@gem-sdk/core 1.63.17 → 2.0.0-dev.157

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 (214) hide show
  1. package/dist/cjs/components/AddOn.js +1 -0
  2. package/dist/cjs/components/ComponentAnimation.js +1 -0
  3. package/dist/cjs/components/ComponentToolbarPreview.js +8 -7
  4. package/dist/cjs/components/ComponentWrapper.js +1 -0
  5. package/dist/cjs/components/ComponentWrapperPreview.js +3 -2
  6. package/dist/cjs/components/Empty.js +1 -0
  7. package/dist/cjs/components/InteractionSuffix.js +7 -6
  8. package/dist/cjs/components/Render.js +1 -0
  9. package/dist/cjs/components/Render.liquid.js +4 -1
  10. package/dist/cjs/components/RenderBlock.js +1 -0
  11. package/dist/cjs/components/RenderCustomCode.js +8 -7
  12. package/dist/cjs/components/RenderPreview.js +1 -0
  13. package/dist/cjs/components/RenderSection.js +1 -0
  14. package/dist/cjs/components/ai-generator/AIContentGenerator.js +5 -4
  15. package/dist/cjs/components/ai-generator/AIGenContentLoading.js +1 -0
  16. package/dist/cjs/components/ai-generator/components/PickProduct.js +5 -4
  17. package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +1 -0
  18. package/dist/cjs/components/ai-generator/icons/AIIcon.js +1 -0
  19. package/dist/cjs/components/ai-generator/icons/CloseIcon.js +1 -0
  20. package/dist/cjs/components/ai-generator/icons/DropdownIcon.js +1 -0
  21. package/dist/cjs/components/ai-generator/icons/SearchIcon.js +1 -0
  22. package/dist/cjs/components/ai-generator/icons/ShowMoreIcon.js +1 -0
  23. package/dist/cjs/components/ai-generator/icons/UpgradeIcon.js +1 -0
  24. package/dist/cjs/components/ai-generator/icons/WarningIcon.js +1 -0
  25. package/dist/cjs/components/resize/Resize.js +1 -0
  26. package/dist/cjs/components/resize/Spacing.js +8 -7
  27. package/dist/cjs/components/theme-section/CreateThemeSection.js +5 -4
  28. package/dist/cjs/components/theme-section/ThemeSectionStatus.js +1 -0
  29. package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +1 -0
  30. package/dist/cjs/components/toolbar/Tooltip.js +1 -0
  31. package/dist/cjs/contexts/AddonContext.js +1 -0
  32. package/dist/cjs/contexts/ArticleContext.js +1 -0
  33. package/dist/cjs/contexts/ArticleListContext.js +1 -0
  34. package/dist/cjs/contexts/BuilderComponent.js +1 -0
  35. package/dist/cjs/contexts/BuilderContext.js +1 -0
  36. package/dist/cjs/contexts/BuilderPreviewContext.js +1 -0
  37. package/dist/cjs/contexts/CartLineContext.js +1 -0
  38. package/dist/cjs/contexts/CollectionContext.js +1 -0
  39. package/dist/cjs/contexts/ModalContext.js +1 -0
  40. package/dist/cjs/contexts/PageContext.js +1 -0
  41. package/dist/cjs/contexts/ProductContext.js +12 -12
  42. package/dist/cjs/contexts/ProductListContext.js +1 -0
  43. package/dist/cjs/contexts/SectionContext.js +1 -0
  44. package/dist/cjs/contexts/ShopContext.js +1 -0
  45. package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +0 -4
  46. package/dist/cjs/graphql/fragments/published-theme-page.generated.js +4 -0
  47. package/dist/cjs/graphql/queries/articles.generated.js +1 -0
  48. package/dist/cjs/graphql/queries/blogs.generated.js +1 -0
  49. package/dist/cjs/graphql/queries/shop-shopify.generated.js +11 -0
  50. package/dist/cjs/helpers/align.js +18 -0
  51. package/dist/cjs/helpers/background.js +6 -2
  52. package/dist/cjs/helpers/backgroundImage.js +184 -0
  53. package/dist/cjs/helpers/borders.js +17 -0
  54. package/dist/cjs/helpers/compose-advance-style.js +71 -1
  55. package/dist/cjs/helpers/filter-toolbar-preview.js +1 -0
  56. package/dist/cjs/helpers/interaction/index.js +7 -6
  57. package/dist/cjs/helpers/is-empty-children.js +1 -0
  58. package/dist/cjs/helpers/layout.js +17 -0
  59. package/dist/cjs/helpers/radius.js +13 -1
  60. package/dist/cjs/helpers/shadow.js +28 -2
  61. package/dist/cjs/helpers/size.js +22 -0
  62. package/dist/cjs/helpers/third-party/appConfig.js +63 -0
  63. package/dist/cjs/helpers/third-party/appSetting.js +382 -6
  64. package/dist/cjs/helpers/third-party/constant.js +10 -1
  65. package/dist/cjs/helpers/third-party/getAppBlockConfig.js +5 -1
  66. package/dist/cjs/helpers/typography.js +10 -1
  67. package/dist/cjs/hooks/animation/useAnimationActions.js +1 -0
  68. package/dist/cjs/hooks/animation/useAnimationConfig.js +1 -0
  69. package/dist/cjs/hooks/animation/useAnimationPreview.js +1 -0
  70. package/dist/cjs/hooks/animation/useAnimationTarget.js +1 -0
  71. package/dist/cjs/hooks/animation/useApplyAnimation.js +1 -0
  72. package/dist/cjs/hooks/articles/useArticlesQuery.js +1 -0
  73. package/dist/cjs/hooks/cart/use-add-to-cart.js +1 -0
  74. package/dist/cjs/hooks/cart/use-cart-data.js +1 -0
  75. package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +1 -0
  76. package/dist/cjs/hooks/cart/use-cart-note-update.js +1 -0
  77. package/dist/cjs/hooks/cart/use-create-cart.js +1 -0
  78. package/dist/cjs/hooks/cart/use-remove-cart-item.js +1 -0
  79. package/dist/cjs/hooks/cart/use-update-cart-item.js +1 -0
  80. package/dist/cjs/hooks/shop/use-collection-query.js +1 -0
  81. package/dist/cjs/hooks/shop/use-collections-query.js +1 -0
  82. package/dist/cjs/hooks/shop/use-product-query.js +1 -0
  83. package/dist/cjs/hooks/shop/use-products-query.js +1 -0
  84. package/dist/cjs/hooks/shop/useShopifyLink.js +47 -0
  85. package/dist/cjs/hooks/shop.js +10 -0
  86. package/dist/cjs/hooks/use-current-device.js +2 -1
  87. package/dist/cjs/hooks/use-lazy-video.js +1 -0
  88. package/dist/cjs/hooks/useAnimations.js +1 -0
  89. package/dist/cjs/hooks/useCartId.js +1 -0
  90. package/dist/cjs/hooks/useCartLine.js +1 -0
  91. package/dist/cjs/hooks/useCartUI.js +1 -0
  92. package/dist/cjs/hooks/useCollection.js +1 -0
  93. package/dist/cjs/hooks/useFetchHandle.js +1 -0
  94. package/dist/cjs/hooks/useFormatMoney.js +1 -0
  95. package/dist/cjs/hooks/useInitialSwatchesOptions.js +1 -0
  96. package/dist/cjs/hooks/useInteraction.js +1 -0
  97. package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +1 -0
  98. package/dist/cjs/hooks/useLoadScript.js +1 -0
  99. package/dist/cjs/hooks/useMoney.js +1 -0
  100. package/dist/cjs/hooks/usePrevious.js +1 -0
  101. package/dist/cjs/hooks/useProduct.js +18 -0
  102. package/dist/cjs/hooks/useProductList.js +1 -0
  103. package/dist/cjs/hooks/useSuspenseFetch.js +1 -0
  104. package/dist/cjs/hooks/useSwatchesOptions.js +1 -0
  105. package/dist/cjs/hooks/useToolbarPostPurchase.js +1 -0
  106. package/dist/cjs/index.js +18 -0
  107. package/dist/esm/components/AddOn.js +1 -0
  108. package/dist/esm/components/ComponentAnimation.js +1 -0
  109. package/dist/esm/components/ComponentToolbarPreview.js +8 -7
  110. package/dist/esm/components/ComponentWrapper.js +1 -0
  111. package/dist/esm/components/ComponentWrapperPreview.js +3 -2
  112. package/dist/esm/components/Empty.js +1 -0
  113. package/dist/esm/components/InteractionSuffix.js +7 -6
  114. package/dist/esm/components/Render.js +1 -0
  115. package/dist/esm/components/Render.liquid.js +4 -1
  116. package/dist/esm/components/RenderBlock.js +1 -0
  117. package/dist/esm/components/RenderCustomCode.js +8 -7
  118. package/dist/esm/components/RenderPreview.js +1 -0
  119. package/dist/esm/components/RenderSection.js +1 -0
  120. package/dist/esm/components/ai-generator/AIContentGenerator.js +5 -4
  121. package/dist/esm/components/ai-generator/AIGenContentLoading.js +1 -0
  122. package/dist/esm/components/ai-generator/components/PickProduct.js +5 -4
  123. package/dist/esm/components/ai-generator/components/ToneAndVoice.js +1 -0
  124. package/dist/esm/components/ai-generator/icons/AIIcon.js +1 -0
  125. package/dist/esm/components/ai-generator/icons/CloseIcon.js +1 -0
  126. package/dist/esm/components/ai-generator/icons/DropdownIcon.js +1 -0
  127. package/dist/esm/components/ai-generator/icons/SearchIcon.js +1 -0
  128. package/dist/esm/components/ai-generator/icons/ShowMoreIcon.js +1 -0
  129. package/dist/esm/components/ai-generator/icons/UpgradeIcon.js +1 -0
  130. package/dist/esm/components/ai-generator/icons/WarningIcon.js +1 -0
  131. package/dist/esm/components/resize/Resize.js +1 -0
  132. package/dist/esm/components/resize/Spacing.js +8 -7
  133. package/dist/esm/components/theme-section/CreateThemeSection.js +5 -4
  134. package/dist/esm/components/theme-section/ThemeSectionStatus.js +1 -0
  135. package/dist/esm/components/theme-section/ThemeSectionTooltip.js +1 -0
  136. package/dist/esm/components/toolbar/Tooltip.js +1 -0
  137. package/dist/esm/contexts/AddonContext.js +1 -0
  138. package/dist/esm/contexts/ArticleContext.js +1 -0
  139. package/dist/esm/contexts/ArticleListContext.js +1 -0
  140. package/dist/esm/contexts/BuilderComponent.js +1 -0
  141. package/dist/esm/contexts/BuilderContext.js +1 -0
  142. package/dist/esm/contexts/BuilderPreviewContext.js +1 -0
  143. package/dist/esm/contexts/CartLineContext.js +1 -0
  144. package/dist/esm/contexts/CollectionContext.js +1 -0
  145. package/dist/esm/contexts/ModalContext.js +1 -0
  146. package/dist/esm/contexts/PageContext.js +1 -0
  147. package/dist/esm/contexts/ProductContext.js +12 -12
  148. package/dist/esm/contexts/ProductListContext.js +1 -0
  149. package/dist/esm/contexts/SectionContext.js +1 -0
  150. package/dist/esm/contexts/ShopContext.js +1 -0
  151. package/dist/esm/graphql/fragments/preview-theme-page.generated.js +0 -4
  152. package/dist/esm/graphql/fragments/published-theme-page.generated.js +4 -0
  153. package/dist/esm/graphql/queries/articles.generated.js +1 -0
  154. package/dist/esm/graphql/queries/blogs.generated.js +1 -0
  155. package/dist/esm/graphql/queries/shop-shopify.generated.js +9 -0
  156. package/dist/esm/helpers/align.js +18 -1
  157. package/dist/esm/helpers/background.js +6 -2
  158. package/dist/esm/helpers/backgroundImage.js +179 -0
  159. package/dist/esm/helpers/borders.js +17 -1
  160. package/dist/esm/helpers/compose-advance-style.js +71 -1
  161. package/dist/esm/helpers/filter-toolbar-preview.js +1 -0
  162. package/dist/esm/helpers/interaction/index.js +7 -6
  163. package/dist/esm/helpers/is-empty-children.js +1 -0
  164. package/dist/esm/helpers/layout.js +17 -1
  165. package/dist/esm/helpers/radius.js +13 -1
  166. package/dist/esm/helpers/shadow.js +28 -3
  167. package/dist/esm/helpers/size.js +21 -1
  168. package/dist/esm/helpers/third-party/appConfig.js +55 -1
  169. package/dist/esm/helpers/third-party/appSetting.js +382 -6
  170. package/dist/esm/helpers/third-party/constant.js +11 -2
  171. package/dist/esm/helpers/third-party/getAppBlockConfig.js +5 -1
  172. package/dist/esm/helpers/typography.js +10 -2
  173. package/dist/esm/hooks/animation/useAnimationActions.js +1 -0
  174. package/dist/esm/hooks/animation/useAnimationConfig.js +1 -0
  175. package/dist/esm/hooks/animation/useAnimationPreview.js +1 -0
  176. package/dist/esm/hooks/animation/useAnimationTarget.js +1 -0
  177. package/dist/esm/hooks/animation/useApplyAnimation.js +1 -0
  178. package/dist/esm/hooks/articles/useArticlesQuery.js +1 -0
  179. package/dist/esm/hooks/cart/use-add-to-cart.js +1 -0
  180. package/dist/esm/hooks/cart/use-cart-data.js +1 -0
  181. package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +1 -0
  182. package/dist/esm/hooks/cart/use-cart-note-update.js +1 -0
  183. package/dist/esm/hooks/cart/use-create-cart.js +1 -0
  184. package/dist/esm/hooks/cart/use-remove-cart-item.js +1 -0
  185. package/dist/esm/hooks/cart/use-update-cart-item.js +1 -0
  186. package/dist/esm/hooks/shop/use-collection-query.js +1 -0
  187. package/dist/esm/hooks/shop/use-collections-query.js +1 -0
  188. package/dist/esm/hooks/shop/use-product-query.js +1 -0
  189. package/dist/esm/hooks/shop/use-products-query.js +1 -0
  190. package/dist/esm/hooks/shop/useShopifyLink.js +45 -0
  191. package/dist/esm/hooks/shop.js +10 -1
  192. package/dist/esm/hooks/use-current-device.js +2 -1
  193. package/dist/esm/hooks/use-lazy-video.js +1 -0
  194. package/dist/esm/hooks/useAnimations.js +1 -0
  195. package/dist/esm/hooks/useCartId.js +1 -0
  196. package/dist/esm/hooks/useCartLine.js +1 -0
  197. package/dist/esm/hooks/useCartUI.js +1 -0
  198. package/dist/esm/hooks/useCollection.js +1 -0
  199. package/dist/esm/hooks/useFetchHandle.js +1 -0
  200. package/dist/esm/hooks/useFormatMoney.js +1 -0
  201. package/dist/esm/hooks/useInitialSwatchesOptions.js +1 -0
  202. package/dist/esm/hooks/useInteraction.js +1 -0
  203. package/dist/esm/hooks/useIsomorphicLayoutEffect.js +1 -0
  204. package/dist/esm/hooks/useLoadScript.js +1 -0
  205. package/dist/esm/hooks/useMoney.js +1 -0
  206. package/dist/esm/hooks/usePrevious.js +1 -0
  207. package/dist/esm/hooks/useProduct.js +18 -1
  208. package/dist/esm/hooks/useProductList.js +1 -0
  209. package/dist/esm/hooks/useSuspenseFetch.js +1 -0
  210. package/dist/esm/hooks/useSwatchesOptions.js +1 -0
  211. package/dist/esm/hooks/useToolbarPostPurchase.js +1 -0
  212. package/dist/esm/index.js +11 -8
  213. package/dist/types/index.d.ts +729 -253
  214. package/package.json +4 -4
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
3
  import { useRef } from 'react';
