@gem-sdk/core 2.0.0-dev.460 → 2.0.0-dev.464

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.
@@ -247,6 +247,10 @@ const ComponentToolbarPreview = (props)=>{
247
247
  }
248
248
  return -1;
249
249
  };
250
+ const getToolbarParentLabel = (parent)=>{
251
+ const parentLength = parent?.childrens?.length ?? 0;
252
+ return parent.label === 'Row' ? `Row ${parentLength} col${parentLength === 1 ? '' : 's'}` : parent.label;
253
+ };
250
254
  const onShowParent = (e)=>{
251
255
  if (!parents.length) return;
252
256
  const $target = (e?.target) || null;
@@ -512,12 +516,6 @@ const ComponentToolbarPreview = (props)=>{
512
516
  ]
513
517
  }),
514
518
  isActiveToolbarComponent && isShowParent && parents.map((parent, index)=>{
515
- // Update count columns of Row
516
- const parentLength = parent?.childrens?.length ?? 0;
517
- let parent_label = parent.label;
518
- if (parent.label === 'Row') {
519
- parent_label = parentLength <= 1 ? parent.label + ' ' + parentLength + ' col' : parent.label + ' ' + parentLength + ' cols';
520
- }
521
519
  return /*#__PURE__*/ jsxRuntime.jsxs("div", {
522
520
  "data-toolbar-parent": true,
523
521
  "data-component-tag": parent.tag,
@@ -566,7 +564,7 @@ const ComponentToolbarPreview = (props)=>{
566
564
  }),
567
565
  /*#__PURE__*/ jsxRuntime.jsx("div", {
568
566
  "data-toolbar-name": true,
569
- children: parent_label
567
+ children: getToolbarParentLabel(parent)
570
568
  })
571
569
  ]
572
570
  }, parent.uid);
@@ -10,26 +10,10 @@ var BuilderComponent = require('../contexts/BuilderComponent.js');
10
10
  var BuilderPreviewContext = require('../contexts/BuilderPreviewContext.js');
11
11
  var ComponentWrapperPreview = require('./ComponentWrapperPreview.js');
12
12
  var RenderSection = require('./RenderSection.js');
13
- require('zustand');
14
- var I18nContext = require('../contexts/I18nContext.js');
15
- require('swr');
16
- require('@gem-sdk/adapter-shopify');
17
- require('swr/mutation');
18
- require('swr/infinite');
19
- require('vanilla-lazyload');
20
- require('../hooks/useCartUI.js');
21
- var useI18n = require('../hooks/useI18n.js');
22
- require('react-transition-group');
23
- require('@gem-sdk/core');
24
- require('classnames');
25
- require('dayjs');
26
- require('../helpers/convert.js');
27
13
 
28
14
  const RenderPreview = ({ uid, ...passProps })=>{
29
15
  const item = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getItem(uid));
30
- BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getState());
31
16
  const Component = BuilderComponent.useBuilderComponent(item?.tag);
32
- const { t } = useI18n.useI18n();
33
17
  if (!item) return null;
34
18
  if (item?.type === 'section') {
35
19
  return /*#__PURE__*/ jsxRuntime.jsx(RenderSection.default, {
@@ -51,31 +35,28 @@ const RenderPreview = ({ uid, ...passProps })=>{
51
35
  })
52
36
  ]
53
37
  }),
