@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,25 +1,21 @@
1
1
  'use strict';
2
2
 
3
- var publishedThemePage_generated = require('../fragments/published-theme-page.generated.js');
4
- var publishedPageSection_generated = require('../fragments/published-page-section.generated.js');
5
- var publishedCustomSection_generated = require('../fragments/published-custom-section.generated.js');
3
+ var previewThemePage_generated = require('../fragments/preview-theme-page.generated.js');
6
4
  var dataSeo_generated = require('../fragments/data-seo.generated.js');
7
- var publishedThemeStyle_generated = require('../fragments/published-theme-style.generated.js');
8
5
  var analytic_generated = require('../fragments/analytic.generated.js');
9
6
  var customCode_generated = require('../fragments/custom-code.generated.js');
7
+ var customFont_generated = require('../fragments/custom-font.generated.js');
10
8
 
11
- const PreviewPageDocument = `
12
- query previewPage($handleURL: String, $pageType: PublishedThemePageType!) {
13
- previewPage(handleURL: $handleURL, pageType: $pageType) {
9
+ const PreviewThemePageDocument = `
10
+ query PreviewThemePage($pageType: PreviewThemePageType!, $handleURL: String) {
11
+ previewThemePage(pageType: $pageType, handleURL: $handleURL) {
14
12
  ...PreviewThemePageSelect
15
13
  }
16
14
  }
17
- ${publishedThemePage_generated.PreviewThemePageSelect}
18
- ${publishedPageSection_generated.PublishedPageSectionSelect}
19
- ${publishedCustomSection_generated.PublishedCustomSectionSelect}
15
+ ${previewThemePage_generated.PreviewThemePageSelect}
20
16
  ${dataSeo_generated.DataSeoSelect}
21
- ${publishedThemeStyle_generated.PublishedThemeStyleSelect}
22
17
  ${analytic_generated.AnalyticSelect}
23
- ${customCode_generated.CustomCodeSelect}`;
18
+ ${customCode_generated.CustomCodeSelect}
19
+ ${customFont_generated.CustomFontSelect}`;
24
20
 
25
- exports.PreviewPageDocument = PreviewPageDocument;
21
+ exports.PreviewThemePageDocument = PreviewThemePageDocument;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ const ShopShopifyDocument = `
4
+ query shopShopify {
5
+ shopShopify {
6
+ timezone
7
+ }
8
+ }
9
+ `;
10
+
11
+ exports.ShopShopifyDocument = ShopShopifyDocument;
@@ -15,5 +15,23 @@ const convertTextAlignToJustify = (align)=>{
15
15
  });
16
16
  return result;
17
17
  };
18
+ const getAlignmentClasses = (align)=>{
19
+ const breakpoints = [
20
+ 'desktop',
21
+ 'tablet',
22
+ 'mobile'
23
+ ];
24
+ return breakpoints.reduce((classes, bp)=>{
25
+ const prefix = bp === 'desktop' ? '' : `${bp}:`;
26
+ const alignment = align?.[bp];
27
+ if (alignment) {
28
+ classes[`${prefix}gp-justify-start`] = alignment === 'left';
29
+ classes[`${prefix}gp-justify-center`] = alignment === 'center';
30
+ classes[`${prefix}gp-justify-end`] = alignment === 'right';
31
+ }
32
+ return classes;
33
+ }, {});
34
+ };
18
35
 
19
36
  exports.convertTextAlignToJustify = convertTextAlignToJustify;
