@gem-sdk/core 1.14.0-next.96 → 1.14.0
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 +18 -1
- package/dist/cjs/components/ComponentWrapper.js +28 -1
- package/dist/cjs/components/ComponentWrapperPreview.js +72 -1
- package/dist/cjs/components/Empty.js +7 -1
- package/dist/cjs/components/Render.js +65 -1
- package/dist/cjs/components/Render.liquid.js +158 -3
- package/dist/cjs/components/RenderBlock.js +54 -1
- package/dist/cjs/components/RenderPreview.js +66 -1
- package/dist/cjs/components/RenderSection.js +23 -1
- package/dist/cjs/components/constant.js +39 -1
- package/dist/cjs/contexts/AddonContext.js +36 -1
- package/dist/cjs/contexts/BuilderComponent.js +34 -1
- package/dist/cjs/contexts/BuilderContext.js +35 -1
- package/dist/cjs/contexts/BuilderPreviewContext.js +370 -1
- package/dist/cjs/contexts/CartLineContext.js +29 -1
- package/dist/cjs/contexts/CollectionContext.js +38 -1
- package/dist/cjs/contexts/ModalContext.js +47 -1
- package/dist/cjs/contexts/ProductContext.js +149 -1
- package/dist/cjs/contexts/ProductListContext.js +32 -1
- package/dist/cjs/contexts/SectionContext.js +53 -1
- package/dist/cjs/contexts/ShopContext.js +70 -1
- package/dist/cjs/graphql/fragments/analytic.generated.js +6 -2
- package/dist/cjs/graphql/fragments/collection-detail.generated.js +6 -2
- package/dist/cjs/graphql/fragments/collection-product.generated.js +6 -2
- package/dist/cjs/graphql/fragments/collection.generated.js +6 -2
- package/dist/cjs/graphql/fragments/custom-code.generated.js +6 -2
- package/dist/cjs/graphql/fragments/data-seo.generated.js +6 -2
- package/dist/cjs/graphql/fragments/media.generated.js +6 -3
- package/dist/cjs/graphql/fragments/product-little.generated.js +6 -2
- package/dist/cjs/graphql/fragments/product-option-value.generated.js +6 -2
- package/dist/cjs/graphql/fragments/product-option.generated.js +6 -2
- package/dist/cjs/graphql/fragments/product.generated.js +6 -2
- package/dist/cjs/graphql/fragments/published-custom-section.generated.js +6 -2
- package/dist/cjs/graphql/fragments/published-page-section.generated.js +6 -2
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +6 -2
- package/dist/cjs/graphql/fragments/published-theme-style.generated.js +6 -2
- package/dist/cjs/graphql/fragments/selected-option.generated.js +6 -2
- package/dist/cjs/graphql/fragments/variant.generated.js +6 -2
- package/dist/cjs/graphql/mutations/page-view-up.generated.js +7 -3
- package/dist/cjs/graphql/queries/collection-detail-filter.generated.js +16 -2
- package/dist/cjs/graphql/queries/collection.generated.js +14 -2
- package/dist/cjs/graphql/queries/collections.generated.js +9 -2
- package/dist/cjs/graphql/queries/preview-page.generated.js +14 -2
- package/dist/cjs/graphql/queries/product-little-detail.generated.js +11 -2
- package/dist/cjs/graphql/queries/product-medias.generated.js +8 -2
- package/dist/cjs/graphql/queries/product-variants.generated.js +10 -2
- package/dist/cjs/graphql/queries/products.generated.js +17 -3
- package/dist/cjs/graphql/queries/published-theme-pages.generated.js +14 -2
- package/dist/cjs/graphql/queries/store-property.generated.js +6 -2
- package/dist/cjs/helpers/GlobalEvent.js +19 -1
- package/dist/cjs/helpers/background.js +109 -1
- package/dist/cjs/helpers/borders.js +183 -4
- package/dist/cjs/helpers/clone-deep.js +5 -1
- package/dist/cjs/helpers/cls.js +16 -1
- package/dist/cjs/helpers/colors.js +183 -1
- package/dist/cjs/helpers/compose-advance-style.js +188 -1
- package/dist/cjs/helpers/constant.js +23 -1
- package/dist/cjs/helpers/convert.js +7 -1
- package/dist/cjs/helpers/css-variable.js +7 -1
- package/dist/cjs/helpers/email.js +11 -1
- package/dist/cjs/helpers/flatten-connection.js +9 -1
- package/dist/cjs/helpers/get-resonsive-value.js +31 -1
- package/dist/cjs/helpers/get-shortname.js +92 -1
- package/dist/cjs/helpers/is-browser.js +9 -1
- package/dist/cjs/helpers/is-defined.js +7 -1
- package/dist/cjs/helpers/is-empty-children.js +12 -1
- package/dist/cjs/helpers/is-safari.js +9 -1
- package/dist/cjs/helpers/layout.js +59 -1
- package/dist/cjs/helpers/load-script.js +31 -1
- package/dist/cjs/helpers/make-style.js +128 -1
- package/dist/cjs/helpers/normalize-builder-data.js +23 -1
- package/dist/cjs/helpers/prefetch-queries.js +78 -1
- package/dist/cjs/helpers/product.js +45 -1
- package/dist/cjs/helpers/queries/get-collection.js +220 -1
- package/dist/cjs/helpers/queries/get-collections.js +21 -1
- package/dist/cjs/helpers/queries/get-product-by-slug.js +125 -1
- package/dist/cjs/helpers/queries/get-product.js +154 -1
- package/dist/cjs/helpers/queries/get-products.js +161 -1
- package/dist/cjs/helpers/query.js +29 -1
- package/dist/cjs/helpers/radius.js +131 -6
- package/dist/cjs/helpers/render.js +71 -1
- package/dist/cjs/helpers/shadow.js +56 -1
- package/dist/cjs/helpers/size.js +35 -4
- package/dist/cjs/helpers/spacing.js +43 -1
- package/dist/cjs/helpers/tracking/fpixel.js +28 -1
- package/dist/cjs/helpers/tracking/gtag.js +93 -1
- package/dist/cjs/helpers/tracking/tiktokpixel.js +17 -1
- package/dist/cjs/helpers/typography.js +105 -17
- package/dist/cjs/helpers/variant.js +8 -1
- package/dist/cjs/hooks/cart/use-add-to-cart.js +20 -1
- package/dist/cjs/hooks/cart/use-cart-data.js +28 -1
- package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +20 -1
- package/dist/cjs/hooks/cart/use-cart-note-update.js +20 -1
- package/dist/cjs/hooks/cart/use-create-cart.js +22 -1
- package/dist/cjs/hooks/cart/use-remove-cart-item.js +20 -1
- package/dist/cjs/hooks/cart/use-update-cart-item.js +20 -1
- package/dist/cjs/hooks/shop/use-collection-query.js +22 -1
- package/dist/cjs/hooks/shop/use-collections-query.js +17 -1
- package/dist/cjs/hooks/shop/use-product-query.js +22 -1
- package/dist/cjs/hooks/shop/use-products-query.js +22 -1
- package/dist/cjs/hooks/shop.js +126 -1
- package/dist/cjs/hooks/use-current-device.js +21 -1
- package/dist/cjs/hooks/use-lazy-video.js +15 -1
- package/dist/cjs/hooks/useCartId.js +44 -1
- package/dist/cjs/hooks/useCartLine.js +11 -1
- package/dist/cjs/hooks/useCartUI.js +48 -1
- package/dist/cjs/hooks/useCollection.js +9 -1
- package/dist/cjs/hooks/useFetchHandle.js +13 -1
- package/dist/cjs/hooks/useFormatMoney.js +58 -1
- package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +10 -1
- package/dist/cjs/hooks/useLoadScript.js +32 -1
- package/dist/cjs/hooks/useMoney.js +84 -1
- package/dist/cjs/hooks/usePrevious.js +19 -1
- package/dist/cjs/hooks/useProduct.js +124 -1
- package/dist/cjs/hooks/useProductList.js +21 -1
- package/dist/cjs/hooks/useSuspenseFetch.js +27 -1
- package/dist/cjs/hooks/useSwatchesOptions.js +41 -1
- package/dist/cjs/index.js +291 -1
- package/dist/cjs/types/global-style.js +14 -1
- package/dist/cjs/types/shop.js +2 -1
- package/dist/esm/components/AddOn.js +14 -1
- package/dist/esm/components/ComponentWrapper.js +24 -1
- package/dist/esm/components/ComponentWrapperPreview.js +68 -1
- package/dist/esm/components/Empty.js +3 -1
- package/dist/esm/components/Render.js +61 -1
- package/dist/esm/components/Render.liquid.js +153 -3
- package/dist/esm/components/RenderBlock.js +50 -1
- package/dist/esm/components/RenderPreview.js +62 -1
- package/dist/esm/components/RenderSection.js +19 -1
- package/dist/esm/components/constant.js +37 -1
- package/dist/esm/contexts/AddonContext.js +32 -1
- package/dist/esm/contexts/BuilderComponent.js +31 -1
- package/dist/esm/contexts/BuilderContext.js +32 -1
- package/dist/esm/contexts/BuilderPreviewContext.js +367 -1
- package/dist/esm/contexts/CartLineContext.js +26 -1
- package/dist/esm/contexts/CollectionContext.js +35 -1
- package/dist/esm/contexts/ModalContext.js +44 -1
- package/dist/esm/contexts/ProductContext.js +146 -1
- package/dist/esm/contexts/ProductListContext.js +28 -1
- package/dist/esm/contexts/SectionContext.js +49 -1
- package/dist/esm/contexts/ShopContext.js +67 -1
- package/dist/esm/graphql/fragments/analytic.generated.js +4 -2
- package/dist/esm/graphql/fragments/collection-detail.generated.js +4 -2
- package/dist/esm/graphql/fragments/collection-product.generated.js +4 -2
- package/dist/esm/graphql/fragments/collection.generated.js +4 -2
- package/dist/esm/graphql/fragments/custom-code.generated.js +4 -2
- package/dist/esm/graphql/fragments/data-seo.generated.js +4 -2
- package/dist/esm/graphql/fragments/media.generated.js +4 -3
- package/dist/esm/graphql/fragments/product-little.generated.js +4 -2
- package/dist/esm/graphql/fragments/product-option-value.generated.js +4 -2
- package/dist/esm/graphql/fragments/product-option.generated.js +4 -2
- package/dist/esm/graphql/fragments/product.generated.js +4 -2
- package/dist/esm/graphql/fragments/published-custom-section.generated.js +4 -2
- package/dist/esm/graphql/fragments/published-page-section.generated.js +4 -2
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +4 -2
- package/dist/esm/graphql/fragments/published-theme-style.generated.js +4 -2
- package/dist/esm/graphql/fragments/selected-option.generated.js +4 -2
- package/dist/esm/graphql/fragments/variant.generated.js +4 -2
- package/dist/esm/graphql/mutations/page-view-up.generated.js +5 -3
- package/dist/esm/graphql/queries/collection-detail-filter.generated.js +22 -10
- package/dist/esm/graphql/queries/collection.generated.js +18 -8
- package/dist/esm/graphql/queries/collections.generated.js +8 -3
- package/dist/esm/graphql/queries/preview-page.generated.js +18 -8
- package/dist/esm/graphql/queries/product-little-detail.generated.js +12 -5
- package/dist/esm/graphql/queries/product-medias.generated.js +6 -2
- package/dist/esm/graphql/queries/product-variants.generated.js +10 -4
- package/dist/esm/graphql/queries/products.generated.js +20 -9
- package/dist/esm/graphql/queries/published-theme-pages.generated.js +18 -8
- package/dist/esm/graphql/queries/store-property.generated.js +4 -2
- package/dist/esm/helpers/GlobalEvent.js +15 -1
- package/dist/esm/helpers/background.js +106 -1
- package/dist/esm/helpers/borders.js +175 -4
- package/dist/esm/helpers/clone-deep.js +3 -1
- package/dist/esm/helpers/cls.js +14 -1
- package/dist/esm/helpers/colors.js +168 -1
- package/dist/esm/helpers/compose-advance-style.js +185 -1
- package/dist/esm/helpers/constant.js +19 -1
- package/dist/esm/helpers/convert.js +4 -1
- package/dist/esm/helpers/css-variable.js +5 -1
- package/dist/esm/helpers/email.js +6 -1
- package/dist/esm/helpers/flatten-connection.js +7 -1
- package/dist/esm/helpers/get-resonsive-value.js +27 -1
- package/dist/esm/helpers/get-shortname.js +90 -1
- package/dist/esm/helpers/is-browser.js +5 -1
- package/dist/esm/helpers/is-defined.js +5 -1
- package/dist/esm/helpers/is-empty-children.js +7 -1
- package/dist/esm/helpers/is-safari.js +5 -1
- package/dist/esm/helpers/layout.js +54 -1
- package/dist/esm/helpers/load-script.js +29 -1
- package/dist/esm/helpers/make-style.js +117 -1
- package/dist/esm/helpers/normalize-builder-data.js +21 -1
- package/dist/esm/helpers/prefetch-queries.js +76 -1
- package/dist/esm/helpers/product.js +41 -1
- package/dist/esm/helpers/queries/get-collection.js +217 -1
- package/dist/esm/helpers/queries/get-collections.js +19 -1
- package/dist/esm/helpers/queries/get-product-by-slug.js +123 -1
- package/dist/esm/helpers/queries/get-product.js +150 -1
- package/dist/esm/helpers/queries/get-products.js +159 -1
- package/dist/esm/helpers/query.js +25 -1
- package/dist/esm/helpers/radius.js +124 -6
- package/dist/esm/helpers/render.js +64 -1
- package/dist/esm/helpers/shadow.js +51 -1
- package/dist/esm/helpers/size.js +31 -4
- package/dist/esm/helpers/spacing.js +40 -1
- package/dist/esm/helpers/tracking/fpixel.js +24 -1
- package/dist/esm/helpers/tracking/gtag.js +87 -1
- package/dist/esm/helpers/tracking/tiktokpixel.js +15 -1
- package/dist/esm/helpers/typography.js +96 -17
- package/dist/esm/helpers/variant.js +6 -1
- package/dist/esm/hooks/cart/use-add-to-cart.js +18 -1
- package/dist/esm/hooks/cart/use-cart-data.js +26 -1
- package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +18 -1
- package/dist/esm/hooks/cart/use-cart-note-update.js +18 -1
- package/dist/esm/hooks/cart/use-create-cart.js +20 -1
- package/dist/esm/hooks/cart/use-remove-cart-item.js +18 -1
- package/dist/esm/hooks/cart/use-update-cart-item.js +18 -1
- package/dist/esm/hooks/shop/use-collection-query.js +20 -1
- package/dist/esm/hooks/shop/use-collections-query.js +15 -1
- package/dist/esm/hooks/shop/use-product-query.js +20 -1
- package/dist/esm/hooks/shop/use-products-query.js +20 -1
- package/dist/esm/hooks/shop.js +111 -1
- package/dist/esm/hooks/use-current-device.js +19 -1
- package/dist/esm/hooks/use-lazy-video.js +13 -1
- package/dist/esm/hooks/useCartId.js +40 -1
- package/dist/esm/hooks/useCartLine.js +7 -1
- package/dist/esm/hooks/useCartUI.js +44 -1
- package/dist/esm/hooks/useCollection.js +7 -1
- package/dist/esm/hooks/useFetchHandle.js +11 -1
- package/dist/esm/hooks/useFormatMoney.js +56 -1
- package/dist/esm/hooks/useIsomorphicLayoutEffect.js +6 -1
- package/dist/esm/hooks/useLoadScript.js +28 -1
- package/dist/esm/hooks/useMoney.js +80 -1
- package/dist/esm/hooks/usePrevious.js +17 -1
- package/dist/esm/hooks/useProduct.js +111 -1
- package/dist/esm/hooks/useProductList.js +16 -1
- package/dist/esm/hooks/useSuspenseFetch.js +23 -1
- package/dist/esm/hooks/useSwatchesOptions.js +37 -1
- package/dist/esm/index.js +92 -1
- package/dist/esm/types/global-style.js +11 -1
- package/dist/types/index.d.ts +26 -28
- package/package.json +2 -2
|
@@ -1 +1,183 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
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 +1,188 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
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 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
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 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
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 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
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 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
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 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
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 +1,92 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
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 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function isBrowser() {
|
|
6
|
+
return typeof window !== 'undefined';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
exports.default = isBrowser;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
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 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
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;
|