@gem-sdk/core 1.17.9 → 1.18.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.
@@ -4,6 +4,7 @@
4
4
  fragment MediaSelect on Media {
5
5
  id
6
6
  contentType
7
+ previewImage
7
8
  src
8
9
  width
9
10
  height
@@ -2,6 +2,7 @@
2
2
  fragment MediaSelect on Media {
3
3
  id
4
4
  contentType
5
+ previewImage
5
6
  src
6
7
  width
7
8
  height
@@ -768,6 +768,8 @@ type Mapped<K, T> = NonNullable<T> extends ObjectDevices<infer U> ? {
768
768
  placeholder?: string;
769
769
  type: 'layout-segment';
770
770
  options: Option<T>[];
771
+ iconViewBox?: string;
772
+ enableItemBackground?: boolean;
771
773
  default?: T;
772
774
  };
773
775
  type LayoutSegmentControlType<T> = {
@@ -7271,7 +7273,7 @@ type CollectionProductSelectFragment = Pick<Collection, 'id' | 'createdAt' | 'up
7271
7273
  node?: Maybe<Pick<Product, 'id' | 'title' | 'description' | 'descriptionHtml' | 'handle' | 'averageRating' | 'isStorefront' | 'isSample' | 'baseID' | 'sku' | 'vendor'> & {
7272
7274
  medias?: Maybe<{
7273
7275
  edges: Array<Pick<MediaEdge, 'cursor'> & {
7274
- node?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7276
+ node?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7275
7277
  }>;
7276
7278
  pageInfo?: Maybe<Pick<PageInfo, 'endCursor' | 'hasNextPage'>>;
7277
7279
  }>;
@@ -7279,7 +7281,7 @@ type CollectionProductSelectFragment = Pick<Collection, 'id' | 'createdAt' | 'up
7279
7281
  edges: Array<Pick<ProductVariantEdge, 'cursor'> & {
7280
7282
  node?: Maybe<Pick<ProductVariant, 'id' | 'title' | 'barcode' | 'baseID' | 'costPrice' | 'height' | 'inventoryPolicy' | 'inventoryQuantity' | 'inventoryStatus' | 'isDigital' | 'length' | 'lowInventoryAmount' | 'manageInventory' | 'mediaId' | 'platform' | 'price' | 'salePrice' | 'sku' | 'soldIndividually' | 'weight' | 'width'> & {
7281
7283
  selectedOptions: Array<Pick<SelectedOption, 'name' | 'value' | 'optionType'>>;
7282
- media?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7284
+ media?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7283
7285
  }>;
7284
7286
  }>;
7285
7287
  pageInfo?: Maybe<Pick<PageInfo, 'hasNextPage' | 'endCursor'>>;
@@ -7287,7 +7289,7 @@ type CollectionProductSelectFragment = Pick<Collection, 'id' | 'createdAt' | 'up
7287
7289
  options?: Maybe<Array<Pick<ProductOption, 'id' | 'name' | 'optionType'> & {
7288
7290
  values: Array<Pick<ProductOptionValue, 'id' | 'label' | 'isDefault' | 'baseID'>>;
7289
7291
  }>>;
7290
- featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7292
+ featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7291
7293
  }>;
7292
7294
  }>;
7293
7295
  pageInfo?: Maybe<Pick<PageInfo, 'endCursor' | 'hasNextPage'>>;
@@ -7296,7 +7298,7 @@ type CollectionProductSelectFragment = Pick<Collection, 'id' | 'createdAt' | 'up
7296
7298
  };
7297
7299
 
7298
7300
  type ProductQuickSelectFragment = Pick<Product, 'id' | 'title' | 'handle' | 'averageRating' | 'baseID' | 'description' | 'sku' | 'vendor'> & {
7299
- featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7301
+ featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7300
7302
  options?: Maybe<Array<Pick<ProductOption, 'id' | 'name' | 'optionType'> & {
7301
7303
  values: Array<Pick<ProductOptionValue, 'id' | 'label' | 'isDefault' | 'baseID'>>;
7302
7304
  }>>;
@@ -7304,7 +7306,7 @@ type ProductQuickSelectFragment = Pick<Product, 'id' | 'title' | 'handle' | 'ave
7304
7306
  edges: Array<{
7305
7307
  node?: Maybe<Pick<ProductVariant, 'id' | 'title' | 'barcode' | 'costPrice' | 'height' | 'inventoryQuantity' | 'inventoryStatus' | 'length' | 'price' | 'salePrice' | 'sku' | 'baseID' | 'weight' | 'width'> & {
7306
7308
  selectedOptions: Array<Pick<SelectedOption, 'name' | 'value' | 'optionType'>>;
7307
- media?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7309
+ media?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7308
7310
  }>;
7309
7311
  }>;
7310
7312
  }>;
@@ -7343,7 +7345,7 @@ declare const useProductListStore: <U>(selector: (state: ExtractState<StoreApi<P
7343
7345
  type ProductSelectFragment = Pick<Product, 'id' | 'title' | 'description' | 'descriptionHtml' | 'handle' | 'averageRating' | 'isStorefront' | 'isSample' | 'baseID' | 'sku' | 'vendor'> & {
7344
7346
  medias?: Maybe<{
7345
7347
  edges: Array<Pick<MediaEdge, 'cursor'> & {
7346
- node?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7348
+ node?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7347
7349
  }>;
7348
7350
  pageInfo?: Maybe<Pick<PageInfo, 'endCursor' | 'hasNextPage'>>;
7349
7351
  }>;
@@ -7351,7 +7353,7 @@ type ProductSelectFragment = Pick<Product, 'id' | 'title' | 'description' | 'des
7351
7353
  edges: Array<Pick<ProductVariantEdge, 'cursor'> & {
7352
7354
  node?: Maybe<Pick<ProductVariant, 'id' | 'title' | 'barcode' | 'baseID' | 'costPrice' | 'height' | 'inventoryPolicy' | 'inventoryQuantity' | 'inventoryStatus' | 'isDigital' | 'length' | 'lowInventoryAmount' | 'manageInventory' | 'mediaId' | 'platform' | 'price' | 'salePrice' | 'sku' | 'soldIndividually' | 'weight' | 'width'> & {
7353
7355
  selectedOptions: Array<Pick<SelectedOption, 'name' | 'value' | 'optionType'>>;
7354
- media?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7356
+ media?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7355
7357
  }>;
7356
7358
  }>;
7357
7359
  pageInfo?: Maybe<Pick<PageInfo, 'hasNextPage' | 'endCursor'>>;
@@ -7359,10 +7361,10 @@ type ProductSelectFragment = Pick<Product, 'id' | 'title' | 'description' | 'des
7359
7361
  options?: Maybe<Array<Pick<ProductOption, 'id' | 'name' | 'optionType'> & {
7360
7362
  values: Array<Pick<ProductOptionValue, 'id' | 'label' | 'isDefault' | 'baseID'>>;
7361
7363
  }>>;
7362
- featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7364
+ featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7363
7365
  };
7364
7366
 
7365
- type MediaSelectFragment = Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>;
7367
+ type MediaSelectFragment = Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>;
7366
7368
 
7367
7369
  type AttributeProp = {
7368
7370
  key: string;
@@ -7514,7 +7516,7 @@ type CollectionDetailFilterQueryResponse = {
7514
7516
  node?: Maybe<Pick<Product, 'id' | 'title' | 'description' | 'descriptionHtml' | 'handle' | 'averageRating' | 'isStorefront' | 'isSample' | 'baseID' | 'sku' | 'vendor'> & {
7515
7517
  medias?: Maybe<{
7516
7518
  edges: Array<Pick<MediaEdge, 'cursor'> & {
7517
- node?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7519
+ node?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7518
7520
  }>;
7519
7521
  pageInfo?: Maybe<Pick<PageInfo, 'endCursor' | 'hasNextPage'>>;
7520
7522
  }>;
@@ -7522,7 +7524,7 @@ type CollectionDetailFilterQueryResponse = {
7522
7524
  edges: Array<Pick<ProductVariantEdge, 'cursor'> & {
7523
7525
  node?: Maybe<Pick<ProductVariant, 'id' | 'title' | 'barcode' | 'baseID' | 'costPrice' | 'height' | 'inventoryPolicy' | 'inventoryQuantity' | 'inventoryStatus' | 'isDigital' | 'length' | 'lowInventoryAmount' | 'manageInventory' | 'mediaId' | 'platform' | 'price' | 'salePrice' | 'sku' | 'soldIndividually' | 'weight' | 'width'> & {
7524
7526
  selectedOptions: Array<Pick<SelectedOption, 'name' | 'value' | 'optionType'>>;
7525
- media?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7527
+ media?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7526
7528
  }>;
7527
7529
  }>;
7528
7530
  pageInfo?: Maybe<Pick<PageInfo, 'hasNextPage' | 'endCursor'>>;
@@ -7530,7 +7532,7 @@ type CollectionDetailFilterQueryResponse = {
7530
7532
  options?: Maybe<Array<Pick<ProductOption, 'id' | 'name' | 'optionType'> & {
7531
7533
  values: Array<Pick<ProductOptionValue, 'id' | 'label' | 'isDefault' | 'baseID'>>;
7532
7534
  }>>;
7533
- featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7535
+ featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7534
7536
  }>;
7535
7537
  }>;
7536
7538
  pageInfo?: Maybe<Pick<PageInfo, 'endCursor' | 'hasNextPage'>>;
@@ -7559,7 +7561,7 @@ type CollectionQueryResponse = {
7559
7561
  node?: Maybe<Pick<Product, 'id' | 'title' | 'description' | 'descriptionHtml' | 'handle' | 'averageRating' | 'isStorefront' | 'isSample' | 'baseID' | 'sku' | 'vendor'> & {
7560
7562
  medias?: Maybe<{
7561
7563
  edges: Array<Pick<MediaEdge, 'cursor'> & {
7562
- node?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7564
+ node?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7563
7565
  }>;
7564
7566
  pageInfo?: Maybe<Pick<PageInfo, 'endCursor' | 'hasNextPage'>>;
7565
7567
  }>;
@@ -7567,7 +7569,7 @@ type CollectionQueryResponse = {
7567
7569
  edges: Array<Pick<ProductVariantEdge, 'cursor'> & {
7568
7570
  node?: Maybe<Pick<ProductVariant, 'id' | 'title' | 'barcode' | 'baseID' | 'costPrice' | 'height' | 'inventoryPolicy' | 'inventoryQuantity' | 'inventoryStatus' | 'isDigital' | 'length' | 'lowInventoryAmount' | 'manageInventory' | 'mediaId' | 'platform' | 'price' | 'salePrice' | 'sku' | 'soldIndividually' | 'weight' | 'width'> & {
7569
7571
  selectedOptions: Array<Pick<SelectedOption, 'name' | 'value' | 'optionType'>>;
7570
- media?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7572
+ media?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7571
7573
  }>;
7572
7574
  }>;
7573
7575
  pageInfo?: Maybe<Pick<PageInfo, 'hasNextPage' | 'endCursor'>>;
@@ -7575,7 +7577,7 @@ type CollectionQueryResponse = {
7575
7577
  options?: Maybe<Array<Pick<ProductOption, 'id' | 'name' | 'optionType'> & {
7576
7578
  values: Array<Pick<ProductOptionValue, 'id' | 'label' | 'isDefault' | 'baseID'>>;
7577
7579
  }>>;
7578
- featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7580
+ featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7579
7581
  }>;
7580
7582
  }>;
7581
7583
  pageInfo?: Maybe<Pick<PageInfo, 'endCursor' | 'hasNextPage' | 'hasPreviousPage' | 'startCursor'>>;
@@ -7643,7 +7645,7 @@ type ProductsQueryResponse = {
7643
7645
  node?: Maybe<Pick<Product, 'id' | 'title' | 'description' | 'descriptionHtml' | 'handle' | 'averageRating' | 'isStorefront' | 'isSample' | 'baseID' | 'sku' | 'vendor'> & {
7644
7646
  medias?: Maybe<{
7645
7647
  edges: Array<Pick<MediaEdge, 'cursor'> & {
7646
- node?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7648
+ node?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7647
7649
  }>;
7648
7650
  pageInfo?: Maybe<Pick<PageInfo, 'endCursor' | 'hasNextPage'>>;
7649
7651
  }>;
@@ -7651,7 +7653,7 @@ type ProductsQueryResponse = {
7651
7653
  edges: Array<Pick<ProductVariantEdge, 'cursor'> & {
7652
7654
  node?: Maybe<Pick<ProductVariant, 'id' | 'title' | 'barcode' | 'baseID' | 'costPrice' | 'height' | 'inventoryPolicy' | 'inventoryQuantity' | 'inventoryStatus' | 'isDigital' | 'length' | 'lowInventoryAmount' | 'manageInventory' | 'mediaId' | 'platform' | 'price' | 'salePrice' | 'sku' | 'soldIndividually' | 'weight' | 'width'> & {
7653
7655
  selectedOptions: Array<Pick<SelectedOption, 'name' | 'value' | 'optionType'>>;
7654
- media?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7656
+ media?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7655
7657
  }>;
7656
7658
  }>;
7657
7659
  pageInfo?: Maybe<Pick<PageInfo, 'hasNextPage' | 'endCursor'>>;
@@ -7659,7 +7661,7 @@ type ProductsQueryResponse = {
7659
7661
  options?: Maybe<Array<Pick<ProductOption, 'id' | 'name' | 'optionType'> & {
7660
7662
  values: Array<Pick<ProductOptionValue, 'id' | 'label' | 'isDefault' | 'baseID'>>;
7661
7663
  }>>;
7662
- featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7664
+ featuredImage?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7663
7665
  }>;
7664
7666
  }>;
7665
7667
  pageInfo?: Maybe<Pick<PageInfo, 'endCursor' | 'hasNextPage'>>;
@@ -7693,7 +7695,7 @@ declare const PreviewPageDocument: string;
7693
7695
 
7694
7696
  type VariantSelectFragment = Pick<ProductVariant, 'id' | 'title' | 'barcode' | 'baseID' | 'costPrice' | 'height' | 'inventoryPolicy' | 'inventoryQuantity' | 'inventoryStatus' | 'isDigital' | 'length' | 'lowInventoryAmount' | 'manageInventory' | 'mediaId' | 'platform' | 'price' | 'salePrice' | 'sku' | 'soldIndividually' | 'weight' | 'width'> & {
7695
7697
  selectedOptions: Array<Pick<SelectedOption, 'name' | 'value' | 'optionType'>>;
7696
- media?: Maybe<Pick<Media, 'id' | 'contentType' | 'src' | 'width' | 'height' | 'alt'>>;
7698
+ media?: Maybe<Pick<Media, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
7697
7699
  };
7698
7700
 
7699
7701
  type BorderStyle = StateProp<Border> | ResponsiveStateProp<Border>;
@@ -9405,7 +9407,7 @@ type RequiredCursorEdge<T> = {
9405
9407
  };
9406
9408
  declare const fetchVariants: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchProductParams) => Promise<RequiredCursorEdge<VariantSelectFragment>[]>;
9407
9409
  declare const fetchMedias: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchProductParams) => Promise<(Pick<MediaEdge, "cursor"> & {
9408
- node?: Maybe<Pick<Media, "width" | "height" | "id" | "contentType" | "src" | "alt">>;
9410
+ node?: Maybe<Pick<Media, "width" | "height" | "id" | "contentType" | "previewImage" | "src" | "alt">>;
9409
9411
  })[]>;
9410
9412
 
9411
9413
  type FetchProductsParams = {
@@ -9602,11 +9604,11 @@ declare const useSelectedOption: () => {
9602
9604
  };
9603
9605
  declare const useVariants: () => Maybe<Pick<ProductVariant, "title" | "width" | "length" | "weight" | "height" | "id" | "barcode" | "baseID" | "costPrice" | "inventoryPolicy" | "inventoryQuantity" | "inventoryStatus" | "isDigital" | "lowInventoryAmount" | "manageInventory" | "mediaId" | "platform" | "price" | "salePrice" | "sku" | "soldIndividually"> & {
9604
9606
  selectedOptions: Pick<SelectedOption, "value" | "name" | "optionType">[];
9605
- media?: Maybe<Pick<Media, "width" | "height" | "id" | "contentType" | "src" | "alt">>;
9607
+ media?: Maybe<Pick<Media, "width" | "height" | "id" | "contentType" | "previewImage" | "src" | "alt">>;
9606
9608
  }>[];
9607
9609
  declare const useVariant: (id: string) => Maybe<Pick<ProductVariant, "title" | "width" | "length" | "weight" | "height" | "id" | "barcode" | "baseID" | "costPrice" | "inventoryPolicy" | "inventoryQuantity" | "inventoryStatus" | "isDigital" | "lowInventoryAmount" | "manageInventory" | "mediaId" | "platform" | "price" | "salePrice" | "sku" | "soldIndividually"> & {
9608
9610
  selectedOptions: Pick<SelectedOption, "value" | "name" | "optionType">[];
9609
- media?: Maybe<Pick<Media, "width" | "height" | "id" | "contentType" | "src" | "alt">>;
9611
+ media?: Maybe<Pick<Media, "width" | "height" | "id" | "contentType" | "previewImage" | "src" | "alt">>;
9610
9612
  }>;
9611
9613
  declare const useCurrentVariant: () => Maybe<VariantSelectFragment>;
9612
9614
  declare const useCurrentVariantInStock: () => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.17.9",
3
+ "version": "1.18.0",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@gem-sdk/adapter-shopify": "1.12.0",
28
- "@gem-sdk/styles": "1.17.7"
28
+ "@gem-sdk/styles": "1.17.10"
29
29
  },
30
30
  "dependencies": {
31
31
  "react-error-boundary": "4.0.10",