@gem-sdk/core 1.42.3-dev.64 → 1.42.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/ComponentToolbarPreview.js +6 -120
- package/dist/cjs/components/ComponentWrapperPreview.js +1 -44
- package/dist/cjs/components/Render.liquid.js +0 -2
- package/dist/cjs/components/RenderCustomCode.js +0 -2
- package/dist/cjs/components/constant.js +2 -19
- package/dist/cjs/components/resize/Spacing.js +0 -2
- package/dist/cjs/components/theme-section/CreateThemeSection.js +0 -2
- package/dist/cjs/contexts/BuilderPreviewContext.js +6 -11
- package/dist/cjs/contexts/SectionContext.js +0 -1
- package/dist/cjs/helpers/carousel.js +10 -7
- package/dist/cjs/helpers/colors.js +1 -1
- package/dist/cjs/helpers/queries/get-products.js +0 -23
- package/dist/cjs/helpers/typography.js +4 -4
- package/dist/cjs/hooks/shop/use-products-query.js +0 -29
- package/dist/cjs/hooks/useAnimations.js +0 -2
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +0 -2
- package/dist/cjs/hooks/useProduct.js +0 -2
- package/dist/cjs/index.js +15 -26
- package/dist/esm/components/ComponentToolbarPreview.js +6 -120
- package/dist/esm/components/ComponentWrapperPreview.js +1 -44
- package/dist/esm/components/Render.liquid.js +0 -2
- package/dist/esm/components/RenderCustomCode.js +0 -2
- package/dist/esm/components/constant.js +3 -19
- package/dist/esm/components/resize/Spacing.js +0 -2
- package/dist/esm/components/theme-section/CreateThemeSection.js +0 -2
- package/dist/esm/contexts/BuilderPreviewContext.js +6 -11
- package/dist/esm/contexts/SectionContext.js +0 -1
- package/dist/esm/helpers/carousel.js +10 -7
- package/dist/esm/helpers/colors.js +1 -1
- package/dist/esm/helpers/queries/get-products.js +1 -23
- package/dist/esm/helpers/typography.js +4 -4
- package/dist/esm/hooks/shop/use-products-query.js +2 -30
- package/dist/esm/hooks/useAnimations.js +0 -2
- package/dist/esm/hooks/useInitialSwatchesOptions.js +0 -2
- package/dist/esm/hooks/useProduct.js +0 -2
- package/dist/esm/index.js +10 -14
- package/dist/types/index.d.ts +86 -227
- package/package.json +3 -5
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +0 -205
- package/dist/cjs/components/ai-generator/AIGenContentLoading.js +0 -85
- package/dist/cjs/components/ai-generator/components/PickProduct.js +0 -218
- package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +0 -77
- package/dist/cjs/components/ai-generator/hooks/useCheckingProductInside.js +0 -47
- package/dist/cjs/components/ai-generator/hooks/useFlipPopup.js +0 -110
- package/dist/cjs/components/ai-generator/hooks/useGettingGenerateRequest.js +0 -37
- package/dist/cjs/components/ai-generator/hooks/useListenEventGenerate.js +0 -63
- package/dist/cjs/components/ai-generator/icons/AIIcon.js +0 -67
- package/dist/cjs/components/ai-generator/icons/CloseIcon.js +0 -19
- package/dist/cjs/components/ai-generator/icons/DropdownIcon.js +0 -37
- package/dist/cjs/components/ai-generator/icons/SearchIcon.js +0 -21
- package/dist/cjs/components/ai-generator/icons/ShowMoreIcon.js +0 -21
- package/dist/cjs/contexts/ArticleContext.js +0 -39
- package/dist/cjs/contexts/ArticleListContext.js +0 -32
- package/dist/cjs/helpers/align.js +0 -19
- package/dist/cjs/hooks/articles/useArticlesQuery.js +0 -152
- package/dist/esm/components/ai-generator/AIContentGenerator.js +0 -203
- package/dist/esm/components/ai-generator/AIGenContentLoading.js +0 -83
- package/dist/esm/components/ai-generator/components/PickProduct.js +0 -216
- package/dist/esm/components/ai-generator/components/ToneAndVoice.js +0 -75
- package/dist/esm/components/ai-generator/hooks/useCheckingProductInside.js +0 -45
- package/dist/esm/components/ai-generator/hooks/useFlipPopup.js +0 -108
- package/dist/esm/components/ai-generator/hooks/useGettingGenerateRequest.js +0 -35
- package/dist/esm/components/ai-generator/hooks/useListenEventGenerate.js +0 -61
- package/dist/esm/components/ai-generator/icons/AIIcon.js +0 -65
- package/dist/esm/components/ai-generator/icons/CloseIcon.js +0 -17
- package/dist/esm/components/ai-generator/icons/DropdownIcon.js +0 -34
- package/dist/esm/components/ai-generator/icons/SearchIcon.js +0 -19
- package/dist/esm/components/ai-generator/icons/ShowMoreIcon.js +0 -19
- package/dist/esm/contexts/ArticleContext.js +0 -36
- package/dist/esm/contexts/ArticleListContext.js +0 -28
- package/dist/esm/helpers/align.js +0 -17
- package/dist/esm/hooks/articles/useArticlesQuery.js +0 -149
|
@@ -78,28 +78,6 @@ const getProductQueryAll = async (fetcher, arg)=>{
|
|
|
78
78
|
const pageData = await fetchProducts(fetcher, variables);
|
|
79
79
|
return pageData;
|
|
80
80
|
};
|
|
81
|
-
const getListProductByVariables = async (fetcher, arg)=>{
|
|
82
|
-
const variables = {
|
|
83
|
-
first: arg.first || 8,
|
|
84
|
-
firstMedia: 1,
|
|
85
|
-
firstVariant: 1,
|
|
86
|
-
orderBy: {
|
|
87
|
-
field: 'PLATFORM_CREATED_AT',
|
|
88
|
-
direction: 'DESC'
|
|
89
|
-
},
|
|
90
|
-
orderByMedia: {
|
|
91
|
-
field: 'POSITION',
|
|
92
|
-
direction: 'ASC'
|
|
93
|
-
},
|
|
94
|
-
where: {
|
|
95
|
-
status: 'ACTIVE',
|
|
96
|
-
...arg.where
|
|
97
|
-
},
|
|
98
|
-
after: arg.after
|
|
99
|
-
};
|
|
100
|
-
const pageData = await fetchProducts(fetcher, variables);
|
|
101
|
-
return pageData;
|
|
102
|
-
};
|
|
103
81
|
const fetchProducts = async (fetcher, variables)=>{
|
|
104
82
|
return fetcher([
|
|
105
83
|
ProductsDocument,
|
|
@@ -207,4 +185,4 @@ const mergeMediasToProducts = async ({ fetcher, products, isSample, isStorefront
|
|
|
207
185
|
// );
|
|
208
186
|
// };
|
|
209
187
|
|
|
210
|
-
export {
|
|
188
|
+
export { getProductQueryAll, getProducts };
|
|
@@ -27,7 +27,7 @@ const composeTypographyV2Css = (typography, isImportant)=>{
|
|
|
27
27
|
${fontSize?.desktop ? `font-size: ${fontSize?.desktop} ${composeImportant};` : ''}
|
|
28
28
|
${bold ? `font-weight: bold ${composeImportant};` : fontWeight ? `font-weight: ${fontWeight} ${composeImportant};` : ''}
|
|
29
29
|
${letterSpacing ? `letter-spacing: ${letterSpacing} ${composeImportant};` : ''}
|
|
30
|
-
${lineHeight
|
|
30
|
+
${lineHeight ? `line-height: ${lineHeight} ${composeImportant};` : ''}
|
|
31
31
|
${italic ? `font-style: italic ${composeImportant};` : ''}
|
|
32
32
|
${underline ? `text-decoration-line: underline ${composeImportant};` : ''}
|
|
33
33
|
${transform ? `text-transform: ${transform} ${composeImportant};` : ''}
|
|
@@ -61,10 +61,10 @@ const composeTypographyV2 = (value, attrs)=>{
|
|
|
61
61
|
fs: !attrs?.italic ? value?.fontStyle : undefined,
|
|
62
62
|
ff: value?.fontFamily ? `var(--g-font-${value.fontFamily.replace(/ /g, '-')}, '${value.fontFamily}'), ${value.fallbackFontFamily}` : undefined,
|
|
63
63
|
weight: !attrs?.bold ? value?.fontWeight : undefined,
|
|
64
|
-
ls: value?.letterSpacing
|
|
64
|
+
ls: value?.letterSpacing,
|
|
65
|
+
lh: value?.lineHeight
|
|
65
66
|
}),
|
|
66
|
-
...makeStyleResponsive('size', value?.fontSize)
|
|
67
|
-
...makeStyleResponsive('lh', value?.lineHeight)
|
|
67
|
+
...makeStyleResponsive('size', value?.fontSize)
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
70
|
const composeTypographyAttr = (attrs)=>{
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import useSWR from 'swr';
|
|
2
|
-
import
|
|
3
|
-
import { getProducts, getProductQueryAll, getListProductByVariables } from '../../helpers/queries/get-products.js';
|
|
2
|
+
import { getProducts, getProductQueryAll } from '../../helpers/queries/get-products.js';
|
|
4
3
|
import { generateProductsQueryKey } from '../../helpers/query.js';
|
|
5
4
|
import { useIsSampleProduct, useIsStorefrontProduct } from '../shop.js';
|
|
6
5
|
import { useFetchHandle } from '../useFetchHandle.js';
|
|
@@ -19,33 +18,6 @@ const useProductsQuery = (ids, options, params)=>{
|
|
|
19
18
|
return getProducts(params?.fetcher || fetcher, arg);
|
|
20
19
|
}, options);
|
|
21
20
|
};
|
|
22
|
-
const getKey = (variable)=>{
|
|
23
|
-
return (pageIndex, previousPageData)=>{
|
|
24
|
-
if (!variable || previousPageData && !previousPageData.products?.pageInfo?.hasNextPage) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
if (pageIndex === 0) {
|
|
28
|
-
return [
|
|
29
|
-
'query/products',
|
|
30
|
-
variable
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
return [
|
|
34
|
-
'query/products',
|
|
35
|
-
{
|
|
36
|
-
...variable,
|
|
37
|
-
after: previousPageData.products?.pageInfo?.endCursor
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
const useListProductQuery = (variable, options)=>{
|
|
43
|
-
const fetcher = useFetchHandle();
|
|
44
|
-
const data = useSWRInfinite(getKey(variable), async ([, arg])=>{
|
|
45
|
-
return getListProductByVariables(fetcher, arg);
|
|
46
|
-
}, options);
|
|
47
|
-
return data;
|
|
48
|
-
};
|
|
49
21
|
const useProductsQueryAll = (variable, options)=>{
|
|
50
22
|
const fetcher = useFetchHandle();
|
|
51
23
|
return useSWR(variable ? [
|
|
@@ -56,4 +28,4 @@ const useProductsQueryAll = (variable, options)=>{
|
|
|
56
28
|
}, options);
|
|
57
29
|
};
|
|
58
30
|
|
|
59
|
-
export {
|
|
31
|
+
export { useProductsQuery, useProductsQueryAll };
|
|
@@ -5,12 +5,10 @@ import 'zustand';
|
|
|
5
5
|
import 'swr';
|
|
6
6
|
import '@gem-sdk/adapter-shopify';
|
|
7
7
|
import 'swr/mutation';
|
|
8
|
-
import 'swr/infinite';
|
|
9
8
|
import 'vanilla-lazyload';
|
|
10
9
|
import './useCartUI.js';
|
|
11
10
|
import 'react-transition-group';
|
|
12
11
|
import '@gem-sdk/core';
|
|
13
|
-
import 'classnames';
|
|
14
12
|
import '../helpers/convert.js';
|
|
15
13
|
|
|
16
14
|
const useAnimations = ()=>{
|
|
@@ -9,12 +9,10 @@ import 'react/jsx-runtime';
|
|
|
9
9
|
import 'zustand';
|
|
10
10
|
import '@gem-sdk/adapter-shopify';
|
|
11
11
|
import 'swr/mutation';
|
|
12
|
-
import 'swr/infinite';
|
|
13
12
|
import 'vanilla-lazyload';
|
|
14
13
|
import './useCartUI.js';
|
|
15
14
|
import 'react-transition-group';
|
|
16
15
|
import '@gem-sdk/core';
|
|
17
|
-
import 'classnames';
|
|
18
16
|
import isBrowser from '../helpers/is-browser.js';
|
|
19
17
|
import '../helpers/convert.js';
|
|
20
18
|
|
|
@@ -6,13 +6,11 @@ import 'swr';
|
|
|
6
6
|
import { usePageStore } from '../contexts/PageContext.js';
|
|
7
7
|
import '@gem-sdk/adapter-shopify';
|
|
8
8
|
import 'swr/mutation';
|
|
9
|
-
import 'swr/infinite';
|
|
10
9
|
import 'vanilla-lazyload';
|
|
11
10
|
import './useCartUI.js';
|
|
12
11
|
import { checkInStock } from '../helpers/variant.js';
|
|
13
12
|
import 'react-transition-group';
|
|
14
13
|
import '@gem-sdk/core';
|
|
15
|
-
import 'classnames';
|
|
16
14
|
import { flattenConnection } from '../helpers/flatten-connection.js';
|
|
17
15
|
import '../helpers/convert.js';
|
|
18
16
|
import { getSelectedVariant } from '../helpers/product.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -14,8 +14,6 @@ export { ShopProvider, useShopStore } from './contexts/ShopContext.js';
|
|
|
14
14
|
export { PageProvider, usePageStore } from './contexts/PageContext.js';
|
|
15
15
|
export { CollectionProvider, useCollectionStore } from './contexts/CollectionContext.js';
|
|
16
16
|
export { ModalProvider, useModalStore } from './contexts/ModalContext.js';
|
|
17
|
-
export { ArticleListProvider, useArticleListStore } from './contexts/ArticleListContext.js';
|
|
18
|
-
export { ArticleProvider, useArticleStore } from './contexts/ArticleContext.js';
|
|
19
17
|
export { PageViewUpDocument } from './graphql/mutations/page-view-up.generated.js';
|
|
20
18
|
export { CollectionDetailFilterDocument } from './graphql/queries/collection-detail-filter.generated.js';
|
|
21
19
|
export { CollectionDocument } from './graphql/queries/collection.generated.js';
|
|
@@ -42,6 +40,16 @@ export { isEmptyChildren } from './helpers/is-empty-children.js';
|
|
|
42
40
|
export { default as isSafari } from './helpers/is-safari.js';
|
|
43
41
|
export { normalizeBuilderData } from './helpers/normalize-builder-data.js';
|
|
44
42
|
export { prefetchQueries } from './helpers/prefetch-queries.js';
|
|
43
|
+
export { validateEmail } from './helpers/email.js';
|
|
44
|
+
export { loadScript } from './helpers/load-script.js';
|
|
45
|
+
export { composeSpacing, getSpacingVariable } from './helpers/spacing.js';
|
|
46
|
+
export { genVariable } from './helpers/css-variable.js';
|
|
47
|
+
import * as fpixel from './helpers/tracking/fpixel.js';
|
|
48
|
+
export { fpixel };
|
|
49
|
+
import * as gtag from './helpers/tracking/gtag.js';
|
|
50
|
+
export { gtag };
|
|
51
|
+
import * as tiktokpixel from './helpers/tracking/tiktokpixel.js';
|
|
52
|
+
export { tiktokpixel };
|
|
45
53
|
export { GRADIENT_BGR_KEY, composeBackgroundCss, getBgImageByDevice, getGradientBgrStyleByDevice, getGradientBgrStyleForButton, getStyleBackgroundByDevice, makeFixedBgAttachment } from './helpers/background.js';
|
|
46
54
|
export { composeTextColorCss, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getSingleColorVariable, isColor } from './helpers/colors.js';
|
|
47
55
|
export { composeAdvanceStyle, composeAdvanceStyleForPostPurchase, filterAttrInStyle, filterCornerInStyle, removeAttrInStyle, removePaddingYInStyle, splitStyle } from './helpers/compose-advance-style.js';
|
|
@@ -51,7 +59,6 @@ export { composePositionLineHeight, composePostionIconList } from './helpers/ico
|
|
|
51
59
|
export { isDefined } from './helpers/is-defined.js';
|
|
52
60
|
export { composeGridLayout, convertOldLayout, gridToArrayRegex, optionLayoutStyle } from './helpers/layout.js';
|
|
53
61
|
export { makeAspectRatio, makeGlobalSizeHeightResponsive, makeGlobalSizeWidthResponsive, makeHeight, makeLineClamp, makeStyle, makeStyleKey, makeStyleResponsive, makeStyleResponsiveByScreen, makeStyleResponsiveState, makeStyleState, makeWidth, removeNullUndefined } from './helpers/make-style.js';
|
|
54
|
-
export { convertTextAlignToJustify } from './helpers/align.js';
|
|
55
62
|
export { checkAvailableVariantInStock, getSelectedVariant, parseSelectedOption } from './helpers/product.js';
|
|
56
63
|
export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey } from './helpers/query.js';
|
|
57
64
|
export { composeCornerCss, composeRadius, composeRadiusResponsive, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
|
|
@@ -59,16 +66,6 @@ export { RenderIf, composeMemo, dataStringify, props, removeUndefinedValuesFromO
|
|
|
59
66
|
export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
|
|
60
67
|
export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeGlobalSizeIcon, makeStyleWithDefault } from './helpers/size.js';
|
|
61
68
|
export { composeFallbackTypographyStyle, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass } from './helpers/typography.js';
|
|
62
|
-
export { validateEmail } from './helpers/email.js';
|
|
63
|
-
export { loadScript } from './helpers/load-script.js';
|
|
64
|
-
export { composeSpacing, getSpacingVariable } from './helpers/spacing.js';
|
|
65
|
-
export { genVariable } from './helpers/css-variable.js';
|
|
66
|
-
import * as fpixel from './helpers/tracking/fpixel.js';
|
|
67
|
-
export { fpixel };
|
|
68
|
-
import * as gtag from './helpers/tracking/gtag.js';
|
|
69
|
-
export { gtag };
|
|
70
|
-
import * as tiktokpixel from './helpers/tracking/tiktokpixel.js';
|
|
71
|
-
export { tiktokpixel };
|
|
72
69
|
export { useAddToCart } from './hooks/cart/use-add-to-cart.js';
|
|
73
70
|
export { useCartData } from './hooks/cart/use-cart-data.js';
|
|
74
71
|
export { useCartDiscountCodesUpdate } from './hooks/cart/use-cart-discount-codes-update.js';
|
|
@@ -93,7 +90,6 @@ export { default as useIsomorphicLayoutEffect } from './hooks/useIsomorphicLayou
|
|
|
93
90
|
export { default as useLoadScript } from './hooks/useLoadScript.js';
|
|
94
91
|
export { default as useMoney } from './hooks/useMoney.js';
|
|
95
92
|
export { usePrevious } from './hooks/usePrevious.js';
|
|
96
|
-
export { useArticlesQuery, useBlogsQuery } from './hooks/articles/useArticlesQuery.js';
|
|
97
93
|
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useIsSyncProduct, useProduct, useProductOfferDiscount, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants } from './hooks/useProduct.js';
|
|
98
94
|
export { useProductList, useProductListProducts, useProductListSettings, useProductListStyles } from './hooks/useProductList.js';
|
|
99
95
|
export { default as useSuspenseFetch } from './hooks/useSuspenseFetch.js';
|