37
+ exports.getAlignmentClasses = getAlignmentClasses;
@@ -0,0 +1,184 @@
1
+ 'use strict';
2
+
3
+ var makeStyle = require('./make-style.js');
4
+
5
+ const getStyleBackgroundImageByDevice = (backgroundImage, options)=>{
6
+ if (!backgroundImage) {
7
+ return {};
8
+ }
9
+ return {
10
+ ...!options?.ignoreBackgroundImage ? {
11
+ ...getStyleBgImageSource(backgroundImage, options)
12
+ } : {},
13
+ ...!options?.ignoreBackgroundImageProperties ? {
14
+ ...getStyleBgImagePosition(backgroundImage),
15
+ ...getStyleBgImageSize(backgroundImage),
16
+ ...getStyleBgImageRepeat(backgroundImage)
17
+ } : {},
18
+ ...!options?.ignoreBgAttachment ? getStyleBgImageAttachment(backgroundImage) : {}
19
+ };
20
+ };
21
+ const getStyleBgImageSource = (backgroundImage, options)=>{
22
+ const bgImage = {
23
+ desktop: {
24
+ normal: getBgImageSourceByDevice(backgroundImage, 'desktop', 'normal', options),
25
+ hover: getBgImageSourceByDevice(backgroundImage, 'desktop', 'hover', options)
26
+ },
27
+ tablet: {
28
+ normal: getBgImageSourceByDevice(backgroundImage, 'tablet', 'normal', options),
29
+ hover: getBgImageSourceByDevice(backgroundImage, 'tablet', 'hover', options)
30
+ },
31
+ mobile: {
32
+ normal: getBgImageSourceByDevice(backgroundImage, 'mobile', 'normal', options),
33
+ hover: getBgImageSourceByDevice(backgroundImage, 'mobile', 'hover', options)
34
+ }
35
+ };
36
+ return makeStyle.makeStyleResponsiveState('bgi', bgImage);
37
+ };
38
+ const getBgImageSourceByDevice = (backgroundImage, device, state, options)=>{
39
+ const stateValue = backgroundImage?.[device]?.[state];
40
+ if (!stateValue?.image?.src) return;
41
+ const backupFileKey = stateValue.image.backupFileKey;
42
+ const storage = stateValue.image.storage;
43
+ let imageByDevice = stateValue.image.src;
44
+ let newBackupFilekey = backupFileKey;
45
+ const shopifyHandleName = imageByDevice?.match(// eslint-disable-next-line
46
+ /\/files\/([^\/]+\.(jpg|jpeg|gif|png|webp|svg))/)?.[1];
47
+ if (backupFileKey && shopifyHandleName && shopifyHandleName !== backupFileKey) {
48
+ newBackupFilekey = shopifyHandleName;
49
+ }
50
+ if (storage === 'FILE_CONTENT') {
51
+ if (options?.liquid && newBackupFilekey) {
52
+ imageByDevice = `{{ "${newBackupFilekey.replace('.jpeg', '.jpg')}" | file_url }}`;
53
+ }
54
+ }
55
+ if (storage === 'THEME' || !storage) {
56
+ if (options?.liquid && newBackupFilekey) {
57
+ imageByDevice = `{{ "${newBackupFilekey}" | asset_url }}`;
58
+ }
59
+ }
60
+ return imageByDevice ? `url(${imageByDevice})` : 'none';
61
+ };
62
+ const getStyleBgImagePosition = (backgroundImage)=>{
63
+ const bgPosition = {
64
+ desktop: {
65
+ normal: getBgImagePositionByDevice(backgroundImage, 'desktop', 'normal'),
66
+ hover: getBgImagePositionByDevice(backgroundImage, 'desktop', 'hover')
67
+ },
68
+ tablet: {
69
+ normal: getBgImagePositionByDevice(backgroundImage, 'tablet', 'normal'),
70
+ hover: getBgImagePositionByDevice(backgroundImage, 'tablet', 'hover')
71
+ },
72
+ mobile: {
73
+ normal: getBgImagePositionByDevice(backgroundImage, 'mobile', 'normal'),
74
+ hover: getBgImagePositionByDevice(backgroundImage, 'mobile', 'hover')
75
+ }
76
+ };
77
+ return makeStyle.makeStyleResponsiveState('bgp', bgPosition);
78
+ };
79
+ const getBgImagePositionByDevice = (backgroundImage, device, state)=>{
80
+ const position = backgroundImage?.[device]?.[state]?.position;
81
+ return position && `${position.x}% ${position.y}%`;
82
+ };
83
+ const getStyleBgImageSize = (backgroundImage)=>{
84
+ const bgSize = {
85
+ desktop: {
86
+ normal: getBgImageSizeByDevice(backgroundImage, 'desktop', 'normal'),
87
+ hover: getBgImageSizeByDevice(backgroundImage, 'desktop', 'hover')
88
+ },
89
+ tablet: {
90
+ normal: getBgImageSizeByDevice(backgroundImage, 'tablet', 'normal'),
91
+ hover: getBgImageSizeByDevice(backgroundImage, 'tablet', 'hover')
92
+ },
93
+ mobile: {
94
+ normal: getBgImageSizeByDevice(backgroundImage, 'mobile', 'normal'),
95
+ hover: getBgImageSizeByDevice(backgroundImage, 'mobile', 'hover')
96
+ }
97
+ };
98
+ return makeStyle.makeStyleResponsiveState('bgs', bgSize);
99
+ };
100
+ const getBgImageSizeByDevice = (backgroundImage, device, state)=>{
101
+ return backgroundImage?.[device]?.[state]?.size;
102
+ };
103
+ const getStyleBgImageRepeat = (backgroundImage)=>{
104
+ const bgRepeat = {
105
+ desktop: {
106
+ normal: getBgImageRepeatByDevice(backgroundImage, 'desktop', 'normal'),
107
+ hover: getBgImageRepeatByDevice(backgroundImage, 'desktop', 'hover')
108
+ },
109
+ tablet: {
110
+ normal: getBgImageRepeatByDevice(backgroundImage, 'tablet', 'normal'),
111
+ hover: getBgImageRepeatByDevice(backgroundImage, 'tablet', 'hover')
112
+ },
113
+ mobile: {
114
+ normal: getBgImageRepeatByDevice(backgroundImage, 'mobile', 'normal'),
115
+ hover: getBgImageRepeatByDevice(backgroundImage, 'mobile', 'hover')
116
+ }
117
+ };
118
+ return makeStyle.makeStyleResponsiveState('bgr', bgRepeat);
119
+ };
120
+ const getBgImageRepeatByDevice = (backgroundImage, device, state)=>{
121
+ return backgroundImage?.[device]?.[state]?.repeat;
122
+ };
123
+ const getStyleBgImageAttachment = (backgroundImage)=>{
124
+ const bgAttachment = {
125
+ desktop: {
126
+ normal: getBgImageAttachmentByDevice(backgroundImage, 'desktop', 'normal'),
127
+ hover: getBgImageAttachmentByDevice(backgroundImage, 'desktop', 'hover')
128
+ },
129
+ tablet: {
130
+ normal: getBgImageAttachmentByDevice(backgroundImage, 'tablet', 'normal'),
131
+ hover: getBgImageAttachmentByDevice(backgroundImage, 'tablet', 'hover')
132
+ },
133
+ mobile: {
134
+ normal: getBgImageAttachmentByDevice(backgroundImage, 'mobile', 'normal'),
135
+ hover: getBgImageAttachmentByDevice(backgroundImage, 'mobile', 'hover')
136
+ }
137
+ };
138
+ return makeStyle.makeStyleResponsiveState('bga', bgAttachment);
139
+ };
140
+ const getBgImageAttachmentByDevice = (backgroundImage, device, state)=>{
141
+ return backgroundImage?.[device]?.[state]?.attachment;
142
+ };
143
+ const composeBackgroundImageCss = (config, options = {})=>{
144
+ if (!config) return undefined;
145
+ const { device = 'desktop', state = 'normal', useLiquid = false } = options;
146
+ const styles = [];
147
+ const bgConfig = config?.[device]?.[state];
148
+ if (!bgConfig) return '';
149
+ // Handle background image source
150
+ if (bgConfig.image?.src) {
151
+ let imageUrl = bgConfig.image.src;
152
+ // Handle Shopify liquid transformations if needed
153
+ if (useLiquid && bgConfig.image.backupFileKey) {
154
+ if (bgConfig.image.storage === 'FILE_CONTENT') {
155
+ imageUrl = `{{ "${bgConfig.image.backupFileKey.replace('.jpeg', '.jpg')}" | file_url }}`;
156
+ } else if (bgConfig.image.storage === 'THEME' || !bgConfig.image.storage) {
157
+ imageUrl = `{{ "${bgConfig.image.backupFileKey}" | asset_url }}`;
158
+ }
159
+ }
160
+ styles.push(`background-image: url(${imageUrl});`);
161
+ }
162
+ // Handle position
163
+ if (bgConfig.position) {
164
+ styles.push(`background-position: ${bgConfig.position.x}% ${bgConfig.position.y}%;`);
165
+ }
166
+ // Handle size
167
+ if (bgConfig.size) {
168
+ styles.push(`background-size: ${bgConfig.size};`);
169
+ }
170
+ // Handle repeat
171
+ if (bgConfig.repeat) {
172
+ styles.push(`background-repeat: ${bgConfig.repeat};`);
173
+ }
174
+ // Handle attachment
175
+ if (bgConfig.attachment) {
176
+ styles.push(`background-attachment: ${bgConfig.attachment};`);
177
+ }
178
+ return styles.join('\n ');
179
+ };
180
+
181
+ exports.composeBackgroundImageCss = composeBackgroundImageCss;
182
+ exports.getBgImageSourceByDevice = getBgImageSourceByDevice;
183
+ exports.getStyleBackgroundImageByDevice = getStyleBackgroundImageByDevice;
184
+ exports.getStyleBgImageSource = getStyleBgImageSource;
@@ -112,12 +112,66 @@ function composeAdvanceStyle(data, tag, pageType) {
112
112
  Object.assign(styles, radius.composeRadius(value));
113
113
  }
