@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,57 @@
|
|
|
1
|
-
import{jsxs
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { isValidElement } from 'react';
|
|
3
|
+
import { composeAdvanceStyle } from '../helpers/compose-advance-style.js';
|
|
4
|
+
import { disableWrap } from './constant.js';
|
|
5
|
+
import RenderCustomCode from './RenderCustomCode.js';
|
|
6
|
+
|
|
7
|
+
const ComponentWrapper = ({ children, pageType, ...props })=>{
|
|
8
|
+
if (props.type === 'section') return null;
|
|
9
|
+
const style = composeAdvanceStyle(props.advanced, props.tag, pageType);
|
|
10
|
+
const advanced = props.advanced;
|
|
11
|
+
const interactionAttributes = ()=>{
|
|
12
|
+
let result = {};
|
|
13
|
+
if (props.advanced?.displayInitInteraction !== undefined) {
|
|
14
|
+
result = {
|
|
15
|
+
'display-init': props.advanced?.displayInitInteraction === false ? 'hide' : 'show',
|
|
16
|
+
'gp-interaction-wrapper': ''
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
if (disableWrap.includes(props.tag) && /*#__PURE__*/ isValidElement(children)) {
|
|
22
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
23
|
+
children: [
|
|
24
|
+
/*#__PURE__*/ jsx(RenderCustomCode, {
|
|
25
|
+
uid: props.uid,
|
|
26
|
+
advanced: advanced
|
|
27
|
+
}),
|
|
28
|
+
/*#__PURE__*/ jsx(children.type, {
|
|
29
|
+
className: advanced?.cssClass,
|
|
30
|
+
...children.props,
|
|
31
|
+
style,
|
|
32
|
+
advanced,
|
|
33
|
+
builderAttrs: {
|
|
34
|
+
...children.props.builderAttrs,
|
|
35
|
+
...interactionAttributes()
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ jsx(RenderCustomCode, {
|
|
44
|
+
uid: props.uid,
|
|
45
|
+
advanced: advanced
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ jsx("div", {
|
|
48
|
+
style: style,
|
|
49
|
+
...interactionAttributes(),
|
|
50
|
+
className: `${props.uid} ${advanced?.cssClass}`,
|
|
51
|
+
children: children
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { ComponentWrapper as default };
|
|
@@ -1 +1,209 @@
|
|
|
1
|
-
import{jsxs
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { memo, useEffect, isValidElement } from 'react';
|
|
3
|
+
import { composeAdvanceStyle } from '../helpers/compose-advance-style.js';
|
|
4
|
+
import { useInteraction } from '../hooks/useInteraction.js';
|
|
5
|
+
import { disableWrap, excludeApplyStyle } from './constant.js';
|
|
6
|
+
import RenderCustomCode from './RenderCustomCode.js';
|
|
7
|
+
import ComponentToolbarPreview from './ComponentToolbarPreview.js';
|
|
8
|
+
import 'zustand';
|
|
9
|
+
import { cls } from '../helpers/cls.js';
|
|
10
|
+
import 'swr';
|
|
11
|
+
import '../helpers/convert.js';
|
|
12
|
+
import '@gem-sdk/adapter-shopify';
|
|
13
|
+
import 'swr/mutation';
|
|
14
|
+
import { usePageType } from '../hooks/shop.js';
|
|
15
|
+
import 'swr/infinite';
|
|
16
|
+
import 'vanilla-lazyload';
|
|
17
|
+
import '../hooks/useCartUI.js';
|
|
18
|
+
import ComponentAnimation from './ComponentAnimation.js';
|
|
19
|
+
|
|
20
|
+
const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
21
|
+
useEffect(()=>{
|
|
22
|
+
const event = new CustomEvent('editor:component:render', {
|
|
23
|
+
bubbles: true,
|
|
24
|
+
detail: {
|
|
25
|
+
componentUid: props.uid
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
window.dispatchEvent(event);
|
|
29
|
+
}, [
|
|
30
|
+
props.uid
|
|
31
|
+
]);
|
|
32
|
+
const currentProps = props;
|
|
33
|
+
const { getAnimationByUid } = useInteraction();
|
|
34
|
+
const animationByInteraction = getAnimationByUid(props.uid);
|
|
35
|
+
if (animationByInteraction) {
|
|
36
|
+
currentProps.advanced = {
|
|
37
|
+
...currentProps.advanced,
|
|
38
|
+
animation: {
|
|
39
|
+
desktop: animationByInteraction,
|
|
40
|
+
tablet: animationByInteraction,
|
|
41
|
+
mobile: animationByInteraction
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const pageType = usePageType();
|
|
46
|
+
if (props.type === 'section') {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const customProps = {};
|
|
50
|
+
if (props.tag === 'Section' && props.isThemeSection) {
|
|
51
|
+
customProps['data-theme-section'] = true;
|
|
52
|
+
}
|
|
53
|
+
if (props.tag === 'Section' && props.isShopifySection) {
|
|
54
|
+
customProps['data-shopify-section'] = true;
|
|
55
|
+
customProps['data-toolbar-wrap'] = true;
|
|
56
|
+
}
|
|
57
|
+
// Build editor configs
|
|
58
|
+
if (props.editorConfigs) {
|
|
59
|
+
const editorConfigs = props.editorConfigs;
|
|
60
|
+
if (editorConfigs.placeholder?.notAppendBeforeAfter) {
|
|
61
|
+
customProps['data-placeholder-not-append-before-after'] = true;
|
|
62
|
+
}
|
|
63
|
+
if (editorConfigs.toolbar?.parent) {
|
|
64
|
+
customProps['data-toolbar-parent'] = true;
|
|
65
|
+
}
|
|
66
|
+
if (editorConfigs.component?.noDelete) {
|
|
67
|
+
customProps['data-component-no-delete'] = true;
|
|
68
|
+
}
|
|
69
|
+
if (editorConfigs.component?.noDuplicate) {
|
|
70
|
+
customProps['data-component-no-duplicate'] = true;
|
|
71
|
+
}
|
|
72
|
+
if (editorConfigs.component?.noDragDrop) {
|
|
73
|
+
customProps['data-component-no-drag-drop'] = true;
|
|
74
|
+
}
|
|
75
|
+
if (editorConfigs.component?.noSetting) {
|
|
76
|
+
customProps['data-component-no-setting'] = true;
|
|
77
|
+
}
|
|
78
|
+
if (editorConfigs.component?.isThirdParty) {
|
|
79
|
+
customProps['data-component-is-third-party'] = true;
|
|
80
|
+
}
|
|
81
|
+
if (editorConfigs.toolbar?.hide) {
|
|
82
|
+
customProps['data-toolbar-hide'] = true;
|
|
83
|
+
}
|
|
84
|
+
if (editorConfigs.slots?.children) {
|
|
85
|
+
customProps['data-slots-children'] = true;
|
|
86
|
+
}
|
|
87
|
+
if (!editorConfigs.toolbar?.hide) {
|
|
88
|
+
customProps['data-toolbar-wrap'] = true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// Show toolbar wrapper
|
|
92
|
+
if (!props?.editorConfigs?.toolbar?.hide) {
|
|
93
|
+
customProps['data-toolbar-wrap'] = true;
|
|
94
|
+
}
|
|
95
|
+
const isNotDroppable = (tag)=>{
|
|
96
|
+
return pageType === 'GP_FUNNEL_PAGE' ? [
|
|
97
|
+
'ProductList',
|
|
98
|
+
'Header'
|
|
99
|
+
].includes(tag) : false;
|
|
100
|
+
};
|
|
101
|
+
const style = composeAdvanceStyle(props.advanced, props.tag, pageType);
|
|
102
|
+
const advanced = props.advanced;
|
|
103
|
+
const builderAttrs = {
|
|
104
|
+
...customProps,
|
|
105
|
+
'data-uid': props.uid,
|
|
106
|
+
'data-component-type': 'component',
|
|
107
|
+
'data-component-tag': props.tag,
|
|
108
|
+
'data-component-label': props.label,
|
|
109
|
+
'data-not-droppable': isNotDroppable(props.tag)
|
|
110
|
+
};
|
|
111
|
+
const ShopifySection = ({ name, visibility })=>{
|
|
112
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
113
|
+
className: cls('gp-flex gp-items-center gp-justify-center gp-gap-[8px] gp-bg-[#F4F4F4] gp-p-[16px] gp-border gp-border-[#D6D6D6]', {
|
|
114
|
+
'gp-opacity-60': !visibility
|
|
115
|
+
}),
|
|
116
|
+
children: [
|
|
117
|
+
/*#__PURE__*/ jsxs("svg", {
|
|
118
|
+
width: "24",
|
|
119
|
+
height: "24",
|
|
120
|
+
viewBox: "0 0 24 24",
|
|
121
|
+
fill: "none",
|
|
122
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
123
|
+
children: [
|
|
124
|
+
/*#__PURE__*/ jsx("path", {
|
|
125
|
+
d: "M19.1475 5.16194C19.1416 5.1148 19.1197 5.0713 19.0857 5.03911C19.0516 5.00692 19.0076 4.9881 18.9614 4.98597C18.8835 4.98597 17.3469 4.95397 17.3469 4.95397C17.3469 4.95397 16.0588 3.67419 15.9342 3.5311C15.8104 3.40312 15.5619 3.43512 15.4684 3.46711L14.8166 3.67508C14.7361 3.40491 14.6323 3.14259 14.5067 2.89121C14.0566 1.99536 13.3727 1.51544 12.5659 1.51544C12.5044 1.51544 12.4577 1.51544 12.3954 1.53144C12.3642 1.49945 12.3486 1.46745 12.3175 1.45145C11.9608 1.06752 11.5107 0.875552 10.967 0.891549C9.92824 0.923543 8.88772 1.70741 8.03419 3.08318C7.44467 4.05901 6.99453 5.27392 6.8543 6.21776C5.65969 6.6017 4.82087 6.87365 4.79057 6.87365C4.18461 7.06562 4.16903 7.08161 4.09199 7.67351C4.06082 8.12144 2.47754 20.7415 2.47754 20.7415L15.7636 23.1091L21.522 21.6374C21.5064 21.6374 19.1631 5.27392 19.1475 5.16194ZM14.1492 3.89904C13.8062 4.00572 13.4648 4.11772 13.1251 4.23498C13.1251 3.69108 13.0472 2.92321 12.8143 2.28331C13.6064 2.41129 13.9942 3.33914 14.1492 3.89904ZM12.4265 4.44206C11.7279 4.66602 10.9679 4.90598 10.207 5.14594C10.4243 4.29808 10.8277 3.46623 11.3245 2.90632C11.533 2.66965 11.7863 2.47913 12.069 2.34641C12.3806 2.9712 12.4421 3.85105 12.4265 4.44206ZM10.9982 1.61143C11.2466 1.61143 11.4483 1.65942 11.6197 1.7874C11.3127 1.95192 11.0387 2.17444 10.8121 2.44329C10.1455 3.17916 9.63305 4.31408 9.43135 5.4179C8.79423 5.62586 8.17356 5.81783 7.61521 5.9938C7.98744 4.25009 9.39933 1.65942 10.9982 1.61143Z",
|
|
126
|
+
fill: "#95BF47"
|
|
127
|
+
}),
|
|
128
|
+
/*#__PURE__*/ jsx("path", {
|
|
129
|
+
d: "M18.9647 4.94709C18.8851 4.94709 17.3155 4.91503 17.3155 4.91503C17.3155 4.91503 15.9981 3.63242 15.8716 3.48812C15.8261 3.43951 15.7635 3.41074 15.6973 3.40796V23.1094L21.5828 21.6344L19.1709 5.12345C19.1399 5.01122 19.0444 4.94709 18.9647 4.94709Z",
|
|
130
|
+
fill: "#5E8E3E"
|
|
131
|
+
}),
|
|
132
|
+
/*#__PURE__*/ jsx("path", {
|
|
133
|
+
d: "M13.0575 8.51577L12.3029 10.8908C12.3029 10.8908 11.4602 10.5663 10.4599 10.6253C8.98595 10.6991 8.98595 11.4809 8.98595 11.6727C9.07404 12.7348 12.39 12.9709 12.5828 15.4631C12.7238 17.4251 11.3545 18.7675 9.35396 18.8708C6.96778 18.9733 5.65137 17.7939 5.65137 17.7939L6.16032 15.9794C6.16032 15.9794 7.49435 16.8203 8.5465 16.7613C9.23162 16.7318 9.4949 16.245 9.45967 15.9204C9.35396 14.5337 6.65165 14.6223 6.47645 12.3365C6.33551 10.4188 7.82712 8.48626 11.1265 8.30924C12.4076 8.23548 13.0575 8.51577 13.0575 8.51577Z",
|
|
134
|
+
fill: "white"
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
}),
|
|
138
|
+
/*#__PURE__*/ jsx("span", {
|
|
139
|
+
className: "gp-text-[#212121] gp-text-[14px] gp-leading-[24px] gp-font-medium",
|
|
140
|
+
children: name
|
|
141
|
+
})
|
|
142
|
+
]
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
if (disableWrap.includes(props.tag) && /*#__PURE__*/ isValidElement(children)) {
|
|
146
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
147
|
+
children: [
|
|
148
|
+
/*#__PURE__*/ jsx(ComponentAnimation, {
|
|
149
|
+
...currentProps
|
|
150
|
+
}),
|
|
151
|
+
/*#__PURE__*/ jsx(RenderCustomCode, {
|
|
152
|
+
uid: props.uid,
|
|
153
|
+
advanced: advanced
|
|
154
|
+
}),
|
|
155
|
+
/*#__PURE__*/ jsxs(children.type, {
|
|
156
|
+
className: advanced?.cssClass,
|
|
157
|
+
...children.props,
|
|
158
|
+
style,
|
|
159
|
+
builderAttrs,
|
|
160
|
+
advanced,
|
|
161
|
+
children: [
|
|
162
|
+
props.isShopifySection ? /*#__PURE__*/ jsx(ShopifySection, {
|
|
163
|
+
name: props.name ?? '',
|
|
164
|
+
visibility: !!props.isShopifyVisibility
|
|
165
|
+
}) : children.props['children'],
|
|
166
|
+
/*#__PURE__*/ jsx(ComponentToolbarPreview, {
|
|
167
|
+
...props
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
|
+
})
|
|
171
|
+
]
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
// Render
|
|
175
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
176
|
+
children: [
|
|
177
|
+
/*#__PURE__*/ jsx(ComponentAnimation, {
|
|
178
|
+
...currentProps
|
|
179
|
+
}),
|
|
180
|
+
/*#__PURE__*/ jsx(RenderCustomCode, {
|
|
181
|
+
uid: props.uid,
|
|
182
|
+
advanced: advanced
|
|
183
|
+
}),
|
|
184
|
+
/*#__PURE__*/ jsxs("div", {
|
|
185
|
+
style: !excludeApplyStyle.includes(props.tag) ? style : {
|
|
186
|
+
'--mb': style?.['--mb'],
|
|
187
|
+
'--mb-tablet': style?.['--mb-tablet'],
|
|
188
|
+
'--mb-mobile': style?.['--mb-mobile']
|
|
189
|
+
},
|
|
190
|
+
className: `${props.uid} ${props.advanced?.cssClass ? props.advanced?.cssClass : ''}`,
|
|
191
|
+
...builderAttrs,
|
|
192
|
+
children: [
|
|
193
|
+
!excludeApplyStyle.includes(props.tag) && children,
|
|
194
|
+
/*#__PURE__*/ isValidElement(children) && excludeApplyStyle.includes(props.tag) && /*#__PURE__*/ jsx(children.type, {
|
|
195
|
+
...children.props,
|
|
196
|
+
style,
|
|
197
|
+
advanced
|
|
198
|
+
}),
|
|
199
|
+
/*#__PURE__*/ jsx(ComponentToolbarPreview, {
|
|
200
|
+
...props
|
|
201
|
+
})
|
|
202
|
+
]
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
var ComponentWrapperPreview$1 = /*#__PURE__*/ memo(ComponentWrapperPreview);
|
|
208
|
+
|
|
209
|
+
export { ComponentWrapperPreview$1 as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import 'zustand';
|
|
3
|
+
import 'react';
|
|
4
|
+
import { usePageStore } from '../contexts/PageContext.js';
|
|
5
|
+
import 'react-transition-group';
|
|
6
|
+
import '@gem-sdk/core';
|
|
7
|
+
import 'swr';
|
|
8
|
+
import 'swr/infinite';
|
|
9
|
+
import 'classnames';
|
|
10
|
+
import 'dayjs';
|
|
11
|
+
import { useInteraction } from '../helpers/interaction/index.js';
|
|
12
|
+
import '../helpers/convert.js';
|
|
13
|
+
import '@gem-sdk/adapter-shopify';
|
|
14
|
+
import 'swr/mutation';
|
|
15
|
+
import 'vanilla-lazyload';
|
|
16
|
+
import '../hooks/useCartUI.js';
|
|
17
|
+
|
|
18
|
+
const InteractionSuffix = ({ uid })=>{
|
|
19
|
+
const { closeSelectOnPage, selectInteractionElement } = useInteraction();
|
|
20
|
+
const settingType = usePageStore((s)=>s.interactionData?.settingType || '');
|
|
21
|
+
const isSelectOnPage = usePageStore((s)=>s.interactionData?.isSelectOnPage);
|
|
22
|
+
const onClick = (e)=>{
|
|
23
|
+
selectInteractionElement({
|
|
24
|
+
$target: e.target,
|
|
25
|
+
componentUid: uid,
|
|
26
|
+
settingType
|
|
27
|
+
});
|
|
28
|
+
closeSelectOnPage();
|
|
29
|
+
};
|
|
30
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
31
|
+
children: isSelectOnPage && /*#__PURE__*/ jsx("button", {
|
|
32
|
+
className: "gp-bg-[#F4F4F4] gp-px-2 gp-h-[24px] gp-py-0.5 gp-rounded-lg gp-text-[#212121] gp-text-xs gp-font-medium gp-hidden interaction-use-custom-element ",
|
|
33
|
+
onClick: onClick,
|
|
34
|
+
"data-setup-interaction": true,
|
|
35
|
+
children: settingType === 'TRIGGER' ? 'Set as trigger' : 'Set as target'
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export { InteractionSuffix };
|
|
@@ -1 +1,71 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { memo, useMemo } from 'react';
|
|
3
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
4
|
+
import { useBuilderComponent } from '../contexts/BuilderComponent.js';
|
|
5
|
+
import { useBuilderStore } from '../contexts/BuilderContext.js';
|
|
6
|
+
import ComponentWrapper from './ComponentWrapper.js';
|
|
7
|
+
import RenderSectionMemo from './RenderSection.js';
|
|
8
|
+
|
|
9
|
+
const Render = ({ uid, ...passProps })=>{
|
|
10
|
+
const item = useBuilderStore((s)=>s.getItem(uid));
|
|
11
|
+
const Component = useBuilderComponent(item?.tag);
|
|
12
|
+
const isPostPurchase = useBuilderStore((s)=>s.getIsPostPurchase());
|
|
13
|
+
const isPreview = useBuilderStore((s)=>s.getIsPreview());
|
|
14
|
+
const pageType = useMemo(()=>{
|
|
15
|
+
return isPostPurchase ? 'POST_PURCHASE' : undefined;
|
|
16
|
+
}, [
|
|
17
|
+
isPostPurchase
|
|
18
|
+
]);
|
|
19
|
+
if (!item) return null;
|
|
20
|
+
if (item?.type === 'section') {
|
|
21
|
+
return /*#__PURE__*/ jsx(RenderSectionMemo, {
|
|
22
|
+
sectionId: item.uid
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
return /*#__PURE__*/ jsx(ErrorBoundary, {
|
|
26
|
+
fallbackRender: ({ error, resetErrorBoundary })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
27
|
+
children: [
|
|
28
|
+
/*#__PURE__*/ jsx("span", {
|
|
29
|
+
"aria-label": "Error message",
|
|
30
|
+
children: error.message
|
|
31
|
+
}),
|
|
32
|
+
/*#__PURE__*/ jsx("button", {
|
|
33
|
+
type: "button",
|
|
34
|
+
onClick: resetErrorBoundary,
|
|
35
|
+
children: "Try again"
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
}),
|
|
39
|
+
children: /*#__PURE__*/ jsx(ComponentWrapper, {
|
|
40
|
+
...item,
|
|
41
|
+
pageType: pageType,
|
|
42
|
+
children: item?.childrens?.length ? /*#__PURE__*/ jsx(Component, {
|
|
43
|
+
builderProps: {
|
|
44
|
+
uid,
|
|
45
|
+
builderData: item,
|
|
46
|
+
isPreview
|
|
47
|
+
},
|
|
48
|
+
styles: item.styles,
|
|
49
|
+
setting: item.settings,
|
|
50
|
+
...passProps,
|
|
51
|
+
children: item.childrens.map((id)=>/*#__PURE__*/ jsx(RenderMemo, {
|
|
52
|
+
uid: id
|
|
53
|
+
}, id))
|
|
54
|
+
}) : /*#__PURE__*/ jsx(Component, {
|
|
55
|
+
builderProps: {
|
|
56
|
+
uid,
|
|
57
|
+
builderData: item,
|
|
58
|
+
isPreview
|
|
59
|
+
},
|
|
60
|
+
styles: item.styles,
|
|
61
|
+
setting: item.settings,
|
|
62
|
+
...passProps
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
}, item.uid);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const RenderMemo = /*#__PURE__*/ memo(Render);
|
|
69
|
+
RenderMemo.displayName = 'RenderMemo';
|
|
70
|
+
|
|
71
|
+
export { RenderMemo as default };
|