@gem-sdk/core 1.58.0-dev.38 → 1.58.0-dev.43

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;
@@ -112,12 +112,23 @@ function composeAdvanceStyle(data, tag, pageType) {
112
112
  Object.assign(styles, radius.composeRadius(value));
113
113
  }
114
114
  if (attr === 'boxShadow') {
115
- const listElementShadowV2 = [
116
- 'Row',
115
+ const baseElements = [
117
116
  'Section',
117
+ 'Row',
118
118
  'Text',
119
119
  'Heading',
120
- 'Image'
120
+ 'Image',
121
+ 'Button'
122
+ ];
123
+ const productElements = [
124
+ 'ProductTitle',
125
+ 'ProductDescription',
126
+ 'ProductPrice',
127
+ 'ProductVendor'
128
+ ];
129
+ const listElementShadowV2 = [
130
+ ...baseElements,
131
+ ...productElements
121
132
  ];
122
133
  let hasBoxShadowV2 = hasBoxShadow;
123
134
  if (listElementShadowV2.includes(tag || '')) {
@@ -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 };
@@ -110,12 +110,23 @@ function composeAdvanceStyle(data, tag, pageType) {
110
110
  Object.assign(styles, composeRadius(value));
111
111
  }
112
112
  if (attr === 'boxShadow') {
113
- const listElementShadowV2 = [
114
- 'Row',
113
+ const baseElements = [
115
114
  'Section',
115
+ 'Row',
116
116
  'Text',
117
117
  'Heading',
118
- 'Image'
118
+ 'Image',
119
+ 'Button'
120
+ ];
121
+ const productElements = [
122
+ 'ProductTitle',
123
+ 'ProductDescription',
124
+ 'ProductPrice',
125
+ 'ProductVendor'
126
+ ];
127
+ const listElementShadowV2 = [
128
+ ...baseElements,
129
+ ...productElements
119
130
  ];
120
131
  let hasBoxShadowV2 = hasBoxShadow;
121
132
  if (listElementShadowV2.includes(tag || '')) {
@@ -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
  };
@@ -8110,6 +8110,7 @@ type TypographyV2ControlType<T> = SharedControlType<T> & {
8110
8110
  color?: boolean;
8111
8111
  transform?: boolean;
8112
8112
  fontWeight?: boolean;
8113
+ textShadow?: boolean;
8113
8114
  };
8114
8115
  disableCollapse?: boolean;
8115
8116
  };
@@ -8548,6 +8549,7 @@ type SettingUIControl = {
8548
8549
  updateFields?: {
8549
8550
  field: string;
8550
8551
  settingId: string;
8552
+ state?: SettingStateType;
8551
8553
  }[];
8552
8554
  };
8553
8555
  setting?: {
@@ -8568,6 +8570,7 @@ type ControlTriggerAction$1 = {
8568
8570
  groupType: string;
8569
8571
  valueIfNull?: any;
8570
8572
  removeDevice?: boolean;
8573
+ state?: SettingStateType;
8571
8574
  };
8572
8575
  type ControlTriggerSetting = {
8573
8576
  source?: string[];
@@ -32211,6 +32214,7 @@ type PreviewThemePageQueryResponse = {
32211
32214
  themeStyle?: Maybe$1<Pick<PreviewThemeStyle, 'id' | 'data' | 'name'>>;
32212
32215
  analytic?: Maybe$1<Pick<Analytic$1, 'fbPixelID' | 'gaTrackingID' | 'tiktokPixelID'>>;
32213
32216
  customCode?: Maybe$1<Pick<CustomCode$1, 'body' | 'header'>>;
32217
+ customFonts?: Maybe$1<Array<Maybe$1<Pick<CustomFont$1, 'backupFilePath' | 'fontFamily' | 'fontStyle' | 'fontWeight' | 'mimeType' | 'filePath'>>>>;
32214
32218
  }>;
32215
32219
  };
32216
32220
  declare const PreviewThemePageDocument: string;
@@ -41881,7 +41885,7 @@ declare const useBlogsQuery: (variables: BlogsQueryVariables | null, options?: S
41881
41885
  type Func$6 = ReturnType<typeof addToCartOperation>;
41882
41886
  type Response$6 = Awaited<ReturnType<Func$6>>;
41883
41887
  type Args$5 = Parameters<Func$6>[0];
41884
- 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">;
41888
+ 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>;
41885
41889
 
41886
41890
  type Func$5 = ReturnType<typeof getCartOperation>;
41887
41891
  type Response$5 = Awaited<ReturnType<Func$5>>;
@@ -41890,27 +41894,27 @@ declare const useCartData: (options?: SWRConfiguration<Response$5 | undefined, a
41890
41894
  type Func$4 = ReturnType<typeof cartDiscountCodesUpdateOperation>;
41891
41895
  type Response$4 = Awaited<ReturnType<Func$4>>;
41892
41896
  type Args$4 = Parameters<Func$4>[0];
41893
- 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">;
41897
+ 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>;
41894
41898
 
41895
41899
  type Func$3 = ReturnType<typeof cartNoteUpdateOperation>;
41896
41900
  type Response$3 = Awaited<ReturnType<Func$3>>;
41897
41901
  type Args$3 = Parameters<Func$3>[0];
41898
- 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">;
41902
+ 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>;
41899
41903
 
41900
41904
  type Func$2 = ReturnType<typeof createCartOperation>;
41901
41905
  type Response$2 = Awaited<ReturnType<Func$2>>;
41902
41906
  type Args$2 = Parameters<Func$2>[0];
41903
- 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">;
41907
+ 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>;
41904
41908
 
41905
41909
  type Func$1 = ReturnType<typeof removeCartItemOperation>;
41906
41910
  type Response$1 = Awaited<ReturnType<Func$1>>;
41907
41911
  type Args$1 = Parameters<Func$1>[0];
41908
- 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">;
41912
+ 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>;
41909
41913
 
41910
41914
  type Func = ReturnType<typeof updateCartLineOperation>;
41911
41915
  type Response = Awaited<ReturnType<Func>>;
41912
41916
  type Args = Parameters<Func>[0];
41913
- 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">;
41917
+ 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>;
41914
41918
 
41915
41919
  declare const useLocale: () => {
41916
41920
  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.38",
3
+ "version": "1.58.0-dev.43",
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
  },