3
4
  import { Transition } from 'react-transition-group';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
 
3
4
  function Tooltip({ children, enable, text = 'Tooltip Text', position = 'right', width, ...props }) {
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useContext, useMemo, createContext } from 'react';
3
4
  import Empty from '../components/Empty.js';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, Fragment } from 'react/jsx-runtime';
2
3
  import { useStore, createStore } from 'zustand';
3
4
  import { useId, useMemo, useContext, createContext } from 'react';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useContext, createContext } from 'react';
3
4
  import { useStore, createStore } from 'zustand';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useStore, createStore } from 'zustand';
3
4
  import { useContext, createContext } from 'react';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useContext, createContext, Suspense, Fragment } from 'react';
3
4
  import { useStore, createStore } from 'zustand';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useMemo, useContext, createContext, Suspense, Fragment } from 'react';
3
4
  import { useStore, createStore } from 'zustand';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useStore, createStore } from 'zustand';
3
4
  import { useContext, createContext } from 'react';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useMemo, useContext, createContext } from 'react';
3
4
  import { useStore, createStore } from 'zustand';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useContext, createContext } from 'react';
3
4
  import { useStore, createStore } from 'zustand';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useMemo, useContext, createContext } from 'react';
3
4
  import { useStore, createStore } from 'zustand';
