@gem-sdk/core 1.13.38 → 1.14.0-next.103

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.
Files changed (241) hide show
  1. package/dist/cjs/components/AddOn.js +1 -18
  2. package/dist/cjs/components/ComponentWrapper.js +1 -28
  3. package/dist/cjs/components/ComponentWrapperPreview.js +1 -72
  4. package/dist/cjs/components/Empty.js +1 -7
  5. package/dist/cjs/components/Render.js +1 -65
  6. package/dist/cjs/components/Render.liquid.js +3 -158
  7. package/dist/cjs/components/RenderBlock.js +1 -54
  8. package/dist/cjs/components/RenderPreview.js +1 -66
  9. package/dist/cjs/components/RenderSection.js +1 -23
  10. package/dist/cjs/components/constant.js +1 -39
  11. package/dist/cjs/contexts/AddonContext.js +1 -36
  12. package/dist/cjs/contexts/BuilderComponent.js +1 -34
  13. package/dist/cjs/contexts/BuilderContext.js +1 -35
  14. package/dist/cjs/contexts/BuilderPreviewContext.js +1 -370
  15. package/dist/cjs/contexts/CartLineContext.js +1 -29
  16. package/dist/cjs/contexts/CollectionContext.js +1 -38
  17. package/dist/cjs/contexts/ModalContext.js +1 -47
  18. package/dist/cjs/contexts/ProductContext.js +1 -149
  19. package/dist/cjs/contexts/ProductListContext.js +1 -32
  20. package/dist/cjs/contexts/SectionContext.js +1 -53
  21. package/dist/cjs/contexts/ShopContext.js +1 -70
  22. package/dist/cjs/graphql/fragments/analytic.generated.js +2 -6
  23. package/dist/cjs/graphql/fragments/collection-detail.generated.js +2 -6
  24. package/dist/cjs/graphql/fragments/collection-product.generated.js +2 -6
  25. package/dist/cjs/graphql/fragments/collection.generated.js +2 -6
  26. package/dist/cjs/graphql/fragments/custom-code.generated.js +2 -6
  27. package/dist/cjs/graphql/fragments/data-seo.generated.js +2 -6
  28. package/dist/cjs/graphql/fragments/media.generated.js +3 -6
  29. package/dist/cjs/graphql/fragments/product-little.generated.js +2 -6
  30. package/dist/cjs/graphql/fragments/product-option-value.generated.js +2 -6
  31. package/dist/cjs/graphql/fragments/product-option.generated.js +2 -6
  32. package/dist/cjs/graphql/fragments/product.generated.js +2 -6
  33. package/dist/cjs/graphql/fragments/published-custom-section.generated.js +2 -6
  34. package/dist/cjs/graphql/fragments/published-page-section.generated.js +2 -6
  35. package/dist/cjs/graphql/fragments/published-theme-page.generated.js +2 -6
  36. package/dist/cjs/graphql/fragments/published-theme-style.generated.js +2 -6
  37. package/dist/cjs/graphql/fragments/selected-option.generated.js +2 -6
  38. package/dist/cjs/graphql/fragments/variant.generated.js +2 -6
  39. package/dist/cjs/graphql/mutations/page-view-up.generated.js +3 -7
  40. package/dist/cjs/graphql/queries/collection-detail-filter.generated.js +2 -16
  41. package/dist/cjs/graphql/queries/collection.generated.js +2 -14
  42. package/dist/cjs/graphql/queries/collections.generated.js +2 -9
  43. package/dist/cjs/graphql/queries/preview-page.generated.js +2 -14
  44. package/dist/cjs/graphql/queries/product-little-detail.generated.js +2 -11
  45. package/dist/cjs/graphql/queries/product-medias.generated.js +2 -8
  46. package/dist/cjs/graphql/queries/product-variants.generated.js +2 -10
  47. package/dist/cjs/graphql/queries/products.generated.js +3 -17
  48. package/dist/cjs/graphql/queries/published-theme-pages.generated.js +2 -14
  49. package/dist/cjs/graphql/queries/store-property.generated.js +2 -6
  50. package/dist/cjs/helpers/GlobalEvent.js +1 -19
  51. package/dist/cjs/helpers/background.js +1 -109
  52. package/dist/cjs/helpers/borders.js +4 -183
  53. package/dist/cjs/helpers/clone-deep.js +1 -5
  54. package/dist/cjs/helpers/cls.js +1 -16
  55. package/dist/cjs/helpers/colors.js +1 -183
  56. package/dist/cjs/helpers/compose-advance-style.js +1 -188
  57. package/dist/cjs/helpers/constant.js +1 -23
  58. package/dist/cjs/helpers/convert.js +1 -7
  59. package/dist/cjs/helpers/css-variable.js +1 -7
  60. package/dist/cjs/helpers/email.js +1 -11
  61. package/dist/cjs/helpers/flatten-connection.js +1 -9
  62. package/dist/cjs/helpers/get-resonsive-value.js +1 -31
  63. package/dist/cjs/helpers/get-shortname.js +1 -92
  64. package/dist/cjs/helpers/is-browser.js +1 -9
  65. package/dist/cjs/helpers/is-defined.js +1 -7
  66. package/dist/cjs/helpers/is-empty-children.js +1 -12
  67. package/dist/cjs/helpers/is-safari.js +1 -9
  68. package/dist/cjs/helpers/layout.js +1 -59
  69. package/dist/cjs/helpers/load-script.js +1 -31
  70. package/dist/cjs/helpers/make-style.js +1 -128
  71. package/dist/cjs/helpers/normalize-builder-data.js +1 -23
  72. package/dist/cjs/helpers/prefetch-queries.js +1 -78
  73. package/dist/cjs/helpers/product.js +1 -31
  74. package/dist/cjs/helpers/queries/get-collection.js +1 -220
  75. package/dist/cjs/helpers/queries/get-collections.js +1 -21
  76. package/dist/cjs/helpers/queries/get-product-by-slug.js +1 -125
  77. package/dist/cjs/helpers/queries/get-product.js +1 -154
  78. package/dist/cjs/helpers/queries/get-products.js +1 -161
  79. package/dist/cjs/helpers/query.js +1 -29
  80. package/dist/cjs/helpers/radius.js +6 -131
  81. package/dist/cjs/helpers/render.js +1 -71
  82. package/dist/cjs/helpers/shadow.js +1 -56
  83. package/dist/cjs/helpers/size.js +4 -35
  84. package/dist/cjs/helpers/spacing.js +1 -43
  85. package/dist/cjs/helpers/tracking/fpixel.js +1 -28
  86. package/dist/cjs/helpers/tracking/gtag.js +1 -93
  87. package/dist/cjs/helpers/tracking/tiktokpixel.js +1 -17
  88. package/dist/cjs/helpers/typography.js +17 -105
  89. package/dist/cjs/helpers/variant.js +1 -8
  90. package/dist/cjs/hooks/cart/use-add-to-cart.js +1 -20
  91. package/dist/cjs/hooks/cart/use-cart-data.js +1 -28
  92. package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +1 -20
  93. package/dist/cjs/hooks/cart/use-cart-note-update.js +1 -20
  94. package/dist/cjs/hooks/cart/use-create-cart.js +1 -22
  95. package/dist/cjs/hooks/cart/use-remove-cart-item.js +1 -20
  96. package/dist/cjs/hooks/cart/use-update-cart-item.js +1 -20
  97. package/dist/cjs/hooks/shop/use-collection-query.js +1 -22
  98. package/dist/cjs/hooks/shop/use-collections-query.js +1 -17
  99. package/dist/cjs/hooks/shop/use-product-query.js +1 -22
  100. package/dist/cjs/hooks/shop/use-products-query.js +1 -22
  101. package/dist/cjs/hooks/shop.js +1 -126
  102. package/dist/cjs/hooks/use-current-device.js +1 -21
  103. package/dist/cjs/hooks/use-lazy-video.js +1 -15
  104. package/dist/cjs/hooks/useCartId.js +1 -44
  105. package/dist/cjs/hooks/useCartLine.js +1 -11
  106. package/dist/cjs/hooks/useCartUI.js +1 -48
  107. package/dist/cjs/hooks/useCollection.js +1 -9
  108. package/dist/cjs/hooks/useFetchHandle.js +1 -13
  109. package/dist/cjs/hooks/useFormatMoney.js +1 -58
  110. package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +1 -10
  111. package/dist/cjs/hooks/useLoadScript.js +1 -32
  112. package/dist/cjs/hooks/useMoney.js +1 -84
  113. package/dist/cjs/hooks/usePrevious.js +1 -19
  114. package/dist/cjs/hooks/useProduct.js +1 -127
  115. package/dist/cjs/hooks/useProductList.js +1 -21
  116. package/dist/cjs/hooks/useSuspenseFetch.js +1 -27
  117. package/dist/cjs/hooks/useSwatchesOptions.js +1 -41
  118. package/dist/cjs/index.js +1 -290
  119. package/dist/cjs/types/global-style.js +1 -14
  120. package/dist/cjs/types/shop.js +1 -2
  121. package/dist/esm/components/AddOn.js +1 -14
  122. package/dist/esm/components/ComponentWrapper.js +1 -24
  123. package/dist/esm/components/ComponentWrapperPreview.js +1 -68
  124. package/dist/esm/components/Empty.js +1 -3
  125. package/dist/esm/components/Render.js +1 -61
  126. package/dist/esm/components/Render.liquid.js +3 -153
  127. package/dist/esm/components/RenderBlock.js +1 -50
  128. package/dist/esm/components/RenderPreview.js +1 -62
  129. package/dist/esm/components/RenderSection.js +1 -19
  130. package/dist/esm/components/constant.js +1 -37
  131. package/dist/esm/contexts/AddonContext.js +1 -32
  132. package/dist/esm/contexts/BuilderComponent.js +1 -31
  133. package/dist/esm/contexts/BuilderContext.js +1 -32
  134. package/dist/esm/contexts/BuilderPreviewContext.js +1 -367
  135. package/dist/esm/contexts/CartLineContext.js +1 -26
  136. package/dist/esm/contexts/CollectionContext.js +1 -35
  137. package/dist/esm/contexts/ModalContext.js +1 -44
  138. package/dist/esm/contexts/ProductContext.js +1 -146
  139. package/dist/esm/contexts/ProductListContext.js +1 -28
  140. package/dist/esm/contexts/SectionContext.js +1 -49
  141. package/dist/esm/contexts/ShopContext.js +1 -67
  142. package/dist/esm/graphql/fragments/analytic.generated.js +2 -4
  143. package/dist/esm/graphql/fragments/collection-detail.generated.js +2 -4
  144. package/dist/esm/graphql/fragments/collection-product.generated.js +2 -4
  145. package/dist/esm/graphql/fragments/collection.generated.js +2 -4
  146. package/dist/esm/graphql/fragments/custom-code.generated.js +2 -4
  147. package/dist/esm/graphql/fragments/data-seo.generated.js +2 -4
  148. package/dist/esm/graphql/fragments/media.generated.js +3 -4
  149. package/dist/esm/graphql/fragments/product-little.generated.js +2 -4
  150. package/dist/esm/graphql/fragments/product-option-value.generated.js +2 -4
  151. package/dist/esm/graphql/fragments/product-option.generated.js +2 -4
  152. package/dist/esm/graphql/fragments/product.generated.js +2 -4
  153. package/dist/esm/graphql/fragments/published-custom-section.generated.js +2 -4
  154. package/dist/esm/graphql/fragments/published-page-section.generated.js +2 -4
  155. package/dist/esm/graphql/fragments/published-theme-page.generated.js +2 -4
  156. package/dist/esm/graphql/fragments/published-theme-style.generated.js +2 -4
  157. package/dist/esm/graphql/fragments/selected-option.generated.js +2 -4
  158. package/dist/esm/graphql/fragments/variant.generated.js +2 -4
  159. package/dist/esm/graphql/mutations/page-view-up.generated.js +3 -5
  160. package/dist/esm/graphql/queries/collection-detail-filter.generated.js +10 -22
  161. package/dist/esm/graphql/queries/collection.generated.js +8 -18
  162. package/dist/esm/graphql/queries/collections.generated.js +3 -8
  163. package/dist/esm/graphql/queries/preview-page.generated.js +8 -18
  164. package/dist/esm/graphql/queries/product-little-detail.generated.js +5 -12
  165. package/dist/esm/graphql/queries/product-medias.generated.js +2 -6
  166. package/dist/esm/graphql/queries/product-variants.generated.js +4 -10
  167. package/dist/esm/graphql/queries/products.generated.js +9 -20
  168. package/dist/esm/graphql/queries/published-theme-pages.generated.js +8 -18
  169. package/dist/esm/graphql/queries/store-property.generated.js +2 -4
  170. package/dist/esm/helpers/GlobalEvent.js +1 -15
  171. package/dist/esm/helpers/background.js +1 -106
  172. package/dist/esm/helpers/borders.js +4 -175
  173. package/dist/esm/helpers/clone-deep.js +1 -3
  174. package/dist/esm/helpers/cls.js +1 -14
  175. package/dist/esm/helpers/colors.js +1 -168
  176. package/dist/esm/helpers/compose-advance-style.js +1 -185
  177. package/dist/esm/helpers/constant.js +1 -19
  178. package/dist/esm/helpers/convert.js +1 -4
  179. package/dist/esm/helpers/css-variable.js +1 -5
  180. package/dist/esm/helpers/email.js +1 -6
  181. package/dist/esm/helpers/flatten-connection.js +1 -7
  182. package/dist/esm/helpers/get-resonsive-value.js +1 -27
  183. package/dist/esm/helpers/get-shortname.js +1 -90
  184. package/dist/esm/helpers/is-browser.js +1 -5
  185. package/dist/esm/helpers/is-defined.js +1 -5
  186. package/dist/esm/helpers/is-empty-children.js +1 -7
  187. package/dist/esm/helpers/is-safari.js +1 -5
  188. package/dist/esm/helpers/layout.js +1 -54
  189. package/dist/esm/helpers/load-script.js +1 -29
  190. package/dist/esm/helpers/make-style.js +1 -117
  191. package/dist/esm/helpers/normalize-builder-data.js +1 -21
  192. package/dist/esm/helpers/prefetch-queries.js +1 -76
  193. package/dist/esm/helpers/product.js +1 -28
  194. package/dist/esm/helpers/queries/get-collection.js +1 -217
  195. package/dist/esm/helpers/queries/get-collections.js +1 -19
  196. package/dist/esm/helpers/queries/get-product-by-slug.js +1 -123
  197. package/dist/esm/helpers/queries/get-product.js +1 -150
  198. package/dist/esm/helpers/queries/get-products.js +1 -159
  199. package/dist/esm/helpers/query.js +1 -25
  200. package/dist/esm/helpers/radius.js +6 -124
  201. package/dist/esm/helpers/render.js +1 -64
  202. package/dist/esm/helpers/shadow.js +1 -51
  203. package/dist/esm/helpers/size.js +4 -31
  204. package/dist/esm/helpers/spacing.js +1 -40
  205. package/dist/esm/helpers/tracking/fpixel.js +1 -24
  206. package/dist/esm/helpers/tracking/gtag.js +1 -87
  207. package/dist/esm/helpers/tracking/tiktokpixel.js +1 -15
  208. package/dist/esm/helpers/typography.js +17 -96
  209. package/dist/esm/helpers/variant.js +1 -6
  210. package/dist/esm/hooks/cart/use-add-to-cart.js +1 -18
  211. package/dist/esm/hooks/cart/use-cart-data.js +1 -26
  212. package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +1 -18
  213. package/dist/esm/hooks/cart/use-cart-note-update.js +1 -18
  214. package/dist/esm/hooks/cart/use-create-cart.js +1 -20
  215. package/dist/esm/hooks/cart/use-remove-cart-item.js +1 -18
  216. package/dist/esm/hooks/cart/use-update-cart-item.js +1 -18
  217. package/dist/esm/hooks/shop/use-collection-query.js +1 -20
  218. package/dist/esm/hooks/shop/use-collections-query.js +1 -15
  219. package/dist/esm/hooks/shop/use-product-query.js +1 -20
  220. package/dist/esm/hooks/shop/use-products-query.js +1 -20
  221. package/dist/esm/hooks/shop.js +1 -111
  222. package/dist/esm/hooks/use-current-device.js +1 -19
  223. package/dist/esm/hooks/use-lazy-video.js +1 -13
  224. package/dist/esm/hooks/useCartId.js +1 -40
  225. package/dist/esm/hooks/useCartLine.js +1 -7
  226. package/dist/esm/hooks/useCartUI.js +1 -44
  227. package/dist/esm/hooks/useCollection.js +1 -7
  228. package/dist/esm/hooks/useFetchHandle.js +1 -11
  229. package/dist/esm/hooks/useFormatMoney.js +1 -56
  230. package/dist/esm/hooks/useIsomorphicLayoutEffect.js +1 -6
  231. package/dist/esm/hooks/useLoadScript.js +1 -28
  232. package/dist/esm/hooks/useMoney.js +1 -80
  233. package/dist/esm/hooks/usePrevious.js +1 -17
  234. package/dist/esm/hooks/useProduct.js +1 -114
  235. package/dist/esm/hooks/useProductList.js +1 -16
  236. package/dist/esm/hooks/useSuspenseFetch.js +1 -23
  237. package/dist/esm/hooks/useSwatchesOptions.js +1 -37
  238. package/dist/esm/index.js +1 -92
  239. package/dist/esm/types/global-style.js +1 -11
  240. package/dist/types/index.d.ts +1038 -984
  241. package/package.json +4 -4
