@ubnt/store.core 9.17.0-alpha.5 → 9.18.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/lib/apis/smartcat.js +1 -4
- package/lib/apis/smartcat.js.map +1 -1
- package/lib/apis/smartcat.mjs +1 -4
- package/lib/apis/smartcat.mjs.map +1 -1
- package/lib/assets/attention.svg +5 -5
- package/lib/assets/attention2.svg +5 -5
- package/lib/assets/close2.svg +2 -3
- package/lib/assets/close3.svg +3 -2
- package/lib/components/CategoryTabs/CategoryTabs.types.d.ts +1 -1
- package/lib/components/CloserLookSection/CloserLookSection.js.map +1 -1
- package/lib/components/CloserLookSection/CloserLookSection.mjs.map +1 -1
- package/lib/components/CustomImage/CustomImage.js.map +1 -1
- package/lib/components/CustomImage/CustomImage.mjs.map +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.js +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.js.map +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs.map +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.js +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.mjs +2 -2
- package/lib/components/Footer/hooks/useFooterContent.d.ts +3 -1
- package/lib/components/Footer/hooks/useFooterContent.js +8 -1
- package/lib/components/Footer/hooks/useFooterContent.js.map +1 -1
- package/lib/components/Footer/hooks/useFooterContent.mjs +8 -1
- package/lib/components/Footer/hooks/useFooterContent.mjs.map +1 -1
- package/lib/components/Footer/translations/ar.json.js +1 -1
- package/lib/components/Footer/translations/ar.json.mjs +1 -1
- package/lib/components/Footer/translations/de.json.js +1 -1
- package/lib/components/Footer/translations/de.json.mjs +1 -1
- package/lib/components/Footer/translations/el.json.js +1 -1
- package/lib/components/Footer/translations/el.json.mjs +1 -1
- package/lib/components/Footer/translations/en.json.js +1 -0
- package/lib/components/Footer/translations/en.json.js.map +1 -1
- package/lib/components/Footer/translations/en.json.mjs +1 -0
- package/lib/components/Footer/translations/en.json.mjs.map +1 -1
- package/lib/components/Footer/translations/es.json.js +1 -1
- package/lib/components/Footer/translations/es.json.mjs +1 -1
- package/lib/components/Footer/translations/fr.json.js +4 -4
- package/lib/components/Footer/translations/fr.json.mjs +4 -4
- package/lib/components/Footer/translations/it.json.js +1 -1
- package/lib/components/Footer/translations/it.json.mjs +1 -1
- package/lib/components/Footer/translations/ja.json.js +2 -2
- package/lib/components/Footer/translations/ja.json.mjs +2 -2
- package/lib/components/Footer/translations/pt-BR.json.js +1 -1
- package/lib/components/Footer/translations/pt-BR.json.mjs +1 -1
- package/lib/components/Footer/translations/zh-Hans.json.js +4 -4
- package/lib/components/Footer/translations/zh-Hans.json.mjs +4 -4
- package/lib/components/Footer/translations/zh-Hant-TW.json.js +1 -1
- package/lib/components/Footer/translations/zh-Hant-TW.json.mjs +1 -1
- package/lib/components/GridGallery/GridGallery.js.map +1 -1
- package/lib/components/GridGallery/GridGallery.mjs.map +1 -1
- package/lib/components/Header/AccountMenu/AccountMenu.js +22 -20
- package/lib/components/Header/AccountMenu/AccountMenu.js.map +1 -1
- package/lib/components/Header/AccountMenu/AccountMenu.mjs +22 -20
- package/lib/components/Header/AccountMenu/AccountMenu.mjs.map +1 -1
- package/lib/components/Header/AccountMenu/megaphone.http.service.js +1 -4
- package/lib/components/Header/AccountMenu/megaphone.http.service.js.map +1 -1
- package/lib/components/Header/AccountMenu/megaphone.http.service.mjs +1 -4
- package/lib/components/Header/AccountMenu/megaphone.http.service.mjs.map +1 -1
- package/lib/components/Header/CartModalV2/CartModal.js.map +1 -1
- package/lib/components/Header/CartModalV2/CartModal.mjs.map +1 -1
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mjs.map +1 -1
- package/lib/components/Header/Header.types.d.ts +6 -2
- package/lib/components/Header/Header.types.js.map +1 -1
- package/lib/components/Header/Header.types.mjs.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.js.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.mjs.map +1 -1
- package/lib/components/Header/LanguageFrame/Mobile/Mobile.js.map +1 -1
- package/lib/components/Header/LanguageFrame/Mobile/Mobile.mjs.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.js +2 -2
- package/lib/components/Header/MenuItem/MenuItem.styles.js.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs +2 -2
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.types.d.ts +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.d.ts +1 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.js +24 -30
- package/lib/components/Header/Navigation/ProMenu/ProMenu.js.map +1 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs +26 -32
- package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.d.ts +6 -7
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js +8 -41
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs +9 -41
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.types.d.ts +0 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.d.ts +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js +67 -92
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs +68 -93
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.d.ts +3 -0
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js +4 -0
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs +5 -2
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.types.d.ts +7 -6
- package/lib/components/Header/Overlay/Overlay.js.map +1 -1
- package/lib/components/Header/Overlay/Overlay.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.d.ts +2 -1
- package/lib/components/Header/ProHeader/ProHeader.js +132 -119
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +134 -121
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.d.ts +5 -2
- package/lib/components/Header/ProHeader/ProHeader.styles.js +8 -2
- package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs +8 -2
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
- package/lib/components/Header/translations/ar.json.js +4 -1
- package/lib/components/Header/translations/ar.json.js.map +1 -1
- package/lib/components/Header/translations/ar.json.mjs +4 -2
- package/lib/components/Header/translations/ar.json.mjs.map +1 -1
- package/lib/components/Header/translations/de.json.js +4 -1
- package/lib/components/Header/translations/de.json.js.map +1 -1
- package/lib/components/Header/translations/de.json.mjs +4 -2
- package/lib/components/Header/translations/de.json.mjs.map +1 -1
- package/lib/components/Header/translations/el.json.js +4 -1
- package/lib/components/Header/translations/el.json.js.map +1 -1
- package/lib/components/Header/translations/el.json.mjs +4 -2
- package/lib/components/Header/translations/el.json.mjs.map +1 -1
- package/lib/components/Header/translations/es.json.js +4 -1
- package/lib/components/Header/translations/es.json.js.map +1 -1
- package/lib/components/Header/translations/es.json.mjs +4 -2
- package/lib/components/Header/translations/es.json.mjs.map +1 -1
- package/lib/components/Header/translations/fr.json.js +4 -1
- package/lib/components/Header/translations/fr.json.js.map +1 -1
- package/lib/components/Header/translations/fr.json.mjs +4 -2
- package/lib/components/Header/translations/fr.json.mjs.map +1 -1
- package/lib/components/Header/translations/it.json.js +4 -1
- package/lib/components/Header/translations/it.json.js.map +1 -1
- package/lib/components/Header/translations/it.json.mjs +4 -2
- package/lib/components/Header/translations/it.json.mjs.map +1 -1
- package/lib/components/Header/translations/ja.json.js +4 -1
- package/lib/components/Header/translations/ja.json.js.map +1 -1
- package/lib/components/Header/translations/ja.json.mjs +4 -2
- package/lib/components/Header/translations/ja.json.mjs.map +1 -1
- package/lib/components/Header/translations/pt-BR.json.js +4 -1
- package/lib/components/Header/translations/pt-BR.json.js.map +1 -1
- package/lib/components/Header/translations/pt-BR.json.mjs +4 -2
- package/lib/components/Header/translations/pt-BR.json.mjs.map +1 -1
- package/lib/components/Header/translations/zh-Hans.json.js +4 -1
- package/lib/components/Header/translations/zh-Hans.json.js.map +1 -1
- package/lib/components/Header/translations/zh-Hans.json.mjs +4 -2
- package/lib/components/Header/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.js +4 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.mjs +4 -2
- package/lib/components/Header/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/components/ImageSequence/ImageSequence.js.map +1 -1
- package/lib/components/ImageSequence/ImageSequence.mjs.map +1 -1
- package/lib/components/LandingPage/Cards/Card/Card.js.map +1 -1
- package/lib/components/LandingPage/Cards/Card/Card.mjs.map +1 -1
- package/lib/components/LandingPage/Cards/Cards.js.map +1 -1
- package/lib/components/LandingPage/Cards/Cards.mjs.map +1 -1
- package/lib/components/MicrositeIntroductionBlock/MicrositeIntroductionBlock.js.map +1 -1
- package/lib/components/MicrositeIntroductionBlock/MicrositeIntroductionBlock.mjs.map +1 -1
- package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.js.map +1 -1
- package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.mjs.map +1 -1
- package/lib/components/MicrositeProductGrid/MicrositeProductGrid.js.map +1 -1
- package/lib/components/MicrositeProductGrid/MicrositeProductGrid.mjs.map +1 -1
- package/lib/components/Microsites/MicrositeProductPage.js +39 -0
- package/lib/components/Microsites/MicrositeProductPage.js.map +1 -1
- package/lib/components/Microsites/MicrositeProductPage.mjs +39 -0
- package/lib/components/Microsites/MicrositeProductPage.mjs.map +1 -1
- package/lib/components/ModelCompareV3/StickyGrid/StickyGridHeader.js.map +1 -1
- package/lib/components/ModelCompareV3/StickyGrid/StickyGridHeader.mjs.map +1 -1
- package/lib/components/ProductCompare/ProductCompare.js.map +1 -1
- package/lib/components/ProductCompare/ProductCompare.mjs.map +1 -1
- package/lib/components/QuantityControls/QuantityControls.js.map +1 -1
- package/lib/components/QuantityControls/QuantityControls.mjs.map +1 -1
- package/lib/components/RelatedProducts/RelatedProducts.js.map +1 -1
- package/lib/components/RelatedProducts/RelatedProducts.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
- package/lib/components/ReverseLoopingVideo/ReverseLoopingVideo.js.map +1 -1
- package/lib/components/ReverseLoopingVideo/ReverseLoopingVideo.mjs.map +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.js.map +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.mjs.map +1 -1
- package/lib/components/StorageSliders/Slider/Slider.js.map +1 -1
- package/lib/components/StorageSliders/Slider/Slider.mjs.map +1 -1
- package/lib/components/StorageSliders/StorageSliders.context.js.map +1 -1
- package/lib/components/StorageSliders/StorageSliders.context.mjs.map +1 -1
- package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.js.map +1 -1
- package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.mjs.map +1 -1
- package/lib/components/VariantSelector/Variant/Variant.js.map +1 -1
- package/lib/components/VariantSelector/Variant/Variant.mjs.map +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.js +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
- package/lib/constants/icons/options/colors/black.svg.js +5 -5
- package/lib/constants/icons/options/colors/index.js +3 -3
- package/lib/constants/icons/options/styles/black.svg.js +5 -5
- package/lib/constants/icons/options/styles/index.js +3 -3
- package/lib/constants/optionIcons.js +6 -6
- package/lib/constants/optionIcons.mjs +4 -4
- package/lib/constants/theme.js +4 -0
- package/lib/constants/theme.js.map +1 -1
- package/lib/constants/theme.mjs +4 -0
- package/lib/constants/theme.mjs.map +1 -1
- package/lib/constants/url.d.ts +2 -1
- package/lib/constants/url.js +1 -0
- package/lib/constants/url.js.map +1 -1
- package/lib/constants/url.mjs +1 -0
- package/lib/constants/url.mjs.map +1 -1
- package/lib/contexts/MenuContext/utils.js +1 -0
- package/lib/contexts/MenuContext/utils.js.map +1 -1
- package/lib/contexts/MenuContext/utils.mjs +1 -0
- package/lib/contexts/MenuContext/utils.mjs.map +1 -1
- package/lib/helpers/product.js.map +1 -1
- package/lib/helpers/product.mjs.map +1 -1
- package/lib/helpers/ux.js.map +1 -1
- package/lib/helpers/ux.mjs.map +1 -1
- package/lib/hooks/useHasTouch.js.map +1 -1
- package/lib/hooks/useHasTouch.mjs.map +1 -1
- package/lib/hooks/useHorizontalScroll.js.map +1 -1
- package/lib/hooks/useHorizontalScroll.mjs.map +1 -1
- package/lib/utils/money/allocators/fixedAmount.js +1 -4
- package/lib/utils/money/allocators/fixedAmount.js.map +1 -1
- package/lib/utils/money/allocators/fixedAmount.mjs +1 -4
- package/lib/utils/money/allocators/fixedAmount.mjs.map +1 -1
- package/lib/utils/money/allocators/productAmount.js +15 -27
- package/lib/utils/money/allocators/productAmount.js.map +1 -1
- package/lib/utils/money/allocators/productAmount.mjs +15 -27
- package/lib/utils/money/allocators/productAmount.mjs.map +1 -1
- package/lib/utils/productSort.js +1 -0
- package/lib/utils/productSort.js.map +1 -1
- package/lib/utils/productSort.mjs +1 -0
- package/lib/utils/productSort.mjs.map +1 -1
- package/lib/utils/validations/postalCodeSuperRefinement.js +3 -0
- package/lib/utils/validations/postalCodeSuperRefinement.js.map +1 -1
- package/lib/utils/validations/postalCodeSuperRefinement.mjs +3 -0
- package/lib/utils/validations/postalCodeSuperRefinement.mjs.map +1 -1
- package/lib/utils/validations/stateRegistrationNumberSuperRefinement.js +2 -0
- package/lib/utils/validations/stateRegistrationNumberSuperRefinement.js.map +1 -1
- package/lib/utils/validations/stateRegistrationNumberSuperRefinement.mjs +2 -0
- package/lib/utils/validations/stateRegistrationNumberSuperRefinement.mjs.map +1 -1
- package/lib/utils/validations/taxIdSuperRefinement.js +2 -0
- package/lib/utils/validations/taxIdSuperRefinement.js.map +1 -1
- package/lib/utils/validations/taxIdSuperRefinement.mjs +2 -0
- package/lib/utils/validations/taxIdSuperRefinement.mjs.map +1 -1
- package/lib/utils/variant.js.map +1 -1
- package/lib/utils/variant.mjs.map +1 -1
- package/lib/utils/wattage.js.map +1 -1
- package/lib/utils/wattage.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { LineLoader } from '@ubnt/ui-components/LineLoader';
|
|
3
3
|
import merge from 'lodash/merge';
|
|
4
4
|
import { memo, useRef, useState, useMemo, useEffect, useCallback } from 'react';
|
|
5
|
-
import { useMedia, useHoverDirty, useClickAway } from 'react-use';
|
|
5
|
+
import { useMedia, useHoverDirty, useEffectOnce, useClickAway } from 'react-use';
|
|
6
6
|
import '../../../assets/account/no-user-avatar.png.mjs';
|
|
7
7
|
import '../../../assets/icons/menu/icon-ea.svg.mjs';
|
|
8
8
|
import '../../../assets/icons/menu/icon-history.svg.mjs';
|
|
@@ -13,6 +13,7 @@ import { SiteId } from '../../../contexts/MenuContext/mapping.mjs';
|
|
|
13
13
|
import { ModalId } from '../../../contexts/MenuContext/types.mjs';
|
|
14
14
|
import { getTrueSize } from '../../../helpers/ux.mjs';
|
|
15
15
|
import '../../../hooks/index.mjs';
|
|
16
|
+
import { useHasTouch } from '../../../hooks/useHasTouch.mjs';
|
|
16
17
|
import '../../../types/index.mjs';
|
|
17
18
|
import { imageSrc } from '../../../utils/asset.mjs';
|
|
18
19
|
import { checkUnreachable } from '../../../utils/errors.mjs';
|
|
@@ -59,7 +60,9 @@ import { AccountFrame } from '../AccountFrame/AccountFrame.mjs';
|
|
|
59
60
|
import { NavigationProMobileMenu } from '../Navigation/ProMobileMenu/ProMobileMenu.mjs';
|
|
60
61
|
import { NavigationProMenu } from '../Navigation/ProMenu/ProMenu.mjs';
|
|
61
62
|
"use strict";
|
|
62
|
-
const
|
|
63
|
+
const MOBILE_BREAKPOINT_UP = BREAKPOINTS.TABLET_UP;
|
|
64
|
+
const MOBILE_BREAKPOINT_AND_DOWN = BREAKPOINTS.TABLET_AND_DOWN;
|
|
65
|
+
const DEFAULT_PRODUCT_LINE_OPTIONS = [{
|
|
63
66
|
value: ProductLine.Unifi,
|
|
64
67
|
label: "UniFi"
|
|
65
68
|
}, {
|
|
@@ -85,16 +88,17 @@ const ProHeader = memo(function ProHeader2({
|
|
|
85
88
|
handleProductLineChange,
|
|
86
89
|
handleMobileMenuClick,
|
|
87
90
|
productLineValue,
|
|
88
|
-
|
|
91
|
+
categories,
|
|
92
|
+
useInlineCategories,
|
|
89
93
|
embedConfig,
|
|
90
94
|
onSearchFocus,
|
|
91
95
|
onSearchBlur,
|
|
92
96
|
onSearchClick,
|
|
93
|
-
productLineOptions =
|
|
97
|
+
productLineOptions = DEFAULT_PRODUCT_LINE_OPTIONS,
|
|
94
98
|
accountMenu,
|
|
95
99
|
onLanguageChange
|
|
96
100
|
}) {
|
|
97
|
-
const isMobile = useMedia(
|
|
101
|
+
const isMobile = useMedia(MOBILE_BREAKPOINT_AND_DOWN, false);
|
|
98
102
|
const rootRef = useRef(null);
|
|
99
103
|
const wrapRef = useRef(null);
|
|
100
104
|
const containerRef = useRef(null);
|
|
@@ -162,7 +166,6 @@ const ProHeader = memo(function ProHeader2({
|
|
|
162
166
|
);
|
|
163
167
|
}, [activeModal]);
|
|
164
168
|
const [showTouchProMenu, setShowTouchProMenu] = useState(false);
|
|
165
|
-
const hasProMenu = !!inlineCategoryTabs;
|
|
166
169
|
const logoRef = useRef(null);
|
|
167
170
|
const logoHover = useHoverDirty(logoRef);
|
|
168
171
|
const showProMenu = useMemo(() => {
|
|
@@ -174,6 +177,11 @@ const ProHeader = memo(function ProHeader2({
|
|
|
174
177
|
onSearchClick?.();
|
|
175
178
|
}
|
|
176
179
|
}, [activeModal, onSearchClick, setActiveModal]);
|
|
180
|
+
useEffectOnce(() => {
|
|
181
|
+
if (searchValue) {
|
|
182
|
+
setActiveModal(ModalId.Search);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
177
185
|
const blurSearchInput = useCallback(() => {
|
|
178
186
|
if (!searchInputRef || activeModal !== ModalId.Search) {
|
|
179
187
|
return;
|
|
@@ -208,7 +216,7 @@ const ProHeader = memo(function ProHeader2({
|
|
|
208
216
|
}
|
|
209
217
|
}, [handleModalOpen, onSearchClick, searchInputRef]);
|
|
210
218
|
useEffect(() => {
|
|
211
|
-
if (!
|
|
219
|
+
if (!useInlineCategories || activeModal !== ModalId.Search) return;
|
|
212
220
|
if (desktopSearchInputRef) {
|
|
213
221
|
const interval = setInterval(() => {
|
|
214
222
|
if (document.activeElement === desktopSearchInputRef) {
|
|
@@ -217,7 +225,7 @@ const ProHeader = memo(function ProHeader2({
|
|
|
217
225
|
desktopSearchInputRef.focus();
|
|
218
226
|
}, 0);
|
|
219
227
|
}
|
|
220
|
-
}, [activeModal, desktopSearchInputRef,
|
|
228
|
+
}, [activeModal, desktopSearchInputRef, useInlineCategories]);
|
|
221
229
|
const handleSearchValueChange = useCallback(e => {
|
|
222
230
|
onSearch?.(e.target.value);
|
|
223
231
|
}, [onSearch]);
|
|
@@ -258,22 +266,23 @@ const ProHeader = memo(function ProHeader2({
|
|
|
258
266
|
const cartQuantity = useMemo(() => {
|
|
259
267
|
return cart?.items.reduce((sum, item) => sum + item.quantity, 0) ?? 0;
|
|
260
268
|
}, [cart?.items]);
|
|
269
|
+
const hasTouch = useHasTouch();
|
|
261
270
|
const logoSiteUrl = useMemo(() => {
|
|
262
|
-
if (
|
|
271
|
+
if (useInlineCategories) {
|
|
263
272
|
return createSiteUrl([SiteId.Store, "/"]);
|
|
264
273
|
}
|
|
265
274
|
return createSiteUrl([SiteId.Ui, "/"]);
|
|
266
|
-
}, [createSiteUrl,
|
|
267
|
-
const
|
|
275
|
+
}, [createSiteUrl, useInlineCategories]);
|
|
276
|
+
const onLogoAnchorClick = useCallback(e => {
|
|
268
277
|
if (embedConfig?.homeLinkClickHandler) {
|
|
269
278
|
e.preventDefault();
|
|
270
279
|
embedConfig.homeLinkClickHandler();
|
|
271
280
|
}
|
|
272
|
-
if (
|
|
281
|
+
if (useInlineCategories && !showProMenu && !hasTouch) {
|
|
273
282
|
e.preventDefault();
|
|
274
283
|
setShowTouchProMenu(true);
|
|
275
284
|
}
|
|
276
|
-
}, [embedConfig,
|
|
285
|
+
}, [embedConfig, useInlineCategories, hasTouch, showProMenu]);
|
|
277
286
|
useEffect(() => {
|
|
278
287
|
const containerEl = containerRef.current;
|
|
279
288
|
if (!containerEl) return;
|
|
@@ -331,26 +340,26 @@ const ProHeader = memo(function ProHeader2({
|
|
|
331
340
|
width: 17,
|
|
332
341
|
height: 20
|
|
333
342
|
});
|
|
334
|
-
if (!
|
|
343
|
+
if (!useInlineCategories) {
|
|
335
344
|
return defaultIcon;
|
|
336
345
|
}
|
|
337
346
|
switch (productLineValue) {
|
|
338
347
|
case ProductLine.Unifi:
|
|
339
348
|
return /* @__PURE__ */jsx(StyleableSvgImage, {
|
|
340
349
|
src: _externalAssets_BH7iT_0Q__default,
|
|
341
|
-
width:
|
|
342
|
-
height:
|
|
350
|
+
width: 58.5,
|
|
351
|
+
height: 18
|
|
343
352
|
});
|
|
344
353
|
case ProductLine.Uisp:
|
|
345
354
|
return /* @__PURE__ */jsx(StyleableSvgImage, {
|
|
346
355
|
src: _externalAssets_TKrekyEi__default,
|
|
347
|
-
width:
|
|
348
|
-
height:
|
|
356
|
+
width: 56.5,
|
|
357
|
+
height: 18
|
|
349
358
|
});
|
|
350
359
|
default:
|
|
351
360
|
return defaultIcon;
|
|
352
361
|
}
|
|
353
|
-
}, [
|
|
362
|
+
}, [productLineValue, useInlineCategories]);
|
|
354
363
|
return /* @__PURE__ */jsxs(ProHeaderWrap, {
|
|
355
364
|
ref: rootRef,
|
|
356
365
|
$sticky: !!embedConfig,
|
|
@@ -368,30 +377,33 @@ const ProHeader = memo(function ProHeader2({
|
|
|
368
377
|
ref: containerRef,
|
|
369
378
|
children: [/* @__PURE__ */jsxs(Wrap, {
|
|
370
379
|
ref: wrapRef,
|
|
371
|
-
children: [/* @__PURE__ */
|
|
380
|
+
children: [/* @__PURE__ */jsx(LeftWrap, {
|
|
372
381
|
$addSpaceOnDesktop: !!embedConfig?.fullWidthHeader,
|
|
373
|
-
children:
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
children: embedConfig
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
382
|
+
children: activeModal !== ModalId.ProMobileMenu && /* @__PURE__ */jsxs(Fragment, {
|
|
383
|
+
children: [!embedConfig?.hideLogo && /* @__PURE__ */jsx(Anchor, {
|
|
384
|
+
href: logoSiteUrl,
|
|
385
|
+
onClick: onLogoAnchorClick,
|
|
386
|
+
children: embedConfig?.siteTitle ? /* @__PURE__ */jsx(SiteTitleWrap, {
|
|
387
|
+
children: embedConfig.siteTitle
|
|
388
|
+
}) : /* @__PURE__ */jsx(LogoIconWrap, {
|
|
389
|
+
motif,
|
|
390
|
+
ref: logoRef,
|
|
391
|
+
children: logoIconHtml
|
|
392
|
+
})
|
|
393
|
+
}), embedConfig?.moveAvatarIconToLeft && avatarHtml, !useInlineCategories && /* @__PURE__ */jsx(BreakpointsWrap, {
|
|
394
|
+
hideBreakpoint: MOBILE_BREAKPOINT_AND_DOWN,
|
|
395
|
+
children: currentCountryName && /* @__PURE__ */jsx(CountryButton, {
|
|
396
|
+
"data-test-id": "country-select-btn",
|
|
397
|
+
type: "button",
|
|
398
|
+
onClick: handleStorePickerClick,
|
|
399
|
+
children: currentCountryName
|
|
400
|
+
})
|
|
401
|
+
})]
|
|
402
|
+
})
|
|
392
403
|
}), /* @__PURE__ */jsxs(CenterWrap, {
|
|
393
|
-
hideBreakpoint:
|
|
394
|
-
|
|
404
|
+
hideBreakpoint: MOBILE_BREAKPOINT_AND_DOWN,
|
|
405
|
+
justifyRight: useInlineCategories && (activeModal === ModalId.Search || !!searchValue),
|
|
406
|
+
children: [!useInlineCategories || activeModal === ModalId.Search ? /* @__PURE__ */jsx(Search, {
|
|
395
407
|
setInputRef: setDesktopSearchInputRef,
|
|
396
408
|
onValueChange: handleSearchValueChange,
|
|
397
409
|
placeholder: searchPlaceholder,
|
|
@@ -411,25 +423,25 @@ const ProHeader = memo(function ProHeader2({
|
|
|
411
423
|
fillType: "gradient",
|
|
412
424
|
gradientSize: WRAP_GAP * 4,
|
|
413
425
|
gap: CATEGORY_ITEMS_GAP,
|
|
414
|
-
activeIndex:
|
|
415
|
-
items:
|
|
426
|
+
activeIndex: categories.activeIndex,
|
|
427
|
+
items: categories.items.map((category, i) => ({
|
|
416
428
|
id: category.id,
|
|
417
429
|
render() {
|
|
418
|
-
const active =
|
|
419
|
-
|
|
430
|
+
const active = categories.activeIndex === i;
|
|
431
|
+
return /* @__PURE__ */jsx(MenuItem, {
|
|
420
432
|
"data-test-id": `inline-category${active ? "-selected" : ""}`,
|
|
421
433
|
as: "a",
|
|
434
|
+
href: category.url ?? "#",
|
|
422
435
|
active,
|
|
423
436
|
motif,
|
|
424
437
|
children: /* @__PURE__ */jsx(MenuItemLabel, {
|
|
425
438
|
children: category.label
|
|
426
439
|
})
|
|
427
440
|
}, category.id);
|
|
428
|
-
return inlineCategoryTabs.renderLink?.(item, category.href) ?? item;
|
|
429
441
|
}
|
|
430
442
|
})) ?? []
|
|
431
443
|
})
|
|
432
|
-
}), !
|
|
444
|
+
}), !useInlineCategories && /* @__PURE__ */jsx(ProductLineSelectorWrap, {
|
|
433
445
|
children: productLineOptions.map(option => /* @__PURE__ */jsx(ProductLineSelectorItem, {
|
|
434
446
|
onClick: () => handleProductLineChange?.(option.value),
|
|
435
447
|
$active: option.value === productLineValue,
|
|
@@ -439,83 +451,85 @@ const ProHeader = memo(function ProHeader2({
|
|
|
439
451
|
})]
|
|
440
452
|
}), /* @__PURE__ */jsxs(RightWrap, {
|
|
441
453
|
$addSpaceOnDesktop: !!embedConfig?.fullWidthHeader,
|
|
442
|
-
children: [/* @__PURE__ */
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
454
|
+
children: [activeModal !== ModalId.ProMobileMenu && /* @__PURE__ */jsxs(Fragment, {
|
|
455
|
+
children: [/* @__PURE__ */jsx(ProIconWrap, {
|
|
456
|
+
"data-test-id": "search-btn",
|
|
457
|
+
hideBreakpoint: !useInlineCategories ? MOBILE_BREAKPOINT_UP : void 0,
|
|
458
|
+
motif,
|
|
459
|
+
onClick: handleShowSearchTab,
|
|
460
|
+
children: /* @__PURE__ */jsx(ProIconInnerFillWrap, {
|
|
461
|
+
$active: activeModal === ModalId.Search || !!searchValue,
|
|
462
|
+
$transparent: !!embedConfig || useInlineCategories,
|
|
463
|
+
children: /* @__PURE__ */jsx(SvgIcon, {
|
|
464
|
+
src: _externalAssets_g50k1DIN__default,
|
|
465
|
+
width: HEADER_ICON_SIZE,
|
|
466
|
+
height: HEADER_ICON_SIZE
|
|
467
|
+
})
|
|
468
|
+
})
|
|
469
|
+
}), cart && /* @__PURE__ */jsx(ProIconWrap, {
|
|
470
|
+
motif,
|
|
471
|
+
"data-test-id": "cart-btn",
|
|
472
|
+
onClick: e => cartQuantity > 0 && handleModalOpen(e, ModalId.Cart),
|
|
473
|
+
$isDefaultCursor: cartQuantity < 1,
|
|
474
|
+
children: cart?.loading ? /* @__PURE__ */jsx(SkeletonCircleLoader, {
|
|
475
|
+
diameter: HEADER_ICON_SIZE
|
|
476
|
+
}) : cartQuantity > 0 ? /* @__PURE__ */jsx(CartIcon, {
|
|
477
|
+
itemCount: cartQuantity,
|
|
478
|
+
motif,
|
|
479
|
+
width: HEADER_ICON_SIZE,
|
|
480
|
+
height: HEADER_ICON_SIZE
|
|
481
|
+
}) : /* @__PURE__ */jsx(Tooltip, {
|
|
482
|
+
description: translations.cart.empty,
|
|
483
|
+
motif: "light",
|
|
484
|
+
isInteractive: true,
|
|
485
|
+
position: "bottom",
|
|
486
|
+
style: {
|
|
487
|
+
height: `${HEADER_ICON_SIZE}px`
|
|
488
|
+
},
|
|
489
|
+
children: /* @__PURE__ */jsx(CartIcon, {
|
|
490
|
+
itemCount: cartQuantity,
|
|
491
|
+
motif,
|
|
492
|
+
width: HEADER_ICON_SIZE,
|
|
493
|
+
height: HEADER_ICON_SIZE
|
|
494
|
+
})
|
|
495
|
+
})
|
|
496
|
+
}), !embedConfig && !handlePurchaseHistoryClick && /* @__PURE__ */jsx(VerticalDivider, {
|
|
497
|
+
hideBreakpoint: MOBILE_BREAKPOINT_AND_DOWN
|
|
498
|
+
}), isMultiLanguage && !embedConfig?.hideLanguagePicker && /* @__PURE__ */jsx(ProIconWrap, {
|
|
499
|
+
motif,
|
|
500
|
+
"data-test-id": "language-picker-btn",
|
|
501
|
+
onClick: e => handleModalOpen(e, ModalId.Language),
|
|
450
502
|
children: /* @__PURE__ */jsx(SvgIcon, {
|
|
451
|
-
src:
|
|
503
|
+
src: _externalAssets_DJH57LL8__default,
|
|
452
504
|
width: HEADER_ICON_SIZE,
|
|
453
505
|
height: HEADER_ICON_SIZE
|
|
454
506
|
})
|
|
455
|
-
})
|
|
456
|
-
|
|
457
|
-
motif,
|
|
458
|
-
"data-test-id": "cart-btn",
|
|
459
|
-
onClick: e => cartQuantity > 0 && handleModalOpen(e, ModalId.Cart),
|
|
460
|
-
$isDefaultCursor: cartQuantity < 1,
|
|
461
|
-
children: cart?.loading ? /* @__PURE__ */jsx(SkeletonCircleLoader, {
|
|
462
|
-
diameter: HEADER_ICON_SIZE
|
|
463
|
-
}) : cartQuantity > 0 ? /* @__PURE__ */jsx(CartIcon, {
|
|
464
|
-
itemCount: cartQuantity,
|
|
507
|
+
}), handlePurchaseHistoryClick && /* @__PURE__ */jsx(ProIconWrap, {
|
|
508
|
+
hideBreakpoint: MOBILE_BREAKPOINT_AND_DOWN,
|
|
465
509
|
motif,
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
description: translations.cart.empty,
|
|
470
|
-
motif: "light",
|
|
471
|
-
isInteractive: true,
|
|
472
|
-
position: "bottom",
|
|
473
|
-
style: {
|
|
474
|
-
height: `${HEADER_ICON_SIZE}px`
|
|
475
|
-
},
|
|
476
|
-
children: /* @__PURE__ */jsx(CartIcon, {
|
|
477
|
-
itemCount: cartQuantity,
|
|
478
|
-
motif,
|
|
510
|
+
onClick: handlePurchaseHistoryClick,
|
|
511
|
+
children: /* @__PURE__ */jsx(SvgIcon, {
|
|
512
|
+
src: HistoryIcon__default,
|
|
479
513
|
width: HEADER_ICON_SIZE,
|
|
480
514
|
height: HEADER_ICON_SIZE
|
|
481
515
|
})
|
|
482
|
-
})
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
onClick: handlePurchaseHistoryClick,
|
|
498
|
-
children: /* @__PURE__ */jsx(SvgIcon, {
|
|
499
|
-
src: HistoryIcon__default,
|
|
500
|
-
width: HEADER_ICON_SIZE,
|
|
501
|
-
height: HEADER_ICON_SIZE
|
|
502
|
-
})
|
|
503
|
-
}), earlyAccess && /* @__PURE__ */jsx(ProIconWrap, {
|
|
504
|
-
hideBreakpoint: BREAKPOINTS.TABLET_AND_DOWN,
|
|
505
|
-
motif,
|
|
506
|
-
onClick: earlyAccess.onClick,
|
|
507
|
-
children: earlyAccess.loading ? /* @__PURE__ */jsx(SkeletonCircleLoader, {
|
|
508
|
-
diameter: HEADER_ICON_SIZE
|
|
509
|
-
}) : /* @__PURE__ */jsx(SvgIcon, {
|
|
510
|
-
src: EAIcon__default,
|
|
511
|
-
width: HEADER_ICON_SIZE,
|
|
512
|
-
height: HEADER_ICON_SIZE * 0.8,
|
|
513
|
-
renderedHeight: HEADER_ICON_SIZE * 0.8
|
|
514
|
-
})
|
|
515
|
-
}), !embedConfig?.moveAvatarIconToLeft ? !accountMenu ? avatarHtml : accountMenu : null, /* @__PURE__ */jsx(VerticalDivider, {
|
|
516
|
-
hideBreakpoint: BREAKPOINTS.TABLET_UP
|
|
516
|
+
}), earlyAccess && /* @__PURE__ */jsx(ProIconWrap, {
|
|
517
|
+
hideBreakpoint: MOBILE_BREAKPOINT_AND_DOWN,
|
|
518
|
+
motif,
|
|
519
|
+
onClick: earlyAccess.onClick,
|
|
520
|
+
children: earlyAccess.loading ? /* @__PURE__ */jsx(SkeletonCircleLoader, {
|
|
521
|
+
diameter: HEADER_ICON_SIZE
|
|
522
|
+
}) : /* @__PURE__ */jsx(SvgIcon, {
|
|
523
|
+
src: EAIcon__default,
|
|
524
|
+
width: HEADER_ICON_SIZE,
|
|
525
|
+
height: HEADER_ICON_SIZE * 0.8,
|
|
526
|
+
renderedHeight: HEADER_ICON_SIZE * 0.8
|
|
527
|
+
})
|
|
528
|
+
}), !embedConfig?.moveAvatarIconToLeft ? !accountMenu ? avatarHtml : accountMenu : null, /* @__PURE__ */jsx(VerticalDivider, {
|
|
529
|
+
hideBreakpoint: MOBILE_BREAKPOINT_UP
|
|
530
|
+
})]
|
|
517
531
|
}), /* @__PURE__ */jsx(ProIconWrap, {
|
|
518
|
-
hideBreakpoint:
|
|
532
|
+
hideBreakpoint: MOBILE_BREAKPOINT_UP,
|
|
519
533
|
motif,
|
|
520
534
|
onClick: handleHamburgerClick,
|
|
521
535
|
children: activeModal === ModalId.ProMobileMenu ? /* @__PURE__ */jsx(SvgIcon, {
|
|
@@ -589,12 +603,11 @@ const ProHeader = memo(function ProHeader2({
|
|
|
589
603
|
handleProductLineChange,
|
|
590
604
|
productLineValue,
|
|
591
605
|
productLineOptions,
|
|
592
|
-
|
|
593
|
-
|
|
606
|
+
categories,
|
|
607
|
+
hideExtraSection: !!embedConfig
|
|
594
608
|
})]
|
|
595
|
-
}),
|
|
609
|
+
}), useInlineCategories && !embedConfig && /* @__PURE__ */jsx(NavigationProMenu, {
|
|
596
610
|
show: showProMenu,
|
|
597
|
-
onClose: () => setShowTouchProMenu(false),
|
|
598
611
|
currentCountryName,
|
|
599
612
|
handleStorePickerClick,
|
|
600
613
|
productLineValue,
|
|
@@ -604,7 +617,7 @@ const ProHeader = memo(function ProHeader2({
|
|
|
604
617
|
}), /* @__PURE__ */jsx(SearchTabWrap, {
|
|
605
618
|
$show: activeModal === ModalId.Search,
|
|
606
619
|
$isStickyEmbed: !!embedConfig,
|
|
607
|
-
hideBreakpoint:
|
|
620
|
+
hideBreakpoint: MOBILE_BREAKPOINT_UP,
|
|
608
621
|
children: /* @__PURE__ */jsx(Search, {
|
|
609
622
|
setInputRef: setSearchInputRef,
|
|
610
623
|
onValueChange: handleSearchValueChange,
|