@@ -1,19 +1,9 @@
1
+ 'use client';
1
2
  import { jsx, Fragment } from 'react/jsx-runtime';
2
3
  import { useId, useMemo, useContext, createContext } from 'react';
3
4
  import { useStore, createStore } from 'zustand';
4
- import 'swr';
5
- import '@gem-sdk/adapter-shopify';
6
- import 'swr/mutation';
7
- import 'swr/infinite';
8
- import 'vanilla-lazyload';
9
- import '../hooks/useCartUI.js';
10
- import { checkInStock } from '../helpers/variant.js';
11
- import 'react-transition-group';
12
- import '@gem-sdk/core';
13
- import 'classnames';
14
- import 'dayjs';
15
5
  import { flattenConnection } from '../helpers/flatten-connection.js';
16
- import '../helpers/convert.js';
6
+ import { checkInStock } from '../helpers/variant.js';
17
7
 
18
8
  // const { Provider, useStore } = createContext<StoreApi<ProductContextProps>>();
19
9
  const ProductContext = /*#__PURE__*/ createContext(null);
@@ -39,6 +29,16 @@ const createProductStoreProvider = (data)=>createStore((set, get)=>({
39
29
  useProductCompareAtPrice: value
40
30
  });
41
31
  },
32
+ setShouldRequireUploadMessage: (value)=>{
33
+ set({
34
+ shouldRequireUploadMessage: value
35
+ });
36
+ },
37
+ setRequireUpload: (value)=>{
38
+ set({
39
+ requireUpload: value
40
+ });
41
+ },
42
42
  addProperty: (data)=>{
43
43
  const properties = get().properties;
44
44
  if (!properties?.some((v)=>v.key === data.key)) {
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useContext, createContext } from 'react';
3
4
  import { useStore, createStore } from 'zustand';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useStore, createStore } from 'zustand';
