@gem-sdk/core 1.13.38 → 1.14.0-dev.284
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 -31
- 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 -127
- 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 -290
- 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 -28
- 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 -114
- 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 +1213 -1031
- package/package.json +5 -5
|
@@ -1,49 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useStore, createStore } from 'zustand';
|
|
3
|
-
import { useContext, createContext } from 'react';
|
|
4
|
-
import { cloneDeep } from '../helpers/clone-deep.js';
|
|
5
|
-
import { normalizeBuilderData } from '../helpers/normalize-builder-data.js';
|
|
6
|
-
|
|
7
|
-
const SectionContext = /*#__PURE__*/ createContext(null);
|
|
8
|
-
const createSectionProvider = (data)=>createStore((set, get)=>({
|
|
9
|
-
data: data ?? {},
|
|
10
|
-
getSection: (id)=>{
|
|
11
|
-
const section = get().data[id];
|
|
12
|
-
return section ?? undefined;
|
|
13
|
-
},
|
|
14
|
-
addSection: (id, data)=>{
|
|
15
|
-
const item = normalizeBuilderData(data);
|
|
16
|
-
set((prev)=>({
|
|
17
|
-
data: {
|
|
18
|
-
...prev.data,
|
|
19
|
-
[id]: cloneDeep(item)
|
|
20
|
-
}
|
|
21
|
-
}));
|
|
22
|
-
},
|
|
23
|
-
removeSection: (id)=>{
|
|
24
|
-
set((prev)=>{
|
|
25
|
-
const { [id]: _ , ...rest } = prev.data;
|
|
26
|
-
return {
|
|
27
|
-
data: rest
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}));
|
|
32
|
-
const SectionProvider = ({ children , data , ...passProps })=>{
|
|
33
|
-
return /*#__PURE__*/ jsx(SectionContext.Provider, {
|
|
34
|
-
...passProps,
|
|
35
|
-
value: createSectionProvider(data),
|
|
36
|
-
children: children
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
// export const useSectionStore = useStore;
|
|
40
|
-
const useSectionStore = (selector, equalityFn)=>{
|
|
41
|
-
const store = useContext(SectionContext);
|
|
42
|
-
if (!store) {
|
|
43
|
-
throw new Error('useSectionStore must be used within a SectionProvider');
|
|
44
|
-
}
|
|
45
|
-
return useStore(store, selector, equalityFn);
|
|
46
|
-
};
|
|
47
|
-
const useSection = (id)=>useSectionStore((s)=>s.getSection(id));
|
|
48
|
-
|
|
49
|
-
export { SectionProvider, useSection, useSectionStore };
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useStore as t,createStore as o}from"zustand";import{useContext as r,createContext as i}from"react";import{cloneDeep as n}from"../helpers/clone-deep.js";import{normalizeBuilderData as c}from"../helpers/normalize-builder-data.js";let SectionContext=i(null),createSectionProvider=e=>o((t,o)=>({data:e??{},getSection:e=>{let t=o().data[e];return t??void 0},addSection:(e,o)=>{let r=c(o);t(t=>({data:{...t.data,[e]:n(r)}}))},removeSection:e=>{t(t=>{let{[e]:o,...r}=t.data;return{data:r}})}})),SectionProvider=({children:t,data:o,...r})=>e(SectionContext.Provider,{...r,value:createSectionProvider(o),children:t}),useSectionStore=(e,o)=>{let i=r(SectionContext);if(!i)throw Error("useSectionStore must be used within a SectionProvider");return t(i,e,o)},useSection=e=>useSectionStore(t=>t.getSection(e));export{SectionProvider,useSection,useSectionStore};
|
|
@@ -1,67 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SWRConfig } from 'swr';
|
|
3
|
-
import { useStore, createStore } from 'zustand';
|
|
4
|
-
import { useMemo, useContext, createContext } from 'react';
|
|
5
|
-
import { AddonProvider } from './AddonContext.js';
|
|
6
|
-
import { ModalProvider } from './ModalContext.js';
|
|
7
|
-
|
|
8
|
-
const ShopContext = /*#__PURE__*/ createContext(null);
|
|
9
|
-
const createShopStoreProvider = (data)=>createStore((set)=>({
|
|
10
|
-
mobileOnly: false,
|
|
11
|
-
isStorefront: true,
|
|
12
|
-
...data,
|
|
13
|
-
changeLocale: (locale)=>{
|
|
14
|
-
set({
|
|
15
|
-
locale
|
|
16
|
-
});
|
|
17
|
-
},
|
|
18
|
-
changeCurrency: (currency)=>{
|
|
19
|
-
set({
|
|
20
|
-
currency
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
changeSwatches: (swatches)=>{
|
|
24
|
-
set({
|
|
25
|
-
swatches
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
changeLayoutSettings: (layoutSettings)=>{
|
|
29
|
-
set({
|
|
30
|
-
layoutSettings
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
changeStorefrontInfo: ({ url , token })=>{
|
|
34
|
-
set({
|
|
35
|
-
storefrontUrl: url,
|
|
36
|
-
storefrontToken: token
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}));
|
|
40
|
-
const ShopProvider = ({ children , addons , storeOption , queryOption , ...passProps })=>{
|
|
41
|
-
const store = useMemo(()=>createShopStoreProvider(storeOption), [
|
|
42
|
-
storeOption
|
|
43
|
-
]);
|
|
44
|
-
return /*#__PURE__*/ jsx(AddonProvider, {
|
|
45
|
-
components: addons,
|
|
46
|
-
children: /*#__PURE__*/ jsx(SWRConfig, {
|
|
47
|
-
value: queryOption,
|
|
48
|
-
children: /*#__PURE__*/ jsx(ShopContext.Provider, {
|
|
49
|
-
...passProps,
|
|
50
|
-
value: store,
|
|
51
|
-
children: /*#__PURE__*/ jsx(ModalProvider, {
|
|
52
|
-
children: children
|
|
53
|
-
})
|
|
54
|
-
}, JSON.stringify(storeOption))
|
|
55
|
-
})
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
// export const useShopStore = useStore;
|
|
59
|
-
const useShopStore = (selector, equalityFn)=>{
|
|
60
|
-
const store = useContext(ShopContext);
|
|
61
|
-
if (!store) {
|
|
62
|
-
throw new Error('useShopStore must be used within a ShopProvider');
|
|
63
|
-
}
|
|
64
|
-
return useStore(store, selector, equalityFn);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export { ShopProvider, useShopStore };
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{SWRConfig as o}from"swr";import{useStore as e,createStore as t}from"zustand";import{useMemo as n,useContext as i,createContext as h}from"react";import{AddonProvider as S}from"./AddonContext.js";import{ModalProvider as p}from"./ModalContext.js";let ShopContext=h(null),createShopStoreProvider=r=>t(o=>({mobileOnly:!1,isStorefront:!0,...r,changeLocale:r=>{o({locale:r})},changeCurrency:r=>{o({currency:r})},changeSwatches:r=>{o({swatches:r})},changeLayoutSettings:r=>{o({layoutSettings:r})},changeStorefrontInfo:({url:r,token:e})=>{o({storefrontUrl:r,storefrontToken:e})}})),ShopProvider=({children:e,addons:t,storeOption:i,queryOption:h,...a})=>{let c=n(()=>createShopStoreProvider(i),[i]);return r(S,{components:t,children:r(o,{value:h,children:r(ShopContext.Provider,{...a,value:c,children:r(p,{children:e})},JSON.stringify(i))})})},useShopStore=(r,o)=>{let t=i(ShopContext);if(!t)throw Error("useShopStore must be used within a ShopProvider");return e(t,r,o)};export{ShopProvider,useShopStore};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
let CollectionDetailSelect=`
|
|
2
2
|
fragment CollectionDetailSelect on Collection {
|
|
3
3
|
id
|
|
4
4
|
createdAt
|
|
@@ -20,6 +20,4 @@
|
|
|
20
20
|
isStorefront
|
|
21
21
|
isSample
|
|
22
22
|
}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
export { CollectionDetailSelect };
|
|
23
|
+
`;export{CollectionDetailSelect};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
let CollectionProductSelect=`
|
|
2
2
|
fragment CollectionProductSelect on Collection {
|
|
3
3
|
...CollectionDetailSelect
|
|
4
4
|
products(
|
|
@@ -19,6 +19,4 @@
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
export { CollectionProductSelect };
|
|
22
|
+
`;export{CollectionProductSelect};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
let CollectionSelect=`
|
|
2
2
|
fragment CollectionSelect on Collection {
|
|
3
3
|
...CollectionDetailSelect
|
|
4
4
|
products {
|
|
@@ -17,6 +17,4 @@
|
|
|
17
17
|
totalCount
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
export { CollectionSelect };
|
|
20
|
+
`;export{CollectionSelect};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
let ProductLittleSelect=`
|
|
2
2
|
fragment ProductLittleSelect on Product {
|
|
3
3
|
id
|
|
4
4
|
title
|
|
@@ -18,6 +18,4 @@
|
|
|
18
18
|
...MediaSelect
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
export { ProductLittleSelect };
|
|
21
|
+
`;export{ProductLittleSelect};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
let ProductOptionValueSelect=`
|
|
2
2
|
fragment ProductOptionValueSelect on ProductOptionValue {
|
|
3
3
|
id
|
|
4
4
|
label
|
|
5
5
|
isDefault
|
|
6
6
|
baseID
|
|
7
7
|
}
|
|
8
|
-
`;
|
|
9
|
-
|
|
10
|
-
export { ProductOptionValueSelect };
|
|
8
|
+
`;export{ProductOptionValueSelect};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
let ProductOptionSelect=`
|
|
2
2
|
fragment ProductOptionSelect on ProductOption {
|
|
3
3
|
id
|
|
4
4
|
name
|
|
@@ -7,6 +7,4 @@
|
|
|
7
7
|
...ProductOptionValueSelect
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
export { ProductOptionSelect };
|
|
10
|
+
`;export{ProductOptionSelect};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
let ProductSelect=`
|
|
2
2
|
fragment ProductSelect on Product {
|
|
3
3
|
...ProductLittleSelect
|
|
4
4
|
medias(first: $firstMedia, after: $afterMedia, orderBy: $orderByMedia) {
|
|
@@ -26,6 +26,4 @@
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
|
-
export { ProductSelect };
|
|
29
|
+
`;export{ProductSelect};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
let PublishedCustomSectionSelect=`
|
|
2
2
|
fragment PublishedCustomSectionSelect on PublishedCustomSection {
|
|
3
3
|
cid
|
|
4
4
|
component
|
|
5
5
|
id
|
|
6
6
|
type
|
|
7
7
|
}
|
|
8
|
-
`;
|
|
9
|
-
|
|
10
|
-
export { PublishedCustomSectionSelect };
|
|
8
|
+
`;export{PublishedCustomSectionSelect};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
let PublishedPageSectionSelect=`
|
|
2
2
|
fragment PublishedPageSectionSelect on PublishedPageSection {
|
|
3
3
|
cid
|
|
4
4
|
component
|
|
5
5
|
id
|
|
6
6
|
}
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
export { PublishedPageSectionSelect };
|
|
7
|
+
`;export{PublishedPageSectionSelect};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
let PublishedThemePageSelect=`
|
|
2
2
|
fragment PublishedThemePageSelect on PublishedThemePage {
|
|
3
3
|
id
|
|
4
4
|
name
|
|
@@ -24,6 +24,4 @@
|
|
|
24
24
|
...CustomCodeSelect
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
export { PublishedThemePageSelect };
|
|
27
|
+
`;export{PublishedThemePageSelect};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
let PublishedThemeStyleSelect=`
|
|
2
2
|
fragment PublishedThemeStyleSelect on PublishedThemeStyle {
|
|
3
3
|
id
|
|
4
4
|
data
|
|
5
5
|
name
|
|
6
6
|
}
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
export { PublishedThemeStyleSelect };
|
|
7
|
+
`;export{PublishedThemeStyleSelect};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
mutation pageViewUp($pageHandle: String!, $userAgent: String
|
|
1
|
+
let PageViewUpDocument=`
|
|
2
|
+
mutation pageViewUp($pageHandle: String!, $userAgent: String) {
|
|
3
3
|
pageViewUp(pageHandle: $pageHandle, userAgent: $userAgent)
|
|
4
4
|
}
|
|
5
|
-
`;
|
|
6
|
-
|
|
7
|
-
export { PageViewUpDocument };
|
|
5
|
+
`;export{PageViewUpDocument};
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CollectionDetailSelect } from '../fragments/collection-detail.generated.js';
|
|
3
|
-
import { ProductSelect } from '../fragments/product.generated.js';
|
|
4
|
-
import { ProductLittleSelect } from '../fragments/product-little.generated.js';
|
|
5
|
-
import { ProductOptionSelect } from '../fragments/product-option.generated.js';
|
|
6
|
-
import { ProductOptionValueSelect } from '../fragments/product-option-value.generated.js';
|
|
7
|
-
import { MediaSelect } from '../fragments/media.generated.js';
|
|
8
|
-
import { VariantSelect } from '../fragments/variant.generated.js';
|
|
9
|
-
import { SelectedOptionSelect } from '../fragments/selected-option.generated.js';
|
|
10
|
-
|
|
11
|
-
const CollectionDetailFilterDocument = `
|
|
1
|
+
import{CollectionProductSelect as e}from"../fragments/collection-product.generated.js";import{CollectionDetailSelect as r}from"../fragments/collection-detail.generated.js";import{ProductSelect as t}from"../fragments/product.generated.js";import{ProductLittleSelect as o}from"../fragments/product-little.generated.js";import{ProductOptionSelect as i}from"../fragments/product-option.generated.js";import{ProductOptionValueSelect as n}from"../fragments/product-option-value.generated.js";import{MediaSelect as d}from"../fragments/media.generated.js";import{VariantSelect as a}from"../fragments/variant.generated.js";import{SelectedOptionSelect as l}from"../fragments/selected-option.generated.js";let CollectionDetailFilterDocument=`
|
|
12
2
|
query collectionDetailFilter($firstProduct: Int = 10, $orderBy: CollectionOrder, $where: CollectionWhereInput, $orderByProduct: ProductOrder, $productsAfter: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor, $firstMedia: Int, $orderByMedia: MediaOrder, $whereProduct: ProductWhereInput) {
|
|
13
3
|
collections(first: 1, orderBy: $orderBy, where: $where) {
|
|
14
4
|
edges {
|
|
@@ -19,14 +9,12 @@ const CollectionDetailFilterDocument = `
|
|
|
19
9
|
}
|
|
20
10
|
}
|
|
21
11
|
}
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
${
|
|
27
|
-
${
|
|
28
|
-
${
|
|
29
|
-
${
|
|
30
|
-
${
|
|
31
|
-
|
|
32
|
-
export { CollectionDetailFilterDocument };
|
|
12
|
+
${e}
|
|
13
|
+
${r}
|
|
14
|
+
${t}
|
|
15
|
+
${o}
|
|
16
|
+
${i}
|
|
17
|
+
${n}
|
|
18
|
+
${d}
|
|
19
|
+
${a}
|
|
20
|
+
${l}`;export{CollectionDetailFilterDocument};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ProductLittleSelect } from '../fragments/product-little.generated.js';
|
|
3
|
-
import { ProductOptionSelect } from '../fragments/product-option.generated.js';
|
|
4
|
-
import { ProductOptionValueSelect } from '../fragments/product-option-value.generated.js';
|
|
5
|
-
import { MediaSelect } from '../fragments/media.generated.js';
|
|
6
|
-
import { VariantSelect } from '../fragments/variant.generated.js';
|
|
7
|
-
import { SelectedOptionSelect } from '../fragments/selected-option.generated.js';
|
|
8
|
-
|
|
9
|
-
const CollectionDocument = `
|
|
1
|
+
import{ProductSelect as e}from"../fragments/product.generated.js";import{ProductLittleSelect as t}from"../fragments/product-little.generated.js";import{ProductOptionSelect as r}from"../fragments/product-option.generated.js";import{ProductOptionValueSelect as o}from"../fragments/product-option-value.generated.js";import{MediaSelect as a}from"../fragments/media.generated.js";import{VariantSelect as i}from"../fragments/variant.generated.js";import{SelectedOptionSelect as n}from"../fragments/selected-option.generated.js";let CollectionDocument=`
|
|
10
2
|
query collection($first: Int = 5, $firstMedia: Int = 20, $orderByMedia: MediaOrder, $afterMedia: Cursor, $firstVariant: Int = 20, $afterVariant: Cursor, $handle: String, $id: ID) {
|
|
11
3
|
collection(handle: $handle, id: $id) {
|
|
12
4
|
baseID
|
|
@@ -39,12 +31,10 @@ const CollectionDocument = `
|
|
|
39
31
|
updatedAt
|
|
40
32
|
}
|
|
41
33
|
}
|
|
42
|
-
${
|
|
43
|
-
${
|
|
44
|
-
${
|
|
45
|
-
${
|
|
46
|
-
${
|
|
47
|
-
${
|
|
48
|
-
${
|
|
49
|
-
|
|
50
|
-
export { CollectionDocument };
|
|
34
|
+
${e}
|
|
35
|
+
${t}
|
|
36
|
+
${r}
|
|
37
|
+
${o}
|
|
38
|
+
${a}
|
|
39
|
+
${i}
|
|
40
|
+
${n}`;export{CollectionDocument};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CollectionDetailSelect } from '../fragments/collection-detail.generated.js';
|
|
3
|
-
|
|
4
|
-
const CollectionsDocument = `
|
|
1
|
+
import{CollectionSelect as e}from"../fragments/collection.generated.js";import{CollectionDetailSelect as r}from"../fragments/collection-detail.generated.js";let CollectionsDocument=`
|
|
5
2
|
query Collections($after: Cursor, $first: Int, $before: Cursor, $last: Int, $where: CollectionWhereInput, $orderBy: CollectionOrder) {
|
|
6
3
|
collections(
|
|
7
4
|
after: $after
|
|
@@ -18,7 +15,5 @@ const CollectionsDocument = `
|
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
|
|
24
|
-
export { CollectionsDocument };
|
|
18
|
+
${e}
|
|
19
|
+
${r}`;export{CollectionsDocument};
|
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PublishedPageSectionSelect } from '../fragments/published-page-section.generated.js';
|
|
3
|
-
import { PublishedCustomSectionSelect } from '../fragments/published-custom-section.generated.js';
|
|
4
|
-
import { DataSeoSelect } from '../fragments/data-seo.generated.js';
|
|
5
|
-
import { PublishedThemeStyleSelect } from '../fragments/published-theme-style.generated.js';
|
|
6
|
-
import { AnalyticSelect } from '../fragments/analytic.generated.js';
|
|
7
|
-
import { CustomCodeSelect } from '../fragments/custom-code.generated.js';
|
|
8
|
-
|
|
9
|
-
const PreviewPageDocument = `
|
|
1
|
+
import{PublishedThemePageSelect as e}from"../fragments/published-theme-page.generated.js";import{PublishedPageSectionSelect as t}from"../fragments/published-page-section.generated.js";import{PublishedCustomSectionSelect as r}from"../fragments/published-custom-section.generated.js";import{DataSeoSelect as a}from"../fragments/data-seo.generated.js";import{PublishedThemeStyleSelect as m}from"../fragments/published-theme-style.generated.js";import{AnalyticSelect as g}from"../fragments/analytic.generated.js";import{CustomCodeSelect as s}from"../fragments/custom-code.generated.js";let PreviewPageDocument=`
|
|
10
2
|
query previewPage($handleURL: String, $pageType: PublishedThemePageType!) {
|
|
11
3
|
previewPage(handleURL: $handleURL, pageType: $pageType) {
|
|
12
4
|
...PublishedThemePageSelect
|
|
13
5
|
}
|
|
14
6
|
}
|
|
15
|
-
${
|
|
16
|
-
${
|
|
17
|
-
${
|
|
18
|
-
${
|
|
19
|
-
${
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
|
|
23
|
-
export { PreviewPageDocument };
|
|
7
|
+
${e}
|
|
8
|
+
${t}
|
|
9
|
+
${r}
|
|
10
|
+
${a}
|
|
11
|
+
${m}
|
|
12
|
+
${g}
|
|
13
|
+
${s}`;export{PreviewPageDocument};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ProductOptionSelect } from '../fragments/product-option.generated.js';
|
|
3
|
-
import { ProductOptionValueSelect } from '../fragments/product-option-value.generated.js';
|
|
4
|
-
import { MediaSelect } from '../fragments/media.generated.js';
|
|
5
|
-
|
|
6
|
-
const ProductLittleDetailDocument = `
|
|
1
|
+
import{ProductLittleSelect as e}from"../fragments/product-little.generated.js";import{ProductOptionSelect as t}from"../fragments/product-option.generated.js";import{ProductOptionValueSelect as r}from"../fragments/product-option-value.generated.js";import{MediaSelect as o}from"../fragments/media.generated.js";let ProductLittleDetailDocument=`
|
|
7
2
|
query productLittleDetail($orderBy: ProductOrder, $where: ProductWhereInput) {
|
|
8
3
|
product: products(first: 1, orderBy: $orderBy, where: $where) {
|
|
9
4
|
edges {
|
|
@@ -14,9 +9,7 @@ const ProductLittleDetailDocument = `
|
|
|
14
9
|
}
|
|
15
10
|
}
|
|
16
11
|
}
|
|
17
|
-
${
|
|
18
|
-
${
|
|
19
|
-
${
|
|
20
|
-
${
|
|
21
|
-
|
|
22
|
-
export { ProductLittleDetailDocument };
|
|
12
|
+
${e}
|
|
13
|
+
${t}
|
|
14
|
+
${r}
|
|
15
|
+
${o}`;export{ProductLittleDetailDocument};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const ProductMediasDocument = `
|
|
1
|
+
import{MediaSelect as e}from"../fragments/media.generated.js";let ProductMediasDocument=`
|
|
4
2
|
query productMedias($firstMedia: Int = 50, $afterMedia: Cursor, $orderBy: ProductOrder, $where: ProductWhereInput, $orderByMedia: MediaOrder) {
|
|
5
3
|
medias: products(first: 1, orderBy: $orderBy, where: $where) {
|
|
6
4
|
edges {
|
|
@@ -22,6 +20,4 @@ const ProductMediasDocument = `
|
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
|
-
${
|
|
26
|
-
|
|
27
|
-
export { ProductMediasDocument };
|
|
23
|
+
${e}`;export{ProductMediasDocument};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SelectedOptionSelect } from '../fragments/selected-option.generated.js';
|
|
3
|
-
import { MediaSelect } from '../fragments/media.generated.js';
|
|
4
|
-
|
|
5
|
-
const ProductVariantsDocument = `
|
|
1
|
+
import{VariantSelect as r}from"../fragments/variant.generated.js";import{SelectedOptionSelect as e}from"../fragments/selected-option.generated.js";import{MediaSelect as t}from"../fragments/media.generated.js";let ProductVariantsDocument=`
|
|
6
2
|
query productVariants($firstVariant: Int = 100, $afterVariant: Cursor, $orderBy: ProductOrder, $orderByVariant: ProductVariantOrder, $where: ProductWhereInput, $first: Int = 1) {
|
|
7
3
|
variants: products(first: $first, orderBy: $orderBy, where: $where) {
|
|
8
4
|
edges {
|
|
@@ -24,8 +20,6 @@ const ProductVariantsDocument = `
|
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
22
|
}
|
|
27
|
-
${
|
|
28
|
-
${
|
|
29
|
-
${
|
|
30
|
-
|
|
31
|
-
export { ProductVariantsDocument };
|
|
23
|
+
${r}
|
|
24
|
+
${e}
|
|
25
|
+
${t}`;export{ProductVariantsDocument};
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ProductLittleSelect } from '../fragments/product-little.generated.js';
|
|
3
|
-
import { ProductOptionSelect } from '../fragments/product-option.generated.js';
|
|
4
|
-
import { ProductOptionValueSelect } from '../fragments/product-option-value.generated.js';
|
|
5
|
-
import { MediaSelect } from '../fragments/media.generated.js';
|
|
6
|
-
import { VariantSelect } from '../fragments/variant.generated.js';
|
|
7
|
-
import { SelectedOptionSelect } from '../fragments/selected-option.generated.js';
|
|
8
|
-
|
|
9
|
-
const ProductsEdgeDetail = `
|
|
1
|
+
import{ProductSelect as r}from"../fragments/product.generated.js";import{ProductLittleSelect as e}from"../fragments/product-little.generated.js";import{ProductOptionSelect as t}from"../fragments/product-option.generated.js";import{ProductOptionValueSelect as o}from"../fragments/product-option-value.generated.js";import{MediaSelect as d}from"../fragments/media.generated.js";import{VariantSelect as a}from"../fragments/variant.generated.js";import{SelectedOptionSelect as s}from"../fragments/selected-option.generated.js";let ProductsEdgeDetail=`
|
|
10
2
|
fragment ProductsEdgeDetail on ProductEdge {
|
|
11
3
|
cursor
|
|
12
4
|
node {
|
|
13
5
|
...ProductSelect
|
|
14
6
|
}
|
|
15
7
|
}
|
|
16
|
-
|
|
17
|
-
const ProductsDocument = `
|
|
8
|
+
`,ProductsDocument=`
|
|
18
9
|
query products($first: Int, $where: ProductWhereInput, $firstMedia: Int, $orderBy: ProductOrder, $after: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor, $orderByMedia: MediaOrder) {
|
|
19
10
|
products(first: $first, where: $where, orderBy: $orderBy, after: $after) {
|
|
20
11
|
edges {
|
|
@@ -27,12 +18,10 @@ const ProductsDocument = `
|
|
|
27
18
|
}
|
|
28
19
|
}
|
|
29
20
|
${ProductsEdgeDetail}
|
|
30
|
-
${
|
|
31
|
-
${
|
|
32
|
-
${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
${
|
|
36
|
-
${
|
|
37
|
-
|
|
38
|
-
export { ProductsDocument, ProductsEdgeDetail };
|
|
21
|
+
${r}
|
|
22
|
+
${e}
|
|
23
|
+
${t}
|
|
24
|
+
${o}
|
|
25
|
+
${d}
|
|
26
|
+
${a}
|
|
27
|
+
${s}`;export{ProductsDocument,ProductsEdgeDetail};
|