@gem-sdk/core 1.38.0 → 2.0.0-dev.832
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 +1 -18
- package/dist/cjs/components/ComponentToolbarPreview.js +1 -465
- package/dist/cjs/components/ComponentWrapper.js +1 -46
- package/dist/cjs/components/ComponentWrapperPreview.js +1 -136
- package/dist/cjs/components/Empty.js +1 -7
- package/dist/cjs/components/Render.js +1 -65
- package/dist/cjs/components/Render.liquid.js +14 -288
- package/dist/cjs/components/RenderBlock.js +1 -54
- package/dist/cjs/components/RenderCustomCode.js +3 -56
- package/dist/cjs/components/RenderPreview.js +1 -66
- package/dist/cjs/components/RenderSection.js +1 -23
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +1 -0
- package/dist/cjs/components/ai-generator/AIGenContentLoading.js +1 -0
- package/dist/cjs/components/ai-generator/components/PickProduct.js +1 -0
- package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +1 -0
- package/dist/cjs/components/ai-generator/hooks/useGettingGenerateRequest.js +1 -0
- package/dist/cjs/components/ai-generator/hooks/useListenEventGenerate.js +1 -0
- package/dist/cjs/components/ai-generator/icons/AIIcon.js +1 -0
- package/dist/cjs/components/ai-generator/icons/CloseIcon.js +1 -0
- package/dist/cjs/components/ai-generator/icons/DropdownIcon.js +1 -0
- package/dist/cjs/components/ai-generator/icons/ShowMoreIcon.js +1 -0
- package/dist/cjs/components/animation/AnimationWrapper.js +1 -0
- package/dist/cjs/components/constant.js +1 -54
- package/dist/cjs/components/resize/Resize.js +1 -16
- package/dist/cjs/components/resize/Spacing.js +1 -248
- package/dist/cjs/components/src/product/helpers/variant-presets.js +1 -56
- package/dist/cjs/components/theme-section/CreateThemeSection.js +1 -117
- package/dist/cjs/components/theme-section/ThemeSectionStatus.js +1 -36
- package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +1 -102
- package/dist/cjs/components/toolbar/Tooltip.js +1 -22
- package/dist/cjs/contexts/AddonContext.js +1 -36
- package/dist/cjs/contexts/BuilderComponent.js +1 -34
- package/dist/cjs/contexts/BuilderContext.js +1 -35
- package/dist/cjs/contexts/BuilderPreviewContext.js +1 -479
- package/dist/cjs/contexts/CartLineContext.js +1 -29
- package/dist/cjs/contexts/CollectionContext.js +1 -38
- package/dist/cjs/contexts/ModalContext.js +1 -47
- package/dist/cjs/contexts/PageContext.js +1 -44
- package/dist/cjs/contexts/ProductContext.js +1 -156
- package/dist/cjs/contexts/ProductListContext.js +1 -32
- package/dist/cjs/contexts/SectionContext.js +1 -53
- package/dist/cjs/contexts/ShopContext.js +1 -80
- 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 +2 -6
- 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/product-little.generated.js +11 -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 +11 -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 +3 -9
- 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 +3 -7
- 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 -14
- 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 +2 -10
- package/dist/cjs/graphql/queries/products.generated.js +12 -17
- package/dist/cjs/graphql/queries/published-theme-pages.generated.js +2 -15
- package/dist/cjs/graphql/queries/store-property.generated.js +2 -6
- package/dist/cjs/graphql-app-api/queries/LibraryTemplate.generated.js +13 -0
- package/dist/cjs/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +34 -0
- package/dist/cjs/graphql-app-api/queries/ThemePage.generated.js +22 -0
- package/dist/cjs/helpers/GlobalEvent.js +1 -19
- package/dist/cjs/helpers/animations.js +1 -213
- package/dist/cjs/helpers/background.js +1 -230
- package/dist/cjs/helpers/borders.js +4 -183
- package/dist/cjs/helpers/carousel.js +1 -58
- 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 -268
- 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-toolbar-preview.js +1 -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/is-browser.js +1 -9
- package/dist/cjs/helpers/is-defined.js +1 -7
- package/dist/cjs/helpers/is-empty-children.js +1 -15
- package/dist/cjs/helpers/is-safari.js +1 -9
- package/dist/cjs/helpers/layout.js +1 -59
- package/dist/cjs/helpers/load-script.js +1 -31
- package/dist/cjs/helpers/make-style.js +1 -163
- package/dist/cjs/helpers/normalize-builder-data.js +1 -23
- 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 -163
- package/dist/cjs/helpers/query.js +1 -29
- package/dist/cjs/helpers/radius.js +6 -140
- package/dist/cjs/helpers/render.js +1 -76
- package/dist/cjs/helpers/shadow.js +1 -57
- package/dist/cjs/helpers/size.js +4 -183
- package/dist/cjs/helpers/spacing.js +1 -43
- 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 +17 -126
- package/dist/cjs/helpers/variant.js +1 -11
- package/dist/cjs/hooks/animation/animations.js +1 -0
- package/dist/cjs/hooks/animation/useAnimationActions.js +1 -39
- package/dist/cjs/hooks/animation/useAnimationConfig.js +1 -29
- package/dist/cjs/hooks/animation/useAnimationPreview.js +1 -31
- package/dist/cjs/hooks/animation/useAnimationTarget.js +1 -120
- package/dist/cjs/hooks/animation/useApplyAnimation.js +1 -87
- package/dist/cjs/hooks/animation/useLivePageAnimation.js +1 -0
- package/dist/cjs/hooks/cart/use-add-to-cart.js +1 -20
- package/dist/cjs/hooks/cart/use-cart-data.js +1 -28
- package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +1 -20
- package/dist/cjs/hooks/cart/use-cart-note-update.js +1 -20
- package/dist/cjs/hooks/cart/use-create-cart.js +1 -22
- package/dist/cjs/hooks/cart/use-remove-cart-item.js +1 -20
- package/dist/cjs/hooks/cart/use-update-cart-item.js +1 -20
- package/dist/cjs/hooks/shop/use-collection-query.js +1 -22
- package/dist/cjs/hooks/shop/use-collections-query.js +1 -17
- package/dist/cjs/hooks/shop/use-product-query.js +1 -22
- package/dist/cjs/hooks/shop/use-products-query.js +1 -23
- package/dist/cjs/hooks/shop.js +1 -126
- package/dist/cjs/hooks/use-current-device.js +1 -21
- package/dist/cjs/hooks/use-lazy-video.js +1 -15
- package/dist/cjs/hooks/useAnimations.js +1 -26
- package/dist/cjs/hooks/useCartId.js +1 -44
- package/dist/cjs/hooks/useCartLine.js +1 -11
- package/dist/cjs/hooks/useCartUI.js +1 -48
- package/dist/cjs/hooks/useCollection.js +1 -9
- package/dist/cjs/hooks/useFetchHandle.js +1 -13
- package/dist/cjs/hooks/useFormatMoney.js +1 -58
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +1 -113
- package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +1 -10
- package/dist/cjs/hooks/useLoadScript.js +1 -32
- package/dist/cjs/hooks/useMoney.js +1 -84
- package/dist/cjs/hooks/usePrevious.js +1 -19
- package/dist/cjs/hooks/useProduct.js +1 -206
- package/dist/cjs/hooks/useProductList.js +1 -21
- package/dist/cjs/hooks/useSuspenseFetch.js +1 -27
- package/dist/cjs/hooks/useSwatchesOptions.js +1 -41
- package/dist/cjs/hooks/useToolbarPostPurchase.js +1 -0
- package/dist/cjs/index.js +1 -361
- package/dist/cjs/types/animations.js +1 -47
- package/dist/cjs/types/appAPI.js +1 -0
- package/dist/cjs/types/global-style.js +1 -15
- package/dist/cjs/types/shop.js +1 -2
- package/dist/cjs/web-components/src/helpers/styles/constant.js +1 -9
- package/dist/esm/components/AddOn.js +1 -14
- package/dist/esm/components/ComponentToolbarPreview.js +1 -463
- package/dist/esm/components/ComponentWrapper.js +1 -42
- package/dist/esm/components/ComponentWrapperPreview.js +1 -132
- package/dist/esm/components/Empty.js +1 -3
- package/dist/esm/components/Render.js +1 -61
- package/dist/esm/components/Render.liquid.js +14 -282
- package/dist/esm/components/RenderBlock.js +1 -50
- package/dist/esm/components/RenderCustomCode.js +3 -52
- package/dist/esm/components/RenderPreview.js +1 -62
- package/dist/esm/components/RenderSection.js +1 -19
- package/dist/esm/components/ai-generator/AIContentGenerator.js +1 -0
- package/dist/esm/components/ai-generator/AIGenContentLoading.js +1 -0
- package/dist/esm/components/ai-generator/components/PickProduct.js +1 -0
- package/dist/esm/components/ai-generator/components/ToneAndVoice.js +1 -0
- package/dist/esm/components/ai-generator/hooks/useGettingGenerateRequest.js +1 -0
- package/dist/esm/components/ai-generator/hooks/useListenEventGenerate.js +1 -0
- package/dist/esm/components/ai-generator/icons/AIIcon.js +1 -0
- package/dist/esm/components/ai-generator/icons/CloseIcon.js +1 -0
- package/dist/esm/components/ai-generator/icons/DropdownIcon.js +1 -0
- package/dist/esm/components/ai-generator/icons/ShowMoreIcon.js +1 -0
- package/dist/esm/components/animation/AnimationWrapper.js +1 -0
- package/dist/esm/components/constant.js +1 -50
- package/dist/esm/components/resize/Resize.js +1 -12
- package/dist/esm/components/resize/Spacing.js +1 -244
- package/dist/esm/components/src/product/helpers/variant-presets.js +1 -54
- package/dist/esm/components/theme-section/CreateThemeSection.js +1 -115
- package/dist/esm/components/theme-section/ThemeSectionStatus.js +1 -34
- package/dist/esm/components/theme-section/ThemeSectionTooltip.js +1 -100
- package/dist/esm/components/toolbar/Tooltip.js +1 -18
- package/dist/esm/contexts/AddonContext.js +1 -32
- package/dist/esm/contexts/BuilderComponent.js +1 -31
- package/dist/esm/contexts/BuilderContext.js +1 -32
- package/dist/esm/contexts/BuilderPreviewContext.js +1 -476
- package/dist/esm/contexts/CartLineContext.js +1 -26
- package/dist/esm/contexts/CollectionContext.js +1 -35
- package/dist/esm/contexts/ModalContext.js +1 -44
- package/dist/esm/contexts/PageContext.js +1 -41
- package/dist/esm/contexts/ProductContext.js +1 -153
- package/dist/esm/contexts/ProductListContext.js +1 -28
- package/dist/esm/contexts/SectionContext.js +1 -49
- package/dist/esm/contexts/ShopContext.js +1 -77
- 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 +2 -4
- 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/product-little.generated.js +11 -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 +11 -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 +3 -6
- 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 +3 -5
- 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 +8 -18
- 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 +4 -10
- package/dist/esm/graphql/queries/products.generated.js +18 -20
- package/dist/esm/graphql/queries/published-theme-pages.generated.js +9 -20
- package/dist/esm/graphql/queries/store-property.generated.js +2 -4
- package/dist/esm/graphql-app-api/queries/LibraryTemplate.generated.js +13 -0
- package/dist/esm/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +34 -0
- package/dist/esm/graphql-app-api/queries/ThemePage.generated.js +22 -0
- package/dist/esm/helpers/GlobalEvent.js +1 -15
- package/dist/esm/helpers/animations.js +1 -211
- package/dist/esm/helpers/background.js +1 -222
- package/dist/esm/helpers/borders.js +4 -175
- package/dist/esm/helpers/carousel.js +1 -54
- 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 -261
- 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-toolbar-preview.js +1 -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/is-browser.js +1 -5
- package/dist/esm/helpers/is-defined.js +1 -5
- package/dist/esm/helpers/is-empty-children.js +1 -10
- package/dist/esm/helpers/is-safari.js +1 -5
- package/dist/esm/helpers/layout.js +1 -54
- package/dist/esm/helpers/load-script.js +1 -29
- package/dist/esm/helpers/make-style.js +1 -149
- package/dist/esm/helpers/normalize-builder-data.js +1 -21
- 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 -161
- package/dist/esm/helpers/query.js +1 -25
- package/dist/esm/helpers/radius.js +6 -132
- package/dist/esm/helpers/render.js +1 -68
- package/dist/esm/helpers/shadow.js +1 -52
- package/dist/esm/helpers/size.js +4 -171
- package/dist/esm/helpers/spacing.js +1 -40
- 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 +17 -116
- package/dist/esm/helpers/variant.js +1 -9
- package/dist/esm/hooks/animation/animations.js +1 -0
- package/dist/esm/hooks/animation/useAnimationActions.js +1 -37
- package/dist/esm/hooks/animation/useAnimationConfig.js +1 -27
- package/dist/esm/hooks/animation/useAnimationPreview.js +1 -29
- package/dist/esm/hooks/animation/useAnimationTarget.js +1 -118
- package/dist/esm/hooks/animation/useApplyAnimation.js +1 -83
- package/dist/esm/hooks/animation/useLivePageAnimation.js +1 -0
- package/dist/esm/hooks/cart/use-add-to-cart.js +1 -18
- package/dist/esm/hooks/cart/use-cart-data.js +1 -26
- package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +1 -18
- package/dist/esm/hooks/cart/use-cart-note-update.js +1 -18
- package/dist/esm/hooks/cart/use-create-cart.js +1 -20
- package/dist/esm/hooks/cart/use-remove-cart-item.js +1 -18
- package/dist/esm/hooks/cart/use-update-cart-item.js +1 -18
- package/dist/esm/hooks/shop/use-collection-query.js +1 -20
- package/dist/esm/hooks/shop/use-collections-query.js +1 -15
- package/dist/esm/hooks/shop/use-product-query.js +1 -20
- package/dist/esm/hooks/shop/use-products-query.js +1 -21
- package/dist/esm/hooks/shop.js +1 -111
- package/dist/esm/hooks/use-current-device.js +1 -19
- package/dist/esm/hooks/use-lazy-video.js +1 -13
- package/dist/esm/hooks/useAnimations.js +1 -24
- package/dist/esm/hooks/useCartId.js +1 -40
- package/dist/esm/hooks/useCartLine.js +1 -7
- package/dist/esm/hooks/useCartUI.js +1 -44
- package/dist/esm/hooks/useCollection.js +1 -7
- package/dist/esm/hooks/useFetchHandle.js +1 -11
- package/dist/esm/hooks/useFormatMoney.js +1 -56
- package/dist/esm/hooks/useInitialSwatchesOptions.js +1 -109
- package/dist/esm/hooks/useIsomorphicLayoutEffect.js +1 -6
- package/dist/esm/hooks/useLoadScript.js +1 -28
- package/dist/esm/hooks/useMoney.js +1 -80
- package/dist/esm/hooks/usePrevious.js +1 -17
- package/dist/esm/hooks/useProduct.js +1 -192
- package/dist/esm/hooks/useProductList.js +1 -16
- package/dist/esm/hooks/useSuspenseFetch.js +1 -23
- package/dist/esm/hooks/useSwatchesOptions.js +1 -37
- package/dist/esm/hooks/useToolbarPostPurchase.js +1 -0
- package/dist/esm/index.js +1 -100
- package/dist/esm/types/animations.js +1 -47
- package/dist/esm/types/appAPI.js +1 -0
- package/dist/esm/types/global-style.js +1 -12
- package/dist/esm/web-components/src/helpers/styles/constant.js +1 -7
- package/dist/types/index.d.ts +24803 -6239
- package/package.json +8 -3
|
@@ -1,92 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const globalSortNameMapping = {
|
|
4
|
-
'typography-heading-1-fontFamily': 'h1-ff',
|
|
5
|
-
'typography-heading-1-fontSize': 'h1-size',
|
|
6
|
-
'typography-heading-1-fontWeight': 'h1-weight',
|
|
7
|
-
'typography-heading-1-lineHeight': 'h1-lh',
|
|
8
|
-
'typography-heading-1-letterSpacing': 'h1-ls',
|
|
9
|
-
'typography-heading-1-fontStyle': 'h1-fs',
|
|
10
|
-
'typography-heading-2-fontFamily': 'h2-ff',
|
|
11
|
-
'typography-heading-2-fontSize': 'h2-size',
|
|
12
|
-
'typography-heading-2-fontWeight': 'h2-weight',
|
|
13
|
-
'typography-heading-2-lineHeight': 'h2-lh',
|
|
14
|
-
'typography-heading-2-letterSpacing': 'h2-ls',
|
|
15
|
-
'typography-heading-2-fontStyle': 'h2-fs',
|
|
16
|
-
'typography-heading-3-fontFamily': 'h3-ff',
|
|
17
|
-
'typography-heading-3-fontSize': 'h3-size',
|
|
18
|
-
'typography-heading-3-fontWeight': 'h3-weight',
|
|
19
|
-
'typography-heading-3-lineHeight': 'h3-lh',
|
|
20
|
-
'typography-heading-3-letterSpacing': 'h3-ls',
|
|
21
|
-
'typography-heading-3-fontStyle': 'h3-fs',
|
|
22
|
-
'typography-subheading-1-fontFamily': 'sh1-ff',
|
|
23
|
-
'typography-subheading-1-fontSize': 'sh1-size',
|
|
24
|
-
'typography-subheading-1-fontWeight': 'sh1-weight',
|
|
25
|
-
'typography-subheading-1-lineHeight': 'sh1-lh',
|
|
26
|
-
'typography-subheading-1-letterSpacing': 'sh1-ls',
|
|
27
|
-
'typography-subheading-1-fontStyle': 'sh1-fs',
|
|
28
|
-
'typography-subheading-2-fontFamily': 'sh2-ff',
|
|
29
|
-
'typography-subheading-2-fontSize': 'sh2-size',
|
|
30
|
-
'typography-subheading-2-fontWeight': 'sh2-weight',
|
|
31
|
-
'typography-subheading-2-lineHeight': 'sh2-lh',
|
|
32
|
-
'typography-subheading-2-letterSpacing': 'sh2-ls',
|
|
33
|
-
'typography-subheading-2-fontStyle': 'sh2-fs',
|
|
34
|
-
'typography-subheading-3-fontFamily': 'sh3-ff',
|
|
35
|
-
'typography-subheading-3-fontSize': 'sh3-size',
|
|
36
|
-
'typography-subheading-3-fontWeight': 'sh3-weight',
|
|
37
|
-
'typography-subheading-3-lineHeight': 'sh3-lh',
|
|
38
|
-
'typography-subheading-3-letterSpacing': 'sh3-ls',
|
|
39
|
-
'typography-subheading-3-fontStyle': 'sh3-fs',
|
|
40
|
-
'typography-paragraph-1-fontFamily': 'p1-ff',
|
|
41
|
-
'typography-paragraph-1-fontSize': 'p1-size',
|
|
42
|
-
'typography-paragraph-1-fontWeight': 'p1-weight',
|
|
43
|
-
'typography-paragraph-1-lineHeight': 'p1-lh',
|
|
44
|
-
'typography-paragraph-1-letterSpacing': 'p1-ls',
|
|
45
|
-
'typography-paragraph-1-fontStyle': 'p1-fs',
|
|
46
|
-
'typography-paragraph-2-fontFamily': 'p2-ff',
|
|
47
|
-
'typography-paragraph-2-fontSize': 'p2-size',
|
|
48
|
-
'typography-paragraph-2-fontWeight': 'p2-weight',
|
|
49
|
-
'typography-paragraph-2-lineHeight': 'p2-lh',
|
|
50
|
-
'typography-paragraph-2-letterSpacing': 'p2-ls',
|
|
51
|
-
'typography-paragraph-2-fontStyle': 'p2-fs',
|
|
52
|
-
'typography-paragraph-3-fontFamily': 'p3-ff',
|
|
53
|
-
'typography-paragraph-3-fontSize': 'p3-size',
|
|
54
|
-
'typography-paragraph-3-fontWeight': 'p3-weight',
|
|
55
|
-
'typography-paragraph-3-lineHeight': 'p3-lh',
|
|
56
|
-
'typography-paragraph-3-letterSpacing': 'p3-ls',
|
|
57
|
-
'typography-paragraph-3-fontStyle': 'p3-fs',
|
|
58
|
-
'color-brand': 'c-brand',
|
|
59
|
-
'color-highlight': 'c-highlight',
|
|
60
|
-
'color-text-1': 'c-text-1',
|
|
61
|
-
'color-text-2': 'c-text-2',
|
|
62
|
-
'color-text-3': 'c-text-3',
|
|
63
|
-
'color-bg-1': 'c-bg-1',
|
|
64
|
-
'color-bg-2': 'c-bg-2',
|
|
65
|
-
'color-bg-3': 'c-bg-3',
|
|
66
|
-
'color-line-1': 'c-line-1',
|
|
67
|
-
'color-line-2': 'c-line-2',
|
|
68
|
-
'color-line-3': 'c-line-3',
|
|
69
|
-
'color-success': 'c-success',
|
|
70
|
-
'color-info': 'c-info',
|
|
71
|
-
'color-warning': 'c-warning',
|
|
72
|
-
'color-error': 'c-error',
|
|
73
|
-
'spacing-xxs': 's-xxs',
|
|
74
|
-
'spacing-xs': 's-xs',
|
|
75
|
-
'spacing-s': 's-s',
|
|
76
|
-
'spacing-m': 's-m',
|
|
77
|
-
'spacing-l': 's-l',
|
|
78
|
-
'spacing-xl': 's-xl',
|
|
79
|
-
'spacing-2xl': 's-2xl',
|
|
80
|
-
'spacing-3xl': 's-3xl',
|
|
81
|
-
'spacing-4xl': 's-4xl',
|
|
82
|
-
'spacing-5xl': 's-5xl',
|
|
83
|
-
'container-width': 'ct-w',
|
|
84
|
-
'container-padding': 'ct-p',
|
|
85
|
-
'text-shadow': 'ts',
|
|
86
|
-
'box-shadow': 'shadow'
|
|
87
|
-
};
|
|
88
|
-
function getShortName(name) {
|
|
89
|
-
return globalSortNameMapping[name] || name;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
exports.getShortName = getShortName;
|
|
1
|
+
"use strict";const globalSortNameMapping={"typography-heading-1-fontFamily":"h1-ff","typography-heading-1-fontSize":"h1-size","typography-heading-1-fontWeight":"h1-weight","typography-heading-1-lineHeight":"h1-lh","typography-heading-1-letterSpacing":"h1-ls","typography-heading-1-fontStyle":"h1-fs","typography-heading-2-fontFamily":"h2-ff","typography-heading-2-fontSize":"h2-size","typography-heading-2-fontWeight":"h2-weight","typography-heading-2-lineHeight":"h2-lh","typography-heading-2-letterSpacing":"h2-ls","typography-heading-2-fontStyle":"h2-fs","typography-heading-3-fontFamily":"h3-ff","typography-heading-3-fontSize":"h3-size","typography-heading-3-fontWeight":"h3-weight","typography-heading-3-lineHeight":"h3-lh","typography-heading-3-letterSpacing":"h3-ls","typography-heading-3-fontStyle":"h3-fs","typography-subheading-1-fontFamily":"sh1-ff","typography-subheading-1-fontSize":"sh1-size","typography-subheading-1-fontWeight":"sh1-weight","typography-subheading-1-lineHeight":"sh1-lh","typography-subheading-1-letterSpacing":"sh1-ls","typography-subheading-1-fontStyle":"sh1-fs","typography-subheading-2-fontFamily":"sh2-ff","typography-subheading-2-fontSize":"sh2-size","typography-subheading-2-fontWeight":"sh2-weight","typography-subheading-2-lineHeight":"sh2-lh","typography-subheading-2-letterSpacing":"sh2-ls","typography-subheading-2-fontStyle":"sh2-fs","typography-subheading-3-fontFamily":"sh3-ff","typography-subheading-3-fontSize":"sh3-size","typography-subheading-3-fontWeight":"sh3-weight","typography-subheading-3-lineHeight":"sh3-lh","typography-subheading-3-letterSpacing":"sh3-ls","typography-subheading-3-fontStyle":"sh3-fs","typography-paragraph-1-fontFamily":"p1-ff","typography-paragraph-1-fontSize":"p1-size","typography-paragraph-1-fontWeight":"p1-weight","typography-paragraph-1-lineHeight":"p1-lh","typography-paragraph-1-letterSpacing":"p1-ls","typography-paragraph-1-fontStyle":"p1-fs","typography-paragraph-2-fontFamily":"p2-ff","typography-paragraph-2-fontSize":"p2-size","typography-paragraph-2-fontWeight":"p2-weight","typography-paragraph-2-lineHeight":"p2-lh","typography-paragraph-2-letterSpacing":"p2-ls","typography-paragraph-2-fontStyle":"p2-fs","typography-paragraph-3-fontFamily":"p3-ff","typography-paragraph-3-fontSize":"p3-size","typography-paragraph-3-fontWeight":"p3-weight","typography-paragraph-3-lineHeight":"p3-lh","typography-paragraph-3-letterSpacing":"p3-ls","typography-paragraph-3-fontStyle":"p3-fs","color-brand":"c-brand","color-highlight":"c-highlight","color-text-1":"c-text-1","color-text-2":"c-text-2","color-text-3":"c-text-3","color-bg-1":"c-bg-1","color-bg-2":"c-bg-2","color-bg-3":"c-bg-3","color-line-1":"c-line-1","color-line-2":"c-line-2","color-line-3":"c-line-3","color-success":"c-success","color-info":"c-info","color-warning":"c-warning","color-error":"c-error","spacing-xxs":"s-xxs","spacing-xs":"s-xs","spacing-s":"s-s","spacing-m":"s-m","spacing-l":"s-l","spacing-xl":"s-xl","spacing-2xl":"s-2xl","spacing-3xl":"s-3xl","spacing-4xl":"s-4xl","spacing-5xl":"s-5xl","container-width":"ct-w","container-padding":"ct-p","text-shadow":"ts","box-shadow":"shadow"};function getShortName(h){return globalSortNameMapping[h]||h}exports.getShortName=getShortName;
|
|
@@ -1,61 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var constant = require('../web-components/src/helpers/styles/constant.js');
|
|
4
|
-
|
|
5
|
-
const TEXT_TOTAL_SPACING = 3; //Padding 2, margin 1
|
|
6
|
-
const composePostionIconList = (lineHeight, position, iconWidth)=>{
|
|
7
|
-
const compose = {};
|
|
8
|
-
composePositionLineHeight({
|
|
9
|
-
compose,
|
|
10
|
-
lineHeight,
|
|
11
|
-
device: 'desktop',
|
|
12
|
-
position,
|
|
13
|
-
iconWidth
|
|
14
|
-
});
|
|
15
|
-
composePositionLineHeight({
|
|
16
|
-
compose,
|
|
17
|
-
lineHeight,
|
|
18
|
-
device: 'tablet',
|
|
19
|
-
position,
|
|
20
|
-
iconWidth
|
|
21
|
-
});
|
|
22
|
-
composePositionLineHeight({
|
|
23
|
-
compose,
|
|
24
|
-
lineHeight,
|
|
25
|
-
device: 'mobile',
|
|
26
|
-
position,
|
|
27
|
-
iconWidth
|
|
28
|
-
});
|
|
29
|
-
return compose;
|
|
30
|
-
};
|
|
31
|
-
const composePositionLineHeight = ({ compose, lineHeight, device, position, iconWidth })=>{
|
|
32
|
-
const positionDevice = position?.[device];
|
|
33
|
-
const iconWidthDevice = iconWidth?.[device];
|
|
34
|
-
if (positionDevice) {
|
|
35
|
-
const suffix = constant.devicesMapping[device] ?? '';
|
|
36
|
-
if (positionDevice === 'center') {
|
|
37
|
-
compose.wrapper = {
|
|
38
|
-
...compose.wrapper,
|
|
39
|
-
[`--ai${suffix}`]: 'center'
|
|
40
|
-
};
|
|
41
|
-
compose.content = {
|
|
42
|
-
...compose.content,
|
|
43
|
-
[`--pos${suffix}`]: 'static'
|
|
44
|
-
};
|
|
45
|
-
} else if (iconWidthDevice) {
|
|
46
|
-
const computedTop = parseFloat(lineHeight.replaceAll(/[a-zA-Z]/g, '')) / 2 + TEXT_TOTAL_SPACING - iconWidthDevice / 2;
|
|
47
|
-
compose.wrapper = {
|
|
48
|
-
...compose.wrapper,
|
|
49
|
-
[`--ai${suffix}`]: 'flex-start'
|
|
50
|
-
};
|
|
51
|
-
compose.content = {
|
|
52
|
-
...compose.content,
|
|
53
|
-
[`--top${suffix}`]: `${Math.max(0, Math.ceil(computedTop))}px`,
|
|
54
|
-
[`--pos${suffix}`]: 'relative'
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
exports.composePositionLineHeight = composePositionLineHeight;
|
|
61
|
-
exports.composePostionIconList = composePostionIconList;
|
|
1
|
+
"use strict";var constant=require("../web-components/src/helpers/styles/constant.js");const TEXT_TOTAL_SPACING=3,composePostionIconList=(e,t,o)=>{let i={};return composePositionLineHeight({compose:i,lineHeight:e,device:"desktop",position:t,iconWidth:o}),composePositionLineHeight({compose:i,lineHeight:e,device:"tablet",position:t,iconWidth:o}),composePositionLineHeight({compose:i,lineHeight:e,device:"mobile",position:t,iconWidth:o}),i},composePositionLineHeight=({compose:e,lineHeight:t,device:o,position:i,iconWidth:s})=>{let n=i?.[o],c=s?.[o];if(n){let i=constant.devicesMapping[o]??"";if("center"===n)e.wrapper={...e.wrapper,[`--ai${i}`]:"center"},e.content={...e.content,[`--pos${i}`]:"static"};else if(c){let o=parseFloat(t.replaceAll(/[a-zA-Z]/g,""))/2+3-c/2;e.wrapper={...e.wrapper,[`--ai${i}`]:"flex-start"},e.content={...e.content,[`--top${i}`]:`${Math.max(0,Math.ceil(o))}px`,[`--pos${i}`]:"relative"}}}};exports.composePositionLineHeight=composePositionLineHeight,exports.composePostionIconList=composePostionIconList;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
function isBrowser() {
|
|
6
|
-
return typeof window !== 'undefined';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
exports.default = isBrowser;
|
|
1
|
+
"use strict";function isBrowser(){return"undefined"!=typeof window}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=isBrowser;
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var react = require('react');
|
|
6
|
-
var ComponentToolbarPreview = require('../components/ComponentToolbarPreview.js');
|
|
7
|
-
|
|
8
|
-
const isEmptyChildren = (children)=>{
|
|
9
|
-
let arrChild = react.Children.toArray(children);
|
|
10
|
-
arrChild = arrChild.filter((child)=>child?.type != ComponentToolbarPreview.ComponentToolbarPreview);
|
|
11
|
-
return react.Children.count(arrChild) < 1 || !children;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
exports.default = isEmptyChildren;
|
|
15
|
-
exports.isEmptyChildren = isEmptyChildren;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var react=require("react"),ComponentToolbarPreview=require("../components/ComponentToolbarPreview.js");const isEmptyChildren=e=>{let r=react.Children.toArray(e);return r=r.filter(e=>e?.type!=ComponentToolbarPreview.default),1>react.Children.count(r)||!e};exports.default=isEmptyChildren,exports.isEmptyChildren=isEmptyChildren;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
function isSafari() {
|
|
6
|
-
return navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
exports.default = isSafari;
|
|
1
|
+
"use strict";function isSafari(){return -1!=navigator.userAgent.indexOf("Safari")&&-1==navigator.userAgent.indexOf("Chrome")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=isSafari;
|
|
@@ -1,59 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var constant = require('./constant.js');
|
|
4
|
-
var getResonsiveValue = require('./get-resonsive-value.js');
|
|
5
|
-
|
|
6
|
-
const gridToArrayRegex = // eslint-disable-next-line regexp/no-super-linear-backtracking
|
|
7
|
-
/[^\s()]+(?:\([^\s()]+(?:\([^()]+\))?(?:, *[^\s()]+(?:\([^()]+\))?)*\))?/g; // Regex convert css grid to array
|
|
8
|
-
const optionLayoutStyle = (column)=>{
|
|
9
|
-
if (!column) return {};
|
|
10
|
-
const style = {};
|
|
11
|
-
for (const [key, value] of Object.entries(column)){
|
|
12
|
-
Object.assign(style, {
|
|
13
|
-
[`--gtc${constant.devicesMapping?.[key]}`]: `repeat(${parseFloat(value + '') || 1}, minmax(0, 1fr))`
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return style;
|
|
17
|
-
};
|
|
18
|
-
const composeGridLayout = (layout)=>{
|
|
19
|
-
const display = getResonsiveValue.getResponsiveValue(layout, 'display');
|
|
20
|
-
const desktop = (getResonsiveValue.getResponsiveValueByScreen(display, 'desktop') === 'fit' ? layout?.desktop?.cols?.map(()=>`minmax(0, auto)`) : layout?.desktop?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
|
|
21
|
-
const tablet = (getResonsiveValue.getResponsiveValueByScreen(display, 'tablet') === 'fit' ? layout?.tablet?.cols?.map(()=>`minmax(0, auto)`) : layout?.tablet?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
|
|
22
|
-
const mobile = (getResonsiveValue.getResponsiveValueByScreen(display, 'mobile') === 'fit' ? layout?.mobile?.cols?.map(()=>`minmax(0, auto)`) : layout?.mobile?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
|
|
23
|
-
return {
|
|
24
|
-
[`--gtc`]: desktop,
|
|
25
|
-
[`--gtc-tablet`]: tablet,
|
|
26
|
-
[`--gtc-mobile`]: mobile
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
const gridToArray = (layout)=>{
|
|
30
|
-
return layout ? layout.match(gridToArrayRegex) ?? [] : [];
|
|
31
|
-
};
|
|
32
|
-
const convertOldLayout = (layout)=>{
|
|
33
|
-
const desktopCol = gridToArray(layout?.desktop).length;
|
|
34
|
-
const tabletCol = gridToArray(layout?.tablet).length;
|
|
35
|
-
const mobileCol = gridToArray(layout?.mobile).length;
|
|
36
|
-
return {
|
|
37
|
-
desktop: {
|
|
38
|
-
cols: desktopCol ? Array.from({
|
|
39
|
-
length: desktopCol
|
|
40
|
-
}, ()=>12 / desktopCol) : undefined,
|
|
41
|
-
display: 'fill'
|
|
42
|
-
},
|
|
43
|
-
tablet: {
|
|
44
|
-
cols: tabletCol ? Array.from({
|
|
45
|
-
length: tabletCol
|
|
46
|
-
}, ()=>12 / tabletCol) : undefined
|
|
47
|
-
},
|
|
48
|
-
mobile: {
|
|
49
|
-
cols: mobileCol ? Array.from({
|
|
50
|
-
length: mobileCol
|
|
51
|
-
}, ()=>12 / mobileCol) : undefined
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
exports.composeGridLayout = composeGridLayout;
|
|
57
|
-
exports.convertOldLayout = convertOldLayout;
|
|
58
|
-
exports.gridToArrayRegex = gridToArrayRegex;
|
|
59
|
-
exports.optionLayoutStyle = optionLayoutStyle;
|
|
1
|
+
"use strict";var constant=require("./constant.js"),getResonsiveValue=require("./get-resonsive-value.js");const gridToArrayRegex=/[^\s()]+(?:\([^\s()]+(?:\([^()]+\))?(?:, *[^\s()]+(?:\([^()]+\))?)*\))?/g,optionLayoutStyle=e=>{if(!e)return{};let t={};for(let[o,r]of Object.entries(e))Object.assign(t,{[`--gtc${constant.devicesMapping?.[o]}`]:`repeat(${parseFloat(r+"")||1}, minmax(0, 1fr))`});return t},composeGridLayout=e=>{let t=getResonsiveValue.getResponsiveValue(e,"display"),o=("fit"===getResonsiveValue.getResponsiveValueByScreen(t,"desktop")?e?.desktop?.cols?.map(()=>"minmax(0, auto)"):e?.desktop?.cols?.map(e=>`minmax(0, ${e}fr)`))?.join(" "),r=("fit"===getResonsiveValue.getResponsiveValueByScreen(t,"tablet")?e?.tablet?.cols?.map(()=>"minmax(0, auto)"):e?.tablet?.cols?.map(e=>`minmax(0, ${e}fr)`))?.join(" "),a=("fit"===getResonsiveValue.getResponsiveValueByScreen(t,"mobile")?e?.mobile?.cols?.map(()=>"minmax(0, auto)"):e?.mobile?.cols?.map(e=>`minmax(0, ${e}fr)`))?.join(" ");return{"--gtc":o,"--gtc-tablet":r,"--gtc-mobile":a}},gridToArray=e=>e?e.match(gridToArrayRegex)??[]:[],convertOldLayout=e=>{let t=gridToArray(e?.desktop).length,o=gridToArray(e?.tablet).length,r=gridToArray(e?.mobile).length;return{desktop:{cols:t?Array.from({length:t},()=>12/t):void 0,display:"fill"},tablet:{cols:o?Array.from({length:o},()=>12/o):void 0},mobile:{cols:r?Array.from({length:r},()=>12/r):void 0}}};exports.composeGridLayout=composeGridLayout,exports.convertOldLayout=convertOldLayout,exports.gridToArrayRegex=gridToArrayRegex,exports.optionLayoutStyle=optionLayoutStyle;
|
|
@@ -1,31 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const SCRIPTS_LOADED = {};
|
|
4
|
-
function loadScript(src, options) {
|
|
5
|
-
const isScriptLoaded = SCRIPTS_LOADED[src];
|
|
6
|
-
if (isScriptLoaded) {
|
|
7
|
-
return isScriptLoaded;
|
|
8
|
-
}
|
|
9
|
-
const promise = new Promise((resolve, reject)=>{
|
|
10
|
-
const script = document.createElement('script');
|
|
11
|
-
if (options?.module) {
|
|
12
|
-
script.type = 'module';
|
|
13
|
-
}
|
|
14
|
-
script.src = src;
|
|
15
|
-
script.onload = ()=>{
|
|
16
|
-
resolve(true);
|
|
17
|
-
};
|
|
18
|
-
script.onerror = ()=>{
|
|
19
|
-
reject(false);
|
|
20
|
-
};
|
|
21
|
-
if (options?.in === 'head') {
|
|
22
|
-
document.head.appendChild(script);
|
|
23
|
-
} else {
|
|
24
|
-
document.body.appendChild(script);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
SCRIPTS_LOADED[src] = promise;
|
|
28
|
-
return promise;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
exports.loadScript = loadScript;
|
|
1
|
+
"use strict";const SCRIPTS_LOADED={};function loadScript(e,t){let o=SCRIPTS_LOADED[e];if(o)return o;let d=new Promise((o,d)=>{let r=document.createElement("script");t?.module&&(r.type="module"),r.src=e,r.onload=()=>{o(!0)},r.onerror=()=>{d(!1)},t?.in==="head"?document.head.appendChild(r):document.body.appendChild(r)});return SCRIPTS_LOADED[e]=d,d}exports.loadScript=loadScript;
|
|
@@ -1,163 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var getResonsiveValue = require('./get-resonsive-value.js');
|
|
4
|
-
|
|
5
|
-
const removeNullUndefined = (obj)=>Object.entries(obj).reduce((a, [k, v])=>{
|
|
6
|
-
if (v === null || v === undefined) return a;
|
|
7
|
-
return {
|
|
8
|
-
...a,
|
|
9
|
-
[k]: v
|
|
10
|
-
};
|
|
11
|
-
}, {});
|
|
12
|
-
const makeStyleKey = (name)=>{
|
|
13
|
-
return [
|
|
14
|
-
name,
|
|
15
|
-
`hvr-${name}`,
|
|
16
|
-
`focus-${name}`,
|
|
17
|
-
`${name}-tablet`,
|
|
18
|
-
`hvr-${name}-tablet`,
|
|
19
|
-
`focus-${name}-tablet`,
|
|
20
|
-
`${name}-mobile`,
|
|
21
|
-
`hvr-${name}-mobile`,
|
|
22
|
-
`focus-${name}-mobile`
|
|
23
|
-
].map((key)=>`--${key}`);
|
|
24
|
-
};
|
|
25
|
-
const makeStyle = (style)=>{
|
|
26
|
-
return removeNullUndefined(Object.fromEntries(Object.entries(style).map(([key, value])=>[
|
|
27
|
-
`--${key}`,
|
|
28
|
-
value
|
|
29
|
-
])));
|
|
30
|
-
};
|
|
31
|
-
const makeStyleState = (name, value)=>{
|
|
32
|
-
if (!value) return {};
|
|
33
|
-
return {
|
|
34
|
-
[`--${name}`]: value?.normal,
|
|
35
|
-
[`--hvr-${name}`]: value?.hover,
|
|
36
|
-
[`--focus-${name}`]: value?.focus
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
const makeStyleResponsiveState = (name, value)=>{
|
|
40
|
-
if (!value) return {};
|
|
41
|
-
return {
|
|
42
|
-
[`--${name}`]: value?.desktop?.normal,
|
|
43
|
-
[`--hvr-${name}`]: value?.desktop?.hover,
|
|
44
|
-
[`--focus-${name}`]: value?.desktop?.focus,
|
|
45
|
-
[`--${name}-tablet`]: value?.tablet?.normal,
|
|
46
|
-
[`--hvr-${name}-tablet`]: value?.tablet?.hover,
|
|
47
|
-
[`--focus-${name}-tablet`]: value?.tablet?.focus,
|
|
48
|
-
[`--${name}-mobile`]: value?.mobile?.normal,
|
|
49
|
-
[`--hvr-${name}-mobile`]: value?.mobile?.hover,
|
|
50
|
-
[`--focus-${name}-mobile`]: value?.mobile?.focus
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
const makeStyleResponsive = (name, value, unit)=>{
|
|
54
|
-
return {
|
|
55
|
-
[`--${name}`]: unit ? `${value?.desktop}${unit}` : value?.desktop,
|
|
56
|
-
[`--${name}-tablet`]: unit ? `${value?.tablet}${unit}` : value?.tablet,
|
|
57
|
-
[`--${name}-mobile`]: unit ? `${value?.mobile}${unit}` : value?.mobile
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
const makeStyleResponsiveByScreen = (name, value, unit)=>{
|
|
61
|
-
return {
|
|
62
|
-
[`--${name}`]: unit ? `${getResonsiveValue.getResponsiveValueByScreen(value, 'desktop')}${unit}` : getResonsiveValue.getResponsiveValueByScreen(value, 'desktop'),
|
|
63
|
-
[`--${name}-tablet`]: unit ? `${getResonsiveValue.getResponsiveValueByScreen(value, 'tablet')}${unit}` : getResonsiveValue.getResponsiveValueByScreen(value, 'tablet'),
|
|
64
|
-
[`--${name}-mobile`]: unit ? `${getResonsiveValue.getResponsiveValueByScreen(value, 'mobile')}${unit}` : getResonsiveValue.getResponsiveValueByScreen(value, 'mobile')
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
const makeWidth = (widthValue, fullWidthValue)=>{
|
|
68
|
-
const getVal = (deviceValue, widthValue, fullWidthValue)=>{
|
|
69
|
-
const widthVal = getResonsiveValue.getResponsiveValueByScreen(widthValue, deviceValue);
|
|
70
|
-
const fullWidthVal = fullWidthValue?.[deviceValue] === undefined ? fullWidthValue?.['desktop'] : fullWidthValue?.[deviceValue];
|
|
71
|
-
if (fullWidthVal) {
|
|
72
|
-
return '100%';
|
|
73
|
-
} else if (fullWidthVal === false) {
|
|
74
|
-
return widthVal ?? widthVal;
|
|
75
|
-
} else {
|
|
76
|
-
return widthVal || 'auto';
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
return {
|
|
80
|
-
desktop: getVal('desktop', widthValue, fullWidthValue),
|
|
81
|
-
tablet: getVal('tablet', widthValue, fullWidthValue),
|
|
82
|
-
mobile: getVal('mobile', widthValue, fullWidthValue)
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
const makeGlobalSizeWidthResponsive = (globalSize)=>{
|
|
86
|
-
return {
|
|
87
|
-
'--w': globalSize?.desktop?.width,
|
|
88
|
-
'--w-tablet': globalSize?.tablet?.width,
|
|
89
|
-
'--w-mobile': globalSize?.mobile?.width
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
const makeGlobalSizeHeightResponsive = (globalSize)=>{
|
|
93
|
-
return {
|
|
94
|
-
'--h': globalSize?.desktop?.height,
|
|
95
|
-
'--h-tablet': globalSize?.tablet?.height,
|
|
96
|
-
'--h-mobile': globalSize?.mobile?.height
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
const makeHeight = (heighValue, autoHeight)=>{
|
|
100
|
-
const getVal = (deviceValue, heighValue, autoHeight)=>{
|
|
101
|
-
const heightVal = heighValue?.[deviceValue];
|
|
102
|
-
const isAuto = autoHeight?.[deviceValue];
|
|
103
|
-
if (isAuto) {
|
|
104
|
-
return 'auto';
|
|
105
|
-
} else if (isAuto === false) {
|
|
106
|
-
return heightVal ?? heightVal;
|
|
107
|
-
} else {
|
|
108
|
-
return heightVal;
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
return {
|
|
112
|
-
desktop: getVal('desktop', heighValue, autoHeight),
|
|
113
|
-
tablet: getVal('tablet', heighValue, autoHeight),
|
|
114
|
-
mobile: getVal('mobile', heighValue, autoHeight)
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
const makeAspectRatio = (aspectRatio, aspectWidth, aspectHeight)=>{
|
|
118
|
-
let result = {};
|
|
119
|
-
const DEVICES = [
|
|
120
|
-
'desktop',
|
|
121
|
-
'mobile',
|
|
122
|
-
'tablet'
|
|
123
|
-
];
|
|
124
|
-
DEVICES.forEach((device)=>{
|
|
125
|
-
const aspectRatioDevice = getResonsiveValue.getResponsiveValueByScreen(aspectRatio, device);
|
|
126
|
-
if (aspectRatioDevice !== 'none') {
|
|
127
|
-
result = {
|
|
128
|
-
...result,
|
|
129
|
-
[device]: aspectRatioDevice !== 'custom' ? aspectRatioDevice : `${getResonsiveValue.getResponsiveValueByScreen(aspectWidth, 'desktop')}/${getResonsiveValue.getResponsiveValueByScreen(aspectHeight, 'desktop')}`
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
return result;
|
|
134
|
-
};
|
|
135
|
-
const makeLineClamp = (lineClampValue, hasLineClampValue)=>{
|
|
136
|
-
const getVal = (deviceValue, lineClampValue, hasLineClampValue)=>{
|
|
137
|
-
const lineClamp = lineClampValue?.[deviceValue];
|
|
138
|
-
const hasLineClamp = hasLineClampValue?.[deviceValue] || hasLineClampValue?.['desktop'];
|
|
139
|
-
if (hasLineClamp || hasLineClamp === undefined) {
|
|
140
|
-
return lineClamp;
|
|
141
|
-
}
|
|
142
|
-
return 'unset';
|
|
143
|
-
};
|
|
144
|
-
return {
|
|
145
|
-
desktop: getVal('desktop', lineClampValue, hasLineClampValue),
|
|
146
|
-
tablet: getVal('tablet', lineClampValue, hasLineClampValue),
|
|
147
|
-
mobile: getVal('mobile', lineClampValue, hasLineClampValue)
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
exports.makeAspectRatio = makeAspectRatio;
|
|
152
|
-
exports.makeGlobalSizeHeightResponsive = makeGlobalSizeHeightResponsive;
|
|
153
|
-
exports.makeGlobalSizeWidthResponsive = makeGlobalSizeWidthResponsive;
|
|
154
|
-
exports.makeHeight = makeHeight;
|
|
155
|
-
exports.makeLineClamp = makeLineClamp;
|
|
156
|
-
exports.makeStyle = makeStyle;
|
|
157
|
-
exports.makeStyleKey = makeStyleKey;
|
|
158
|
-
exports.makeStyleResponsive = makeStyleResponsive;
|
|
159
|
-
exports.makeStyleResponsiveByScreen = makeStyleResponsiveByScreen;
|
|
160
|
-
exports.makeStyleResponsiveState = makeStyleResponsiveState;
|
|
161
|
-
exports.makeStyleState = makeStyleState;
|
|
162
|
-
exports.makeWidth = makeWidth;
|
|
163
|
-
exports.removeNullUndefined = removeNullUndefined;
|
|
1
|
+
"use strict";var getResonsiveValue=require("./get-resonsive-value.js");const removeNullUndefined=e=>Object.entries(e).reduce((e,[t,o])=>null==o?e:{...e,[t]:o},{}),makeStyleKey=e=>[e,`hvr-${e}`,`focus-${e}`,`${e}-tablet`,`hvr-${e}-tablet`,`focus-${e}-tablet`,`${e}-mobile`,`hvr-${e}-mobile`,`focus-${e}-mobile`].map(e=>`--${e}`),makeStyle=e=>removeNullUndefined(Object.fromEntries(Object.entries(e).map(([e,t])=>[`--${e}`,t]))),makeStyleState=(e,t)=>t?{[`--${e}`]:t?.normal,[`--hvr-${e}`]:t?.hover,[`--focus-${e}`]:t?.focus}:{},makeStyleResponsiveState=(e,t)=>t?{[`--${e}`]:t?.desktop?.normal,[`--hvr-${e}`]:t?.desktop?.hover,[`--focus-${e}`]:t?.desktop?.focus,[`--${e}-tablet`]:t?.tablet?.normal,[`--hvr-${e}-tablet`]:t?.tablet?.hover,[`--focus-${e}-tablet`]:t?.tablet?.focus,[`--${e}-mobile`]:t?.mobile?.normal,[`--hvr-${e}-mobile`]:t?.mobile?.hover,[`--focus-${e}-mobile`]:t?.mobile?.focus}:{},makeStyleResponsive=(e,t,o)=>({[`--${e}`]:o?`${t?.desktop}${o}`:t?.desktop,[`--${e}-tablet`]:o?`${t?.tablet}${o}`:t?.tablet,[`--${e}-mobile`]:o?`${t?.mobile}${o}`:t?.mobile}),makeStyleResponsiveByScreen=(e,t,o)=>({[`--${e}`]:o?`${getResonsiveValue.getResponsiveValueByScreen(t,"desktop")}${o}`:getResonsiveValue.getResponsiveValueByScreen(t,"desktop"),[`--${e}-tablet`]:o?`${getResonsiveValue.getResponsiveValueByScreen(t,"tablet")}${o}`:getResonsiveValue.getResponsiveValueByScreen(t,"tablet"),[`--${e}-mobile`]:o?`${getResonsiveValue.getResponsiveValueByScreen(t,"mobile")}${o}`:getResonsiveValue.getResponsiveValueByScreen(t,"mobile")}),makeWidth=(e,t)=>{let o=(e,t,o)=>{let s=getResonsiveValue.getResponsiveValueByScreen(t,e),l=o?.[e]===void 0?o?.desktop:o?.[e];return l?"100%":!1===l?s??s:s||"auto"};return{desktop:o("desktop",e,t),tablet:o("tablet",e,t),mobile:o("mobile",e,t)}},makeGlobalSizeWidthResponsive=e=>({"--w":e?.desktop?.width,"--w-tablet":e?.tablet?.width,"--w-mobile":e?.mobile?.width}),makeGlobalSizeHeightResponsive=e=>({"--h":e?.desktop?.height,"--h-tablet":e?.tablet?.height,"--h-mobile":e?.mobile?.height}),makeHeight=(e,t)=>{let o=(e,t,o)=>{let s=t?.[e],l=o?.[e];return l?"auto":!1===l?s??s:s};return{desktop:o("desktop",e,t),tablet:o("tablet",e,t),mobile:o("mobile",e,t)}},makeAspectRatio=(e,t,o)=>{let s={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let a=getResonsiveValue.getResponsiveValueByScreen(e,l);"none"!==a&&(s={...s,[l]:"custom"!==a?a:`${getResonsiveValue.getResponsiveValueByScreen(t,"desktop")}/${getResonsiveValue.getResponsiveValueByScreen(o,"desktop")}`})}),s},makeLineClamp=(e,t)=>{let o=(e,t,o)=>{let s=t?.[e],l=o?.[e]||o?.desktop;return l||void 0===l?s:"unset"};return{desktop:o("desktop",e,t),tablet:o("tablet",e,t),mobile:o("mobile",e,t)}};exports.makeAspectRatio=makeAspectRatio,exports.makeGlobalSizeHeightResponsive=makeGlobalSizeHeightResponsive,exports.makeGlobalSizeWidthResponsive=makeGlobalSizeWidthResponsive,exports.makeHeight=makeHeight,exports.makeLineClamp=makeLineClamp,exports.makeStyle=makeStyle,exports.makeStyleKey=makeStyleKey,exports.makeStyleResponsive=makeStyleResponsive,exports.makeStyleResponsiveByScreen=makeStyleResponsiveByScreen,exports.makeStyleResponsiveState=makeStyleResponsiveState,exports.makeStyleState=makeStyleState,exports.makeWidth=makeWidth,exports.removeNullUndefined=removeNullUndefined;
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function normalizeBuilderData(data) {
|
|
4
|
-
const result = {};
|
|
5
|
-
function compose(data, res = {}) {
|
|
6
|
-
const childrens = data.childrens;
|
|
7
|
-
const items = childrens?.map((child)=>child.uid) ?? [];
|
|
8
|
-
res[data.uid] = {
|
|
9
|
-
...data,
|
|
10
|
-
childrens: items,
|
|
11
|
-
type: 'component'
|
|
12
|
-
};
|
|
13
|
-
if (childrens) {
|
|
14
|
-
childrens.map((child)=>compose(child, res));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
compose(data, result);
|
|
18
|
-
return {
|
|
19
|
-
...result
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
exports.normalizeBuilderData = normalizeBuilderData;
|
|
1
|
+
"use strict";function normalizeBuilderData(e){let i={};return!function e(i,t={}){let n=i.childrens,r=n?.map(e=>e.uid)??[];t[i.uid]={...i,childrens:r,type:"component"},n&&n.map(i=>e(i,t))}(e,i),{...i}}exports.normalizeBuilderData=normalizeBuilderData;
|
|
@@ -1,78 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var useSWR = require('swr');
|
|
4
|
-
var getCollection = require('./queries/get-collection.js');
|
|
5
|
-
var getProduct = require('./queries/get-product.js');
|
|
6
|
-
var getProducts = require('./queries/get-products.js');
|
|
7
|
-
var query = require('./query.js');
|
|
8
|
-
|
|
9
|
-
const prefetchQueries = (input, options)=>{
|
|
10
|
-
const queries = [];
|
|
11
|
-
Object.keys(input).forEach((key)=>{
|
|
12
|
-
const item = input[key];
|
|
13
|
-
let data = undefined;
|
|
14
|
-
switch(item.tag){
|
|
15
|
-
case 'Product':
|
|
16
|
-
{
|
|
17
|
-
if (item.settings?.isAuto) break;
|
|
18
|
-
const variables = {
|
|
19
|
-
id: item.settings?.productSetting?.productId ?? 'latest',
|
|
20
|
-
isSample: options?.isSample,
|
|
21
|
-
isStorefront: options?.isStorefront
|
|
22
|
-
};
|
|
23
|
-
data = {
|
|
24
|
-
key: useSWR.unstable_serialize(query.generateProductQueryKey(variables)),
|
|
25
|
-
func: getProduct.getProduct,
|
|
26
|
-
variables
|
|
27
|
-
};
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
case 'ProductList':
|
|
31
|
-
{
|
|
32
|
-
const productSetting = item.settings?.productSetting;
|
|
33
|
-
if (productSetting?.productSrc === 'Collection') {
|
|
34
|
-
const variables = {
|
|
35
|
-
id: productSetting?.collectionId ?? 'latest',
|
|
36
|
-
numberOfProducts: item.settings?.numberOfProducts ?? 4,
|
|
37
|
-
orderBy: item.settings?.orderBy,
|
|
38
|
-
isSample: options?.isSample,
|
|
39
|
-
isStorefront: options?.isStorefront
|
|
40
|
-
};
|
|
41
|
-
data = {
|
|
42
|
-
key: useSWR.unstable_serialize(query.generateCollectionQueryKey(variables)),
|
|
43
|
-
func: getCollection.getCollection,
|
|
44
|
-
variables
|
|
45
|
-
};
|
|
46
|
-
} else {
|
|
47
|
-
const variables = {
|
|
48
|
-
ids: [
|
|
49
|
-
...productSetting?.productIds ?? []
|
|
50
|
-
].sort(),
|
|
51
|
-
isSample: options?.isSample,
|
|
52
|
-
isStorefront: options?.isStorefront
|
|
53
|
-
};
|
|
54
|
-
data = {
|
|
55
|
-
key: useSWR.unstable_serialize(query.generateProductsQueryKey(variables)),
|
|
56
|
-
func: getProducts.getProducts,
|
|
57
|
-
variables
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (data) {
|
|
64
|
-
queries.push(data);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
return queries.reduce((accumulator, current)=>{
|
|
68
|
-
if (!accumulator.some((x)=>x.key === current.key)) {
|
|
69
|
-
return [
|
|
70
|
-
...accumulator,
|
|
71
|
-
current
|
|
72
|
-
];
|
|
73
|
-
}
|
|
74
|
-
return accumulator;
|
|
75
|
-
}, []);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
exports.prefetchQueries = prefetchQueries;
|
|
1
|
+
"use strict";var useSWR=require("swr"),getCollection=require("./queries/get-collection.js"),getProduct=require("./queries/get-product.js"),getProducts=require("./queries/get-products.js"),query=require("./query.js");const prefetchQueries=(e,t)=>{let r=[];return Object.keys(e).forEach(s=>{let u;let o=e[s];switch(o.tag){case"Product":{if(o.settings?.isAuto)break;let e={id:o.settings?.productSetting?.productId??"latest",isSample:t?.isSample,isStorefront:t?.isStorefront};u={key:useSWR.unstable_serialize(query.generateProductQueryKey(e)),func:getProduct.getProduct,variables:e};break}case"ProductList":{let e=o.settings?.productSetting;if(e?.productSrc==="Collection"){let r={id:e?.collectionId??"latest",numberOfProducts:o.settings?.numberOfProducts??4,orderBy:o.settings?.orderBy,isSample:t?.isSample,isStorefront:t?.isStorefront};u={key:useSWR.unstable_serialize(query.generateCollectionQueryKey(r)),func:getCollection.getCollection,variables:r}}else{let r={ids:[...e?.productIds??[]].sort(),isSample:t?.isSample,isStorefront:t?.isStorefront};u={key:useSWR.unstable_serialize(query.generateProductsQueryKey(r)),func:getProducts.getProducts,variables:r}}}}u&&r.push(u)}),r.reduce((e,t)=>e.some(e=>e.key===t.key)?e:[...e,t],[])};exports.prefetchQueries=prefetchQueries;
|
|
@@ -1,48 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var variant = require('./variant.js');
|
|
4
|
-
|
|
5
|
-
function getSelectedVariant(variants, choices, variantId) {
|
|
6
|
-
/**
|
|
7
|
-
* Ensure the user has selected all the required options, not just some.
|
|
8
|
-
*/ if (!variants || !variants.length || !choices || variants[0]?.selectedOptions.length !== Object.keys(choices).length) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
if (variantId) {
|
|
12
|
-
return variants.find((variant)=>variant?.id === variantId);
|
|
13
|
-
}
|
|
14
|
-
return variants.find((variant)=>{
|
|
15
|
-
return Object.entries(choices).every(([name, value])=>{
|
|
16
|
-
return variant?.selectedOptions.some((option)=>option.name === name && option.value === value);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function parseSelectedOption(options) {
|
|
21
|
-
if (!options || options && options.length === 0) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
return options.reduce((acc, { name, value })=>{
|
|
25
|
-
if (name && value) {
|
|
26
|
-
return {
|
|
27
|
-
...acc,
|
|
28
|
-
[name]: value
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
return acc;
|
|
32
|
-
}, {});
|
|
33
|
-
}
|
|
34
|
-
function checkAvailableVariantInStock(variants, optionId, optionValue) {
|
|
35
|
-
return variants ? variants.some((item)=>{
|
|
36
|
-
if (item) {
|
|
37
|
-
const { selectedOptions } = item;
|
|
38
|
-
const opt = selectedOptions?.some((option)=>option?.name === optionId && option.value === optionValue);
|
|
39
|
-
const isInStock = variant.checkInStock(item);
|
|
40
|
-
return opt && isInStock;
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}) : false;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
exports.checkAvailableVariantInStock = checkAvailableVariantInStock;
|
|
47
|
-
exports.getSelectedVariant = getSelectedVariant;
|
|
48
|
-
exports.parseSelectedOption = parseSelectedOption;
|
|
1
|
+
"use strict";var variant=require("./variant.js");function getSelectedVariant(e,t,n){return e&&e.length&&t&&e[0]?.selectedOptions.length===Object.keys(t).length?n?e.find(e=>e?.id===n):e.find(e=>Object.entries(t).every(([t,n])=>e?.selectedOptions.some(e=>e.name===t&&e.value===n))):void 0}function parseSelectedOption(e){if(e&&(!e||0!==e.length))return e.reduce((e,{name:t,value:n})=>t&&n?{...e,[t]:n}:e,{})}function checkAvailableVariantInStock(e,t,n){return!!e&&e.some(e=>{if(e){let{selectedOptions:a}=e,r=a?.some(e=>e?.name===t&&e.value===n),i=variant.checkInStock(e);return r&&i}return!1})}exports.checkAvailableVariantInStock=checkAvailableVariantInStock,exports.getSelectedVariant=getSelectedVariant,exports.parseSelectedOption=parseSelectedOption;
|