3
4
  import { useContext, createContext } from 'react';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { SWRConfig } from 'swr';
3
4
  import { useStore, createStore } from 'zustand';
@@ -27,10 +27,6 @@
27
27
  customFonts {
28
28
  ...CustomFontSelect
29
29
  }
30
- interaction {
31
- id
32
- value
33
- }
34
30
  }
35
31
  `;
36
32
 
@@ -30,6 +30,10 @@
30
30
  id
31
31
  value
32
32
  }
33
+ metafields {
34
+ key
35
+ value
36
+ }
33
37
  }
34
38
  `;
35
39
 
@@ -25,6 +25,7 @@ const ArticlesDocument = `
25
25
  }
26
26
  isSample
27
27
  platformCreatedAt
28
+ platformUpdatedAt
28
29
  author
29
30
  content {
30
31
  excerptHtml
@@ -32,6 +32,7 @@ const BlogsDocument = `
32
32
  }
33
33
  isSample
34
34
  platformCreatedAt
35
+ platformUpdatedAt
35
36
  author
36
37
  content {
37
38
  excerptHtml
@@ -0,0 +1,9 @@
1
+ const ShopShopifyDocument = `
2
+ query shopShopify {
3
+ shopShopify {
4
+ timezone
5
+ }
6
+ }
7
+ `;
8
+
9
+ export { ShopShopifyDocument };
@@ -13,5 +13,22 @@ const convertTextAlignToJustify = (align)=>{
13
13
  });
14
14
  return result;
15
15
  };
