@gem-sdk/core 1.58.0-dev.13 → 1.58.0-dev.134

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 (212) 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 +33 -19
  4. package/dist/cjs/components/ComponentWrapper.js +1 -0
  5. package/dist/cjs/components/ComponentWrapperPreview.js +1 -0
  6. package/dist/cjs/components/Empty.js +1 -0
  7. package/dist/cjs/components/InteractionSuffix.js +2 -1
  8. package/dist/cjs/components/Render.js +1 -0
  9. package/dist/cjs/components/Render.liquid.js +14 -5
  10. package/dist/cjs/components/RenderBlock.js +1 -0
  11. package/dist/cjs/components/RenderCustomCode.js +1 -0
  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 +2 -1
  15. package/dist/cjs/components/ai-generator/AIGenContentLoading.js +1 -0
  16. package/dist/cjs/components/ai-generator/components/PickProduct.js +1 -0
  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 +1 -0
  27. package/dist/cjs/components/theme-section/CreateThemeSection.js +2 -1
  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 +17 -1
  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 +35 -0
  46. package/dist/cjs/graphql/fragments/published-theme-page.generated.js +4 -28
  47. package/dist/cjs/graphql/queries/articles.generated.js +1 -0
  48. package/dist/cjs/graphql/queries/preview-page.generated.js +9 -13
  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/backgroundImage.js +184 -0
  52. package/dist/cjs/helpers/compose-advance-style.js +57 -3
  53. package/dist/cjs/helpers/filter-toolbar-preview.js +1 -0
  54. package/dist/cjs/helpers/interaction/index.js +2 -1
  55. package/dist/cjs/helpers/is-empty-children.js +1 -0
  56. package/dist/cjs/helpers/layout.js +17 -0
  57. package/dist/cjs/helpers/prefetch-queries.js +5 -3
  58. package/dist/cjs/helpers/radius.js +3 -1
  59. package/dist/cjs/helpers/shadow.js +25 -0
  60. package/dist/cjs/helpers/size.js +30 -2
  61. package/dist/cjs/helpers/third-party/appConfig.js +70 -0
  62. package/dist/cjs/helpers/third-party/appSetting.js +345 -2
  63. package/dist/cjs/helpers/third-party/constant.js +11 -1
  64. package/dist/cjs/helpers/third-party/getAppBlockConfig.js +17 -1
  65. package/dist/cjs/helpers/typography.js +10 -1
  66. package/dist/cjs/hooks/animation/useAnimationActions.js +1 -0
  67. package/dist/cjs/hooks/animation/useAnimationConfig.js +1 -0
  68. package/dist/cjs/hooks/animation/useAnimationPreview.js +1 -0
  69. package/dist/cjs/hooks/animation/useAnimationTarget.js +1 -0
  70. package/dist/cjs/hooks/animation/useApplyAnimation.js +1 -0
  71. package/dist/cjs/hooks/articles/useArticlesQuery.js +1 -0
  72. package/dist/cjs/hooks/cart/use-add-to-cart.js +1 -0
  73. package/dist/cjs/hooks/cart/use-cart-data.js +1 -0
  74. package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +1 -0
  75. package/dist/cjs/hooks/cart/use-cart-note-update.js +1 -0
  76. package/dist/cjs/hooks/cart/use-create-cart.js +1 -0
  77. package/dist/cjs/hooks/cart/use-remove-cart-item.js +1 -0
  78. package/dist/cjs/hooks/cart/use-update-cart-item.js +1 -0
  79. package/dist/cjs/hooks/shop/use-collection-query.js +1 -0
  80. package/dist/cjs/hooks/shop/use-collections-query.js +1 -0
  81. package/dist/cjs/hooks/shop/use-product-query.js +1 -0
  82. package/dist/cjs/hooks/shop/use-products-query.js +1 -0
  83. package/dist/cjs/hooks/shop/useShopifyLink.js +47 -0
  84. package/dist/cjs/hooks/shop.js +10 -0
  85. package/dist/cjs/hooks/use-current-device.js +1 -0
  86. package/dist/cjs/hooks/use-lazy-video.js +1 -0
  87. package/dist/cjs/hooks/useAnimations.js +1 -0
  88. package/dist/cjs/hooks/useCartId.js +1 -0
  89. package/dist/cjs/hooks/useCartLine.js +1 -0
  90. package/dist/cjs/hooks/useCartUI.js +1 -0
  91. package/dist/cjs/hooks/useCollection.js +1 -0
  92. package/dist/cjs/hooks/useFetchHandle.js +1 -0
  93. package/dist/cjs/hooks/useFormatMoney.js +1 -0
  94. package/dist/cjs/hooks/useInitialSwatchesOptions.js +1 -0
  95. package/dist/cjs/hooks/useInteraction.js +1 -0
  96. package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +1 -0
  97. package/dist/cjs/hooks/useLoadScript.js +1 -0
  98. package/dist/cjs/hooks/useMoney.js +1 -0
  99. package/dist/cjs/hooks/usePrevious.js +1 -0
  100. package/dist/cjs/hooks/useProduct.js +28 -1
  101. package/dist/cjs/hooks/useProductList.js +1 -0
  102. package/dist/cjs/hooks/useSuspenseFetch.js +1 -0
  103. package/dist/cjs/hooks/useSwatchesOptions.js +1 -0
  104. package/dist/cjs/hooks/useToolbarPostPurchase.js +1 -0
  105. package/dist/cjs/index.js +28 -10
  106. package/dist/esm/components/AddOn.js +1 -0
  107. package/dist/esm/components/ComponentAnimation.js +1 -0
  108. package/dist/esm/components/ComponentToolbarPreview.js +33 -19
  109. package/dist/esm/components/ComponentWrapper.js +1 -0
  110. package/dist/esm/components/ComponentWrapperPreview.js +1 -0
  111. package/dist/esm/components/Empty.js +1 -0
  112. package/dist/esm/components/InteractionSuffix.js +2 -1
  113. package/dist/esm/components/Render.js +1 -0
  114. package/dist/esm/components/Render.liquid.js +14 -5
  115. package/dist/esm/components/RenderBlock.js +1 -0
  116. package/dist/esm/components/RenderCustomCode.js +1 -0
  117. package/dist/esm/components/RenderPreview.js +1 -0
  118. package/dist/esm/components/RenderSection.js +1 -0
  119. package/dist/esm/components/ai-generator/AIContentGenerator.js +2 -1
  120. package/dist/esm/components/ai-generator/AIGenContentLoading.js +1 -0
  121. package/dist/esm/components/ai-generator/components/PickProduct.js +1 -0
  122. package/dist/esm/components/ai-generator/components/ToneAndVoice.js +1 -0
  123. package/dist/esm/components/ai-generator/icons/AIIcon.js +1 -0
  124. package/dist/esm/components/ai-generator/icons/CloseIcon.js +1 -0
  125. package/dist/esm/components/ai-generator/icons/DropdownIcon.js +1 -0
  126. package/dist/esm/components/ai-generator/icons/SearchIcon.js +1 -0
  127. package/dist/esm/components/ai-generator/icons/ShowMoreIcon.js +1 -0
  128. package/dist/esm/components/ai-generator/icons/UpgradeIcon.js +1 -0
  129. package/dist/esm/components/ai-generator/icons/WarningIcon.js +1 -0
  130. package/dist/esm/components/resize/Resize.js +1 -0
  131. package/dist/esm/components/resize/Spacing.js +1 -0
  132. package/dist/esm/components/theme-section/CreateThemeSection.js +2 -1
  133. package/dist/esm/components/theme-section/ThemeSectionStatus.js +1 -0
  134. package/dist/esm/components/theme-section/ThemeSectionTooltip.js +1 -0
  135. package/dist/esm/components/toolbar/Tooltip.js +1 -0
  136. package/dist/esm/contexts/AddonContext.js +1 -0
  137. package/dist/esm/contexts/ArticleContext.js +1 -0
  138. package/dist/esm/contexts/ArticleListContext.js +1 -0
  139. package/dist/esm/contexts/BuilderComponent.js +1 -0
  140. package/dist/esm/contexts/BuilderContext.js +1 -0
  141. package/dist/esm/contexts/BuilderPreviewContext.js +1 -0
  142. package/dist/esm/contexts/CartLineContext.js +1 -0
  143. package/dist/esm/contexts/CollectionContext.js +1 -0
  144. package/dist/esm/contexts/ModalContext.js +1 -0
  145. package/dist/esm/contexts/PageContext.js +1 -0
  146. package/dist/esm/contexts/ProductContext.js +17 -1
  147. package/dist/esm/contexts/ProductListContext.js +1 -0
  148. package/dist/esm/contexts/SectionContext.js +1 -0
  149. package/dist/esm/contexts/ShopContext.js +1 -0
  150. package/dist/esm/graphql/fragments/preview-theme-page.generated.js +33 -0
  151. package/dist/esm/graphql/fragments/published-theme-page.generated.js +5 -28
  152. package/dist/esm/graphql/queries/articles.generated.js +1 -0
  153. package/dist/esm/graphql/queries/preview-page.generated.js +8 -12
  154. package/dist/esm/graphql/queries/shop-shopify.generated.js +9 -0
  155. package/dist/esm/helpers/align.js +18 -1
  156. package/dist/esm/helpers/backgroundImage.js +179 -0
  157. package/dist/esm/helpers/compose-advance-style.js +57 -3
  158. package/dist/esm/helpers/filter-toolbar-preview.js +1 -0
  159. package/dist/esm/helpers/interaction/index.js +2 -1
  160. package/dist/esm/helpers/is-empty-children.js +1 -0
  161. package/dist/esm/helpers/layout.js +17 -1
  162. package/dist/esm/helpers/prefetch-queries.js +5 -3
  163. package/dist/esm/helpers/radius.js +3 -1
  164. package/dist/esm/helpers/shadow.js +25 -1
  165. package/dist/esm/helpers/size.js +29 -3
  166. package/dist/esm/helpers/third-party/appConfig.js +61 -1
  167. package/dist/esm/helpers/third-party/appSetting.js +345 -2
  168. package/dist/esm/helpers/third-party/constant.js +12 -2
  169. package/dist/esm/helpers/third-party/getAppBlockConfig.js +17 -1
  170. package/dist/esm/helpers/typography.js +10 -2
  171. package/dist/esm/hooks/animation/useAnimationActions.js +1 -0
  172. package/dist/esm/hooks/animation/useAnimationConfig.js +1 -0
  173. package/dist/esm/hooks/animation/useAnimationPreview.js +1 -0
  174. package/dist/esm/hooks/animation/useAnimationTarget.js +1 -0
  175. package/dist/esm/hooks/animation/useApplyAnimation.js +1 -0
  176. package/dist/esm/hooks/articles/useArticlesQuery.js +1 -0
  177. package/dist/esm/hooks/cart/use-add-to-cart.js +1 -0
  178. package/dist/esm/hooks/cart/use-cart-data.js +1 -0
  179. package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +1 -0
  180. package/dist/esm/hooks/cart/use-cart-note-update.js +1 -0
  181. package/dist/esm/hooks/cart/use-create-cart.js +1 -0
  182. package/dist/esm/hooks/cart/use-remove-cart-item.js +1 -0
  183. package/dist/esm/hooks/cart/use-update-cart-item.js +1 -0
  184. package/dist/esm/hooks/shop/use-collection-query.js +1 -0
  185. package/dist/esm/hooks/shop/use-collections-query.js +1 -0
  186. package/dist/esm/hooks/shop/use-product-query.js +1 -0
  187. package/dist/esm/hooks/shop/use-products-query.js +1 -0
  188. package/dist/esm/hooks/shop/useShopifyLink.js +45 -0
  189. package/dist/esm/hooks/shop.js +10 -1
  190. package/dist/esm/hooks/use-current-device.js +1 -0
  191. package/dist/esm/hooks/use-lazy-video.js +1 -0
  192. package/dist/esm/hooks/useAnimations.js +1 -0
  193. package/dist/esm/hooks/useCartId.js +1 -0
  194. package/dist/esm/hooks/useCartLine.js +1 -0
  195. package/dist/esm/hooks/useCartUI.js +1 -0
  196. package/dist/esm/hooks/useCollection.js +1 -0
  197. package/dist/esm/hooks/useFetchHandle.js +1 -0
  198. package/dist/esm/hooks/useFormatMoney.js +1 -0
  199. package/dist/esm/hooks/useInitialSwatchesOptions.js +1 -0
  200. package/dist/esm/hooks/useInteraction.js +1 -0
  201. package/dist/esm/hooks/useIsomorphicLayoutEffect.js +1 -0
  202. package/dist/esm/hooks/useLoadScript.js +1 -0
  203. package/dist/esm/hooks/useMoney.js +1 -0
  204. package/dist/esm/hooks/usePrevious.js +1 -0
  205. package/dist/esm/hooks/useProduct.js +27 -2
  206. package/dist/esm/hooks/useProductList.js +1 -0
  207. package/dist/esm/hooks/useSuspenseFetch.js +1 -0
  208. package/dist/esm/hooks/useSwatchesOptions.js +1 -0
  209. package/dist/esm/hooks/useToolbarPostPurchase.js +1 -0
  210. package/dist/esm/index.js +14 -11
  211. package/dist/types/index.d.ts +826 -263
  212. package/package.json +4 -4
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import { useState, useEffect } from 'react';
3
4
  import { DropdownIcon, TickIcon } from '../icons/DropdownIcon.js';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
 