54
- children: /*#__PURE__*/ jsxRuntime.jsx(I18nContext.I18nProvider, {
55
- t: t,
56
- children: /*#__PURE__*/ jsxRuntime.jsx(ComponentWrapperPreview.default, {
57
- ...item,
58
- children: item?.childrens?.length ? /*#__PURE__*/ jsxRuntime.jsx(Component, {
59
- builderProps: {
60
- uid,
61
- builderData: item
62
- },
63
- styles: item.styles,
64
- setting: item.settings,
65
- ...passProps,
66
- children: item.childrens.map((id)=>/*#__PURE__*/ jsxRuntime.jsx(RenderPreviewMemo, {
67
- "bundle-item": passProps?.['bundle-item'],
68
- uid: id
69
- }, id))
70
- }) : /*#__PURE__*/ jsxRuntime.jsx(Component, {
71
- builderProps: {
72
- uid,
73
- builderData: item
74
- },
75
- styles: item.styles,
76
- setting: item.settings,
77
- ...passProps
78
- })
38
+ children: /*#__PURE__*/ jsxRuntime.jsx(ComponentWrapperPreview.default, {
39
+ ...item,
40
+ children: item?.childrens?.length ? /*#__PURE__*/ jsxRuntime.jsx(Component, {
41
+ builderProps: {
42
+ uid,
43
+ builderData: item
44
+ },
45
+ styles: item.styles,
46
+ setting: item.settings,
47
+ ...passProps,
48
+ children: item.childrens.map((id)=>/*#__PURE__*/ jsxRuntime.jsx(RenderPreviewMemo, {
49
+ "bundle-item": passProps?.['bundle-item'],
50
+ uid: id
51
+ }, id))
52
+ }) : /*#__PURE__*/ jsxRuntime.jsx(Component, {
53
+ builderProps: {
54
+ uid,
55
+ builderData: item
56
+ },
57
+ styles: item.styles,
58
+ setting: item.settings,
59
+ ...passProps
79
60
  })
80
61
  })
81
62
  }, item.uid);
@@ -16,6 +16,7 @@ var useGettingGenerateRequest = require('./hooks/useGettingGenerateRequest.js');
16
16
  var useFlipPopup = require('./hooks/useFlipPopup.js');
17
17
  var useCheckingProductInside = require('./hooks/useCheckingProductInside.js');
18
18
  require('zustand');
19
+ var I18nContext = require('../../contexts/I18nContext.js');
19
20
  require('react-transition-group');
20
21
  require('@gem-sdk/core');
21
22
  var ShopContext = require('../../contexts/ShopContext.js');
@@ -36,6 +37,7 @@ const AIContentGenerator = ({ ...props })=>{
36
37
  const genPopupHeader = react.useRef(null);
37
38
  const genButtonWrapper = react.useRef(null);
38
39
  const nextMonth = dayjs().add(1, 'month').startOf('month').format('DD MMM');
40
+ const { t } = I18nContext.useI18nStore();
39
41
  const { popupPositionX, popupPositionY, isValidating: isValidatingFlipPopup, bodyMaxHeight: popupBodyMaxHeight } = useFlipPopup.useFlipPopup(isShowPopup, {
40
42
  genTool,
41
43
  genPopup,
@@ -117,7 +119,7 @@ const AIContentGenerator = ({ ...props })=>{
117
119
  onClick: togglePopup,
118
120
  children: [
119
121
  /*#__PURE__*/ jsxRuntime.jsx(AIIcon.AIIcon, {}),
120
- "AI Content"
122
+ t('AI Content')
121
123
  ]
122
124
  })
123
125
  }),
@@ -29,7 +29,7 @@ const transitions = {
29
29
  }
30
30
  };
31
31
  const ThemeSectionTooltip = ({ isShow, isFreeLimit, isRender, children, limitCreateThemeSection, onMouseEnter, onMouseLeave, onActions })=>{
32
- const { t } = core.useI18n();
32
+ const { t } = core.useI18nStore();
33
33
  const nodeRef = react.useRef(null);
34
34
  const actionBtnLabel = isFreeLimit ? 'Upgrade to create Theme Section' : 'Create Theme Section';
35
35
  const openHelpCenter = ()=>{
@@ -27,7 +27,7 @@ const I18nProvider = ({ children, t })=>{
27
27
  const useI18nStore = ()=>{
28
28
  const store = react.useContext(I18nContext);
29
29
  if (!store) {
30
- throw new Error('Element of article must be used inside a Article');
30
+ throw new Error('useI18nStore must be used inside a I18nProvider');
31
31
  }
32
32
  return zustand.useStore(store);
33
33
  };
@@ -143,7 +143,7 @@ const ProductProvider = ({ children, product, initialVariantId, quantity = 1, is
143
143
  const firstVariant = variants[0];
144
144
  const firstVariantInStock = variants.find((item)=>variant.checkInStock(item));
145
145
  const initialVariant = variants.find((v)=>v?.id === initialVariantId) ?? firstVariantInStock ?? firstVariant;
146
- selectedOptions = initialVariant?.selectedOptions.reduce((acc, option)=>{
146
+ selectedOptions = initialVariant?.selectedOptions?.reduce((acc, option)=>{
147
147
  if (option.name) {
148
148
  return {
149
149
  ...acc,
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  var react = require('react');
@@ -9,10 +10,12 @@ const useI18n = ()=>{
9
10
  if (!detail) return;
10
11
  setI18n(detail);
11
12
  };
12
- const t = (string)=>{
13
+ const t = react.useCallback((string)=>{
13
14
  if (!i18n) return string;
14
15
  return i18n?.t(string);
15
- };
16
+ }, [
17
+ i18n
18
+ ]);
16
19
  react.useEffect(()=>{
17
20
  window.addEventListener('editor:change-language', handleChangeLanguage);
18
21
  return ()=>{
@@ -243,6 +243,10 @@ const ComponentToolbarPreview = (props)=>{
243
243
  }
244
244
  return -1;
245
245
  };
246
+ const getToolbarParentLabel = (parent)=>{
247
+ const parentLength = parent?.childrens?.length ?? 0;
248
+ return parent.label === 'Row' ? `Row ${parentLength} col${parentLength === 1 ? '' : 's'}` : parent.label;
249
+ };
246
250
  const onShowParent = (e)=>{
247
251
  if (!parents.length) return;
248
252
  const $target = (e?.target) || null;
@@ -508,12 +512,6 @@ const ComponentToolbarPreview = (props)=>{
508
512
  ]
509
513
  }),
510
514
  isActiveToolbarComponent && isShowParent && parents.map((parent, index)=>{
511
- // Update count columns of Row
512
- const parentLength = parent?.childrens?.length ?? 0;
513
- let parent_label = parent.label;
514
- if (parent.label === 'Row') {
515
- parent_label = parentLength <= 1 ? parent.label + ' ' + parentLength + ' col' : parent.label + ' ' + parentLength + ' cols';
516
- }
517
515
  return /*#__PURE__*/ jsxs("div", {
518
516
  "data-toolbar-parent": true,
519
517
  "data-component-tag": parent.tag,
@@ -562,7 +560,7 @@ const ComponentToolbarPreview = (props)=>{
562
560
  }),
563
561
  /*#__PURE__*/ jsx("div", {
564
562
  "data-toolbar-name": true,
565
- children: parent_label
563
+ children: getToolbarParentLabel(parent)
566
564
  })
567
565
  ]
568
566
  }, parent.uid);
@@ -6,26 +6,10 @@ import { useBuilderComponent } from '../contexts/BuilderComponent.js';
6
6
  import { useBuilderPreviewStore } from '../contexts/BuilderPreviewContext.js';
7
7
  import ComponentWrapperPreview from './ComponentWrapperPreview.js';
8
8
  import RenderSectionMemo from './RenderSection.js';
9
- import 'zustand';
10
- import { I18nProvider } from '../contexts/I18nContext.js';
11
- import 'swr';
12
- import '@gem-sdk/adapter-shopify';
13
- import 'swr/mutation';
14
- import 'swr/infinite';
15
- import 'vanilla-lazyload';
16
- import '../hooks/useCartUI.js';
17
- import { useI18n } from '../hooks/useI18n.js';
18
- import 'react-transition-group';
19
- import '@gem-sdk/core';
20
- import 'classnames';
21
- import 'dayjs';
22
- import '../helpers/convert.js';
23
9
 
24
10
  const RenderPreview = ({ uid, ...passProps })=>{
25
11
  const item = useBuilderPreviewStore((s)=>s.getItem(uid));
26
- useBuilderPreviewStore((s)=>s.getState());
27
12
  const Component = useBuilderComponent(item?.tag);
28
- const { t } = useI18n();
29
13
  if (!item) return null;
30
14
  if (item?.type === 'section') {
31
15
  return /*#__PURE__*/ jsx(RenderSectionMemo, {
@@ -47,31 +31,28 @@ const RenderPreview = ({ uid, ...passProps })=>{
47
31
  })
48
32
  ]
49
33
  }),
50
- children: /*#__PURE__*/ jsx(I18nProvider, {
51
- t: t,
52
- children: /*#__PURE__*/ jsx(ComponentWrapperPreview, {
53
- ...item,
54
- children: item?.childrens?.length ? /*#__PURE__*/ jsx(Component, {
55
- builderProps: {
56
- uid,
57
- builderData: item
58
- },
59
- styles: item.styles,
60
- setting: item.settings,
61
- ...passProps,
62
- children: item.childrens.map((id)=>/*#__PURE__*/ jsx(RenderPreviewMemo, {
63
- "bundle-item": passProps?.['bundle-item'],
64
- uid: id
65
- }, id))
66
- }) : /*#__PURE__*/ jsx(Component, {
67
- builderProps: {
68
- uid,
69
- builderData: item
70
- },
71
- styles: item.styles,
72
- setting: item.settings,
73
- ...passProps
74
- })
34
+ children: /*#__PURE__*/ jsx(ComponentWrapperPreview, {
35
+ ...item,
36
+ children: item?.childrens?.length ? /*#__PURE__*/ jsx(Component, {
37
+ builderProps: {
38
+ uid,
39
+ builderData: item
40
+ },
41
+ styles: item.styles,
42
+ setting: item.settings,
43
+ ...passProps,
44
+ children: item.childrens.map((id)=>/*#__PURE__*/ jsx(RenderPreviewMemo, {
45
+ "bundle-item": passProps?.['bundle-item'],
46
+ uid: id
47
+ }, id))
48
+ }) : /*#__PURE__*/ jsx(Component, {
49
+ builderProps: {
50
+ uid,
51
+ builderData: item
52
+ },
53
+ styles: item.styles,
54
+ setting: item.settings,
55
+ ...passProps
75
56
  })
76
57
  })
77
58
  }, item.uid);
@@ -14,6 +14,7 @@ import { useGettingGenerateRequest } from './hooks/useGettingGenerateRequest.js'
14
14
  import { useFlipPopup } from './hooks/useFlipPopup.js';
15
15
  import { useCheckingProductInside } from './hooks/useCheckingProductInside.js';
16
16
  import 'zustand';
17
+ import { useI18nStore } from '../../contexts/I18nContext.js';
17
18
  import 'react-transition-group';
18
19
  import '@gem-sdk/core';
19
20
  import { useShopStore } from '../../contexts/ShopContext.js';
@@ -34,6 +35,7 @@ const AIContentGenerator = ({ ...props })=>{
34
35
  const genPopupHeader = useRef(null);
35
36
  const genButtonWrapper = useRef(null);
36
37
  const nextMonth = dayjs().add(1, 'month').startOf('month').format('DD MMM');
38
+ const { t } = useI18nStore();
37
39
  const { popupPositionX, popupPositionY, isValidating: isValidatingFlipPopup, bodyMaxHeight: popupBodyMaxHeight } = useFlipPopup(isShowPopup, {
38
40
  genTool,
39
41
  genPopup,
@@ -115,7 +117,7 @@ const AIContentGenerator = ({ ...props })=>{
115
117
  onClick: togglePopup,
116
118
  children: [
117
119
  /*#__PURE__*/ jsx(AIIcon, {}),
118
- "AI Content"
120
+ t('AI Content')
119
121
  ]
120
122
  })
121
123
  }),
@@ -2,7 +2,7 @@
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
3
  import { useRef } from 'react';
4
4
  import { Transition } from 'react-transition-group';
5
- import { useI18n, cls } from '@gem-sdk/core';
5
+ import { useI18nStore, cls } from '@gem-sdk/core';
6
6
 
7
7
  const TRANSITION_DURATION = 350;
8
8
  const defaultStyles = {
@@ -27,7 +27,7 @@ const transitions = {
27
27
  }
28
28
  };
29
29
  const ThemeSectionTooltip = ({ isShow, isFreeLimit, isRender, children, limitCreateThemeSection, onMouseEnter, onMouseLeave, onActions })=>{
30
- const { t } = useI18n();
30
+ const { t } = useI18nStore();
31
31
  const nodeRef = useRef(null);
32
32
  const actionBtnLabel = isFreeLimit ? 'Upgrade to create Theme Section' : 'Create Theme Section';
33
33
  const openHelpCenter = ()=>{
@@ -25,7 +25,7 @@ const I18nProvider = ({ children, t })=>{
25
25
  const useI18nStore = ()=>{
26
26
  const store = useContext(I18nContext);
27
27
  if (!store) {
28
- throw new Error('Element of article must be used inside a Article');
28
+ throw new Error('useI18nStore must be used inside a I18nProvider');
29
29
  }
30
30
  return useStore(store);
31
31
  };
@@ -141,7 +141,7 @@ const ProductProvider = ({ children, product, initialVariantId, quantity = 1, is
141
141
  const firstVariant = variants[0];
142
142
  const firstVariantInStock = variants.find((item)=>checkInStock(item));
143
143
  const initialVariant = variants.find((v)=>v?.id === initialVariantId) ?? firstVariantInStock ?? firstVariant;
144
- selectedOptions = initialVariant?.selectedOptions.reduce((acc, option)=>{
144
+ selectedOptions = initialVariant?.selectedOptions?.reduce((acc, option)=>{
145
145
  if (option.name) {
146
146
  return {
147
147
  ...acc,
@@ -1,4 +1,5 @@
1
- import { useState, useEffect } from 'react';
1
+ 'use client';
2
+ import { useState, useCallback, useEffect } from 'react';
2
3
 
3
4
  const useI18n = ()=>{
4
5
  const [i18n, setI18n] = useState(null);
@@ -7,10 +8,12 @@ const useI18n = ()=>{
7
8
  if (!detail) return;
8
9
  setI18n(detail);
9
10
  };
10
- const t = (string)=>{
11
+ const t = useCallback((string)=>{
11
12
  if (!i18n) return string;
12
13
  return i18n?.t(string);
13
- };
14
+ }, [
15
+ i18n
16
+ ]);
14
17
  useEffect(()=>{
15
18
  window.addEventListener('editor:change-language', handleChangeLanguage);
16
19
  return ()=>{
@@ -34561,6 +34561,7 @@ type AddonProviderProps = Pick<AddonContextProps, 'components'> & {
34561
34561
  children: React.ReactNode;
34562
34562
  key?: React.Key;
34563
34563
  };
34564
+
34564
34565
  declare const AddonProvider: React.FC<AddonProviderProps>;
34565
34566
  declare const useAddons: () => Record<string, React.ComponentType<any>>;
34566
34567
  declare const useAddon: (id?: string) => React.FC<BaseProps & {
@@ -34575,6 +34576,7 @@ type BuilderComponentProviderProps = Pick<BuilderComponentProps, 'components'> &
34575
34576
  children: React.ReactNode;
34576
34577
  key?: React.Key;
34577
34578
  };
34579
+
34578
34580
  declare const BuilderComponentProvider: React.FC<BuilderComponentProviderProps>;
34579
34581
  declare const useBuilderComponent: (id?: string) => React.FC<BaseProps & {
34580
34582
  children?: React.ReactNode;
@@ -34593,6 +34595,7 @@ type BuilderProviderProps = Pick<BuilderContextProps, 'state' | 'isPostPurchase'
34593
34595
  lazy?: boolean;
34594
34596
  priority?: boolean;
34595
34597
  };
34598
+
34596
34599
  declare const BuilderProvider: React.FC<BuilderProviderProps>;
34597
34600
  declare const useBuilderStore: <U>(selector: (state: ExtractState<StoreApi<BuilderContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34598
34601
 
@@ -34633,6 +34636,7 @@ type BuilderPreviewProviderProps = Pick<BuilderPreviewContextProps, 'state'> & {
34633
34636
  isThemeSectionEditor?: boolean;
34634
34637
  pageName?: string;
34635
34638
  };
34639
+
34636
34640
  declare const BuilderPreviewProvider: React.FC<BuilderPreviewProviderProps>;
34637
34641
  declare const useBuilderPreviewStore: <U>(selector: (state: ExtractState<StoreApi<BuilderPreviewContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34638
34642
 
@@ -34642,6 +34646,7 @@ type CartLineContextProps = {
34642
34646
  type CartLineProviderProps = Pick<CartLineContextProps, 'line'> & {
34643
34647
  children: React.ReactNode;
34644
34648
  };
34649
+
34645
34650
  declare const CartLineProvider: React.FC<CartLineProviderProps>;
34646
34651
  declare const useCartLineStore: <U>(selector: (state: ExtractState<StoreApi<CartLineContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34647
34652
 
@@ -34723,11 +34728,10 @@ type ProductListContextProps = {
34723
34728
  type ProductListProviderProps = ProductListContextProps & {
34724
34729
  children: React.ReactNode;
34725
34730
  };
34731
+
34726
34732
  declare const ProductListProvider: React.FC<ProductListProviderProps>;
34727
34733
  declare const useProductListStore: <U>(selector: (state: ExtractState<StoreApi<ProductListContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34728
34734
 
34729
- type MediaSelectFragment = Pick<Media$1, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>;
34730
-
34731
34735
  type VariantSelectFragment = Pick<ProductVariant$1, 'id' | 'title' | 'barcode' | 'baseID' | 'costPrice' | 'height' | 'inventoryPolicy' | 'inventoryQuantity' | 'inventoryStatus' | 'isDigital' | 'length' | 'lowInventoryAmount' | 'manageInventory' | 'mediaId' | 'platform' | 'price' | 'salePrice' | 'sku' | 'soldIndividually' | 'weight' | 'width'> & {
34732
34736
  selectedOptions: Array<Pick<SelectedOption$1, 'name' | 'value' | 'optionType'>>;
34733
34737
  media?: Maybe$1<Pick<Media$1, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
@@ -34771,6 +34775,8 @@ type CollectionSelectFragment = Pick<Collection$1, 'id' | 'createdAt' | 'updated
34771
34775
  collectionMedia?: Maybe$1<Pick<CollectionMedia$1, 'src'>>;
34772
34776
  };
34773
34777
 
34778
+ type MediaSelectFragment = Pick<Media$1, 'id' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>;
34779
+
34774
34780
  type AttributeProp = {
34775
34781
  key: string;
34776
34782
  value?: string;
@@ -34811,20 +34817,22 @@ type ProductProviderProps = Pick<ProductContextProps, 'product' | 'quantity' | '
34811
34817
  readOnly?: boolean;
34812
34818
  children: React.ReactNode;
34813
34819
  };
34820
+
34814
34821
  declare const ProductProvider: React.FC<ProductProviderProps>;
34815
34822
  declare const useProductStore: <U>(selector: (state: ExtractState<StoreApi<ProductContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34816
34823
 
34824
+ type SectionProviderProps = {
34825
+ children: React.ReactNode;
34826
+ data?: SectionContextProps['data'];
34827
+ key?: React.Key;
34828
+ };
34817
34829
  type SectionContextProps = {
34818
34830
  data: Record<string, SectionData>;
34819
34831
  getSection: (id: string) => SectionData | undefined;
34820
34832
  addSection: (id: string, data: BuilderEntityNested) => void;
34821
34833
  removeSection: (id: string) => void;
34822
34834
  };
34823
- type SectionProviderProps = {
34824
- children: React.ReactNode;
34825
- data?: SectionContextProps['data'];
34826
- key?: React.Key;
34827
- };
34835
+
34828
34836
  declare const SectionProvider: React.FC<SectionProviderProps>;
34829
34837
  declare const useSectionStore: <U>(selector: (state: ExtractState<StoreApi<SectionContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34830
34838
  declare const useSection: (id: string) => SectionData | undefined;
@@ -34884,6 +34892,7 @@ type ShopProviderProps = {
34884
34892
  storeOption: Omit<ShopContextProps, 'changeLocale' | 'changeStorefrontInfo' | 'changeCurrency' | 'changeSwatches' | 'changeLayoutSettings' | 'changeCreateThemeSectionCount' | 'changeShopPlan' | 'changeLimitCreateThemeSection'>;
34885
34893
  queryOption?: React.ComponentProps<typeof SWRConfig>['value'];
34886
34894
  };
34895
+
34887
34896
  declare const ShopProvider: React.FC<ShopProviderProps>;
34888
34897
  declare const useShopStore: <U>(selector: (state: ExtractState<StoreApi<ShopContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34889
34898
 
@@ -34918,6 +34927,7 @@ type PageProviderProps = Pick<PageContextProps, 'dynamicProduct' | 'dynamicColle
34918
34927
  key?: React.Key;
34919
34928
  publicStoreFrontData?: PublicStoreFrontData | null;
34920
34929
  };
34930
+
34921
34931
  declare const PageProvider: React.FC<PageProviderProps>;
34922
34932
  declare const usePageStore: <U>(selector: (state: ExtractState<StoreApi<PageContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34923
34933
 
@@ -34932,6 +34942,7 @@ type CollectionProviderProps = Pick<CollectionContextProps, 'collection'> & {
34932
34942
  readOnly?: boolean;
34933
34943
  children: React.ReactNode;
34934
34944
  };
34945
+
34935
34946
  declare const CollectionProvider: React.FC<CollectionProviderProps>;
34936
34947
  declare const useCollectionStore: <U>(selector: (state: ExtractState<StoreApi<CollectionContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34937
34948
 
@@ -34943,6 +34954,7 @@ type ModalContextProps = {
34943
34954
  type ModalProviderProps = Pick<ModalContextProps, 'activeId'> & {
34944
34955
  children: React.ReactNode;
34945
34956
  };
34957
+
34946
34958
  declare const ModalProvider: React.FC<ModalProviderProps>;
34947
34959
  declare const useModalStore: <U>(selector: (state: ExtractState<StoreApi<ModalContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34948
34960
 
@@ -34963,6 +34975,7 @@ type ArticleListContextProps = {
34963
34975
  type ArticleListProviderProps = ArticleListContextProps & {
34964
34976
  children: React.ReactNode;
34965
34977
  };
34978
+
34966
34979
  declare const ArticleListProvider: React.FC<ArticleListProviderProps>;
34967
34980
  declare const useArticleListStore: <U>(selector: (state: ExtractState<StoreApi<ArticleListContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34968
34981
 
@@ -34975,6 +34988,7 @@ type ArticleProviderProps = Pick<ArticleContextProps, 'article'> & {
34975
34988
  readOnly?: boolean;
34976
34989
  children: React.ReactNode;
34977
34990
  };
34991
+
34978
34992
  declare const ArticleProvider: React.FC<ArticleProviderProps>;
34979
34993
  declare const useArticleStore: <U>(selector: (state: ExtractState<StoreApi<ArticleContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
34980
34994
 
@@ -34985,6 +34999,7 @@ type I18nProviderProps = I18nContextProps & {
34985
34999
  readOnly?: boolean;
34986
35000
  children: React.ReactNode;
34987
35001
  };
35002
+
34988
35003
  declare const I18nProvider: React.FC<I18nProviderProps>;
34989
35004
  declare const useI18nStore: () => I18nContextProps;
34990
35005
 
@@ -42555,7 +42570,7 @@ type RequiredCursorEdge<T> = {
42555
42570
  };
42556
42571
  declare const fetchVariants: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchProductParams) => Promise<RequiredCursorEdge<VariantSelectFragment>[]>;
42557
42572
  declare const fetchMedias: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchProductParams) => Promise<(Pick<MediaEdge$1, "cursor"> & {
42558
- node?: Maybe$1<Pick<Media$1, "id" | "width" | "height" | "src" | "alt" | "contentType" | "previewImage">>;
42573
+ node?: Maybe$1<Pick<Media$1, "id" | "width" | "height" | "contentType" | "previewImage" | "src" | "alt">>;
42559
42574
  })[]>;
42560
42575
 
42561
42576
  type FetchProductsParams = {
@@ -47676,13 +47691,13 @@ declare const useSelectedOption: () => {
47676
47691
  setSelectedOption: (optionId?: Maybe$1<string>, optionValue?: Maybe$1<string>, productId?: Maybe$1<string>, noEmit?: boolean) => void;
47677
47692
  forceSelectedOption: (selectedOption?: Record<string, string>, productId?: Maybe$1<string>, noEmit?: boolean) => void;
47678
47693
  };
47679
- declare const useVariants: () => Maybe$1<Pick<ProductVariant$1, "id" | "title" | "price" | "width" | "length" | "weight" | "height" | "baseID" | "platform" | "sku" | "barcode" | "costPrice" | "inventoryPolicy" | "inventoryQuantity" | "inventoryStatus" | "isDigital" | "lowInventoryAmount" | "manageInventory" | "mediaId" | "salePrice" | "soldIndividually"> & {
47694
+ declare const useVariants: () => Maybe$1<Pick<ProductVariant$1, "id" | "title" | "price" | "width" | "length" | "weight" | "height" | "barcode" | "baseID" | "costPrice" | "inventoryPolicy" | "inventoryQuantity" | "inventoryStatus" | "isDigital" | "lowInventoryAmount" | "manageInventory" | "mediaId" | "platform" | "salePrice" | "sku" | "soldIndividually"> & {
47680
47695
  selectedOptions: Pick<SelectedOption$1, "name" | "value" | "optionType">[];
47681
- media?: Maybe$1<Pick<Media$1, "id" | "width" | "height" | "src" | "alt" | "contentType" | "previewImage">>;
47696
+ media?: Maybe$1<Pick<Media$1, "id" | "width" | "height" | "contentType" | "previewImage" | "src" | "alt">>;
47682
47697
  }>[];
47683
- declare const useVariant: (id: string) => Maybe$1<Pick<ProductVariant$1, "id" | "title" | "price" | "width" | "length" | "weight" | "height" | "baseID" | "platform" | "sku" | "barcode" | "costPrice" | "inventoryPolicy" | "inventoryQuantity" | "inventoryStatus" | "isDigital" | "lowInventoryAmount" | "manageInventory" | "mediaId" | "salePrice" | "soldIndividually"> & {
47698
+ declare const useVariant: (id: string) => Maybe$1<Pick<ProductVariant$1, "id" | "title" | "price" | "width" | "length" | "weight" | "height" | "barcode" | "baseID" | "costPrice" | "inventoryPolicy" | "inventoryQuantity" | "inventoryStatus" | "isDigital" | "lowInventoryAmount" | "manageInventory" | "mediaId" | "platform" | "salePrice" | "sku" | "soldIndividually"> & {
47684
47699
  selectedOptions: Pick<SelectedOption$1, "name" | "value" | "optionType">[];
47685
- media?: Maybe$1<Pick<Media$1, "id" | "width" | "height" | "src" | "alt" | "contentType" | "previewImage">>;
47700
+ media?: Maybe$1<Pick<Media$1, "id" | "width" | "height" | "contentType" | "previewImage" | "src" | "alt">>;
47686
47701
  }>;
47687
47702
  declare const useCurrentVariant: () => Maybe$1<VariantSelectFragment>;
47688
47703
  declare const useCurrentVariantInStock: () => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "2.0.0-dev.460",
3
+ "version": "2.0.0-dev.464",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@gem-sdk/adapter-shopify": "2.0.0-dev.324",
31
- "@gem-sdk/styles": "2.0.0-dev.381",
31
+ "@gem-sdk/styles": "2.0.0-dev.464",
32
32
  "@types/classnames": "^2.3.1"
33
33
  },
34
34
  "dependencies": {