16
+ const getAlignmentClasses = (align)=>{
17
+ const breakpoints = [
18
+ 'desktop',
19
+ 'tablet',
20
+ 'mobile'
21
+ ];
22
+ return breakpoints.reduce((classes, bp)=>{
23
+ const prefix = bp === 'desktop' ? '' : `${bp}:`;
24
+ const alignment = align?.[bp];
25
+ if (alignment) {
26
+ classes[`${prefix}gp-justify-start`] = alignment === 'left';
27
+ classes[`${prefix}gp-justify-center`] = alignment === 'center';
28
+ classes[`${prefix}gp-justify-end`] = alignment === 'right';
29
+ }
30
+ return classes;
31
+ }, {});
32
+ };
16
33
 
17
- export { convertTextAlignToJustify };
34
+ export { convertTextAlignToJustify, getAlignmentClasses };
@@ -71,9 +71,12 @@ const getBgImageByDevice = (background, device, options)=>{
71
71
  imageByDevice = `{{ "${newBackupFilekey}" | asset_url }}`;
72
72
  }
73
73
  }
74
- if (typeof imageByDevice === 'string') {
74
+ if (typeof imageByDevice === 'string' && imageByDevice) {
75
75
  return `url(${imageByDevice})`;
76
76
  }
77
+ if (imageByDevice !== undefined) {
78
+ return 'none';
79
+ }
77
80
  };
