@gem-sdk/core 2.0.0-dev.896 → 2.0.0

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 (396) hide show
  1. package/dist/cjs/components/AddOn.js +18 -1
  2. package/dist/cjs/components/ComponentAnimation.js +17 -0
  3. package/dist/cjs/components/ComponentToolbarPreview.js +752 -1
  4. package/dist/cjs/components/ComponentWrapper.js +61 -1
  5. package/dist/cjs/components/ComponentWrapperPreview.js +213 -1
  6. package/dist/cjs/components/Empty.js +7 -1
  7. package/dist/cjs/components/InteractionSuffix.js +42 -0
  8. package/dist/cjs/components/Render.js +75 -1
  9. package/dist/cjs/components/Render.liquid.js +313 -17
  10. package/dist/cjs/components/RenderBlock.js +54 -1
  11. package/dist/cjs/components/RenderCustomCode.js +59 -3
  12. package/dist/cjs/components/RenderPreview.js +67 -1
  13. package/dist/cjs/components/RenderSection.js +23 -1
  14. package/dist/cjs/components/ai-generator/AIContentGenerator.js +252 -1
  15. package/dist/cjs/components/ai-generator/AIGenContentLoading.js +85 -1
  16. package/dist/cjs/components/ai-generator/components/PickProduct.js +220 -1
  17. package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +77 -1
  18. package/dist/cjs/components/ai-generator/hooks/useCheckingProductInside.js +47 -0
  19. package/dist/cjs/components/ai-generator/hooks/useFlipPopup.js +110 -0
  20. package/dist/cjs/components/ai-generator/hooks/useGettingGenerateRequest.js +37 -1
  21. package/dist/cjs/components/ai-generator/hooks/useListenEventGenerate.js +70 -1
  22. package/dist/cjs/components/ai-generator/icons/AIIcon.js +67 -1
  23. package/dist/cjs/components/ai-generator/icons/CloseIcon.js +19 -1
  24. package/dist/cjs/components/ai-generator/icons/DropdownIcon.js +37 -1
  25. package/dist/cjs/components/ai-generator/icons/SearchIcon.js +21 -1
  26. package/dist/cjs/components/ai-generator/icons/ShowMoreIcon.js +21 -1
  27. package/dist/cjs/components/ai-generator/icons/UpgradeIcon.js +27 -0
  28. package/dist/cjs/components/ai-generator/icons/WarningIcon.js +31 -0
  29. package/dist/cjs/components/constant.js +83 -1
  30. package/dist/cjs/components/resize/Resize.js +16 -1
  31. package/dist/cjs/components/resize/Spacing.js +260 -1
  32. package/dist/cjs/components/src/product/helpers/variant-presets.js +56 -1
  33. package/dist/cjs/components/theme-section/CreateThemeSection.js +123 -1
  34. package/dist/cjs/components/theme-section/ThemeSectionStatus.js +45 -1
  35. package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +126 -1
  36. package/dist/cjs/components/toolbar/Tooltip.js +28 -1
  37. package/dist/cjs/contexts/AddonContext.js +36 -1
  38. package/dist/cjs/contexts/ArticleContext.js +39 -1
  39. package/dist/cjs/contexts/ArticleListContext.js +31 -1
  40. package/dist/cjs/contexts/BuilderComponent.js +34 -1
  41. package/dist/cjs/contexts/BuilderContext.js +39 -1
  42. package/dist/cjs/contexts/BuilderPreviewContext.js +486 -1
  43. package/dist/cjs/contexts/CartLineContext.js +29 -1
  44. package/dist/cjs/contexts/CollectionContext.js +38 -1
  45. package/dist/cjs/contexts/ModalContext.js +47 -1
  46. package/dist/cjs/contexts/PageContext.js +104 -1
  47. package/dist/cjs/contexts/ProductContext.js +177 -1
  48. package/dist/cjs/contexts/ProductListContext.js +32 -1
  49. package/dist/cjs/contexts/SectionContext.js +53 -1
  50. package/dist/cjs/contexts/ShopContext.js +107 -1
  51. package/dist/cjs/graphql/fragments/analytic.generated.js +6 -2
  52. package/dist/cjs/graphql/fragments/collection-detail.generated.js +6 -2
  53. package/dist/cjs/graphql/fragments/collection-product.generated.js +6 -2
  54. package/dist/cjs/graphql/fragments/collection.generated.js +6 -2
  55. package/dist/cjs/graphql/fragments/custom-code.generated.js +6 -2
  56. package/dist/cjs/graphql/fragments/custom-font.generated.js +6 -2
  57. package/dist/cjs/graphql/fragments/data-seo.generated.js +6 -2
  58. package/dist/cjs/graphql/fragments/media.generated.js +6 -2
  59. package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +39 -0
  60. package/dist/cjs/graphql/fragments/product-little.generated.js +7 -2
  61. package/dist/cjs/graphql/fragments/product-option-value.generated.js +6 -2
  62. package/dist/cjs/graphql/fragments/product-option.generated.js +6 -2
  63. package/dist/cjs/graphql/fragments/product.generated.js +6 -2
  64. package/dist/cjs/graphql/fragments/published-custom-section.generated.js +6 -2
  65. package/dist/cjs/graphql/fragments/published-page-section.generated.js +6 -2
  66. package/dist/cjs/graphql/fragments/published-theme-page.generated.js +10 -28
  67. package/dist/cjs/graphql/fragments/published-theme-style.generated.js +6 -2
  68. package/dist/cjs/graphql/fragments/selected-option.generated.js +6 -2
  69. package/dist/cjs/graphql/fragments/variant.generated.js +6 -2
  70. package/dist/cjs/graphql/mutations/page-view-up.generated.js +8 -4
  71. package/dist/cjs/graphql/queries/articles.generated.js +61 -0
  72. package/dist/cjs/graphql/queries/blogs.generated.js +69 -0
  73. package/dist/cjs/graphql/queries/collection-detail-filter.generated.js +16 -2
  74. package/dist/cjs/graphql/queries/collection.generated.js +14 -2
  75. package/dist/cjs/graphql/queries/collections.generated.js +9 -2
  76. package/dist/cjs/graphql/queries/preview-page.generated.js +16 -8
  77. package/dist/cjs/graphql/queries/product-little-detail.generated.js +11 -2
  78. package/dist/cjs/graphql/queries/product-medias.generated.js +8 -2
  79. package/dist/cjs/graphql/queries/product-value-label.generated.js +6 -2
  80. package/dist/cjs/graphql/queries/product-variants.generated.js +10 -2
  81. package/dist/cjs/graphql/queries/products.generated.js +17 -3
  82. package/dist/cjs/graphql/queries/published-shop-metas.js +15 -0
  83. package/dist/cjs/graphql/queries/published-theme-pages.generated.js +15 -2
  84. package/dist/cjs/graphql/queries/store-property.generated.js +6 -2
  85. package/dist/cjs/graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js +6 -2
  86. package/dist/cjs/graphql-app-api/queries/LibraryTemplate.generated.js +6 -2
  87. package/dist/cjs/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +6 -2
  88. package/dist/cjs/graphql-app-api/queries/ShopLibraryPage.generated.js +17 -0
  89. package/dist/cjs/graphql-app-api/queries/ThemePage.generated.js +6 -2
  90. package/dist/cjs/helpers/GlobalEvent.js +19 -1
  91. package/dist/cjs/helpers/align.js +19 -0
  92. package/dist/cjs/helpers/animations.js +222 -1
  93. package/dist/cjs/helpers/background.js +235 -1
  94. package/dist/cjs/helpers/borders.js +198 -4
  95. package/dist/cjs/helpers/carousel.js +55 -1
  96. package/dist/cjs/helpers/clone-deep.js +5 -1
  97. package/dist/cjs/helpers/cls.js +16 -1
  98. package/dist/cjs/helpers/colors.js +184 -1
  99. package/dist/cjs/helpers/compose-advance-style.js +327 -1
  100. package/dist/cjs/helpers/constant.js +23 -1
  101. package/dist/cjs/helpers/convert.js +7 -1
  102. package/dist/cjs/helpers/covert-entities-html.js +19 -1
  103. package/dist/cjs/helpers/css-variable.js +7 -1
  104. package/dist/cjs/helpers/email.js +11 -1
  105. package/dist/cjs/helpers/filter-toolbar-preview.js +14 -1
  106. package/dist/cjs/helpers/flatten-connection.js +9 -1
  107. package/dist/cjs/helpers/get-resonsive-value.js +36 -1
  108. package/dist/cjs/helpers/get-shortname.js +92 -1
  109. package/dist/cjs/helpers/icon-list.js +61 -1
  110. package/dist/cjs/helpers/interaction/index.js +134 -0
  111. package/dist/cjs/helpers/is-browser.js +9 -1
  112. package/dist/cjs/helpers/is-defined.js +7 -1
  113. package/dist/cjs/helpers/is-empty-children.js +15 -1
  114. package/dist/cjs/helpers/is-safari.js +9 -1
  115. package/dist/cjs/helpers/layout.js +59 -1
  116. package/dist/cjs/helpers/load-script.js +31 -1
  117. package/dist/cjs/helpers/loop-component.js +16 -0
  118. package/dist/cjs/helpers/make-style.js +163 -1
  119. package/dist/cjs/helpers/normalize-builder-data.js +23 -1
  120. package/dist/cjs/helpers/pascal-to-kebab-case.js +7 -0
  121. package/dist/cjs/helpers/prefetch-queries.js +78 -1
  122. package/dist/cjs/helpers/product.js +48 -1
  123. package/dist/cjs/helpers/queries/get-collection.js +226 -1
  124. package/dist/cjs/helpers/queries/get-collections.js +21 -1
  125. package/dist/cjs/helpers/queries/get-product-by-slug.js +125 -1
  126. package/dist/cjs/helpers/queries/get-product.js +154 -1
  127. package/dist/cjs/helpers/queries/get-products.js +214 -1
  128. package/dist/cjs/helpers/query.js +29 -1
  129. package/dist/cjs/helpers/radius.js +140 -6
  130. package/dist/cjs/helpers/render.js +78 -1
  131. package/dist/cjs/helpers/shadow.js +69 -1
  132. package/dist/cjs/helpers/size.js +206 -4
  133. package/dist/cjs/helpers/spacing.js +43 -1
  134. package/dist/cjs/helpers/third-party/addAppBlockId.js +20 -0
  135. package/dist/cjs/helpers/third-party/appConfig.js +234 -0
  136. package/dist/cjs/helpers/third-party/appSetting.js +661 -0
  137. package/dist/cjs/helpers/third-party/composeAppBlockId.js +11 -0
  138. package/dist/cjs/helpers/third-party/constant.js +43 -0
  139. package/dist/cjs/helpers/third-party/generateAppBlockConfigs.js +34 -0
  140. package/dist/cjs/helpers/third-party/getAppBlockConfig.js +47 -0
  141. package/dist/cjs/helpers/third-party/getAppBlockType.js +12 -0
  142. package/dist/cjs/helpers/third-party/getAppBlocks.js +30 -0
  143. package/dist/cjs/helpers/third-party/mergeBlock.js +19 -0
  144. package/dist/cjs/helpers/third-party/mergeBlockOrder.js +47 -0
  145. package/dist/cjs/helpers/third-party/removeGPAppItems.js +18 -0
  146. package/dist/cjs/helpers/tracking/fpixel.js +28 -1
  147. package/dist/cjs/helpers/tracking/gtag.js +93 -1
  148. package/dist/cjs/helpers/tracking/tiktokpixel.js +17 -1
  149. package/dist/cjs/helpers/typography.js +160 -17
  150. package/dist/cjs/helpers/variant.js +11 -1
  151. package/dist/cjs/hooks/animation/useAnimationActions.js +39 -1
  152. package/dist/cjs/hooks/animation/useAnimationConfig.js +30 -1
  153. package/dist/cjs/hooks/animation/useAnimationPreview.js +31 -1
  154. package/dist/cjs/hooks/animation/useAnimationTarget.js +122 -1
  155. package/dist/cjs/hooks/animation/useApplyAnimation.js +89 -1
  156. package/dist/cjs/hooks/articles/useArticlesQuery.js +33 -1
  157. package/dist/cjs/hooks/cart/use-add-to-cart.js +20 -1
  158. package/dist/cjs/hooks/cart/use-cart-data.js +28 -1
  159. package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +20 -1
  160. package/dist/cjs/hooks/cart/use-cart-note-update.js +20 -1
  161. package/dist/cjs/hooks/cart/use-create-cart.js +22 -1
  162. package/dist/cjs/hooks/cart/use-remove-cart-item.js +20 -1
  163. package/dist/cjs/hooks/cart/use-update-cart-item.js +20 -1
  164. package/dist/cjs/hooks/shop/use-collection-query.js +22 -1
  165. package/dist/cjs/hooks/shop/use-collections-query.js +17 -1
  166. package/dist/cjs/hooks/shop/use-product-query.js +22 -1
  167. package/dist/cjs/hooks/shop/use-products-query.js +63 -1
  168. package/dist/cjs/hooks/shop.js +126 -1
  169. package/dist/cjs/hooks/use-current-device.js +30 -1
  170. package/dist/cjs/hooks/use-lazy-video.js +15 -1
  171. package/dist/cjs/hooks/useAnimations.js +29 -1
  172. package/dist/cjs/hooks/useCartId.js +44 -1
  173. package/dist/cjs/hooks/useCartLine.js +11 -1
  174. package/dist/cjs/hooks/useCartUI.js +48 -1
  175. package/dist/cjs/hooks/useCollection.js +9 -1
  176. package/dist/cjs/hooks/useFetchHandle.js +13 -1
  177. package/dist/cjs/hooks/useFormatMoney.js +75 -1
  178. package/dist/cjs/hooks/useInitialSwatchesOptions.js +128 -1
  179. package/dist/cjs/hooks/useInteraction.js +19 -0
  180. package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +10 -1
  181. package/dist/cjs/hooks/useLoadScript.js +32 -1
  182. package/dist/cjs/hooks/useMoney.js +84 -1
  183. package/dist/cjs/hooks/usePrevious.js +19 -1
  184. package/dist/cjs/hooks/useProduct.js +245 -1
  185. package/dist/cjs/hooks/useProductList.js +21 -1
  186. package/dist/cjs/hooks/useSuspenseFetch.js +27 -1
  187. package/dist/cjs/hooks/useSwatchesOptions.js +41 -1
  188. package/dist/cjs/hooks/useToolbarPostPurchase.js +89 -1
  189. package/dist/cjs/index.js +416 -1
  190. package/dist/cjs/types/animations.js +49 -1
  191. package/dist/cjs/types/appAPI.js +2 -1
  192. package/dist/cjs/types/custom.js +52 -0
  193. package/dist/cjs/types/global-style.js +15 -1
  194. package/dist/cjs/types/shop.js +2 -1
  195. package/dist/cjs/web-components/src/helpers/styles/constant.js +9 -1
  196. package/dist/esm/components/AddOn.js +14 -1
  197. package/dist/esm/components/ComponentAnimation.js +13 -0
  198. package/dist/esm/components/ComponentToolbarPreview.js +748 -1
  199. package/dist/esm/components/ComponentWrapper.js +57 -1
  200. package/dist/esm/components/ComponentWrapperPreview.js +209 -1
  201. package/dist/esm/components/Empty.js +3 -1
  202. package/dist/esm/components/InteractionSuffix.js +40 -0
  203. package/dist/esm/components/Render.js +71 -1
  204. package/dist/esm/components/Render.liquid.js +307 -17
  205. package/dist/esm/components/RenderBlock.js +50 -1
  206. package/dist/esm/components/RenderCustomCode.js +55 -3
  207. package/dist/esm/components/RenderPreview.js +63 -1
  208. package/dist/esm/components/RenderSection.js +19 -1
  209. package/dist/esm/components/ai-generator/AIContentGenerator.js +250 -1
  210. package/dist/esm/components/ai-generator/AIGenContentLoading.js +83 -1
  211. package/dist/esm/components/ai-generator/components/PickProduct.js +218 -1
  212. package/dist/esm/components/ai-generator/components/ToneAndVoice.js +75 -1
  213. package/dist/esm/components/ai-generator/hooks/useCheckingProductInside.js +45 -0
  214. package/dist/esm/components/ai-generator/hooks/useFlipPopup.js +108 -0
  215. package/dist/esm/components/ai-generator/hooks/useGettingGenerateRequest.js +35 -1
  216. package/dist/esm/components/ai-generator/hooks/useListenEventGenerate.js +68 -1
  217. package/dist/esm/components/ai-generator/icons/AIIcon.js +65 -1
  218. package/dist/esm/components/ai-generator/icons/CloseIcon.js +17 -1
  219. package/dist/esm/components/ai-generator/icons/DropdownIcon.js +34 -1
  220. package/dist/esm/components/ai-generator/icons/SearchIcon.js +19 -1
  221. package/dist/esm/components/ai-generator/icons/ShowMoreIcon.js +19 -1
  222. package/dist/esm/components/ai-generator/icons/UpgradeIcon.js +25 -0
  223. package/dist/esm/components/ai-generator/icons/WarningIcon.js +29 -0
  224. package/dist/esm/components/constant.js +76 -1
  225. package/dist/esm/components/resize/Resize.js +12 -1
  226. package/dist/esm/components/resize/Spacing.js +256 -1
  227. package/dist/esm/components/src/product/helpers/variant-presets.js +54 -1
  228. package/dist/esm/components/theme-section/CreateThemeSection.js +121 -1
  229. package/dist/esm/components/theme-section/ThemeSectionStatus.js +43 -1
  230. package/dist/esm/components/theme-section/ThemeSectionTooltip.js +124 -1
  231. package/dist/esm/components/toolbar/Tooltip.js +24 -1
  232. package/dist/esm/contexts/AddonContext.js +32 -1
  233. package/dist/esm/contexts/ArticleContext.js +36 -1
  234. package/dist/esm/contexts/ArticleListContext.js +27 -1
  235. package/dist/esm/contexts/BuilderComponent.js +31 -1
  236. package/dist/esm/contexts/BuilderContext.js +36 -1
  237. package/dist/esm/contexts/BuilderPreviewContext.js +483 -1
  238. package/dist/esm/contexts/CartLineContext.js +26 -1
  239. package/dist/esm/contexts/CollectionContext.js +35 -1
  240. package/dist/esm/contexts/ModalContext.js +44 -1
  241. package/dist/esm/contexts/PageContext.js +101 -1
  242. package/dist/esm/contexts/ProductContext.js +174 -1
  243. package/dist/esm/contexts/ProductListContext.js +28 -1
  244. package/dist/esm/contexts/SectionContext.js +49 -1
  245. package/dist/esm/contexts/ShopContext.js +104 -1
  246. package/dist/esm/graphql/fragments/analytic.generated.js +4 -2
  247. package/dist/esm/graphql/fragments/collection-detail.generated.js +4 -2
  248. package/dist/esm/graphql/fragments/collection-product.generated.js +4 -2
  249. package/dist/esm/graphql/fragments/collection.generated.js +4 -2
  250. package/dist/esm/graphql/fragments/custom-code.generated.js +4 -2
  251. package/dist/esm/graphql/fragments/custom-font.generated.js +4 -2
  252. package/dist/esm/graphql/fragments/data-seo.generated.js +4 -2
  253. package/dist/esm/graphql/fragments/media.generated.js +4 -2
  254. package/dist/esm/graphql/fragments/preview-theme-page.generated.js +37 -0
  255. package/dist/esm/graphql/fragments/product-little.generated.js +5 -2
  256. package/dist/esm/graphql/fragments/product-option-value.generated.js +4 -2
  257. package/dist/esm/graphql/fragments/product-option.generated.js +4 -2
  258. package/dist/esm/graphql/fragments/product.generated.js +4 -2
  259. package/dist/esm/graphql/fragments/published-custom-section.generated.js +4 -2
  260. package/dist/esm/graphql/fragments/published-page-section.generated.js +4 -2
  261. package/dist/esm/graphql/fragments/published-theme-page.generated.js +8 -28
  262. package/dist/esm/graphql/fragments/published-theme-style.generated.js +4 -2
  263. package/dist/esm/graphql/fragments/selected-option.generated.js +4 -2
  264. package/dist/esm/graphql/fragments/variant.generated.js +4 -2
  265. package/dist/esm/graphql/mutations/page-view-up.generated.js +6 -4
  266. package/dist/esm/graphql/queries/articles.generated.js +59 -0
  267. package/dist/esm/graphql/queries/blogs.generated.js +67 -0
  268. package/dist/esm/graphql/queries/collection-detail-filter.generated.js +22 -10
  269. package/dist/esm/graphql/queries/collection.generated.js +18 -8
  270. package/dist/esm/graphql/queries/collections.generated.js +8 -3
  271. package/dist/esm/graphql/queries/preview-page.generated.js +16 -10
  272. package/dist/esm/graphql/queries/product-little-detail.generated.js +12 -5
  273. package/dist/esm/graphql/queries/product-medias.generated.js +6 -2
  274. package/dist/esm/graphql/queries/product-value-label.generated.js +4 -2
  275. package/dist/esm/graphql/queries/product-variants.generated.js +10 -4
  276. package/dist/esm/graphql/queries/products.generated.js +20 -9
  277. package/dist/esm/graphql/queries/published-shop-metas.js +13 -0
  278. package/dist/esm/graphql/queries/published-theme-pages.generated.js +20 -9
  279. package/dist/esm/graphql/queries/store-property.generated.js +4 -2
  280. package/dist/esm/graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js +4 -2
  281. package/dist/esm/graphql-app-api/queries/LibraryTemplate.generated.js +4 -2
  282. package/dist/esm/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +4 -2
  283. package/dist/esm/graphql-app-api/queries/ShopLibraryPage.generated.js +15 -0
  284. package/dist/esm/graphql-app-api/queries/ThemePage.generated.js +4 -2
  285. package/dist/esm/helpers/GlobalEvent.js +15 -1
  286. package/dist/esm/helpers/align.js +17 -0
  287. package/dist/esm/helpers/animations.js +220 -1
  288. package/dist/esm/helpers/background.js +226 -1
  289. package/dist/esm/helpers/borders.js +189 -4
  290. package/dist/esm/helpers/carousel.js +51 -1
  291. package/dist/esm/helpers/clone-deep.js +3 -1
  292. package/dist/esm/helpers/cls.js +14 -1
  293. package/dist/esm/helpers/colors.js +169 -1
  294. package/dist/esm/helpers/compose-advance-style.js +319 -1
  295. package/dist/esm/helpers/constant.js +19 -1
  296. package/dist/esm/helpers/convert.js +4 -1
  297. package/dist/esm/helpers/covert-entities-html.js +17 -1
  298. package/dist/esm/helpers/css-variable.js +5 -1
  299. package/dist/esm/helpers/email.js +6 -1
  300. package/dist/esm/helpers/filter-toolbar-preview.js +9 -1
  301. package/dist/esm/helpers/flatten-connection.js +7 -1
  302. package/dist/esm/helpers/get-resonsive-value.js +31 -1
  303. package/dist/esm/helpers/get-shortname.js +90 -1
  304. package/dist/esm/helpers/icon-list.js +58 -1
  305. package/dist/esm/helpers/interaction/index.js +132 -0
  306. package/dist/esm/helpers/is-browser.js +5 -1
  307. package/dist/esm/helpers/is-defined.js +5 -1
  308. package/dist/esm/helpers/is-empty-children.js +10 -1
  309. package/dist/esm/helpers/is-safari.js +5 -1
  310. package/dist/esm/helpers/layout.js +54 -1
  311. package/dist/esm/helpers/load-script.js +29 -1
  312. package/dist/esm/helpers/loop-component.js +14 -0
  313. package/dist/esm/helpers/make-style.js +149 -1
  314. package/dist/esm/helpers/normalize-builder-data.js +21 -1
  315. package/dist/esm/helpers/pascal-to-kebab-case.js +5 -0
  316. package/dist/esm/helpers/prefetch-queries.js +76 -1
  317. package/dist/esm/helpers/product.js +44 -1
  318. package/dist/esm/helpers/queries/get-collection.js +223 -1
  319. package/dist/esm/helpers/queries/get-collections.js +19 -1
  320. package/dist/esm/helpers/queries/get-product-by-slug.js +123 -1
  321. package/dist/esm/helpers/queries/get-product.js +150 -1
  322. package/dist/esm/helpers/queries/get-products.js +210 -1
  323. package/dist/esm/helpers/query.js +25 -1
  324. package/dist/esm/helpers/radius.js +132 -6
  325. package/dist/esm/helpers/render.js +70 -1
  326. package/dist/esm/helpers/shadow.js +63 -1
  327. package/dist/esm/helpers/size.js +192 -4
  328. package/dist/esm/helpers/spacing.js +40 -1
  329. package/dist/esm/helpers/third-party/addAppBlockId.js +18 -0
  330. package/dist/esm/helpers/third-party/appConfig.js +200 -0
  331. package/dist/esm/helpers/third-party/appSetting.js +658 -0
  332. package/dist/esm/helpers/third-party/composeAppBlockId.js +9 -0
  333. package/dist/esm/helpers/third-party/constant.js +40 -0
  334. package/dist/esm/helpers/third-party/generateAppBlockConfigs.js +32 -0
  335. package/dist/esm/helpers/third-party/getAppBlockConfig.js +45 -0
  336. package/dist/esm/helpers/third-party/getAppBlockType.js +10 -0
  337. package/dist/esm/helpers/third-party/getAppBlocks.js +28 -0
  338. package/dist/esm/helpers/third-party/mergeBlock.js +17 -0
  339. package/dist/esm/helpers/third-party/mergeBlockOrder.js +45 -0
  340. package/dist/esm/helpers/third-party/removeGPAppItems.js +15 -0
  341. package/dist/esm/helpers/tracking/fpixel.js +24 -1
  342. package/dist/esm/helpers/tracking/gtag.js +87 -1
  343. package/dist/esm/helpers/tracking/tiktokpixel.js +15 -1
  344. package/dist/esm/helpers/typography.js +149 -17
  345. package/dist/esm/helpers/variant.js +9 -1
  346. package/dist/esm/hooks/animation/useAnimationActions.js +37 -1
  347. package/dist/esm/hooks/animation/useAnimationConfig.js +28 -1
  348. package/dist/esm/hooks/animation/useAnimationPreview.js +29 -1
  349. package/dist/esm/hooks/animation/useAnimationTarget.js +120 -1
  350. package/dist/esm/hooks/animation/useApplyAnimation.js +85 -1
  351. package/dist/esm/hooks/articles/useArticlesQuery.js +30 -1
  352. package/dist/esm/hooks/cart/use-add-to-cart.js +18 -1
  353. package/dist/esm/hooks/cart/use-cart-data.js +26 -1
  354. package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +18 -1
  355. package/dist/esm/hooks/cart/use-cart-note-update.js +18 -1
  356. package/dist/esm/hooks/cart/use-create-cart.js +20 -1
  357. package/dist/esm/hooks/cart/use-remove-cart-item.js +18 -1
  358. package/dist/esm/hooks/cart/use-update-cart-item.js +18 -1
  359. package/dist/esm/hooks/shop/use-collection-query.js +20 -1
  360. package/dist/esm/hooks/shop/use-collections-query.js +15 -1
  361. package/dist/esm/hooks/shop/use-product-query.js +20 -1
  362. package/dist/esm/hooks/shop/use-products-query.js +59 -1
  363. package/dist/esm/hooks/shop.js +111 -1
  364. package/dist/esm/hooks/use-current-device.js +28 -1
  365. package/dist/esm/hooks/use-lazy-video.js +13 -1
  366. package/dist/esm/hooks/useAnimations.js +27 -1
  367. package/dist/esm/hooks/useCartId.js +40 -1
  368. package/dist/esm/hooks/useCartLine.js +7 -1
  369. package/dist/esm/hooks/useCartUI.js +44 -1
  370. package/dist/esm/hooks/useCollection.js +7 -1
  371. package/dist/esm/hooks/useFetchHandle.js +11 -1
  372. package/dist/esm/hooks/useFormatMoney.js +71 -1
  373. package/dist/esm/hooks/useInitialSwatchesOptions.js +124 -1
  374. package/dist/esm/hooks/useInteraction.js +17 -0
  375. package/dist/esm/hooks/useIsomorphicLayoutEffect.js +6 -1
  376. package/dist/esm/hooks/useLoadScript.js +28 -1
  377. package/dist/esm/hooks/useMoney.js +80 -1
  378. package/dist/esm/hooks/usePrevious.js +17 -1
  379. package/dist/esm/hooks/useProduct.js +228 -1
  380. package/dist/esm/hooks/useProductList.js +16 -1
  381. package/dist/esm/hooks/useSuspenseFetch.js +23 -1
  382. package/dist/esm/hooks/useSwatchesOptions.js +37 -1
  383. package/dist/esm/hooks/useToolbarPostPurchase.js +87 -1
  384. package/dist/esm/index.js +117 -1
  385. package/dist/esm/types/animations.js +49 -1
  386. package/dist/esm/types/custom.js +52 -0
  387. package/dist/esm/types/global-style.js +12 -1
  388. package/dist/esm/web-components/src/helpers/styles/constant.js +7 -1
  389. package/dist/types/index.d.ts +23183 -17335
  390. package/package.json +5 -3
  391. package/dist/cjs/components/animation/AnimationWrapper.js +0 -1
  392. package/dist/cjs/hooks/animation/animations.js +0 -1
  393. package/dist/cjs/hooks/animation/useLivePageAnimation.js +0 -1
  394. package/dist/esm/components/animation/AnimationWrapper.js +0 -1
  395. package/dist/esm/hooks/animation/animations.js +0 -1
  396. package/dist/esm/hooks/animation/useLivePageAnimation.js +0 -1
