@gem-sdk/core 1.7.13 → 1.8.3

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.
@@ -4,29 +4,30 @@ var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  var zustand = require('zustand');
6
6
 
7
- const CollectionListContext = /*#__PURE__*/ react.createContext(null);
7
+ const CollectionContext = /*#__PURE__*/ react.createContext(null);
8
8
  const createCollectionProvider = (data)=>zustand.createStore(()=>({
9
9
  ...data
10
10
  }));
11
- const CollectionProvider = ({ children , collection , products , settings , styles })=>{
12
- return /*#__PURE__*/ jsxRuntime.jsx(CollectionListContext.Provider, {
13
- value: createCollectionProvider({
14
- products,
15
- collection,
16
- settings,
17
- styles
18
- }),
11
+ const CollectionProvider = ({ collection , children })=>{
12
+ const store = react.useMemo(()=>{
13
+ return createCollectionProvider({
14
+ collection
15
+ });
16
+ }, [
17
+ collection
18
+ ]);
19
+ return /*#__PURE__*/ jsxRuntime.jsx(CollectionContext.Provider, {
20
+ value: store,
19
21
  children: children
20
22
  }, collection?.id);
21
23
  };
22
24
  const useCollectionStore = (selector, equalityFn)=>{
23
- const store = react.useContext(CollectionListContext);
25
+ const store = react.useContext(CollectionContext);
24
26
  if (!store) {
25
27
  throw new Error('useCollectionStore must be used within a useCollectionStore');
26
28
  }
27
29
  return zustand.useStore(store, selector, equalityFn);
28
30
  };
29
31
 
30
- exports.CollectionListContext = CollectionListContext;
31
32
  exports.CollectionProvider = CollectionProvider;
32
33
  exports.useCollectionStore = useCollectionStore;
@@ -3,10 +3,23 @@
3
3
  /* eslint-disable */ const CollectionDetailSelect = `
4
4
  fragment CollectionDetailSelect on Collection {
5
5
  id
6
- baseID
6
+ createdAt
7
+ updatedAt
8
+ deletedAt
7
9
  title
8
10
  handle
9
11
  description
12
+ templateSuffix
13
+ titleMeta
14
+ descriptionMeta
15
+ baseID
16
+ platform
17
+ tags
18
+ collectionMedia {
19
+ src
20
+ }
21
+ isStorefront
22
+ isSample
10
23
  }
11
24
  `;
12
25
 
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ /* eslint-disable */ const CollectionSelect = `
4
+ fragment CollectionSelect on Collection {
5
+ ...CollectionDetailSelect
6
+ products {
7
+ edges {
8
+ node {
9
+ id
10
+ title
11
+ handle
12
+ description
13
+ status
14
+ }
15
+ }
16
+ }
17
+ }
18
+ `;
19
+
20
+ exports.CollectionSelect = CollectionSelect;
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ var collection_generated = require('../fragments/collection.generated.js');
4
+ var collectionDetail_generated = require('../fragments/collection-detail.generated.js');
5
+
6
+ const CollectionsDocument = `
7
+ query Collections($after: Cursor, $first: Int, $before: Cursor, $last: Int, $where: CollectionWhereInput, $orderBy: CollectionOrder) {
8
+ collections(
9
+ after: $after
10
+ first: $first
11
+ before: $before
12
+ last: $last
13
+ where: $where
14
+ orderBy: $orderBy
15
+ ) {
16
+ edges {
17
+ node {
18
+ ...CollectionSelect
19
+ }
20
+ }
21
+ }
22
+ }
23
+ ${collection_generated.CollectionSelect}
24
+ ${collectionDetail_generated.CollectionDetailSelect}`;
25
+
26
+ exports.CollectionsDocument = CollectionsDocument;
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ var collections_generated = require('../../graphql/queries/collections.generated.js');
4
+
5
+ const getCollections = async (fetcher, variable)=>{
6
+ const collections = await fetchCollections(fetcher, variable ?? {});
7
+ if (!collections) {
8
+ throw new Error('Collection not found');
9
+ }
10
+ return {
11
+ ...collections
12
+ };
13
+ };
14
+ const fetchCollections = async (fetcher, variables)=>{
15
+ return fetcher([
16
+ collections_generated.CollectionsDocument,
17
+ variables
18
+ ]);
19
+ };
20
+
21
+ exports.getCollections = getCollections;
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ var useSWR = require('swr');
4
+ var getCollections = require('../../helpers/queries/get-collections.js');
5
+ var useFetchHandle = require('../useFetchHandle.js');
6
+
7
+ const useCollectionsQuery = (variable, options)=>{
8
+ const fetcher = useFetchHandle.useFetchHandle();
9
+ return useSWR([
10
+ 'query/collections',
11
+ variable
12
+ ], async ([, arg])=>{
13
+ return getCollections.getCollections(fetcher, arg);
14
+ }, options);
15
+ };
16
+
17
+ exports.useCollectionsQuery = useCollectionsQuery;
package/dist/cjs/index.js CHANGED
@@ -18,6 +18,7 @@ var ModalContext = require('./contexts/ModalContext.js');
18
18
  var pageViewUp_generated = require('./graphql/mutations/page-view-up.generated.js');
19
19
  var collectionDetailFilter_generated = require('./graphql/queries/collection-detail-filter.generated.js');
20
20
  var collection_generated = require('./graphql/queries/collection.generated.js');
21
+ var collections_generated = require('./graphql/queries/collections.generated.js');
21
22
  var publishedThemePages_generated = require('./graphql/queries/published-theme-pages.generated.js');
22
23
  var products_generated = require('./graphql/queries/products.generated.js');
23
24
  var storeProperty_generated = require('./graphql/queries/store-property.generated.js');
@@ -61,6 +62,7 @@ var useRemoveCartItem = require('./hooks/cart/use-remove-cart-item.js');
61
62
  var useUpdateCartItem = require('./hooks/cart/use-update-cart-item.js');
62
63
  var shop = require('./hooks/shop.js');
63
64
  var useCollectionQuery = require('./hooks/shop/use-collection-query.js');
65
+ var useCollectionsQuery = require('./hooks/shop/use-collections-query.js');
64
66
  var useProductQuery = require('./hooks/shop/use-product-query.js');
65
67
  var useProductsQuery = require('./hooks/shop/use-products-query.js');
66
68
  var useCurrentDevice = require('./hooks/use-current-device.js');
@@ -118,6 +120,7 @@ exports.useModalStore = ModalContext.useModalStore;
118
120
  exports.PageViewUpDocument = pageViewUp_generated.PageViewUpDocument;
119
121
  exports.CollectionDetailFilterDocument = collectionDetailFilter_generated.CollectionDetailFilterDocument;
120
122
  exports.CollectionDocument = collection_generated.CollectionDocument;
123
+ exports.CollectionsDocument = collections_generated.CollectionsDocument;
121
124
  exports.PublishedThemePagesDocument = publishedThemePages_generated.PublishedThemePagesDocument;
122
125
  exports.ProductsDocument = products_generated.ProductsDocument;
123
126
  exports.StorePropertyDocument = storeProperty_generated.StorePropertyDocument;
@@ -205,6 +208,7 @@ exports.usePluginEnable = shop.usePluginEnable;
205
208
  exports.useStoreFront = shop.useStoreFront;
206
209
  exports.useSwatches = shop.useSwatches;
207
210
  exports.useCollectionQuery = useCollectionQuery.useCollectionQuery;
211
+ exports.useCollectionsQuery = useCollectionsQuery.useCollectionsQuery;
208
212
  exports.useProductQuery = useProductQuery.useProductQuery;
209
213
  exports.useProductsQuery = useProductsQuery.useProductsQuery;
210
214
  exports.useCurrentDevice = useCurrentDevice.useCurrentDevice;
@@ -1,28 +1,30 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { useContext, createContext } from 'react';
2
+ import { useMemo, useContext, createContext } from 'react';
3
3
  import { useStore, createStore } from 'zustand';
4
4
 
5
- const CollectionListContext = /*#__PURE__*/ createContext(null);
5
+ const CollectionContext = /*#__PURE__*/ createContext(null);
6
6
  const createCollectionProvider = (data)=>createStore(()=>({
7
7
  ...data
8
8
  }));
9
- const CollectionProvider = ({ children , collection , products , settings , styles })=>{
10
- return /*#__PURE__*/ jsx(CollectionListContext.Provider, {
11
- value: createCollectionProvider({
12
- products,
13
- collection,
14
- settings,
15
- styles
16
- }),
9
+ const CollectionProvider = ({ collection , children })=>{
10
+ const store = useMemo(()=>{
11
+ return createCollectionProvider({
12
+ collection
13
+ });
14
+ }, [
15
+ collection
16
+ ]);
17
+ return /*#__PURE__*/ jsx(CollectionContext.Provider, {
18
+ value: store,
17
19
  children: children
18
20
  }, collection?.id);
19
21
  };
20
22
  const useCollectionStore = (selector, equalityFn)=>{
21
- const store = useContext(CollectionListContext);
23
+ const store = useContext(CollectionContext);
22
24
  if (!store) {
23
25
  throw new Error('useCollectionStore must be used within a useCollectionStore');
24
26
  }
25
27
  return useStore(store, selector, equalityFn);
26
28
  };
27
29
 
28
- export { CollectionListContext, CollectionProvider, useCollectionStore };
30
+ export { CollectionProvider, useCollectionStore };
@@ -1,10 +1,23 @@
1
1
  /* eslint-disable */ const CollectionDetailSelect = `
2
2
  fragment CollectionDetailSelect on Collection {
3
3
  id
4
- baseID
4
+ createdAt
5
+ updatedAt
6
+ deletedAt
5
7
  title
6
8
  handle
7
9
  description
10
+ templateSuffix
11
+ titleMeta
12
+ descriptionMeta
13
+ baseID
14
+ platform
15
+ tags
16
+ collectionMedia {
17
+ src
18
+ }
19
+ isStorefront
20
+ isSample
8
21
  }
9
22
  `;
10
23
 
@@ -0,0 +1,18 @@
1
+ /* eslint-disable */ const CollectionSelect = `
2
+ fragment CollectionSelect on Collection {
3
+ ...CollectionDetailSelect
4
+ products {
5
+ edges {
6
+ node {
7
+ id
8
+ title
9
+ handle
10
+ description
11
+ status
12
+ }
13
+ }
14
+ }
15
+ }
16
+ `;
17
+
18
+ export { CollectionSelect };
@@ -0,0 +1,24 @@
1
+ import { CollectionSelect } from '../fragments/collection.generated.js';
2
+ import { CollectionDetailSelect } from '../fragments/collection-detail.generated.js';
3
+
4
+ const CollectionsDocument = `
5
+ query Collections($after: Cursor, $first: Int, $before: Cursor, $last: Int, $where: CollectionWhereInput, $orderBy: CollectionOrder) {
6
+ collections(
7
+ after: $after
8
+ first: $first
9
+ before: $before
10
+ last: $last
11
+ where: $where
12
+ orderBy: $orderBy
13
+ ) {
14
+ edges {
15
+ node {
16
+ ...CollectionSelect
17
+ }
18
+ }
19
+ }
20
+ }
21
+ ${CollectionSelect}
22
+ ${CollectionDetailSelect}`;
23
+
24
+ export { CollectionsDocument };
@@ -0,0 +1,19 @@
1
+ import { CollectionsDocument } from '../../graphql/queries/collections.generated.js';
2
+
3
+ const getCollections = async (fetcher, variable)=>{
4
+ const collections = await fetchCollections(fetcher, variable ?? {});
5
+ if (!collections) {
6
+ throw new Error('Collection not found');
7
+ }
8
+ return {
9
+ ...collections
10
+ };
11
+ };
12
+ const fetchCollections = async (fetcher, variables)=>{
13
+ return fetcher([
14
+ CollectionsDocument,
15
+ variables
16
+ ]);
17
+ };
18
+
19
+ export { getCollections };
@@ -0,0 +1,15 @@
1
+ import useSWR from 'swr';
2
+ import { getCollections } from '../../helpers/queries/get-collections.js';
3
+ import { useFetchHandle } from '../useFetchHandle.js';
4
+
5
+ const useCollectionsQuery = (variable, options)=>{
6
+ const fetcher = useFetchHandle();
7
+ return useSWR([
8
+ 'query/collections',
9
+ variable
10
+ ], async ([, arg])=>{
11
+ return getCollections(fetcher, arg);
12
+ }, options);
13
+ };
14
+
15
+ export { useCollectionsQuery };
package/dist/esm/index.js CHANGED
@@ -16,6 +16,7 @@ export { ModalProvider, useModalStore } from './contexts/ModalContext.js';
16
16
  export { PageViewUpDocument } from './graphql/mutations/page-view-up.generated.js';
17
17
  export { CollectionDetailFilterDocument } from './graphql/queries/collection-detail-filter.generated.js';
18
18
  export { CollectionDocument } from './graphql/queries/collection.generated.js';
19
+ export { CollectionsDocument } from './graphql/queries/collections.generated.js';
19
20
  export { PublishedThemePagesDocument } from './graphql/queries/published-theme-pages.generated.js';
20
21
  export { ProductsDocument } from './graphql/queries/products.generated.js';
21
22
  export { StorePropertyDocument } from './graphql/queries/store-property.generated.js';
@@ -62,6 +63,7 @@ export { useRemoveCartItem } from './hooks/cart/use-remove-cart-item.js';
62
63
  export { useUpdateCartItem } from './hooks/cart/use-update-cart-item.js';
63
64
  export { useCheckoutUrl, useConnectedShopify, useCurrency, useEditorMode, useIsSampleProduct, useIsStorefrontProduct, useLocale, useMatchMutate, useMobileOnly, usePageType, usePluginEnable, useStoreFront, useSwatches } from './hooks/shop.js';
64
65
  export { useCollectionQuery } from './hooks/shop/use-collection-query.js';
66
+ export { useCollectionsQuery } from './hooks/shop/use-collections-query.js';
65
67
  export { useProductQuery } from './hooks/shop/use-product-query.js';
66
68
  export { useProductsQuery } from './hooks/shop/use-products-query.js';
67
69
  export { useCurrentDevice } from './hooks/use-current-device.js';
@@ -405,6 +405,7 @@ type RangeControlType<T> = SharedControlType<T> & {
405
405
  units?: string[];
406
406
  disableOnChange?: boolean;
407
407
  ignoreUnit?: boolean;
408
+ hideUnit?: boolean;
408
409
  };
409
410
 
410
411
  type Option$2<T> = {
@@ -467,6 +468,7 @@ type SegmentControlType<T> = {
467
468
  type Option$1<T> = {
468
469
  value: T extends ObjectDevices<infer U> ? U extends StateProp<infer A> ? A : U : T extends StateProp<infer B> ? B : T;
469
470
  label: string | number;
471
+ hideOnPage?: string[];
470
472
  };
471
473
  type Mapped$1<K, T> = NonNullable<T> extends ObjectDevices<infer U> ? {
472
474
  id: K;
@@ -829,6 +831,7 @@ type ComponentSetting<P extends BaseProps> = {
829
831
  placeholder?: {
830
832
  notAppendBeforeAfter?: boolean;
831
833
  flowTag?: string[];
834
+ flowPage?: string;
832
835
  };
833
836
  sideBar?: {
834
837
  hide?: boolean;
@@ -1474,7 +1477,7 @@ type CartUserError = {
1474
1477
  field?: Maybe<Array<Maybe<Scalars['String']>>>;
1475
1478
  message?: Maybe<Scalars['String']>;
1476
1479
  };
1477
- type Collection$1 = {
1480
+ type Collection = {
1478
1481
  baseID?: Maybe<Scalars['String']>;
1479
1482
  collectionMedia?: Maybe<CollectionMedia>;
1480
1483
  createdAt?: Maybe<Scalars['Time']>;
@@ -1514,7 +1517,7 @@ type CollectionConnection = {
1514
1517
  };
1515
1518
  type CollectionEdge = {
1516
1519
  cursor?: Maybe<Scalars['Cursor']>;
1517
- node?: Maybe<Collection$1>;
1520
+ node?: Maybe<Collection>;
1518
1521
  };
1519
1522
  type CollectionMedia = {
1520
1523
  alt?: Maybe<Scalars['String']>;
@@ -5674,7 +5677,7 @@ type PublishedThemePageOnlineStoreDataWhereInput = {
5674
5677
  updatedAtNotIn?: InputMaybe<Array<Scalars['Time']>>;
5675
5678
  };
5676
5679
  type PublishedThemePageStatus = 'DRAFT' | 'PUBLISHED';
5677
- type PublishedThemePageType = 'ARTICLE' | 'BLOG' | 'COLLECTION' | 'PRODUCT' | 'STATIC';
5680
+ type PublishedThemePageType = 'ARTICLE' | 'BLOG' | 'COLLECTION' | 'GP_ARTICLE' | 'GP_BLOG' | 'GP_COLLECTION' | 'GP_INDEX' | 'GP_PRODUCT' | 'GP_STATIC' | 'PRODUCT' | 'STATIC';
5678
5681
  /**
5679
5682
  * PublishedThemePageWhereInput is used for filtering PublishedThemePage objects.
5680
5683
  * Input was generated by ent.
@@ -5903,7 +5906,7 @@ type Query = {
5903
5906
  blog?: Maybe<Blog>;
5904
5907
  blogs?: Maybe<BlogConnection>;
5905
5908
  cart?: Maybe<Cart>;
5906
- collection?: Maybe<Collection$1>;
5909
+ collection?: Maybe<Collection>;
5907
5910
  collections?: Maybe<CollectionConnection>;
5908
5911
  media?: Maybe<Media>;
5909
5912
  medias?: Maybe<MediaConnection>;
@@ -6268,6 +6271,7 @@ type shop_CartLineUpdateInput = CartLineUpdateInput;
6268
6271
  type shop_CartPayload = CartPayload;
6269
6272
  type shop_CartPlatform = CartPlatform;
6270
6273
  type shop_CartUserError = CartUserError;
6274
+ type shop_Collection = Collection;
6271
6275
  type shop_CollectionConnection = CollectionConnection;
6272
6276
  type shop_CollectionEdge = CollectionEdge;
6273
6277
  type shop_CollectionMedia = CollectionMedia;
@@ -6452,7 +6456,7 @@ declare namespace shop {
6452
6456
  shop_CartPayload as CartPayload,
6453
6457
  shop_CartPlatform as CartPlatform,
6454
6458
  shop_CartUserError as CartUserError,
6455
- Collection$1 as Collection,
6459
+ shop_Collection as Collection,
6456
6460
  shop_CollectionConnection as CollectionConnection,
6457
6461
  shop_CollectionEdge as CollectionEdge,
6458
6462
  shop_CollectionMedia as CollectionMedia,
@@ -6835,7 +6839,7 @@ type CartLineProviderProps = Pick<CartLineContextProps, 'line'> & {
6835
6839
  declare const CartLineProvider: React.FC<CartLineProviderProps>;
6836
6840
  declare const useCartLineStore: <U>(selector: (state: ExtractState<StoreApi<CartLineContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
6837
6841
 
6838
- type CollectionProductSelectFragment = Pick<Collection$1, 'id' | 'baseID' | 'title' | 'handle' | 'description'> & {
6842
+ type CollectionProductSelectFragment = Pick<Collection, 'id' | 'createdAt' | 'updatedAt' | 'deletedAt' | 'title' | 'handle' | 'description' | 'templateSuffix' | 'titleMeta' | 'descriptionMeta' | 'baseID' | 'platform' | 'tags' | 'isStorefront' | 'isSample'> & {
6839
6843
  products?: Maybe<{
6840
6844
  edges: Array<Pick<ProductEdge, 'cursor'> & {
6841
6845
  node?: Maybe<Pick<Product, 'id' | 'title' | 'description' | 'descriptionHtml' | 'handle' | 'averageRating' | 'isStorefront' | 'isSample' | 'baseID' | 'sku' | 'vendor'> & {
@@ -6862,6 +6866,7 @@ type CollectionProductSelectFragment = Pick<Collection$1, 'id' | 'baseID' | 'tit
6862
6866
  }>;
6863
6867
  pageInfo?: Maybe<Pick<PageInfo, 'endCursor' | 'hasNextPage'>>;
6864
6868
  }>;
6869
+ collectionMedia?: Maybe<Pick<CollectionMedia, 'src'>>;
6865
6870
  };
6866
6871
 
6867
6872
  type ProductQuickSelectFragment = Pick<Product, 'id' | 'title' | 'handle' | 'averageRating' | 'baseID' | 'description' | 'sku' | 'vendor'> & {
@@ -7020,31 +7025,21 @@ type ShopProviderProps = {
7020
7025
  declare const ShopProvider: React.FC<ShopProviderProps>;
7021
7026
  declare const useShopStore: <U>(selector: (state: ExtractState<StoreApi<ShopContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
7022
7027
 
7023
- type Collection = Maybe<ProductQuickSelectFragment>;
7028
+ type CollectionSelectFragment = Pick<Collection, 'id' | 'createdAt' | 'updatedAt' | 'deletedAt' | 'title' | 'handle' | 'description' | 'templateSuffix' | 'titleMeta' | 'descriptionMeta' | 'baseID' | 'platform' | 'tags' | 'isStorefront' | 'isSample'> & {
7029
+ products?: Maybe<{
7030
+ edges: Array<{
7031
+ node?: Maybe<Pick<Product, 'id' | 'title' | 'handle' | 'description' | 'status'>>;
7032
+ }>;
7033
+ }>;
7034
+ collectionMedia?: Maybe<Pick<CollectionMedia, 'src'>>;
7035
+ };
7036
+
7024
7037
  type CollectionContextProps = {
7025
- products?: Collection[];
7026
- collection?: CollectionProductSelectFragment;
7027
- settings?: {
7028
- loop?: ObjectDevices<boolean>;
7029
- scrollMode?: ObjectDevices<'snap' | 'free' | 'free-snap'>;
7030
- slidesToShow?: ObjectDevices<number>;
7031
- spacing?: ObjectDevices<number>;
7032
- layout?: 'grid' | 'slider';
7033
- dot?: ObjectDevices<boolean>;
7034
- arrow?: ObjectDevices<boolean>;
7035
- controlOverContent?: ObjectDevices<boolean>;
7036
- speed?: number;
7037
- };
7038
- styles?: {
7039
- horizontalGutter?: ObjectDevices<string>;
7040
- verticalGutter?: ObjectDevices<string>;
7041
- fullWidth?: ObjectDevices<boolean>;
7042
- spacing?: ObjectDevices<number>;
7043
- width?: ObjectDevices<string>;
7044
- height?: ObjectDevices<string>;
7045
- };
7038
+ collection?: CollectionSelectFragment;
7046
7039
  };
7047
- type CollectionProviderProps = CollectionContextProps & {
7040
+ type CollectionProviderProps = Pick<CollectionContextProps, 'collection'> & {
7041
+ initialVariantId?: string;
7042
+ readOnly?: boolean;
7048
7043
  children: React.ReactNode;
7049
7044
  };
7050
7045
  declare const CollectionProvider: React.FC<CollectionProviderProps>;
@@ -7083,7 +7078,7 @@ type CollectionDetailFilterQueryVariables = Exact<{
7083
7078
  type CollectionDetailFilterQueryResponse = {
7084
7079
  collections?: Maybe<{
7085
7080
  edges: Array<Pick<CollectionEdge, 'cursor'> & {
7086
- node?: Maybe<Pick<Collection$1, 'id' | 'baseID' | 'title' | 'handle' | 'description'> & {
7081
+ node?: Maybe<Pick<Collection, 'id' | 'createdAt' | 'updatedAt' | 'deletedAt' | 'title' | 'handle' | 'description' | 'templateSuffix' | 'titleMeta' | 'descriptionMeta' | 'baseID' | 'platform' | 'tags' | 'isStorefront' | 'isSample'> & {
7087
7082
  products?: Maybe<{
7088
7083
  edges: Array<Pick<ProductEdge, 'cursor'> & {
7089
7084
  node?: Maybe<Pick<Product, 'id' | 'title' | 'description' | 'descriptionHtml' | 'handle' | 'averageRating' | 'isStorefront' | 'isSample' | 'baseID' | 'sku' | 'vendor'> & {
@@ -7110,6 +7105,7 @@ type CollectionDetailFilterQueryResponse = {
7110
7105
  }>;
7111
7106
  pageInfo?: Maybe<Pick<PageInfo, 'endCursor' | 'hasNextPage'>>;
7112
7107
  }>;
7108
+ collectionMedia?: Maybe<Pick<CollectionMedia, 'src'>>;
7113
7109
  }>;
7114
7110
  }>;
7115
7111
  }>;
@@ -7127,7 +7123,7 @@ type CollectionQueryVariables = Exact<{
7127
7123
  id?: InputMaybe<Scalars['ID']>;
7128
7124
  }>;
7129
7125
  type CollectionQueryResponse = {
7130
- collection?: Maybe<Pick<Collection$1, 'baseID' | 'createdAt' | 'deletedAt' | 'description' | 'descriptionMeta' | 'handle' | 'id' | 'platform' | 'tags' | 'templateSuffix' | 'title' | 'titleMeta' | 'updatedAt'> & {
7126
+ collection?: Maybe<Pick<Collection, 'baseID' | 'createdAt' | 'deletedAt' | 'description' | 'descriptionMeta' | 'handle' | 'id' | 'platform' | 'tags' | 'templateSuffix' | 'title' | 'titleMeta' | 'updatedAt'> & {
7131
7127
  products?: Maybe<Pick<ProductConnection, 'totalCount'> & {
7132
7128
  edges: Array<Pick<ProductEdge, 'cursor'> & {
7133
7129
  node?: Maybe<Pick<Product, 'id' | 'title' | 'description' | 'descriptionHtml' | 'handle' | 'averageRating' | 'isStorefront' | 'isSample' | 'baseID' | 'sku' | 'vendor'> & {
@@ -7158,6 +7154,30 @@ type CollectionQueryResponse = {
7158
7154
  };
7159
7155
  declare const CollectionDocument: string;
7160
7156
 
7157
+ type CollectionsQueryVariables = Exact<{
7158
+ after?: InputMaybe<Scalars['Cursor']>;
7159
+ first?: InputMaybe<Scalars['Int']>;
7160
+ before?: InputMaybe<Scalars['Cursor']>;
7161
+ last?: InputMaybe<Scalars['Int']>;
7162
+ where?: InputMaybe<CollectionWhereInput>;
7163
+ orderBy?: InputMaybe<CollectionOrder>;
7164
+ }>;
7165
+ type CollectionsQueryResponse = {
7166
+ collections?: Maybe<{
7167
+ edges: Array<{
7168
+ node?: Maybe<Pick<Collection, 'id' | 'createdAt' | 'updatedAt' | 'deletedAt' | 'title' | 'handle' | 'description' | 'templateSuffix' | 'titleMeta' | 'descriptionMeta' | 'baseID' | 'platform' | 'tags' | 'isStorefront' | 'isSample'> & {
7169
+ products?: Maybe<{
7170
+ edges: Array<{
7171
+ node?: Maybe<Pick<Product, 'id' | 'title' | 'handle' | 'description' | 'status'>>;
7172
+ }>;
7173
+ }>;
7174
+ collectionMedia?: Maybe<Pick<CollectionMedia, 'src'>>;
7175
+ }>;
7176
+ }>;
7177
+ }>;
7178
+ };
7179
+ declare const CollectionsDocument: string;
7180
+
7161
7181
  type PublishedThemePagesQueryVariables = Exact<{
7162
7182
  slug?: InputMaybe<Scalars['String']>;
7163
7183
  slugType: PublishedThemePageType;
@@ -7493,6 +7513,15 @@ type Args$1 = {
7493
7513
  };
7494
7514
  declare const useCollectionQuery: (args: Args$1, options?: SWRConfiguration<CollectionDetailFilterQueryResponse>) => swr__internal.SWRResponse<CollectionDetailFilterQueryResponse, any, Partial<swr__internal.PublicConfiguration<CollectionDetailFilterQueryResponse, any, (arg: ["query/collection", Args$1]) => swr__internal.FetcherResponse<CollectionDetailFilterQueryResponse>>> | undefined>;
7495
7515
 
7516
+ declare const useCollectionsQuery: (variable: CollectionsQueryVariables, options?: SWRConfiguration<CollectionsQueryResponse>) => swr__internal.SWRResponse<CollectionsQueryResponse, any, Partial<swr__internal.PublicConfiguration<CollectionsQueryResponse, any, (arg: ["query/collections", Exact<{
7517
+ after?: InputMaybe<string>;
7518
+ first?: InputMaybe<number>;
7519
+ before?: InputMaybe<string>;
7520
+ last?: InputMaybe<number>;
7521
+ where?: InputMaybe<CollectionWhereInput>;
7522
+ orderBy?: InputMaybe<CollectionOrder>;
7523
+ }>]) => swr__internal.FetcherResponse<CollectionsQueryResponse>>> | undefined>;
7524
+
7496
7525
  declare const useProductQuery: (productId?: string, options?: SWRConfiguration<ProductSelectFragment>) => swr__internal.SWRResponse<ProductSelectFragment, any, Partial<swr__internal.PublicConfiguration<ProductSelectFragment, any, (arg: ["query/product", {
7497
7526
  id?: string | undefined;
7498
7527
  isSample?: boolean | undefined;
@@ -7523,7 +7552,7 @@ declare function useCartUI(): {
7523
7552
  closeCart: () => void;
7524
7553
  };
7525
7554
 
7526
- declare const useCollection: () => CollectionProductSelectFragment | undefined;
7555
+ declare const useCollection: () => CollectionSelectFragment | undefined;
7527
7556
 
7528
7557
  declare const useFormatMoney: () => {
7529
7558
  formatMoney: (value: number, options?: Intl.NumberFormatOptions & Required<Pick<Intl.NumberFormatOptions, 'currency'>>) => string;
@@ -7650,4 +7679,4 @@ declare const fetchMedias: (fetcher: FetchFunc, { id, isSample, isStorefront }:
7650
7679
 
7651
7680
  declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
7652
7681
 
7653
- export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, Border, BorderStyle, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentSetting, ContainerProp, ControlProp, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, ExtractState, FetchFunc, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, InitComponentType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, OptionNormalStyle, OptionSpecialStyle, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, RenderMemo as Render, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveStateProp, RoundedSize, SectionData, SectionEntity, SectionProvider, SectionProviderProps, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeType, SpacingType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TypographyProps, TypographySetting, TypographyType, VariantSelectFragment, calculateFirstProduct, cls, composeAdvanceStyle, composeRadius, composeSize, composeSpacing, fetchMedias, fetchVariants, flattenConnection, fpixel, genTypoClass, genVariable, getBorderStyle, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, globalEvent, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, isBrowser, isColor, isDefined, isEmptyChildren, isLocalEnv, loadScript, makeAspectRatio, makeHeight, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, prefetchQueries, props, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useIsSampleProduct, useIsStorefrontProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductProperties, useProductQuery, useProductStore, useProductsQuery, useQuantity, useRemoveCartItem, useSection, useSectionStore, useSelectedOption, useShopStore, useStoreFront, useSuspenseFetch, useSwatches, useSwatchesOptions, useUniqProductID, useUpdateCartItem, useVariant, useVariantOutStock, useVariants, validateEmail };
7682
+ export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, Border, BorderStyle, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, CollectionsDocument, CollectionsQueryResponse, CollectionsQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentSetting, ContainerProp, ControlProp, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, ExtractState, FetchFunc, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, InitComponentType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, OptionNormalStyle, OptionSpecialStyle, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, RenderMemo as Render, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveStateProp, RoundedSize, SectionData, SectionEntity, SectionProvider, SectionProviderProps, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeType, SpacingType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TypographyProps, TypographySetting, TypographyType, VariantSelectFragment, calculateFirstProduct, cls, composeAdvanceStyle, composeRadius, composeSize, composeSpacing, fetchMedias, fetchVariants, flattenConnection, fpixel, genTypoClass, genVariable, getBorderStyle, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, globalEvent, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, isBrowser, isColor, isDefined, isEmptyChildren, isLocalEnv, loadScript, makeAspectRatio, makeHeight, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, prefetchQueries, props, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useCollectionsQuery, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useIsSampleProduct, useIsStorefrontProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductProperties, useProductQuery, useProductStore, useProductsQuery, useQuantity, useRemoveCartItem, useSection, useSectionStore, useSelectedOption, useShopStore, useStoreFront, useSuspenseFetch, useSwatches, useSwatchesOptions, useUniqProductID, useUpdateCartItem, useVariant, useVariantOutStock, useVariants, validateEmail };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.7.13",
3
+ "version": "1.8.3",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",