@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,752 @@
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"),ShopContext=require("../contexts/ShopContext.js");require("@gem-sdk/adapter-shopify"),require("swr"),require("swr/mutation"),require("vanilla-lazyload"),require("../hooks/useCartUI.js");var CreateThemeSection=require("./theme-section/CreateThemeSection.js"),AIContentGenerator=require("./ai-generator/AIContentGenerator.js"),AIGenContentLoading=require("./ai-generator/AIGenContentLoading.js"),Tooltip=require("./toolbar/Tooltip.js"),ThemeSectionStatus=require("./theme-section/ThemeSectionStatus.js"),useToolbarPostPurchase=require("../hooks/useToolbarPostPurchase.js"),Resize=require("./resize/Resize.js"),constant=require("./constant.js");require("../helpers/convert.js");const SECTION_LIMIT=25,notVisible=e=>{let t=getComputedStyle(e).overflow;return"visible"!==t},isSection=e=>{let t=e.getAttribute("data-component-tag");return"Section"===t},ComponentToolbarPreview=e=>{let t=e.isThemeSection,i=e.isShopifySection,o=ShopContext.useShopStore(e=>e.pageType),n=BuilderPreviewContext.useBuilderPreviewStore(e=>e.getParents),a=BuilderPreviewContext.useBuilderPreviewStore(e=>e.getItem("ROOT")),r=BuilderPreviewContext.useBuilderPreviewStore(e=>e.isThemeSectionEditor),[l,s]=react.useState(null),[d,u]=react.useState(!1),[C,c]=react.useState(!1),[h,x]=react.useState([]),[p,m]=react.useState("top"),[j,v]=react.useState(!1),[b,g]=react.useState({width:"",text:""}),[R,f]=react.useState(!1),S=react.useMemo(()=>"POST_PURCHASE"===o,[o]),{checkDisableDelete:w,getTooltipText:T,checkDisableDuplicate:P}=useToolbarPostPurchase.usePostPurchase(e.uid,e.tag||""),M=(e,t)=>{let i=h.length,o=e.getBoundingClientRect(),n=t.getBoundingClientRect();return o.top-n.top<36*i},V=(e,t)=>{let i=t||e;if(e&&!isSection(e))return notVisible(e)&&M(t,e)?e:e.parentElement?V(e.parentElement,i):void 0},H=react.useCallback(()=>{if("Section"==e.tag)return"bottom";let t=document.querySelector('[data-toolbar-active="true"]');if(t){let e=t.getBoundingClientRect();e.top<60?m("bottom"):m("top")}},[e.tag]),Z=react.useCallback(t=>{let i=t.detail;if(i?.componentUid==e.uid){H(),S&&(v(w()),g(T()),f(P()));let t=n(e.uid).filter(e=>!("ROOT"===e.uid||"Section"===e.tag&&r||e.editorConfigs?.toolbar?.hide||e.editorConfigs?.component?.noSetting)).slice(0,3);x(t)}else x([]),u(!1)},[e.uid,S,n,w,T,P,r,H]);if(react.useEffect(()=>(window.addEventListener("editor:active-component",Z),()=>{window.removeEventListener("editor:active-component",Z)}),[Z]),"section"===e.type||e.editorConfigs?.toolbar?.hide)return null;let E=()=>a?.childrens?.length||0,L=()=>"Section"!==e.tag?-1:a?.childrens?.length?a.childrens.findIndex(t=>t==e.uid):-1,y=e=>{if(!h.length)return;let t=e?.target||null,i=t.closest("[data-toolbar-active]");if(!t||!i)return;if(d)c(!1),u(!1);else{let e=V(i,i);if(e)c(!0);else{let e=i.getBoundingClientRect();e.top<36*h.length?c(!0):c(!1)}u(!0)}let o=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!d}});window.dispatchEvent(o)},B=o=>{o.preventDefault(),o.stopPropagation();let n=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:e.uid,isThemeSection:t,isShopifySection:i}});return window.dispatchEvent(n),!1},q=o=>{if(o.preventDefault(),o.stopPropagation(),E()>=25&&"Section"==e.tag)return!1;let n=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:e.uid,isThemeSection:t,isShopifySection:i}});return window.dispatchEvent(n),!1},I=t=>{t.preventDefault(),t.stopPropagation();let i=new CustomEvent("editor:toolbar:zoom-out-component",{bubbles:!0,detail:{componentUid:e.uid}});return window.dispatchEvent(i),!1},A=()=>{s(null),window.removeEventListener("editor:close-add-section-popup",A)},k=(t,i)=>{if(t.preventDefault(),t.stopPropagation(),E()>=25)return!1;let o=t.target;if(o){s(i);let t=o.getBoundingClientRect(),n=new CustomEvent("editor:toolbar:add-section",{bubbles:!0,detail:{componentUid:e.uid,position:i,top:t.top+t.height/2}});window.dispatchEvent(n),window.addEventListener("editor:close-add-section-popup",A)}return!1},F=()=>{if(i)return`Shopify section: ${e.name}`;let t=e.name&&e.name===`Section ${e.uid}`;return E()>=20?`${t?"Section":e?.name} ${L()+1}/25`:t?`Section ${L()+1}`:e?.name};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!("Section"==e.tag&&r)&&jsxRuntime.jsxs("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==e.tag,"data-toolbar-theme-section":"Section"==e.tag&&!!t||r,"data-toolbar-shopify-section":"Section"==e.tag&&!!i,"data-toolbar-limit":L()>=25,children:[jsxRuntime.jsxs("div",{"data-toolbar-show-parent":!0,onClick:e=>y(e),"aria-hidden":"true",children:[jsxRuntime.jsx("div",{"data-toolbar-icon-drag":!0,children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),"Section"==e.tag?jsxRuntime.jsxs("div",{"data-toolbar-name":!0,children:[F(),e.isShopifySection&&!e.isShopifyVisibility&&jsxRuntime.jsxs("svg",{"data-toolbar-visibility":!0,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1252 9.99773C13.1243 8.27226 11.7248 6.87423 9.99935 6.87506C8.27386 6.87561 6.87518 8.27455 6.87518 10.0001C6.87518 11.7259 8.27429 13.1251 10.0002 13.1251C11.7257 13.1251 13.125 11.727 13.1252 10.0011V9.99773ZM9.99985 8.12506C11.035 8.12451 11.8746 8.96322 11.8752 9.99839V10.0004C11.8752 11.0357 11.0359 11.8751 10.0002 11.8751C8.96465 11.8751 8.12518 11.0356 8.12518 10.0001C8.12518 8.96472 8.96451 8.12533 9.99985 8.12506Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.99885 4.37593C5.66421 4.37604 2.80603 7.64523 1.79548 9.00983C1.35636 9.60279 1.35918 10.4 1.80012 10.9902C2.81706 12.3514 5.69374 15.6241 9.99886 15.6241C14.3806 15.6241 17.2194 12.3452 18.2168 10.9808C18.6473 10.392 18.6442 9.60472 18.211 9.01902C17.2056 7.65938 14.3429 4.37583 9.99885 4.37593ZM2.80002 9.75374C3.77049 8.44326 6.30207 5.62602 9.99888 5.62593C13.7041 5.62585 16.24 8.45598 17.206 9.76225C17.3146 9.9091 17.3149 10.0965 17.2077 10.2431C16.254 11.5477 13.7416 14.3741 9.99886 14.3741C6.33149 14.3741 3.78173 11.5541 2.80152 10.242C2.69021 10.0931 2.69001 9.90229 2.80002 9.75374Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0763 3.26988C18.3415 3.58809 18.2985 4.06101 17.9803 4.32619L2.98032 16.8262C2.66211 17.0914 2.18919 17.0484 1.92402 16.7302C1.65884 16.412 1.70184 15.939 2.02004 15.6739L17.02 3.17385C17.3383 2.90868 17.8112 2.95167 18.0763 3.26988Z",fill:"#F9F9F9"})]})]}):jsxRuntime.jsx("div",{"data-toolbar-name":!0,children:e.customLabel||e.label}),"Section"!==e.tag&&h.length>0&&jsxRuntime.jsx("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":d,children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M5.65522 10C5.07265 10 4.7809 9.22865 5.19284 8.77753L7.53762 6.20974C7.79298 5.93009 8.20702 5.93009 8.46238 6.20974L10.8072 8.77754C11.2191 9.22866 10.9274 10 10.3448 10H5.65522Z",fill:"currentColor"})})})]}),d&&h.map((e,t)=>{let i=e?.childrens?.length??0,o=e.label;return"Row"===e.label&&(o=i<=1?e.label+" "+i+" col":e.label+" "+i+" cols"),jsxRuntime.jsxs("div",{"data-toolbar-parent":!0,"data-parent-uid":e.uid,"data-toolbar-theme-section":r,"data-toolbar-parent-revert":C,style:{top:C?`${36*(t+1)}px`:`${-36*(t+1)}px`},children:[jsxRuntime.jsx("div",{"data-toolbar-icon-drag":!0,children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),jsxRuntime.jsx("div",{"data-toolbar-name":!0,children:o})]},e.uid)}),"Section"===e.tag&&!e.isThemeSection&&"STATIC"!==o&&"POST_PURCHASE"!==o&&!e.isShopifySection&&25>L()&&jsxRuntime.jsx(CreateThemeSection.CreateThemeSection,{...e}),!e.isShopifySection&&constant.ableGenerateContentElements.includes(e.tag)&&jsxRuntime.jsx(AIContentGenerator.AIContentGenerator,{...e}),"Sticky"==e.tag&&jsxRuntime.jsx("div",{"data-toolbar-zoom-out":!0,onClick:e=>I(e),"aria-hidden":"true",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",fill:"currentColor"})})}),jsxRuntime.jsx(Tooltip.default,{enable:"Section"==e.tag&&E()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"bottom","data-toolbar-duplicate":!0,"data-toolbar-disable":"Section"==e.tag&&E()>=25||R,onClick:R?void 0:e=>q(e),"aria-hidden":"true",className:R?"!gp-cursor-not-allowed":"",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",fill:"currentColor"})})}),jsxRuntime.jsx(Tooltip.default,{"data-toolbar-delete":!0,onClick:e=>j?null:B(e),enable:j,"data-toolbar-disable":j,width:b.width,text:b.text,position:p,"aria-hidden":"true",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",fill:"currentColor"})})})]},e.uid),"STATIC"!==o&&"POST_PURCHASE"!==o&&25>L()&&jsxRuntime.jsx(ThemeSectionStatus.ThemeSectionStatusWrapper,{...e}),jsxRuntime.jsx("div",{"data-outline":!0,"data-outline-section":"Section"==e.tag,"data-outline-theme-section":"Section"==e.tag&&!!t||r,"data-outline-shopify-section":"Section"==e.tag&&!!i,"data-outline-limit":L()>=25},"outline-"+e.uid),"Section"==e.tag&&!r&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Tooltip.default,{enable:E()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":E()>=25,"data-toolbar-add-open":"above"==l,onClick:e=>k(e,"above"),"aria-hidden":"true",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})}),jsxRuntime.jsx(Tooltip.default,{enable:E()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":E()>=25,"data-toolbar-add-open":"below"==l,onClick:e=>k(e,"below"),"aria-hidden":"true",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})})]}),constant.ableGenerateContentElements.includes(e.tag)&&jsxRuntime.jsx(AIGenContentLoading.AIGenContentLoading,{...e}),jsxRuntime.jsx(Resize.default,{...e})]})};var ComponentToolbarPreview$1=react.memo(ComponentToolbarPreview);exports.default=ComponentToolbarPreview$1;
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
+ var PageContext = require('../contexts/PageContext.js');
10
+ var CreateThemeSection = require('./theme-section/CreateThemeSection.js');
11
+ var Tooltip = require('./toolbar/Tooltip.js');
12
+ var ThemeSectionStatus = require('./theme-section/ThemeSectionStatus.js');
13
+ var Resize = require('./resize/Resize.js');
14
+ var useToolbarPostPurchase = require('../hooks/useToolbarPostPurchase.js');
15
+ var constant = require('./constant.js');
16
+ var AIContentGenerator = require('./ai-generator/AIContentGenerator.js');
17
+ var AIGenContentLoading = require('./ai-generator/AIGenContentLoading.js');
18
+ var InteractionSuffix = require('./InteractionSuffix.js');
19
+ require('swr');
20
+ require('../helpers/convert.js');
21
+ var ShopContext = require('../contexts/ShopContext.js');
22
+ require('@gem-sdk/adapter-shopify');
23
+ require('swr/mutation');
24
+ require('swr/infinite');
25
+ require('vanilla-lazyload');
26
+ require('../hooks/useCartUI.js');
27
+
28
+ const SECTION_LIMIT = 25;
29
+ const notVisible = (el)=>{
30
+ const overflow = getComputedStyle(el).overflow;
31
+ return overflow !== 'visible';
32
+ };
33
+ const isSection = (el)=>{
34
+ const tag = el.getAttribute('data-component-tag');
35
+ return tag === 'Section';
36
+ };
37
+ const ComponentToolbarPreview = (props)=>{
38
+ const isThemeSection = props.isThemeSection;
39
+ const isShopifySection = !!props.isShopifySection;
40
+ const storefrontUrl = ShopContext.useShopStore((s)=>s.storefrontUrl);
41
+ const editingPageType = ShopContext.useShopStore((s)=>s.pageType);
42
+ const getParents = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getParents);
43
+ const root = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getItem('ROOT'));
44
+ const isThemeSectionEditor = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
45
+ const [activeAddSection, setActiveAddSection] = react.useState(null);
46
+ const [isShowParent, setIsShowParent] = react.useState(false);
47
+ const [isShowParentRevert, setIsShowParentRevert] = react.useState(false);
48
+ const [parents, setParents] = react.useState([]);
49
+ const [deleteTooltipPosition, setDeleteTooltipPosition] = react.useState('top');
50
+ const [isDisableDeleteInSaleFunelPage, setIsDisableDeleteInSaleFunelPage] = react.useState(false);
51
+ const [isActiveToolbarComponent, setIsActiveToolbarComponent] = react.useState(false);
52
+ const [productId, setProductId] = react.useState('');
53
+ const [articleUid, setArticleUid] = react.useState('');
54
+ const [tooltipText, setTooltipText] = react.useState({
55
+ width: '',
56
+ text: ''
57
+ });
58
+ const [isDisableDuplicateInSaleFunnelPage, setIsDisableDuplicateInSaleFunnelPage] = react.useState(false);
59
+ const interactionData = PageContext.usePageStore((s)=>s.interactionData);
60
+ const isSaleFunnelPage = react.useMemo(()=>editingPageType === 'POST_PURCHASE', [
61
+ editingPageType
62
+ ]);
63
+ const { checkDisableDelete, getTooltipText, checkDisableDuplicate } = useToolbarPostPurchase.usePostPurchase(props.uid, props.tag || '');
64
+ const editProductElementList = [
65
+ 'ProductTitle',
66
+ 'ProductDescription',
67
+ 'ProductPrice'
68
+ ];
69
+ const editArticleElementList = [
70
+ 'ArticleTitle',
71
+ 'ArticleContent',
72
+ 'ArticleImage',
73
+ 'ArticleAuthor',
74
+ 'ArticleCategory',
75
+ 'ArticleDate',
76
+ 'ArticleExcerpt',
77
+ 'ArticleTags'
78
+ ];
79
+ const editAbleElementList = [
80
+ ...editProductElementList,
81
+ ...editArticleElementList
82
+ ];
83
+ const isOverToolbarPosition = (el, parent)=>{
84
+ const parentLength = parents.length;
85
+ const rect = el.getBoundingClientRect();
86
+ const rectP = parent.getBoundingClientRect();
87
+ // 36px = toolbar active height + 4 spaces
88
+ return rect.top - rectP.top < parentLength * 36;
89
+ };
90
+ const findOverflowParent = (element, initEl)=>{
91
+ const thisEl = element;
92
+ const origEl = initEl || thisEl;
93
+ if (!thisEl) return;
94
+ if (isSection(thisEl)) return;
95
+ if (notVisible(thisEl) && isOverToolbarPosition(initEl, thisEl)) return thisEl;
96
+ if (thisEl.parentElement) {
97
+ return findOverflowParent(thisEl.parentElement, origEl);
98
+ } else {
99
+ return;
100
+ }
101
+ };
102
+ const getSectionNumber = ()=>{
103
+ return root?.childrens?.length || 0;
104
+ };
105
+ const getDeleteTooltipPosition = react.useCallback(()=>{
106
+ if (props.tag == 'Section') return 'bottom';
107
+ const $toolbar = document.body.querySelector('#storefront')?.querySelector('[data-toolbar-active="true"]');
108
+ if ($toolbar) {
109
+ const rect = $toolbar.getBoundingClientRect();
110
+ if (rect.top < 60) setDeleteTooltipPosition('bottom');
111
+ else setDeleteTooltipPosition('top');
112
+ }
113
+ }, [
114
+ props.tag
115
+ ]);
116
+ const shopName = react.useMemo(()=>{
117
+ const pattern = /^(?:https?:\/\/)?([^/]+)\.myshopify\.com/;
118
+ if (storefrontUrl) {
119
+ return storefrontUrl.match(pattern)?.[1];
120
+ }
121
+ return '';
122
+ }, [
123
+ storefrontUrl
124
+ ]);
125
+ const linkShopDefault = react.useMemo(()=>{
126
+ return `https://admin.shopify.com/store/${shopName}`;
127
+ }, [
128
+ shopName
129
+ ]);
130
+ const linkEditProduct = react.useMemo(()=>{
131
+ return productId ? `${linkShopDefault}/products/${productId}` : '';
132
+ }, [
133
+ linkShopDefault,
134
+ productId
135
+ ]);
136
+ const linkEditArticle = react.useMemo(()=>{
137
+ return articleUid ? `${linkShopDefault}/articles/${articleUid}` : '';
138
+ }, [
139
+ articleUid,
140
+ linkShopDefault
141
+ ]);
142
+ const isSelectOnPage = react.useMemo(()=>interactionData?.isSelectOnPage, [
143
+ interactionData?.isSelectOnPage
144
+ ]);
145
+ const settingType = react.useMemo(()=>interactionData?.settingType, [
146
+ interactionData?.settingType
147
+ ]);
148
+ const isShowIconInteractionTarget = react.useMemo(()=>{
149
+ return interactionData?.item?.targets?.find((t)=>t.uid === props.uid && t?.type !== 'PAGE') && settingType === 'TARGET';
150
+ }, [
151
+ interactionData?.item?.targets,
152
+ props.uid,
153
+ settingType
154
+ ]);
155
+ const isShowIconInteractionTrigger = react.useMemo(()=>{
156
+ return interactionData?.item?.self?.uid === props.uid && interactionData?.item?.self.type !== 'PAGE' && settingType === 'TRIGGER';
157
+ }, [
158
+ interactionData?.item?.self?.type,
159
+ interactionData?.item?.self?.uid,
160
+ props.uid,
161
+ settingType
162
+ ]);
163
+ const isDisplayIconDrag = react.useMemo(()=>{
164
+ return !isShowIconInteractionTarget && !isShowIconInteractionTrigger;
165
+ }, [
166
+ isShowIconInteractionTarget,
167
+ isShowIconInteractionTrigger
168
+ ]);
169
+ const isDisableDelete = react.useMemo(()=>{
170
+ return isDisableDeleteInSaleFunelPage || isShopifySection;
171
+ }, [
172
+ isDisableDeleteInSaleFunelPage,
173
+ isShopifySection
174
+ ]);
175
+ const isDisableDuplicate = react.useMemo(()=>{
176
+ return isDisableDuplicateInSaleFunnelPage || isShopifySection || getSectionNumber() > SECTION_LIMIT && props.tag === 'Section';
177
+ }, [
178
+ getSectionNumber,
179
+ isDisableDuplicateInSaleFunnelPage,
180
+ isShopifySection,
181
+ props.tag
182
+ ]);
183
+ // Get parents
184
+ const onActiveComponent = react.useCallback((e)=>{
185
+ const detail = e.detail;
186
+ if (detail?.articleId) {
187
+ setArticleUid(detail.articleId);
188
+ }
189
+ if (detail?.productId) {
190
+ setProductId(detail.productId);
191
+ }
192
+ if (detail?.componentUid == props.uid) {
193
+ setIsActiveToolbarComponent(true);
194
+ getDeleteTooltipPosition();
195
+ if (isSaleFunnelPage) {
196
+ setIsDisableDeleteInSaleFunelPage(checkDisableDelete());
197
+ setTooltipText(getTooltipText());
198
+ setIsDisableDuplicateInSaleFunnelPage(checkDisableDuplicate());
199
+ }
200
+ const currentParents = getParents(props.uid).filter((parent)=>{
201
+ if (parent.uid === 'ROOT') return false;
202
+ if (parent.tag === 'Section' && isThemeSectionEditor) return false;
203
+ if (parent.editorConfigs?.toolbar?.hide) return false;
204
+ if (parent.editorConfigs?.component?.noSetting) return false;
205
+ return true;
206
+ }).slice(0, 3);
207
+ setParents(currentParents);
208
+ } else {
209
+ setIsActiveToolbarComponent(false);
210
+ setParents([]);
211
+ setIsShowParent(false);
212
+ }
213
+ }, [
214
+ props.uid,
215
+ isSaleFunnelPage,
216
+ getParents,
217
+ checkDisableDelete,
218
+ getTooltipText,
219
+ checkDisableDuplicate,
220
+ isThemeSectionEditor,
221
+ getDeleteTooltipPosition
222
+ ]);
223
+ react.useEffect(()=>{
224
+ window.addEventListener('editor:active-component', onActiveComponent);
225
+ return ()=>{
226
+ window.removeEventListener('editor:active-component', onActiveComponent);
227
+ };
228
+ }, [
229
+ onActiveComponent
230
+ ]);
231
+ // End get parents
232
+ if (props.type === 'section') {
233
+ return null;
234
+ }
235
+ if (props.editorConfigs?.toolbar?.hide) {
236
+ return null;
237
+ }
238
+ const getIndexSection = ()=>{
239
+ if (props.tag !== 'Section') {
240
+ return -1;
241
+ }
242
+ if (root?.childrens?.length) {
243
+ return root.childrens.findIndex((sectionUid)=>sectionUid == props.uid);
244
+ }
245
+ return -1;
246
+ };
247
+ const onShowParent = (e)=>{
248
+ if (!parents.length) return;
249
+ const $target = (e?.target) || null;
250
+ const $toolbar = $target.closest('[data-toolbar-active]');
251
+ if (!$target || !$toolbar) return;
252
+ if (isShowParent) {
253
+ setIsShowParentRevert(false);
254
+ setIsShowParent(false);
255
+ } else {
256
+ const $parentOverflow = findOverflowParent($toolbar, $toolbar);
257
+ if ($parentOverflow) {
258
+ setIsShowParentRevert(true);
259
+ } else {
260
+ const rect = $toolbar.getBoundingClientRect();
261
+ if (rect.top < parents.length * 36) {
262
+ setIsShowParentRevert(true);
263
+ } else {
264
+ setIsShowParentRevert(false);
265
+ }
266
+ }
267
+ setIsShowParent(true);
268
+ }
269
+ const event = new CustomEvent('editor:toolbar:show-parents', {
270
+ bubbles: true,
271
+ detail: {
272
+ value: !isShowParent
273
+ }
274
+ });
275
+ window.dispatchEvent(event);
276
+ };
277
+ const goToShopifyEditLink = ()=>{
278
+ if (editArticleElementList.includes(props.tag)) {
279
+ window.open(linkEditArticle, '_blank');
280
+ return;
281
+ }
282
+ if (editProductElementList.includes(props.tag)) {
283
+ window.open(linkEditProduct, '_blank');
284
+ return;
285
+ }
286
+ window.open(linkShopDefault, '_blank');
287
+ };
288
+ const onDelete = (e)=>{
289
+ e.preventDefault();
290
+ e.stopPropagation();
291
+ const event = new CustomEvent('editor:toolbar:delete-component', {
292
+ bubbles: true,
293
+ detail: {
294
+ componentUid: props.uid,
295
+ isThemeSection,
296
+ isShopifySection
297
+ }
298
+ });
299
+ window.dispatchEvent(event);
300
+ return false;
301
+ };
302
+ const onDuplicate = (e)=>{
303
+ e.preventDefault();
304
+ e.stopPropagation();
305
+ const event = new CustomEvent('editor:toolbar:duplicate-component', {
306
+ bubbles: true,
307
+ detail: {
308
+ componentUid: props.uid,
309
+ isThemeSection,
310
+ isShopifySection
311
+ }
312
+ });
313
+ window.dispatchEvent(event);
314
+ return false;
315
+ };
316
+ const toolbarName = ()=>{
317
+ return props.customLabel || props.label;
318
+ };
319
+ const onZoomOut = (e)=>{
320
+ e.preventDefault();
321
+ e.stopPropagation();
322
+ const event = new CustomEvent('editor:toolbar:zoom-out-component', {
323
+ bubbles: true,
324
+ detail: {
325
+ componentUid: props.uid
326
+ }
327
+ });
328
+ window.dispatchEvent(event);
329
+ return false;
330
+ };
331
+ const closeAddSection = ()=>{
332
+ setActiveAddSection(null);
333
+ window.removeEventListener('editor:close-add-section-popup', closeAddSection);
334
+ };
335
+ const onAddSection = (e, position)=>{
336
+ e.preventDefault();
337
+ e.stopPropagation();
338
+ if (getSectionNumber() >= SECTION_LIMIT) {
339
+ return false;
340
+ }
341
+ const $target = e.target;
342
+ if ($target) {
343
+ setActiveAddSection(position);
344
+ const rect = $target.getBoundingClientRect();
345
+ const event = new CustomEvent('editor:toolbar:add-section', {
346
+ bubbles: true,
347
+ detail: {
348
+ componentUid: props.uid,
349
+ position,
350
+ top: rect.top + rect.height / 2
351
+ }
352
+ });
353
+ window.dispatchEvent(event);
354
+ window.addEventListener('editor:close-add-section-popup', closeAddSection);
355
+ }
356
+ return false;
357
+ };
358
+ const getSectionName = ()=>{
359
+ if (isShopifySection) {
360
+ return props.name?.includes('Shopify section:') ? props.name : `Shopify section: ${props.name}`;
361
+ }
362
+ const checkRenamedSection = props.name && props.name === `Section ${props.uid}`;
363
+ if (getSectionNumber() >= SECTION_LIMIT - 5) {
364
+ return `${checkRenamedSection ? 'Section' : props?.name} ${getIndexSection() + 1}/${SECTION_LIMIT}`;
365
+ }
366
+ return checkRenamedSection ? `Section ${getIndexSection() + 1}` : props?.name;
367
+ };
368
+ const isEnableCreateThemeSection = ()=>{
369
+ return editingPageType !== 'STATIC' && editingPageType !== 'POST_PURCHASE';
370
+ };
371
+ const isEnableAIContent = ()=>{
372
+ const { isShopifySection, tag } = props;
373
+ if (isShopifySection || isThemeSection && !isThemeSectionEditor) return false;
374
+ return constant.ableGenerateContentElements.includes(tag);
375
+ };
376
+ // if (!isActive) return null;
377
+ return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
378
+ children: [
379
+ !(props.tag == 'Section' && isThemeSectionEditor) && /*#__PURE__*/ jsxRuntime.jsxs("div", {
380
+ "data-toolbar": true,
381
+ "data-toolbar-section": props.tag == 'Section',
382
+ "data-toolbar-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor,
383
+ "data-toolbar-shopify-section": props.tag == 'Section' && !!isShopifySection,
384
+ "data-toolbar-limit": getIndexSection() >= SECTION_LIMIT,
385
+ children: [
386
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
387
+ "data-toolbar-show-parent": true,
388
+ onClick: (e)=>onShowParent(e),
389
+ "aria-hidden": "true",
390
+ children: [
391
+ isShowIconInteractionTrigger && /*#__PURE__*/ jsxRuntime.jsx("div", {
392
+ className: "gp-hidden gp-w-[12px] interaction-use-custom-element",
393
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
394
+ width: "12",
395
+ height: "13",
396
+ viewBox: "0 0 12 13",
397
+ fill: "none",
398
+ xmlns: "http://www.w3.org/2000/svg",
399
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
400
+ fillRule: "evenodd",
401
+ clipRule: "evenodd",
402
+ d: "M4.36799 0.430523C4.51596 0.205675 4.76709 0.0703125 5.03626 0.0703125H9.88576C10.2042 0.0703125 10.395 0.424378 10.2198 0.69034L8.36968 3.4992C8.28209 3.63218 8.37747 3.80922 8.53671 3.80922H10.749C11.1111 3.80922 11.2869 4.25204 11.0233 4.50036L3.03971 12.0217C2.7572 12.2878 2.29932 12.0361 2.37262 11.655L3.27994 6.93698C3.30366 6.81364 3.20915 6.69921 3.08354 6.69921H0.984651C0.66625 6.69921 0.475479 6.34529 0.650515 6.07932L4.36799 0.430523Z",
403
+ fill: "#F9F9F9"
404
+ })
405
+ })
406
+ }),
407
+ isShowIconInteractionTarget && /*#__PURE__*/ jsxRuntime.jsx("div", {
408
+ className: "gp-hidden gp-w-[14px] interaction-use-custom-element",
409
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
410
+ width: "16",
411
+ height: "16",
412
+ viewBox: "0 0 16 16",
413
+ fill: "none",
414
+ xmlns: "http://www.w3.org/2000/svg",
415
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
416
+ fillRule: "evenodd",
417
+ clipRule: "evenodd",
418
+ d: "M7.32785 3.66159C7.87459 3.58351 8.25451 3.077 8.17643 2.53026C8.09836 1.98353 7.59184 1.6036 7.0451 1.68168C3.92866 2.12673 1.5332 4.80488 1.5332 8.04424C1.5332 11.594 4.41085 14.4716 7.9606 14.4716C11.1706 14.4716 13.8294 12.1194 14.3105 9.04446C14.3959 8.49881 14.0227 7.98727 13.4771 7.9019C12.9314 7.81654 12.4199 8.18967 12.3345 8.73531C12.0034 10.852 10.1702 12.4716 7.9606 12.4716C5.51541 12.4716 3.5332 10.4894 3.5332 8.04424C3.5332 5.81431 5.18273 3.96793 7.32785 3.66159ZM10.3432 1.97548C10.6232 1.69551 11.102 1.83654 11.1855 2.22355L11.6106 4.19339C11.6313 4.28936 11.7063 4.36432 11.8023 4.38503L13.7721 4.81013C14.1591 4.89365 14.3001 5.37247 14.0202 5.65243L12.3432 7.32945C12.1244 7.54819 11.8168 7.65338 11.5099 7.61436L10.1528 7.44178C9.84592 7.40276 9.53827 7.50795 9.31953 7.72669L8.66719 8.37903C8.35477 8.69145 7.86633 8.70954 7.57623 8.41943C7.28613 8.12933 7.30421 7.64089 7.61663 7.32847L8.26898 6.67613C8.48771 6.45739 8.5929 6.14974 8.55388 5.84287L8.38131 4.48575C8.34228 4.17888 8.44748 3.87123 8.66621 3.6525L10.3432 1.97548ZM8.19853 5.1916C8.35319 5.72179 8.04877 6.27697 7.51858 6.43163C6.83078 6.63226 6.32988 7.2683 6.32988 8.01873C6.32988 8.9316 7.06991 9.67164 7.98279 9.67164C8.73014 9.67164 9.36406 9.17486 9.56743 8.49131C9.72492 7.96195 10.2817 7.6605 10.8111 7.81799C11.3404 7.97548 11.6419 8.53227 11.4844 9.06163C11.0356 10.57 9.63916 11.6716 7.98279 11.6716C5.96535 11.6716 4.32988 10.0362 4.32988 8.01873C4.32988 6.35558 5.44054 4.95445 6.95851 4.51165C7.4887 4.35699 8.04387 4.66141 8.19853 5.1916Z",
419
+ fill: "#F9F9F9"
420
+ })
421
+ })
422
+ }),
423
+ isActiveToolbarComponent && isDisplayIconDrag && /*#__PURE__*/ jsxRuntime.jsx("div", {
424
+ "data-toolbar-icon-drag": true,
425
+ children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
426
+ width: "16",
427
+ height: "16",
428
+ viewBox: "0 0 16 16",
429
+ fill: "none",
430
+ children: [
431
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
432
+ d: "M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",
433
+ fill: "currentColor"
434
+ }),
435
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
436
+ d: "M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",
437
+ fill: "currentColor"
438
+ }),
439
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
440
+ d: "M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",
441
+ fill: "currentColor"
442
+ }),
443
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
444
+ d: "M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",
445
+ fill: "currentColor"
446
+ }),
447
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
448
+ d: "M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",
449
+ fill: "currentColor"
450
+ }),
451
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
452
+ d: "M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",
453
+ fill: "currentColor"
454
+ })
455
+ ]
456
+ })
457
+ }),
458
+ props.tag == 'Section' ? /*#__PURE__*/ jsxRuntime.jsxs("div", {
459
+ "data-toolbar-name": true,
460
+ children: [
461
+ getSectionName(),
462
+ isActiveToolbarComponent && isShopifySection && !props.isShopifyVisibility && /*#__PURE__*/ jsxRuntime.jsxs("svg", {
463
+ "data-toolbar-visibility": true,
464
+ width: "20",
465
+ height: "20",
466
+ viewBox: "0 0 20 20",
467
+ fill: "none",
468
+ xmlns: "http://www.w3.org/2000/svg",
469
+ children: [
470
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
471
+ fillRule: "evenodd",
472
+ clipRule: "evenodd",
473
+ d: "M13.1252 9.99773C13.1243 8.27226 11.7248 6.87423 9.99935 6.87506C8.27386 6.87561 6.87518 8.27455 6.87518 10.0001C6.87518 11.7259 8.27429 13.1251 10.0002 13.1251C11.7257 13.1251 13.125 11.727 13.1252 10.0011V9.99773ZM9.99985 8.12506C11.035 8.12451 11.8746 8.96322 11.8752 9.99839V10.0004C11.8752 11.0357 11.0359 11.8751 10.0002 11.8751C8.96465 11.8751 8.12518 11.0356 8.12518 10.0001C8.12518 8.96472 8.96451 8.12533 9.99985 8.12506Z",
474
+ fill: "#F9F9F9"
475
+ }),
476
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
477
+ fillRule: "evenodd",
478
+ clipRule: "evenodd",
479
+ d: "M9.99885 4.37593C5.66421 4.37604 2.80603 7.64523 1.79548 9.00983C1.35636 9.60279 1.35918 10.4 1.80012 10.9902C2.81706 12.3514 5.69374 15.6241 9.99886 15.6241C14.3806 15.6241 17.2194 12.3452 18.2168 10.9808C18.6473 10.392 18.6442 9.60472 18.211 9.01902C17.2056 7.65938 14.3429 4.37583 9.99885 4.37593ZM2.80002 9.75374C3.77049 8.44326 6.30207 5.62602 9.99888 5.62593C13.7041 5.62585 16.24 8.45598 17.206 9.76225C17.3146 9.9091 17.3149 10.0965 17.2077 10.2431C16.254 11.5477 13.7416 14.3741 9.99886 14.3741C6.33149 14.3741 3.78173 11.5541 2.80152 10.242C2.69021 10.0931 2.69001 9.90229 2.80002 9.75374Z",
480
+ fill: "#F9F9F9"
481
+ }),
482
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
483
+ fillRule: "evenodd",
484
+ clipRule: "evenodd",
485
+ d: "M18.0763 3.26988C18.3415 3.58809 18.2985 4.06101 17.9803 4.32619L2.98032 16.8262C2.66211 17.0914 2.18919 17.0484 1.92402 16.7302C1.65884 16.412 1.70184 15.939 2.02004 15.6739L17.02 3.17385C17.3383 2.90868 17.8112 2.95167 18.0763 3.26988Z",
486
+ fill: "#F9F9F9"
487
+ })
488
+ ]
489
+ })
490
+ ]
491
+ }) : /*#__PURE__*/ jsxRuntime.jsx("div", {
492
+ "data-toolbar-name": true,
493
+ children: toolbarName()
494
+ }),
495
+ isActiveToolbarComponent && props.tag !== 'Section' && parents.length > 0 && /*#__PURE__*/ jsxRuntime.jsx("div", {
496
+ "data-toolbar-icon-parent": true,
497
+ "data-toolbar-icon-parent-open": isShowParent,
498
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
499
+ width: "16",
500
+ height: "16",
501
+ viewBox: "0 0 16 16",
502
+ fill: "none",
503
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
504
+ d: "M5.65522 10C5.07265 10 4.7809 9.22865 5.19284 8.77753L7.53762 6.20974C7.79298 5.93009 8.20702 5.93009 8.46238 6.20974L10.8072 8.77754C11.2191 9.22866 10.9274 10 10.3448 10H5.65522Z",
505
+ fill: "currentColor"
506
+ })
507
+ })
508
+ })
509
+ ]
510
+ }),
511
+ isActiveToolbarComponent && isShowParent && parents.map((parent, index)=>{
512
+ // Update count columns of Row
513
+ const parentLength = parent?.childrens?.length ?? 0;
514
+ let parent_label = parent.label;
515
+ if (parent.label === 'Row') {
516
+ parent_label = parentLength <= 1 ? parent.label + ' ' + parentLength + ' col' : parent.label + ' ' + parentLength + ' cols';
517
+ }
518
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
519
+ "data-toolbar-parent": true,
520
+ "data-component-tag": parent.tag,
521
+ "data-parent-uid": parent.uid,
522
+ "data-toolbar-theme-section": isThemeSectionEditor,
523
+ "data-toolbar-parent-revert": isShowParentRevert,
524
+ style: {
525
+ top: !isShowParentRevert ? `${-36 * (index + 1)}px` // 32 height + 4 spacing
526
+ : `${36 * (index + 1)}px`
527
+ },
528
+ children: [
529
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
530
+ "data-toolbar-icon-drag": true,
531
+ children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
532
+ width: "16",
533
+ height: "16",
534
+ viewBox: "0 0 16 16",
535
+ fill: "none",
536
+ children: [
537
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
538
+ d: "M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",
539
+ fill: "currentColor"
540
+ }),
541
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
542
+ d: "M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",
543
+ fill: "currentColor"
544
+ }),
545
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
546
+ d: "M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",
547
+ fill: "currentColor"
548
+ }),
549
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
550
+ d: "M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",
551
+ fill: "currentColor"
552
+ }),
553
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
554
+ d: "M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",
555
+ fill: "currentColor"
556
+ }),
557
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
558
+ d: "M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",
559
+ fill: "currentColor"
560
+ })
561
+ ]
562
+ })
563
+ }),
564
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
565
+ "data-toolbar-name": true,
566
+ children: parent_label
567
+ })
568
+ ]
569
+ }, parent.uid);
570
+ }),
571
+ isActiveToolbarComponent && !isSelectOnPage && /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
572
+ children: [
573
+ ' ',
574
+ props.tag === 'Section' && !props.isThemeSection && isEnableCreateThemeSection() && !props.isShopifySection && getIndexSection() < SECTION_LIMIT && /*#__PURE__*/ jsxRuntime.jsx(CreateThemeSection.CreateThemeSection, {
575
+ ...props
576
+ }),
577
+ isEnableAIContent() && /*#__PURE__*/ jsxRuntime.jsx(AIContentGenerator.AIContentGenerator, {
578
+ ...props
579
+ }),
580
+ props.tag == 'Sticky' && /*#__PURE__*/ jsxRuntime.jsx("div", {
581
+ "data-toolbar-zoom-out": true,
582
+ onClick: (e)=>onZoomOut(e),
583
+ "aria-hidden": "true",
584
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
585
+ width: "16",
586
+ height: "16",
587
+ viewBox: "0 0 16 16",
588
+ fill: "none",
589
+ xmlns: "http://www.w3.org/2000/svg",
590
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
591
+ fillRule: "evenodd",
592
+ clipRule: "evenodd",
593
+ d: "M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",
594
+ fill: "currentColor"
595
+ })
596
+ })
597
+ }),
598
+ editAbleElementList.includes(props.tag) && /*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
599
+ "data-toolbar-title": true,
600
+ enable: true,
601
+ "data-toolbar-disable": false,
602
+ text: "Edit content in Shopify",
603
+ position: "top",
604
+ onClick: goToShopifyEditLink,
605
+ "aria-hidden": "true",
606
+ children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
607
+ width: "16",
608
+ height: "16",
609
+ viewBox: "0 0 16 16",
610
+ fill: "none",
611
+ xmlns: "http://www.w3.org/2000/svg",
612
+ children: [
613
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
614
+ fillRule: "evenodd",
615
+ clipRule: "evenodd",
616
+ d: "M8.61129 2.47348C8.61129 2.47348 8.47099 2.51557 8.23248 2.59274C8.19039 2.46647 8.13427 2.30512 8.05009 2.15079C7.78352 1.6387 7.39068 1.37212 6.91366 1.36511C6.87858 1.36511 6.85052 1.36511 6.81545 1.37212C6.80843 1.36511 6.80142 1.35634 6.7944 1.34757C6.78739 1.3388 6.78037 1.33003 6.77336 1.32302C6.56992 1.09854 6.30335 0.993314 5.98768 1.00033C5.37737 1.02137 4.76706 1.46332 4.269 2.249C3.91825 2.80319 3.65869 3.49767 3.58153 4.03082C3.38823 4.09074 3.21092 4.14586 3.05516 4.19429C2.64595 4.32151 2.3851 4.40261 2.37494 4.40261C2.01718 4.51485 2.01016 4.52888 1.96106 4.85859C1.92598 5.11113 1 12.2945 1 12.2945L7.14764 13.3583C7.18955 13.118 7.30454 12.8953 7.47848 12.7214L8.70249 11.4974V2.45945C8.66741 2.45945 8.63234 2.46647 8.61129 2.47348ZM6.82948 3.02767L6.62554 3.09101C6.27515 3.19989 5.90094 3.31617 5.5317 3.42752C5.65797 2.94349 5.89648 2.46647 6.19111 2.15079C6.30335 2.03154 6.45067 1.90527 6.63306 1.8281C6.80142 2.18587 6.83649 2.68393 6.82948 3.02767ZM5.99469 1.4072C6.13499 1.4072 6.26126 1.43526 6.36649 1.50541C6.19813 1.58959 6.0438 1.71586 5.88947 1.87721C5.50364 2.29109 5.202 2.94349 5.08274 3.56783C4.74459 3.66991 4.41804 3.77199 4.10838 3.8688L4.01646 3.89753C4.22691 2.90841 5.05468 1.43526 5.99469 1.4072ZM4.80214 7.0122C4.81874 7.26957 5.09737 7.44833 5.43473 7.66478C5.95252 7.99699 6.60867 8.41798 6.66813 9.3482C6.7453 10.5548 6.02977 11.3826 4.99154 11.4457C3.7569 11.5229 3.06943 10.7933 3.06943 10.7933L3.32899 9.67791C3.32899 9.67791 4.01646 10.197 4.56363 10.1619C4.92139 10.1409 5.04767 9.84627 5.04065 9.64283C5.01607 9.26796 4.73308 9.06671 4.41569 8.84101C4.00848 8.55142 3.54465 8.22157 3.49735 7.4331C3.42018 6.24756 4.19885 5.05501 5.91051 4.94277C6.57694 4.90068 6.91366 5.06904 6.91366 5.06904L6.52082 6.53518C6.52082 6.53518 6.08589 6.33876 5.56678 6.36682C4.80915 6.41592 4.79512 6.89294 4.80214 7.0122ZM7.23635 2.9014C7.22934 2.59274 7.19426 2.15781 7.04695 1.78601C7.50994 1.87721 7.74143 2.39632 7.83964 2.71199C7.70008 2.75665 7.54275 2.80575 7.37118 2.8593L7.23635 2.9014Z",
617
+ fill: "currentColor"
618
+ }),
619
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
620
+ d: "M10.7719 3.44156C10.7757 3.47543 11.1733 6.16931 11.541 8.65883L8.95503 11.2448V2.57871C9.16548 2.78214 9.71265 3.31528 9.71265 3.31528C9.71265 3.31528 10.6106 3.32931 10.6597 3.33633C10.7088 3.34334 10.7649 3.37842 10.7719 3.44156Z",
621
+ fill: "currentColor"
622
+ }),
623
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
624
+ d: "M14.8056 8.644L14.0424 7.88088C13.7832 7.62163 13.3629 7.62163 13.1036 7.88088L12.1519 8.83258L13.8539 10.5345L14.8056 9.58282C15.0648 9.32357 15.0648 8.90325 14.8056 8.644Z",
625
+ fill: "currentColor"
626
+ }),
627
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
628
+ d: "M7.85018 13.0942L11.6419 9.30246L13.3438 11.0044L9.55212 14.7961C9.43782 14.9104 9.28573 14.9791 9.1244 14.9892L7.93427 15.0641C7.73484 15.0767 7.56961 14.9114 7.58216 14.712L7.65706 13.5219C7.66721 13.3606 7.73588 13.2085 7.85018 13.0942Z",
629
+ fill: "currentColor"
630
+ })
631
+ ]
632
+ })
633
+ }),
634
+ /*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
635
+ enable: props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT || isShopifySection,
636
+ text: isShopifySection ? 'Disabled. Please edit in Shopify Editor' : 'Page has reached Shopify’s 25 section-limit',
637
+ position: "bottom",
638
+ width: "200px",
639
+ "data-toolbar-duplicate": true,
640
+ "data-toolbar-disable": isDisableDuplicate,
641
+ onClick: isDisableDuplicate ? undefined : (e)=>onDuplicate(e),
642
+ "aria-hidden": "true",
643
+ className: isDisableDuplicate ? '!gp-cursor-not-allowed' : '',
644
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
645
+ width: "16",
646
+ height: "16",
647
+ viewBox: "0 0 16 16",
648
+ fill: "none",
649
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
650
+ fillRule: "evenodd",
651
+ clipRule: "evenodd",
652
+ d: "M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",
653
+ fill: "currentColor"
654
+ })
655
+ })
656
+ }),
657
+ /*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
658
+ "data-toolbar-delete": true,
659
+ onClick: (e)=>isDisableDelete ? null : onDelete(e),
660
+ enable: isDisableDelete,
661
+ "data-toolbar-disable": isDisableDelete,
662
+ text: isShopifySection ? 'Disabled. Please edit in Shopify Editor' : tooltipText.text,
663
+ width: tooltipText.width,
664
+ position: isShopifySection ? 'bottom' : deleteTooltipPosition,
665
+ "aria-hidden": "true",
666
+ className: isDisableDelete ? '!gp-cursor-not-allowed' : '',
667
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
668
+ width: "16",
669
+ height: "16",
670
+ viewBox: "0 0 16 16",
671
+ fill: "none",
672
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
673
+ fillRule: "evenodd",
674
+ clipRule: "evenodd",
675
+ d: "M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",
676
+ fill: "currentColor"
677
+ })
678
+ })
679
+ })
680
+ ]
681
+ }),
682
+ /*#__PURE__*/ jsxRuntime.jsx(InteractionSuffix.InteractionSuffix, {
683
+ uid: props.uid
684
+ })
685
+ ]
686
+ }, props.uid),
687
+ isEnableCreateThemeSection() && getIndexSection() < SECTION_LIMIT && /*#__PURE__*/ jsxRuntime.jsx(ThemeSectionStatus.ThemeSectionStatusWrapper, {
688
+ ...props
689
+ }),
690
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
691
+ "data-outline": true,
692
+ "data-outline-section": props.tag == 'Section',
693
+ "data-outline-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor,
694
+ "data-outline-shopify-section": props.tag == 'Section' && !!isShopifySection,
695
+ "data-outline-limit": getIndexSection() >= SECTION_LIMIT
696
+ }, 'outline-' + props.uid),
697
+ props.tag == 'Section' && !isThemeSectionEditor && /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
698
+ children: [
699
+ /*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
700
+ enable: getSectionNumber() >= SECTION_LIMIT,
701
+ text: "Page has reached Shopify’s 25 section-limit",
702
+ position: "top",
703
+ "data-toolbar-add-top": true,
704
+ "data-toolbar-disable": getSectionNumber() >= SECTION_LIMIT,
705
+ "data-toolbar-add-open": activeAddSection == 'above',
706
+ onClick: (e)=>onAddSection(e, 'above'),
707
+ "aria-hidden": "true",
708
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
709
+ width: "16",
710
+ height: "16",
711
+ viewBox: "0 0 16 16",
712
+ fill: "none",
713
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
714
+ d: "M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",
715
+ fill: "#212121"
716
+ })
717
+ })
718
+ }),
719
+ /*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
720
+ enable: getSectionNumber() >= SECTION_LIMIT,
721
+ text: "Page has reached Shopify’s 25 section-limit",
722
+ position: "top",
723
+ "data-toolbar-add-bottom": true,
724
+ "data-toolbar-disable": getSectionNumber() >= SECTION_LIMIT,
725
+ "data-toolbar-add-open": activeAddSection == 'below',
726
+ onClick: (e)=>onAddSection(e, 'below'),
727
+ "aria-hidden": "true",
728
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
729
+ width: "16",
730
+ height: "16",
731
+ viewBox: "0 0 16 16",
732
+ fill: "none",
733
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
734
+ d: "M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",
735
+ fill: "#212121"
736
+ })
737
+ })
738
+ })
739
+ ]
740
+ }),
741
+ constant.ableGenerateContentElements.includes(props.tag) && isActiveToolbarComponent && /*#__PURE__*/ jsxRuntime.jsx(AIGenContentLoading.AIGenContentLoading, {
742
+ ...props
743
+ }),
744
+ isActiveToolbarComponent && /*#__PURE__*/ jsxRuntime.jsx(Resize.default, {
745
+ ...props
746
+ })
747
+ ]
748
+ });
749
+ };
750
+ var ComponentToolbarPreview$1 = /*#__PURE__*/ react.memo(ComponentToolbarPreview); /* gem-lint/disallow-import-from-package-path */
751
+
752
+ exports.default = ComponentToolbarPreview$1;