@@ -1 +1,260 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react");require("zustand");var BuilderPreviewContext=require("../../contexts/BuilderPreviewContext.js");require("swr"),require("@gem-sdk/adapter-shopify"),require("swr/mutation");var shop=require("../../hooks/shop.js");function Spacing(e){let t=BuilderPreviewContext.useBuilderPreviewStore(e=>e.isThemeSectionEditor),r=shop.usePageType(),n=react.useRef(null),a=react.useRef(null),i=react.useRef(null),u=react.useRef(!1),o=react.useRef(0),s=react.useRef(0),c=react.useRef(null),[l,d]=react.useState(0),[m,p]=react.useState(!1),g=react.useRef(null),v=e=>{let t=e.clientY,r=Math.ceil(t-o.current),n=s.current||0,a=n+r>=0?`${n+r}px`:"0px";return{newValue:a}},f=e=>{if(n.current&&a.current){let{newValue:t}=v(e);a.current.style.height=t,n.current.style.top=t;let r=n.current.closest("[data-toolbar-wrap]");r&&(r.style.marginBottom=t,y(t))}},b=()=>{h()},w=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{u.current=!0;let e=new CustomEvent("editor:toolbar:resize-spacing",{bubbles:!0,detail:{value:!0}});window.dispatchEvent(e),document.addEventListener("mousemove",f),document.addEventListener("mouseup",b)},100)},h=()=>{i.current&&clearTimeout(i.current),u.current=!1;let t=new CustomEvent("editor:toolbar:resize-spacing",{bubbles:!0,detail:{value:!1}});if(window.dispatchEvent(t),n.current){let t=getComputedStyle(n.current),r=t.top,a=new CustomEvent("editor:toolbar:change-margin-bottom",{bubbles:!0,detail:{componentUid:e.uid,marginBottom:r}});window.dispatchEvent(a)}let r=n.current?.closest("[data-toolbar-wrap]");r&&(r.style.marginBottom=""),document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",b)},x=(e,t)=>{let r=e.children.length;if(r)for(let n=0;n<r;n++){let r=e.children[n];if(r){let e=r.getAttribute(t);if(e)return r}}},j=e=>{let t=e.getAttribute("data-component-tag");return"Row"===t||"Product"===t},E=react.useCallback(()=>{let e=n.current?.closest("[data-toolbar-wrap]");if(!e)return;let t=x(e,"data-toolbar");if(!t)return;let r=t.getAttribute("data-toolbar-active");if(!r)return;let i=getComputedStyle(e),u=x(e,"data-spacing"),o=u?.querySelector("[data-spacing-margin-bottom]")||null;if(o&&a.current&&n.current){let t=i.marginBottom;if(y(t),0>parseFloat(t)&&(t="0"),a.current.style.height=t,n.current.style.top=t,o.setAttribute("data-spacing-margin-bottom-active","true"),j(e))a.current.style.left="0";else{let e=i.paddingLeft,t=`-${e}`,r=`translate(${t}, -100%)`;a.current.style.left=t,n.current.style.transform=r}}},[]),y=e=>{let t=parseFloat(e);d(t),p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1)},2e3);let r=t<28&&t>=0?t/2+16:t>28?0:16;c.current&&(c.current.style.transform=`translateY(${r}px)`)},R=usePrevious(e.advanced?.["spacing-setting"]);react.useEffect(()=>{JSON.stringify(R)!==JSON.stringify(e.advanced?.["spacing-setting"])&&E()},[R,e.advanced,E]);let q=react.useCallback(()=>{E()},[E]);return react.useEffect(()=>(window.addEventListener("editor:toolbar:update-margin-bottom",E),window.addEventListener("editor:toolbar:update-padding-left",E),window.addEventListener("resize",q),()=>{window.removeEventListener("editor:toolbar:update-margin-bottom",E),window.removeEventListener("editor:toolbar:update-padding-left",E),window.removeEventListener("resize",q)}),[q,E]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:"Section"!==e.tag&&"POST_PURCHASE"!==r&&jsxRuntime.jsx("div",{"data-spacing":!0,"data-spacing-theme-section":t,className:"gp-absolute gp-w-full gp-bottom-0",children:jsxRuntime.jsxs("div",{"data-spacing-margin-bottom":!0,children:[jsxRuntime.jsxs("div",{"data-spacing-margin-bottom-bg":!0,ref:a,children:[jsxRuntime.jsx("div",{"data-spacing-margin-bottom-value":!0}),jsxRuntime.jsx("div",{"data-active":m,"data-value-number":!0,ref:c,children:l})]}),jsxRuntime.jsx("div",{ref:n,"data-spacing-margin-bottom-drag":!0,onMouseDown:e=>{if(n.current){let t=getComputedStyle(n.current);o.current=e.clientY,s.current=parseFloat(t.top),w()}},onMouseUp:()=>{h()},role:"presentation"})]})})})}require("vanilla-lazyload"),require("../../hooks/useCartUI.js"),require("react-transition-group"),require("@gem-sdk/core"),require("classnames"),require("../../helpers/convert.js");const usePrevious=e=>{let t=react.useRef();return react.useEffect(()=>{t.current=e},[e]),t.current};exports.default=Spacing;
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var react = require('react');
7
+ require('zustand');
8
+ var BuilderPreviewContext = require('../../contexts/BuilderPreviewContext.js');
9
+ require('react-transition-group');
10
+ require('@gem-sdk/core');
11
+ require('swr');
12
+ require('swr/infinite');
13
+ var shop = require('../../hooks/shop.js');
14
+ require('classnames');
15
+ require('dayjs');
16
+ require('../../helpers/convert.js');
17
+ require('@gem-sdk/adapter-shopify');
18
+ require('swr/mutation');
19
+ require('vanilla-lazyload');
20
+ require('../../hooks/useCartUI.js');
21
+
22
+ function Spacing(props) {
23
+ const isThemeSectionEditor = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
24
+ const pageType = shop.usePageType();
25
+ const $bottomDrag = react.useRef(null);
26
+ const $bottomBg = react.useRef(null);
27
+ const delayMouseMove = react.useRef(null);
28
+ const isDragging = react.useRef(false);
29
+ const startY = react.useRef(0);
30
+ const marginBottom = react.useRef(0);
31
+ const $visualNumberValue = react.useRef(null);
32
+ const [marginBottomValue, setMarginBottomValue] = react.useState(0);
33
+ const [isShowVisual, setIsShowVisual] = react.useState(false);
34
+ const hideVisualNumberValue = react.useRef(null);
35
+ const getNewValueMargin = (event)=>{
36
+ const top = event.clientY;
37
+ const diffY = Math.ceil(top - startY.current);
38
+ const currentValue = marginBottom.current || 0;
39
+ const newValue = currentValue + diffY >= 0 ? `${currentValue + diffY}px` : `0px`;
40
+ return {
41
+ newValue
42
+ };
43
+ };
44
+ const onMouseMoveDocument = (event)=>{
45
+ if ($bottomDrag.current && $bottomBg.current) {
46
+ // $bottomDrag.current.
47
+ const { newValue } = getNewValueMargin(event);
48
+ $bottomBg.current.style.height = newValue;
49
+ $bottomDrag.current.style.top = newValue;
50
+ const $component = $bottomDrag.current.closest('[data-toolbar-wrap]');
51
+ if ($component) {
52
+ $component.style.marginBottom = newValue;
53
+ onShowMarginBottomNumber(newValue);
54
+ }
55
+ }
56
+ };
57
+ const onMouseUpDocument = ()=>{
58
+ endDrag();
59
+ };
60
+ const startDrag = ()=>{
61
+ if (delayMouseMove.current) clearTimeout(delayMouseMove.current);
62
+ delayMouseMove.current = setTimeout(()=>{
63
+ isDragging.current = true;
64
+ const event = new CustomEvent('editor:toolbar:resize-spacing', {
65
+ bubbles: true,
66
+ detail: {
67
+ value: true
68
+ }
69
+ });
70
+ window.dispatchEvent(event);
71
+ document.addEventListener('mousemove', onMouseMoveDocument);
72
+ document.addEventListener('mouseup', onMouseUpDocument);
73
+ }, 100);
74
+ };
75
+ const endDrag = ()=>{
76
+ if (delayMouseMove.current) clearTimeout(delayMouseMove.current);
77
+ isDragging.current = false;
78
+ const event = new CustomEvent('editor:toolbar:resize-spacing', {
79
+ bubbles: true,
80
+ detail: {
81
+ value: false
82
+ }
83
+ });
84
+ window.dispatchEvent(event);
85
+ if ($bottomDrag.current) {
86
+ const style = getComputedStyle($bottomDrag.current);
87
+ const marginBottom = style.top;
88
+ const event = new CustomEvent('editor:toolbar:change-margin-bottom', {
89
+ bubbles: true,
90
+ detail: {
91
+ componentUid: props.uid,
92
+ marginBottom
93
+ }
94
+ });
95
+ window.dispatchEvent(event);
96
+ }
97
+ const $component = $bottomDrag.current?.closest('[data-toolbar-wrap]');
98
+ if ($component) {
99
+ $component.style.marginBottom = '';
100
+ }
101
+ document.removeEventListener('mousemove', onMouseMoveDocument);
102
+ document.removeEventListener('mouseup', onMouseUpDocument);
103
+ };
104
+ const onMouseDown = (event)=>{
105
+ if ($bottomDrag.current) {
106
+ const style = getComputedStyle($bottomDrag.current);
107
+ startY.current = event.clientY;
108
+ marginBottom.current = parseFloat(style.top);
109
+ startDrag();
110
+ }
111
+ };
112
+ const onMouseUp = ()=>{
113
+ endDrag();
114
+ };
115
+ const getChildrenByAttrSelector = ($el, attrSelector)=>{
116
+ const childLen = $el.children.length;
117
+ if (childLen) {
118
+ for(let i = 0; i < childLen; i++){
119
+ const children = $el.children[i];
120
+ if (children) {
121
+ const is = children.getAttribute(attrSelector);
122
+ if (is) {
123
+ return children;
124
+ }
125
+ }
126
+ }
127
+ }
128
+ };
129
+ const isLayoutElement = (el)=>{
130
+ const tag = el.getAttribute('data-component-tag');
131
+ return tag === 'Row' || tag === 'Product';
132
+ };
133
+ const updateSpacing = react.useCallback((isShowVisualize)=>{
134
+ const $component = $bottomDrag.current?.closest('[data-toolbar-wrap]');
135
+ if (!$component) return;
136
+ const toolbar = getChildrenByAttrSelector($component, 'data-toolbar');
137
+ if (!toolbar) return;
138
+ const isActive = toolbar.getAttribute('data-toolbar-active');
139
+ if (!isActive) return;
140
+ const style = getComputedStyle($component);
141
+ const $spacing = getChildrenByAttrSelector($component, 'data-spacing');
142
+ const $marginBottom = ($spacing?.querySelector('[data-spacing-margin-bottom]')) || null;
143
+ if ($marginBottom) {
144
+ if ($bottomBg.current && $bottomDrag.current) {
145
+ let value = style.marginBottom;
146
+ isShowVisualize && onShowMarginBottomNumber(value);
147
+ if (parseFloat(value) < 0) {
148
+ value = '0';
149
+ }
150
+ $bottomBg.current.style.height = value;
151
+ $bottomDrag.current.style.top = value;
152
+ $marginBottom.setAttribute('data-spacing-margin-bottom-active', 'true');
153
+ if (isLayoutElement($component)) {
154
+ $bottomBg.current.style.left = '0';
155
+ } else {
156
+ const paddingLeft = style.paddingLeft;
157
+ const leftValue = `-${paddingLeft}`;
158
+ const translateCss = `translate(${leftValue}, -100%)`;
159
+ $bottomBg.current.style.left = leftValue;
160
+ $bottomDrag.current.style.transform = translateCss;
161
+ }
162
+ }
163
+ }
164
+ }, []);
165
+ const onShowMarginBottomNumber = (value)=>{
166
+ const parsedValue = parseFloat(value);
167
+ setMarginBottomValue(parsedValue);
168
+ setIsShowVisual(true);
169
+ if (hideVisualNumberValue.current) clearTimeout(hideVisualNumberValue.current);
170
+ hideVisualNumberValue.current = setTimeout(()=>{
171
+ setIsShowVisual(false);
172
+ }, 2000);
173
+ // break point 28px
174
+ const topPosition = parsedValue <= 28 && parsedValue >= 0 ? parsedValue / 2 + 16 : parsedValue > 28 ? 0 : 16;
175
+ if ($visualNumberValue.current) {
176
+ $visualNumberValue.current.style.transform = `translateY(${topPosition}px)`;
177
+ }
178
+ };
179
+ const previousAdvanced = usePrevious(props.advanced?.['spacing-setting']);
180
+ react.useEffect(()=>{
181
+ // validate margin bottom setting changed
182
+ const isShowVisualize = verifyMarginBottomChanged(previousAdvanced, props.advanced?.['spacing-setting']);
183
+ updateSpacing(isShowVisualize);
184
+ }, [
185
+ previousAdvanced,
186
+ props.advanced,
187
+ updateSpacing
188
+ ]);
189
+ const verifyMarginBottomChanged = (prevValue, newValue)=>{
190
+ const listDevices = [
191
+ 'desktop',
192
+ 'tablet',
193
+ 'mobile'
194
+ ];
195
+ return listDevices.some((device)=>JSON.stringify(prevValue?.[device]?.margin?.bottom) !== JSON.stringify(newValue?.[device]?.margin?.bottom));
196
+ };
197
+ const onWindowResize = react.useCallback(()=>{
198
+ updateSpacing();
199
+ }, [
200
+ updateSpacing
201
+ ]);
202
+ react.useEffect(()=>{
203
+ window.addEventListener('editor:toolbar:update-margin-bottom', ()=>updateSpacing);
204
+ window.addEventListener('editor:toolbar:update-padding-left', ()=>updateSpacing);
205
+ window.addEventListener('resize', onWindowResize);
206
+ return ()=>{
207
+ window.removeEventListener('editor:toolbar:update-margin-bottom', ()=>updateSpacing);
208
+ window.removeEventListener('editor:toolbar:update-padding-left', ()=>updateSpacing);
209
+ window.removeEventListener('resize', onWindowResize);
210
+ };
211
+ }, [
212
+ onWindowResize,
213
+ updateSpacing
214
+ ]);
215
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
216
+ children: props.tag !== 'Section' && pageType !== 'POST_PURCHASE' && /*#__PURE__*/ jsxRuntime.jsx("div", {
217
+ "data-spacing": true,
218
+ "data-spacing-theme-section": isThemeSectionEditor,
219
+ className: "gp-absolute gp-w-full gp-bottom-0",
220
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
221
+ "data-spacing-margin-bottom": true,
222
+ children: [
223
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
224
+ "data-spacing-margin-bottom-bg": true,
225
+ ref: $bottomBg,
226
+ children: [
227
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
228
+ "data-spacing-margin-bottom-value": true
229
+ }),
230
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
231
+ "data-active": isShowVisual,
232
+ "data-value-number": true,
233
+ ref: $visualNumberValue,
234
+ children: marginBottomValue
235
+ })
236
+ ]
237
+ }),
238
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
239
+ ref: $bottomDrag,
240
+ "data-spacing-margin-bottom-drag": true,
241
+ onMouseDown: onMouseDown,
242
+ onMouseUp: onMouseUp,
243
+ role: "presentation"
244
+ })
245
+ ]
246
+ })
247
+ })
248
+ });
249
+ }
250
+ const usePrevious = (value)=>{
251
+ const ref = react.useRef();
252
+ react.useEffect(()=>{
253
+ ref.current = value;
254
+ }, [
255
+ value
256
+ ]);
257
+ return ref.current;
258
+ };
259
+
260
+ exports.default = Spacing;
@@ -1 +1,56 @@
1
- "use strict";const colorPreset={black:"#000000",white:"#FFFFFF",gray:"#808080",red:"#FF0000",blue:"#0000FF",green:"#008000",yellow:"#FFFF00",orange:"#FFA500",pink:"#FFC0CB",purple:"#800080",brown:"#A52A2A",cyan:"#00FFFF",magenta:"#FF00FF",teal:"#008080",navy:"#000080",maroon:"#800000",gold:"#FFD700",silver:"#C0C0C0",beige:"#F5F5DC",ivory:"#FFFFF0",lavender:"#E6E6FA",indigo:"#4B0082",coral:"#FF7F50",mint:"#98FF98","sky blue":"#87CEEB",salmon:"#FA8072",olive:"#808000",lilac:"#C8A2C8",peach:"#FFDAB9",turquoise:"#40E0D0",ruby:"#E0115F",bronze:"#CD7F32",slate:"#708090",charcoal:"#36454F",sand:"#C2B280",mauve:"#E0B0FF",tangerine:"#FF4500","mint green":"#00FF99","forest green":"#228B22","ruby red":"#9B111E",marigold:"#FFB928",eggplant:"#990066","coral pink":"#F88379",mustard:"#FFDB58","sky gray":"#B0C4DE","dusty rose":"#FF9BAE","olive green":"#556B2F",coffee:"#6F4E37","lilac gray":"#C8A2C8","steel blue":"#4682B4"};exports.colorPreset=colorPreset;
1
+ 'use strict';
2
+
3
+ const colorPreset = {
4
+ black: '#000000',
5
+ white: '#FFFFFF',
6
+ gray: '#808080',
7
+ red: '#FF0000',
8
+ blue: '#0000FF',
9
+ green: '#008000',
10
+ yellow: '#FFFF00',
11
+ orange: '#FFA500',
12
+ pink: '#FFC0CB',
13
+ purple: '#800080',
14
+ brown: '#A52A2A',
15
+ cyan: '#00FFFF',
16
+ magenta: '#FF00FF',
17
+ teal: '#008080',
18
+ navy: '#000080',
19
+ maroon: '#800000',
20
+ gold: '#FFD700',
21
+ silver: '#C0C0C0',
22
+ beige: '#F5F5DC',
23
+ ivory: '#FFFFF0',
24
+ lavender: '#E6E6FA',
25
+ indigo: '#4B0082',
26
+ coral: '#FF7F50',
27
+ mint: '#98FF98',
28
+ 'sky blue': '#87CEEB',
29
+ salmon: '#FA8072',
30
+ olive: '#808000',
31
+ lilac: '#C8A2C8',
32
+ peach: '#FFDAB9',
33
+ turquoise: '#40E0D0',
34
+ ruby: '#E0115F',
35
+ bronze: '#CD7F32',
36
+ slate: '#708090',
37
+ charcoal: '#36454F',
38
+ sand: '#C2B280',
39
+ mauve: '#E0B0FF',
40
+ tangerine: '#FF4500',
41
+ 'mint green': '#00FF99',
42
+ 'forest green': '#228B22',
43
+ 'ruby red': '#9B111E',
44
+ marigold: '#FFB928',
45
+ eggplant: '#990066',
46
+ 'coral pink': '#F88379',
47
+ mustard: '#FFDB58',
48
+ 'sky gray': '#B0C4DE',
49
+ 'dusty rose': '#FF9BAE',
50
+ 'olive green': '#556B2F',
51
+ coffee: '#6F4E37',
52
+ 'lilac gray': '#C8A2C8',
53
+ 'steel blue': '#4682B4'
54
+ };
55
+
56
+ exports.colorPreset = colorPreset;
@@ -1 +1,123 @@
1
- "use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),ThemeSectionTooltip=require("./ThemeSectionTooltip.js");require("zustand");var ShopContext=require("../../contexts/ShopContext.js");require("@gem-sdk/adapter-shopify"),require("swr"),require("swr/mutation"),require("vanilla-lazyload"),require("../../hooks/useCartUI.js"),require("classnames"),require("../../helpers/convert.js");const SHOW_TOOLTIP_TIMEOUT=600,NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP=1,LIMIT_PLANS=["starter","trial","trial2022"],CreateThemeSection=({...e})=>{let t=ShopContext.useShopStore(e=>e.plan),r=ShopContext.useShopStore(e=>e.createThemeSectionCount),i=LIMIT_PLANS.includes(t??""),o=i||void 0===r||r<1,n=react.useRef(),[s,a]=react.useState(!1),u=()=>{o&&(n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{a(!0)},600))},c=()=>{o&&(n.current&&clearTimeout(n.current),a(!1))},l=(e,t)=>{e.preventDefault(),e.stopPropagation(),t?.disabled||(i?d():h(),n.current&&clearTimeout(n.current),a(!1))},d=()=>{let e=new CustomEvent("editor:toolbar:upgrade",{bubbles:!0});window.dispatchEvent(e)},h=()=>{let t=new CustomEvent("editor:toolbar:create-theme-section",{bubbles:!0,detail:{componentUid:e.uid}});window.dispatchEvent(t)};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(ThemeSectionTooltip.ThemeSectionTooltip,{isLimit:i,isShow:s,isRender:o,onActions:l,onMouseEnter:u,onMouseLeave:c,children:[o&&jsxRuntime.jsx("div",{"data-toolbar-create-theme-section":!0,children:"You can create reusable sections"}),jsxRuntime.jsx("div",{"data-toolbar-active-create-theme-section-wrapper":!0,children:jsxRuntime.jsxs("div",{"data-toolbar-active-create-theme-section":!0,onClick:e=>l(e,{disabled:i}),"aria-hidden":"true",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M1 2C1 1.44772 1.44772 1 2 1H6C6.55228 1 7 1.44772 7 2V6C7 6.55228 6.55228 7 6 7H2C1.44772 7 1 6.55228 1 6V2Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{d:"M9 10C9 9.44772 9.44772 9 10 9H14C14.5523 9 15 9.44772 15 10V14C15 14.5523 14.5523 15 14 15H10C9.44772 15 9 14.5523 9 14V10Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{d:"M2 9C1.44772 9 1 9.44772 1 10V14C1 14.5523 1.44772 15 2 15H6C6.55228 15 7 14.5523 7 14V10C7 9.44772 6.55228 9 6 9H2Z",fill:"#F9F9F9"})]}),jsxRuntime.jsx("p",{children:"Create Theme Section"})]})})]})})};exports.CreateThemeSection=CreateThemeSection;
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var ThemeSectionTooltip = require('./ThemeSectionTooltip.js');
6
+ require('zustand');
7
+ var ShopContext = require('../../contexts/ShopContext.js');
8
+ require('swr');
9
+ require('swr/infinite');
10
+ require('classnames');
11
+ require('dayjs');
12
+ require('../../helpers/convert.js');
13
+ require('@gem-sdk/adapter-shopify');
14
+ require('swr/mutation');
15
+ require('vanilla-lazyload');
16
+ require('../../hooks/useCartUI.js');
17
+
18
+ const SHOW_TOOLTIP_TIMEOUT = 600;
19
+ const NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP = 1;
20
+ const LIMIT_PLANS = [
21
+ 'starter',
22
+ 'trial',
23
+ 'trial2022'
24
+ ];
25
+ const CreateThemeSection = ({ ...props })=>{
26
+ const shopPlan = ShopContext.useShopStore((s)=>s.plan);
27
+ const createThemeSectionCount = ShopContext.useShopStore((s)=>s.createThemeSectionCount);
28
+ const limitCreateThemeSection = ShopContext.useShopStore((s)=>s.limitCreateThemeSection);
29
+ const isFreeLimit = LIMIT_PLANS.includes(shopPlan ?? '');
30
+ const isLimit = isFreeLimit || limitCreateThemeSection?.isLimit;
31
+ const isRenderTooltip = isLimit || createThemeSectionCount === undefined || createThemeSectionCount < NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP;
32
+ const timeoutRef = react.useRef();
33
+ const [isShowTooltip, setIsShowTooltip] = react.useState(false);
34
+ const showTooltip = ()=>{
35
+ if (!isRenderTooltip) return;
36
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
37
+ timeoutRef.current = setTimeout(()=>{
38
+ setIsShowTooltip(true);
39
+ }, SHOW_TOOLTIP_TIMEOUT);
40
+ };
41
+ const hideTooltip = ()=>{
42
+ if (!isRenderTooltip) return;
43
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
44
+ setIsShowTooltip(false);
45
+ };
46
+ const onActions = (e, options)=>{
47
+ e.preventDefault();
48
+ e.stopPropagation();
49
+ if (options?.disabled) return;
50
+ isLimit ? onUpgrade() : onCreate();
51
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
52
+ setIsShowTooltip(false);
53
+ };
54
+ const onUpgrade = ()=>{
55
+ const eventUpgrade = new CustomEvent('editor:toolbar:upgrade', {
56
+ bubbles: true
57
+ });
58
+ window.dispatchEvent(eventUpgrade);
59
+ };
60
+ const onCreate = ()=>{
61
+ const eventCreate = new CustomEvent('editor:toolbar:create-theme-section', {
62
+ bubbles: true,
63
+ detail: {
64
+ componentUid: props.uid
65
+ }
66
+ });
67
+ window.dispatchEvent(eventCreate);
68
+ };
69
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
70
+ children: /*#__PURE__*/ jsxRuntime.jsxs(ThemeSectionTooltip.ThemeSectionTooltip, {
71
+ isFreeLimit: isFreeLimit,
72
+ limitCreateThemeSection: limitCreateThemeSection,
73
+ isShow: isShowTooltip,
74
+ isRender: isRenderTooltip,
75
+ onActions: onActions,
76
+ onMouseEnter: showTooltip,
77
+ onMouseLeave: hideTooltip,
78
+ children: [
79
+ isRenderTooltip && /*#__PURE__*/ jsxRuntime.jsx("div", {
80
+ "data-toolbar-create-theme-section": true,
81
+ children: "You can create reusable sections"
82
+ }),
83
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
84
+ "data-toolbar-active-create-theme-section-wrapper": true,
85
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
86
+ "data-toolbar-active-create-theme-section": true,
87
+ onClick: (e)=>onActions(e, {
88
+ disabled: !!isLimit
89
+ }),
90
+ "aria-hidden": "true",
91
+ children: [
92
+ /*#__PURE__*/ jsxRuntime.jsxs("svg", {
93
+ width: "16",
94
+ height: "16",
95
+ viewBox: "0 0 16 16",
96
+ fill: "none",
97
+ children: [
98
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
99
+ d: "M1 2C1 1.44772 1.44772 1 2 1H6C6.55228 1 7 1.44772 7 2V6C7 6.55228 6.55228 7 6 7H2C1.44772 7 1 6.55228 1 6V2Z",
100
+ fill: "#F9F9F9"
101
+ }),
102
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
103
+ d: "M9 10C9 9.44772 9.44772 9 10 9H14C14.5523 9 15 9.44772 15 10V14C15 14.5523 14.5523 15 14 15H10C9.44772 15 9 14.5523 9 14V10Z",
104
+ fill: "#F9F9F9"
105
+ }),
106
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
107
+ d: "M2 9C1.44772 9 1 9.44772 1 10V14C1 14.5523 1.44772 15 2 15H6C6.55228 15 7 14.5523 7 14V10C7 9.44772 6.55228 9 6 9H2Z",
108
+ fill: "#F9F9F9"
109
+ })
110
+ ]
111
+ }),
112
+ /*#__PURE__*/ jsxRuntime.jsx("p", {
113
+ children: "Create Theme Section"
114
+ })
115
+ ]
116
+ })
117
+ })
118
+ ]
119
+ })
120
+ });
121
+ };
122
+
123
+ exports.CreateThemeSection = CreateThemeSection;
@@ -1 +1,45 @@
1
- "use strict";var jsxRuntime=require("react/jsx-runtime");const getStatusMessage=e=>{switch(e){case"DRAFT":return"This Theme Section is Draft. Publish page will also publish Theme Section.";case"NEED_PUBLISHING":return"Need to republish. Go to global edit and publish this section"}},ThemeSectionStatusWrapper=({tag:e,status:t,isThemeSection:s})=>{let i="Section"===e&&s&&("DRAFT"===t||"NEED_PUBLISHING"===t),n=getStatusMessage(t);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:i&&jsxRuntime.jsxs("div",{"data-theme-section-status":!0,children:[jsxRuntime.jsx("div",{"data-theme-section-status-icon":!0,children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.4668 4.61597C8.4668 4.89211 8.24294 5.11597 7.9668 5.11597C7.69065 5.11597 7.4668 4.89211 7.4668 4.61597C7.4668 4.33982 7.69065 4.11597 7.9668 4.11597C8.24294 4.11597 8.4668 4.33982 8.4668 4.61597ZM6.91309 5.48633C6.63694 5.48633 6.41309 5.71019 6.41309 5.98633C6.41309 6.26247 6.63694 6.48633 6.91309 6.48633H7.56006V10.3839C7.56006 10.9362 8.00777 11.3839 8.56006 11.3839H9.57144C9.84758 11.3839 10.0714 11.1601 10.0714 10.8839C10.0714 10.6078 9.84758 10.3839 9.57144 10.3839H8.56006V6.48633C8.56006 5.93404 8.11234 5.48633 7.56006 5.48633H6.91309Z",fill:"#9144DA"})})}),n&&jsxRuntime.jsx("span",{"data-theme-section-status-text":!0,children:n})]})})};exports.ThemeSectionStatusWrapper=ThemeSectionStatusWrapper;
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
5
+ const getStatusMessage = (status)=>{
6
+ switch(status){
7
+ case 'DRAFT':
8
+ return 'This Theme Section is Draft. Publish page will also publish Theme Section.';
9
+ case 'NEED_PUBLISHING':
10
+ return 'Need to republish. Go to global edit and publish this section';
11
+ }
12
+ };
13
+ const ThemeSectionStatusWrapper = ({ tag, status, isThemeSection })=>{
14
+ const isRenderThemeSectionStatus = tag === 'Section' && isThemeSection && (status === 'DRAFT' || status === 'NEED_PUBLISHING');
15
+ const statusMessage = getStatusMessage(status);
16
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
17
+ children: isRenderThemeSectionStatus && /*#__PURE__*/ jsxRuntime.jsxs("div", {
18
+ "data-theme-section-status": true,
19
+ children: [
20
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
21
+ "data-theme-section-status-icon": true,
22
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
23
+ xmlns: "http://www.w3.org/2000/svg",
24
+ width: "16",
25
+ height: "16",
26
+ viewBox: "0 0 16 16",
27
+ fill: "none",
28
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
29
+ fillRule: "evenodd",
30
+ clipRule: "evenodd",
31
+ d: "M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.4668 4.61597C8.4668 4.89211 8.24294 5.11597 7.9668 5.11597C7.69065 5.11597 7.4668 4.89211 7.4668 4.61597C7.4668 4.33982 7.69065 4.11597 7.9668 4.11597C8.24294 4.11597 8.4668 4.33982 8.4668 4.61597ZM6.91309 5.48633C6.63694 5.48633 6.41309 5.71019 6.41309 5.98633C6.41309 6.26247 6.63694 6.48633 6.91309 6.48633H7.56006V10.3839C7.56006 10.9362 8.00777 11.3839 8.56006 11.3839H9.57144C9.84758 11.3839 10.0714 11.1601 10.0714 10.8839C10.0714 10.6078 9.84758 10.3839 9.57144 10.3839H8.56006V6.48633C8.56006 5.93404 8.11234 5.48633 7.56006 5.48633H6.91309Z",
32
+ fill: "#9144DA"
33
+ })
34
+ })
35
+ }),
36
+ statusMessage && /*#__PURE__*/ jsxRuntime.jsx("span", {
37
+ "data-theme-section-status-text": true,
38
+ children: statusMessage
39
+ })
40
+ ]
41
+ })
42
+ });
43
+ };
44
+
45
+ exports.ThemeSectionStatusWrapper = ThemeSectionStatusWrapper;
@@ -1 +1,126 @@
1
- "use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),reactTransitionGroup=require("react-transition-group"),core=require("@gem-sdk/core");const TRANSITION_DURATION=350,defaultStyles={transition:"opacity 350ms ease-out",opacity:0},transitions={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0},unmounted:{opacity:0}},ThemeSectionTooltip=({isShow:e,isLimit:t,isRender:i,children:o,onMouseEnter:n,onMouseLeave:s,onActions:a})=>{let c=react.useRef(null),r=t?"Upgrade to create Theme Section":"Create Theme Section",l=()=>{window.open("https://help.gempages.net/articles/theme-section","_blank")};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"theme-section-tooltip-wrapper",onMouseEnter:n,onMouseLeave:s,children:[o,i&&jsxRuntime.jsx(reactTransitionGroup.Transition,{in:e,timeout:350,nodeRef:c,unmountOnExit:!0,children:e=>jsxRuntime.jsxs("div",{className:"theme-section-tooltip",ref:c,style:{...defaultStyles,...transitions[e]},children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__image",children:jsxRuntime.jsx("img",{src:"https://ucarecdn.com/6a9f408a-aa8c-434a-890b-81067a14aceb/-/format/auto/-/preview/1920x1920/-/quality/lighter/theme-section-illustration.png",alt:""})}),jsxRuntime.jsxs("div",{className:"theme-section-tooltip__body",children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__body-title",children:"Create once, use everywhere with Theme Section"}),jsxRuntime.jsx("div",{className:"theme-section-tooltip__body-desc",children:"A global section that can be used on all your GemPages & Shopify pages."})]}),jsxRuntime.jsxs("div",{className:core.cls("theme-section-tooltip__action",{"theme-section-tooltip__action-limit":t}),children:[jsxRuntime.jsx("button",{onClick:e=>a(e),children:r}),t&&jsxRuntime.jsx("div",{onClick:l,"aria-hidden":!0,className:"theme-section-tooltip__action-learn-more",children:"Learn more about Theme Section"})]})]})})]})})};exports.ThemeSectionTooltip=ThemeSectionTooltip;
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var reactTransitionGroup = require('react-transition-group');
6
+ var core = require('@gem-sdk/core');
7
+
8
+ const TRANSITION_DURATION = 350;
9
+ const defaultStyles = {
10
+ transition: `opacity ${TRANSITION_DURATION}ms ease-out`,
11
+ opacity: 0
12
+ };
13
+ const transitions = {
14
+ entering: {
15
+ opacity: 1
16
+ },
17
+ entered: {
18
+ opacity: 1
19
+ },
20
+ exiting: {
21
+ opacity: 0
22
+ },
23
+ exited: {
24
+ opacity: 0
25
+ },
26
+ unmounted: {
27
+ opacity: 0
28
+ }
29
+ };
30
+ const ThemeSectionTooltip = ({ isShow, isFreeLimit, isRender, children, limitCreateThemeSection, onMouseEnter, onMouseLeave, onActions })=>{
31
+ const nodeRef = react.useRef(null);
32
+ const actionBtnLabel = isFreeLimit ? 'Upgrade to create Theme Section' : 'Create Theme Section';
33
+ const openHelpCenter = ()=>{
34
+ const url = 'https://help.gempages.net/articles/theme-section';
35
+ window.open(url, '_blank');
36
+ };
37
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
38
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
39
+ className: "theme-section-tooltip-wrapper",
40
+ onMouseEnter: onMouseEnter,
41
+ onMouseLeave: onMouseLeave,
42
+ children: [
43
+ children,
44
+ isRender && /*#__PURE__*/ jsxRuntime.jsx(reactTransitionGroup.Transition, {
45
+ in: isShow,
46
+ timeout: TRANSITION_DURATION,
47
+ nodeRef: nodeRef,
48
+ unmountOnExit: true,
49
+ children: (state)=>/*#__PURE__*/ jsxRuntime.jsx("div", {
50
+ className: "theme-section-tooltip",
51
+ ref: nodeRef,
52
+ style: {
53
+ ...defaultStyles,
54
+ ...transitions[state]
55
+ },
56
+ children: limitCreateThemeSection?.isLimit && !isFreeLimit ? /*#__PURE__*/ jsxRuntime.jsxs("div", {
57
+ className: "theme-section-tooltip__body theme-section-tooltip__body-limit",
58
+ children: [
59
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
60
+ className: "theme-section-tooltip__body-title theme-section-tooltip__body-limit__title",
61
+ children: "Upgrade plan"
62
+ }),
63
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
64
+ className: "theme-section-tooltip__body-desc theme-section-tooltip__body-limit__desc",
65
+ children: [
66
+ "You’ve reached the maximum number of theme sections on your plan (",
67
+ limitCreateThemeSection.total,
68
+ "/",
69
+ limitCreateThemeSection.limit,
70
+ ")"
71
+ ]
72
+ }),
73
+ /*#__PURE__*/ jsxRuntime.jsx("button", {
74
+ onClick: (e)=>onActions(e),
75
+ children: "Upgrade plan to create more"
76
+ })
77
+ ]
78
+ }) : /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
79
+ children: [
80
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
81
+ className: "theme-section-tooltip__image",
82
+ children: /*#__PURE__*/ jsxRuntime.jsx("img", {
83
+ src: "https://ucarecdn.com/6a9f408a-aa8c-434a-890b-81067a14aceb/-/format/auto/-/preview/1920x1920/-/quality/lighter/theme-section-illustration.png",
84
+ alt: ""
85
+ })
86
+ }),
87
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
88
+ className: "theme-section-tooltip__body",
89
+ children: [
90
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
91
+ className: "theme-section-tooltip__body-title",
92
+ children: "Create once, use everywhere with Theme Section"
93
+ }),
94
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
95
+ className: "theme-section-tooltip__body-desc",
96
+ children: "A global section that can be used on all your GemPages & Shopify pages."
97
+ })
98
+ ]
99
+ }),
100
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
101
+ className: core.cls('theme-section-tooltip__action', {
102
+ 'theme-section-tooltip__action-limit': isFreeLimit
103
+ }),
104
+ children: [
105
+ /*#__PURE__*/ jsxRuntime.jsx("button", {
106
+ onClick: (e)=>onActions(e),
107
+ children: actionBtnLabel
108
+ }),
109
+ isFreeLimit && /*#__PURE__*/ jsxRuntime.jsx("div", {
110
+ onClick: openHelpCenter,
111
+ "aria-hidden": true,
112
+ className: "theme-section-tooltip__action-learn-more",
113
+ children: "Learn more about Theme Section"
114
+ })
115
+ ]
116
+ })
117
+ ]
118
+ })
119
+ })
120
+ })
121
+ ]
122
+ })
123
+ });
124
+ };
125
+
126
+ exports.ThemeSectionTooltip = ThemeSectionTooltip;