3
4
  const AIIcon = ()=>{
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
 
3
4
  const CloseIcon = ()=>{
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
 
3
4
  const DropdownIcon = ()=>{
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
 
3
4
  const SearchIcon = ()=>{
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
 
3
4
  const ShowMoreIcon = ()=>{
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
 
3
4
  const UpgradeIcon = ()=>{
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
 
3
4
  const WarningIcon = ()=>{
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, Fragment } from 'react/jsx-runtime';
2
3
  import Spacing from './Spacing.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
3
  import { useRef, useState, useCallback, useEffect } from 'react';
3
4
  import 'zustand';
@@ -1,10 +1,11 @@
1
+ 'use client';
1
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
3
  import { useRef, useState } from 'react';
3
4
  import { ThemeSectionTooltip } from './ThemeSectionTooltip.js';
4
5
  import 'zustand';
5
6
  import { useShopStore } from '../../contexts/ShopContext.js';
6
- import '@gem-sdk/adapter-shopify';
7
7
  import 'swr';
8
+ import '@gem-sdk/adapter-shopify';
8
9
  import 'swr/mutation';
9
10
  import 'swr/infinite';
10
11
  import 'vanilla-lazyload';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
3
 
3
4
  const getStatusMessage = (status)=>{
@@ -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,6 +1,7 @@
1
+ 'use client';
1
2
  import { jsx, Fragment } from 'react/jsx-runtime';
2
- import { useStore, createStore } from 'zustand';
3
3
  import { useId, useMemo, useContext, createContext } from 'react';
4
+ import { useStore, createStore } from 'zustand';
4
5
  import { flattenConnection } from '../helpers/flatten-connection.js';
5
6
  import { checkInStock } from '../helpers/variant.js';
6
7
 
@@ -23,6 +24,21 @@ const createProductStoreProvider = (data)=>createStore((set, get)=>({
23
24
  };
24
25
  });
25
26
  },
27
+ setUseProductCompareAtPrice: (value)=>{
28
+ set({
29
+ useProductCompareAtPrice: value
30
+ });
31
+ },
32
+ setShouldRequireUploadMessage: (value)=>{
33
+ set({
34
+ shouldRequireUploadMessage: value
35
+ });
36
+ },
37
+ setRequireUpload: (value)=>{
38
+ set({
39
+ requireUpload: value
40
+ });
41
+ },
26
42
  addProperty: (data)=>{
27
43
  const properties = get().properties;
28
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';
@@ -0,0 +1,33 @@
1
+ /* eslint-disable */ const PreviewThemePageSelect = `
2
+ fragment PreviewThemePageSelect on PreviewThemePage {
3
+ id
4
+ name
5
+ handle
6
+ isMobile
7
+ sectionPosition
8
+ pageSections {
9
+ cid
10
+ component
11
+ id
12
+ }
13
+ dataSEO {
14
+ ...DataSEOSelect
15
+ }
16
+ themeStyle {
17
+ id
18
+ data
19
+ name
20
+ }
21
+ analytic {
22
+ ...AnalyticSelect
23
+ }
24
+ customCode {
25
+ ...CustomCodeSelect
26
+ }
27
+ customFonts {
28
+ ...CustomFontSelect
29
+ }
30
+ }
31
+ `;
32
+
33
+ export { PreviewThemePageSelect };
@@ -30,34 +30,11 @@
30
30
  id
31
31
  value
32
32
  }
33
+ metafields {
34
+ key
35
+ value
36
+ }
33
37
  }
34
38
  `;
35
- const PreviewThemePageSelect = `
36
- fragment PreviewThemePageSelect on PublishedThemePage {
37
- id
38
- name
39
- handle
40
- isMobile
41
- sectionPosition
42
- pageSections {
43
- ...PublishedPageSectionSelect
44
- }
45
- themePageCustomSections {
46
- ...PublishedCustomSectionSelect
47
- }
48
- themePageDataSEO {
49
- ...DataSEOSelect
50
- }
51
- pageStyle {
52
- ...PublishedThemeStyleSelect
53
- }
54
- themePageAnalytic {
55
- ...AnalyticSelect
56
- }
57
- themePageCustomCode {
58
- ...CustomCodeSelect
59
- }
60
- }
61
- `;
62
39
 
63
- export { PreviewThemePageSelect, PublishedThemePageSelect };
40
+ export { PublishedThemePageSelect };
@@ -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
@@ -1,23 +1,19 @@
1
- import { PreviewThemePageSelect } from '../fragments/published-theme-page.generated.js';
2
- import { PublishedPageSectionSelect } from '../fragments/published-page-section.generated.js';
3
- import { PublishedCustomSectionSelect } from '../fragments/published-custom-section.generated.js';
1
+ import { PreviewThemePageSelect } from '../fragments/preview-theme-page.generated.js';
4
2
  import { DataSeoSelect } from '../fragments/data-seo.generated.js';
5
- import { PublishedThemeStyleSelect } from '../fragments/published-theme-style.generated.js';
6
3
  import { AnalyticSelect } from '../fragments/analytic.generated.js';
7
4
  import { CustomCodeSelect } from '../fragments/custom-code.generated.js';
5
+ import { CustomFontSelect } from '../fragments/custom-font.generated.js';
8
6
 
9
- const PreviewPageDocument = `
10
- query previewPage($handleURL: String, $pageType: PublishedThemePageType!) {
11
- previewPage(handleURL: $handleURL, pageType: $pageType) {
7
+ const PreviewThemePageDocument = `
8
+ query PreviewThemePage($pageType: PreviewThemePageType!, $handleURL: String) {
9
+ previewThemePage(pageType: $pageType, handleURL: $handleURL) {
12
10
  ...PreviewThemePageSelect
13
11
  }
14
12
  }
15
13
  ${PreviewThemePageSelect}
16
- ${PublishedPageSectionSelect}
17
- ${PublishedCustomSectionSelect}
18
14
  ${DataSeoSelect}
19
- ${PublishedThemeStyleSelect}
20
15
  ${AnalyticSelect}
21
- ${CustomCodeSelect}`;
16
+ ${CustomCodeSelect}
17
+ ${CustomFontSelect}`;
22
18
 
23
- export { PreviewPageDocument };
19
+ export { PreviewThemePageDocument };
@@ -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 };
@@ -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 };
@@ -110,12 +110,66 @@ function composeAdvanceStyle(data, tag, pageType) {
110
110
  Object.assign(styles, composeRadius(value));
111
111
  }
112
112
  if (attr === 'boxShadow') {
113
- const listElementShadowV2 = [
114
- 'Row',
113
+ const baseElements = [
115
114
  'Section',
115
+ 'Row',
116
116
  'Text',
117
117
  'Heading',
118
- 'Image'
118
+ 'Image',
119
+ 'Button',
120
+ '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
+ ];
150
+ const formElements = [
151
+ 'Newsletter',
152
+ 'ContactForm',
153
+ 'TextField',
154
+ 'FormTextarea',
155
+ 'FormEmail',
156
+ 'FormDropdown',
157
+ 'FormCheckbox',
158
+ 'SubmitButton'
159
+ ];
160
+ const collectionElements = [
161
+ 'CollectionTitle',
162
+ 'CollectionDescription',
163
+ 'CollectionBanner',
164
+ 'CollectionToolbar',
165
+ 'CollectionPaginator'
166
+ ];
167
+ const listElementShadowV2 = [
168
+ ...baseElements,
169
+ ...productElements,
170
+ ...boostElements,
171
+ ...formElements,
172
+ ...collectionElements
119
173
  ];
120
174
  let hasBoxShadowV2 = hasBoxShadow;
121
175
  if (listElementShadowV2.includes(tag || '')) {
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { Children } from 'react';
2
3
  import ComponentToolbarPreview from '../components/ComponentToolbarPreview.js';
3
4
 
@@ -1,8 +1,9 @@
1
+ 'use client';
1
2
  import { useRef, useMemo, useCallback } from 'react';
2
3
  import 'react/jsx-runtime';
3
4
  import 'zustand';
4
- import 'swr';
5
5
  import { usePageStore } from '../../contexts/PageContext.js';
6
+ import 'swr';
6
7
  import '@gem-sdk/adapter-shopify';
7
8
  import 'swr/mutation';
8
9
  import 'swr/infinite';
@@ -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 };