@gem-sdk/core 3.0.0-pre-production.15 → 3.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.
- package/README.md +1 -1
- package/dist/cjs/components/AddOn.js +2 -18
- package/dist/cjs/components/ComponentAnimation.js +2 -17
- package/dist/cjs/components/ComponentToolbarPreview.js +2 -752
- package/dist/cjs/components/ComponentWrapper.js +2 -61
- package/dist/cjs/components/ComponentWrapperPreview.js +2 -213
- package/dist/cjs/components/Empty.js +2 -7
- package/dist/cjs/components/InteractionSuffix.js +2 -42
- package/dist/cjs/components/Render.js +2 -75
- package/dist/cjs/components/Render.liquid.js +16 -307
- package/dist/cjs/components/RenderBlock.js +2 -54
- package/dist/cjs/components/RenderCustomCode.js +4 -59
- package/dist/cjs/components/RenderPreview.js +2 -67
- package/dist/cjs/components/RenderSection.js +2 -23
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +2 -252
- package/dist/cjs/components/ai-generator/AIGenContentLoading.js +2 -85
- package/dist/cjs/components/ai-generator/components/PickProduct.js +2 -220
- package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +2 -77
- package/dist/cjs/components/ai-generator/hooks/useCheckingProductInside.js +1 -47
- package/dist/cjs/components/ai-generator/hooks/useFlipPopup.js +1 -110
- package/dist/cjs/components/ai-generator/hooks/useGettingGenerateRequest.js +1 -37
- package/dist/cjs/components/ai-generator/hooks/useListenEventGenerate.js +1 -70
- package/dist/cjs/components/ai-generator/icons/AIIcon.js +2 -67
- package/dist/cjs/components/ai-generator/icons/CloseIcon.js +2 -19
- package/dist/cjs/components/ai-generator/icons/DropdownIcon.js +2 -37
- package/dist/cjs/components/ai-generator/icons/SearchIcon.js +2 -21
- package/dist/cjs/components/ai-generator/icons/ShowMoreIcon.js +2 -21
- package/dist/cjs/components/ai-generator/icons/UpgradeIcon.js +2 -27
- package/dist/cjs/components/ai-generator/icons/WarningIcon.js +2 -31
- package/dist/cjs/components/constant.js +1 -82
- package/dist/cjs/components/resize/Resize.js +2 -16
- package/dist/cjs/components/resize/Spacing.js +2 -260
- package/dist/cjs/components/src/product/helpers/variant-presets.js +1 -56
- package/dist/cjs/components/theme-section/CreateThemeSection.js +2 -123
- package/dist/cjs/components/theme-section/ThemeSectionStatus.js +2 -45
- package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +2 -126
- package/dist/cjs/components/toolbar/Tooltip.js +2 -28
- package/dist/cjs/constants/device.js +1 -0
- package/dist/cjs/contexts/AddonContext.js +2 -36
- package/dist/cjs/contexts/ArticleContext.js +2 -39
- package/dist/cjs/contexts/ArticleListContext.js +2 -31
- package/dist/cjs/contexts/BuilderComponent.js +2 -34
- package/dist/cjs/contexts/BuilderContext.js +2 -39
- package/dist/cjs/contexts/BuilderPreviewContext.js +2 -482
- package/dist/cjs/contexts/CartLineContext.js +2 -29
- package/dist/cjs/contexts/CollectionContext.js +2 -38
- package/dist/cjs/contexts/I18nContext.js +2 -0
- package/dist/cjs/contexts/ModalContext.js +2 -47
- package/dist/cjs/contexts/PageContext.js +2 -111
- package/dist/cjs/contexts/ProductContext.js +2 -182
- package/dist/cjs/contexts/ProductListContext.js +2 -32
- package/dist/cjs/contexts/SectionContext.js +2 -53
- package/dist/cjs/contexts/ShopContext.js +2 -107
- package/dist/cjs/graphql/fragments/analytic.generated.js +2 -6
- package/dist/cjs/graphql/fragments/collection-detail.generated.js +2 -6
- package/dist/cjs/graphql/fragments/collection-product.generated.js +2 -6
- package/dist/cjs/graphql/fragments/collection.generated.js +2 -6
- package/dist/cjs/graphql/fragments/custom-code.generated.js +2 -6
- package/dist/cjs/graphql/fragments/custom-font.generated.js +7 -7
- package/dist/cjs/graphql/fragments/data-seo.generated.js +2 -6
- package/dist/cjs/graphql/fragments/media.generated.js +2 -6
- package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +6 -6
- package/dist/cjs/graphql/fragments/product-little.generated.js +2 -6
- package/dist/cjs/graphql/fragments/product-option-value.generated.js +2 -6
- package/dist/cjs/graphql/fragments/product-option.generated.js +2 -6
- package/dist/cjs/graphql/fragments/product.generated.js +2 -6
- package/dist/cjs/graphql/fragments/published-custom-section.generated.js +2 -6
- package/dist/cjs/graphql/fragments/published-page-section.generated.js +2 -6
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +4 -18
- package/dist/cjs/graphql/fragments/published-theme-style.generated.js +2 -6
- package/dist/cjs/graphql/fragments/selected-option.generated.js +2 -6
- package/dist/cjs/graphql/fragments/variant.generated.js +2 -6
- package/dist/cjs/graphql/mutations/page-view-up.generated.js +2 -6
- package/dist/cjs/graphql/queries/articles.generated.js +2 -6
- package/dist/cjs/graphql/queries/blogs.generated.js +2 -6
- package/dist/cjs/graphql/queries/collection-detail-filter.generated.js +2 -16
- package/dist/cjs/graphql/queries/collection.generated.js +2 -14
- package/dist/cjs/graphql/queries/collections.generated.js +2 -9
- package/dist/cjs/graphql/queries/preview-page.generated.js +2 -12
- package/dist/cjs/graphql/queries/product-little-detail.generated.js +2 -11
- package/dist/cjs/graphql/queries/product-medias.generated.js +2 -8
- package/dist/cjs/graphql/queries/product-value-label.generated.js +2 -6
- package/dist/cjs/graphql/queries/product-variants.generated.js +3 -11
- package/dist/cjs/graphql/queries/products.generated.js +3 -17
- package/dist/cjs/graphql/queries/{published-shop-metas.js → published-shop-metas.generated.js} +2 -6
- package/dist/cjs/graphql/queries/published-theme-pages.generated.js +3 -19
- package/dist/cjs/graphql/queries/shop-shopify.generated.js +2 -6
- package/dist/cjs/graphql/queries/store-property.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/LibraryTemplate.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/SaleFunnelOffer.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/ShopLibraryPage.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/ThemePage.generated.js +2 -6
- package/dist/cjs/helpers/GlobalEvent.js +1 -19
- package/dist/cjs/helpers/align.js +1 -37
- package/dist/cjs/helpers/animations.js +1 -222
- package/dist/cjs/helpers/background.js +1 -236
- package/dist/cjs/helpers/backgroundImage.js +1 -0
- package/dist/cjs/helpers/borders.js +4 -198
- package/dist/cjs/helpers/carousel.js +1 -55
- package/dist/cjs/helpers/clone-deep.js +1 -5
- package/dist/cjs/helpers/cls.js +1 -16
- package/dist/cjs/helpers/colors.js +1 -184
- package/dist/cjs/helpers/compose-advance-style.js +1 -323
- package/dist/cjs/helpers/composeClasses.js +1 -0
- package/dist/cjs/helpers/const.js +1 -0
- package/dist/cjs/helpers/constant.js +1 -23
- package/dist/cjs/helpers/convert.js +1 -7
- package/dist/cjs/helpers/covert-entities-html.js +1 -19
- package/dist/cjs/helpers/css-variable.js +1 -7
- package/dist/cjs/helpers/email.js +1 -11
- package/dist/cjs/helpers/filter-styles.js +1 -0
- package/dist/cjs/helpers/filter-toolbar-preview.js +2 -14
- package/dist/cjs/helpers/flatten-connection.js +1 -9
- package/dist/cjs/helpers/get-resonsive-value.js +1 -36
- package/dist/cjs/helpers/get-shortname.js +1 -92
- package/dist/cjs/helpers/icon-list.js +1 -61
- package/dist/cjs/helpers/interaction/index.js +2 -134
- package/dist/cjs/helpers/is-browser.js +1 -9
- package/dist/cjs/helpers/is-defined.js +1 -7
- package/dist/cjs/helpers/is-empty-children.js +2 -15
- package/dist/cjs/helpers/is-safari.js +1 -9
- package/dist/cjs/helpers/layout.js +1 -76
- package/dist/cjs/helpers/load-script.js +1 -31
- package/dist/cjs/helpers/loop-component.js +1 -16
- package/dist/cjs/helpers/make-style.js +1 -163
- package/dist/cjs/helpers/normalize-builder-data.js +1 -23
- package/dist/cjs/helpers/pascal-to-kebab-case.js +1 -7
- package/dist/cjs/helpers/prefetch-queries.js +1 -78
- package/dist/cjs/helpers/product.js +1 -48
- package/dist/cjs/helpers/queries/get-collection.js +1 -226
- package/dist/cjs/helpers/queries/get-collections.js +1 -21
- package/dist/cjs/helpers/queries/get-product-by-slug.js +1 -125
- package/dist/cjs/helpers/queries/get-product.js +1 -154
- package/dist/cjs/helpers/queries/get-products.js +1 -214
- package/dist/cjs/helpers/query.js +1 -29
- package/dist/cjs/helpers/radius.js +6 -140
- package/dist/cjs/helpers/render.js +1 -91
- package/dist/cjs/helpers/shadow.js +1 -69
- package/dist/cjs/helpers/size.js +4 -228
- package/dist/cjs/helpers/spacing.js +1 -43
- package/dist/cjs/helpers/third-party/addAppBlockId.js +1 -20
- package/dist/cjs/helpers/third-party/appConfig.js +1 -416
- package/dist/cjs/helpers/third-party/appSetting.js +1 -1324
- package/dist/cjs/helpers/third-party/composeAppBlockId.js +1 -11
- package/dist/cjs/helpers/third-party/constant.js +1 -69
- package/dist/cjs/helpers/third-party/generateAppBlockConfigs.js +1 -34
- package/dist/cjs/helpers/third-party/getAppBlockConfig.js +1 -55
- package/dist/cjs/helpers/third-party/getAppBlockType.js +1 -12
- package/dist/cjs/helpers/third-party/getAppBlocks.js +1 -30
- package/dist/cjs/helpers/third-party/mergeBlock.js +1 -19
- package/dist/cjs/helpers/third-party/mergeBlockOrder.js +1 -47
- package/dist/cjs/helpers/third-party/removeGPAppItems.js +1 -18
- package/dist/cjs/helpers/tracking/fpixel.js +1 -28
- package/dist/cjs/helpers/tracking/gtag.js +1 -93
- package/dist/cjs/helpers/tracking/tiktokpixel.js +1 -17
- package/dist/cjs/helpers/typography.js +19 -160
- package/dist/cjs/helpers/variant.js +1 -11
- package/dist/cjs/hooks/animation/useAnimationActions.js +2 -39
- package/dist/cjs/hooks/animation/useAnimationConfig.js +2 -30
- package/dist/cjs/hooks/animation/useAnimationPreview.js +2 -31
- package/dist/cjs/hooks/animation/useAnimationTarget.js +2 -122
- package/dist/cjs/hooks/animation/useApplyAnimation.js +2 -89
- package/dist/cjs/hooks/articles/useArticlesQuery.js +2 -33
- package/dist/cjs/hooks/cart/use-add-to-cart.js +2 -20
- package/dist/cjs/hooks/cart/use-cart-data.js +2 -28
- package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +2 -20
- package/dist/cjs/hooks/cart/use-cart-note-update.js +2 -20
- package/dist/cjs/hooks/cart/use-create-cart.js +2 -22
- package/dist/cjs/hooks/cart/use-remove-cart-item.js +2 -20
- package/dist/cjs/hooks/cart/use-update-cart-item.js +2 -20
- package/dist/cjs/hooks/shop/use-collection-query.js +2 -22
- package/dist/cjs/hooks/shop/use-collections-query.js +2 -17
- package/dist/cjs/hooks/shop/use-product-query.js +2 -22
- package/dist/cjs/hooks/shop/use-products-query.js +2 -63
- package/dist/cjs/hooks/shop/useShopifyLink.js +2 -0
- package/dist/cjs/hooks/shop.js +2 -135
- package/dist/cjs/hooks/use-current-device.js +2 -30
- package/dist/cjs/hooks/use-lazy-video.js +2 -15
- package/dist/cjs/hooks/useAnimations.js +2 -29
- package/dist/cjs/hooks/useCartId.js +2 -44
- package/dist/cjs/hooks/useCartLine.js +2 -11
- package/dist/cjs/hooks/useCartUI.js +2 -48
- package/dist/cjs/hooks/useCollection.js +2 -9
- package/dist/cjs/hooks/useFetchHandle.js +2 -13
- package/dist/cjs/hooks/useFormatMoney.js +2 -75
- package/dist/cjs/hooks/useI18n.js +2 -0
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +2 -127
- package/dist/cjs/hooks/useInteraction.js +2 -19
- package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +2 -10
- package/dist/cjs/hooks/useLoadScript.js +2 -32
- package/dist/cjs/hooks/useMoney.js +2 -84
- package/dist/cjs/hooks/usePrevious.js +2 -19
- package/dist/cjs/hooks/useProduct.js +2 -250
- package/dist/cjs/hooks/useProductList.js +2 -21
- package/dist/cjs/hooks/useStickyStore.js +1 -0
- package/dist/cjs/hooks/useSuspenseFetch.js +2 -27
- package/dist/cjs/hooks/useSwatchesOptions.js +2 -41
- package/dist/cjs/hooks/useToolbarPostPurchase.js +2 -89
- package/dist/cjs/index.js +1 -425
- package/dist/cjs/types/animations.js +1 -49
- package/dist/cjs/types/appAPI.js +1 -2
- package/dist/cjs/types/custom.js +1 -52
- package/dist/cjs/types/global-style.js +1 -15
- package/dist/cjs/types/shop.js +1 -2
- package/dist/esm/components/AddOn.js +2 -14
- package/dist/esm/components/ComponentAnimation.js +2 -13
- package/dist/esm/components/ComponentToolbarPreview.js +2 -748
- package/dist/esm/components/ComponentWrapper.js +2 -57
- package/dist/esm/components/ComponentWrapperPreview.js +2 -209
- package/dist/esm/components/Empty.js +2 -3
- package/dist/esm/components/InteractionSuffix.js +2 -40
- package/dist/esm/components/Render.js +2 -71
- package/dist/esm/components/Render.liquid.js +16 -301
- package/dist/esm/components/RenderBlock.js +2 -50
- package/dist/esm/components/RenderCustomCode.js +4 -55
- package/dist/esm/components/RenderPreview.js +2 -63
- package/dist/esm/components/RenderSection.js +2 -19
- package/dist/esm/components/ai-generator/AIContentGenerator.js +2 -250
- package/dist/esm/components/ai-generator/AIGenContentLoading.js +2 -83
- package/dist/esm/components/ai-generator/components/PickProduct.js +2 -218
- package/dist/esm/components/ai-generator/components/ToneAndVoice.js +2 -75
- package/dist/esm/components/ai-generator/hooks/useCheckingProductInside.js +1 -45
- package/dist/esm/components/ai-generator/hooks/useFlipPopup.js +1 -108
- package/dist/esm/components/ai-generator/hooks/useGettingGenerateRequest.js +1 -35
- package/dist/esm/components/ai-generator/hooks/useListenEventGenerate.js +1 -68
- package/dist/esm/components/ai-generator/icons/AIIcon.js +2 -65
- package/dist/esm/components/ai-generator/icons/CloseIcon.js +2 -17
- package/dist/esm/components/ai-generator/icons/DropdownIcon.js +2 -34
- package/dist/esm/components/ai-generator/icons/SearchIcon.js +2 -19
- package/dist/esm/components/ai-generator/icons/ShowMoreIcon.js +2 -19
- package/dist/esm/components/ai-generator/icons/UpgradeIcon.js +2 -25
- package/dist/esm/components/ai-generator/icons/WarningIcon.js +2 -29
- package/dist/esm/components/constant.js +1 -75
- package/dist/esm/components/resize/Resize.js +2 -12
- package/dist/esm/components/resize/Spacing.js +2 -256
- package/dist/esm/components/src/product/helpers/variant-presets.js +1 -54
- package/dist/esm/components/theme-section/CreateThemeSection.js +2 -121
- package/dist/esm/components/theme-section/ThemeSectionStatus.js +2 -43
- package/dist/esm/components/theme-section/ThemeSectionTooltip.js +2 -124
- package/dist/esm/components/toolbar/Tooltip.js +2 -24
- package/dist/esm/constants/device.js +1 -0
- package/dist/esm/contexts/AddonContext.js +2 -32
- package/dist/esm/contexts/ArticleContext.js +2 -36
- package/dist/esm/contexts/ArticleListContext.js +2 -27
- package/dist/esm/contexts/BuilderComponent.js +2 -31
- package/dist/esm/contexts/BuilderContext.js +2 -36
- package/dist/esm/contexts/BuilderPreviewContext.js +2 -479
- package/dist/esm/contexts/CartLineContext.js +2 -26
- package/dist/esm/contexts/CollectionContext.js +2 -35
- package/dist/esm/contexts/I18nContext.js +2 -0
- package/dist/esm/contexts/ModalContext.js +2 -44
- package/dist/esm/contexts/PageContext.js +2 -108
- package/dist/esm/contexts/ProductContext.js +2 -179
- package/dist/esm/contexts/ProductListContext.js +2 -28
- package/dist/esm/contexts/SectionContext.js +2 -49
- package/dist/esm/contexts/ShopContext.js +2 -104
- package/dist/esm/graphql/fragments/analytic.generated.js +2 -4
- package/dist/esm/graphql/fragments/collection-detail.generated.js +2 -4
- package/dist/esm/graphql/fragments/collection-product.generated.js +2 -4
- package/dist/esm/graphql/fragments/collection.generated.js +2 -4
- package/dist/esm/graphql/fragments/custom-code.generated.js +2 -4
- package/dist/esm/graphql/fragments/custom-font.generated.js +7 -5
- package/dist/esm/graphql/fragments/data-seo.generated.js +2 -4
- package/dist/esm/graphql/fragments/media.generated.js +2 -4
- package/dist/esm/graphql/fragments/preview-theme-page.generated.js +6 -4
- package/dist/esm/graphql/fragments/product-little.generated.js +2 -4
- package/dist/esm/graphql/fragments/product-option-value.generated.js +2 -4
- package/dist/esm/graphql/fragments/product-option.generated.js +2 -4
- package/dist/esm/graphql/fragments/product.generated.js +2 -4
- package/dist/esm/graphql/fragments/published-custom-section.generated.js +2 -4
- package/dist/esm/graphql/fragments/published-page-section.generated.js +2 -4
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +4 -16
- package/dist/esm/graphql/fragments/published-theme-style.generated.js +2 -4
- package/dist/esm/graphql/fragments/selected-option.generated.js +2 -4
- package/dist/esm/graphql/fragments/variant.generated.js +2 -4
- package/dist/esm/graphql/mutations/page-view-up.generated.js +2 -4
- package/dist/esm/graphql/queries/articles.generated.js +2 -4
- package/dist/esm/graphql/queries/blogs.generated.js +2 -4
- package/dist/esm/graphql/queries/collection-detail-filter.generated.js +10 -22
- package/dist/esm/graphql/queries/collection.generated.js +8 -18
- package/dist/esm/graphql/queries/collections.generated.js +3 -8
- package/dist/esm/graphql/queries/preview-page.generated.js +6 -14
- package/dist/esm/graphql/queries/product-little-detail.generated.js +5 -12
- package/dist/esm/graphql/queries/product-medias.generated.js +2 -6
- package/dist/esm/graphql/queries/product-value-label.generated.js +2 -4
- package/dist/esm/graphql/queries/product-variants.generated.js +5 -11
- package/dist/esm/graphql/queries/products.generated.js +9 -20
- package/dist/esm/graphql/queries/{published-shop-metas.js → published-shop-metas.generated.js} +2 -4
- package/dist/esm/graphql/queries/published-theme-pages.generated.js +6 -20
- package/dist/esm/graphql/queries/shop-shopify.generated.js +2 -4
- package/dist/esm/graphql/queries/store-property.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/LibraryTemplate.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/SaleFunnelOffer.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/ShopLibraryPage.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/ThemePage.generated.js +2 -4
- package/dist/esm/helpers/GlobalEvent.js +1 -15
- package/dist/esm/helpers/align.js +1 -34
- package/dist/esm/helpers/animations.js +1 -220
- package/dist/esm/helpers/background.js +1 -227
- package/dist/esm/helpers/backgroundImage.js +1 -0
- package/dist/esm/helpers/borders.js +4 -189
- package/dist/esm/helpers/carousel.js +1 -51
- package/dist/esm/helpers/clone-deep.js +1 -3
- package/dist/esm/helpers/cls.js +1 -14
- package/dist/esm/helpers/colors.js +1 -169
- package/dist/esm/helpers/compose-advance-style.js +1 -315
- package/dist/esm/helpers/composeClasses.js +1 -0
- package/dist/esm/helpers/const.js +1 -0
- package/dist/esm/helpers/constant.js +1 -19
- package/dist/esm/helpers/convert.js +1 -4
- package/dist/esm/helpers/covert-entities-html.js +1 -17
- package/dist/esm/helpers/css-variable.js +1 -5
- package/dist/esm/helpers/email.js +1 -6
- package/dist/esm/helpers/filter-styles.js +1 -0
- package/dist/esm/helpers/filter-toolbar-preview.js +2 -9
- package/dist/esm/helpers/flatten-connection.js +1 -7
- package/dist/esm/helpers/get-resonsive-value.js +1 -31
- package/dist/esm/helpers/get-shortname.js +1 -90
- package/dist/esm/helpers/icon-list.js +1 -58
- package/dist/esm/helpers/interaction/index.js +2 -132
- package/dist/esm/helpers/is-browser.js +1 -5
- package/dist/esm/helpers/is-defined.js +1 -5
- package/dist/esm/helpers/is-empty-children.js +2 -10
- package/dist/esm/helpers/is-safari.js +1 -5
- package/dist/esm/helpers/layout.js +1 -70
- package/dist/esm/helpers/load-script.js +1 -29
- package/dist/esm/helpers/loop-component.js +1 -14
- package/dist/esm/helpers/make-style.js +1 -149
- package/dist/esm/helpers/normalize-builder-data.js +1 -21
- package/dist/esm/helpers/pascal-to-kebab-case.js +1 -5
- package/dist/esm/helpers/prefetch-queries.js +1 -76
- package/dist/esm/helpers/product.js +1 -44
- package/dist/esm/helpers/queries/get-collection.js +1 -223
- package/dist/esm/helpers/queries/get-collections.js +1 -19
- package/dist/esm/helpers/queries/get-product-by-slug.js +1 -123
- package/dist/esm/helpers/queries/get-product.js +1 -150
- package/dist/esm/helpers/queries/get-products.js +1 -210
- package/dist/esm/helpers/query.js +1 -25
- package/dist/esm/helpers/radius.js +6 -132
- package/dist/esm/helpers/render.js +1 -82
- package/dist/esm/helpers/shadow.js +1 -63
- package/dist/esm/helpers/size.js +4 -213
- package/dist/esm/helpers/spacing.js +1 -40
- package/dist/esm/helpers/third-party/addAppBlockId.js +1 -18
- package/dist/esm/helpers/third-party/appConfig.js +1 -356
- package/dist/esm/helpers/third-party/appSetting.js +1 -1321
- package/dist/esm/helpers/third-party/composeAppBlockId.js +1 -9
- package/dist/esm/helpers/third-party/constant.js +1 -66
- package/dist/esm/helpers/third-party/generateAppBlockConfigs.js +1 -32
- package/dist/esm/helpers/third-party/getAppBlockConfig.js +1 -53
- package/dist/esm/helpers/third-party/getAppBlockType.js +1 -10
- package/dist/esm/helpers/third-party/getAppBlocks.js +1 -28
- package/dist/esm/helpers/third-party/mergeBlock.js +1 -17
- package/dist/esm/helpers/third-party/mergeBlockOrder.js +1 -45
- package/dist/esm/helpers/third-party/removeGPAppItems.js +1 -15
- package/dist/esm/helpers/tracking/fpixel.js +1 -24
- package/dist/esm/helpers/tracking/gtag.js +1 -87
- package/dist/esm/helpers/tracking/tiktokpixel.js +1 -15
- package/dist/esm/helpers/typography.js +19 -149
- package/dist/esm/helpers/variant.js +1 -9
- package/dist/esm/hooks/animation/useAnimationActions.js +2 -37
- package/dist/esm/hooks/animation/useAnimationConfig.js +2 -28
- package/dist/esm/hooks/animation/useAnimationPreview.js +2 -29
- package/dist/esm/hooks/animation/useAnimationTarget.js +2 -120
- package/dist/esm/hooks/animation/useApplyAnimation.js +2 -85
- package/dist/esm/hooks/articles/useArticlesQuery.js +2 -30
- package/dist/esm/hooks/cart/use-add-to-cart.js +2 -18
- package/dist/esm/hooks/cart/use-cart-data.js +2 -26
- package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +2 -18
- package/dist/esm/hooks/cart/use-cart-note-update.js +2 -18
- package/dist/esm/hooks/cart/use-create-cart.js +2 -20
- package/dist/esm/hooks/cart/use-remove-cart-item.js +2 -18
- package/dist/esm/hooks/cart/use-update-cart-item.js +2 -18
- package/dist/esm/hooks/shop/use-collection-query.js +2 -20
- package/dist/esm/hooks/shop/use-collections-query.js +2 -15
- package/dist/esm/hooks/shop/use-product-query.js +2 -20
- package/dist/esm/hooks/shop/use-products-query.js +2 -59
- package/dist/esm/hooks/shop/useShopifyLink.js +2 -0
- package/dist/esm/hooks/shop.js +2 -119
- package/dist/esm/hooks/use-current-device.js +2 -28
- package/dist/esm/hooks/use-lazy-video.js +2 -13
- package/dist/esm/hooks/useAnimations.js +2 -27
- package/dist/esm/hooks/useCartId.js +2 -40
- package/dist/esm/hooks/useCartLine.js +2 -7
- package/dist/esm/hooks/useCartUI.js +2 -44
- package/dist/esm/hooks/useCollection.js +2 -7
- package/dist/esm/hooks/useFetchHandle.js +2 -11
- package/dist/esm/hooks/useFormatMoney.js +2 -71
- package/dist/esm/hooks/useI18n.js +2 -0
- package/dist/esm/hooks/useInitialSwatchesOptions.js +2 -123
- package/dist/esm/hooks/useInteraction.js +2 -17
- package/dist/esm/hooks/useIsomorphicLayoutEffect.js +2 -6
- package/dist/esm/hooks/useLoadScript.js +2 -28
- package/dist/esm/hooks/useMoney.js +2 -80
- package/dist/esm/hooks/usePrevious.js +2 -17
- package/dist/esm/hooks/useProduct.js +2 -233
- package/dist/esm/hooks/useProductList.js +2 -16
- package/dist/esm/hooks/useStickyStore.js +1 -0
- package/dist/esm/hooks/useSuspenseFetch.js +2 -23
- package/dist/esm/hooks/useSwatchesOptions.js +2 -37
- package/dist/esm/hooks/useToolbarPostPurchase.js +2 -87
- package/dist/esm/index.js +1 -119
- package/dist/esm/types/animations.js +1 -49
- package/dist/esm/types/custom.js +1 -52
- package/dist/esm/types/global-style.js +1 -12
- package/dist/types/index.d.ts +12025 -8969
- package/package.json +6 -6
- package/dist/cjs/web-components/src/helpers/styles/constant.js +0 -9
- package/dist/esm/web-components/src/helpers/styles/constant.js +0 -7
|
@@ -1,748 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { memo, useState, useMemo, useCallback, useEffect } from 'react';
|
|
3
|
-
import 'zustand';
|
|
4
|
-
import { useBuilderPreviewStore } from '../contexts/BuilderPreviewContext.js';
|
|
5
|
-
import { usePageStore } from '../contexts/PageContext.js';
|
|
6
|
-
import { CreateThemeSection } from './theme-section/CreateThemeSection.js';
|
|
7
|
-
import Tooltip from './toolbar/Tooltip.js';
|
|
8
|
-
import { ThemeSectionStatusWrapper } from './theme-section/ThemeSectionStatus.js';
|
|
9
|
-
import Resize from './resize/Resize.js';
|
|
10
|
-
import { usePostPurchase } from '../hooks/useToolbarPostPurchase.js';
|
|
11
|
-
import { ableGenerateContentElements } from './constant.js';
|
|
12
|
-
import { AIContentGenerator } from './ai-generator/AIContentGenerator.js';
|
|
13
|
-
import { AIGenContentLoading } from './ai-generator/AIGenContentLoading.js';
|
|
14
|
-
import { InteractionSuffix } from './InteractionSuffix.js';
|
|
15
|
-
import 'swr';
|
|
16
|
-
import '../helpers/convert.js';
|
|
17
|
-
import { useShopStore } from '../contexts/ShopContext.js';
|
|
18
|
-
import '@gem-sdk/adapter-shopify';
|
|
19
|
-
import 'swr/mutation';
|
|
20
|
-
import 'swr/infinite';
|
|
21
|
-
import 'vanilla-lazyload';
|
|
22
|
-
import '../hooks/useCartUI.js';
|
|
23
|
-
|
|
24
|
-
const SECTION_LIMIT = 25;
|
|
25
|
-
const notVisible = (el)=>{
|
|
26
|
-
const overflow = getComputedStyle(el).overflow;
|
|
27
|
-
return overflow !== 'visible';
|
|
28
|
-
};
|
|
29
|
-
const isSection = (el)=>{
|
|
30
|
-
const tag = el.getAttribute('data-component-tag');
|
|
31
|
-
return tag === 'Section';
|
|
32
|
-
};
|
|
33
|
-
const ComponentToolbarPreview = (props)=>{
|
|
34
|
-
const isThemeSection = props.isThemeSection;
|
|
35
|
-
const isShopifySection = !!props.isShopifySection;
|
|
36
|
-
const storefrontUrl = useShopStore((s)=>s.storefrontUrl);
|
|
37
|
-
const editingPageType = useShopStore((s)=>s.pageType);
|
|
38
|
-
const getParents = useBuilderPreviewStore((s)=>s.getParents);
|
|
39
|
-
const root = useBuilderPreviewStore((s)=>s.getItem('ROOT'));
|
|
40
|
-
const isThemeSectionEditor = useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
|
|
41
|
-
const [activeAddSection, setActiveAddSection] = useState(null);
|
|
42
|
-
const [isShowParent, setIsShowParent] = useState(false);
|
|
43
|
-
const [isShowParentRevert, setIsShowParentRevert] = useState(false);
|
|
44
|
-
const [parents, setParents] = useState([]);
|
|
45
|
-
const [deleteTooltipPosition, setDeleteTooltipPosition] = useState('top');
|
|
46
|
-
const [isDisableDeleteInSaleFunelPage, setIsDisableDeleteInSaleFunelPage] = useState(false);
|
|
47
|
-
const [isActiveToolbarComponent, setIsActiveToolbarComponent] = useState(false);
|
|
48
|
-
const [productId, setProductId] = useState('');
|
|
49
|
-
const [articleUid, setArticleUid] = useState('');
|
|
50
|
-
const [tooltipText, setTooltipText] = useState({
|
|
51
|
-
width: '',
|
|
52
|
-
text: ''
|
|
53
|
-
});
|
|
54
|
-
const [isDisableDuplicateInSaleFunnelPage, setIsDisableDuplicateInSaleFunnelPage] = useState(false);
|
|
55
|
-
const interactionData = usePageStore((s)=>s.interactionData);
|
|
56
|
-
const isSaleFunnelPage = useMemo(()=>editingPageType === 'POST_PURCHASE', [
|
|
57
|
-
editingPageType
|
|
58
|
-
]);
|
|
59
|
-
const { checkDisableDelete, getTooltipText, checkDisableDuplicate } = usePostPurchase(props.uid, props.tag || '');
|
|
60
|
-
const editProductElementList = [
|
|
61
|
-
'ProductTitle',
|
|
62
|
-
'ProductDescription',
|
|
63
|
-
'ProductPrice'
|
|
64
|
-
];
|
|
65
|
-
const editArticleElementList = [
|
|
66
|
-
'ArticleTitle',
|
|
67
|
-
'ArticleContent',
|
|
68
|
-
'ArticleImage',
|
|
69
|
-
'ArticleAuthor',
|
|
70
|
-
'ArticleCategory',
|
|
71
|
-
'ArticleDate',
|
|
72
|
-
'ArticleExcerpt',
|
|
73
|
-
'ArticleTags'
|
|
74
|
-
];
|
|
75
|
-
const editAbleElementList = [
|
|
76
|
-
...editProductElementList,
|
|
77
|
-
...editArticleElementList
|
|
78
|
-
];
|
|
79
|
-
const isOverToolbarPosition = (el, parent)=>{
|
|
80
|
-
const parentLength = parents.length;
|
|
81
|
-
const rect = el.getBoundingClientRect();
|
|
82
|
-
const rectP = parent.getBoundingClientRect();
|
|
83
|
-
// 36px = toolbar active height + 4 spaces
|
|
84
|
-
return rect.top - rectP.top < parentLength * 36;
|
|
85
|
-
};
|
|
86
|
-
const findOverflowParent = (element, initEl)=>{
|
|
87
|
-
const thisEl = element;
|
|
88
|
-
const origEl = initEl || thisEl;
|
|
89
|
-
if (!thisEl) return;
|
|
90
|
-
if (isSection(thisEl)) return;
|
|
91
|
-
if (notVisible(thisEl) && isOverToolbarPosition(initEl, thisEl)) return thisEl;
|
|
92
|
-
if (thisEl.parentElement) {
|
|
93
|
-
return findOverflowParent(thisEl.parentElement, origEl);
|
|
94
|
-
} else {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const getSectionNumber = ()=>{
|
|
99
|
-
return root?.childrens?.length || 0;
|
|
100
|
-
};
|
|
101
|
-
const getDeleteTooltipPosition = useCallback(()=>{
|
|
102
|
-
if (props.tag == 'Section') return 'bottom';
|
|
103
|
-
const $toolbar = document.body.querySelector('#storefront')?.querySelector('[data-toolbar-active="true"]');
|
|
104
|
-
if ($toolbar) {
|
|
105
|
-
const rect = $toolbar.getBoundingClientRect();
|
|
106
|
-
if (rect.top < 60) setDeleteTooltipPosition('bottom');
|
|
107
|
-
else setDeleteTooltipPosition('top');
|
|
108
|
-
}
|
|
109
|
-
}, [
|
|
110
|
-
props.tag
|
|
111
|
-
]);
|
|
112
|
-
const shopName = useMemo(()=>{
|
|
113
|
-
const pattern = /^(?:https?:\/\/)?([^/]+)\.myshopify\.com/;
|
|
114
|
-
if (storefrontUrl) {
|
|
115
|
-
return storefrontUrl.match(pattern)?.[1];
|
|
116
|
-
}
|
|
117
|
-
return '';
|
|
118
|
-
}, [
|
|
119
|
-
storefrontUrl
|
|
120
|
-
]);
|
|
121
|
-
const linkShopDefault = useMemo(()=>{
|
|
122
|
-
return `https://admin.shopify.com/store/${shopName}`;
|
|
123
|
-
}, [
|
|
124
|
-
shopName
|
|
125
|
-
]);
|
|
126
|
-
const linkEditProduct = useMemo(()=>{
|
|
127
|
-
return productId ? `${linkShopDefault}/products/${productId}` : '';
|
|
128
|
-
}, [
|
|
129
|
-
linkShopDefault,
|
|
130
|
-
productId
|
|
131
|
-
]);
|
|
132
|
-
const linkEditArticle = useMemo(()=>{
|
|
133
|
-
return articleUid ? `${linkShopDefault}/articles/${articleUid}` : '';
|
|
134
|
-
}, [
|
|
135
|
-
articleUid,
|
|
136
|
-
linkShopDefault
|
|
137
|
-
]);
|
|
138
|
-
const isSelectOnPage = useMemo(()=>interactionData?.isSelectOnPage, [
|
|
139
|
-
interactionData?.isSelectOnPage
|
|
140
|
-
]);
|
|
141
|
-
const settingType = useMemo(()=>interactionData?.settingType, [
|
|
142
|
-
interactionData?.settingType
|
|
143
|
-
]);
|
|
144
|
-
const isShowIconInteractionTarget = useMemo(()=>{
|
|
145
|
-
return interactionData?.item?.targets?.find((t)=>t.uid === props.uid && t?.type !== 'PAGE') && settingType === 'TARGET';
|
|
146
|
-
}, [
|
|
147
|
-
interactionData?.item?.targets,
|
|
148
|
-
props.uid,
|
|
149
|
-
settingType
|
|
150
|
-
]);
|
|
151
|
-
const isShowIconInteractionTrigger = useMemo(()=>{
|
|
152
|
-
return interactionData?.item?.self?.uid === props.uid && interactionData?.item?.self.type !== 'PAGE' && settingType === 'TRIGGER';
|
|
153
|
-
}, [
|
|
154
|
-
interactionData?.item?.self?.type,
|
|
155
|
-
interactionData?.item?.self?.uid,
|
|
156
|
-
props.uid,
|
|
157
|
-
settingType
|
|
158
|
-
]);
|
|
159
|
-
const isDisplayIconDrag = useMemo(()=>{
|
|
160
|
-
return !isShowIconInteractionTarget && !isShowIconInteractionTrigger;
|
|
161
|
-
}, [
|
|
162
|
-
isShowIconInteractionTarget,
|
|
163
|
-
isShowIconInteractionTrigger
|
|
164
|
-
]);
|
|
165
|
-
const isDisableDelete = useMemo(()=>{
|
|
166
|
-
return isDisableDeleteInSaleFunelPage || isShopifySection;
|
|
167
|
-
}, [
|
|
168
|
-
isDisableDeleteInSaleFunelPage,
|
|
169
|
-
isShopifySection
|
|
170
|
-
]);
|
|
171
|
-
const isDisableDuplicate = useMemo(()=>{
|
|
172
|
-
return isDisableDuplicateInSaleFunnelPage || isShopifySection || getSectionNumber() > SECTION_LIMIT && props.tag === 'Section';
|
|
173
|
-
}, [
|
|
174
|
-
getSectionNumber,
|
|
175
|
-
isDisableDuplicateInSaleFunnelPage,
|
|
176
|
-
isShopifySection,
|
|
177
|
-
props.tag
|
|
178
|
-
]);
|
|
179
|
-
// Get parents
|
|
180
|
-
const onActiveComponent = useCallback((e)=>{
|
|
181
|
-
const detail = e.detail;
|
|
182
|
-
if (detail?.articleId) {
|
|
183
|
-
setArticleUid(detail.articleId);
|
|
184
|
-
}
|
|
185
|
-
if (detail?.productId) {
|
|
186
|
-
setProductId(detail.productId);
|
|
187
|
-
}
|
|
188
|
-
if (detail?.componentUid == props.uid) {
|
|
189
|
-
setIsActiveToolbarComponent(true);
|
|
190
|
-
getDeleteTooltipPosition();
|
|
191
|
-
if (isSaleFunnelPage) {
|
|
192
|
-
setIsDisableDeleteInSaleFunelPage(checkDisableDelete());
|
|
193
|
-
setTooltipText(getTooltipText());
|
|
194
|
-
setIsDisableDuplicateInSaleFunnelPage(checkDisableDuplicate());
|
|
195
|
-
}
|
|
196
|
-
const currentParents = getParents(props.uid).filter((parent)=>{
|
|
197
|
-
if (parent.uid === 'ROOT') return false;
|
|
198
|
-
if (parent.tag === 'Section' && isThemeSectionEditor) return false;
|
|
199
|
-
if (parent.editorConfigs?.toolbar?.hide) return false;
|
|
200
|
-
if (parent.editorConfigs?.component?.noSetting) return false;
|
|
201
|
-
return true;
|
|
202
|
-
}).slice(0, 3);
|
|
203
|
-
setParents(currentParents);
|
|
204
|
-
} else {
|
|
205
|
-
setIsActiveToolbarComponent(false);
|
|
206
|
-
setParents([]);
|
|
207
|
-
setIsShowParent(false);
|
|
208
|
-
}
|
|
209
|
-
}, [
|
|
210
|
-
props.uid,
|
|
211
|
-
isSaleFunnelPage,
|
|
212
|
-
getParents,
|
|
213
|
-
checkDisableDelete,
|
|
214
|
-
getTooltipText,
|
|
215
|
-
checkDisableDuplicate,
|
|
216
|
-
isThemeSectionEditor,
|
|
217
|
-
getDeleteTooltipPosition
|
|
218
|
-
]);
|
|
219
|
-
useEffect(()=>{
|
|
220
|
-
window.addEventListener('editor:active-component', onActiveComponent);
|
|
221
|
-
return ()=>{
|
|
222
|
-
window.removeEventListener('editor:active-component', onActiveComponent);
|
|
223
|
-
};
|
|
224
|
-
}, [
|
|
225
|
-
onActiveComponent
|
|
226
|
-
]);
|
|
227
|
-
// End get parents
|
|
228
|
-
if (props.type === 'section') {
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
if (props.editorConfigs?.toolbar?.hide) {
|
|
232
|
-
return null;
|
|
233
|
-
}
|
|
234
|
-
const getIndexSection = ()=>{
|
|
235
|
-
if (props.tag !== 'Section') {
|
|
236
|
-
return -1;
|
|
237
|
-
}
|
|
238
|
-
if (root?.childrens?.length) {
|
|
239
|
-
return root.childrens.findIndex((sectionUid)=>sectionUid == props.uid);
|
|
240
|
-
}
|
|
241
|
-
return -1;
|
|
242
|
-
};
|
|
243
|
-
const onShowParent = (e)=>{
|
|
244
|
-
if (!parents.length) return;
|
|
245
|
-
const $target = (e?.target) || null;
|
|
246
|
-
const $toolbar = $target.closest('[data-toolbar-active]');
|
|
247
|
-
if (!$target || !$toolbar) return;
|
|
248
|
-
if (isShowParent) {
|
|
249
|
-
setIsShowParentRevert(false);
|
|
250
|
-
setIsShowParent(false);
|
|
251
|
-
} else {
|
|
252
|
-
const $parentOverflow = findOverflowParent($toolbar, $toolbar);
|
|
253
|
-
if ($parentOverflow) {
|
|
254
|
-
setIsShowParentRevert(true);
|
|
255
|
-
} else {
|
|
256
|
-
const rect = $toolbar.getBoundingClientRect();
|
|
257
|
-
if (rect.top < parents.length * 36) {
|
|
258
|
-
setIsShowParentRevert(true);
|
|
259
|
-
} else {
|
|
260
|
-
setIsShowParentRevert(false);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
setIsShowParent(true);
|
|
264
|
-
}
|
|
265
|
-
const event = new CustomEvent('editor:toolbar:show-parents', {
|
|
266
|
-
bubbles: true,
|
|
267
|
-
detail: {
|
|
268
|
-
value: !isShowParent
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
window.dispatchEvent(event);
|
|
272
|
-
};
|
|
273
|
-
const goToShopifyEditLink = ()=>{
|
|
274
|
-
if (editArticleElementList.includes(props.tag)) {
|
|
275
|
-
window.open(linkEditArticle, '_blank');
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
if (editProductElementList.includes(props.tag)) {
|
|
279
|
-
window.open(linkEditProduct, '_blank');
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
window.open(linkShopDefault, '_blank');
|
|
283
|
-
};
|
|
284
|
-
const onDelete = (e)=>{
|
|
285
|
-
e.preventDefault();
|
|
286
|
-
e.stopPropagation();
|
|
287
|
-
const event = new CustomEvent('editor:toolbar:delete-component', {
|
|
288
|
-
bubbles: true,
|
|
289
|
-
detail: {
|
|
290
|
-
componentUid: props.uid,
|
|
291
|
-
isThemeSection,
|
|
292
|
-
isShopifySection
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
window.dispatchEvent(event);
|
|
296
|
-
return false;
|
|
297
|
-
};
|
|
298
|
-
const onDuplicate = (e)=>{
|
|
299
|
-
e.preventDefault();
|
|
300
|
-
e.stopPropagation();
|
|
301
|
-
const event = new CustomEvent('editor:toolbar:duplicate-component', {
|
|
302
|
-
bubbles: true,
|
|
303
|
-
detail: {
|
|
304
|
-
componentUid: props.uid,
|
|
305
|
-
isThemeSection,
|
|
306
|
-
isShopifySection
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
window.dispatchEvent(event);
|
|
310
|
-
return false;
|
|
311
|
-
};
|
|
312
|
-
const toolbarName = ()=>{
|
|
313
|
-
return props.customLabel || props.label;
|
|
314
|
-
};
|
|
315
|
-
const onZoomOut = (e)=>{
|
|
316
|
-
e.preventDefault();
|
|
317
|
-
e.stopPropagation();
|
|
318
|
-
const event = new CustomEvent('editor:toolbar:zoom-out-component', {
|
|
319
|
-
bubbles: true,
|
|
320
|
-
detail: {
|
|
321
|
-
componentUid: props.uid
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
window.dispatchEvent(event);
|
|
325
|
-
return false;
|
|
326
|
-
};
|
|
327
|
-
const closeAddSection = ()=>{
|
|
328
|
-
setActiveAddSection(null);
|
|
329
|
-
window.removeEventListener('editor:close-add-section-popup', closeAddSection);
|
|
330
|
-
};
|
|
331
|
-
const onAddSection = (e, position)=>{
|
|
332
|
-
e.preventDefault();
|
|
333
|
-
e.stopPropagation();
|
|
334
|
-
if (getSectionNumber() >= SECTION_LIMIT) {
|
|
335
|
-
return false;
|
|
336
|
-
}
|
|
337
|
-
const $target = e.target;
|
|
338
|
-
if ($target) {
|
|
339
|
-
setActiveAddSection(position);
|
|
340
|
-
const rect = $target.getBoundingClientRect();
|
|
341
|
-
const event = new CustomEvent('editor:toolbar:add-section', {
|
|
342
|
-
bubbles: true,
|
|
343
|
-
detail: {
|
|
344
|
-
componentUid: props.uid,
|
|
345
|
-
position,
|
|
346
|
-
top: rect.top + rect.height / 2
|
|
347
|
-
}
|
|
348
|
-
});
|
|
349
|
-
window.dispatchEvent(event);
|
|
350
|
-
window.addEventListener('editor:close-add-section-popup', closeAddSection);
|
|
351
|
-
}
|
|
352
|
-
return false;
|
|
353
|
-
};
|
|
354
|
-
const getSectionName = ()=>{
|
|
355
|
-
if (isShopifySection) {
|
|
356
|
-
return props.name?.includes('Shopify section:') ? props.name : `Shopify section: ${props.name}`;
|
|
357
|
-
}
|
|
358
|
-
const checkRenamedSection = props.name && props.name === `Section ${props.uid}`;
|
|
359
|
-
if (getSectionNumber() >= SECTION_LIMIT - 5) {
|
|
360
|
-
return `${checkRenamedSection ? 'Section' : props?.name} ${getIndexSection() + 1}/${SECTION_LIMIT}`;
|
|
361
|
-
}
|
|
362
|
-
return checkRenamedSection ? `Section ${getIndexSection() + 1}` : props?.name;
|
|
363
|
-
};
|
|
364
|
-
const isEnableCreateThemeSection = ()=>{
|
|
365
|
-
return editingPageType !== 'STATIC' && editingPageType !== 'POST_PURCHASE';
|
|
366
|
-
};
|
|
367
|
-
const isEnableAIContent = ()=>{
|
|
368
|
-
const { isShopifySection, tag } = props;
|
|
369
|
-
if (isShopifySection || isThemeSection && !isThemeSectionEditor) return false;
|
|
370
|
-
return ableGenerateContentElements.includes(tag);
|
|
371
|
-
};
|
|
372
|
-
// if (!isActive) return null;
|
|
373
|
-
return /*#__PURE__*/ jsxs(Fragment, {
|
|
374
|
-
children: [
|
|
375
|
-
!(props.tag == 'Section' && isThemeSectionEditor) && /*#__PURE__*/ jsxs("div", {
|
|
376
|
-
"data-toolbar": true,
|
|
377
|
-
"data-toolbar-section": props.tag == 'Section',
|
|
378
|
-
"data-toolbar-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor,
|
|
379
|
-
"data-toolbar-shopify-section": props.tag == 'Section' && !!isShopifySection,
|
|
380
|
-
"data-toolbar-limit": getIndexSection() >= SECTION_LIMIT,
|
|
381
|
-
children: [
|
|
382
|
-
/*#__PURE__*/ jsxs("div", {
|
|
383
|
-
"data-toolbar-show-parent": true,
|
|
384
|
-
onClick: (e)=>onShowParent(e),
|
|
385
|
-
"aria-hidden": "true",
|
|
386
|
-
children: [
|
|
387
|
-
isShowIconInteractionTrigger && /*#__PURE__*/ jsx("div", {
|
|
388
|
-
className: "gp-hidden gp-w-[12px] interaction-use-custom-element",
|
|
389
|
-
children: /*#__PURE__*/ jsx("svg", {
|
|
390
|
-
width: "12",
|
|
391
|
-
height: "13",
|
|
392
|
-
viewBox: "0 0 12 13",
|
|
393
|
-
fill: "none",
|
|
394
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
395
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
396
|
-
fillRule: "evenodd",
|
|
397
|
-
clipRule: "evenodd",
|
|
398
|
-
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",
|
|
399
|
-
fill: "#F9F9F9"
|
|
400
|
-
})
|
|
401
|
-
})
|
|
402
|
-
}),
|
|
403
|
-
isShowIconInteractionTarget && /*#__PURE__*/ jsx("div", {
|
|
404
|
-
className: "gp-hidden gp-w-[14px] interaction-use-custom-element",
|
|
405
|
-
children: /*#__PURE__*/ jsx("svg", {
|
|
406
|
-
width: "16",
|
|
407
|
-
height: "16",
|
|
408
|
-
viewBox: "0 0 16 16",
|
|
409
|
-
fill: "none",
|
|
410
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
411
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
412
|
-
fillRule: "evenodd",
|
|
413
|
-
clipRule: "evenodd",
|
|
414
|
-
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",
|
|
415
|
-
fill: "#F9F9F9"
|
|
416
|
-
})
|
|
417
|
-
})
|
|
418
|
-
}),
|
|
419
|
-
isActiveToolbarComponent && isDisplayIconDrag && /*#__PURE__*/ jsx("div", {
|
|
420
|
-
"data-toolbar-icon-drag": true,
|
|
421
|
-
children: /*#__PURE__*/ jsxs("svg", {
|
|
422
|
-
width: "16",
|
|
423
|
-
height: "16",
|
|
424
|
-
viewBox: "0 0 16 16",
|
|
425
|
-
fill: "none",
|
|
426
|
-
children: [
|
|
427
|
-
/*#__PURE__*/ jsx("path", {
|
|
428
|
-
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",
|
|
429
|
-
fill: "currentColor"
|
|
430
|
-
}),
|
|
431
|
-
/*#__PURE__*/ jsx("path", {
|
|
432
|
-
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",
|
|
433
|
-
fill: "currentColor"
|
|
434
|
-
}),
|
|
435
|
-
/*#__PURE__*/ jsx("path", {
|
|
436
|
-
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",
|
|
437
|
-
fill: "currentColor"
|
|
438
|
-
}),
|
|
439
|
-
/*#__PURE__*/ jsx("path", {
|
|
440
|
-
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",
|
|
441
|
-
fill: "currentColor"
|
|
442
|
-
}),
|
|
443
|
-
/*#__PURE__*/ jsx("path", {
|
|
444
|
-
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",
|
|
445
|
-
fill: "currentColor"
|
|
446
|
-
}),
|
|
447
|
-
/*#__PURE__*/ jsx("path", {
|
|
448
|
-
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",
|
|
449
|
-
fill: "currentColor"
|
|
450
|
-
})
|
|
451
|
-
]
|
|
452
|
-
})
|
|
453
|
-
}),
|
|
454
|
-
props.tag == 'Section' ? /*#__PURE__*/ jsxs("div", {
|
|
455
|
-
"data-toolbar-name": true,
|
|
456
|
-
children: [
|
|
457
|
-
getSectionName(),
|
|
458
|
-
isActiveToolbarComponent && isShopifySection && !props.isShopifyVisibility && /*#__PURE__*/ jsxs("svg", {
|
|
459
|
-
"data-toolbar-visibility": true,
|
|
460
|
-
width: "20",
|
|
461
|
-
height: "20",
|
|
462
|
-
viewBox: "0 0 20 20",
|
|
463
|
-
fill: "none",
|
|
464
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
465
|
-
children: [
|
|
466
|
-
/*#__PURE__*/ jsx("path", {
|
|
467
|
-
fillRule: "evenodd",
|
|
468
|
-
clipRule: "evenodd",
|
|
469
|
-
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",
|
|
470
|
-
fill: "#F9F9F9"
|
|
471
|
-
}),
|
|
472
|
-
/*#__PURE__*/ jsx("path", {
|
|
473
|
-
fillRule: "evenodd",
|
|
474
|
-
clipRule: "evenodd",
|
|
475
|
-
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",
|
|
476
|
-
fill: "#F9F9F9"
|
|
477
|
-
}),
|
|
478
|
-
/*#__PURE__*/ jsx("path", {
|
|
479
|
-
fillRule: "evenodd",
|
|
480
|
-
clipRule: "evenodd",
|
|
481
|
-
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",
|
|
482
|
-
fill: "#F9F9F9"
|
|
483
|
-
})
|
|
484
|
-
]
|
|
485
|
-
})
|
|
486
|
-
]
|
|
487
|
-
}) : /*#__PURE__*/ jsx("div", {
|
|
488
|
-
"data-toolbar-name": true,
|
|
489
|
-
children: toolbarName()
|
|
490
|
-
}),
|
|
491
|
-
isActiveToolbarComponent && props.tag !== 'Section' && parents.length > 0 && /*#__PURE__*/ jsx("div", {
|
|
492
|
-
"data-toolbar-icon-parent": true,
|
|
493
|
-
"data-toolbar-icon-parent-open": isShowParent,
|
|
494
|
-
children: /*#__PURE__*/ jsx("svg", {
|
|
495
|
-
width: "16",
|
|
496
|
-
height: "16",
|
|
497
|
-
viewBox: "0 0 16 16",
|
|
498
|
-
fill: "none",
|
|
499
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
500
|
-
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",
|
|
501
|
-
fill: "currentColor"
|
|
502
|
-
})
|
|
503
|
-
})
|
|
504
|
-
})
|
|
505
|
-
]
|
|
506
|
-
}),
|
|
507
|
-
isActiveToolbarComponent && isShowParent && parents.map((parent, index)=>{
|
|
508
|
-
// Update count columns of Row
|
|
509
|
-
const parentLength = parent?.childrens?.length ?? 0;
|
|
510
|
-
let parent_label = parent.label;
|
|
511
|
-
if (parent.label === 'Row') {
|
|
512
|
-
parent_label = parentLength <= 1 ? parent.label + ' ' + parentLength + ' col' : parent.label + ' ' + parentLength + ' cols';
|
|
513
|
-
}
|
|
514
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
515
|
-
"data-toolbar-parent": true,
|
|
516
|
-
"data-component-tag": parent.tag,
|
|
517
|
-
"data-parent-uid": parent.uid,
|
|
518
|
-
"data-toolbar-theme-section": isThemeSectionEditor,
|
|
519
|
-
"data-toolbar-parent-revert": isShowParentRevert,
|
|
520
|
-
style: {
|
|
521
|
-
top: !isShowParentRevert ? `${-36 * (index + 1)}px` // 32 height + 4 spacing
|
|
522
|
-
: `${36 * (index + 1)}px`
|
|
523
|
-
},
|
|
524
|
-
children: [
|
|
525
|
-
/*#__PURE__*/ jsx("div", {
|
|
526
|
-
"data-toolbar-icon-drag": true,
|
|
527
|
-
children: /*#__PURE__*/ jsxs("svg", {
|
|
528
|
-
width: "16",
|
|
529
|
-
height: "16",
|
|
530
|
-
viewBox: "0 0 16 16",
|
|
531
|
-
fill: "none",
|
|
532
|
-
children: [
|
|
533
|
-
/*#__PURE__*/ jsx("path", {
|
|
534
|
-
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",
|
|
535
|
-
fill: "currentColor"
|
|
536
|
-
}),
|
|
537
|
-
/*#__PURE__*/ jsx("path", {
|
|
538
|
-
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",
|
|
539
|
-
fill: "currentColor"
|
|
540
|
-
}),
|
|
541
|
-
/*#__PURE__*/ jsx("path", {
|
|
542
|
-
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",
|
|
543
|
-
fill: "currentColor"
|
|
544
|
-
}),
|
|
545
|
-
/*#__PURE__*/ jsx("path", {
|
|
546
|
-
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",
|
|
547
|
-
fill: "currentColor"
|
|
548
|
-
}),
|
|
549
|
-
/*#__PURE__*/ jsx("path", {
|
|
550
|
-
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",
|
|
551
|
-
fill: "currentColor"
|
|
552
|
-
}),
|
|
553
|
-
/*#__PURE__*/ jsx("path", {
|
|
554
|
-
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",
|
|
555
|
-
fill: "currentColor"
|
|
556
|
-
})
|
|
557
|
-
]
|
|
558
|
-
})
|
|
559
|
-
}),
|
|
560
|
-
/*#__PURE__*/ jsx("div", {
|
|
561
|
-
"data-toolbar-name": true,
|
|
562
|
-
children: parent_label
|
|
563
|
-
})
|
|
564
|
-
]
|
|
565
|
-
}, parent.uid);
|
|
566
|
-
}),
|
|
567
|
-
isActiveToolbarComponent && !isSelectOnPage && /*#__PURE__*/ jsxs(Fragment, {
|
|
568
|
-
children: [
|
|
569
|
-
' ',
|
|
570
|
-
props.tag === 'Section' && !props.isThemeSection && isEnableCreateThemeSection() && !props.isShopifySection && getIndexSection() < SECTION_LIMIT && /*#__PURE__*/ jsx(CreateThemeSection, {
|
|
571
|
-
...props
|
|
572
|
-
}),
|
|
573
|
-
isEnableAIContent() && /*#__PURE__*/ jsx(AIContentGenerator, {
|
|
574
|
-
...props
|
|
575
|
-
}),
|
|
576
|
-
props.tag == 'Sticky' && /*#__PURE__*/ jsx("div", {
|
|
577
|
-
"data-toolbar-zoom-out": true,
|
|
578
|
-
onClick: (e)=>onZoomOut(e),
|
|
579
|
-
"aria-hidden": "true",
|
|
580
|
-
children: /*#__PURE__*/ jsx("svg", {
|
|
581
|
-
width: "16",
|
|
582
|
-
height: "16",
|
|
583
|
-
viewBox: "0 0 16 16",
|
|
584
|
-
fill: "none",
|
|
585
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
586
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
587
|
-
fillRule: "evenodd",
|
|
588
|
-
clipRule: "evenodd",
|
|
589
|
-
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",
|
|
590
|
-
fill: "currentColor"
|
|
591
|
-
})
|
|
592
|
-
})
|
|
593
|
-
}),
|
|
594
|
-
editAbleElementList.includes(props.tag) && /*#__PURE__*/ jsx(Tooltip, {
|
|
595
|
-
"data-toolbar-title": true,
|
|
596
|
-
enable: true,
|
|
597
|
-
"data-toolbar-disable": false,
|
|
598
|
-
text: "Edit content in Shopify",
|
|
599
|
-
position: "top",
|
|
600
|
-
onClick: goToShopifyEditLink,
|
|
601
|
-
"aria-hidden": "true",
|
|
602
|
-
children: /*#__PURE__*/ jsxs("svg", {
|
|
603
|
-
width: "16",
|
|
604
|
-
height: "16",
|
|
605
|
-
viewBox: "0 0 16 16",
|
|
606
|
-
fill: "none",
|
|
607
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
608
|
-
children: [
|
|
609
|
-
/*#__PURE__*/ jsx("path", {
|
|
610
|
-
fillRule: "evenodd",
|
|
611
|
-
clipRule: "evenodd",
|
|
612
|
-
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",
|
|
613
|
-
fill: "currentColor"
|
|
614
|
-
}),
|
|
615
|
-
/*#__PURE__*/ jsx("path", {
|
|
616
|
-
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",
|
|
617
|
-
fill: "currentColor"
|
|
618
|
-
}),
|
|
619
|
-
/*#__PURE__*/ jsx("path", {
|
|
620
|
-
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",
|
|
621
|
-
fill: "currentColor"
|
|
622
|
-
}),
|
|
623
|
-
/*#__PURE__*/ jsx("path", {
|
|
624
|
-
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",
|
|
625
|
-
fill: "currentColor"
|
|
626
|
-
})
|
|
627
|
-
]
|
|
628
|
-
})
|
|
629
|
-
}),
|
|
630
|
-
/*#__PURE__*/ jsx(Tooltip, {
|
|
631
|
-
enable: props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT || isShopifySection,
|
|
632
|
-
text: isShopifySection ? 'Disabled. Please edit in Shopify Editor' : 'Page has reached Shopify’s 25 section-limit',
|
|
633
|
-
position: "bottom",
|
|
634
|
-
width: "200px",
|
|
635
|
-
"data-toolbar-duplicate": true,
|
|
636
|
-
"data-toolbar-disable": isDisableDuplicate,
|
|
637
|
-
onClick: isDisableDuplicate ? undefined : (e)=>onDuplicate(e),
|
|
638
|
-
"aria-hidden": "true",
|
|
639
|
-
className: isDisableDuplicate ? '!gp-cursor-not-allowed' : '',
|
|
640
|
-
children: /*#__PURE__*/ jsx("svg", {
|
|
641
|
-
width: "16",
|
|
642
|
-
height: "16",
|
|
643
|
-
viewBox: "0 0 16 16",
|
|
644
|
-
fill: "none",
|
|
645
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
646
|
-
fillRule: "evenodd",
|
|
647
|
-
clipRule: "evenodd",
|
|
648
|
-
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",
|
|
649
|
-
fill: "currentColor"
|
|
650
|
-
})
|
|
651
|
-
})
|
|
652
|
-
}),
|
|
653
|
-
/*#__PURE__*/ jsx(Tooltip, {
|
|
654
|
-
"data-toolbar-delete": true,
|
|
655
|
-
onClick: (e)=>isDisableDelete ? null : onDelete(e),
|
|
656
|
-
enable: isDisableDelete,
|
|
657
|
-
"data-toolbar-disable": isDisableDelete,
|
|
658
|
-
text: isShopifySection ? 'Disabled. Please edit in Shopify Editor' : tooltipText.text,
|
|
659
|
-
width: tooltipText.width,
|
|
660
|
-
position: isShopifySection ? 'bottom' : deleteTooltipPosition,
|
|
661
|
-
"aria-hidden": "true",
|
|
662
|
-
className: isDisableDelete ? '!gp-cursor-not-allowed' : '',
|
|
663
|
-
children: /*#__PURE__*/ jsx("svg", {
|
|
664
|
-
width: "16",
|
|
665
|
-
height: "16",
|
|
666
|
-
viewBox: "0 0 16 16",
|
|
667
|
-
fill: "none",
|
|
668
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
669
|
-
fillRule: "evenodd",
|
|
670
|
-
clipRule: "evenodd",
|
|
671
|
-
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",
|
|
672
|
-
fill: "currentColor"
|
|
673
|
-
})
|
|
674
|
-
})
|
|
675
|
-
})
|
|
676
|
-
]
|
|
677
|
-
}),
|
|
678
|
-
/*#__PURE__*/ jsx(InteractionSuffix, {
|
|
679
|
-
uid: props.uid
|
|
680
|
-
})
|
|
681
|
-
]
|
|
682
|
-
}, props.uid),
|
|
683
|
-
isEnableCreateThemeSection() && getIndexSection() < SECTION_LIMIT && /*#__PURE__*/ jsx(ThemeSectionStatusWrapper, {
|
|
684
|
-
...props
|
|
685
|
-
}),
|
|
686
|
-
/*#__PURE__*/ jsx("div", {
|
|
687
|
-
"data-outline": true,
|
|
688
|
-
"data-outline-section": props.tag == 'Section',
|
|
689
|
-
"data-outline-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor,
|
|
690
|
-
"data-outline-shopify-section": props.tag == 'Section' && !!isShopifySection,
|
|
691
|
-
"data-outline-limit": getIndexSection() >= SECTION_LIMIT
|
|
692
|
-
}, 'outline-' + props.uid),
|
|
693
|
-
props.tag == 'Section' && !isThemeSectionEditor && /*#__PURE__*/ jsxs(Fragment, {
|
|
694
|
-
children: [
|
|
695
|
-
/*#__PURE__*/ jsx(Tooltip, {
|
|
696
|
-
enable: getSectionNumber() >= SECTION_LIMIT,
|
|
697
|
-
text: "Page has reached Shopify’s 25 section-limit",
|
|
698
|
-
position: "top",
|
|
699
|
-
"data-toolbar-add-top": true,
|
|
700
|
-
"data-toolbar-disable": getSectionNumber() >= SECTION_LIMIT,
|
|
701
|
-
"data-toolbar-add-open": activeAddSection == 'above',
|
|
702
|
-
onClick: (e)=>onAddSection(e, 'above'),
|
|
703
|
-
"aria-hidden": "true",
|
|
704
|
-
children: /*#__PURE__*/ jsx("svg", {
|
|
705
|
-
width: "16",
|
|
706
|
-
height: "16",
|
|
707
|
-
viewBox: "0 0 16 16",
|
|
708
|
-
fill: "none",
|
|
709
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
710
|
-
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",
|
|
711
|
-
fill: "#212121"
|
|
712
|
-
})
|
|
713
|
-
})
|
|
714
|
-
}),
|
|
715
|
-
/*#__PURE__*/ jsx(Tooltip, {
|
|
716
|
-
enable: getSectionNumber() >= SECTION_LIMIT,
|
|
717
|
-
text: "Page has reached Shopify’s 25 section-limit",
|
|
718
|
-
position: "top",
|
|
719
|
-
"data-toolbar-add-bottom": true,
|
|
720
|
-
"data-toolbar-disable": getSectionNumber() >= SECTION_LIMIT,
|
|
721
|
-
"data-toolbar-add-open": activeAddSection == 'below',
|
|
722
|
-
onClick: (e)=>onAddSection(e, 'below'),
|
|
723
|
-
"aria-hidden": "true",
|
|
724
|
-
children: /*#__PURE__*/ jsx("svg", {
|
|
725
|
-
width: "16",
|
|
726
|
-
height: "16",
|
|
727
|
-
viewBox: "0 0 16 16",
|
|
728
|
-
fill: "none",
|
|
729
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
730
|
-
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",
|
|
731
|
-
fill: "#212121"
|
|
732
|
-
})
|
|
733
|
-
})
|
|
734
|
-
})
|
|
735
|
-
]
|
|
736
|
-
}),
|
|
737
|
-
ableGenerateContentElements.includes(props.tag) && isActiveToolbarComponent && /*#__PURE__*/ jsx(AIGenContentLoading, {
|
|
738
|
-
...props
|
|
739
|
-
}),
|
|
740
|
-
isActiveToolbarComponent && /*#__PURE__*/ jsx(Resize, {
|
|
741
|
-
...props
|
|
742
|
-
})
|
|
743
|
-
]
|
|
744
|
-
});
|
|
745
|
-
};
|
|
746
|
-
var ComponentToolbarPreview$1 = /*#__PURE__*/ memo(ComponentToolbarPreview); /* gem-lint/disallow-import-from-package-path */
|
|
747
|
-
|
|
748
|
-
export { ComponentToolbarPreview$1 as default };
|
|
1
|
+
'use client';
|
|
2
|
+
import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import{memo as i,useState as n,useMemo as l,useCallback as r,useEffect as a}from"react";import"zustand";import{useBuilderPreviewStore as d}from"../contexts/BuilderPreviewContext.js";import{usePageStore as C}from"../contexts/PageContext.js";import{CreateThemeSection as c}from"./theme-section/CreateThemeSection.js";import s from"./toolbar/Tooltip.js";import{ThemeSectionStatusWrapper as p}from"./theme-section/ThemeSectionStatus.js";import h from"./resize/Resize.js";import{usePostPurchase as u}from"../hooks/useToolbarPostPurchase.js";import{ableGenerateContentElements as m}from"./constant.js";import{AIContentGenerator as g}from"./ai-generator/AIContentGenerator.js";import{AIGenContentLoading as f}from"./ai-generator/AIGenContentLoading.js";import{InteractionSuffix as v}from"./InteractionSuffix.js";import"swr";import"../helpers/convert.js";import{useShopStore as w}from"../contexts/ShopContext.js";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"swr/infinite";import"vanilla-lazyload";import"../hooks/useCartUI.js";import"../hooks/useStickyStore.js";let SECTION_LIMIT=25,notVisible=t=>{let e=getComputedStyle(t).overflow;return"visible"!==e},isSection=t=>{let e=t.getAttribute("data-component-tag");return"Section"===e},ComponentToolbarPreview=i=>{let b=i.isThemeSection,S=!!i.isShopifySection,L=w(t=>t.storefrontUrl),M=w(t=>t.pageType),x=d(t=>t.getParents),Z=d(t=>t.getItem("ROOT")),y=d(t=>t.isThemeSectionEditor),[R,H]=n(null),[P,V]=n(!1),[T,E]=n(!1),[A,B]=n([]),[I,j]=n("top"),[k,$]=n(!1),[F,O]=n(!1),[U,D]=n(""),[G,_]=n(""),[z,N]=n({width:"",text:""}),[q,J]=n(!1),K=C(t=>t.interactionData),Q=l(()=>"POST_PURCHASE"===M,[M]),{checkDisableDelete:W,getTooltipText:X,checkDisableDuplicate:Y}=u(i.uid,i.tag||""),tt=["ProductTitle","ProductDescription","ProductPrice"],te=["ArticleTitle","ArticleContent","ArticleImage","ArticleAuthor","ArticleCategory","ArticleDate","ArticleExcerpt","ArticleTags"],to=[...tt,...te],ti=(t,e)=>{let o=A.length,i=t.getBoundingClientRect(),n=e.getBoundingClientRect();return i.top-n.top<36*o},tn=(t,e)=>{let o=e||t;if(t&&!isSection(t))return notVisible(t)&&ti(e,t)?t:t.parentElement?tn(t.parentElement,o):void 0},tl=r(()=>Z?.childrens?.length||0,[Z?.childrens?.length]),tr=r(()=>{if("Section"==i.tag)return"bottom";let t=document.body.querySelector("#storefront")?.querySelector('[data-toolbar-active="true"]');if(t){let e=t.getBoundingClientRect();e.top<60?j("bottom"):j("top")}},[i.tag]),ta=l(()=>{let t=/^(?:https?:\/\/)?([^/]+)\.myshopify\.com/;return L?L.match(t)?.[1]:""},[L]),td=l(()=>`https://admin.shopify.com/store/${ta}`,[ta]),tC=l(()=>U?`${td}/products/${U}`:"",[td,U]),tc=l(()=>G?`${td}/articles/${G.replace("gid://shopify/Article/","")}`:"",[G,td]),ts=l(()=>K?.isSelectOnPage,[K?.isSelectOnPage]),tp=l(()=>K?.settingType,[K?.settingType]),th=l(()=>K?.item?.targets?.find(t=>t.uid===i.uid&&t?.type!=="PAGE")&&"TARGET"===tp,[K?.item?.targets,i.uid,tp]),tu=l(()=>K?.item?.self?.uid===i.uid&&K?.item?.self.type!=="PAGE"&&"TRIGGER"===tp,[K?.item?.self?.type,K?.item?.self?.uid,i.uid,tp]),tm=l(()=>!th&&!tu,[th,tu]),tg=l(()=>k||S,[k,S]),tf=l(()=>q||S||tl()>25&&"Section"===i.tag,[tl,q,S,i.tag]),tv=r(t=>{let e=t.detail;if(e?.articleId&&_(e.articleId),e?.productId&&D(e.productId),e?.componentUid==i.uid){O(!0),tr(),Q&&($(W()),N(X()),J(Y()));let t=x(i.uid).filter(t=>!("ROOT"===t.uid||"Section"===t.tag&&y||t.editorConfigs?.toolbar?.hide||t.editorConfigs?.component?.noSetting)).slice(0,3);B(t)}else O(!1),B([]),V(!1)},[i.uid,Q,x,W,X,Y,y,tr]);if(a(()=>(window.addEventListener("editor:active-component",tv),()=>{window.removeEventListener("editor:active-component",tv)}),[tv]),"section"===i.type||i.editorConfigs?.toolbar?.hide)return null;let tw=()=>"Section"!==i.tag?-1:Z?.childrens?.length?Z.childrens.findIndex(t=>t==i.uid):-1,tb=t=>{let e=t?.childrens?.length??0;return"Row"===t.label?`Row ${e} col${1===e?"":"s"}`:t.label},tS=t=>{if(!A.length)return;let e=t?.target||null,o=e.closest("[data-toolbar-active]");if(!e||!o)return;if(P)E(!1),V(!1);else{let t=tn(o,o);if(t)E(!0);else{let t=o.getBoundingClientRect();t.top<36*A.length?E(!0):E(!1)}V(!0)}let i=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!P}});window.dispatchEvent(i)},tL=()=>{if(te.includes(i.tag)){window.open(tc,"_blank");return}if(tt.includes(i.tag)){window.open(tC,"_blank");return}window.open(td,"_blank")},tM=t=>{t.preventDefault(),t.stopPropagation();let e=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:i.uid,isThemeSection:b,isShopifySection:S}});return window.dispatchEvent(e),!1},tx=t=>{t.preventDefault(),t.stopPropagation();let e=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:i.uid,isThemeSection:b,isShopifySection:S}});return window.dispatchEvent(e),!1},tZ=t=>{t.preventDefault(),t.stopPropagation();let e=new CustomEvent("editor:toolbar:zoom-out-component",{bubbles:!0,detail:{componentUid:i.uid}});return window.dispatchEvent(e),!1},ty=()=>{H(null),window.removeEventListener("editor:close-add-section-popup",ty)},tR=(t,e)=>{if(t.preventDefault(),t.stopPropagation(),tl()>=25)return!1;let o=t.target;if(o){H(e);let t=o.getBoundingClientRect(),n=new CustomEvent("editor:toolbar:add-section",{bubbles:!0,detail:{componentUid:i.uid,position:e,top:t.top+t.height/2}});window.dispatchEvent(n),window.addEventListener("editor:close-add-section-popup",ty)}return!1},tH=()=>{if(S)return i.name?.includes("Shopify section:")?i.name:`Shopify section: ${i.name}`;let t=i.name&&i.name===`Section ${i.uid}`;return tl()>=20?`${t?"Section":i?.name} ${tw()+1}/25`:t?`Section ${tw()+1}`:i?.name},tP=()=>{let{isShopifySection:t,tag:e}=i;return!t&&(!b||!!y)&&m.includes(e)};return t(e,{children:[!("Section"==i.tag&&y)&&t("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==i.tag,"data-toolbar-theme-section":"Section"==i.tag&&!!b||y,"data-toolbar-shopify-section":"Section"==i.tag&&!!S,"data-toolbar-limit":tw()>=25,children:[t("div",{"data-toolbar-show-parent":!0,onClick:t=>tS(t),"aria-hidden":"true",children:[tu&&o("div",{className:"gp-hidden gp-w-[12px] interaction-use-custom-element",children:o("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o("path",{fillRule:"evenodd",clipRule:"evenodd",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",fill:"#F9F9F9"})})}),th&&o("div",{className:"gp-hidden gp-w-[14px] interaction-use-custom-element",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o("path",{fillRule:"evenodd",clipRule:"evenodd",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",fill:"#F9F9F9"})})}),F&&tm&&o("div",{"data-toolbar-icon-drag":!0,children:t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[o("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"}),o("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"}),o("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"}),o("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"}),o("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"}),o("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"==i.tag?t("div",{"data-toolbar-name":!0,children:[tH(),F&&S&&!i.isShopifyVisibility&&t("svg",{"data-toolbar-visibility":!0,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o("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"}),o("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"}),o("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"})]})]}):o("div",{"data-toolbar-name":!0,children:i.customLabel||i.label}),F&&"Section"!==i.tag&&A.length>0&&o("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":P,children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})})]}),F&&P&&A.map((e,i)=>t("div",{"data-toolbar-parent":!0,"data-component-tag":e.tag,"data-parent-uid":e.uid,"data-toolbar-theme-section":y,"data-toolbar-parent-revert":T,style:{top:T?`${36*(i+1)}px`:`${-36*(i+1)}px`},children:[o("div",{"data-toolbar-icon-drag":!0,children:t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[o("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"}),o("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"}),o("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"}),o("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"}),o("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"}),o("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"})]})}),o("div",{"data-toolbar-name":!0,children:tb(e)})]},e.uid)),F&&!ts&&t(e,{children:[" ","Section"===i.tag&&!i.isThemeSection&&"STATIC"!==M&&"POST_PURCHASE"!==M&&!i.isShopifySection&&25>tw()&&o(c,{...i}),tP()&&o(g,{...i}),"Sticky"==i.tag&&o("div",{"data-toolbar-zoom-out":!0,onClick:t=>tZ(t),"aria-hidden":"true",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o("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"})})}),to.includes(i.tag)&&o(s,{"data-toolbar-title":!0,enable:!0,"data-toolbar-disable":!1,text:"Edit content in Shopify",position:"top",onClick:tL,"aria-hidden":"true",children:t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o("path",{fillRule:"evenodd",clipRule:"evenodd",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",fill:"currentColor"}),o("path",{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",fill:"currentColor"}),o("path",{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",fill:"currentColor"}),o("path",{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",fill:"currentColor"})]})}),o(s,{enable:"Section"==i.tag&&tl()>=25||S,text:S?"Disabled. Please edit in Shopify Editor":"Page has reached Shopify’s 25 section-limit",position:"bottom",width:"200px","data-toolbar-duplicate":!0,"data-toolbar-disable":tf,onClick:tf?void 0:t=>tx(t),"aria-hidden":"true",className:tf?"!gp-cursor-not-allowed":"",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})}),o(s,{"data-toolbar-delete":!0,onClick:t=>tg?null:tM(t),enable:tg,"data-toolbar-disable":tg,text:S?"Disabled. Please edit in Shopify Editor":z.text,width:z.width,position:S?"bottom":I,"aria-hidden":"true",className:tg?"!gp-cursor-not-allowed":"",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})})]}),o(v,{uid:i.uid})]},i.uid),"STATIC"!==M&&"POST_PURCHASE"!==M&&25>tw()&&o(p,{...i}),o("div",{"data-outline":!0,"data-outline-section":"Section"==i.tag,"data-outline-theme-section":"Section"==i.tag&&!!b||y,"data-outline-shopify-section":"Section"==i.tag&&!!S,"data-outline-limit":tw()>=25},"outline-"+i.uid),"Section"==i.tag&&!y&&t(e,{children:[o(s,{enable:tl()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":tl()>=25,"data-toolbar-add-open":"above"==R,onClick:t=>tR(t,"above"),"aria-hidden":"true",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})}),o(s,{enable:tl()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":tl()>=25,"data-toolbar-add-open":"below"==R,onClick:t=>tR(t,"below"),"aria-hidden":"true",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})})]}),m.includes(i.tag)&&F&&o(f,{...i}),F&&o(h,{...i})]})};var ComponentToolbarPreview$1=i(ComponentToolbarPreview);export{ComponentToolbarPreview$1 as default};
|