114
114
  if (attr === 'boxShadow') {
115
- const listElementShadowV2 = [
116
- 'Row',
115
+ const baseElements = [
117
116
  'Section',
117
+ 'Row',
118
118
  'Text',
119
119
  'Heading',
120
- 'Image'
120
+ 'Image',
121
+ 'Button',
122
+ 'HeroBanner',
123
+ 'ImageComparison',
124
+ 'Countdown',
125
+ 'Video'
126
+ ];
127
+ const productElements = [
128
+ 'ProductTitle',
129
+ 'ProductDescription',
130
+ 'ProductPrice',
131
+ 'ProductVendor',
132
+ 'Product',
133
+ 'ProductSku',
134
+ 'StockCounter',
135
+ 'Sticky',
136
+ 'ProductBadge',
137
+ 'ProductViewMore',
138
+ 'ProductButton',
139
+ 'DynamicCheckout'
140
+ ];
141
+ const boostElements = [
142
+ 'Icon',
143
+ 'IconListHoz',
144
+ 'Line',
145
+ 'IconList',
146
+ 'IconListV2',
147
+ 'Tabs',
148
+ 'Accordion',
149
+ 'Marquee',
150
+ 'Breadcrumb'
151
+ ];
152
+ const formElements = [
153
+ 'Newsletter',
154
+ 'ContactForm',
155
+ 'TextField',
156
+ 'FormTextarea',
157
+ 'FormEmail',
158
+ 'FormDropdown',
159
+ 'FormCheckbox',
160
+ 'SubmitButton'
161
+ ];
162
+ const collectionElements = [
163
+ 'CollectionTitle',
164
+ 'CollectionDescription',
165
+ 'CollectionBanner',
166
+ 'CollectionToolbar',
167
+ 'CollectionPaginator'
168
+ ];
169
+ const listElementShadowV2 = [
170
+ ...baseElements,
171
+ ...productElements,
172
+ ...boostElements,
173
+ ...formElements,
174
+ ...collectionElements
121
175
  ];
122
176
  let hasBoxShadowV2 = hasBoxShadow;
123
177
  if (listElementShadowV2.includes(tag || '')) {
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,10 +1,11 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  var react = require('react');
4
5
  require('react/jsx-runtime');
5
6
  require('zustand');
6
- require('swr');
7
7
  var PageContext = require('../../contexts/PageContext.js');
8
+ require('swr');
8
9
  require('@gem-sdk/adapter-shopify');
9
10
  require('swr/mutation');
10
11
  require('swr/infinite');
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -52,8 +52,25 @@ const convertOldLayout = (layout)=>{
52
52
  }
53
53
  };
54
54
  };
55
+ const getLayoutClasses = (layout)=>{
56
+ const breakpoints = [
57
+ 'desktop',
58
+ 'tablet',
59
+ 'mobile'
60
+ ];
61
+ return breakpoints.reduce((classes, bp)=>{
62
+ const prefix = bp === 'desktop' ? '' : `${bp}:`;
63
+ const layoutValue = layout?.[bp];
64
+ if (layoutValue) {
65
+ classes[`${prefix}gp-flex-col`] = layoutValue === 'vertical';
66
+ classes[`${prefix}gp-flex-row`] = layoutValue === 'horizontal';
67
+ }
68
+ return classes;
69
+ }, {});
70
+ };
55
71
 
56
72
  exports.composeGridLayout = composeGridLayout;
57
73
  exports.convertOldLayout = convertOldLayout;
74
+ exports.getLayoutClasses = getLayoutClasses;
58
75
  exports.gridToArrayRegex = gridToArrayRegex;
59
76
  exports.optionLayoutStyle = optionLayoutStyle;
@@ -1,8 +1,10 @@
1
1
  'use strict';
2
2
 
3
+ var useSWR = require('swr');
3
4
  var getCollection = require('./queries/get-collection.js');
4
5
  var getProduct = require('./queries/get-product.js');
5
6
  var getProducts = require('./queries/get-products.js');
7
+ var query = require('./query.js');
6
8
 
7
9
  const prefetchQueries = (input, options)=>{
8
10
  const queries = [];
@@ -19,7 +21,7 @@ const prefetchQueries = (input, options)=>{
19
21
  isStorefront: options?.isStorefront
20
22
  };
21
23
  data = {
22
- key: `query/product/${variables.id}`,
24
+ key: useSWR.unstable_serialize(query.generateProductQueryKey(variables)),
23
25
  func: getProduct.getProduct,
24
26
  variables
25
27
  };
@@ -37,7 +39,7 @@ const prefetchQueries = (input, options)=>{
37
39
  isStorefront: options?.isStorefront
38
40
  };
39
41
  data = {
40
- key: `query/collection/${variables.id}`,
42
+ key: useSWR.unstable_serialize(query.generateCollectionQueryKey(variables)),
41
43
  func: getCollection.getCollection,
42
44
  variables
43
45
  };
@@ -50,7 +52,7 @@ const prefetchQueries = (input, options)=>{
50
52
  isStorefront: options?.isStorefront
51
53
  };
52
54
  data = {
53
- key: `query/products/${variables.ids.join(',')}`,
55
+ key: useSWR.unstable_serialize(query.generateProductsQueryKey(variables)),
54
56
  func: getProducts.getProducts,
55
57
  variables
56
58
  };
@@ -32,7 +32,8 @@ const getCustomRadius = (state, radius, device)=>{
32
32
  'pill',
33
33
  'rounded',
34
34
  'single',
35
- 'none'
35
+ 'none',
36
+ 'circle'
36
37
  ];
37
38
  if (!radius || !state || !list.includes(radius?.radiusType ?? '')) return {};
38
39
  const suffix = device && device !== 'desktop' ? constant.devicesMapping?.[device] : '';
@@ -129,6 +130,7 @@ const composeCornerCss = (value, important = false)=>{
129
130
  break;
130
131
  case 'circle':
131
132
  case 'none':
133
+ case 'rounded':
132
134
  case 'custom':
133
135
  radiusValue = `
134
136
  ${bblr ? `border-bottom-left-radius: ${bblr}${sub};` : ''}
@@ -55,6 +55,30 @@ const getResponsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
55
55
  };
56
56
  }
57
57
  };
58
+ const getResponsiveStyleShadowWithoutState = (value, styleAppliedFor, isEnableShadow)=>{
59
+ if (!value) return undefined;
60
+ if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
61
+ return {
62
+ ...getStyleShadow({
63
+ value: value.desktop,
64
+ styleAppliedFor,
65
+ isEnableShadow: isEnableShadow.desktop
66
+ }),
67
+ ...value.tablet && (isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadow({
68
+ value: value.tablet,
69
+ styleAppliedFor,
70
+ isEnableShadow: isEnableShadow.tablet ?? isEnableShadow.desktop,
71
+ screen: 'tablet'
72
+ }) : undefined,
73
+ ...value.mobile && (isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadow({
74
+ value: value.mobile,
75
+ styleAppliedFor,
76
+ isEnableShadow: isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop,
77
+ screen: 'mobile'
78
+ }) : undefined
79
+ };
80
+ }
81
+ };
58
82
  const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
59
83
  if (!hasBoxShadow) return undefined;
60
84
  if (!boxShadowValue) return undefined;
@@ -65,6 +89,7 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
65
89
 
66
90
  exports.composeShadowCss = composeShadowCss;
67
91
  exports.getResponsiveStyleShadow = getResponsiveStyleShadow;
92
+ exports.getResponsiveStyleShadowWithoutState = getResponsiveStyleShadowWithoutState;
68
93
  exports.getStyleShadow = getStyleShadow;
69
94
  exports.getStyleShadowState = getStyleShadowState;
70
95
  exports.parseValueWithUnit = parseValueWithUnit;
@@ -103,7 +103,7 @@ const getHeightByShapeGlobalSize = (shapeByLayout)=>{
103
103
  });
104
104
  return result;
105
105
  };
106
- const getWidthByShapeGlobalSize = (shapeByLayout, defaultAuto)=>{
106
+ const getWidthByShapeGlobalSize = (shapeByLayout, defaultAuto, defaultFull)=>{
107
107
  let result = {};
108
108
  const DEVICES = [
109
109
  'desktop',
@@ -112,7 +112,13 @@ const getWidthByShapeGlobalSize = (shapeByLayout, defaultAuto)=>{
112
112
  ];
113
113
  DEVICES.forEach((device)=>{
114
114
  const shapeByDevice = getResonsiveValue.getResponsiveValueByScreen(shapeByLayout, device);
115
- const width = defaultAuto ? shapeByDevice?.width || 'auto' : shapeByDevice?.width;
115
+ let width = shapeByDevice?.width;
116
+ if (defaultAuto) {
117
+ width = shapeByDevice?.width || 'auto';
118
+ }
119
+ if (defaultFull) {
120
+ width = shapeByDevice?.width || '100%';
121
+ }
116
122
  if (width) {
117
123
  result = {
118
124
  ...result,
@@ -184,6 +190,26 @@ const getPaddingGlobalSize = (globalSize)=>{
184
190
  const getValueByDevice = (value, device)=>{
185
191
  return value?.[device] === undefined ? value?.desktop === undefined ? value?.tablet : value?.desktop : value?.[device];
186
192
  };
193
+ const getPaddingStyleByDevice = (value, device)=>{
194
+ if (!value) return {};
195
+ const suffix = constant.devicesMapping[device || ''] ?? '';
196
+ return {
197
+ [`--pl${suffix}`]: value?.left,
198
+ [`--pr${suffix}`]: value?.right,
199
+ [`--pt${suffix}`]: value?.top,
200
+ [`--pb${suffix}`]: value?.bottom
201
+ };
202
+ };
203
+ const getResponsiveStylePadding = (value)=>{
204
+ if (!value) return undefined;
205
+ if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
206
+ return {
207
+ ...getPaddingStyleByDevice(value?.desktop),
208
+ ...getPaddingStyleByDevice(value?.tablet, 'tablet'),
209
+ ...getPaddingStyleByDevice(value?.mobile, 'mobile')
210
+ };
211
+ }
212
+ };
187
213
 
188
214
  exports.composeSize = composeSize;
189
215
  exports.composeSizeCss = composeSizeCss;
@@ -192,6 +218,8 @@ exports.getAspectRatioGlobalSize = getAspectRatioGlobalSize;
192
218
  exports.getGlobalSizeGap = getGlobalSizeGap;
193
219
  exports.getHeightByShapeGlobalSize = getHeightByShapeGlobalSize;
194
220
  exports.getPaddingGlobalSize = getPaddingGlobalSize;
221
+ exports.getPaddingStyleByDevice = getPaddingStyleByDevice;
222
+ exports.getResponsiveStylePadding = getResponsiveStylePadding;
195
223
  exports.getValueByDevice = getValueByDevice;
196
224
  exports.getWidthByShapeGlobalSize = getWidthByShapeGlobalSize;
197
225
  exports.getWidthHeightGlobalSize = getWidthHeightGlobalSize;
@@ -186,8 +186,70 @@ const KachingBundlesConfig = {
186
186
  appId: '6c637362-a106-4a32-94ac-94dcfd68cdb8'
187
187
  }
188
188
  };
189
+ const BestBuyFulfillmentConfig = {
190
+ BestBuyFulfillment: {
191
+ appName: 'best-buy-fulfillment',
192
+ appId: 'd9839db8-b94c-4590-ac73-3469abe7ed9b'
193
+ }
194
+ };
195
+ const AftershipEmailMarketingsmsConfig = {
196
+ AftershipEmailMarketingsms: {
197
+ appName: 'aftership-email-marketing-sms',
198
+ appId: '2db13273-f8db-4274-be89-c86a3352fb70'
199
+ }
200
+ };
201
+ const SegunoEmailMarketingConfig = {
202
+ SegunoEmailMarketing: {
203
+ appName: 'seguno-email',
204
+ appId: 'db65571f-fa4d-473d-baa2-283a96dc76bc'
205
+ }
206
+ };
207
+ const TrustooConfig = {
208
+ Trustoo: {
209
+ appName: 'trustoo-io-reviews',
210
+ appId: 'c8f15077-6475-4e86-ad06-b66038d5ba2c'
211
+ }
212
+ };
213
+ const LooxReviewsConfig = {
214
+ LooxReviews: {
215
+ appName: 'loox-reviews',
216
+ appId: '5c3b337f-fd14-4df5-b1d6-80ec13e6e28e'
217
+ }
218
+ };
219
+ const SeoantTrustBadgesIconConfig = {
220
+ SeoantTrustBadgesIcon: {
221
+ appName: 'seoant-trust-badges',
222
+ appId: 'f42f2346-5d14-4b41-a8b9-4b6ee352262e'
223
+ }
224
+ };
225
+ const PowrContactFormBuilderConfig = {
226
+ PowrContactFormBuilder: {
227
+ appName: 'powr-form-builder',
228
+ appId: '1412fe37-d89c-4706-a797-6e2b53cb4a69'
229
+ }
230
+ };
231
+ const MyappgurusProductReviewsConfig = {
232
+ MyappgurusProductReviews: {
233
+ appName: 'mag-product-reviews',
234
+ appId: '0cf5caa0-e138-46b8-999b-520d16633e4c'
235
+ }
236
+ };
237
+ const TrustreviewsProductReviewsConfig = {
238
+ TrustreviewsProductReviews: {
239
+ appName: 'trustreviews',
240
+ appId: '56d0fe1b-e701-4cff-8f84-466a26e09adb'
241
+ }
242
+ };
243
+ const HulkProductOptionsConfig = {
244
+ HulkProductOptions: {
245
+ appName: 'hulk-product-options',
246
+ appId: '380168ef-9475-4244-a291-f66b189208b5'
247
+ }
248
+ };
189
249
 
250
+ exports.AftershipEmailMarketingsmsConfig = AftershipEmailMarketingsmsConfig;
190
251
  exports.AppointmentBookingCowlendarConfig = AppointmentBookingCowlendarConfig;
252
+ exports.BestBuyFulfillmentConfig = BestBuyFulfillmentConfig;
191
253
  exports.BoldSubscriptionsConfig = BoldSubscriptionsConfig;
192
254
  exports.BonLoyaltyRewardsReferralsConfig = BonLoyaltyRewardsReferralsConfig;
193
255
  exports.EasyBundleBuilderSkailamaConfig = EasyBundleBuilderSkailamaConfig;
@@ -195,25 +257,33 @@ exports.FastBundleBundlesDiscountsConfig = FastBundleBundlesDiscountsConfig;
195
257
  exports.FlyBundlesUpsellsFbtConfig = FlyBundlesUpsellsFbtConfig;
196
258
  exports.GloboProductOptionsVariantConfig = GloboProductOptionsVariantConfig;
197
259
  exports.GrowaveConfig = GrowaveConfig;
260
+ exports.HulkProductOptionsConfig = HulkProductOptionsConfig;
198
261
  exports.InstasellShoppableInstagramConfig = InstasellShoppableInstagramConfig;
199
262
  exports.JunipProductReviewsUgcConfig = JunipProductReviewsUgcConfig;
200
263
  exports.KachingBundlesConfig = KachingBundlesConfig;
201
264
  exports.KiteFreeGiftDiscountConfig = KiteFreeGiftDiscountConfig;
202
265
  exports.LoloyalLoyaltyReferralsConfig = LoloyalLoyaltyReferralsConfig;
203
266
  exports.LoopSubscriptionsConfig = LoopSubscriptionsConfig;
267
+ exports.LooxReviewsConfig = LooxReviewsConfig;
268
+ exports.MyappgurusProductReviewsConfig = MyappgurusProductReviewsConfig;
204
269
  exports.PowerfulContactFormBuilderConfig = PowerfulContactFormBuilderConfig;
270
+ exports.PowrContactFormBuilderConfig = PowrContactFormBuilderConfig;
205
271
  exports.PreorderNowPreOrderPqConfig = PreorderNowPreOrderPqConfig;
206
272
  exports.PreorderNowWodPresaleConfig = PreorderNowWodPresaleConfig;
207
273
  exports.ProductOptionsCustomizerConfig = ProductOptionsCustomizerConfig;
208
274
  exports.PumperBundlesVolumeDiscountConfig = PumperBundlesVolumeDiscountConfig;
209
275
  exports.RechargeSubscriptionsConfig = RechargeSubscriptionsConfig;
210
276
  exports.ReviewxpoProductReviewsAppConfig = ReviewxpoProductReviewsAppConfig;
277
+ exports.SegunoEmailMarketingConfig = SegunoEmailMarketingConfig;
211
278
  exports.SelleasyConfig = SelleasyConfig;
279
+ exports.SeoantTrustBadgesIconConfig = SeoantTrustBadgesIconConfig;
212
280
  exports.ShopifyFormsConfig = ShopifyFormsConfig;
213
281
  exports.SimpleBundlesKitsConfig = SimpleBundlesKitsConfig;
214
282
  exports.SkioSubscriptionsYcS20Config = SkioSubscriptionsYcS20Config;
215
283
  exports.SproutPlantTreesGrowSalesConfig = SproutPlantTreesGrowSalesConfig;
216
284
  exports.SubifySubscriptionsConfig = SubifySubscriptionsConfig;
285
+ exports.TrustooConfig = TrustooConfig;
286
+ exports.TrustreviewsProductReviewsConfig = TrustreviewsProductReviewsConfig;
217
287
  exports.UnlimitedBundlesDiscountsConfig = UnlimitedBundlesDiscountsConfig;
218
288
  exports.WhatmoreShoppableVideosreelConfig = WhatmoreShoppableVideosreelConfig;
219
289
  exports.WishlistKingConfig = WishlistKingConfig;