@@ -1,56 +1 @@
1
- import { useMoneyFormat } from './shop.js';
2
-
3
- const useFormatMoney = (amount, withCurrency)=>{
4
- const { moneyFormat , moneyWithCurrencyFormat } = useMoneyFormat();
5
- const formatMoney = function(cents, format) {
6
- let value = '';
7
- const placeholderRegex = /\{\{\s*(\w+)\s*\}\}/;
8
- const formatString = format || '${{amount}}';
9
- /**
10
- * check default
11
- * @param opt opt
12
- * @param def def
13
- * @returns any
14
- */ function defaultOption(opt, def) {
15
- return typeof opt == 'undefined' ? def : opt;
16
- }
17
- /**
18
- * formatWithDelimiters
19
- * @param number number
20
- * @param precision precision
21
- * @param thousands thousands
22
- * @param decimal decimal
23
- * @returns any
24
- */ // eslint-disable-next-line max-params
25
- function formatWithDelimiters(number, precision, thousands, decimal) {
26
- precision = defaultOption(precision, 2);
27
- thousands = defaultOption(thousands, ',');
28
- decimal = defaultOption(decimal, '.');
29
- if (isNaN(number) || number == null) {
30
- return 0;
31
- }
32
- // shopify làm tròn bằng cách cắt đi các số ở đằng sau chứ không sử dụng toFixed để làm tròn như toán học
33
- number = parseFloat(`${number}`).toFixed(Number(precision) + 1).slice(0, -1);
34
- const parts = number.split('.'), dollars = parts[0]?.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1' + thousands), cents = parts[1] ? decimal + parts[1] : '';
35
- return dollars + cents;
36
- }
37
- switch(formatString.match(placeholderRegex)[1]){
38
- case 'amount':
39
- value = formatWithDelimiters(cents, 2);
40
- break;
41
- case 'amount_no_decimals':
42
- value = formatWithDelimiters(cents, 0);
43
- break;
44
- case 'amount_with_comma_separator':
45
- value = formatWithDelimiters(cents, 2, '.', ',');
46
- break;
47
- case 'amount_no_decimals_with_comma_separator':
48
- value = formatWithDelimiters(cents, 0, '.', ',');
49
- break;
50
- }
51
- return formatString.replace(placeholderRegex, value);
52
- };
53
- return withCurrency ? formatMoney(`${amount}`, moneyWithCurrencyFormat || moneyFormat) : formatMoney(`${amount}`, moneyFormat);
54
- };
55
-
56
- export { useFormatMoney };
1
+ import{useMoneyFormat as e}from"./shop.js";let useFormatMoney=(t,a)=>{let{moneyFormat:r,moneyWithCurrencyFormat:o}=e(),n=function(e,t){let a="",r=/\{\{\s*(\w+)\s*\}\}/,o=t||"${{amount}}";function n(e,t){return void 0===e?t:e}function s(e,t,a,r){if(t=n(t,2),a=n(a,","),r=n(r,"."),isNaN(e)||null==e)return 0;e=parseFloat(`${e}`).toFixed(Number(t)+1).slice(0,-1);let o=e.split("."),s=o[0]?.replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+a),m=o[1]?r+o[1]:"";return s+m}switch(o.match(r)[1]){case"amount":a=s(e,2);break;case"amount_no_decimals":a=s(e,0);break;case"amount_with_comma_separator":a=s(e,2,".",",");break;case"amount_no_decimals_with_comma_separator":a=s(e,0,".",",")}return o.replace(r,a)};return n(`${t}`,a&&o||r)};export{useFormatMoney};
@@ -1,6 +1 @@
1
- import { useLayoutEffect } from 'react';
2
-
3
- // const isBrowser = typeof window !== 'undefined';
4
- const useIsomorphicLayoutEffect = useLayoutEffect;
5
-
6
- export { useIsomorphicLayoutEffect as default };
1
+ import{useLayoutEffect as o}from"react";let useIsomorphicLayoutEffect=o;export{useIsomorphicLayoutEffect as default};
@@ -1,28 +1 @@
1
- import { useState, useEffect } from 'react';
2
- import { loadScript } from '../helpers/load-script.js';
3
-
4
- /**
5
- * The `useLoadScript` hook loads an external script tag on the client-side.
6
- */ function useLoadScript(url, options) {
7
- const [status, setStatus] = useState('loading');
8
- const stringifiedOptions = JSON.stringify(options);
9
- useEffect(()=>{
10
- async function loadScriptWrapper() {
11
- try {
12
- setStatus('loading');
13
- await loadScript(url, options);
14
- setStatus('done');
15
- } catch (error) {
16
- setStatus('error');
17
- }
18
- }
19
- loadScriptWrapper();
20
- }, [
21
- url,
22
- stringifiedOptions,
23
- options
24
- ]);
25
- return status;
26
- }
27
-
28
- export { useLoadScript as default };
1
+ import{useState as r,useEffect as t}from"react";import{loadScript as o}from"../helpers/load-script.js";function useLoadScript(a,i){let[e,n]=r("loading"),c=JSON.stringify(i);return t(()=>{(async function(){try{n("loading"),await o(a,i),n("done")}catch(r){n("error")}})()},[a,c,i]),e}export{useLoadScript as default};
@@ -1,80 +1 @@
1
- import { useMemo } from 'react';
2
- import { useLocale, useCurrency } from './shop.js';
3
-
4
- const useMoney = (amount)=>{
5
- const { locale } = useLocale();
6
- const { currency } = useCurrency();
7
- const options = useMemo(()=>({
8
- style: 'currency',
9
- currency: currency
10
- }), [
11
- currency
12
- ]);
13
- const defaultFormatter = useLazyFormatter(locale, options);
14
- const nameFormatter = useLazyFormatter(locale, {
15
- ...options,
16
- currencyDisplay: 'name'
17
- });
18
- const narrowSymbolFormatter = useLazyFormatter(locale, {
19
- ...options,
20
- currencyDisplay: 'narrowSymbol'
21
- });
22
- const withoutTrailingZerosFormatter = useLazyFormatter(locale, {
23
- ...options,
24
- minimumFractionDigits: 0,
25
- maximumFractionDigits: 0
26
- });
27
- const withoutCurrencyFormatter = useLazyFormatter(locale);
28
- const withoutTrailingZerosOrCurrencyFormatter = useLazyFormatter(locale, {
29
- minimumFractionDigits: 0,
30
- maximumFractionDigits: 0
31
- });
32
- const isPartCurrency = (part)=>part.type === 'currency';
33
- // By wrapping these properties in functions, we only
34
- // create formatters if they are going to be used.
35
- const lazyFormatters = useMemo(()=>({
36
- currencyCode: ()=>currency,
37
- localizedString: ()=>defaultFormatter().format(amount),
38
- parts: ()=>defaultFormatter().formatToParts(amount),
39
- withoutTrailingZeros: ()=>amount % 1 === 0 ? withoutTrailingZerosFormatter().format(amount) : defaultFormatter().format(amount),
40
- withoutTrailingZerosAndCurrency: ()=>amount % 1 === 0 ? withoutTrailingZerosOrCurrencyFormatter().format(amount) : withoutCurrencyFormatter().format(amount),
41
- currencyName: ()=>nameFormatter().formatToParts(amount).find(isPartCurrency)?.value ?? currency,
42
- currencySymbol: ()=>defaultFormatter().formatToParts(amount).find(isPartCurrency)?.value ?? currency,
43
- currencyNarrowSymbol: ()=>narrowSymbolFormatter().formatToParts(amount).find(isPartCurrency)?.value ?? '',
44
- amount: ()=>defaultFormatter().formatToParts(amount).filter((part)=>[
45
- 'decimal',
46
- 'fraction',
47
- 'group',
48
- 'integer',
49
- 'literal'
50
- ].includes(part.type)).map((part)=>part.value).join('')
51
- }), [
52
- currency,
53
- amount,
54
- nameFormatter,
55
- defaultFormatter,
56
- narrowSymbolFormatter,
57
- withoutCurrencyFormatter,
58
- withoutTrailingZerosFormatter,
59
- withoutTrailingZerosOrCurrencyFormatter
60
- ]);
61
- // Call functions automatically when the properties are accessed
62
- // to keep these functions as an implementation detail.
63
- return useMemo(()=>new Proxy(lazyFormatters, {
64
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
65
- get: (target, key)=>Reflect.get(target, key)?.call(null)
66
- }), [
67
- lazyFormatters
68
- ]);
69
- };
70
- function useLazyFormatter(locale, options) {
71
- return useMemo(()=>{
72
- let memoized;
73
- return ()=>memoized ??= new Intl.NumberFormat(locale, options);
74
- }, [
75
- locale,
76
- options
77
- ]);
78
- }
79
-
80
- export { useMoney as default };
1
+ import{useMemo as r}from"react";import{useLocale as t,useCurrency as e}from"./shop.js";let useMoney=a=>{let{locale:o}=t(),{currency:m}=e(),i=r(()=>({style:"currency",currency:m}),[m]),n=useLazyFormatter(o,i),u=useLazyFormatter(o,{...i,currencyDisplay:"name"}),c=useLazyFormatter(o,{...i,currencyDisplay:"narrowSymbol"}),l=useLazyFormatter(o,{...i,minimumFractionDigits:0,maximumFractionDigits:0}),s=useLazyFormatter(o),y=useLazyFormatter(o,{minimumFractionDigits:0,maximumFractionDigits:0}),f=r=>"currency"===r.type,F=r(()=>({currencyCode:()=>m,localizedString:()=>n().format(a),parts:()=>n().formatToParts(a),withoutTrailingZeros:()=>a%1==0?l().format(a):n().format(a),withoutTrailingZerosAndCurrency:()=>a%1==0?y().format(a):s().format(a),currencyName:()=>u().formatToParts(a).find(f)?.value??m,currencySymbol:()=>n().formatToParts(a).find(f)?.value??m,currencyNarrowSymbol:()=>c().formatToParts(a).find(f)?.value??"",amount:()=>n().formatToParts(a).filter(r=>["decimal","fraction","group","integer","literal"].includes(r.type)).map(r=>r.value).join("")}),[m,a,u,n,c,s,l,y]);return r(()=>new Proxy(F,{get:(r,t)=>Reflect.get(r,t)?.call(null)}),[F])};function useLazyFormatter(t,e){return r(()=>{let r;return()=>r??=new Intl.NumberFormat(t,e)},[t,e])}export{useMoney as default};
@@ -1,17 +1 @@
1
- import { useRef, useEffect } from 'react';
2
-
3
- const usePrevious = (value)=>{
4
- // The ref object is a generic container whose current property is mutable ...
5
- // ... and can hold any value, similar to an instance property on a class
6
- const ref = useRef();
7
- // Store current value in ref
8
- useEffect(()=>{
9
- ref.current = value;
10
- }, [
11
- value
12
- ]); // Only re-run if value changes
13
- // Return previous value (happens before update in useEffect above)
14
- return ref.current;
15
- };
16
-
17
- export { usePrevious };
1
+ import{useRef as r,useEffect as e}from"react";let usePrevious=t=>{let u=r();return e(()=>{u.current=t},[t]),u.current};export{usePrevious};
@@ -1,114 +1 @@
1
- import { useCallback, useMemo } from 'react';
2
- import { useProductStore } from '../contexts/ProductContext.js';
3
- import { flattenConnection } from '../helpers/flatten-connection.js';
4
- import 'swr';
5
- import { getSelectedVariant } from '../helpers/product.js';
6
- import '../helpers/convert.js';
7
- import { checkInStock } from '../helpers/variant.js';
8
-
9
- const useUniqProductID = ()=>{
10
- return useProductStore((s)=>s.uiqueId);
11
- };
12
- const useProduct = ()=>{
13
- return useProductStore((s)=>s.product);
14
- };
15
- const useFeaturedImageGlobal = ()=>{
16
- return useProductStore((s)=>s.featuredImageGlobal);
17
- };
18
- const useProductProperties = ()=>{
19
- return useProductStore((s)=>s.properties);
20
- };
21
- const useQuantity = ()=>{
22
- const quantity = useProductStore((s)=>s.quantity);
23
- const decrement = useProductStore((s)=>s.decrementQuantity);
24
- const increment = useProductStore((s)=>s.incrementQuantity);
25
- const updateQuantity = useProductStore((s)=>s.setQuantity);
26
- const reset = useCallback(()=>{
27
- updateQuantity(1);
28
- }, [
29
- updateQuantity
30
- ]);
31
- return useMemo(()=>({
32
- quantity,
33
- increment,
34
- decrement,
35
- reset,
36
- setQuantity: updateQuantity
37
- }), [
38
- decrement,
39
- increment,
40
- quantity,
41
- reset,
42
- updateQuantity
43
- ]);
44
- };
45
- const useSelectedOption = ()=>{
46
- const setSelectedOption = useProductStore((s)=>s.setSelectedOption);
47
- const selectedOptions = useProductStore((s)=>s.selectedOptions);
48
- const forceSelectedOption = useProductStore((s)=>s.forceSelectedOption);
49
- const updateOption = useCallback((optionId, optionValue)=>{
50
- setSelectedOption(optionId, optionValue);
51
- }, [
52
- setSelectedOption
53
- ]);
54
- return useMemo(()=>({
55
- selectedOptions,
56
- setSelectedOption: updateOption,
57
- forceSelectedOption
58
- }), [
59
- selectedOptions,
60
- updateOption,
61
- forceSelectedOption
62
- ]);
63
- };
64
- const useVariants = ()=>{
65
- const variants = useProductStore((s)=>s.product?.variants);
66
- return flattenConnection(variants);
67
- };
68
- const useVariant = (id)=>{
69
- const variants = useVariants();
70
- return useMemo(()=>variants?.find((v)=>v?.id === id), [
71
- id,
72
- variants
73
- ]);
74
- };
75
- const useCurrentVariant = ()=>{
76
- const { selectedOptions } = useSelectedOption();
77
- const variants = useVariants();
78
- return useMemo(()=>getSelectedVariant(variants, selectedOptions), [
79
- selectedOptions,
80
- variants
81
- ]);
82
- };
83
- const useCurrentVariantInStock = ()=>{
84
- const currentVariant = useCurrentVariant();
85
- const isInStock = checkInStock(currentVariant);
86
- return isInStock;
87
- };
88
- const useVariantOutStock = (optionId, optionValue)=>{
89
- const { selectedOptions } = useSelectedOption();
90
- const variants = useVariants();
91
- const matchedVariant = getSelectedVariant(variants, {
92
- ...selectedOptions,
93
- [optionId]: optionValue
94
- });
95
- const isInStock = checkInStock(matchedVariant);
96
- return !isInStock;
97
- };
98
- const useCheckAvailableVariantInStock = (optionId, optionValue)=>{
99
- const variants = useVariants();
100
- let available = false;
101
- variants.forEach((item)=>{
102
- if (item) {
103
- const { selectedOptions } = item;
104
- const opt = selectedOptions?.find((option)=>option?.name === optionId && option.value === optionValue);
105
- const isInStock = checkInStock(item);
106
- if (opt && isInStock) {
107
- available = true;
108
- }
109
- }
110
- });
111
- return available;
112
- };
113
-
114
- export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useProduct, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants };
1
+ import{useCallback as e,useMemo as t}from"react";import{useProductStore as r}from"../contexts/ProductContext.js";import{flattenConnection as u}from"../helpers/flatten-connection.js";import"swr";import{getSelectedVariant as n}from"../helpers/product.js";import"../helpers/convert.js";import{checkInStock as a}from"../helpers/variant.js";let useUniqProductID=()=>r(e=>e.uiqueId),useProduct=()=>r(e=>e.product),useFeaturedImageGlobal=()=>r(e=>e.featuredImageGlobal),useProductProperties=()=>r(e=>e.properties),useQuantity=()=>{let u=r(e=>e.quantity),n=r(e=>e.decrementQuantity),a=r(e=>e.incrementQuantity),s=r(e=>e.setQuantity),i=e(()=>{s(1)},[s]);return t(()=>({quantity:u,increment:a,decrement:n,reset:i,setQuantity:s}),[n,a,u,i,s])},useSelectedOption=()=>{let u=r(e=>e.setSelectedOption),n=r(e=>e.selectedOptions),a=r(e=>e.forceSelectedOption),s=e((e,t)=>{u(e,t)},[u]);return t(()=>({selectedOptions:n,setSelectedOption:s,forceSelectedOption:a}),[n,s,a])},useVariants=()=>{let e=r(e=>e.product?.variants);return u(e)},useVariant=e=>{let r=useVariants();return t(()=>r?.find(t=>t?.id===e),[e,r])},useCurrentVariant=()=>{let{selectedOptions:e}=useSelectedOption(),r=useVariants();return t(()=>n(r,e),[e,r])},useCurrentVariantInStock=()=>{let e=useCurrentVariant(),t=a(e);return t},useVariantOutStock=(e,t)=>{let{selectedOptions:r}=useSelectedOption(),u=useVariants(),s=n(u,{...r,[e]:t}),i=a(s);return!i},useCheckAvailableVariantInStock=(e,t)=>{let r=useVariants();return!!r&&r.some(r=>{if(r){let{selectedOptions:u}=r,n=u?.some(r=>r?.name===e&&r.value===t),s=a(r);return n&&s}return!1})};export{useCheckAvailableVariantInStock,useCurrentVariant,useCurrentVariantInStock,useFeaturedImageGlobal,useProduct,useProductProperties,useQuantity,useSelectedOption,useUniqProductID,useVariant,useVariantOutStock,useVariants};
@@ -1,16 +1 @@
1
- import { useProductListStore } from '../contexts/ProductListContext.js';
2
-
3
- const useProductList = ()=>{
4
- return useProductListStore((s)=>s.collection);
5
- };
6
- const useProductListProducts = ()=>{
7
- return useProductListStore((s)=>s.products);
8
- };
9
- const useProductListSettings = ()=>{
10
- return useProductListStore((s)=>s.settings);
11
- };
12
- const useProductListStyles = ()=>{
13
- return useProductListStore((s)=>s.styles);
14
- };
15
-
16
- export { useProductList, useProductListProducts, useProductListSettings, useProductListStyles };
1
+ import{useProductListStore as t}from"../contexts/ProductListContext.js";let useProductList=()=>t(t=>t.collection),useProductListProducts=()=>t(t=>t.products),useProductListSettings=()=>t(t=>t.settings),useProductListStyles=()=>t(t=>t.styles);export{useProductList,useProductListProducts,useProductListSettings,useProductListStyles};
@@ -1,23 +1 @@
1
- const cache = new Map();
2
- const useSuspenseFetch = (key, promise)=>{
3
- const value = cache.get(key) || {
4
- status: 'new',
5
- data: null
6
- };
7
- if (value.status === 'resolved') {
8
- return {
9
- data: value.data
10
- };
11
- }
12
- promise().then((data)=>{
13
- value.status = 'resolved';
14
- value.data = data;
15
- cache.set(key, value);
16
- }).catch(()=>{
17
- value.status = 'error';
18
- value.data = null;
19
- });
20
- throw promise();
21
- };
22
-
23
- export { useSuspenseFetch as default };
1
+ let cache=new Map,useSuspenseFetch=(e,t)=>{let a=cache.get(e)||{status:"new",data:null};if("resolved"===a.status)return{data:a.data};throw t().then(t=>{a.status="resolved",a.data=t,cache.set(e,a)}).catch(()=>{a.status="error",a.data=null}),t()};export{useSuspenseFetch as default};
@@ -1,37 +1 @@
1
- import { useSwatches } from './shop.js';
2
-
3
- const initialSwatchOptionValue = {
4
- label: '',
5
- colors: [],
6
- imageUrl: ''
7
- };
8
- const initialGlobalSwatchesData = {
9
- optionTitle: '',
10
- optionType: '',
11
- optionValues: []
12
- };
13
- const useSwatchesOptions = (options)=>{
14
- const { swatches } = useSwatches();
15
- if (!options) return [];
16
- return options?.map((option)=>{
17
- const swatchOption = swatches?.find((sw)=>sw?.optionTitle === option?.name) || {
18
- ...initialGlobalSwatchesData
19
- };
20
- return {
21
- ...option,
22
- optionType: swatchOption ? swatchOption.optionType : '',
23
- values: option.values?.map((val)=>{
24
- const swatchValue = swatchOption && swatchOption?.optionValues?.find((swatOp)=>swatOp?.label === val?.label) || {
25
- ...initialSwatchOptionValue
26
- };
27
- return {
28
- ...val,
29
- colors: swatchValue?.colors || [],
30
- imageUrl: swatchValue?.imageUrl || ''
31
- };
32
- })
33
- };
34
- });
35
- };
36
-
37
- export { useSwatchesOptions as default };
1
+ import{useSwatches as t}from"./shop.js";let initialSwatchOptionValue={label:"",colors:[],imageUrl:""},initialGlobalSwatchesData={optionTitle:"",optionType:"",optionValues:[]},useSwatchesOptions=a=>{let{swatches:e}=t();return a?a?.map(t=>{let a=e?.find(a=>a?.optionTitle===t?.name)||{...initialGlobalSwatchesData};return{...t,optionType:a?a.optionType:"",values:t.values?.map(t=>{let e=a&&a?.optionValues?.find(a=>a?.label===t?.label)||{...initialSwatchOptionValue};return{...t,colors:e?.colors||[],imageUrl:e?.imageUrl||""}})}}):[]};export{useSwatchesOptions as default};
package/dist/esm/index.js CHANGED
@@ -1,92 +1 @@
1
- export { default as AddOn } from './components/AddOn.js';
2
- export { default as Render } from './components/Render.js';
3
- export { default as RenderPreview } from './components/RenderPreview.js';
4
- export { RenderChildren, default as RenderLiquid } from './components/Render.liquid.js';
5
- export { AddonProvider, useAddon, useAddons } from './contexts/AddonContext.js';
6
- export { BuilderComponentProvider, useBuilderComponent } from './contexts/BuilderComponent.js';
7
- export { BuilderProvider, useBuilderStore } from './contexts/BuilderContext.js';
8
- export { BuilderPreviewProvider, useBuilderPreviewStore } from './contexts/BuilderPreviewContext.js';
9
- export { CartLineProvider, useCartLineStore } from './contexts/CartLineContext.js';
10
- export { ProductListProvider, useProductListStore } from './contexts/ProductListContext.js';
11
- export { ProductProvider, useProductStore } from './contexts/ProductContext.js';
12
- export { SectionProvider, useSection, useSectionStore } from './contexts/SectionContext.js';
13
- export { ShopProvider, useShopStore } from './contexts/ShopContext.js';
14
- export { CollectionProvider, useCollectionStore } from './contexts/CollectionContext.js';
15
- export { ModalProvider, useModalStore } from './contexts/ModalContext.js';
16
- export { PageViewUpDocument } from './graphql/mutations/page-view-up.generated.js';
17
- export { CollectionDetailFilterDocument } from './graphql/queries/collection-detail-filter.generated.js';
18
- export { CollectionDocument } from './graphql/queries/collection.generated.js';
19
- export { CollectionsDocument } from './graphql/queries/collections.generated.js';
20
- export { PublishedThemePagesDocument } from './graphql/queries/published-theme-pages.generated.js';
21
- export { ProductsDocument } from './graphql/queries/products.generated.js';
22
- export { StorePropertyDocument } from './graphql/queries/store-property.generated.js';
23
- export { PreviewPageDocument } from './graphql/queries/preview-page.generated.js';
24
- export { composeBorderCss, getBorderStyle, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn } from './helpers/borders.js';
25
- export { cls } from './helpers/cls.js';
26
- export { flattenConnection } from './helpers/flatten-connection.js';
27
- export { getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen } from './helpers/get-resonsive-value.js';
28
- export { getShortName } from './helpers/get-shortname.js';
29
- export { default as globalEvent } from './helpers/GlobalEvent.js';
30
- export { default as isBrowser } from './helpers/is-browser.js';
31
- export { default as isSafari } from './helpers/is-safari.js';
32
- export { isEmptyChildren } from './helpers/is-empty-children.js';
33
- export { makeAspectRatio, makeHeight, makeLineClamp, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, removeNullUndefined } from './helpers/make-style.js';
34
- export { normalizeBuilderData } from './helpers/normalize-builder-data.js';
35
- export { prefetchQueries } from './helpers/prefetch-queries.js';
36
- export { composeSpacing, getSpacingVariable } from './helpers/spacing.js';
37
- export { loadScript } from './helpers/load-script.js';
38
- export { validateEmail } from './helpers/email.js';
39
- export { genVariable } from './helpers/css-variable.js';
40
- export { composeGridLayout, convertOldLayout, gridToArrayRegex, optionLayoutStyle } from './helpers/layout.js';
41
- export { isDefined } from './helpers/is-defined.js';
42
- export { composeTextColorCss, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getSingleColorVariable, isColor } from './helpers/colors.js';
43
- export { composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass } from './helpers/typography.js';
44
- export { composeCornerCss, composeRadius, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
45
- export { getSelectedVariant, parseSelectedOption } from './helpers/product.js';
46
- import * as fpixel from './helpers/tracking/fpixel.js';
47
- export { fpixel };
48
- import * as gtag from './helpers/tracking/gtag.js';
49
- export { gtag };
50
- import * as tiktokpixel from './helpers/tracking/tiktokpixel.js';
51
- export { tiktokpixel };
52
- export { RenderIf, composeMemo, dataStringify, props, styles, template } from './helpers/render.js';
53
- export { baseAssetURL, isLocalEnv } from './helpers/convert.js';
54
- export { composeSize, composeSizeCss, genSizeClass } from './helpers/size.js';
55
- export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
56
- export { composeBackgroundCss, getStyleBackgroundByDevice } from './helpers/background.js';
57
- export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey } from './helpers/query.js';
58
- export { composeAdvanceStyle, splitStyle } from './helpers/compose-advance-style.js';
59
- export { useAddToCart } from './hooks/cart/use-add-to-cart.js';
60
- export { useCartData } from './hooks/cart/use-cart-data.js';
61
- export { useCartDiscountCodesUpdate } from './hooks/cart/use-cart-discount-codes-update.js';
62
- export { useCartNoteUpdate } from './hooks/cart/use-cart-note-update.js';
63
- export { useCreateCart } from './hooks/cart/use-create-cart.js';
64
- export { useRemoveCartItem } from './hooks/cart/use-remove-cart-item.js';
65
- export { useUpdateCartItem } from './hooks/cart/use-update-cart-item.js';
66
- export { useCheckoutUrl, useConnectedShopify, useCurrency, useEditorMode, useIsSampleProduct, useIsStorefrontProduct, useLocale, useMatchMutate, useMobileOnly, useMoneyFormat, usePageType, usePluginEnable, useStoreFront, useSwatches } from './hooks/shop.js';
67
- export { useCollectionQuery } from './hooks/shop/use-collection-query.js';
68
- export { useCollectionsQuery } from './hooks/shop/use-collections-query.js';
69
- export { useProductQuery } from './hooks/shop/use-product-query.js';
70
- export { useProductsQuery } from './hooks/shop/use-products-query.js';
71
- export { useCurrentDevice } from './hooks/use-current-device.js';
72
- export { useFormatMoney } from './hooks/useFormatMoney.js';
73
- export { useLazyVideo } from './hooks/use-lazy-video.js';
74
- export { default as useCartId } from './hooks/useCartId.js';
75
- export { default as useCartLine } from './hooks/useCartLine.js';
76
- export { default as useCartUI } from './hooks/useCartUI.js';
77
- export { useCollection } from './hooks/useCollection.js';
78
- export { useId } from 'react';
79
- export { default as useIsomorphicLayoutEffect } from './hooks/useIsomorphicLayoutEffect.js';
80
- export { default as useLoadScript } from './hooks/useLoadScript.js';
81
- export { default as useMoney } from './hooks/useMoney.js';
82
- export { usePrevious } from './hooks/usePrevious.js';
83
- export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useProduct, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants } from './hooks/useProduct.js';
84
- export { useProductList, useProductListProducts, useProductListSettings, useProductListStyles } from './hooks/useProductList.js';
85
- export { default as useSuspenseFetch } from './hooks/useSuspenseFetch.js';
86
- export { default as useSwatchesOptions } from './hooks/useSwatchesOptions.js';
87
- import * as shop from './types/shop.js';
88
- export { shop as ShopType };
89
- export { OptionNormalStyle, OptionSpecialStyle } from './types/global-style.js';
90
- export { calculateFirstProduct, getCollection } from './helpers/queries/get-collection.js';
91
- export { fetchMedias, fetchVariants, getProduct } from './helpers/queries/get-product.js';
92
- export { getProductBySlug } from './helpers/queries/get-product-by-slug.js';
1
+ export{default as AddOn}from"./components/AddOn.js";export{default as Render}from"./components/Render.js";export{default as RenderPreview}from"./components/RenderPreview.js";export{RenderChildren,default as RenderLiquid}from"./components/Render.liquid.js";export{AddonProvider,useAddon,useAddons}from"./contexts/AddonContext.js";export{BuilderComponentProvider,useBuilderComponent}from"./contexts/BuilderComponent.js";export{BuilderProvider,useBuilderStore}from"./contexts/BuilderContext.js";export{BuilderPreviewProvider,useBuilderPreviewStore}from"./contexts/BuilderPreviewContext.js";export{CartLineProvider,useCartLineStore}from"./contexts/CartLineContext.js";export{ProductListProvider,useProductListStore}from"./contexts/ProductListContext.js";export{ProductProvider,useProductStore}from"./contexts/ProductContext.js";export{SectionProvider,useSection,useSectionStore}from"./contexts/SectionContext.js";export{ShopProvider,useShopStore}from"./contexts/ShopContext.js";export{CollectionProvider,useCollectionStore}from"./contexts/CollectionContext.js";export{ModalProvider,useModalStore}from"./contexts/ModalContext.js";export{PageViewUpDocument}from"./graphql/mutations/page-view-up.generated.js";export{CollectionDetailFilterDocument}from"./graphql/queries/collection-detail-filter.generated.js";export{CollectionDocument}from"./graphql/queries/collection.generated.js";export{CollectionsDocument}from"./graphql/queries/collections.generated.js";export{PublishedThemePagesDocument}from"./graphql/queries/published-theme-pages.generated.js";export{ProductsDocument}from"./graphql/queries/products.generated.js";export{StorePropertyDocument}from"./graphql/queries/store-property.generated.js";export{PreviewPageDocument}from"./graphql/queries/preview-page.generated.js";export{composeBorderCss,getBorderStyle,handleConvertBorderColor,handleConvertBorderStyle,handleConvertBorderWidth,handleConvertClassColor,handleConvertClassColorDynamicBtn}from"./helpers/borders.js";export{cls}from"./helpers/cls.js";export{flattenConnection}from"./helpers/flatten-connection.js";export{getResponsiveStateValue,getResponsiveValue,getResponsiveValueByScreen}from"./helpers/get-resonsive-value.js";export{getShortName}from"./helpers/get-shortname.js";export{default as globalEvent}from"./helpers/GlobalEvent.js";export{default as isBrowser}from"./helpers/is-browser.js";export{default as isSafari}from"./helpers/is-safari.js";export{isEmptyChildren}from"./helpers/is-empty-children.js";export{makeAspectRatio,makeHeight,makeLineClamp,makeStyle,makeStyleResponsive,makeStyleResponsiveState,makeStyleState,makeWidth,removeNullUndefined}from"./helpers/make-style.js";export{normalizeBuilderData}from"./helpers/normalize-builder-data.js";export{prefetchQueries}from"./helpers/prefetch-queries.js";export{composeSpacing,getSpacingVariable}from"./helpers/spacing.js";export{loadScript}from"./helpers/load-script.js";export{validateEmail}from"./helpers/email.js";export{genVariable}from"./helpers/css-variable.js";export{composeGridLayout,convertOldLayout,gridToArrayRegex,optionLayoutStyle}from"./helpers/layout.js";export{isDefined}from"./helpers/is-defined.js";export{composeTextColorCss,getGlobalColorCSSProp,getGlobalColorClass,getGlobalColorResponsiveClass,getGlobalColorResponsiveStyle,getGlobalColorStateClass,getGlobalColorStateClassDynamicBtn,getGlobalColorStateResponsiveClass,getGlobalColorStateResponsiveClassDynamicBtn,getGlobalColorStateResponsiveStyle,getGlobalColorStateStyle,getGlobalColorStyle,getSingleColorVariable,isColor}from"./helpers/colors.js";export{composeTypography,composeTypographyAttr,composeTypographyClassName,composeTypographyCss,composeTypographyStyle,composeTypographyV2,composeTypographyV2Css,genTypoClass}from"./helpers/typography.js";export{composeCornerCss,composeRadius,getCornerCSSFromGlobal,getCustomRadius,getRadiusCSSFromGlobal,getRadiusStyleActiveState}from"./helpers/radius.js";export{checkAvailableVariantInStock,getSelectedVariant,parseSelectedOption}from"./helpers/product.js";import*as e from"./helpers/tracking/fpixel.js";import*as o from"./helpers/tracking/gtag.js";import*as r from"./helpers/tracking/tiktokpixel.js";export{RenderIf,composeMemo,dataStringify,props,styles,template}from"./helpers/render.js";export{baseAssetURL,isLocalEnv}from"./helpers/convert.js";export{composeSize,composeSizeCss,genSizeClass}from"./helpers/size.js";export{composeShadowCss,getStyleShadow,getStyleShadowState,parseValueWithUnit}from"./helpers/shadow.js";export{composeBackgroundCss,getStyleBackgroundByDevice}from"./helpers/background.js";export{generateCollectionQueryKey,generateProductQueryKey,generateProductsQueryKey}from"./helpers/query.js";export{composeAdvanceStyle,splitStyle}from"./helpers/compose-advance-style.js";export{useAddToCart}from"./hooks/cart/use-add-to-cart.js";export{useCartData}from"./hooks/cart/use-cart-data.js";export{useCartDiscountCodesUpdate}from"./hooks/cart/use-cart-discount-codes-update.js";export{useCartNoteUpdate}from"./hooks/cart/use-cart-note-update.js";export{useCreateCart}from"./hooks/cart/use-create-cart.js";export{useRemoveCartItem}from"./hooks/cart/use-remove-cart-item.js";export{useUpdateCartItem}from"./hooks/cart/use-update-cart-item.js";export{useCheckoutUrl,useConnectedShopify,useCurrency,useEditorMode,useIsSampleProduct,useIsStorefrontProduct,useLocale,useMatchMutate,useMobileOnly,useMoneyFormat,usePageType,usePluginEnable,useStoreFront,useSwatches}from"./hooks/shop.js";export{useCollectionQuery}from"./hooks/shop/use-collection-query.js";export{useCollectionsQuery}from"./hooks/shop/use-collections-query.js";export{useProductQuery}from"./hooks/shop/use-product-query.js";export{useProductsQuery}from"./hooks/shop/use-products-query.js";export{useCurrentDevice}from"./hooks/use-current-device.js";export{useFormatMoney}from"./hooks/useFormatMoney.js";export{useLazyVideo}from"./hooks/use-lazy-video.js";export{default as useCartId}from"./hooks/useCartId.js";export{default as useCartLine}from"./hooks/useCartLine.js";export{default as useCartUI}from"./hooks/useCartUI.js";export{useCollection}from"./hooks/useCollection.js";export{useId}from"react";export{default as useIsomorphicLayoutEffect}from"./hooks/useIsomorphicLayoutEffect.js";export{default as useLoadScript}from"./hooks/useLoadScript.js";export{default as useMoney}from"./hooks/useMoney.js";export{usePrevious}from"./hooks/usePrevious.js";export{useCheckAvailableVariantInStock,useCurrentVariant,useCurrentVariantInStock,useFeaturedImageGlobal,useProduct,useProductProperties,useQuantity,useSelectedOption,useUniqProductID,useVariant,useVariantOutStock,useVariants}from"./hooks/useProduct.js";export{useProductList,useProductListProducts,useProductListSettings,useProductListStyles}from"./hooks/useProductList.js";export{default as useSuspenseFetch}from"./hooks/useSuspenseFetch.js";export{default as useSwatchesOptions}from"./hooks/useSwatchesOptions.js";import*as t from"./types/shop.js";export{OptionNormalStyle,OptionSpecialStyle}from"./types/global-style.js";export{calculateFirstProduct,getCollection}from"./helpers/queries/get-collection.js";export{fetchMedias,fetchVariants,getProduct}from"./helpers/queries/get-product.js";export{getProductBySlug}from"./helpers/queries/get-product-by-slug.js";export{e as fpixel,o as gtag,r as tiktokpixel,t as ShopType};
@@ -1,11 +1 @@
1
- const OptionNormalStyle = [
2
- 'radio_buttons',
3
- 'dropdown'
4
- ];
5
- const OptionSpecialStyle = [
6
- 'color',
7
- 'image',
8
- 'rectangle_list'
9
- ];
10
-
11
- export { OptionNormalStyle, OptionSpecialStyle };
1
+ let OptionNormalStyle=["radio_buttons","dropdown"],OptionSpecialStyle=["color","image","rectangle_list","image_shopify"];export{OptionNormalStyle,OptionSpecialStyle};