@gem-sdk/core 3.0.0-pre-production.15 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/components/AddOn.js +2 -18
- package/dist/cjs/components/ComponentAnimation.js +2 -17
- package/dist/cjs/components/ComponentToolbarPreview.js +2 -752
- package/dist/cjs/components/ComponentWrapper.js +2 -61
- package/dist/cjs/components/ComponentWrapperPreview.js +2 -213
- package/dist/cjs/components/Empty.js +2 -7
- package/dist/cjs/components/InteractionSuffix.js +2 -42
- package/dist/cjs/components/Render.js +2 -75
- package/dist/cjs/components/Render.liquid.js +16 -307
- package/dist/cjs/components/RenderBlock.js +2 -54
- package/dist/cjs/components/RenderCustomCode.js +4 -59
- package/dist/cjs/components/RenderPreview.js +2 -67
- package/dist/cjs/components/RenderSection.js +2 -23
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +2 -252
- package/dist/cjs/components/ai-generator/AIGenContentLoading.js +2 -85
- package/dist/cjs/components/ai-generator/components/PickProduct.js +2 -220
- package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +2 -77
- package/dist/cjs/components/ai-generator/hooks/useCheckingProductInside.js +1 -47
- package/dist/cjs/components/ai-generator/hooks/useFlipPopup.js +1 -110
- package/dist/cjs/components/ai-generator/hooks/useGettingGenerateRequest.js +1 -37
- package/dist/cjs/components/ai-generator/hooks/useListenEventGenerate.js +1 -70
- package/dist/cjs/components/ai-generator/icons/AIIcon.js +2 -67
- package/dist/cjs/components/ai-generator/icons/CloseIcon.js +2 -19
- package/dist/cjs/components/ai-generator/icons/DropdownIcon.js +2 -37
- package/dist/cjs/components/ai-generator/icons/SearchIcon.js +2 -21
- package/dist/cjs/components/ai-generator/icons/ShowMoreIcon.js +2 -21
- package/dist/cjs/components/ai-generator/icons/UpgradeIcon.js +2 -27
- package/dist/cjs/components/ai-generator/icons/WarningIcon.js +2 -31
- package/dist/cjs/components/constant.js +1 -82
- package/dist/cjs/components/resize/Resize.js +2 -16
- package/dist/cjs/components/resize/Spacing.js +2 -260
- package/dist/cjs/components/src/product/helpers/variant-presets.js +1 -56
- package/dist/cjs/components/theme-section/CreateThemeSection.js +2 -123
- package/dist/cjs/components/theme-section/ThemeSectionStatus.js +2 -45
- package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +2 -126
- package/dist/cjs/components/toolbar/Tooltip.js +2 -28
- package/dist/cjs/constants/device.js +1 -0
- package/dist/cjs/contexts/AddonContext.js +2 -36
- package/dist/cjs/contexts/ArticleContext.js +2 -39
- package/dist/cjs/contexts/ArticleListContext.js +2 -31
- package/dist/cjs/contexts/BuilderComponent.js +2 -34
- package/dist/cjs/contexts/BuilderContext.js +2 -39
- package/dist/cjs/contexts/BuilderPreviewContext.js +2 -482
- package/dist/cjs/contexts/CartLineContext.js +2 -29
- package/dist/cjs/contexts/CollectionContext.js +2 -38
- package/dist/cjs/contexts/I18nContext.js +2 -0
- package/dist/cjs/contexts/ModalContext.js +2 -47
- package/dist/cjs/contexts/PageContext.js +2 -111
- package/dist/cjs/contexts/ProductContext.js +2 -182
- package/dist/cjs/contexts/ProductListContext.js +2 -32
- package/dist/cjs/contexts/SectionContext.js +2 -53
- package/dist/cjs/contexts/ShopContext.js +2 -107
- package/dist/cjs/graphql/fragments/analytic.generated.js +2 -6
- package/dist/cjs/graphql/fragments/collection-detail.generated.js +2 -6
- package/dist/cjs/graphql/fragments/collection-product.generated.js +2 -6
- package/dist/cjs/graphql/fragments/collection.generated.js +2 -6
- package/dist/cjs/graphql/fragments/custom-code.generated.js +2 -6
- package/dist/cjs/graphql/fragments/custom-font.generated.js +7 -7
- package/dist/cjs/graphql/fragments/data-seo.generated.js +2 -6
- package/dist/cjs/graphql/fragments/media.generated.js +2 -6
- package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +6 -6
- package/dist/cjs/graphql/fragments/product-little.generated.js +2 -6
- package/dist/cjs/graphql/fragments/product-option-value.generated.js +2 -6
- package/dist/cjs/graphql/fragments/product-option.generated.js +2 -6
- package/dist/cjs/graphql/fragments/product.generated.js +2 -6
- package/dist/cjs/graphql/fragments/published-custom-section.generated.js +2 -6
- package/dist/cjs/graphql/fragments/published-page-section.generated.js +2 -6
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +4 -18
- package/dist/cjs/graphql/fragments/published-theme-style.generated.js +2 -6
- package/dist/cjs/graphql/fragments/selected-option.generated.js +2 -6
- package/dist/cjs/graphql/fragments/variant.generated.js +2 -6
- package/dist/cjs/graphql/mutations/page-view-up.generated.js +2 -6
- package/dist/cjs/graphql/queries/articles.generated.js +2 -6
- package/dist/cjs/graphql/queries/blogs.generated.js +2 -6
- package/dist/cjs/graphql/queries/collection-detail-filter.generated.js +2 -16
- package/dist/cjs/graphql/queries/collection.generated.js +2 -14
- package/dist/cjs/graphql/queries/collections.generated.js +2 -9
- package/dist/cjs/graphql/queries/preview-page.generated.js +2 -12
- package/dist/cjs/graphql/queries/product-little-detail.generated.js +2 -11
- package/dist/cjs/graphql/queries/product-medias.generated.js +2 -8
- package/dist/cjs/graphql/queries/product-value-label.generated.js +2 -6
- package/dist/cjs/graphql/queries/product-variants.generated.js +3 -11
- package/dist/cjs/graphql/queries/products.generated.js +3 -17
- package/dist/cjs/graphql/queries/{published-shop-metas.js → published-shop-metas.generated.js} +2 -6
- package/dist/cjs/graphql/queries/published-theme-pages.generated.js +3 -19
- package/dist/cjs/graphql/queries/shop-shopify.generated.js +2 -6
- package/dist/cjs/graphql/queries/store-property.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/LibraryTemplate.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/SaleFunnelOffer.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/ShopLibraryPage.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/ThemePage.generated.js +2 -6
- package/dist/cjs/helpers/GlobalEvent.js +1 -19
- package/dist/cjs/helpers/align.js +1 -37
- package/dist/cjs/helpers/animations.js +1 -222
- package/dist/cjs/helpers/background.js +1 -236
- package/dist/cjs/helpers/backgroundImage.js +1 -0
- package/dist/cjs/helpers/borders.js +4 -198
- package/dist/cjs/helpers/carousel.js +1 -55
- package/dist/cjs/helpers/clone-deep.js +1 -5
- package/dist/cjs/helpers/cls.js +1 -16
- package/dist/cjs/helpers/colors.js +1 -184
- package/dist/cjs/helpers/compose-advance-style.js +1 -323
- package/dist/cjs/helpers/composeClasses.js +1 -0
- package/dist/cjs/helpers/const.js +1 -0
- package/dist/cjs/helpers/constant.js +1 -23
- package/dist/cjs/helpers/convert.js +1 -7
- package/dist/cjs/helpers/covert-entities-html.js +1 -19
- package/dist/cjs/helpers/css-variable.js +1 -7
- package/dist/cjs/helpers/email.js +1 -11
- package/dist/cjs/helpers/filter-styles.js +1 -0
- package/dist/cjs/helpers/filter-toolbar-preview.js +2 -14
- package/dist/cjs/helpers/flatten-connection.js +1 -9
- package/dist/cjs/helpers/get-resonsive-value.js +1 -36
- package/dist/cjs/helpers/get-shortname.js +1 -92
- package/dist/cjs/helpers/icon-list.js +1 -61
- package/dist/cjs/helpers/interaction/index.js +2 -134
- package/dist/cjs/helpers/is-browser.js +1 -9
- package/dist/cjs/helpers/is-defined.js +1 -7
- package/dist/cjs/helpers/is-empty-children.js +2 -15
- package/dist/cjs/helpers/is-safari.js +1 -9
- package/dist/cjs/helpers/layout.js +1 -76
- package/dist/cjs/helpers/load-script.js +1 -31
- package/dist/cjs/helpers/loop-component.js +1 -16
- package/dist/cjs/helpers/make-style.js +1 -163
- package/dist/cjs/helpers/normalize-builder-data.js +1 -23
- package/dist/cjs/helpers/pascal-to-kebab-case.js +1 -7
- package/dist/cjs/helpers/prefetch-queries.js +1 -78
- package/dist/cjs/helpers/product.js +1 -48
- package/dist/cjs/helpers/queries/get-collection.js +1 -226
- package/dist/cjs/helpers/queries/get-collections.js +1 -21
- package/dist/cjs/helpers/queries/get-product-by-slug.js +1 -125
- package/dist/cjs/helpers/queries/get-product.js +1 -154
- package/dist/cjs/helpers/queries/get-products.js +1 -214
- package/dist/cjs/helpers/query.js +1 -29
- package/dist/cjs/helpers/radius.js +6 -140
- package/dist/cjs/helpers/render.js +1 -91
- package/dist/cjs/helpers/shadow.js +1 -69
- package/dist/cjs/helpers/size.js +4 -228
- package/dist/cjs/helpers/spacing.js +1 -43
- package/dist/cjs/helpers/third-party/addAppBlockId.js +1 -20
- package/dist/cjs/helpers/third-party/appConfig.js +1 -416
- package/dist/cjs/helpers/third-party/appSetting.js +1 -1324
- package/dist/cjs/helpers/third-party/composeAppBlockId.js +1 -11
- package/dist/cjs/helpers/third-party/constant.js +1 -69
- package/dist/cjs/helpers/third-party/generateAppBlockConfigs.js +1 -34
- package/dist/cjs/helpers/third-party/getAppBlockConfig.js +1 -55
- package/dist/cjs/helpers/third-party/getAppBlockType.js +1 -12
- package/dist/cjs/helpers/third-party/getAppBlocks.js +1 -30
- package/dist/cjs/helpers/third-party/mergeBlock.js +1 -19
- package/dist/cjs/helpers/third-party/mergeBlockOrder.js +1 -47
- package/dist/cjs/helpers/third-party/removeGPAppItems.js +1 -18
- package/dist/cjs/helpers/tracking/fpixel.js +1 -28
- package/dist/cjs/helpers/tracking/gtag.js +1 -93
- package/dist/cjs/helpers/tracking/tiktokpixel.js +1 -17
- package/dist/cjs/helpers/typography.js +19 -160
- package/dist/cjs/helpers/variant.js +1 -11
- package/dist/cjs/hooks/animation/useAnimationActions.js +2 -39
- package/dist/cjs/hooks/animation/useAnimationConfig.js +2 -30
- package/dist/cjs/hooks/animation/useAnimationPreview.js +2 -31
- package/dist/cjs/hooks/animation/useAnimationTarget.js +2 -122
- package/dist/cjs/hooks/animation/useApplyAnimation.js +2 -89
- package/dist/cjs/hooks/articles/useArticlesQuery.js +2 -33
- package/dist/cjs/hooks/cart/use-add-to-cart.js +2 -20
- package/dist/cjs/hooks/cart/use-cart-data.js +2 -28
- package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +2 -20
- package/dist/cjs/hooks/cart/use-cart-note-update.js +2 -20
- package/dist/cjs/hooks/cart/use-create-cart.js +2 -22
- package/dist/cjs/hooks/cart/use-remove-cart-item.js +2 -20
- package/dist/cjs/hooks/cart/use-update-cart-item.js +2 -20
- package/dist/cjs/hooks/shop/use-collection-query.js +2 -22
- package/dist/cjs/hooks/shop/use-collections-query.js +2 -17
- package/dist/cjs/hooks/shop/use-product-query.js +2 -22
- package/dist/cjs/hooks/shop/use-products-query.js +2 -63
- package/dist/cjs/hooks/shop/useShopifyLink.js +2 -0
- package/dist/cjs/hooks/shop.js +2 -135
- package/dist/cjs/hooks/use-current-device.js +2 -30
- package/dist/cjs/hooks/use-lazy-video.js +2 -15
- package/dist/cjs/hooks/useAnimations.js +2 -29
- package/dist/cjs/hooks/useCartId.js +2 -44
- package/dist/cjs/hooks/useCartLine.js +2 -11
- package/dist/cjs/hooks/useCartUI.js +2 -48
- package/dist/cjs/hooks/useCollection.js +2 -9
- package/dist/cjs/hooks/useFetchHandle.js +2 -13
- package/dist/cjs/hooks/useFormatMoney.js +2 -75
- package/dist/cjs/hooks/useI18n.js +2 -0
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +2 -127
- package/dist/cjs/hooks/useInteraction.js +2 -19
- package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +2 -10
- package/dist/cjs/hooks/useLoadScript.js +2 -32
- package/dist/cjs/hooks/useMoney.js +2 -84
- package/dist/cjs/hooks/usePrevious.js +2 -19
- package/dist/cjs/hooks/useProduct.js +2 -250
- package/dist/cjs/hooks/useProductList.js +2 -21
- package/dist/cjs/hooks/useStickyStore.js +1 -0
- package/dist/cjs/hooks/useSuspenseFetch.js +2 -27
- package/dist/cjs/hooks/useSwatchesOptions.js +2 -41
- package/dist/cjs/hooks/useToolbarPostPurchase.js +2 -89
- package/dist/cjs/index.js +1 -425
- package/dist/cjs/types/animations.js +1 -49
- package/dist/cjs/types/appAPI.js +1 -2
- package/dist/cjs/types/custom.js +1 -52
- package/dist/cjs/types/global-style.js +1 -15
- package/dist/cjs/types/shop.js +1 -2
- package/dist/esm/components/AddOn.js +2 -14
- package/dist/esm/components/ComponentAnimation.js +2 -13
- package/dist/esm/components/ComponentToolbarPreview.js +2 -748
- package/dist/esm/components/ComponentWrapper.js +2 -57
- package/dist/esm/components/ComponentWrapperPreview.js +2 -209
- package/dist/esm/components/Empty.js +2 -3
- package/dist/esm/components/InteractionSuffix.js +2 -40
- package/dist/esm/components/Render.js +2 -71
- package/dist/esm/components/Render.liquid.js +16 -301
- package/dist/esm/components/RenderBlock.js +2 -50
- package/dist/esm/components/RenderCustomCode.js +4 -55
- package/dist/esm/components/RenderPreview.js +2 -63
- package/dist/esm/components/RenderSection.js +2 -19
- package/dist/esm/components/ai-generator/AIContentGenerator.js +2 -250
- package/dist/esm/components/ai-generator/AIGenContentLoading.js +2 -83
- package/dist/esm/components/ai-generator/components/PickProduct.js +2 -218
- package/dist/esm/components/ai-generator/components/ToneAndVoice.js +2 -75
- package/dist/esm/components/ai-generator/hooks/useCheckingProductInside.js +1 -45
- package/dist/esm/components/ai-generator/hooks/useFlipPopup.js +1 -108
- package/dist/esm/components/ai-generator/hooks/useGettingGenerateRequest.js +1 -35
- package/dist/esm/components/ai-generator/hooks/useListenEventGenerate.js +1 -68
- package/dist/esm/components/ai-generator/icons/AIIcon.js +2 -65
- package/dist/esm/components/ai-generator/icons/CloseIcon.js +2 -17
- package/dist/esm/components/ai-generator/icons/DropdownIcon.js +2 -34
- package/dist/esm/components/ai-generator/icons/SearchIcon.js +2 -19
- package/dist/esm/components/ai-generator/icons/ShowMoreIcon.js +2 -19
- package/dist/esm/components/ai-generator/icons/UpgradeIcon.js +2 -25
- package/dist/esm/components/ai-generator/icons/WarningIcon.js +2 -29
- package/dist/esm/components/constant.js +1 -75
- package/dist/esm/components/resize/Resize.js +2 -12
- package/dist/esm/components/resize/Spacing.js +2 -256
- package/dist/esm/components/src/product/helpers/variant-presets.js +1 -54
- package/dist/esm/components/theme-section/CreateThemeSection.js +2 -121
- package/dist/esm/components/theme-section/ThemeSectionStatus.js +2 -43
- package/dist/esm/components/theme-section/ThemeSectionTooltip.js +2 -124
- package/dist/esm/components/toolbar/Tooltip.js +2 -24
- package/dist/esm/constants/device.js +1 -0
- package/dist/esm/contexts/AddonContext.js +2 -32
- package/dist/esm/contexts/ArticleContext.js +2 -36
- package/dist/esm/contexts/ArticleListContext.js +2 -27
- package/dist/esm/contexts/BuilderComponent.js +2 -31
- package/dist/esm/contexts/BuilderContext.js +2 -36
- package/dist/esm/contexts/BuilderPreviewContext.js +2 -479
- package/dist/esm/contexts/CartLineContext.js +2 -26
- package/dist/esm/contexts/CollectionContext.js +2 -35
- package/dist/esm/contexts/I18nContext.js +2 -0
- package/dist/esm/contexts/ModalContext.js +2 -44
- package/dist/esm/contexts/PageContext.js +2 -108
- package/dist/esm/contexts/ProductContext.js +2 -179
- package/dist/esm/contexts/ProductListContext.js +2 -28
- package/dist/esm/contexts/SectionContext.js +2 -49
- package/dist/esm/contexts/ShopContext.js +2 -104
- package/dist/esm/graphql/fragments/analytic.generated.js +2 -4
- package/dist/esm/graphql/fragments/collection-detail.generated.js +2 -4
- package/dist/esm/graphql/fragments/collection-product.generated.js +2 -4
- package/dist/esm/graphql/fragments/collection.generated.js +2 -4
- package/dist/esm/graphql/fragments/custom-code.generated.js +2 -4
- package/dist/esm/graphql/fragments/custom-font.generated.js +7 -5
- package/dist/esm/graphql/fragments/data-seo.generated.js +2 -4
- package/dist/esm/graphql/fragments/media.generated.js +2 -4
- package/dist/esm/graphql/fragments/preview-theme-page.generated.js +6 -4
- package/dist/esm/graphql/fragments/product-little.generated.js +2 -4
- package/dist/esm/graphql/fragments/product-option-value.generated.js +2 -4
- package/dist/esm/graphql/fragments/product-option.generated.js +2 -4
- package/dist/esm/graphql/fragments/product.generated.js +2 -4
- package/dist/esm/graphql/fragments/published-custom-section.generated.js +2 -4
- package/dist/esm/graphql/fragments/published-page-section.generated.js +2 -4
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +4 -16
- package/dist/esm/graphql/fragments/published-theme-style.generated.js +2 -4
- package/dist/esm/graphql/fragments/selected-option.generated.js +2 -4
- package/dist/esm/graphql/fragments/variant.generated.js +2 -4
- package/dist/esm/graphql/mutations/page-view-up.generated.js +2 -4
- package/dist/esm/graphql/queries/articles.generated.js +2 -4
- package/dist/esm/graphql/queries/blogs.generated.js +2 -4
- package/dist/esm/graphql/queries/collection-detail-filter.generated.js +10 -22
- package/dist/esm/graphql/queries/collection.generated.js +8 -18
- package/dist/esm/graphql/queries/collections.generated.js +3 -8
- package/dist/esm/graphql/queries/preview-page.generated.js +6 -14
- package/dist/esm/graphql/queries/product-little-detail.generated.js +5 -12
- package/dist/esm/graphql/queries/product-medias.generated.js +2 -6
- package/dist/esm/graphql/queries/product-value-label.generated.js +2 -4
- package/dist/esm/graphql/queries/product-variants.generated.js +5 -11
- package/dist/esm/graphql/queries/products.generated.js +9 -20
- package/dist/esm/graphql/queries/{published-shop-metas.js → published-shop-metas.generated.js} +2 -4
- package/dist/esm/graphql/queries/published-theme-pages.generated.js +6 -20
- package/dist/esm/graphql/queries/shop-shopify.generated.js +2 -4
- package/dist/esm/graphql/queries/store-property.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/LibraryTemplate.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/SaleFunnelOffer.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/ShopLibraryPage.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/ThemePage.generated.js +2 -4
- package/dist/esm/helpers/GlobalEvent.js +1 -15
- package/dist/esm/helpers/align.js +1 -34
- package/dist/esm/helpers/animations.js +1 -220
- package/dist/esm/helpers/background.js +1 -227
- package/dist/esm/helpers/backgroundImage.js +1 -0
- package/dist/esm/helpers/borders.js +4 -189
- package/dist/esm/helpers/carousel.js +1 -51
- package/dist/esm/helpers/clone-deep.js +1 -3
- package/dist/esm/helpers/cls.js +1 -14
- package/dist/esm/helpers/colors.js +1 -169
- package/dist/esm/helpers/compose-advance-style.js +1 -315
- package/dist/esm/helpers/composeClasses.js +1 -0
- package/dist/esm/helpers/const.js +1 -0
- package/dist/esm/helpers/constant.js +1 -19
- package/dist/esm/helpers/convert.js +1 -4
- package/dist/esm/helpers/covert-entities-html.js +1 -17
- package/dist/esm/helpers/css-variable.js +1 -5
- package/dist/esm/helpers/email.js +1 -6
- package/dist/esm/helpers/filter-styles.js +1 -0
- package/dist/esm/helpers/filter-toolbar-preview.js +2 -9
- package/dist/esm/helpers/flatten-connection.js +1 -7
- package/dist/esm/helpers/get-resonsive-value.js +1 -31
- package/dist/esm/helpers/get-shortname.js +1 -90
- package/dist/esm/helpers/icon-list.js +1 -58
- package/dist/esm/helpers/interaction/index.js +2 -132
- package/dist/esm/helpers/is-browser.js +1 -5
- package/dist/esm/helpers/is-defined.js +1 -5
- package/dist/esm/helpers/is-empty-children.js +2 -10
- package/dist/esm/helpers/is-safari.js +1 -5
- package/dist/esm/helpers/layout.js +1 -70
- package/dist/esm/helpers/load-script.js +1 -29
- package/dist/esm/helpers/loop-component.js +1 -14
- package/dist/esm/helpers/make-style.js +1 -149
- package/dist/esm/helpers/normalize-builder-data.js +1 -21
- package/dist/esm/helpers/pascal-to-kebab-case.js +1 -5
- package/dist/esm/helpers/prefetch-queries.js +1 -76
- package/dist/esm/helpers/product.js +1 -44
- package/dist/esm/helpers/queries/get-collection.js +1 -223
- package/dist/esm/helpers/queries/get-collections.js +1 -19
- package/dist/esm/helpers/queries/get-product-by-slug.js +1 -123
- package/dist/esm/helpers/queries/get-product.js +1 -150
- package/dist/esm/helpers/queries/get-products.js +1 -210
- package/dist/esm/helpers/query.js +1 -25
- package/dist/esm/helpers/radius.js +6 -132
- package/dist/esm/helpers/render.js +1 -82
- package/dist/esm/helpers/shadow.js +1 -63
- package/dist/esm/helpers/size.js +4 -213
- package/dist/esm/helpers/spacing.js +1 -40
- package/dist/esm/helpers/third-party/addAppBlockId.js +1 -18
- package/dist/esm/helpers/third-party/appConfig.js +1 -356
- package/dist/esm/helpers/third-party/appSetting.js +1 -1321
- package/dist/esm/helpers/third-party/composeAppBlockId.js +1 -9
- package/dist/esm/helpers/third-party/constant.js +1 -66
- package/dist/esm/helpers/third-party/generateAppBlockConfigs.js +1 -32
- package/dist/esm/helpers/third-party/getAppBlockConfig.js +1 -53
- package/dist/esm/helpers/third-party/getAppBlockType.js +1 -10
- package/dist/esm/helpers/third-party/getAppBlocks.js +1 -28
- package/dist/esm/helpers/third-party/mergeBlock.js +1 -17
- package/dist/esm/helpers/third-party/mergeBlockOrder.js +1 -45
- package/dist/esm/helpers/third-party/removeGPAppItems.js +1 -15
- package/dist/esm/helpers/tracking/fpixel.js +1 -24
- package/dist/esm/helpers/tracking/gtag.js +1 -87
- package/dist/esm/helpers/tracking/tiktokpixel.js +1 -15
- package/dist/esm/helpers/typography.js +19 -149
- package/dist/esm/helpers/variant.js +1 -9
- package/dist/esm/hooks/animation/useAnimationActions.js +2 -37
- package/dist/esm/hooks/animation/useAnimationConfig.js +2 -28
- package/dist/esm/hooks/animation/useAnimationPreview.js +2 -29
- package/dist/esm/hooks/animation/useAnimationTarget.js +2 -120
- package/dist/esm/hooks/animation/useApplyAnimation.js +2 -85
- package/dist/esm/hooks/articles/useArticlesQuery.js +2 -30
- package/dist/esm/hooks/cart/use-add-to-cart.js +2 -18
- package/dist/esm/hooks/cart/use-cart-data.js +2 -26
- package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +2 -18
- package/dist/esm/hooks/cart/use-cart-note-update.js +2 -18
- package/dist/esm/hooks/cart/use-create-cart.js +2 -20
- package/dist/esm/hooks/cart/use-remove-cart-item.js +2 -18
- package/dist/esm/hooks/cart/use-update-cart-item.js +2 -18
- package/dist/esm/hooks/shop/use-collection-query.js +2 -20
- package/dist/esm/hooks/shop/use-collections-query.js +2 -15
- package/dist/esm/hooks/shop/use-product-query.js +2 -20
- package/dist/esm/hooks/shop/use-products-query.js +2 -59
- package/dist/esm/hooks/shop/useShopifyLink.js +2 -0
- package/dist/esm/hooks/shop.js +2 -119
- package/dist/esm/hooks/use-current-device.js +2 -28
- package/dist/esm/hooks/use-lazy-video.js +2 -13
- package/dist/esm/hooks/useAnimations.js +2 -27
- package/dist/esm/hooks/useCartId.js +2 -40
- package/dist/esm/hooks/useCartLine.js +2 -7
- package/dist/esm/hooks/useCartUI.js +2 -44
- package/dist/esm/hooks/useCollection.js +2 -7
- package/dist/esm/hooks/useFetchHandle.js +2 -11
- package/dist/esm/hooks/useFormatMoney.js +2 -71
- package/dist/esm/hooks/useI18n.js +2 -0
- package/dist/esm/hooks/useInitialSwatchesOptions.js +2 -123
- package/dist/esm/hooks/useInteraction.js +2 -17
- package/dist/esm/hooks/useIsomorphicLayoutEffect.js +2 -6
- package/dist/esm/hooks/useLoadScript.js +2 -28
- package/dist/esm/hooks/useMoney.js +2 -80
- package/dist/esm/hooks/usePrevious.js +2 -17
- package/dist/esm/hooks/useProduct.js +2 -233
- package/dist/esm/hooks/useProductList.js +2 -16
- package/dist/esm/hooks/useStickyStore.js +1 -0
- package/dist/esm/hooks/useSuspenseFetch.js +2 -23
- package/dist/esm/hooks/useSwatchesOptions.js +2 -37
- package/dist/esm/hooks/useToolbarPostPurchase.js +2 -87
- package/dist/esm/index.js +1 -119
- package/dist/esm/types/animations.js +1 -49
- package/dist/esm/types/custom.js +1 -52
- package/dist/esm/types/global-style.js +1 -12
- package/dist/types/index.d.ts +12025 -8969
- package/package.json +6 -6
- package/dist/cjs/web-components/src/helpers/styles/constant.js +0 -9
- package/dist/esm/web-components/src/helpers/styles/constant.js +0 -7
|
@@ -1,111 +1,2 @@
|
|
|
1
|
-
'use
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var react = require('react');
|
|
5
|
-
var zustand = require('zustand');
|
|
6
|
-
|
|
7
|
-
const PageContext = /*#__PURE__*/ react.createContext(null);
|
|
8
|
-
const createPageStoreProvider = (data)=>zustand.createStore((set)=>({
|
|
9
|
-
...data,
|
|
10
|
-
setDynamicProduct: (data)=>{
|
|
11
|
-
set({
|
|
12
|
-
dynamicProduct: data
|
|
13
|
-
});
|
|
14
|
-
},
|
|
15
|
-
setDynamicCollection: (data)=>{
|
|
16
|
-
set({
|
|
17
|
-
dynamicCollection: data
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
setPostPurchaseProductOffers: (productOffers)=>{
|
|
21
|
-
set({
|
|
22
|
-
productOffers: productOffers
|
|
23
|
-
});
|
|
24
|
-
},
|
|
25
|
-
setDynamicDiscountOffer: (dynamicDiscountOffer)=>{
|
|
26
|
-
set({
|
|
27
|
-
dynamicDiscountOffer: dynamicDiscountOffer
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
setSalePageProductId: (id)=>{
|
|
31
|
-
set({
|
|
32
|
-
salePageProductId: id
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
setPublicStoreFrontData: (publicStoreFrontData)=>{
|
|
36
|
-
set({
|
|
37
|
-
publicStoreFrontData: publicStoreFrontData
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
setInteractionIsSelectOnPage: (value)=>{
|
|
41
|
-
set((state)=>({
|
|
42
|
-
interactionData: {
|
|
43
|
-
...state.interactionData,
|
|
44
|
-
isSelectOnPage: value
|
|
45
|
-
}
|
|
46
|
-
}));
|
|
47
|
-
},
|
|
48
|
-
setInteractionItem: (item)=>{
|
|
49
|
-
set((state)=>({
|
|
50
|
-
interactionData: {
|
|
51
|
-
...state.interactionData,
|
|
52
|
-
item,
|
|
53
|
-
isSelectOnPage: state.interactionData?.isSelectOnPage || false
|
|
54
|
-
}
|
|
55
|
-
}));
|
|
56
|
-
},
|
|
57
|
-
setInteractionSelectType: (selectType)=>{
|
|
58
|
-
set((state)=>({
|
|
59
|
-
interactionData: {
|
|
60
|
-
...state.interactionData,
|
|
61
|
-
selectType
|
|
62
|
-
}
|
|
63
|
-
}));
|
|
64
|
-
},
|
|
65
|
-
setInteractionSettingType: (settingType)=>{
|
|
66
|
-
set((state)=>({
|
|
67
|
-
interactionData: {
|
|
68
|
-
...state.interactionData,
|
|
69
|
-
settingType
|
|
70
|
-
}
|
|
71
|
-
}));
|
|
72
|
-
},
|
|
73
|
-
setSidebarMode: (mode)=>{
|
|
74
|
-
set(()=>({
|
|
75
|
-
sidebarMode: mode
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
}));
|
|
79
|
-
const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, dynamicDiscountOffer, publicStoreFrontData, ...passProps })=>{
|
|
80
|
-
const store = react.useMemo(()=>createPageStoreProvider({
|
|
81
|
-
dynamicProduct,
|
|
82
|
-
dynamicCollection,
|
|
83
|
-
productOffers,
|
|
84
|
-
dynamicDiscountOffer,
|
|
85
|
-
publicStoreFrontData,
|
|
86
|
-
interactionData: {
|
|
87
|
-
selectType: 'ELEMENT'
|
|
88
|
-
}
|
|
89
|
-
}), [
|
|
90
|
-
dynamicProduct,
|
|
91
|
-
dynamicCollection,
|
|
92
|
-
productOffers,
|
|
93
|
-
dynamicDiscountOffer,
|
|
94
|
-
publicStoreFrontData
|
|
95
|
-
]);
|
|
96
|
-
return /*#__PURE__*/ jsxRuntime.jsx(PageContext.Provider, {
|
|
97
|
-
...passProps,
|
|
98
|
-
value: store,
|
|
99
|
-
children: children
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
const usePageStore = (selector, equalityFn)=>{
|
|
103
|
-
const store = react.useContext(PageContext);
|
|
104
|
-
if (!store) {
|
|
105
|
-
throw new Error('usePageStore must be used within a PageProvider');
|
|
106
|
-
}
|
|
107
|
-
return zustand.useStore(store, selector, equalityFn);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
exports.PageProvider = PageProvider;
|
|
111
|
-
exports.usePageStore = usePageStore;
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand");const PageContext=react.createContext(null),createPageStoreProvider=e=>zustand.createStore(t=>({...e,setDynamicProduct:e=>{t({dynamicProduct:e})},setDynamicCollection:e=>{t({dynamicCollection:e})},setPostPurchaseProductOffers:e=>{t({productOffers:e})},setDynamicDiscountOffer:e=>{t({dynamicDiscountOffer:e})},setSalePageProductId:e=>{t({salePageProductId:e})},setPublicStoreFrontData:e=>{t({publicStoreFrontData:e})},setInteractionIsSelectOnPage:e=>{t(t=>({interactionData:{...t.interactionData,isSelectOnPage:e}}))},setInteractionItem:e=>{t(t=>({interactionData:{...t.interactionData,item:e,isSelectOnPage:t.interactionData?.isSelectOnPage||!1}}))},setInteractionSelectType:e=>{t(t=>({interactionData:{...t.interactionData,selectType:e}}))},setInteractionSettingType:e=>{t(t=>({interactionData:{...t.interactionData,settingType:e}}))},setSidebarMode:e=>{t(()=>({sidebarMode:e}))}})),PageProvider=({children:e,dynamicProduct:t,dynamicCollection:a,productOffers:r,dynamicDiscountOffer:n,publicStoreFrontData:i,...o})=>{let c=react.useMemo(()=>createPageStoreProvider({dynamicProduct:t,dynamicCollection:a,productOffers:r,dynamicDiscountOffer:n,publicStoreFrontData:i,interactionData:{selectType:"ELEMENT"}}),[t,a,r,n,i]);return jsxRuntime.jsx(PageContext.Provider,{...o,value:c,children:e})},usePageStore=(e,t)=>{let a=react.useContext(PageContext);if(!a)throw Error("usePageStore must be used within a PageProvider");return zustand.useStore(a,e,t)};exports.PageProvider=PageProvider,exports.usePageStore=usePageStore;
|
|
@@ -1,182 +1,2 @@
|
|
|
1
|
-
'use
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var react = require('react');
|
|
5
|
-
var zustand = require('zustand');
|
|
6
|
-
require('swr');
|
|
7
|
-
require('@gem-sdk/adapter-shopify');
|
|
8
|
-
require('swr/mutation');
|
|
9
|
-
require('swr/infinite');
|
|
10
|
-
require('vanilla-lazyload');
|
|
11
|
-
require('../hooks/useCartUI.js');
|
|
12
|
-
var variant = require('../helpers/variant.js');
|
|
13
|
-
require('react-transition-group');
|
|
14
|
-
require('@gem-sdk/core');
|
|
15
|
-
require('classnames');
|
|
16
|
-
require('dayjs');
|
|
17
|
-
var flattenConnection = require('../helpers/flatten-connection.js');
|
|
18
|
-
require('../helpers/convert.js');
|
|
19
|
-
|
|
20
|
-
// const { Provider, useStore } = createContext<StoreApi<ProductContextProps>>();
|
|
21
|
-
const ProductContext = /*#__PURE__*/ react.createContext(null);
|
|
22
|
-
const createProductStoreProvider = (data)=>zustand.createStore((set, get)=>({
|
|
23
|
-
...data,
|
|
24
|
-
updateProperty: (name, data)=>{
|
|
25
|
-
set((state)=>{
|
|
26
|
-
return {
|
|
27
|
-
properties: state.properties?.map((v)=>{
|
|
28
|
-
if (v.key === name) {
|
|
29
|
-
return {
|
|
30
|
-
...v,
|
|
31
|
-
...data
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
return v;
|
|
35
|
-
})
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
setUseProductCompareAtPrice: (value)=>{
|
|
40
|
-
set({
|
|
41
|
-
useProductCompareAtPrice: value
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
addProperty: (data)=>{
|
|
45
|
-
const properties = get().properties;
|
|
46
|
-
if (!properties?.some((v)=>v.key === data.key)) {
|
|
47
|
-
set((state)=>({
|
|
48
|
-
properties: [
|
|
49
|
-
...state.properties ?? [],
|
|
50
|
-
data
|
|
51
|
-
]
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
removeProperty: (name)=>{
|
|
56
|
-
set((state)=>({
|
|
57
|
-
properties: state.properties?.filter((v)=>v.key !== name)
|
|
58
|
-
}));
|
|
59
|
-
},
|
|
60
|
-
setQuantity: (num)=>{
|
|
61
|
-
set({
|
|
62
|
-
quantity: num > 0 ? num : 1
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
setProductFeaturedImage: (image)=>{
|
|
66
|
-
set({
|
|
67
|
-
featuredImageGlobal: image
|
|
68
|
-
});
|
|
69
|
-
},
|
|
70
|
-
incrementQuantity: ()=>{
|
|
71
|
-
set((state)=>{
|
|
72
|
-
const quantity = state.quantity ?? 1;
|
|
73
|
-
return {
|
|
74
|
-
quantity: quantity + 1
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
decrementQuantity: ()=>{
|
|
79
|
-
set((state)=>{
|
|
80
|
-
const quantity = state.quantity ?? 1;
|
|
81
|
-
return {
|
|
82
|
-
quantity: quantity > 2 ? quantity - 1 : 1
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
|
-
},
|
|
86
|
-
setSelectedOption: (optionId, optionValue)=>{
|
|
87
|
-
set((state)=>{
|
|
88
|
-
if (optionId && optionValue) {
|
|
89
|
-
return {
|
|
90
|
-
selectedOptions: {
|
|
91
|
-
...state?.selectedOptions,
|
|
92
|
-
[optionId]: optionValue
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
return state;
|
|
97
|
-
});
|
|
98
|
-
},
|
|
99
|
-
forceSelectedOption: (value)=>{
|
|
100
|
-
set((state)=>{
|
|
101
|
-
return {
|
|
102
|
-
selectedOptions: {
|
|
103
|
-
...state?.selectedOptions,
|
|
104
|
-
...value
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
});
|
|
108
|
-
},
|
|
109
|
-
updateIsSubmit: (value)=>{
|
|
110
|
-
set({
|
|
111
|
-
isSubmit: value
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
setHasUpdatePriceFollowQuantity: (updatePrice)=>{
|
|
115
|
-
set({
|
|
116
|
-
updatePrice
|
|
117
|
-
});
|
|
118
|
-
},
|
|
119
|
-
setHasPreSelected: (value)=>{
|
|
120
|
-
set({
|
|
121
|
-
hasPreSelected: value
|
|
122
|
-
});
|
|
123
|
-
},
|
|
124
|
-
setIsChangeSelectedOption: (value)=>{
|
|
125
|
-
set({
|
|
126
|
-
isChangeSelectedOption: value
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}));
|
|
130
|
-
const ProductProvider = ({ children, product, initialVariantId, quantity = 1, isSyncProduct })=>{
|
|
131
|
-
const uiqueId = react.useId();
|
|
132
|
-
const store = react.useMemo(()=>{
|
|
133
|
-
let selectedOptions = {};
|
|
134
|
-
let featuredImageGlobal = undefined;
|
|
135
|
-
if (product) {
|
|
136
|
-
const variants = flattenConnection.flattenConnection(product.variants);
|
|
137
|
-
const firstVariant = variants[0];
|
|
138
|
-
const firstVariantInStock = variants.find((item)=>variant.checkInStock(item));
|
|
139
|
-
const initialVariant = variants.find((v)=>v?.id === initialVariantId) ?? firstVariantInStock ?? firstVariant;
|
|
140
|
-
selectedOptions = initialVariant?.selectedOptions.reduce((acc, option)=>{
|
|
141
|
-
if (option.name) {
|
|
142
|
-
return {
|
|
143
|
-
...acc,
|
|
144
|
-
[option.name]: option.value
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
return acc;
|
|
148
|
-
}, {});
|
|
149
|
-
featuredImageGlobal = product.medias?.edges.find((v)=>v.node?.id === initialVariant?.mediaId)?.node ?? product.featuredImage;
|
|
150
|
-
}
|
|
151
|
-
return createProductStoreProvider({
|
|
152
|
-
product,
|
|
153
|
-
quantity,
|
|
154
|
-
selectedOptions,
|
|
155
|
-
uiqueId,
|
|
156
|
-
featuredImageGlobal,
|
|
157
|
-
isSyncProduct
|
|
158
|
-
});
|
|
159
|
-
}, [
|
|
160
|
-
initialVariantId,
|
|
161
|
-
product,
|
|
162
|
-
quantity,
|
|
163
|
-
uiqueId,
|
|
164
|
-
isSyncProduct
|
|
165
|
-
]);
|
|
166
|
-
return /*#__PURE__*/ jsxRuntime.jsx(ProductContext.Provider, {
|
|
167
|
-
value: store,
|
|
168
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
169
|
-
children: children
|
|
170
|
-
})
|
|
171
|
-
});
|
|
172
|
-
};
|
|
173
|
-
const useProductStore = (selector, equalityFn)=>{
|
|
174
|
-
const store = react.useContext(ProductContext);
|
|
175
|
-
if (!store) {
|
|
176
|
-
throw new Error('Element of product must be used inside a Product');
|
|
177
|
-
}
|
|
178
|
-
return zustand.useStore(store, selector, equalityFn);
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
exports.ProductProvider = ProductProvider;
|
|
182
|
-
exports.useProductStore = useProductStore;
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand");require("swr"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("swr/infinite"),require("vanilla-lazyload"),require("../hooks/useCartUI.js"),require("../hooks/useStickyStore.js");var variant=require("../helpers/variant.js");require("react-transition-group"),require("@gem-sdk/core"),require("classnames"),require("dayjs");var flattenConnection=require("../helpers/flatten-connection.js");require("../helpers/convert.js");const ProductContext=react.createContext(null),createProductStoreProvider=e=>zustand.createStore((t,r)=>({...e,updateProperty:(e,r)=>{t(t=>({properties:t.properties?.map(t=>t.key===e?{...t,...r}:t)}))},setUseProductCompareAtPrice:e=>{t({useProductCompareAtPrice:e})},setShouldRequireUploadMessage:e=>{t({shouldRequireUploadMessage:e})},setRequireUpload:e=>{t({requireUpload:e})},addProperty:e=>{let i=r().properties;i?.some(t=>t.key===e.key)||t(t=>({properties:[...t.properties??[],e]}))},removeProperty:e=>{t(t=>({properties:t.properties?.filter(t=>t.key!==e)}))},setQuantity:e=>{t({quantity:e>0?e:1})},setProductFeaturedImage:e=>{t({featuredImageGlobal:e})},incrementQuantity:()=>{t(e=>{let t=e.quantity??1;return{quantity:t+1}})},decrementQuantity:()=>{t(e=>{let t=e.quantity??1;return{quantity:t>2?t-1:1}})},setSelectedOption:(e,r)=>{t(t=>e&&r?{selectedOptions:{...t?.selectedOptions,[e]:r}}:t)},forceSelectedOption:e=>{t(t=>({selectedOptions:{...t?.selectedOptions,...e}}))},updateIsSubmit:e=>{t({isSubmit:e})},setHasUpdatePriceFollowQuantity:e=>{t({updatePrice:e})},setHasPreSelected:e=>{t({hasPreSelected:e})},setIsChangeSelectedOption:e=>{t({isChangeSelectedOption:e})}})),ProductProvider=({children:e,product:t,initialVariantId:r,initialVariantBaseId:i,quantity:o=1,isSyncProduct:s,hasPreSelected:u})=>{let a=react.useId(),n=react.useMemo(()=>{let e,n={};if(t){let o=flattenConnection.flattenConnection(t.variants),s=o[0],u=o.find(e=>variant.checkInStock(e)),a=o.find(e=>e?.id===r||e?.baseID===i)??u??s;n=a?.selectedOptions?.reduce((e,t)=>t.name?{...e,[t.name]:t.value}:e,{}),e=t.medias?.edges.find(e=>e.node?.id===a?.mediaId)?.node??t.featuredImage}return createProductStoreProvider({product:t,quantity:o,selectedOptions:n,uiqueId:a,featuredImageGlobal:e,isSyncProduct:s,hasPreSelected:u})},[t,o,a,s,u,r]);return jsxRuntime.jsx(ProductContext.Provider,{value:n,children:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})})},useProductStore=(e,t)=>{let r=react.useContext(ProductContext);if(!r)throw Error("Element of product must be used inside a Product");return zustand.useStore(r,e,t)};exports.ProductProvider=ProductProvider,exports.useProductStore=useProductStore;
|
|
@@ -1,32 +1,2 @@
|
|
|
1
|
-
'use
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var react = require('react');
|
|
5
|
-
var zustand = require('zustand');
|
|
6
|
-
|
|
7
|
-
const ProductListContext = /*#__PURE__*/ react.createContext(null);
|
|
8
|
-
const createProductListProvider = (data)=>zustand.createStore(()=>({
|
|
9
|
-
...data
|
|
10
|
-
}));
|
|
11
|
-
const ProductListProvider = ({ children, collection, products, settings, styles })=>{
|
|
12
|
-
return /*#__PURE__*/ jsxRuntime.jsx(ProductListContext.Provider, {
|
|
13
|
-
value: createProductListProvider({
|
|
14
|
-
products,
|
|
15
|
-
collection,
|
|
16
|
-
settings,
|
|
17
|
-
styles
|
|
18
|
-
}),
|
|
19
|
-
children: children
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
const useProductListStore = (selector, equalityFn)=>{
|
|
23
|
-
const store = react.useContext(ProductListContext);
|
|
24
|
-
if (!store) {
|
|
25
|
-
throw new Error('useProductListStore must be used within a useProductListStore');
|
|
26
|
-
}
|
|
27
|
-
return zustand.useStore(store, selector, equalityFn);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
exports.ProductListContext = ProductListContext;
|
|
31
|
-
exports.ProductListProvider = ProductListProvider;
|
|
32
|
-
exports.useProductListStore = useProductListStore;
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand");const ProductListContext=react.createContext(null),createProductListProvider=t=>zustand.createStore(()=>({...t})),ProductListProvider=({children:t,collection:r,products:e,settings:o,styles:s})=>jsxRuntime.jsx(ProductListContext.Provider,{value:createProductListProvider({products:e,collection:r,settings:o,styles:s}),children:t}),useProductListStore=(t,r)=>{let e=react.useContext(ProductListContext);if(!e)throw Error("useProductListStore must be used within a useProductListStore");return zustand.useStore(e,t,r)};exports.ProductListContext=ProductListContext,exports.ProductListProvider=ProductListProvider,exports.useProductListStore=useProductListStore;
|
|
@@ -1,53 +1,2 @@
|
|
|
1
|
-
'use
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var zustand = require('zustand');
|
|
5
|
-
var react = require('react');
|
|
6
|
-
var cloneDeep = require('../helpers/clone-deep.js');
|
|
7
|
-
var normalizeBuilderData = require('../helpers/normalize-builder-data.js');
|
|
8
|
-
|
|
9
|
-
const SectionContext = /*#__PURE__*/ react.createContext(null);
|
|
10
|
-
const createSectionProvider = (data)=>zustand.createStore((set, get)=>({
|
|
11
|
-
data: data ?? {},
|
|
12
|
-
getSection: (id)=>{
|
|
13
|
-
const section = get().data[id];
|
|
14
|
-
return section ?? undefined;
|
|
15
|
-
},
|
|
16
|
-
addSection: (id, data)=>{
|
|
17
|
-
const item = normalizeBuilderData.normalizeBuilderData(data);
|
|
18
|
-
set((prev)=>({
|
|
19
|
-
data: {
|
|
20
|
-
...prev.data,
|
|
21
|
-
[id]: cloneDeep.cloneDeep(item)
|
|
22
|
-
}
|
|
23
|
-
}));
|
|
24
|
-
},
|
|
25
|
-
removeSection: (id)=>{
|
|
26
|
-
set((prev)=>{
|
|
27
|
-
const { [id]: _, ...rest } = prev.data;
|
|
28
|
-
return {
|
|
29
|
-
data: rest
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}));
|
|
34
|
-
const SectionProvider = ({ children, data, ...passProps })=>{
|
|
35
|
-
return /*#__PURE__*/ jsxRuntime.jsx(SectionContext.Provider, {
|
|
36
|
-
...passProps,
|
|
37
|
-
value: createSectionProvider(data),
|
|
38
|
-
children: children
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
// export const useSectionStore = useStore;
|
|
42
|
-
const useSectionStore = (selector, equalityFn)=>{
|
|
43
|
-
const store = react.useContext(SectionContext);
|
|
44
|
-
if (!store) {
|
|
45
|
-
throw new Error('useSectionStore must be used within a SectionProvider');
|
|
46
|
-
}
|
|
47
|
-
return zustand.useStore(store, selector, equalityFn);
|
|
48
|
-
};
|
|
49
|
-
const useSection = (id)=>useSectionStore((s)=>s.getSection(id));
|
|
50
|
-
|
|
51
|
-
exports.SectionProvider = SectionProvider;
|
|
52
|
-
exports.useSection = useSection;
|
|
53
|
-
exports.useSectionStore = useSectionStore;
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),zustand=require("zustand"),react=require("react"),cloneDeep=require("../helpers/clone-deep.js"),normalizeBuilderData=require("../helpers/normalize-builder-data.js");const SectionContext=react.createContext(null),createSectionProvider=e=>zustand.createStore((t,r)=>({data:e??{},getSection:e=>{let t=r().data[e];return t??void 0},addSection:(e,r)=>{let o=normalizeBuilderData.normalizeBuilderData(r);t(t=>({data:{...t.data,[e]:cloneDeep.cloneDeep(o)}}))},removeSection:e=>{t(t=>{let{[e]:r,...o}=t.data;return{data:o}})}})),SectionProvider=({children:e,data:t,...r})=>jsxRuntime.jsx(SectionContext.Provider,{...r,value:createSectionProvider(t),children:e}),useSectionStore=(e,t)=>{let r=react.useContext(SectionContext);if(!r)throw Error("useSectionStore must be used within a SectionProvider");return zustand.useStore(r,e,t)},useSection=e=>useSectionStore(t=>t.getSection(e));exports.SectionProvider=SectionProvider,exports.useSection=useSection,exports.useSectionStore=useSectionStore;
|
|
@@ -1,107 +1,2 @@
|
|
|
1
|
-
'use
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var useSWR = require('swr');
|
|
5
|
-
var zustand = require('zustand');
|
|
6
|
-
var react = require('react');
|
|
7
|
-
var AddonContext = require('./AddonContext.js');
|
|
8
|
-
var ModalContext = require('./ModalContext.js');
|
|
9
|
-
|
|
10
|
-
const ShopContext = /*#__PURE__*/ react.createContext(null);
|
|
11
|
-
const createShopStoreProvider = (data)=>zustand.createStore((set)=>({
|
|
12
|
-
mobileOnly: false,
|
|
13
|
-
isStorefront: true,
|
|
14
|
-
...data,
|
|
15
|
-
changeLocale: (locale)=>{
|
|
16
|
-
set({
|
|
17
|
-
locale
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
changeCurrency: (currency)=>{
|
|
21
|
-
set({
|
|
22
|
-
currency
|
|
23
|
-
});
|
|
24
|
-
},
|
|
25
|
-
changeSwatches: (swatches)=>{
|
|
26
|
-
set({
|
|
27
|
-
swatches
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
changeLayoutSettings: (layoutSettings)=>{
|
|
31
|
-
set({
|
|
32
|
-
layoutSettings
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
changeStorefrontInfo: ({ url, token })=>{
|
|
36
|
-
set({
|
|
37
|
-
storefrontUrl: url,
|
|
38
|
-
storefrontToken: token
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
changeCreateThemeSectionCount: (count)=>{
|
|
42
|
-
set({
|
|
43
|
-
createThemeSectionCount: count
|
|
44
|
-
});
|
|
45
|
-
},
|
|
46
|
-
changeShopPlan: (plan)=>{
|
|
47
|
-
set({
|
|
48
|
-
plan
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
changeLimitCreateThemeSection: (data)=>{
|
|
52
|
-
set({
|
|
53
|
-
limitCreateThemeSection: data
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}));
|
|
57
|
-
const ShopProvider = ({ children, addons, storeOption, queryOption, ...passProps })=>{
|
|
58
|
-
const store = react.useMemo(()=>createShopStoreProvider(storeOption), [
|
|
59
|
-
storeOption
|
|
60
|
-
]);
|
|
61
|
-
const onUpdateLimitation = react.useCallback((e)=>{
|
|
62
|
-
const isAllow = !!e.detail?.isAllow;
|
|
63
|
-
const maxGenerateCount = e.detail?.maxGenerateCount;
|
|
64
|
-
const nextQuota = e.detail?.nextQuota;
|
|
65
|
-
store.setState({
|
|
66
|
-
generateContentLimitation: {
|
|
67
|
-
isAllow,
|
|
68
|
-
maxGenerateCount,
|
|
69
|
-
nextQuota
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}, [
|
|
73
|
-
store
|
|
74
|
-
]);
|
|
75
|
-
react.useEffect(()=>{
|
|
76
|
-
window.addEventListener('editor:ai-generate-content-update-limitation', onUpdateLimitation);
|
|
77
|
-
return ()=>{
|
|
78
|
-
window.removeEventListener('editor:ai-generate-content-update-limitation', onUpdateLimitation);
|
|
79
|
-
};
|
|
80
|
-
}, [
|
|
81
|
-
onUpdateLimitation
|
|
82
|
-
]);
|
|
83
|
-
return /*#__PURE__*/ jsxRuntime.jsx(AddonContext.AddonProvider, {
|
|
84
|
-
components: addons,
|
|
85
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(useSWR.SWRConfig, {
|
|
86
|
-
value: queryOption,
|
|
87
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(ShopContext.Provider, {
|
|
88
|
-
...passProps,
|
|
89
|
-
value: store,
|
|
90
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(ModalContext.ModalProvider, {
|
|
91
|
-
children: children
|
|
92
|
-
})
|
|
93
|
-
}, JSON.stringify(storeOption))
|
|
94
|
-
})
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
// export const useShopStore = useStore;
|
|
98
|
-
const useShopStore = (selector, equalityFn)=>{
|
|
99
|
-
const store = react.useContext(ShopContext);
|
|
100
|
-
if (!store) {
|
|
101
|
-
throw new Error('useShopStore must be used within a ShopProvider');
|
|
102
|
-
}
|
|
103
|
-
return zustand.useStore(store, selector, equalityFn);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
exports.ShopProvider = ShopProvider;
|
|
107
|
-
exports.useShopStore = useShopStore;
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),useSWR=require("swr"),zustand=require("zustand"),react=require("react"),AddonContext=require("./AddonContext.js"),ModalContext=require("./ModalContext.js");const ShopContext=react.createContext(null),createShopStoreProvider=e=>zustand.createStore(t=>({mobileOnly:!1,isStorefront:!0,...e,changeLocale:e=>{t({locale:e})},changeCurrency:e=>{t({currency:e})},changeSwatches:e=>{t({swatches:e})},changeLayoutSettings:e=>{t({layoutSettings:e})},updatePriceWithCurrency:e=>{t({showPriceCurrency:e})},changeStorefrontInfo:({url:e,token:r})=>{t({storefrontUrl:e,storefrontToken:r})},changeCreateThemeSectionCount:e=>{t({createThemeSectionCount:e})},changeShopPlan:e=>{t({plan:e})},changeLimitCreateThemeSection:e=>{t({limitCreateThemeSection:e})}})),ShopProvider=({children:e,addons:t,storeOption:r,queryOption:o,...n})=>{let i=react.useMemo(()=>createShopStoreProvider(r),[r]),a=react.useCallback(e=>{let t=!!e.detail?.isAllow,r=e.detail?.maxGenerateCount,o=e.detail?.nextQuota;i.setState({generateContentLimitation:{isAllow:t,maxGenerateCount:r,nextQuota:o}})},[i]);return react.useEffect(()=>(window.addEventListener("editor:ai-generate-content-update-limitation",a),()=>{window.removeEventListener("editor:ai-generate-content-update-limitation",a)}),[a]),jsxRuntime.jsx(AddonContext.AddonProvider,{components:t,children:jsxRuntime.jsx(useSWR.SWRConfig,{value:o,children:jsxRuntime.jsx(ShopContext.Provider,{...n,value:i,children:jsxRuntime.jsx(ModalContext.ModalProvider,{children:e})},JSON.stringify(r))})})},useShopStore=(e,t)=>{let r=react.useContext(ShopContext);if(!r)throw Error("useShopStore must be used within a ShopProvider");return zustand.useStore(r,e,t)};exports.ShopProvider=ShopProvider,exports.useShopStore=useShopStore;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable */ const AnalyticSelect = `
|
|
1
|
+
"use strict";const AnalyticSelect=`
|
|
4
2
|
fragment AnalyticSelect on Analytic {
|
|
5
3
|
fbPixelID
|
|
6
4
|
gaTrackingID
|
|
7
5
|
tiktokPixelID
|
|
8
6
|
}
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
exports.AnalyticSelect = AnalyticSelect;
|
|
7
|
+
`;exports.AnalyticSelect=AnalyticSelect;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable */ const CollectionDetailSelect = `
|
|
1
|
+
"use strict";const CollectionDetailSelect=`
|
|
4
2
|
fragment CollectionDetailSelect on Collection {
|
|
5
3
|
id
|
|
6
4
|
createdAt
|
|
@@ -22,6 +20,4 @@
|
|
|
22
20
|
isStorefront
|
|
23
21
|
isSample
|
|
24
22
|
}
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
exports.CollectionDetailSelect = CollectionDetailSelect;
|
|
23
|
+
`;exports.CollectionDetailSelect=CollectionDetailSelect;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable */ const CollectionProductSelect = `
|
|
1
|
+
"use strict";const CollectionProductSelect=`
|
|
4
2
|
fragment CollectionProductSelect on Collection {
|
|
5
3
|
...CollectionDetailSelect
|
|
6
4
|
products(
|
|
@@ -21,6 +19,4 @@
|
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
exports.CollectionProductSelect = CollectionProductSelect;
|
|
22
|
+
`;exports.CollectionProductSelect=CollectionProductSelect;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable */ const CollectionSelect = `
|
|
1
|
+
"use strict";const CollectionSelect=`
|
|
4
2
|
fragment CollectionSelect on Collection {
|
|
5
3
|
...CollectionDetailSelect
|
|
6
4
|
products {
|
|
@@ -19,6 +17,4 @@
|
|
|
19
17
|
totalCount
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
exports.CollectionSelect = CollectionSelect;
|
|
20
|
+
`;exports.CollectionSelect=CollectionSelect;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable */ const CustomCodeSelect = `
|
|
1
|
+
"use strict";const CustomCodeSelect=`
|
|
4
2
|
fragment CustomCodeSelect on CustomCode {
|
|
5
3
|
body
|
|
6
4
|
header
|
|
7
5
|
}
|
|
8
|
-
`;
|
|
9
|
-
|
|
10
|
-
exports.CustomCodeSelect = CustomCodeSelect;
|
|
6
|
+
`;exports.CustomCodeSelect=CustomCodeSelect;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable */ const CustomFontSelect = `
|
|
1
|
+
"use strict";const CustomFontSelect=`
|
|
4
2
|
fragment CustomFontSelect on CustomFont {
|
|
5
3
|
backupFilePath
|
|
4
|
+
fileKey
|
|
5
|
+
filePath
|
|
6
6
|
fontFamily
|
|
7
7
|
fontStyle
|
|
8
8
|
fontWeight
|
|
9
|
+
id
|
|
9
10
|
mimeType
|
|
10
|
-
|
|
11
|
+
shopID
|
|
12
|
+
size
|
|
11
13
|
}
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
exports.CustomFontSelect = CustomFontSelect;
|
|
14
|
+
`;exports.CustomFontSelect=CustomFontSelect;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable */ const MediaSelect = `
|
|
1
|
+
"use strict";const MediaSelect=`
|
|
4
2
|
fragment MediaSelect on Media {
|
|
5
3
|
id
|
|
6
4
|
contentType
|
|
@@ -10,6 +8,4 @@
|
|
|
10
8
|
height
|
|
11
9
|
alt
|
|
12
10
|
}
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports.MediaSelect = MediaSelect;
|
|
11
|
+
`;exports.MediaSelect=MediaSelect;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable */ const PreviewThemePageSelect = `
|
|
1
|
+
"use strict";const PreviewThemePageSelect=`
|
|
4
2
|
fragment PreviewThemePageSelect on PreviewThemePage {
|
|
5
3
|
id
|
|
6
4
|
name
|
|
@@ -33,7 +31,9 @@
|
|
|
33
31
|
id
|
|
34
32
|
value
|
|
35
33
|
}
|
|
34
|
+
metafields {
|
|
35
|
+
key
|
|
36
|
+
value
|
|
37
|
+
}
|
|
36
38
|
}
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
|
-
exports.PreviewThemePageSelect = PreviewThemePageSelect;
|
|
39
|
+
`;exports.PreviewThemePageSelect=PreviewThemePageSelect;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable */ const ProductLittleSelect = `
|
|
1
|
+
"use strict";const ProductLittleSelect=`
|
|
4
2
|
fragment ProductLittleSelect on Product {
|
|
5
3
|
id
|
|
6
4
|
title
|
|
@@ -30,6 +28,4 @@
|
|
|
30
28
|
}
|
|
31
29
|
tags
|
|
32
30
|
}
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
exports.ProductLittleSelect = ProductLittleSelect;
|
|
31
|
+
`;exports.ProductLittleSelect=ProductLittleSelect;
|