78
81
  const getStyleBgPosition = (background)=>{
79
82
  const bgPosition = {
@@ -214,9 +217,10 @@ const getGradientBgrStyleByDevice = (backgroundStyle, ignoreBackgroundImage)=>{
214
217
  'mobile'
215
218
  ].forEach((device)=>{
216
219
  if (backgroundStyle[device]?.color?.includes(GRADIENT_BGR_KEY)) {
220
+ const bgImage = `${getBgImageByDevice(backgroundStyle, device) || 'url()'}, ${backgroundStyle[device]?.color}`;
217
221
  Object.assign(bgrStyle, {
218
222
  [`--bgc${device !== 'desktop' ? '-' + device : ''}`]: backgroundStyle[device]?.color,
219
- [`--bgi${device !== 'desktop' ? '-' + device : ''}`]: !ignoreBackgroundImage?.[device] ? `${backgroundStyle[device]?.color}` : `${getBgImageByDevice(backgroundStyle, device) || 'url()'}, ${backgroundStyle[device]?.color}`
223
+ [`--bgi${device !== 'desktop' ? '-' + device : ''}`]: !ignoreBackgroundImage?.[device] ? `${backgroundStyle[device]?.color}` : bgImage
220
224
  });
221
225
  }
222
226
  });
@@ -0,0 +1,179 @@
1
+ import { makeStyleResponsiveState } from './make-style.js';
2
+
3
+ const getStyleBackgroundImageByDevice = (backgroundImage, options)=>{
4
+ if (!backgroundImage) {
5
+ return {};
6
+ }
7
+ return {
8
+ ...!options?.ignoreBackgroundImage ? {
9
+ ...getStyleBgImageSource(backgroundImage, options)
10
+ } : {},
11
+ ...!options?.ignoreBackgroundImageProperties ? {
12
+ ...getStyleBgImagePosition(backgroundImage),
13
+ ...getStyleBgImageSize(backgroundImage),
14
+ ...getStyleBgImageRepeat(backgroundImage)
15
+ } : {},
16
+ ...!options?.ignoreBgAttachment ? getStyleBgImageAttachment(backgroundImage) : {}
17
+ };
18
+ };
19
+ const getStyleBgImageSource = (backgroundImage, options)=>{
20
+ const bgImage = {
21
+ desktop: {
22
+ normal: getBgImageSourceByDevice(backgroundImage, 'desktop', 'normal', options),
23
+ hover: getBgImageSourceByDevice(backgroundImage, 'desktop', 'hover', options)
24
+ },
25
+ tablet: {
26
+ normal: getBgImageSourceByDevice(backgroundImage, 'tablet', 'normal', options),
27
+ hover: getBgImageSourceByDevice(backgroundImage, 'tablet', 'hover', options)
28
+ },
29
+ mobile: {
30
+ normal: getBgImageSourceByDevice(backgroundImage, 'mobile', 'normal', options),
31
+ hover: getBgImageSourceByDevice(backgroundImage, 'mobile', 'hover', options)
32
+ }
33
+ };
34
+ return makeStyleResponsiveState('bgi', bgImage);
35
+ };
36
+ const getBgImageSourceByDevice = (backgroundImage, device, state, options)=>{
37
+ const stateValue = backgroundImage?.[device]?.[state];
38
+ if (!stateValue?.image?.src) return;
39
+ const backupFileKey = stateValue.image.backupFileKey;
40
+ const storage = stateValue.image.storage;
41
+ let imageByDevice = stateValue.image.src;
42
+ let newBackupFilekey = backupFileKey;
43
+ const shopifyHandleName = imageByDevice?.match(// eslint-disable-next-line
44
+ /\/files\/([^\/]+\.(jpg|jpeg|gif|png|webp|svg))/)?.[1];
45
+ if (backupFileKey && shopifyHandleName && shopifyHandleName !== backupFileKey) {
46
+ newBackupFilekey = shopifyHandleName;
47
+ }
48
+ if (storage === 'FILE_CONTENT') {
49
+ if (options?.liquid && newBackupFilekey) {
50
+ imageByDevice = `{{ "${newBackupFilekey.replace('.jpeg', '.jpg')}" | file_url }}`;
51
+ }
52
+ }
53
+ if (storage === 'THEME' || !storage) {
54
+ if (options?.liquid && newBackupFilekey) {
55
+ imageByDevice = `{{ "${newBackupFilekey}" | asset_url }}`;
56
+ }
57
+ }
58
+ return imageByDevice ? `url(${imageByDevice})` : 'none';
59
+ };
60
+ const getStyleBgImagePosition = (backgroundImage)=>{
61
+ const bgPosition = {
62
+ desktop: {
63
+ normal: getBgImagePositionByDevice(backgroundImage, 'desktop', 'normal'),
64
+ hover: getBgImagePositionByDevice(backgroundImage, 'desktop', 'hover')
65
+ },
66
+ tablet: {
67
+ normal: getBgImagePositionByDevice(backgroundImage, 'tablet', 'normal'),
68
+ hover: getBgImagePositionByDevice(backgroundImage, 'tablet', 'hover')
69
+ },
70
+ mobile: {
71
+ normal: getBgImagePositionByDevice(backgroundImage, 'mobile', 'normal'),
72
+ hover: getBgImagePositionByDevice(backgroundImage, 'mobile', 'hover')
73
+ }
74
+ };
75
+ return makeStyleResponsiveState('bgp', bgPosition);
76
+ };
77
+ const getBgImagePositionByDevice = (backgroundImage, device, state)=>{
78
+ const position = backgroundImage?.[device]?.[state]?.position;
79
+ return position && `${position.x}% ${position.y}%`;
80
+ };
81
+ const getStyleBgImageSize = (backgroundImage)=>{
82
+ const bgSize = {
83
+ desktop: {
84
+ normal: getBgImageSizeByDevice(backgroundImage, 'desktop', 'normal'),
85
+ hover: getBgImageSizeByDevice(backgroundImage, 'desktop', 'hover')
86
+ },
87
+ tablet: {
88
+ normal: getBgImageSizeByDevice(backgroundImage, 'tablet', 'normal'),
89
+ hover: getBgImageSizeByDevice(backgroundImage, 'tablet', 'hover')
90
+ },
91
+ mobile: {
92
+ normal: getBgImageSizeByDevice(backgroundImage, 'mobile', 'normal'),
93
+ hover: getBgImageSizeByDevice(backgroundImage, 'mobile', 'hover')
94
+ }
95
+ };
96
+ return makeStyleResponsiveState('bgs', bgSize);
97
+ };
98
+ const getBgImageSizeByDevice = (backgroundImage, device, state)=>{
99
+ return backgroundImage?.[device]?.[state]?.size;
100
+ };
101
+ const getStyleBgImageRepeat = (backgroundImage)=>{
102
+ const bgRepeat = {
103
+ desktop: {
104
+ normal: getBgImageRepeatByDevice(backgroundImage, 'desktop', 'normal'),
105
+ hover: getBgImageRepeatByDevice(backgroundImage, 'desktop', 'hover')
106
+ },
107
+ tablet: {
108
+ normal: getBgImageRepeatByDevice(backgroundImage, 'tablet', 'normal'),
109
+ hover: getBgImageRepeatByDevice(backgroundImage, 'tablet', 'hover')
110
+ },
111
+ mobile: {
112
+ normal: getBgImageRepeatByDevice(backgroundImage, 'mobile', 'normal'),
113
+ hover: getBgImageRepeatByDevice(backgroundImage, 'mobile', 'hover')
114
+ }
115
+ };
116
+ return makeStyleResponsiveState('bgr', bgRepeat);
117
+ };
118
+ const getBgImageRepeatByDevice = (backgroundImage, device, state)=>{
119
+ return backgroundImage?.[device]?.[state]?.repeat;
120
+ };
121
+ const getStyleBgImageAttachment = (backgroundImage)=>{
122
+ const bgAttachment = {
123
+ desktop: {
124
+ normal: getBgImageAttachmentByDevice(backgroundImage, 'desktop', 'normal'),
125
+ hover: getBgImageAttachmentByDevice(backgroundImage, 'desktop', 'hover')
126
+ },
127
+ tablet: {
128
+ normal: getBgImageAttachmentByDevice(backgroundImage, 'tablet', 'normal'),
129
+ hover: getBgImageAttachmentByDevice(backgroundImage, 'tablet', 'hover')
130
+ },
131
+ mobile: {
132
+ normal: getBgImageAttachmentByDevice(backgroundImage, 'mobile', 'normal'),
133
+ hover: getBgImageAttachmentByDevice(backgroundImage, 'mobile', 'hover')
134
+ }
135
+ };
136
+ return makeStyleResponsiveState('bga', bgAttachment);
137
+ };
138
+ const getBgImageAttachmentByDevice = (backgroundImage, device, state)=>{
139
+ return backgroundImage?.[device]?.[state]?.attachment;
140
+ };
141
+ const composeBackgroundImageCss = (config, options = {})=>{
142
+ if (!config) return undefined;
143
+ const { device = 'desktop', state = 'normal', useLiquid = false } = options;
144
+ const styles = [];
145
+ const bgConfig = config?.[device]?.[state];
146
+ if (!bgConfig) return '';
147
+ // Handle background image source
148
+ if (bgConfig.image?.src) {
149
+ let imageUrl = bgConfig.image.src;
150
+ // Handle Shopify liquid transformations if needed
151
+ if (useLiquid && bgConfig.image.backupFileKey) {
152
+ if (bgConfig.image.storage === 'FILE_CONTENT') {
153
+ imageUrl = `{{ "${bgConfig.image.backupFileKey.replace('.jpeg', '.jpg')}" | file_url }}`;
154
+ } else if (bgConfig.image.storage === 'THEME' || !bgConfig.image.storage) {
155
+ imageUrl = `{{ "${bgConfig.image.backupFileKey}" | asset_url }}`;
156
+ }
157
+ }
158
+ styles.push(`background-image: url(${imageUrl});`);
159
+ }
160
+ // Handle position
161
+ if (bgConfig.position) {
162
+ styles.push(`background-position: ${bgConfig.position.x}% ${bgConfig.position.y}%;`);
163
+ }
164
+ // Handle size
165
+ if (bgConfig.size) {
166
+ styles.push(`background-size: ${bgConfig.size};`);
167
+ }
168
+ // Handle repeat
169
+ if (bgConfig.repeat) {
170
+ styles.push(`background-repeat: ${bgConfig.repeat};`);
171
+ }
172
+ // Handle attachment
173
+ if (bgConfig.attachment) {
174
+ styles.push(`background-attachment: ${bgConfig.attachment};`);
175
+ }
176
+ return styles.join('\n ');
177
+ };
178
+
179
+ export { composeBackgroundImageCss, getBgImageSourceByDevice, getStyleBackgroundImageByDevice, getStyleBgImageSource };
@@ -1,5 +1,6 @@
1
1
  import { getSingleColorVariable, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStateResponsiveClass, getGlobalColorStateClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateClassDynamicBtn } from './colors.js';
2
2
  import { makeStyle, makeStyleResponsiveState, makeStyleState } from './make-style.js';
3
+ import { devicesMapping } from './constant.js';
3
4
 
4
5
  const getBorderStyle = (value)=>{
5
6
  return makeStyle({
@@ -185,5 +186,20 @@ const composeBorderCss = (borderV)=>{
185
186
  ${color ? `border-color: ${getSingleColorVariable(color)};` : ''}
186
187
  `;
187
188
  };
189
+ const composeBorderResponsive = (borderValue)=>{
190
+ const style = {};
191
+ Object.assign(style, composeBorderDevice(borderValue?.desktop, 'desktop'));
192
+ Object.assign(style, composeBorderDevice(borderValue?.tablet, 'tablet'));
193
+ Object.assign(style, composeBorderDevice(borderValue?.mobile, 'mobile'));
194
+ return style;
195
+ };
196
+ const composeBorderDevice = (value, device)=>{
197
+ const suffix = device && device !== 'desktop' ? devicesMapping?.[device] : '';
198
+ return {
199
+ [`--b${suffix}`]: value?.border,
200
+ [`--bc${suffix}`]: getSingleColorVariable(value?.color),
201
+ [`--bw${suffix}`]: value?.width
202
+ };
203
+ };
188
204
 
189
- export { composeBorderCss, getBorderRadiusStyle, getBorderStyle, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn };
205
+ export { composeBorderCss, composeBorderResponsive, getBorderRadiusStyle, getBorderStyle, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn };
@@ -110,7 +110,77 @@ function composeAdvanceStyle(data, tag, pageType) {
110
110
  Object.assign(styles, composeRadius(value));
111
111
  }
112
112
  if (attr === 'boxShadow') {
113
- Object.assign(styles, getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
113
+ const baseElements = [
114
+ 'Section',
115
+ 'Row',
116
+ 'Text',
117
+ 'Heading',
118
+ 'Image',
119
+ 'Button',
120
+ 'HeroBanner',
121
+ 'ImageComparison',
122
+ 'Countdown',
123
+ 'Video'
124
+ ];
125
+ const productElements = [
126
+ 'ProductTitle',
127
+ 'ProductDescription',
128
+ 'ProductPrice',
129
+ 'ProductVendor',
130
+ 'Product',
131
+ 'ProductSku',
132
+ 'StockCounter',
133
+ 'Sticky',
134
+ 'ProductBadge',
135
+ 'ProductViewMore',
136
+ 'ProductButton',
137
+ 'DynamicCheckout'
138
+ ];
139
+ const boostElements = [
140
+ 'Icon',
141
+ 'IconListHoz',
142
+ 'Line',
143
+ 'IconList',
144
+ 'IconListV2',
145
+ 'Tabs',
146
+ 'Accordion',
147
+ 'Marquee',
148
+ 'Breadcrumb',
149
+ 'EstimateDate'
150
+ ];
151
+ const formElements = [
152
+ 'Newsletter',
153
+ 'ContactForm',
154
+ 'TextField',
155
+ 'FormTextarea',
156
+ 'FormEmail',
157
+ 'FormDropdown',
158
+ 'FormCheckbox',
159
+ 'SubmitButton'
160
+ ];
161
+ const collectionElements = [
162
+ 'CollectionTitle',
163
+ 'CollectionDescription',
164
+ 'CollectionBanner',
165
+ 'CollectionToolbar',
166
+ 'CollectionPaginator'
167
+ ];
168
+ const listElementShadowV2 = [
169
+ ...baseElements,
170
+ ...productElements,
171
+ ...boostElements,
172
+ ...formElements,
173
+ ...collectionElements
174
+ ];
175
+ let hasBoxShadowV2 = hasBoxShadow;
176
+ if (listElementShadowV2.includes(tag || '')) {
177
+ hasBoxShadowV2 = {
178
+ desktop: value.desktop ?? {},
179
+ tablet: value.tablet ?? value.desktop ?? {},
180
+ mobile: value.mobile ?? value.tablet ?? value.desktop ?? {}
181
+ };
182
+ }
183
+ Object.assign(styles, getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadowV2 ?? hasBoxShadow));
114
184
  }
115
185
  const styleValue = getAttrValue(attr, deviceValue, tag);
116
186
  if (composeAttr === 'desktop') {
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { Children } from 'react';
2
3
  import ComponentToolbarPreview from '../components/ComponentToolbarPreview.js';
3
4
 
@@ -1,18 +1,19 @@
1
+ 'use client';
1
2
  import { useRef, useMemo, useCallback } from 'react';
2
3
  import 'react/jsx-runtime';
3
4
  import 'zustand';
4
5
  import { usePageStore } from '../../contexts/PageContext.js';
5
- import 'react-transition-group';
6
- import '@gem-sdk/core';
7
6
  import 'swr';
8
- import 'swr/infinite';
9
- import 'classnames';
10
- import 'dayjs';
11
- import '../convert.js';
12
7
  import '@gem-sdk/adapter-shopify';
13
8
  import 'swr/mutation';
9
+ import 'swr/infinite';
14
10
  import 'vanilla-lazyload';
15
11
  import '../../hooks/useCartUI.js';
12
+ import 'react-transition-group';
13
+ import '@gem-sdk/core';
14
+ import 'classnames';
15
+ import 'dayjs';
16
+ import '../convert.js';
16
17
 
17
18
  const useInteraction = ()=>{
18
19
  const ref = useRef();
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { Children } from 'react';
2
3
  import ComponentToolbarPreview from '../components/ComponentToolbarPreview.js';
3
4
 
@@ -50,5 +50,21 @@ const convertOldLayout = (layout)=>{
50
50
  }
51
51
  };
52
52
  };
53
+ const getLayoutClasses = (layout)=>{
54
+ const breakpoints = [
55
+ 'desktop',
56
+ 'tablet',
57
+ 'mobile'
58
+ ];
59
+ return breakpoints.reduce((classes, bp)=>{
60
+ const prefix = bp === 'desktop' ? '' : `${bp}:`;
61
+ const layoutValue = layout?.[bp];
62
+ if (layoutValue) {
63
+ classes[`${prefix}gp-flex-col`] = layoutValue === 'vertical';
64
+ classes[`${prefix}gp-flex-row`] = layoutValue === 'horizontal';
65
+ }
66
+ return classes;
67
+ }, {});
68
+ };
53
69
 
54
- export { composeGridLayout, convertOldLayout, gridToArrayRegex, optionLayoutStyle };
70
+ export { composeGridLayout, convertOldLayout, getLayoutClasses, gridToArrayRegex, optionLayoutStyle };
@@ -25,7 +25,15 @@ const getRadiusCSSFromGlobal = (state, key, device)=>{
25
25
  };
26
26
  };
27
27
  const getCustomRadius = (state, radius, device)=>{
28
- if (!radius || !state || radius?.radiusType !== 'custom') return {};
28
+ const list = [
29
+ 'custom',
30
+ 'pill',
31
+ 'rounded',
32
+ 'single',
33
+ 'none',
34
+ 'circle'
35
+ ];
36
+ if (!radius || !state || !list.includes(radius?.radiusType ?? '')) return {};
29
37
  const suffix = device && device !== 'desktop' ? devicesMapping?.[device] : '';
30
38
  const mState = stateMapping?.[state];
31
39
  return {
@@ -60,6 +68,7 @@ const composeRadiusState = (radiusValue, device)=>{
60
68
  case 'circle':
61
69
  case 'none':
62
70
  case 'custom':
71
+ case 'rounded':
63
72
  Object.assign(style, getCustomRadius('normal', radiusValue.normal, device));
64
73
  break;
65
74
  }
@@ -72,6 +81,7 @@ const composeRadiusState = (radiusValue, device)=>{
72
81
  case 'circle':
73
82
  case 'none':
74
83
  case 'custom':
84
+ case 'rounded':
75
85
  Object.assign(style, getCustomRadius('hover', radiusValue.hover, device));
76
86
  break;
77
87
  }
@@ -84,6 +94,7 @@ const composeRadiusState = (radiusValue, device)=>{
84
94
  case 'circle':
85
95
  case 'none':
86
96
  case 'custom':
97
+ case 'rounded':
87
98
  Object.assign(style, getCustomRadius('focus', radiusValue.focus, device));
88
99
  break;
89
100
  }
@@ -117,6 +128,7 @@ const composeCornerCss = (value, important = false)=>{
117
128
  break;
118
129
  case 'circle':
119
130
  case 'none':
131
+ case 'rounded':
120
132
  case 'custom':
121
133
  radiusValue = `
122
134
  ${bblr ? `border-bottom-left-radius: ${bblr}${sub};` : ''}