@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.
- package/dist/cjs/components/AddOn.js +18 -1
- package/dist/cjs/components/ComponentAnimation.js +17 -0
- package/dist/cjs/components/ComponentToolbarPreview.js +752 -1
- package/dist/cjs/components/ComponentWrapper.js +61 -1
- package/dist/cjs/components/ComponentWrapperPreview.js +213 -1
- package/dist/cjs/components/Empty.js +7 -1
- package/dist/cjs/components/InteractionSuffix.js +42 -0
- package/dist/cjs/components/Render.js +75 -1
- package/dist/cjs/components/Render.liquid.js +313 -17
- package/dist/cjs/components/RenderBlock.js +54 -1
- package/dist/cjs/components/RenderCustomCode.js +59 -3
- package/dist/cjs/components/RenderPreview.js +67 -1
- package/dist/cjs/components/RenderSection.js +23 -1
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +252 -1
- package/dist/cjs/components/ai-generator/AIGenContentLoading.js +85 -1
- package/dist/cjs/components/ai-generator/components/PickProduct.js +220 -1
- package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +77 -1
- package/dist/cjs/components/ai-generator/hooks/useCheckingProductInside.js +47 -0
- package/dist/cjs/components/ai-generator/hooks/useFlipPopup.js +110 -0
- package/dist/cjs/components/ai-generator/hooks/useGettingGenerateRequest.js +37 -1
- package/dist/cjs/components/ai-generator/hooks/useListenEventGenerate.js +70 -1
- package/dist/cjs/components/ai-generator/icons/AIIcon.js +67 -1
- package/dist/cjs/components/ai-generator/icons/CloseIcon.js +19 -1
- package/dist/cjs/components/ai-generator/icons/DropdownIcon.js +37 -1
- package/dist/cjs/components/ai-generator/icons/SearchIcon.js +21 -1
- package/dist/cjs/components/ai-generator/icons/ShowMoreIcon.js +21 -1
- package/dist/cjs/components/ai-generator/icons/UpgradeIcon.js +27 -0
- package/dist/cjs/components/ai-generator/icons/WarningIcon.js +31 -0
- package/dist/cjs/components/constant.js +83 -1
- package/dist/cjs/components/resize/Resize.js +16 -1
- package/dist/cjs/components/resize/Spacing.js +260 -1
- package/dist/cjs/components/src/product/helpers/variant-presets.js +56 -1
- package/dist/cjs/components/theme-section/CreateThemeSection.js +123 -1
- package/dist/cjs/components/theme-section/ThemeSectionStatus.js +45 -1
- package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +126 -1
- package/dist/cjs/components/toolbar/Tooltip.js +28 -1
- package/dist/cjs/contexts/AddonContext.js +36 -1
- package/dist/cjs/contexts/ArticleContext.js +39 -1
- package/dist/cjs/contexts/ArticleListContext.js +31 -1
- package/dist/cjs/contexts/BuilderComponent.js +34 -1
- package/dist/cjs/contexts/BuilderContext.js +39 -1
- package/dist/cjs/contexts/BuilderPreviewContext.js +486 -1
- package/dist/cjs/contexts/CartLineContext.js +29 -1
- package/dist/cjs/contexts/CollectionContext.js +38 -1
- package/dist/cjs/contexts/ModalContext.js +47 -1
- package/dist/cjs/contexts/PageContext.js +104 -1
- package/dist/cjs/contexts/ProductContext.js +177 -1
- package/dist/cjs/contexts/ProductListContext.js +32 -1
- package/dist/cjs/contexts/SectionContext.js +53 -1
- package/dist/cjs/contexts/ShopContext.js +107 -1
- package/dist/cjs/graphql/fragments/analytic.generated.js +6 -2
- package/dist/cjs/graphql/fragments/collection-detail.generated.js +6 -2
- package/dist/cjs/graphql/fragments/collection-product.generated.js +6 -2
- package/dist/cjs/graphql/fragments/collection.generated.js +6 -2
- package/dist/cjs/graphql/fragments/custom-code.generated.js +6 -2
- package/dist/cjs/graphql/fragments/custom-font.generated.js +6 -2
- package/dist/cjs/graphql/fragments/data-seo.generated.js +6 -2
- package/dist/cjs/graphql/fragments/media.generated.js +6 -2
- package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +39 -0
- package/dist/cjs/graphql/fragments/product-little.generated.js +7 -2
- package/dist/cjs/graphql/fragments/product-option-value.generated.js +6 -2
- package/dist/cjs/graphql/fragments/product-option.generated.js +6 -2
- package/dist/cjs/graphql/fragments/product.generated.js +6 -2
- package/dist/cjs/graphql/fragments/published-custom-section.generated.js +6 -2
- package/dist/cjs/graphql/fragments/published-page-section.generated.js +6 -2
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +10 -28
- package/dist/cjs/graphql/fragments/published-theme-style.generated.js +6 -2
- package/dist/cjs/graphql/fragments/selected-option.generated.js +6 -2
- package/dist/cjs/graphql/fragments/variant.generated.js +6 -2
- package/dist/cjs/graphql/mutations/page-view-up.generated.js +8 -4
- package/dist/cjs/graphql/queries/articles.generated.js +61 -0
- package/dist/cjs/graphql/queries/blogs.generated.js +69 -0
- package/dist/cjs/graphql/queries/collection-detail-filter.generated.js +16 -2
- package/dist/cjs/graphql/queries/collection.generated.js +14 -2
- package/dist/cjs/graphql/queries/collections.generated.js +9 -2
- package/dist/cjs/graphql/queries/preview-page.generated.js +16 -8
- package/dist/cjs/graphql/queries/product-little-detail.generated.js +11 -2
- package/dist/cjs/graphql/queries/product-medias.generated.js +8 -2
- package/dist/cjs/graphql/queries/product-value-label.generated.js +6 -2
- package/dist/cjs/graphql/queries/product-variants.generated.js +10 -2
- package/dist/cjs/graphql/queries/products.generated.js +17 -3
- package/dist/cjs/graphql/queries/published-shop-metas.js +15 -0
- package/dist/cjs/graphql/queries/published-theme-pages.generated.js +15 -2
- package/dist/cjs/graphql/queries/store-property.generated.js +6 -2
- package/dist/cjs/graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js +6 -2
- package/dist/cjs/graphql-app-api/queries/LibraryTemplate.generated.js +6 -2
- package/dist/cjs/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +6 -2
- package/dist/cjs/graphql-app-api/queries/ShopLibraryPage.generated.js +17 -0
- package/dist/cjs/graphql-app-api/queries/ThemePage.generated.js +6 -2
- package/dist/cjs/helpers/GlobalEvent.js +19 -1
- package/dist/cjs/helpers/align.js +19 -0
- package/dist/cjs/helpers/animations.js +222 -1
- package/dist/cjs/helpers/background.js +235 -1
- package/dist/cjs/helpers/borders.js +198 -4
- package/dist/cjs/helpers/carousel.js +55 -1
- package/dist/cjs/helpers/clone-deep.js +5 -1
- package/dist/cjs/helpers/cls.js +16 -1
- package/dist/cjs/helpers/colors.js +184 -1
- package/dist/cjs/helpers/compose-advance-style.js +327 -1
- package/dist/cjs/helpers/constant.js +23 -1
- package/dist/cjs/helpers/convert.js +7 -1
- package/dist/cjs/helpers/covert-entities-html.js +19 -1
- package/dist/cjs/helpers/css-variable.js +7 -1
- package/dist/cjs/helpers/email.js +11 -1
- package/dist/cjs/helpers/filter-toolbar-preview.js +14 -1
- package/dist/cjs/helpers/flatten-connection.js +9 -1
- package/dist/cjs/helpers/get-resonsive-value.js +36 -1
- package/dist/cjs/helpers/get-shortname.js +92 -1
- package/dist/cjs/helpers/icon-list.js +61 -1
- package/dist/cjs/helpers/interaction/index.js +134 -0
- package/dist/cjs/helpers/is-browser.js +9 -1
- package/dist/cjs/helpers/is-defined.js +7 -1
- package/dist/cjs/helpers/is-empty-children.js +15 -1
- package/dist/cjs/helpers/is-safari.js +9 -1
- package/dist/cjs/helpers/layout.js +59 -1
- package/dist/cjs/helpers/load-script.js +31 -1
- package/dist/cjs/helpers/loop-component.js +16 -0
- package/dist/cjs/helpers/make-style.js +163 -1
- package/dist/cjs/helpers/normalize-builder-data.js +23 -1
- package/dist/cjs/helpers/pascal-to-kebab-case.js +7 -0
- package/dist/cjs/helpers/prefetch-queries.js +78 -1
- package/dist/cjs/helpers/product.js +48 -1
- package/dist/cjs/helpers/queries/get-collection.js +226 -1
- package/dist/cjs/helpers/queries/get-collections.js +21 -1
- package/dist/cjs/helpers/queries/get-product-by-slug.js +125 -1
- package/dist/cjs/helpers/queries/get-product.js +154 -1
- package/dist/cjs/helpers/queries/get-products.js +214 -1
- package/dist/cjs/helpers/query.js +29 -1
- package/dist/cjs/helpers/radius.js +140 -6
- package/dist/cjs/helpers/render.js +78 -1
- package/dist/cjs/helpers/shadow.js +69 -1
- package/dist/cjs/helpers/size.js +206 -4
- package/dist/cjs/helpers/spacing.js +43 -1
- package/dist/cjs/helpers/third-party/addAppBlockId.js +20 -0
- package/dist/cjs/helpers/third-party/appConfig.js +234 -0
- package/dist/cjs/helpers/third-party/appSetting.js +661 -0
- package/dist/cjs/helpers/third-party/composeAppBlockId.js +11 -0
- package/dist/cjs/helpers/third-party/constant.js +43 -0
- package/dist/cjs/helpers/third-party/generateAppBlockConfigs.js +34 -0
- package/dist/cjs/helpers/third-party/getAppBlockConfig.js +47 -0
- package/dist/cjs/helpers/third-party/getAppBlockType.js +12 -0
- package/dist/cjs/helpers/third-party/getAppBlocks.js +30 -0
- package/dist/cjs/helpers/third-party/mergeBlock.js +19 -0
- package/dist/cjs/helpers/third-party/mergeBlockOrder.js +47 -0
- package/dist/cjs/helpers/third-party/removeGPAppItems.js +18 -0
- package/dist/cjs/helpers/tracking/fpixel.js +28 -1
- package/dist/cjs/helpers/tracking/gtag.js +93 -1
- package/dist/cjs/helpers/tracking/tiktokpixel.js +17 -1
- package/dist/cjs/helpers/typography.js +160 -17
- package/dist/cjs/helpers/variant.js +11 -1
- package/dist/cjs/hooks/animation/useAnimationActions.js +39 -1
- package/dist/cjs/hooks/animation/useAnimationConfig.js +30 -1
- package/dist/cjs/hooks/animation/useAnimationPreview.js +31 -1
- package/dist/cjs/hooks/animation/useAnimationTarget.js +122 -1
- package/dist/cjs/hooks/animation/useApplyAnimation.js +89 -1
- package/dist/cjs/hooks/articles/useArticlesQuery.js +33 -1
- package/dist/cjs/hooks/cart/use-add-to-cart.js +20 -1
- package/dist/cjs/hooks/cart/use-cart-data.js +28 -1
- package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +20 -1
- package/dist/cjs/hooks/cart/use-cart-note-update.js +20 -1
- package/dist/cjs/hooks/cart/use-create-cart.js +22 -1
- package/dist/cjs/hooks/cart/use-remove-cart-item.js +20 -1
- package/dist/cjs/hooks/cart/use-update-cart-item.js +20 -1
- package/dist/cjs/hooks/shop/use-collection-query.js +22 -1
- package/dist/cjs/hooks/shop/use-collections-query.js +17 -1
- package/dist/cjs/hooks/shop/use-product-query.js +22 -1
- package/dist/cjs/hooks/shop/use-products-query.js +63 -1
- package/dist/cjs/hooks/shop.js +126 -1
- package/dist/cjs/hooks/use-current-device.js +30 -1
- package/dist/cjs/hooks/use-lazy-video.js +15 -1
- package/dist/cjs/hooks/useAnimations.js +29 -1
- package/dist/cjs/hooks/useCartId.js +44 -1
- package/dist/cjs/hooks/useCartLine.js +11 -1
- package/dist/cjs/hooks/useCartUI.js +48 -1
- package/dist/cjs/hooks/useCollection.js +9 -1
- package/dist/cjs/hooks/useFetchHandle.js +13 -1
- package/dist/cjs/hooks/useFormatMoney.js +75 -1
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +128 -1
- package/dist/cjs/hooks/useInteraction.js +19 -0
- package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +10 -1
- package/dist/cjs/hooks/useLoadScript.js +32 -1
- package/dist/cjs/hooks/useMoney.js +84 -1
- package/dist/cjs/hooks/usePrevious.js +19 -1
- package/dist/cjs/hooks/useProduct.js +245 -1
- package/dist/cjs/hooks/useProductList.js +21 -1
- package/dist/cjs/hooks/useSuspenseFetch.js +27 -1
- package/dist/cjs/hooks/useSwatchesOptions.js +41 -1
- package/dist/cjs/hooks/useToolbarPostPurchase.js +89 -1
- package/dist/cjs/index.js +416 -1
- package/dist/cjs/types/animations.js +49 -1
- package/dist/cjs/types/appAPI.js +2 -1
- package/dist/cjs/types/custom.js +52 -0
- package/dist/cjs/types/global-style.js +15 -1
- package/dist/cjs/types/shop.js +2 -1
- package/dist/cjs/web-components/src/helpers/styles/constant.js +9 -1
- package/dist/esm/components/AddOn.js +14 -1
- package/dist/esm/components/ComponentAnimation.js +13 -0
- package/dist/esm/components/ComponentToolbarPreview.js +748 -1
- package/dist/esm/components/ComponentWrapper.js +57 -1
- package/dist/esm/components/ComponentWrapperPreview.js +209 -1
- package/dist/esm/components/Empty.js +3 -1
- package/dist/esm/components/InteractionSuffix.js +40 -0
- package/dist/esm/components/Render.js +71 -1
- package/dist/esm/components/Render.liquid.js +307 -17
- package/dist/esm/components/RenderBlock.js +50 -1
- package/dist/esm/components/RenderCustomCode.js +55 -3
- package/dist/esm/components/RenderPreview.js +63 -1
- package/dist/esm/components/RenderSection.js +19 -1
- package/dist/esm/components/ai-generator/AIContentGenerator.js +250 -1
- package/dist/esm/components/ai-generator/AIGenContentLoading.js +83 -1
- package/dist/esm/components/ai-generator/components/PickProduct.js +218 -1
- package/dist/esm/components/ai-generator/components/ToneAndVoice.js +75 -1
- package/dist/esm/components/ai-generator/hooks/useCheckingProductInside.js +45 -0
- package/dist/esm/components/ai-generator/hooks/useFlipPopup.js +108 -0
- package/dist/esm/components/ai-generator/hooks/useGettingGenerateRequest.js +35 -1
- package/dist/esm/components/ai-generator/hooks/useListenEventGenerate.js +68 -1
- package/dist/esm/components/ai-generator/icons/AIIcon.js +65 -1
- package/dist/esm/components/ai-generator/icons/CloseIcon.js +17 -1
- package/dist/esm/components/ai-generator/icons/DropdownIcon.js +34 -1
- package/dist/esm/components/ai-generator/icons/SearchIcon.js +19 -1
- package/dist/esm/components/ai-generator/icons/ShowMoreIcon.js +19 -1
- package/dist/esm/components/ai-generator/icons/UpgradeIcon.js +25 -0
- package/dist/esm/components/ai-generator/icons/WarningIcon.js +29 -0
- package/dist/esm/components/constant.js +76 -1
- package/dist/esm/components/resize/Resize.js +12 -1
- package/dist/esm/components/resize/Spacing.js +256 -1
- package/dist/esm/components/src/product/helpers/variant-presets.js +54 -1
- package/dist/esm/components/theme-section/CreateThemeSection.js +121 -1
- package/dist/esm/components/theme-section/ThemeSectionStatus.js +43 -1
- package/dist/esm/components/theme-section/ThemeSectionTooltip.js +124 -1
- package/dist/esm/components/toolbar/Tooltip.js +24 -1
- package/dist/esm/contexts/AddonContext.js +32 -1
- package/dist/esm/contexts/ArticleContext.js +36 -1
- package/dist/esm/contexts/ArticleListContext.js +27 -1
- package/dist/esm/contexts/BuilderComponent.js +31 -1
- package/dist/esm/contexts/BuilderContext.js +36 -1
- package/dist/esm/contexts/BuilderPreviewContext.js +483 -1
- package/dist/esm/contexts/CartLineContext.js +26 -1
- package/dist/esm/contexts/CollectionContext.js +35 -1
- package/dist/esm/contexts/ModalContext.js +44 -1
- package/dist/esm/contexts/PageContext.js +101 -1
- package/dist/esm/contexts/ProductContext.js +174 -1
- package/dist/esm/contexts/ProductListContext.js +28 -1
- package/dist/esm/contexts/SectionContext.js +49 -1
- package/dist/esm/contexts/ShopContext.js +104 -1
- package/dist/esm/graphql/fragments/analytic.generated.js +4 -2
- package/dist/esm/graphql/fragments/collection-detail.generated.js +4 -2
- package/dist/esm/graphql/fragments/collection-product.generated.js +4 -2
- package/dist/esm/graphql/fragments/collection.generated.js +4 -2
- package/dist/esm/graphql/fragments/custom-code.generated.js +4 -2
- package/dist/esm/graphql/fragments/custom-font.generated.js +4 -2
- package/dist/esm/graphql/fragments/data-seo.generated.js +4 -2
- package/dist/esm/graphql/fragments/media.generated.js +4 -2
- package/dist/esm/graphql/fragments/preview-theme-page.generated.js +37 -0
- package/dist/esm/graphql/fragments/product-little.generated.js +5 -2
- package/dist/esm/graphql/fragments/product-option-value.generated.js +4 -2
- package/dist/esm/graphql/fragments/product-option.generated.js +4 -2
- package/dist/esm/graphql/fragments/product.generated.js +4 -2
- package/dist/esm/graphql/fragments/published-custom-section.generated.js +4 -2
- package/dist/esm/graphql/fragments/published-page-section.generated.js +4 -2
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +8 -28
- package/dist/esm/graphql/fragments/published-theme-style.generated.js +4 -2
- package/dist/esm/graphql/fragments/selected-option.generated.js +4 -2
- package/dist/esm/graphql/fragments/variant.generated.js +4 -2
- package/dist/esm/graphql/mutations/page-view-up.generated.js +6 -4
- package/dist/esm/graphql/queries/articles.generated.js +59 -0
- package/dist/esm/graphql/queries/blogs.generated.js +67 -0
- package/dist/esm/graphql/queries/collection-detail-filter.generated.js +22 -10
- package/dist/esm/graphql/queries/collection.generated.js +18 -8
- package/dist/esm/graphql/queries/collections.generated.js +8 -3
- package/dist/esm/graphql/queries/preview-page.generated.js +16 -10
- package/dist/esm/graphql/queries/product-little-detail.generated.js +12 -5
- package/dist/esm/graphql/queries/product-medias.generated.js +6 -2
- package/dist/esm/graphql/queries/product-value-label.generated.js +4 -2
- package/dist/esm/graphql/queries/product-variants.generated.js +10 -4
- package/dist/esm/graphql/queries/products.generated.js +20 -9
- package/dist/esm/graphql/queries/published-shop-metas.js +13 -0
- package/dist/esm/graphql/queries/published-theme-pages.generated.js +20 -9
- package/dist/esm/graphql/queries/store-property.generated.js +4 -2
- package/dist/esm/graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js +4 -2
- package/dist/esm/graphql-app-api/queries/LibraryTemplate.generated.js +4 -2
- package/dist/esm/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +4 -2
- package/dist/esm/graphql-app-api/queries/ShopLibraryPage.generated.js +15 -0
- package/dist/esm/graphql-app-api/queries/ThemePage.generated.js +4 -2
- package/dist/esm/helpers/GlobalEvent.js +15 -1
- package/dist/esm/helpers/align.js +17 -0
- package/dist/esm/helpers/animations.js +220 -1
- package/dist/esm/helpers/background.js +226 -1
- package/dist/esm/helpers/borders.js +189 -4
- package/dist/esm/helpers/carousel.js +51 -1
- package/dist/esm/helpers/clone-deep.js +3 -1
- package/dist/esm/helpers/cls.js +14 -1
- package/dist/esm/helpers/colors.js +169 -1
- package/dist/esm/helpers/compose-advance-style.js +319 -1
- package/dist/esm/helpers/constant.js +19 -1
- package/dist/esm/helpers/convert.js +4 -1
- package/dist/esm/helpers/covert-entities-html.js +17 -1
- package/dist/esm/helpers/css-variable.js +5 -1
- package/dist/esm/helpers/email.js +6 -1
- package/dist/esm/helpers/filter-toolbar-preview.js +9 -1
- package/dist/esm/helpers/flatten-connection.js +7 -1
- package/dist/esm/helpers/get-resonsive-value.js +31 -1
- package/dist/esm/helpers/get-shortname.js +90 -1
- package/dist/esm/helpers/icon-list.js +58 -1
- package/dist/esm/helpers/interaction/index.js +132 -0
- package/dist/esm/helpers/is-browser.js +5 -1
- package/dist/esm/helpers/is-defined.js +5 -1
- package/dist/esm/helpers/is-empty-children.js +10 -1
- package/dist/esm/helpers/is-safari.js +5 -1
- package/dist/esm/helpers/layout.js +54 -1
- package/dist/esm/helpers/load-script.js +29 -1
- package/dist/esm/helpers/loop-component.js +14 -0
- package/dist/esm/helpers/make-style.js +149 -1
- package/dist/esm/helpers/normalize-builder-data.js +21 -1
- package/dist/esm/helpers/pascal-to-kebab-case.js +5 -0
- package/dist/esm/helpers/prefetch-queries.js +76 -1
- package/dist/esm/helpers/product.js +44 -1
- package/dist/esm/helpers/queries/get-collection.js +223 -1
- package/dist/esm/helpers/queries/get-collections.js +19 -1
- package/dist/esm/helpers/queries/get-product-by-slug.js +123 -1
- package/dist/esm/helpers/queries/get-product.js +150 -1
- package/dist/esm/helpers/queries/get-products.js +210 -1
- package/dist/esm/helpers/query.js +25 -1
- package/dist/esm/helpers/radius.js +132 -6
- package/dist/esm/helpers/render.js +70 -1
- package/dist/esm/helpers/shadow.js +63 -1
- package/dist/esm/helpers/size.js +192 -4
- package/dist/esm/helpers/spacing.js +40 -1
- package/dist/esm/helpers/third-party/addAppBlockId.js +18 -0
- package/dist/esm/helpers/third-party/appConfig.js +200 -0
- package/dist/esm/helpers/third-party/appSetting.js +658 -0
- package/dist/esm/helpers/third-party/composeAppBlockId.js +9 -0
- package/dist/esm/helpers/third-party/constant.js +40 -0
- package/dist/esm/helpers/third-party/generateAppBlockConfigs.js +32 -0
- package/dist/esm/helpers/third-party/getAppBlockConfig.js +45 -0
- package/dist/esm/helpers/third-party/getAppBlockType.js +10 -0
- package/dist/esm/helpers/third-party/getAppBlocks.js +28 -0
- package/dist/esm/helpers/third-party/mergeBlock.js +17 -0
- package/dist/esm/helpers/third-party/mergeBlockOrder.js +45 -0
- package/dist/esm/helpers/third-party/removeGPAppItems.js +15 -0
- package/dist/esm/helpers/tracking/fpixel.js +24 -1
- package/dist/esm/helpers/tracking/gtag.js +87 -1
- package/dist/esm/helpers/tracking/tiktokpixel.js +15 -1
- package/dist/esm/helpers/typography.js +149 -17
- package/dist/esm/helpers/variant.js +9 -1
- package/dist/esm/hooks/animation/useAnimationActions.js +37 -1
- package/dist/esm/hooks/animation/useAnimationConfig.js +28 -1
- package/dist/esm/hooks/animation/useAnimationPreview.js +29 -1
- package/dist/esm/hooks/animation/useAnimationTarget.js +120 -1
- package/dist/esm/hooks/animation/useApplyAnimation.js +85 -1
- package/dist/esm/hooks/articles/useArticlesQuery.js +30 -1
- package/dist/esm/hooks/cart/use-add-to-cart.js +18 -1
- package/dist/esm/hooks/cart/use-cart-data.js +26 -1
- package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +18 -1
- package/dist/esm/hooks/cart/use-cart-note-update.js +18 -1
- package/dist/esm/hooks/cart/use-create-cart.js +20 -1
- package/dist/esm/hooks/cart/use-remove-cart-item.js +18 -1
- package/dist/esm/hooks/cart/use-update-cart-item.js +18 -1
- package/dist/esm/hooks/shop/use-collection-query.js +20 -1
- package/dist/esm/hooks/shop/use-collections-query.js +15 -1
- package/dist/esm/hooks/shop/use-product-query.js +20 -1
- package/dist/esm/hooks/shop/use-products-query.js +59 -1
- package/dist/esm/hooks/shop.js +111 -1
- package/dist/esm/hooks/use-current-device.js +28 -1
- package/dist/esm/hooks/use-lazy-video.js +13 -1
- package/dist/esm/hooks/useAnimations.js +27 -1
- package/dist/esm/hooks/useCartId.js +40 -1
- package/dist/esm/hooks/useCartLine.js +7 -1
- package/dist/esm/hooks/useCartUI.js +44 -1
- package/dist/esm/hooks/useCollection.js +7 -1
- package/dist/esm/hooks/useFetchHandle.js +11 -1
- package/dist/esm/hooks/useFormatMoney.js +71 -1
- package/dist/esm/hooks/useInitialSwatchesOptions.js +124 -1
- package/dist/esm/hooks/useInteraction.js +17 -0
- package/dist/esm/hooks/useIsomorphicLayoutEffect.js +6 -1
- package/dist/esm/hooks/useLoadScript.js +28 -1
- package/dist/esm/hooks/useMoney.js +80 -1
- package/dist/esm/hooks/usePrevious.js +17 -1
- package/dist/esm/hooks/useProduct.js +228 -1
- package/dist/esm/hooks/useProductList.js +16 -1
- package/dist/esm/hooks/useSuspenseFetch.js +23 -1
- package/dist/esm/hooks/useSwatchesOptions.js +37 -1
- package/dist/esm/hooks/useToolbarPostPurchase.js +87 -1
- package/dist/esm/index.js +117 -1
- package/dist/esm/types/animations.js +49 -1
- package/dist/esm/types/custom.js +52 -0
- package/dist/esm/types/global-style.js +12 -1
- package/dist/esm/web-components/src/helpers/styles/constant.js +7 -1
- package/dist/types/index.d.ts +23183 -17335
- package/package.json +5 -3
- package/dist/cjs/components/animation/AnimationWrapper.js +0 -1
- package/dist/cjs/hooks/animation/animations.js +0 -1
- package/dist/cjs/hooks/animation/useLivePageAnimation.js +0 -1
- package/dist/esm/components/animation/AnimationWrapper.js +0 -1
- package/dist/esm/hooks/animation/animations.js +0 -1
- package/dist/esm/hooks/animation/useLivePageAnimation.js +0 -1
|
@@ -1 +1,17 @@
|
|
|
1
|
-
import{useRef
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const usePrevious = (value)=>{
|
|
4
|
+
// The ref object is a generic container whose current property is mutable ...
|
|
5
|
+
// ... and can hold any value, similar to an instance property on a class
|
|
6
|
+
const ref = useRef();
|
|
7
|
+
// Store current value in ref
|
|
8
|
+
useEffect(()=>{
|
|
9
|
+
ref.current = value;
|
|
10
|
+
}, [
|
|
11
|
+
value
|
|
12
|
+
]); // Only re-run if value changes
|
|
13
|
+
// Return previous value (happens before update in useEffect above)
|
|
14
|
+
return ref.current;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { usePrevious };
|
|
@@ -1 +1,228 @@
|
|
|
1
|
-
import{useCallback
|
|
1
|
+
import { useCallback, useEffect, useMemo } from 'react';
|
|
2
|
+
import { useProductStore } from '../contexts/ProductContext.js';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'zustand';
|
|
5
|
+
import { usePageStore } from '../contexts/PageContext.js';
|
|
6
|
+
import 'swr';
|
|
7
|
+
import '@gem-sdk/adapter-shopify';
|
|
8
|
+
import 'swr/mutation';
|
|
9
|
+
import 'swr/infinite';
|
|
10
|
+
import 'vanilla-lazyload';
|
|
11
|
+
import './useCartUI.js';
|
|
12
|
+
import { checkInStock } from '../helpers/variant.js';
|
|
13
|
+
import 'react-transition-group';
|
|
14
|
+
import '@gem-sdk/core';
|
|
15
|
+
import 'classnames';
|
|
16
|
+
import 'dayjs';
|
|
17
|
+
import { flattenConnection } from '../helpers/flatten-connection.js';
|
|
18
|
+
import '../helpers/convert.js';
|
|
19
|
+
import { getSelectedVariant } from '../helpers/product.js';
|
|
20
|
+
|
|
21
|
+
const useUniqProductID = ()=>{
|
|
22
|
+
return useProductStore((s)=>s.uiqueId);
|
|
23
|
+
};
|
|
24
|
+
const useProduct = ()=>{
|
|
25
|
+
return useProductStore((s)=>s.product);
|
|
26
|
+
};
|
|
27
|
+
const useFeaturedImageGlobal = ()=>{
|
|
28
|
+
return useProductStore((s)=>s.featuredImageGlobal);
|
|
29
|
+
};
|
|
30
|
+
const useProductProperties = ()=>{
|
|
31
|
+
return useProductStore((s)=>s.properties);
|
|
32
|
+
};
|
|
33
|
+
const useIsSyncProduct = ()=>{
|
|
34
|
+
return useProductStore((s)=>s.isSyncProduct);
|
|
35
|
+
};
|
|
36
|
+
const useProductBundleDiscount = ()=>{
|
|
37
|
+
const useProductCompareAtPrice = useProductStore((s)=>s.useProductCompareAtPrice);
|
|
38
|
+
const seUseProductCompareAtPrice = useProductStore((s)=>s.setUseProductCompareAtPrice);
|
|
39
|
+
return {
|
|
40
|
+
useProductCompareAtPrice,
|
|
41
|
+
seUseProductCompareAtPrice
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const useQuantity = ()=>{
|
|
45
|
+
const quantity = useProductStore((s)=>s.quantity);
|
|
46
|
+
const hasUpdatePrice = useProductStore((s)=>s.updatePrice);
|
|
47
|
+
const decrement = useProductStore((s)=>s.decrementQuantity);
|
|
48
|
+
const increment = useProductStore((s)=>s.incrementQuantity);
|
|
49
|
+
const updateQuantity = useProductStore((s)=>s.setQuantity);
|
|
50
|
+
const updatePrice = useProductStore((s)=>s.setHasUpdatePriceFollowQuantity);
|
|
51
|
+
const isSyncProduct = useProductStore((s)=>s.isSyncProduct);
|
|
52
|
+
const product = useProductStore((s)=>s.product);
|
|
53
|
+
const productId = product?.id;
|
|
54
|
+
const reset = useCallback(()=>{
|
|
55
|
+
updateQuantity(1);
|
|
56
|
+
}, [
|
|
57
|
+
updateQuantity
|
|
58
|
+
]);
|
|
59
|
+
useEffect(()=>{
|
|
60
|
+
if (isSyncProduct) {
|
|
61
|
+
const setOption = new CustomEvent('set-product-quantity', {
|
|
62
|
+
bubbles: true,
|
|
63
|
+
cancelable: true,
|
|
64
|
+
composed: true,
|
|
65
|
+
detail: {
|
|
66
|
+
quantity,
|
|
67
|
+
productId
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
window.dispatchEvent(setOption);
|
|
71
|
+
}
|
|
72
|
+
}, [
|
|
73
|
+
quantity,
|
|
74
|
+
isSyncProduct,
|
|
75
|
+
productId
|
|
76
|
+
]);
|
|
77
|
+
return useMemo(()=>({
|
|
78
|
+
quantity,
|
|
79
|
+
hasUpdatePrice,
|
|
80
|
+
increment,
|
|
81
|
+
decrement,
|
|
82
|
+
reset,
|
|
83
|
+
setQuantity: updateQuantity,
|
|
84
|
+
setUpdatePrice: updatePrice
|
|
85
|
+
}), [
|
|
86
|
+
decrement,
|
|
87
|
+
increment,
|
|
88
|
+
quantity,
|
|
89
|
+
reset,
|
|
90
|
+
updateQuantity,
|
|
91
|
+
updatePrice,
|
|
92
|
+
hasUpdatePrice
|
|
93
|
+
]);
|
|
94
|
+
};
|
|
95
|
+
const useHasPreSelected = ()=>{
|
|
96
|
+
const hasPreSelected = useProductStore((s)=>s.hasPreSelected);
|
|
97
|
+
const setHasPreSelected = useProductStore((s)=>s.setHasPreSelected);
|
|
98
|
+
return useMemo(()=>({
|
|
99
|
+
hasPreSelected,
|
|
100
|
+
setHasPreSelected
|
|
101
|
+
}), [
|
|
102
|
+
hasPreSelected,
|
|
103
|
+
setHasPreSelected
|
|
104
|
+
]);
|
|
105
|
+
};
|
|
106
|
+
const useSelectedOption = ()=>{
|
|
107
|
+
const setSelectedOption = useProductStore((s)=>s.setSelectedOption);
|
|
108
|
+
const selectedOptions = useProductStore((s)=>s.selectedOptions);
|
|
109
|
+
const forceSelectedOption = useProductStore((s)=>s.forceSelectedOption);
|
|
110
|
+
const isSyncProduct = useProductStore((s)=>s.isSyncProduct);
|
|
111
|
+
const updateOption = useCallback((optionId, optionValue, productId, noEmit)=>{
|
|
112
|
+
if (!noEmit && isSyncProduct) {
|
|
113
|
+
const setOption = new CustomEvent('set-selected-option', {
|
|
114
|
+
bubbles: true,
|
|
115
|
+
cancelable: true,
|
|
116
|
+
composed: true,
|
|
117
|
+
detail: {
|
|
118
|
+
optionId,
|
|
119
|
+
optionValue,
|
|
120
|
+
productId
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
window.dispatchEvent(setOption);
|
|
124
|
+
}
|
|
125
|
+
setSelectedOption(optionId, optionValue);
|
|
126
|
+
}, [
|
|
127
|
+
setSelectedOption,
|
|
128
|
+
isSyncProduct
|
|
129
|
+
]);
|
|
130
|
+
const forceOption = useCallback((selectedOption, productId, noEmit)=>{
|
|
131
|
+
if (!noEmit && isSyncProduct) {
|
|
132
|
+
const forceOption = new CustomEvent('force-selected-option', {
|
|
133
|
+
bubbles: true,
|
|
134
|
+
cancelable: true,
|
|
135
|
+
composed: true,
|
|
136
|
+
detail: {
|
|
137
|
+
selectedOption,
|
|
138
|
+
productId
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
window.dispatchEvent(forceOption);
|
|
142
|
+
}
|
|
143
|
+
forceSelectedOption(selectedOption);
|
|
144
|
+
}, [
|
|
145
|
+
forceSelectedOption,
|
|
146
|
+
isSyncProduct
|
|
147
|
+
]);
|
|
148
|
+
return useMemo(()=>({
|
|
149
|
+
selectedOptions,
|
|
150
|
+
setSelectedOption: updateOption,
|
|
151
|
+
forceSelectedOption: forceOption
|
|
152
|
+
}), [
|
|
153
|
+
selectedOptions,
|
|
154
|
+
updateOption,
|
|
155
|
+
forceOption
|
|
156
|
+
]);
|
|
157
|
+
};
|
|
158
|
+
const useVariants = ()=>{
|
|
159
|
+
const variants = useProductStore((s)=>s.product?.variants);
|
|
160
|
+
return flattenConnection(variants);
|
|
161
|
+
};
|
|
162
|
+
const useVariant = (id)=>{
|
|
163
|
+
const variants = useVariants();
|
|
164
|
+
return useMemo(()=>variants?.find((v)=>v?.id === id), [
|
|
165
|
+
id,
|
|
166
|
+
variants
|
|
167
|
+
]);
|
|
168
|
+
};
|
|
169
|
+
const useCurrentVariant = ()=>{
|
|
170
|
+
const { selectedOptions } = useSelectedOption();
|
|
171
|
+
const variants = useVariants();
|
|
172
|
+
return useMemo(()=>getSelectedVariant(variants, selectedOptions), [
|
|
173
|
+
selectedOptions,
|
|
174
|
+
variants
|
|
175
|
+
]);
|
|
176
|
+
};
|
|
177
|
+
const useCurrentVariantInStock = ()=>{
|
|
178
|
+
const currentVariant = useCurrentVariant();
|
|
179
|
+
const currentProduct = useProduct();
|
|
180
|
+
return checkInStock(currentVariant, currentProduct);
|
|
181
|
+
};
|
|
182
|
+
const useVariantOutStock = (optionId, optionValue, options)=>{
|
|
183
|
+
const { selectedOptions } = useSelectedOption();
|
|
184
|
+
const variants = useVariants();
|
|
185
|
+
const lastPos = options.optionNumber - 1;
|
|
186
|
+
if (options.position < lastPos) {
|
|
187
|
+
return variants.some((variant)=>{
|
|
188
|
+
if (variant) {
|
|
189
|
+
const { selectedOptions } = variant;
|
|
190
|
+
const opt = selectedOptions?.some((option)=>option?.name === optionId && option.value === optionValue);
|
|
191
|
+
const isInStock = checkInStock(variant);
|
|
192
|
+
return opt && isInStock;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
const matchedVariant = getSelectedVariant(variants, {
|
|
197
|
+
...selectedOptions,
|
|
198
|
+
[optionId]: optionValue
|
|
199
|
+
});
|
|
200
|
+
return checkInStock(matchedVariant);
|
|
201
|
+
};
|
|
202
|
+
const useCheckAvailableVariantInStock = (optionId, optionValue)=>{
|
|
203
|
+
const variants = useVariants();
|
|
204
|
+
return variants ? variants.some((item)=>{
|
|
205
|
+
if (item) {
|
|
206
|
+
const { selectedOptions } = item;
|
|
207
|
+
const opt = selectedOptions?.some((option)=>option?.name === optionId && option.value === optionValue);
|
|
208
|
+
const isInStock = checkInStock(item);
|
|
209
|
+
return opt && isInStock;
|
|
210
|
+
}
|
|
211
|
+
return false;
|
|
212
|
+
}) : false;
|
|
213
|
+
};
|
|
214
|
+
const useProductOfferDiscount = ()=>{
|
|
215
|
+
const productOffers = usePageStore((s)=>s.productOffers);
|
|
216
|
+
const currentProduct = useProduct();
|
|
217
|
+
const currentVariant = useCurrentVariant();
|
|
218
|
+
const currentOffer = productOffers?.find((item)=>item?.node?.objectBaseID === currentProduct?.baseID)?.node;
|
|
219
|
+
if (!currentOffer || !currentOffer.isEnabled) return 0;
|
|
220
|
+
let currentDiscount = currentOffer?.value;
|
|
221
|
+
if (currentOffer && currentOffer.valueType === 'PERCENTAGE' && currentDiscount) {
|
|
222
|
+
const price = currentVariant?.price || 0;
|
|
223
|
+
currentDiscount = currentDiscount * price / 100;
|
|
224
|
+
}
|
|
225
|
+
return currentDiscount || 0;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useHasPreSelected, useIsSyncProduct, useProduct, useProductBundleDiscount, useProductOfferDiscount, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants };
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
import{useProductListStore
|
|
1
|
+
import { useProductListStore } from '../contexts/ProductListContext.js';
|
|
2
|
+
|
|
3
|
+
const useProductList = ()=>{
|
|
4
|
+
return useProductListStore((s)=>s.collection);
|
|
5
|
+
};
|
|
6
|
+
const useProductListProducts = ()=>{
|
|
7
|
+
return useProductListStore((s)=>s.products);
|
|
8
|
+
};
|
|
9
|
+
const useProductListSettings = ()=>{
|
|
10
|
+
return useProductListStore((s)=>s.settings);
|
|
11
|
+
};
|
|
12
|
+
const useProductListStyles = ()=>{
|
|
13
|
+
return useProductListStore((s)=>s.styles);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { useProductList, useProductListProducts, useProductListSettings, useProductListStyles };
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
const cache = new Map();
|
|
2
|
+
const useSuspenseFetch = (key, promise)=>{
|
|
3
|
+
const value = cache.get(key) || {
|
|
4
|
+
status: 'new',
|
|
5
|
+
data: null
|
|
6
|
+
};
|
|
7
|
+
if (value.status === 'resolved') {
|
|
8
|
+
return {
|
|
9
|
+
data: value.data
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
promise().then((data)=>{
|
|
13
|
+
value.status = 'resolved';
|
|
14
|
+
value.data = data;
|
|
15
|
+
cache.set(key, value);
|
|
16
|
+
}).catch(()=>{
|
|
17
|
+
value.status = 'error';
|
|
18
|
+
value.data = null;
|
|
19
|
+
});
|
|
20
|
+
throw promise();
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { useSuspenseFetch as default };
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
import{useSwatches
|
|
1
|
+
import { useSwatches } from './shop.js';
|
|
2
|
+
|
|
3
|
+
const initialSwatchOptionValue = {
|
|
4
|
+
label: '',
|
|
5
|
+
colors: [],
|
|
6
|
+
imageUrl: ''
|
|
7
|
+
};
|
|
8
|
+
const initialGlobalSwatchesData = {
|
|
9
|
+
optionTitle: '',
|
|
10
|
+
optionType: '',
|
|
11
|
+
optionValues: []
|
|
12
|
+
};
|
|
13
|
+
const useSwatchesOptions = (options)=>{
|
|
14
|
+
const { swatches } = useSwatches();
|
|
15
|
+
if (!options) return [];
|
|
16
|
+
return options?.map((option)=>{
|
|
17
|
+
const swatchOption = swatches?.find((sw)=>sw?.optionTitle === option?.name) || {
|
|
18
|
+
...initialGlobalSwatchesData
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
...option,
|
|
22
|
+
optionType: swatchOption ? swatchOption.optionType : '',
|
|
23
|
+
values: option.values?.map((val)=>{
|
|
24
|
+
const swatchValue = swatchOption && swatchOption?.optionValues?.find((swatOp)=>swatOp?.label === val?.label) || {
|
|
25
|
+
...initialSwatchOptionValue
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
...val,
|
|
29
|
+
colors: swatchValue?.colors || [],
|
|
30
|
+
imageUrl: swatchValue?.imageUrl || ''
|
|
31
|
+
};
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { useSwatchesOptions as default };
|
|
@@ -1 +1,87 @@
|
|
|
1
|
-
import{postPurchaseRequiredElements
|
|
1
|
+
import { postPurchaseRequiredElements, postPurchaseWrapElements } from '../components/constant.js';
|
|
2
|
+
import { useShopStore } from '../contexts/ShopContext.js';
|
|
3
|
+
|
|
4
|
+
const usePostPurchase = (uid, tag)=>{
|
|
5
|
+
const editingPageType = useShopStore((s)=>s.pageType);
|
|
6
|
+
const getElementCountInPage = (tagParam, root)=>{
|
|
7
|
+
const tagUsed = tagParam || tag;
|
|
8
|
+
let count = 0;
|
|
9
|
+
const elements = (root || document).querySelectorAll(`[data-component-tag="${tagUsed}"]`);
|
|
10
|
+
if (tagUsed === 'PostPurchaseProductOffer') {
|
|
11
|
+
return elements.length;
|
|
12
|
+
}
|
|
13
|
+
let isCountedWrapper = '';
|
|
14
|
+
elements.forEach((element)=>{
|
|
15
|
+
const isWrappedByProductOffer = element.closest('[data-component-tag="PostPurchaseProductOffer"]');
|
|
16
|
+
const productId = isWrappedByProductOffer?.getAttribute('data-uid') || '';
|
|
17
|
+
const productWrapper = element.closest('[data-component-tag="Product"]');
|
|
18
|
+
const elementCounted = productWrapper?.querySelectorAll(`[data-component-tag="${tagUsed}"]`).length || 0;
|
|
19
|
+
const offset = isWrappedByProductOffer ? productId !== isCountedWrapper ? elementCounted : 0 : 1;
|
|
20
|
+
if (isWrappedByProductOffer) {
|
|
21
|
+
isCountedWrapper = productId;
|
|
22
|
+
}
|
|
23
|
+
count += offset;
|
|
24
|
+
});
|
|
25
|
+
return count;
|
|
26
|
+
};
|
|
27
|
+
const verifyRequireElement = ()=>{
|
|
28
|
+
const count = getElementCountInPage();
|
|
29
|
+
return count <= 1;
|
|
30
|
+
};
|
|
31
|
+
const verifyWrapContainsRequireElement = ()=>{
|
|
32
|
+
const $component = document.body.querySelector('#storefront')?.querySelector(`[data-uid="${uid}"]`);
|
|
33
|
+
if (!$component) return false;
|
|
34
|
+
for (const requiredElementTag of postPurchaseRequiredElements){
|
|
35
|
+
const countElementInsidePage = getElementCountInPage(requiredElementTag);
|
|
36
|
+
const countElementInsideWrap = getElementCountInPage(requiredElementTag, $component);
|
|
37
|
+
if (countElementInsideWrap > 0 && countElementInsidePage - countElementInsideWrap < 1) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
};
|
|
43
|
+
const countRequiredElement = ()=>{
|
|
44
|
+
return postPurchaseRequiredElements.reduce((acc, requiredElementTag)=>{
|
|
45
|
+
const $component = document.body.querySelector('#storefront')?.querySelector(`[data-uid="${uid}"]`);
|
|
46
|
+
if (!$component) return 0;
|
|
47
|
+
const count = $component.querySelectorAll(`[data-component-tag="${requiredElementTag}"]`).length;
|
|
48
|
+
return acc + count;
|
|
49
|
+
}, 0);
|
|
50
|
+
};
|
|
51
|
+
const checkDisableDelete = ()=>{
|
|
52
|
+
if (editingPageType !== 'POST_PURCHASE') return false;
|
|
53
|
+
let isUnable = false;
|
|
54
|
+
if (postPurchaseRequiredElements.includes(tag)) {
|
|
55
|
+
isUnable = verifyRequireElement();
|
|
56
|
+
if (isUnable) return isUnable;
|
|
57
|
+
}
|
|
58
|
+
if (postPurchaseWrapElements.includes(tag) && countRequiredElement() > 0) {
|
|
59
|
+
return verifyWrapContainsRequireElement();
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
};
|
|
63
|
+
const checkDisableDuplicate = ()=>{
|
|
64
|
+
return editingPageType === 'GP_FUNNEL_PAGE' && tag === 'ProductList';
|
|
65
|
+
};
|
|
66
|
+
const getTooltipText = ()=>{
|
|
67
|
+
if (postPurchaseRequiredElements.includes(tag)) {
|
|
68
|
+
return {
|
|
69
|
+
text: 'This element is required <br> and can’t be deleted',
|
|
70
|
+
width: '175px'
|
|
71
|
+
};
|
|
72
|
+
} else {
|
|
73
|
+
const elmName = tag === 'Section' ? 'section' : 'element';
|
|
74
|
+
return {
|
|
75
|
+
text: `This ${elmName} contains required <br> elements and cannot be deleted`,
|
|
76
|
+
width: '206px'
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
return {
|
|
81
|
+
checkDisableDelete,
|
|
82
|
+
getTooltipText,
|
|
83
|
+
checkDisableDuplicate
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export { usePostPurchase };
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1,117 @@
|
|
|
1
|
-
export{default as AddOn
|
|
1
|
+
export { default as AddOn } from './components/AddOn.js';
|
|
2
|
+
export { default as Render } from './components/Render.js';
|
|
3
|
+
export { default as RenderPreview } from './components/RenderPreview.js';
|
|
4
|
+
export { RenderChildren, default as RenderLiquid, WrapRenderChildren } from './components/Render.liquid.js';
|
|
5
|
+
export { AddonProvider, useAddon, useAddons } from './contexts/AddonContext.js';
|
|
6
|
+
export { BuilderComponentProvider, useBuilderComponent } from './contexts/BuilderComponent.js';
|
|
7
|
+
export { BuilderProvider, useBuilderStore } from './contexts/BuilderContext.js';
|
|
8
|
+
export { BuilderPreviewProvider, useBuilderPreviewStore } from './contexts/BuilderPreviewContext.js';
|
|
9
|
+
export { CartLineProvider, useCartLineStore } from './contexts/CartLineContext.js';
|
|
10
|
+
export { ProductListProvider, useProductListStore } from './contexts/ProductListContext.js';
|
|
11
|
+
export { ProductProvider, useProductStore } from './contexts/ProductContext.js';
|
|
12
|
+
export { SectionProvider, useSection, useSectionStore } from './contexts/SectionContext.js';
|
|
13
|
+
export { ShopProvider, useShopStore } from './contexts/ShopContext.js';
|
|
14
|
+
export { PageProvider, usePageStore } from './contexts/PageContext.js';
|
|
15
|
+
export { CollectionProvider, useCollectionStore } from './contexts/CollectionContext.js';
|
|
16
|
+
export { ModalProvider, useModalStore } from './contexts/ModalContext.js';
|
|
17
|
+
export { ArticleListProvider, useArticleListStore } from './contexts/ArticleListContext.js';
|
|
18
|
+
export { ArticleProvider, useArticleStore } from './contexts/ArticleContext.js';
|
|
19
|
+
export { PageViewUpDocument } from './graphql/mutations/page-view-up.generated.js';
|
|
20
|
+
export { PublishedShopMetasDocument } from './graphql/queries/published-shop-metas.js';
|
|
21
|
+
export { CollectionDetailFilterDocument } from './graphql/queries/collection-detail-filter.generated.js';
|
|
22
|
+
export { CollectionDocument } from './graphql/queries/collection.generated.js';
|
|
23
|
+
export { CollectionsDocument } from './graphql/queries/collections.generated.js';
|
|
24
|
+
export { PublishedThemePagesDocument } from './graphql/queries/published-theme-pages.generated.js';
|
|
25
|
+
export { ProductsDocument } from './graphql/queries/products.generated.js';
|
|
26
|
+
export { StorePropertyDocument } from './graphql/queries/store-property.generated.js';
|
|
27
|
+
export { PreviewThemePageDocument } from './graphql/queries/preview-page.generated.js';
|
|
28
|
+
export { LibraryTemplateDocument } from './graphql-app-api/queries/LibraryTemplate.generated.js';
|
|
29
|
+
export { ThemePageDocument } from './graphql-app-api/queries/ThemePage.generated.js';
|
|
30
|
+
export { SaleFunnelDiscountsDocument } from './graphql-app-api/queries/SaleFunnelDiscounts.generated.js';
|
|
31
|
+
export { LibrarySaleFunnelDocument } from './graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js';
|
|
32
|
+
export { ShopLibraryPageDocument } from './graphql-app-api/queries/ShopLibraryPage.generated.js';
|
|
33
|
+
export { composeBorderCss, getBorderRadiusStyle, getBorderStyle, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn } from './helpers/borders.js';
|
|
34
|
+
export { getCarouselContainerHeight, makeContainerWidthOrHeight, makeDotGapToCarouselStyle } from './helpers/carousel.js';
|
|
35
|
+
export { cls } from './helpers/cls.js';
|
|
36
|
+
export { animations } from './helpers/animations.js';
|
|
37
|
+
export { filterToolbarPreview } from './helpers/filter-toolbar-preview.js';
|
|
38
|
+
export { flattenConnection } from './helpers/flatten-connection.js';
|
|
39
|
+
export { getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, isColumnDirectionExist } from './helpers/get-resonsive-value.js';
|
|
40
|
+
export { getShortName } from './helpers/get-shortname.js';
|
|
41
|
+
export { default as globalEvent } from './helpers/GlobalEvent.js';
|
|
42
|
+
export { default as isBrowser } from './helpers/is-browser.js';
|
|
43
|
+
export { isEmptyChildren } from './helpers/is-empty-children.js';
|
|
44
|
+
export { default as isSafari } from './helpers/is-safari.js';
|
|
45
|
+
export { normalizeBuilderData } from './helpers/normalize-builder-data.js';
|
|
46
|
+
export { prefetchQueries } from './helpers/prefetch-queries.js';
|
|
47
|
+
export { validateEmail } from './helpers/email.js';
|
|
48
|
+
export { loadScript } from './helpers/load-script.js';
|
|
49
|
+
export { composeSpacing, getSpacingVariable } from './helpers/spacing.js';
|
|
50
|
+
export { genVariable } from './helpers/css-variable.js';
|
|
51
|
+
import * as fpixel from './helpers/tracking/fpixel.js';
|
|
52
|
+
export { fpixel };
|
|
53
|
+
import * as gtag from './helpers/tracking/gtag.js';
|
|
54
|
+
export { gtag };
|
|
55
|
+
import * as tiktokpixel from './helpers/tracking/tiktokpixel.js';
|
|
56
|
+
export { tiktokpixel };
|
|
57
|
+
export { GRADIENT_BGR_KEY, composeBackgroundCss, getBgImageByDevice, getGradientBgrStyleByDevice, getGradientBgrStyleForButton, getStyleBackgroundByDevice, getStyleBgColor, makeFixedBgAttachment } from './helpers/background.js';
|
|
58
|
+
export { composeTextColorCss, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getSingleColorVariable, isColor } from './helpers/colors.js';
|
|
59
|
+
export { composeAdvanceStyle, composeAdvanceStyleForPostPurchase, filterAttrInStyle, filterCornerInStyle, removeAttrInStyle, removePaddingYInStyle, splitStyle } from './helpers/compose-advance-style.js';
|
|
60
|
+
export { baseAssetURL, isLocalEnv } from './helpers/convert.js';
|
|
61
|
+
export { convertHTML } from './helpers/covert-entities-html.js';
|
|
62
|
+
export { composePositionLineHeight, composePostionIconList } from './helpers/icon-list.js';
|
|
63
|
+
export { isDefined } from './helpers/is-defined.js';
|
|
64
|
+
export { composeGridLayout, convertOldLayout, gridToArrayRegex, optionLayoutStyle } from './helpers/layout.js';
|
|
65
|
+
export { makeAspectRatio, makeGlobalSizeHeightResponsive, makeGlobalSizeWidthResponsive, makeHeight, makeLineClamp, makeStyle, makeStyleKey, makeStyleResponsive, makeStyleResponsiveByScreen, makeStyleResponsiveState, makeStyleState, makeWidth, removeNullUndefined } from './helpers/make-style.js';
|
|
66
|
+
export { convertTextAlignToJustify } from './helpers/align.js';
|
|
67
|
+
export { checkInStock } from './helpers/variant.js';
|
|
68
|
+
export { checkAvailableVariantInStock, getSelectedVariant, parseSelectedOption } from './helpers/product.js';
|
|
69
|
+
export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey } from './helpers/query.js';
|
|
70
|
+
export { composeCornerCss, composeRadius, composeRadiusResponsive, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
|
|
71
|
+
export { RenderIf, composeMemo, dataStringify, props, removeUndefinedValuesFromObject, styles, template } from './helpers/render.js';
|
|
72
|
+
export { composeShadowCss, getResponsiveStyleShadow, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
|
|
73
|
+
export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getValueByDevice, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeGlobalSizeIcon, makeStyleWithDefault } from './helpers/size.js';
|
|
74
|
+
export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass } from './helpers/typography.js';
|
|
75
|
+
export { useArticlesQuery, useBlogsQuery } from './hooks/articles/useArticlesQuery.js';
|
|
76
|
+
export { useAddToCart } from './hooks/cart/use-add-to-cart.js';
|
|
77
|
+
export { useCartData } from './hooks/cart/use-cart-data.js';
|
|
78
|
+
export { useCartDiscountCodesUpdate } from './hooks/cart/use-cart-discount-codes-update.js';
|
|
79
|
+
export { useCartNoteUpdate } from './hooks/cart/use-cart-note-update.js';
|
|
80
|
+
export { useCreateCart } from './hooks/cart/use-create-cart.js';
|
|
81
|
+
export { useRemoveCartItem } from './hooks/cart/use-remove-cart-item.js';
|
|
82
|
+
export { useUpdateCartItem } from './hooks/cart/use-update-cart-item.js';
|
|
83
|
+
export { useCheckoutUrl, useConnectedShopify, useCurrency, useEditorMode, useIsSampleProduct, useIsStorefrontProduct, useLocale, useMatchMutate, useMobileOnly, useMoneyFormat, usePageType, usePluginEnable, useStoreFront, useSwatches } from './hooks/shop.js';
|
|
84
|
+
export { useCollectionQuery } from './hooks/shop/use-collection-query.js';
|
|
85
|
+
export { useCollectionsQuery } from './hooks/shop/use-collections-query.js';
|
|
86
|
+
export { useProductQuery } from './hooks/shop/use-product-query.js';
|
|
87
|
+
export { useProductsQuery, useProductsQueryAll } from './hooks/shop/use-products-query.js';
|
|
88
|
+
export { useCurrentDevice } from './hooks/use-current-device.js';
|
|
89
|
+
export { useLazyVideo } from './hooks/use-lazy-video.js';
|
|
90
|
+
export { default as useCartId } from './hooks/useCartId.js';
|
|
91
|
+
export { default as useCartLine } from './hooks/useCartLine.js';
|
|
92
|
+
export { default as useCartUI } from './hooks/useCartUI.js';
|
|
93
|
+
export { useCollection } from './hooks/useCollection.js';
|
|
94
|
+
export { formatMoney, shopifyPriceRounding, useFormatMoney } from './hooks/useFormatMoney.js';
|
|
95
|
+
export { useId } from 'react';
|
|
96
|
+
export { default as useInitialSwatchesOptions } from './hooks/useInitialSwatchesOptions.js';
|
|
97
|
+
export { default as useIsomorphicLayoutEffect } from './hooks/useIsomorphicLayoutEffect.js';
|
|
98
|
+
export { default as useLoadScript } from './hooks/useLoadScript.js';
|
|
99
|
+
export { default as useMoney } from './hooks/useMoney.js';
|
|
100
|
+
export { usePrevious } from './hooks/usePrevious.js';
|
|
101
|
+
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useHasPreSelected, useIsSyncProduct, useProduct, useProductBundleDiscount, useProductOfferDiscount, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants } from './hooks/useProduct.js';
|
|
102
|
+
export { useProductList, useProductListProducts, useProductListSettings, useProductListStyles } from './hooks/useProductList.js';
|
|
103
|
+
export { default as useSuspenseFetch } from './hooks/useSuspenseFetch.js';
|
|
104
|
+
export { default as useSwatchesOptions } from './hooks/useSwatchesOptions.js';
|
|
105
|
+
export { InteractionTargetEvent, InteractionTriggerEvent } from './types/custom.js';
|
|
106
|
+
import * as shop from './types/shop.js';
|
|
107
|
+
export { shop as ShopType };
|
|
108
|
+
import * as appAPI from './types/appAPI.js';
|
|
109
|
+
export { appAPI as AppAPIType };
|
|
110
|
+
export { OptionNormalStyle, OptionSpecialStyle } from './types/global-style.js';
|
|
111
|
+
export { AnimationDirectionType, AnimationEasingType, AnimationSetting, AnimationTriggerType, AnimationType, AnimationZoomDirectionType } from './types/animations.js';
|
|
112
|
+
export { calculateFirstProduct, getCollection } from './helpers/queries/get-collection.js';
|
|
113
|
+
export { fetchMedias, fetchVariants, getProduct } from './helpers/queries/get-product.js';
|
|
114
|
+
export { getProductBySlug } from './helpers/queries/get-product-by-slug.js';
|
|
115
|
+
export { getAppBlocks } from './helpers/third-party/getAppBlocks.js';
|
|
116
|
+
export { addAppBlockId } from './helpers/third-party/addAppBlockId.js';
|
|
117
|
+
export { useInteraction } from './helpers/interaction/index.js';
|
|
@@ -1 +1,49 @@
|
|
|
1
|
-
var AnimationType
|
|
1
|
+
var AnimationType;
|
|
2
|
+
(function(AnimationType) {
|
|
3
|
+
AnimationType["Fade"] = 'fade';
|
|
4
|
+
AnimationType["Slide"] = 'slide';
|
|
5
|
+
AnimationType["Zoom"] = 'zoom';
|
|
6
|
+
AnimationType["Shake"] = 'shake';
|
|
7
|
+
AnimationType["None"] = 'none';
|
|
8
|
+
})(AnimationType || (AnimationType = {}));
|
|
9
|
+
var AnimationSetting;
|
|
10
|
+
(function(AnimationSetting) {
|
|
11
|
+
AnimationSetting["Loop"] = 'loop';
|
|
12
|
+
AnimationSetting["Scale"] = 'scale';
|
|
13
|
+
AnimationSetting["Delay"] = 'delay';
|
|
14
|
+
AnimationSetting["Easing"] = 'easing';
|
|
15
|
+
AnimationSetting["Speed"] = 'speed';
|
|
16
|
+
AnimationSetting["IsFade"] = 'isFade';
|
|
17
|
+
AnimationSetting["Distance"] = 'distance';
|
|
18
|
+
AnimationSetting["Intensity"] = 'intensity';
|
|
19
|
+
AnimationSetting["Direction"] = 'direction';
|
|
20
|
+
AnimationSetting["ZoomDirection"] = 'zoomDirection';
|
|
21
|
+
})(AnimationSetting || (AnimationSetting = {}));
|
|
22
|
+
var AnimationDirectionType;
|
|
23
|
+
(function(AnimationDirectionType) {
|
|
24
|
+
AnimationDirectionType["Left"] = 'left';
|
|
25
|
+
AnimationDirectionType["Right"] = 'right';
|
|
26
|
+
AnimationDirectionType["Up"] = 'up';
|
|
27
|
+
AnimationDirectionType["Down"] = 'down';
|
|
28
|
+
})(AnimationDirectionType || (AnimationDirectionType = {}));
|
|
29
|
+
var AnimationTriggerType;
|
|
30
|
+
(function(AnimationTriggerType) {
|
|
31
|
+
AnimationTriggerType["Appear"] = 'appear';
|
|
32
|
+
AnimationTriggerType["Hover"] = 'hover';
|
|
33
|
+
AnimationTriggerType["Hidden"] = 'hidden';
|
|
34
|
+
AnimationTriggerType["AppearByTrigger"] = 'appearByTrigger';
|
|
35
|
+
})(AnimationTriggerType || (AnimationTriggerType = {}));
|
|
36
|
+
var AnimationZoomDirectionType;
|
|
37
|
+
(function(AnimationZoomDirectionType) {
|
|
38
|
+
AnimationZoomDirectionType["In"] = 'in';
|
|
39
|
+
AnimationZoomDirectionType["Out"] = 'out';
|
|
40
|
+
})(AnimationZoomDirectionType || (AnimationZoomDirectionType = {}));
|
|
41
|
+
var AnimationEasingType;
|
|
42
|
+
(function(AnimationEasingType) {
|
|
43
|
+
AnimationEasingType["Ease"] = 'ease';
|
|
44
|
+
AnimationEasingType["EaseIn"] = 'ease-in';
|
|
45
|
+
AnimationEasingType["EaseOut"] = 'ease-out';
|
|
46
|
+
AnimationEasingType["Linear"] = 'linear';
|
|
47
|
+
})(AnimationEasingType || (AnimationEasingType = {}));
|
|
48
|
+
|
|
49
|
+
export { AnimationDirectionType, AnimationEasingType, AnimationSetting, AnimationTriggerType, AnimationType, AnimationZoomDirectionType };
|