@gem-sdk/core 1.58.0-dev.36 → 1.58.0-dev.40

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.
@@ -26,6 +26,9 @@
26
26
  customCode {
27
27
  ...CustomCodeSelect
28
28
  }
29
+ customFonts {
30
+ ...CustomFontSelect
31
+ }
29
32
  }
30
33
  `;
31
34
 
@@ -4,6 +4,7 @@ var previewThemePage_generated = require('../fragments/preview-theme-page.genera
4
4
  var dataSeo_generated = require('../fragments/data-seo.generated.js');
5
5
  var analytic_generated = require('../fragments/analytic.generated.js');
6
6
  var customCode_generated = require('../fragments/custom-code.generated.js');
7
+ var customFont_generated = require('../fragments/custom-font.generated.js');
7
8
 
8
9
  const PreviewThemePageDocument = `
9
10
  query PreviewThemePage($pageType: PreviewThemePageType!, $handleURL: String) {
@@ -14,6 +15,7 @@ const PreviewThemePageDocument = `
14
15
  ${previewThemePage_generated.PreviewThemePageSelect}
15
16
  ${dataSeo_generated.DataSeoSelect}
16
17
  ${analytic_generated.AnalyticSelect}
17
- ${customCode_generated.CustomCodeSelect}`;
18
+ ${customCode_generated.CustomCodeSelect}
19
+ ${customFont_generated.CustomFontSelect}`;
18
20
 
19
21
  exports.PreviewThemePageDocument = PreviewThemePageDocument;
@@ -1,8 +1,10 @@
1
1
  'use strict';
2
2
 
3
+ var useSWR = require('swr');
3
4
  var getCollection = require('./queries/get-collection.js');
4
5
  var getProduct = require('./queries/get-product.js');
5
6
  var getProducts = require('./queries/get-products.js');
7
+ var query = require('./query.js');
6
8
 
7
9
  const prefetchQueries = (input, options)=>{
8
10
  const queries = [];
@@ -19,7 +21,7 @@ const prefetchQueries = (input, options)=>{
19
21
  isStorefront: options?.isStorefront
20
22
  };
21
23
  data = {
22
- key: `query/product/${variables.id}`,
24
+ key: useSWR.unstable_serialize(query.generateProductQueryKey(variables)),
23
25
  func: getProduct.getProduct,
24
26
  variables
25
27
  };
@@ -37,7 +39,7 @@ const prefetchQueries = (input, options)=>{
37
39
  isStorefront: options?.isStorefront
38
40
  };
39
41
  data = {
40
- key: `query/collection/${variables.id}`,
42
+ key: useSWR.unstable_serialize(query.generateCollectionQueryKey(variables)),
41
43
  func: getCollection.getCollection,
42
44
  variables
43
45
  };
@@ -50,7 +52,7 @@ const prefetchQueries = (input, options)=>{
50
52
  isStorefront: options?.isStorefront
51
53
  };
52
54
  data = {
53
- key: `query/products/${variables.ids.join(',')}`,
55
+ key: useSWR.unstable_serialize(query.generateProductsQueryKey(variables)),
54
56
  func: getProducts.getProducts,
55
57
  variables
56
58
  };
@@ -24,6 +24,9 @@
24
24
  customCode {
25
25
  ...CustomCodeSelect
26
26
  }
27
+ customFonts {
28
+ ...CustomFontSelect
29
+ }
27
30
  }
28
31
  `;
29
32
 
@@ -2,6 +2,7 @@ import { PreviewThemePageSelect } from '../fragments/preview-theme-page.generate
2
2
  import { DataSeoSelect } from '../fragments/data-seo.generated.js';
3
3
  import { AnalyticSelect } from '../fragments/analytic.generated.js';
4
4
  import { CustomCodeSelect } from '../fragments/custom-code.generated.js';
5
+ import { CustomFontSelect } from '../fragments/custom-font.generated.js';
5
6
 
6
7
  const PreviewThemePageDocument = `
7
8
  query PreviewThemePage($pageType: PreviewThemePageType!, $handleURL: String) {
@@ -12,6 +13,7 @@ const PreviewThemePageDocument = `
12
13
  ${PreviewThemePageSelect}
13
14
  ${DataSeoSelect}
14
15
  ${AnalyticSelect}
15
- ${CustomCodeSelect}`;
16
+ ${CustomCodeSelect}
17
+ ${CustomFontSelect}`;
16
18
 
17
19
  export { PreviewThemePageDocument };
@@ -1,6 +1,8 @@
1
+ import { unstable_serialize } from 'swr';
1
2
  import { getCollection } from './queries/get-collection.js';
2
3
  import { getProduct } from './queries/get-product.js';
3
4
  import { getProducts } from './queries/get-products.js';
5
+ import { generateCollectionQueryKey, generateProductsQueryKey, generateProductQueryKey } from './query.js';
4
6
 
5
7
  const prefetchQueries = (input, options)=>{
6
8
  const queries = [];
@@ -17,7 +19,7 @@ const prefetchQueries = (input, options)=>{
17
19
  isStorefront: options?.isStorefront
18
20
  };
19
21
  data = {
20
- key: `query/product/${variables.id}`,
22
+ key: unstable_serialize(generateProductQueryKey(variables)),
21
23
  func: getProduct,
22
24
  variables
23
25
  };
@@ -35,7 +37,7 @@ const prefetchQueries = (input, options)=>{
35
37
  isStorefront: options?.isStorefront
36
38
  };
37
39
  data = {
38
- key: `query/collection/${variables.id}`,
40
+ key: unstable_serialize(generateCollectionQueryKey(variables)),
39
41
  func: getCollection,
40
42
  variables
41
43
  };
@@ -48,7 +50,7 @@ const prefetchQueries = (input, options)=>{
48
50
  isStorefront: options?.isStorefront
49
51
  };
50
52
  data = {
51
- key: `query/products/${variables.ids.join(',')}`,
53
+ key: unstable_serialize(generateProductsQueryKey(variables)),
52
54
  func: getProducts,
53
55
  variables
54
56
  };
@@ -7859,6 +7859,12 @@ type SelectVariantControlType = {
7859
7859
  hide?: boolean;
7860
7860
  };
7861
7861
 
7862
+ type VariantListingControlType = {
7863
+ id: string;
7864
+ type: 'variant:listing';
7865
+ label?: string;
7866
+ };
7867
+
7862
7868
  type BackgroundControlType<T> = SharedControlType<T> & {
7863
7869
  type: 'background';
7864
7870
  value?: Background;
@@ -8893,7 +8899,7 @@ type ImageV2ControlType<T> = SharedControlType<T> & {
8893
8899
  type: 'image-v2';
8894
8900
  };
8895
8901
 
8896
- type ControlProp<T> = ProductBundleChildControlType<T> | SelectProductBundleControlType<T> | AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | OpenLinkControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | LayoutBannerControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | VariantSwatchesOnlyDefaultVariantControlType<T> | ProductListControlType<T> | ArticleListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting$1<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | BackgroundColorPickerType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | SneakPeakControlType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | PostPurchaseTextareaControlType<T> | NotesControlType<T> | ButtonLayoutType<T> | ShapeSelectorControlType<T> | DisplayTriggerControlType<T> | CustomPositionControlType<T> | DealControlType<T> | ProductHandleType<T> | ColorPickerV2ControlType<T> | BorderV2ControlType<T> | CornerV2ControlType<T> | PaddingV2ControlType<T> | BackgroundImageType<T> | BackgroundVideoType<T> | ShadowV2ControlType<T> | BackgroundMediaControlType<T> | BackgroundVideoType<T> | SwitchControlType<T> | ImageV2ControlType<T>;
8902
+ type ControlProp<T> = ProductBundleChildControlType<T> | SelectProductBundleControlType<T> | AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | OpenLinkControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | VariantListingControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | LayoutBannerControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | VariantSwatchesOnlyDefaultVariantControlType<T> | ProductListControlType<T> | ArticleListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting$1<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | BackgroundColorPickerType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | SneakPeakControlType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | PostPurchaseTextareaControlType<T> | NotesControlType<T> | ButtonLayoutType<T> | ShapeSelectorControlType<T> | DisplayTriggerControlType<T> | CustomPositionControlType<T> | DealControlType<T> | ProductHandleType<T> | ColorPickerV2ControlType<T> | BorderV2ControlType<T> | CornerV2ControlType<T> | PaddingV2ControlType<T> | BackgroundImageType<T> | BackgroundVideoType<T> | ShadowV2ControlType<T> | BackgroundMediaControlType<T> | BackgroundVideoType<T> | SwitchControlType<T> | ImageV2ControlType<T>;
8897
8903
  type ControlTriggerAction = {
8898
8904
  controlId: string;
8899
8905
  newValue?: any;
@@ -32205,6 +32211,7 @@ type PreviewThemePageQueryResponse = {
32205
32211
  themeStyle?: Maybe$1<Pick<PreviewThemeStyle, 'id' | 'data' | 'name'>>;
32206
32212
  analytic?: Maybe$1<Pick<Analytic$1, 'fbPixelID' | 'gaTrackingID' | 'tiktokPixelID'>>;
32207
32213
  customCode?: Maybe$1<Pick<CustomCode$1, 'body' | 'header'>>;
32214
+ customFonts?: Maybe$1<Array<Maybe$1<Pick<CustomFont$1, 'backupFilePath' | 'fontFamily' | 'fontStyle' | 'fontWeight' | 'mimeType' | 'filePath'>>>>;
32208
32215
  }>;
32209
32216
  };
32210
32217
  declare const PreviewThemePageDocument: string;
@@ -41875,7 +41882,7 @@ declare const useBlogsQuery: (variables: BlogsQueryVariables | null, options?: S
41875
41882
  type Func$6 = ReturnType<typeof addToCartOperation>;
41876
41883
  type Response$6 = Awaited<ReturnType<Func$6>>;
41877
41884
  type Args$5 = Parameters<Func$6>[0];
41878
- declare const useAddToCart: (options?: SWRMutationConfiguration<Response$6, any, Args$5, 'add-to-cart'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.AddCartLineInput, "add-to-cart">;
41885
+ declare const useAddToCart: (options?: SWRMutationConfiguration<Response$6, any, 'add-to-cart', Args$5>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "add-to-cart", _gem_sdk_adapter_common_dist_types_types_cart.AddCartLineInput>;
41879
41886
 
41880
41887
  type Func$5 = ReturnType<typeof getCartOperation>;
41881
41888
  type Response$5 = Awaited<ReturnType<Func$5>>;
@@ -41884,27 +41891,27 @@ declare const useCartData: (options?: SWRConfiguration<Response$5 | undefined, a
41884
41891
  type Func$4 = ReturnType<typeof cartDiscountCodesUpdateOperation>;
41885
41892
  type Response$4 = Awaited<ReturnType<Func$4>>;
41886
41893
  type Args$4 = Parameters<Func$4>[0];
41887
- declare const useCartDiscountCodesUpdate: (options?: SWRMutationConfiguration<Response$4, any, Args$4, 'cart-discount-codes-update'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.CartDiscountCodesUpdateInput, "cart-discount-codes-update">;
41894
+ declare const useCartDiscountCodesUpdate: (options?: SWRMutationConfiguration<Response$4, any, 'cart-discount-codes-update', Args$4>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "cart-discount-codes-update", _gem_sdk_adapter_common_dist_types_types_cart.CartDiscountCodesUpdateInput>;
41888
41895
 
41889
41896
  type Func$3 = ReturnType<typeof cartNoteUpdateOperation>;
41890
41897
  type Response$3 = Awaited<ReturnType<Func$3>>;
41891
41898
  type Args$3 = Parameters<Func$3>[0];
41892
- declare const useCartNoteUpdate: (options?: SWRMutationConfiguration<Response$3, any, Args$3, 'cart-note-update'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.CartNoteUpdateInput, "cart-note-update">;
41899
+ declare const useCartNoteUpdate: (options?: SWRMutationConfiguration<Response$3, any, 'cart-note-update', Args$3>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "cart-note-update", _gem_sdk_adapter_common_dist_types_types_cart.CartNoteUpdateInput>;
41893
41900
 
41894
41901
  type Func$2 = ReturnType<typeof createCartOperation>;
41895
41902
  type Response$2 = Awaited<ReturnType<Func$2>>;
41896
41903
  type Args$2 = Parameters<Func$2>[0];
41897
- declare const useCreateCart: (options?: SWRMutationConfiguration<Response$2, any, Args$2, 'create-cart'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.CreateCartInput, "create-cart">;
41904
+ declare const useCreateCart: (options?: SWRMutationConfiguration<Response$2, any, 'create-cart', Args$2>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "create-cart", _gem_sdk_adapter_common_dist_types_types_cart.CreateCartInput>;
41898
41905
 
41899
41906
  type Func$1 = ReturnType<typeof removeCartItemOperation>;
41900
41907
  type Response$1 = Awaited<ReturnType<Func$1>>;
41901
41908
  type Args$1 = Parameters<Func$1>[0];
41902
- declare const useRemoveCartItem: (options?: SWRMutationConfiguration<Response$1, any, Args$1, 'remove-cart-item'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.RemoveCartLineInput, "remove-cart-item">;
41909
+ declare const useRemoveCartItem: (options?: SWRMutationConfiguration<Response$1, any, 'remove-cart-item', Args$1>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "remove-cart-item", _gem_sdk_adapter_common_dist_types_types_cart.RemoveCartLineInput>;
41903
41910
 
41904
41911
  type Func = ReturnType<typeof updateCartLineOperation>;
41905
41912
  type Response = Awaited<ReturnType<Func>>;
41906
41913
  type Args = Parameters<Func>[0];
41907
- declare const useUpdateCartItem: (options?: SWRMutationConfiguration<Response, any, Args, 'update-cart-item'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.UpdateCartLineInput, "update-cart-item">;
41914
+ declare const useUpdateCartItem: (options?: SWRMutationConfiguration<Response, any, 'update-cart-item', Args>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "update-cart-item", _gem_sdk_adapter_common_dist_types_types_cart.UpdateCartLineInput>;
41908
41915
 
41909
41916
  declare const useLocale: () => {
41910
41917
  locale: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.58.0-dev.36",
3
+ "version": "1.58.0-dev.40",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -36,7 +36,7 @@
36
36
  "cssjson": "2.1.3",
37
37
  "dayjs": "^1.11.11",
38
38
  "react-error-boundary": "4.0.10",
39
- "swr": "2.1.2",
39
+ "swr": "2.2.0",
40
40
  "vanilla-lazyload": "17.8.3",
41
41
  "zustand": "4.3.9"
42
42
  },