@ubnt/store.core 9.38.1 → 9.39.0-beta.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 +299 -0
- package/lib/_virtual/_virtual_multi-entry.js +17 -2
- package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
- package/lib/_virtual/_virtual_multi-entry.mjs +4 -0
- package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
- package/lib/apis/smartcat.js.map +1 -1
- package/lib/apis/smartcat.mjs.map +1 -1
- package/lib/assets/basestation-xg.jpg +0 -0
- package/lib/assets/close2.svg +3 -2
- package/lib/assets/close3.svg +2 -3
- package/lib/assets/crestron.svg +3 -0
- package/lib/assets/e7-audience.jpg +0 -0
- package/lib/assets/e7.jpg +0 -0
- package/lib/assets/pause.svg +3 -3
- package/lib/assets/pause2.svg +3 -3
- package/lib/assets/port.svg +4 -2
- package/lib/assets/port2.svg +3 -0
- package/lib/assets/radio-60g.svg +11 -0
- package/lib/assets/ucgMax.jpg +0 -0
- package/lib/assets/ucgMax2.jpg +0 -0
- package/lib/assets/ucgUltra.jpg +0 -0
- package/lib/assets/ucgUltra2.jpg +0 -0
- package/lib/assets/udmPro.jpg +0 -0
- package/lib/assets/udmPro2.jpg +0 -0
- package/lib/assets/udmProSpecial.jpg +0 -0
- package/lib/assets/udmProSpecial2.jpg +0 -0
- package/lib/assets/wifiEnterprise.svg +3 -0
- package/lib/components/Accordion/Accordion.js.map +1 -1
- package/lib/components/Accordion/Accordion.mjs.map +1 -1
- package/lib/components/Accordion/Accordion.styles.js.map +1 -1
- package/lib/components/Accordion/Accordion.styles.mjs.map +1 -1
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Avatar/Avatar.mjs.map +1 -1
- package/lib/components/BackInStock/BackInStock.types.d.ts +1 -0
- package/lib/components/Banner/Banner.styles.js.map +1 -1
- package/lib/components/Banner/Banner.styles.mjs.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.js.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.mjs.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.styles.js.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.styles.mjs.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.d.ts +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.js +16 -4
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.js.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.mjs +17 -5
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.mjs.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.d.ts +5 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.js +82 -17
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.js.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.mjs +82 -17
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.mjs.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.types.d.ts +4 -0
- package/lib/components/CloserLookSection/CloserLookSection.js.map +1 -1
- package/lib/components/CloserLookSection/CloserLookSection.mjs.map +1 -1
- package/lib/components/CloserLookSection/CloserLookSection.styles.js.map +1 -1
- package/lib/components/CloserLookSection/CloserLookSection.styles.mjs.map +1 -1
- package/lib/components/Container/Container.styles.js.map +1 -1
- package/lib/components/Container/Container.styles.mjs.map +1 -1
- package/lib/components/CustomImage/CustomImage.js +1 -1
- package/lib/components/CustomImage/CustomImage.js.map +1 -1
- package/lib/components/CustomImage/CustomImage.mjs +1 -1
- package/lib/components/CustomImage/CustomImage.mjs.map +1 -1
- package/lib/components/CustomImage/CustomImage.styles.js.map +1 -1
- package/lib/components/CustomImage/CustomImage.styles.mjs.map +1 -1
- package/lib/components/Explore/Explore.js.map +1 -1
- package/lib/components/Explore/Explore.mjs.map +1 -1
- package/lib/components/Explore/ExploreData.js +15 -13
- package/lib/components/Explore/ExploreData.js.map +1 -1
- package/lib/components/Explore/ExploreData.mjs +15 -13
- package/lib/components/Explore/ExploreData.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/FeaturesSection.styles.js.map +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.styles.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/Footer.js +1 -1
- package/lib/components/Footer/Footer.js.map +1 -1
- package/lib/components/Footer/Footer.mjs +1 -1
- package/lib/components/Footer/Footer.mjs.map +1 -1
- package/lib/components/Footer/Footer.styles.js.map +1 -1
- package/lib/components/Footer/Footer.styles.mjs.map +1 -1
- package/lib/components/Gallery/Gallery.js.map +1 -1
- package/lib/components/Gallery/Gallery.mjs.map +1 -1
- package/lib/components/Gallery/Gallery.styles.js.map +1 -1
- package/lib/components/Gallery/Gallery.styles.mjs.map +1 -1
- package/lib/components/Gallery/GalleryThumbnails/GalleryThumbnails.js.map +1 -1
- package/lib/components/Gallery/GalleryThumbnails/GalleryThumbnails.mjs.map +1 -1
- package/lib/components/Gallery/GalleryThumbnails/GalleryThumbnails.styles.js.map +1 -1
- package/lib/components/Gallery/GalleryThumbnails/GalleryThumbnails.styles.mjs.map +1 -1
- package/lib/components/GradientButton/GradientButton.styles.js.map +1 -1
- package/lib/components/GradientButton/GradientButton.styles.mjs.map +1 -1
- package/lib/components/GridGallery/GridGallery.js.map +1 -1
- package/lib/components/GridGallery/GridGallery.mjs.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.js.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.mjs.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.styles.js.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.styles.mjs.map +1 -1
- package/lib/components/Header/AccountMenu/megaphone.http.service.js.map +1 -1
- package/lib/components/Header/AccountMenu/megaphone.http.service.mjs.map +1 -1
- package/lib/components/Header/CartModalV2/Item/Item.js.map +1 -1
- package/lib/components/Header/CartModalV2/Item/Item.mjs.map +1 -1
- package/lib/components/Header/Header.js +3 -3
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mjs +3 -3
- package/lib/components/Header/Header.mjs.map +1 -1
- package/lib/components/Header/Header.styles.js.map +1 -1
- package/lib/components/Header/Header.styles.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/LanguageFrame.styles.js.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/Carousel/Carousel.js.map +1 -1
- package/lib/components/Header/Navigation/Carousel/Carousel.mjs.map +1 -1
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
- package/lib/components/Hero/Hero.js.map +1 -1
- package/lib/components/Hero/Hero.mjs.map +1 -1
- package/lib/components/Hero/Hero.styles.js.map +1 -1
- package/lib/components/Hero/Hero.styles.mjs.map +1 -1
- package/lib/components/ImageCarousel/ImageCarousel.styles.js.map +1 -1
- package/lib/components/ImageCarousel/ImageCarousel.styles.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/LandingPage/Cards/Cards.styles.js.map +1 -1
- package/lib/components/LandingPage/Cards/Cards.styles.mjs.map +1 -1
- package/lib/components/LandingPage/LandingPage.js.map +1 -1
- package/lib/components/LandingPage/LandingPage.mjs.map +1 -1
- package/lib/components/LandingPagePro/LandingPagePro.js.map +1 -1
- package/lib/components/LandingPagePro/LandingPagePro.mjs.map +1 -1
- package/lib/components/LandingPageSearch/Modal/Modal.js.map +1 -1
- package/lib/components/LandingPageSearch/Modal/Modal.mjs.map +1 -1
- package/lib/components/LandingPageSidebar/LandingPageSidebar.js.map +1 -1
- package/lib/components/LandingPageSidebar/LandingPageSidebar.mjs.map +1 -1
- package/lib/components/LandingPageSidebar/LandingPageSidebar.styles.js.map +1 -1
- package/lib/components/LandingPageSidebar/LandingPageSidebar.styles.mjs.map +1 -1
- package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.helpers.js.map +1 -1
- package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.helpers.mjs.map +1 -1
- package/lib/components/MicrositeExploreCards/MicrositeExploreCards.styles.js.map +1 -1
- package/lib/components/MicrositeExploreCards/MicrositeExploreCards.styles.mjs.map +1 -1
- package/lib/components/MicrositeFeatureList/MicrositeFeatureList.styles.js.map +1 -1
- package/lib/components/MicrositeFeatureList/MicrositeFeatureList.styles.mjs.map +1 -1
- package/lib/components/MicrositeHero/MicrositeHero.js.map +1 -1
- package/lib/components/MicrositeHero/MicrositeHero.mjs.map +1 -1
- package/lib/components/MicrositeHero/MicrositeHero.styles.js.map +1 -1
- package/lib/components/MicrositeHero/MicrositeHero.styles.mjs.map +1 -1
- package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.styles.js.map +1 -1
- package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.styles.mjs.map +1 -1
- package/lib/components/MicrositeProductGrid/MicrositeProductGrid.styles.js.map +1 -1
- package/lib/components/MicrositeProductGrid/MicrositeProductGrid.styles.mjs.map +1 -1
- package/lib/components/MicrositeProductLearnMoreBlock/MicrositeProductLearnMoreBlockWrap.js.map +1 -1
- package/lib/components/MicrositeProductLearnMoreBlock/MicrositeProductLearnMoreBlockWrap.mjs.map +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
- package/lib/components/Microsites/MicrositeProductPage.js.map +1 -1
- package/lib/components/Microsites/MicrositeProductPage.mjs.map +1 -1
- package/lib/components/MobileModal/MobileModal.styles.js.map +1 -1
- package/lib/components/MobileModal/MobileModal.styles.mjs.map +1 -1
- package/lib/components/ModelCompareV3/HeaderShadow.js.map +1 -1
- package/lib/components/ModelCompareV3/HeaderShadow.mjs.map +1 -1
- package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.js +1 -0
- package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.js.map +1 -1
- package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.mjs +1 -0
- package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.mjs.map +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.js.map +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.mjs.map +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.js +2 -0
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.js.map +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.mjs +2 -0
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.mjs.map +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +10 -1
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/WiFi/basestation-xg.jpg.js +27 -0
- package/lib/components/ModelCompareV3/assets/WiFi/basestation-xg.jpg.js.map +1 -0
- package/lib/components/ModelCompareV3/assets/WiFi/basestation-xg.jpg.mjs +3 -0
- package/lib/components/ModelCompareV3/assets/WiFi/basestation-xg.jpg.mjs.map +1 -0
- package/lib/components/ModelCompareV3/assets/WiFi/e7-audience.jpg.js +27 -0
- package/lib/components/ModelCompareV3/assets/WiFi/e7-audience.jpg.js.map +1 -0
- package/lib/components/ModelCompareV3/assets/WiFi/e7-audience.jpg.mjs +3 -0
- package/lib/components/ModelCompareV3/assets/WiFi/e7-audience.jpg.mjs.map +1 -0
- package/lib/components/ModelCompareV3/assets/WiFi/e7.jpg.js +27 -0
- package/lib/components/ModelCompareV3/assets/WiFi/e7.jpg.js.map +1 -0
- package/lib/components/ModelCompareV3/assets/WiFi/e7.jpg.mjs +3 -0
- package/lib/components/ModelCompareV3/assets/WiFi/e7.jpg.mjs.map +1 -0
- package/lib/components/ModelCompareV3/assets/crestron.svg.js +27 -0
- package/lib/components/ModelCompareV3/assets/crestron.svg.js.map +1 -0
- package/lib/components/ModelCompareV3/assets/crestron.svg.mjs +3 -0
- package/lib/components/ModelCompareV3/assets/crestron.svg.mjs.map +1 -0
- package/lib/components/ModelCompareV3/assets/port.svg.js +27 -0
- package/lib/components/ModelCompareV3/assets/port.svg.js.map +1 -0
- package/lib/components/ModelCompareV3/assets/port.svg.mjs +3 -0
- package/lib/components/ModelCompareV3/assets/port.svg.mjs.map +1 -0
- package/lib/components/ModelCompareV3/assets/radio-60g.svg.js +27 -0
- package/lib/components/ModelCompareV3/assets/radio-60g.svg.js.map +1 -0
- package/lib/components/ModelCompareV3/assets/radio-60g.svg.mjs +3 -0
- package/lib/components/ModelCompareV3/assets/radio-60g.svg.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/CloudGateways.js +12 -12
- package/lib/components/ModelCompareV3/data/CloudGateways.mjs +8 -8
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.js +3 -2
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.js.map +1 -1
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.mjs +3 -2
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/EnterpriseWiFi.d.ts +2 -0
- package/lib/components/ModelCompareV3/data/EnterpriseWiFi.js +28 -0
- package/lib/components/ModelCompareV3/data/EnterpriseWiFi.js.map +1 -0
- package/lib/components/ModelCompareV3/data/EnterpriseWiFi.mjs +26 -0
- package/lib/components/ModelCompareV3/data/EnterpriseWiFi.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/MegaCapacityWiFI.d.ts +2 -0
- package/lib/components/ModelCompareV3/data/MegaCapacityWiFI.js +26 -0
- package/lib/components/ModelCompareV3/data/MegaCapacityWiFI.js.map +1 -0
- package/lib/components/ModelCompareV3/data/MegaCapacityWiFI.mjs +24 -0
- package/lib/components/ModelCompareV3/data/MegaCapacityWiFI.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.js +10 -3
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.js.map +1 -1
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.mjs +10 -3
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/Switching.js +3 -2
- package/lib/components/ModelCompareV3/data/Switching.js.map +1 -1
- package/lib/components/ModelCompareV3/data/Switching.mjs +3 -2
- package/lib/components/ModelCompareV3/data/Switching.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/index.d.ts +39 -37
- package/lib/components/ModelCompareV3/data/index.js +80 -74
- package/lib/components/ModelCompareV3/data/index.js.map +1 -1
- package/lib/components/ModelCompareV3/data/index.mjs +80 -74
- package/lib/components/ModelCompareV3/data/index.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/UispRouter.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/UispRouter.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/UispRouterPro.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/UispRouterPro.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/aggregation.js +7 -0
- package/lib/components/ModelCompareV3/data/products/aggregation.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/aggregation.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/aggregation.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airFiber11.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airFiber11.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airFiber24.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airFiber24.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airFiber24HiDensity.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airFiber24HiDensity.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airFiber2X.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airFiber2X.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airFiber5.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airFiber5.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airMAX5GHz16dBi120Sector.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airMAX5GHz16dBi120Sector.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airMAX5GHz17dBi90Sector.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airMAX5GHz17dBi90Sector.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airMAX5GHz19dBi120Sector.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airMAX5GHz19dBi120Sector.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airMAX5GHz20dBi90Sector.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/airMAX5GHz20dBi90Sector.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/baseStationXG.d.ts +2 -0
- package/lib/components/ModelCompareV3/data/products/baseStationXG.js +114 -0
- package/lib/components/ModelCompareV3/data/products/baseStationXG.js.map +1 -0
- package/lib/components/ModelCompareV3/data/products/baseStationXG.mjs +106 -0
- package/lib/components/ModelCompareV3/data/products/baseStationXG.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/products/buildingBridge.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/buildingBridge.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/buildingBridgeXG.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/buildingBridgeXG.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.js +4 -2
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.mjs +4 -2
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.js +2 -2
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.mjs +2 -2
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/e7.d.ts +2 -0
- package/lib/components/ModelCompareV3/data/products/e7.js +121 -0
- package/lib/components/ModelCompareV3/data/products/e7.js.map +1 -0
- package/lib/components/ModelCompareV3/data/products/e7.mjs +113 -0
- package/lib/components/ModelCompareV3/data/products/e7.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/products/e7Audience.d.ts +2 -0
- package/lib/components/ModelCompareV3/data/products/e7Audience.js +135 -0
- package/lib/components/ModelCompareV3/data/products/e7Audience.js.map +1 -0
- package/lib/components/ModelCompareV3/data/products/e7Audience.mjs +127 -0
- package/lib/components/ModelCompareV3/data/products/e7Audience.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/products/e7Campus.d.ts +2 -0
- package/lib/components/ModelCompareV3/data/products/e7Campus.js +119 -0
- package/lib/components/ModelCompareV3/data/products/e7Campus.js.map +1 -0
- package/lib/components/ModelCompareV3/data/products/e7Campus.mjs +111 -0
- package/lib/components/ModelCompareV3/data/products/e7Campus.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/products/edgePointR6.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgePointR6.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgePointR8.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgePointR8.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgePointS16Switch.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgePointS16Switch.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouter10x.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouter10x.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouter12.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouter12.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouter12p.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouter12p.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouter4.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouter4.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouter6Poe.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouter6Poe.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouterInfinity.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouterInfinity.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouterX.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouterX.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouterXSfp.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeRouterXSfp.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch10x.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch10x.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch10xp.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch10xp.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch16xg.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch16xg.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch16xp.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch16xp.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch16xpoe150.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch16xpoe150.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch18x.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch18x.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch24lite.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch24lite.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch24poe-500.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch24poe-500.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch24poe.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch24poe.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch48lite.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch48lite.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch48poe.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeSwitch48poe.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeswitch48poe-750.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeswitch48poe-750.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeswitch5xp.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeswitch5xp.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeswitch8poe.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/edgeswitch8poe.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.js +7 -0
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.js +7 -0
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.js +7 -0
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/express.js +3 -3
- package/lib/components/ModelCompareV3/data/products/express.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/express.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/express.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/fiberInstant.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/fiberInstant.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/fiberNanog.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/fiberNanog.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.js +4 -2
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.mjs +4 -2
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayLite.js +4 -2
- package/lib/components/ModelCompareV3/data/products/gatewayLite.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayLite.mjs +4 -2
- package/lib/components/ModelCompareV3/data/products/gatewayLite.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayMax.js +4 -2
- package/lib/components/ModelCompareV3/data/products/gatewayMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayMax.mjs +4 -2
- package/lib/components/ModelCompareV3/data/products/gatewayMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.js +4 -2
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.mjs +4 -2
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js +7 -0
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ltuExtremeRange.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ltuExtremeRange.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ltuLongRange.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ltuLongRange.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ltuPro.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ltuPro.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/missionCritical.js +7 -0
- package/lib/components/ModelCompareV3/data/products/missionCritical.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/missionCritical.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/missionCritical.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/nanoStation5AC.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/nanoStation5AC.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/nanoStation5ACLoco.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/nanoStation5ACLoco.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.js +3 -1
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.mjs +3 -1
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/prismStation5AC.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/prismStation5AC.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16.js +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax16.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24.js +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax24.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48.js +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax48.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js +8 -0
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs +8 -0
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.js +7 -0
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js +10 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs +10 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesStandard.js +7 -0
- package/lib/components/ModelCompareV3/data/products/switchesStandard.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs +7 -0
- package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgMax.js +2 -2
- package/lib/components/ModelCompareV3/data/products/ucgMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgMax.mjs +2 -2
- package/lib/components/ModelCompareV3/data/products/ucgMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.js +4 -4
- package/lib/components/ModelCompareV3/data/products/ucgUltra.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +4 -4
- package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udb.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udb.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udbPro.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udbPro.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmPro.js +4 -4
- package/lib/components/ModelCompareV3/data/products/udmPro.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmPro.mjs +4 -4
- package/lib/components/ModelCompareV3/data/products/udmPro.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.js +3 -3
- package/lib/components/ModelCompareV3/data/products/udmProMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +4 -4
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +4 -4
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.js +5 -41
- package/lib/components/ModelCompareV3/data/products/udr.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.mjs +5 -21
- package/lib/components/ModelCompareV3/data/products/udr.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udw.js +3 -3
- package/lib/components/ModelCompareV3/data/products/udw.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udw.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udw.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/uispSwitch.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/uispSwitch.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.d.ts +2 -0
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.js +18 -0
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.js.map +1 -0
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.mjs +10 -0
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/properties/dedicatedSpectral.js +2 -2
- package/lib/components/ModelCompareV3/data/properties/dedicatedSpectral.js.map +1 -1
- package/lib/components/ModelCompareV3/data/properties/dedicatedSpectral.mjs +2 -2
- package/lib/components/ModelCompareV3/data/properties/dedicatedSpectral.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/properties/index.d.ts +5 -0
- package/lib/components/ModelCompareV3/data/properties/index.js +10 -0
- package/lib/components/ModelCompareV3/data/properties/index.js.map +1 -1
- package/lib/components/ModelCompareV3/data/properties/index.mjs +5 -0
- package/lib/components/ModelCompareV3/data/properties/index.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.d.ts +2 -0
- package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.js +18 -0
- package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.js.map +1 -0
- package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.mjs +10 -0
- package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/properties/rfFilteringTechnology.d.ts +2 -0
- package/lib/components/ModelCompareV3/data/properties/rfFilteringTechnology.js +18 -0
- package/lib/components/ModelCompareV3/data/properties/rfFilteringTechnology.js.map +1 -0
- package/lib/components/ModelCompareV3/data/properties/rfFilteringTechnology.mjs +10 -0
- package/lib/components/ModelCompareV3/data/properties/rfFilteringTechnology.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/properties/weatherproofing.d.ts +2 -0
- package/lib/components/ModelCompareV3/data/properties/weatherproofing.js +18 -0
- package/lib/components/ModelCompareV3/data/properties/weatherproofing.js.map +1 -0
- package/lib/components/ModelCompareV3/data/properties/weatherproofing.mjs +10 -0
- package/lib/components/ModelCompareV3/data/properties/weatherproofing.mjs.map +1 -0
- package/lib/components/ModelCompareV3/data/properties/wifi6Technology.d.ts +2 -0
- package/lib/components/ModelCompareV3/data/properties/wifi6Technology.js +18 -0
- package/lib/components/ModelCompareV3/data/properties/wifi6Technology.js.map +1 -0
- package/lib/components/ModelCompareV3/data/properties/wifi6Technology.mjs +10 -0
- package/lib/components/ModelCompareV3/data/properties/wifi6Technology.mjs.map +1 -0
- package/lib/components/ModelCompareV3/translations/en.json.js +31 -1
- package/lib/components/ModelCompareV3/translations/en.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/en.json.mjs +31 -1
- package/lib/components/ModelCompareV3/translations/en.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/useModelCompareTranslation.d.ts +2 -2
- package/lib/components/Pagination/Pagination.js.map +1 -1
- package/lib/components/Pagination/Pagination.mjs.map +1 -1
- package/lib/components/PriceRangeSlider/PriceRangeSlider.js.map +1 -1
- package/lib/components/PriceRangeSlider/PriceRangeSlider.mjs.map +1 -1
- package/lib/components/ProductCard/ProductCard.js.map +1 -1
- package/lib/components/ProductCard/ProductCard.mjs.map +1 -1
- package/lib/components/ProductCardPopup/ProductCardPopup.js.map +1 -1
- package/lib/components/ProductCardPopup/ProductCardPopup.mjs.map +1 -1
- package/lib/components/ProductGrid/ProductGrid.js.map +1 -1
- package/lib/components/ProductGrid/ProductGrid.mjs.map +1 -1
- package/lib/components/ProductSectionTabs/ProductSectionTabs.js.map +1 -1
- package/lib/components/ProductSectionTabs/ProductSectionTabs.mjs.map +1 -1
- package/lib/components/ProductTechSpecs/ProductTechSpecs.styles.js.map +1 -1
- package/lib/components/ProductTechSpecs/ProductTechSpecs.styles.mjs.map +1 -1
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.js.map +1 -1
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.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/ComputeResourceCalculator.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/Layout.styles.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/Layout.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerConfigurator.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerConfigurator.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/port.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/port.svg.mjs +2 -2
- package/lib/components/ScrollWrapper/ScrollWrapper.js.map +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.mjs.map +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.styles.js.map +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.styles.mjs.map +1 -1
- package/lib/components/Search/Input/Input.styles.js.map +1 -1
- package/lib/components/Search/Input/Input.styles.mjs.map +1 -1
- package/lib/components/Search/Modal/Modal.js.map +1 -1
- package/lib/components/Search/Modal/Modal.mjs.map +1 -1
- package/lib/components/SkeletonLoader/SkeletonLoaderTable/SkeletonLoaderTable.js.map +1 -1
- package/lib/components/SkeletonLoader/SkeletonLoaderTable/SkeletonLoaderTable.mjs.map +1 -1
- package/lib/components/StorageSliders/StorageSliders.utils.js.map +1 -1
- package/lib/components/StorageSliders/StorageSliders.utils.mjs.map +1 -1
- package/lib/components/StyleableSvgImage/StyleableSvgImage.js.map +1 -1
- package/lib/components/StyleableSvgImage/StyleableSvgImage.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/Compatibility/Compatibility.styles.js.map +1 -1
- package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.styles.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/VariantSelector/VariantSelector.constants.js.map +1 -1
- package/lib/components/VariantSelector/VariantSelector.constants.mjs.map +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.js +2 -2
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +2 -2
- package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
- package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
- package/lib/constants/icons/menu/index.d.ts +1 -0
- package/lib/constants/icons/menu/index.js +9 -0
- package/lib/constants/icons/menu/index.js.map +1 -1
- package/lib/constants/icons/menu/index.mjs +2 -0
- package/lib/constants/icons/menu/index.mjs.map +1 -1
- package/lib/constants/icons/menu/wifiEnterprise.svg.js +27 -0
- package/lib/constants/icons/menu/wifiEnterprise.svg.js.map +1 -0
- package/lib/constants/icons/menu/wifiEnterprise.svg.mjs +3 -0
- package/lib/constants/icons/menu/wifiEnterprise.svg.mjs.map +1 -0
- package/lib/constants/layout.js.map +1 -1
- package/lib/constants/layout.mjs.map +1 -1
- package/lib/constants/postalCode.js.map +1 -1
- package/lib/constants/postalCode.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.d.ts +3 -2
- package/lib/constants/proStoreCategories/mapping/index.js +40 -46
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +39 -44
- package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/redirects.js +18 -3
- package/lib/constants/proStoreCategories/mapping/redirects.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/redirects.mjs +18 -3
- package/lib/constants/proStoreCategories/mapping/redirects.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/uisp.d.ts +1 -0
- package/lib/constants/proStoreCategories/mapping/uisp.js +1 -0
- package/lib/constants/proStoreCategories/mapping/uisp.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/uisp.mjs +1 -0
- package/lib/constants/proStoreCategories/mapping/uisp.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.d.ts +8 -9
- package/lib/constants/proStoreCategories/mapping/unifi.js +8 -9
- package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs +8 -9
- package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.js +6 -2
- package/lib/constants/proStoreCategories/translations/ar.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.mjs +6 -3
- package/lib/constants/proStoreCategories/translations/ar.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.js +6 -2
- package/lib/constants/proStoreCategories/translations/de.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.mjs +6 -3
- package/lib/constants/proStoreCategories/translations/de.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.js +6 -2
- package/lib/constants/proStoreCategories/translations/el.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.mjs +6 -3
- package/lib/constants/proStoreCategories/translations/el.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.js +3 -2
- package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.mjs +3 -2
- package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/es.json.js +6 -2
- package/lib/constants/proStoreCategories/translations/es.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/es.json.mjs +6 -3
- package/lib/constants/proStoreCategories/translations/es.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.js +3 -2
- package/lib/constants/proStoreCategories/translations/fr.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.mjs +3 -2
- package/lib/constants/proStoreCategories/translations/fr.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/it.json.js +6 -2
- package/lib/constants/proStoreCategories/translations/it.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/it.json.mjs +6 -3
- package/lib/constants/proStoreCategories/translations/it.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.js +6 -2
- package/lib/constants/proStoreCategories/translations/ja.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.mjs +6 -3
- package/lib/constants/proStoreCategories/translations/ja.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js +6 -2
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs +6 -3
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +3 -2
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +3 -2
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +3 -2
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +3 -2
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/constants/proStoreFilters/mapping.d.ts +17 -1
- package/lib/constants/proStoreFilters/mapping.js +16 -0
- package/lib/constants/proStoreFilters/mapping.js.map +1 -1
- package/lib/constants/proStoreFilters/mapping.mjs +16 -0
- package/lib/constants/proStoreFilters/mapping.mjs.map +1 -1
- package/lib/contexts/MenuContext/mapping.js +12 -0
- package/lib/contexts/MenuContext/mapping.js.map +1 -1
- package/lib/contexts/MenuContext/mapping.mjs +11 -0
- package/lib/contexts/MenuContext/mapping.mjs.map +1 -1
- package/lib/contexts/MenuContext/utils.js.map +1 -1
- package/lib/contexts/MenuContext/utils.mjs.map +1 -1
- package/lib/helpers/index.d.ts +1 -0
- package/lib/helpers/index.js +11 -0
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/index.mjs +1 -0
- package/lib/helpers/index.mjs.map +1 -1
- package/lib/helpers/product.d.ts +87 -0
- package/lib/helpers/product.js +346 -0
- package/lib/helpers/product.js.map +1 -0
- package/lib/helpers/product.mjs +335 -0
- package/lib/helpers/product.mjs.map +1 -0
- package/lib/helpers/product.test.d.ts +1 -0
- package/lib/helpers/time.js.map +1 -1
- package/lib/helpers/time.mjs.map +1 -1
- package/lib/hooks/useTranslation.js.map +1 -1
- package/lib/hooks/useTranslation.mjs.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -1
- package/lib/types/index.mjs +1 -0
- package/lib/types/index.mjs.map +1 -1
- package/lib/types/product.d.ts +87 -0
- package/lib/types/product.js +14 -0
- package/lib/types/product.js.map +1 -0
- package/lib/types/product.mjs +13 -0
- package/lib/types/product.mjs.map +1 -0
- package/lib/utils/address.d.ts +278 -62
- package/lib/utils/address.js +11 -8
- package/lib/utils/address.js.map +1 -1
- package/lib/utils/address.mjs +11 -8
- package/lib/utils/address.mjs.map +1 -1
- package/lib/utils/array.d.ts +4 -0
- package/lib/utils/array.js +10 -0
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/array.mjs +10 -1
- package/lib/utils/array.mjs.map +1 -1
- package/lib/utils/blackFriday.d.ts +21 -0
- package/lib/utils/blackFriday.js +82 -0
- package/lib/utils/blackFriday.js.map +1 -0
- package/lib/utils/blackFriday.mjs +79 -0
- package/lib/utils/blackFriday.mjs.map +1 -0
- package/lib/utils/blackFriday.test.d.ts +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +2 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/index.mjs +2 -0
- package/lib/utils/index.mjs.map +1 -1
- package/lib/utils/money/allocators/fixedAmount.js.map +1 -1
- package/lib/utils/money/allocators/fixedAmount.mjs.map +1 -1
- package/lib/utils/money/format.js +2 -1
- package/lib/utils/money/format.js.map +1 -1
- package/lib/utils/money/format.mjs +2 -1
- package/lib/utils/money/format.mjs.map +1 -1
- package/lib/utils/money/misc.js.map +1 -1
- package/lib/utils/money/misc.mjs.map +1 -1
- package/lib/utils/nextjs/createInlineScript.js.map +1 -1
- package/lib/utils/nextjs/createInlineScript.mjs.map +1 -1
- package/lib/utils/nextjs/index.d.ts +3 -0
- package/lib/utils/nextjs/index.js +5 -0
- package/lib/utils/nextjs/index.js.map +1 -1
- package/lib/utils/nextjs/index.mjs +3 -0
- package/lib/utils/nextjs/index.mjs.map +1 -1
- package/lib/utils/nextjs/patch.d.ts +1 -0
- package/lib/utils/nextjs/patch.js +53 -0
- package/lib/utils/nextjs/patch.js.map +1 -0
- package/lib/utils/nextjs/patch.mjs +41 -0
- package/lib/utils/nextjs/patch.mjs.map +1 -0
- package/lib/utils/nextjs/plugin.d.ts +14 -0
- package/lib/utils/nextjs/plugin.js +41 -0
- package/lib/utils/nextjs/plugin.js.map +1 -0
- package/lib/utils/nextjs/plugin.mjs +39 -0
- package/lib/utils/nextjs/plugin.mjs.map +1 -0
- package/lib/utils/nextjs/ssr/constants.d.ts +8 -0
- package/lib/utils/nextjs/ssr/constants.js +8 -0
- package/lib/utils/nextjs/ssr/constants.js.map +1 -0
- package/lib/utils/nextjs/ssr/constants.mjs +6 -0
- package/lib/utils/nextjs/ssr/constants.mjs.map +1 -0
- package/lib/utils/nextjs/ssr/registry.d.ts +52 -0
- package/lib/utils/nextjs/ssr/registry.js +22 -0
- package/lib/utils/nextjs/ssr/registry.js.map +1 -0
- package/lib/utils/nextjs/ssr/registry.mjs +20 -0
- package/lib/utils/nextjs/ssr/registry.mjs.map +1 -0
- package/lib/utils/nextjs/ssr/style-inject.d.ts +21 -0
- package/lib/utils/nextjs/ssr/style-inject.js +47 -0
- package/lib/utils/nextjs/ssr/style-inject.js.map +1 -0
- package/lib/utils/nextjs/ssr/style-inject.mjs +43 -0
- package/lib/utils/nextjs/ssr/style-inject.mjs.map +1 -0
- package/lib/utils/nextjs/ssr/transform-css-module.d.ts +11 -0
- package/lib/utils/nextjs/ssr/transform-css-module.js +115 -0
- package/lib/utils/nextjs/ssr/transform-css-module.js.map +1 -0
- package/lib/utils/nextjs/ssr/transform-css-module.mjs +87 -0
- package/lib/utils/nextjs/ssr/transform-css-module.mjs.map +1 -0
- package/lib/utils/nextjs/ssr/transform-css-module.test.d.ts +1 -0
- package/lib/utils/nextjs/ssr/types.d.ts +10 -0
- package/lib/utils/nextjs/stringifyForInject.js.map +1 -1
- package/lib/utils/nextjs/stringifyForInject.mjs.map +1 -1
- package/lib/utils/number.js.map +1 -1
- package/lib/utils/number.mjs.map +1 -1
- package/lib/utils/productSort.d.ts +41 -0
- package/lib/utils/productSort.js +67 -0
- package/lib/utils/productSort.js.map +1 -0
- package/lib/utils/productSort.mjs +60 -0
- package/lib/utils/productSort.mjs.map +1 -0
- package/lib/utils/tax/brazil.js.map +1 -1
- package/lib/utils/tax/brazil.mjs.map +1 -1
- package/lib/utils/validations/lastNameSuperRefinement.d.ts +11 -0
- package/lib/utils/validations/lastNameSuperRefinement.js +25 -0
- package/lib/utils/validations/lastNameSuperRefinement.js.map +1 -0
- package/lib/utils/validations/lastNameSuperRefinement.mjs +21 -0
- package/lib/utils/validations/lastNameSuperRefinement.mjs.map +1 -0
- package/lib/utils/wattage.js.map +1 -1
- package/lib/utils/wattage.mjs.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport { dedupe } from \"../array\";\nimport patchUiComponentsAndIcons from \"./patch\";\n\nexport type WithUbntLibrariesConfig = {\n /**\n * ESM Modules to transpile\n */\n transpilePackages?: string[];\n};\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(options?: WithUbntLibrariesConfig) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Extra libs\n ...(options?.transpilePackages ?? []),\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n \"convert-units\", // Currently as of 3.0.0-beta.5 caused prod build issues on consumer projects\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = dedupe([\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ]);\n nextConfig.transpilePackages = dedupe([\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ]);\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","options","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","dedupe","esmExternals","oldWebpackFn","webpack","webpackConfig","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;;;;AAkBO,SAASA,kBAAkBC,OAAmC,EAAA;EAIzCC,KAAAA,CAAAA,SAAAA,CAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,IAAIF,OAAS,EAAAE,iBAAA,IAAqB,EAAC;EAAA;EAEnC,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,EACA;EAAA;EAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACWD,UAAA,CAAAC,YAAA,CAAaC,yBAAyBC,YAAO,CAAA,CACtD,IAAIH,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACJ,CAAA;IACDC,UAAA,CAAWD,oBAAoBI,YAAO,CAAA,CACpC,IAAIH,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACJ,CAAA;IAWDC,UAAA,CAAWC,aAAaG,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeL,UAAW,CAAAM,OAAA;IACrBN,UAAA,CAAAM,OAAA,GAAU,CAACC,aAAA,EAAeV,QAAY,KAAA;MAC/C,IAAIQ,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeV,QAAO,CAAA;MACrD;MAEA,MAAMW,UAAa,GAAAD,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAL,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAL,aAAA;IAAA,CACT;IAEO,OAAAP,UAAA;EAAA,CACT;AACF;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { dedupe } from '../array.mjs';
|
|
2
|
+
import patchUiComponentsAndIcons from './patch.mjs';
|
|
3
|
+
"use strict";
|
|
4
|
+
function withUbntLibraries(options) {
|
|
5
|
+
patchUiComponentsAndIcons();
|
|
6
|
+
const transpilePackages = [
|
|
7
|
+
// Extra libs
|
|
8
|
+
...(options?.transpilePackages ?? []),
|
|
9
|
+
// Core repos
|
|
10
|
+
"@ubnt/ui-components", "@ubnt/icons", "@ubnt/store.core",
|
|
11
|
+
// Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...
|
|
12
|
+
"lodash-es", "styled-components", "react-use", "convert-units"
|
|
13
|
+
// Currently as of 3.0.0-beta.5 caused prod build issues on consumer projects
|
|
14
|
+
];
|
|
15
|
+
return nextConfig => {
|
|
16
|
+
if (!nextConfig.experimental) {
|
|
17
|
+
nextConfig.experimental = {};
|
|
18
|
+
}
|
|
19
|
+
nextConfig.experimental.optimizePackageImports = dedupe([...(nextConfig.experimental.optimizePackageImports ?? []), ...transpilePackages]);
|
|
20
|
+
nextConfig.transpilePackages = dedupe([...(nextConfig.transpilePackages ?? []), ...transpilePackages]);
|
|
21
|
+
nextConfig.experimental.esmExternals = "loose";
|
|
22
|
+
const oldWebpackFn = nextConfig.webpack;
|
|
23
|
+
nextConfig.webpack = (webpackConfig, options2) => {
|
|
24
|
+
if (oldWebpackFn) {
|
|
25
|
+
webpackConfig = oldWebpackFn(webpackConfig, options2);
|
|
26
|
+
}
|
|
27
|
+
const jsExtIndex = webpackConfig.resolve.extensions.indexOf(".js");
|
|
28
|
+
const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(".mjs");
|
|
29
|
+
if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {
|
|
30
|
+
webpackConfig.resolve.extensions[jsExtIndex] = ".mjs";
|
|
31
|
+
webpackConfig.resolve.extensions[mjsExtIndex] = ".js";
|
|
32
|
+
}
|
|
33
|
+
return webpackConfig;
|
|
34
|
+
};
|
|
35
|
+
return nextConfig;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export { withUbntLibraries };
|
|
39
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.mjs","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport { dedupe } from \"../array\";\nimport patchUiComponentsAndIcons from \"./patch\";\n\nexport type WithUbntLibrariesConfig = {\n /**\n * ESM Modules to transpile\n */\n transpilePackages?: string[];\n};\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(options?: WithUbntLibrariesConfig) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Extra libs\n ...(options?.transpilePackages ?? []),\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n \"convert-units\", // Currently as of 3.0.0-beta.5 caused prod build issues on consumer projects\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = dedupe([\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ]);\n nextConfig.transpilePackages = dedupe([\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ]);\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","options","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","dedupe","esmExternals","oldWebpackFn","webpack","webpackConfig","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;;AAkBO,SAASA,kBAAkBC,OAAmC,EAAA;EAIzCC,yBAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,IAAIF,OAAS,EAAAE,iBAAA,IAAqB,EAAC;EAAA;EAEnC,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,EACA;EAAA;EAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACWD,UAAA,CAAAC,YAAA,CAAaC,yBAAyBC,MAAO,CAAA,CACtD,IAAIH,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACJ,CAAA;IACDC,UAAA,CAAWD,oBAAoBI,MAAO,CAAA,CACpC,IAAIH,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACJ,CAAA;IAWDC,UAAA,CAAWC,aAAaG,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeL,UAAW,CAAAM,OAAA;IACrBN,UAAA,CAAAM,OAAA,GAAU,CAACC,aAAA,EAAeV,QAAY,KAAA;MAC/C,IAAIQ,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeV,QAAO,CAAA;MACrD;MAEA,MAAMW,UAAa,GAAAD,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAL,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAL,aAAA;IAAA,CACT;IAEO,OAAAP,UAAA;EAAA,CACT;AACF;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name for the global object that will be used to store the SSR modules when injecting them into the page.
|
|
3
|
+
*/
|
|
4
|
+
export declare const SSR_INJECT_ID = "__styleInject_SSR_MODULES";
|
|
5
|
+
/**
|
|
6
|
+
* Data attribute that indicates that given `<style>` node was injected by us
|
|
7
|
+
*/
|
|
8
|
+
export declare const SSR_NODE_DATA_ID = "data-uic-style";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/utils/nextjs/ssr/constants.ts"],"sourcesContent":["// #############################################################################\n// ! If making changes make sure to update `style-inject.ts` as well\n// #############################################################################\n/**\n * Name for the global object that will be used to store the SSR modules when injecting them into the page.\n */\nexport const SSR_INJECT_ID = \"__styleInject_SSR_MODULES\";\n\n/**\n * Data attribute that indicates that given `<style>` node was injected by us\n */\nexport const SSR_NODE_DATA_ID = \"data-uic-style\";\n"],"names":["SSR_INJECT_ID","SSR_NODE_DATA_ID"],"mappings":";;;AAMO,MAAMA,aAAgB,GAAA,2BAAA;AAKtB,MAAMC,gBAAmB,GAAA,gBAAA;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../../src/utils/nextjs/ssr/constants.ts"],"sourcesContent":["// #############################################################################\n// ! If making changes make sure to update `style-inject.ts` as well\n// #############################################################################\n/**\n * Name for the global object that will be used to store the SSR modules when injecting them into the page.\n */\nexport const SSR_INJECT_ID = \"__styleInject_SSR_MODULES\";\n\n/**\n * Data attribute that indicates that given `<style>` node was injected by us\n */\nexport const SSR_NODE_DATA_ID = \"data-uic-style\";\n"],"names":["SSR_INJECT_ID","SSR_NODE_DATA_ID"],"mappings":";;AAMO,MAAMA,aAAgB,GAAA,2BAAA;AAKtB,MAAMC,gBAAmB,GAAA,gBAAA;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper to read injected styles from SSR and inject them into header so first-render is styled correctly.
|
|
3
|
+
* See `./style-inject.ts` for more info!
|
|
4
|
+
*
|
|
5
|
+
* Based on:
|
|
6
|
+
* @see https://github.com/egoist/style-inject/pull/28/files
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* \/**
|
|
10
|
+
* * Add styled-components server-side render support
|
|
11
|
+
* * Taken from https://github.com/vercel/next.js/blob/master/examples/with-styled-components/pages/_document.js
|
|
12
|
+
* *\/
|
|
13
|
+
* static override async getInitialProps(ctx: DocumentContext): Promise<{
|
|
14
|
+
* styles: JSX.Element;
|
|
15
|
+
* html: string;
|
|
16
|
+
* head?: (JSX.Element | null)[] | undefined;
|
|
17
|
+
* }> {
|
|
18
|
+
* const sheet = new ServerStyleSheet();
|
|
19
|
+
* const originalRenderPage = ctx.renderPage;
|
|
20
|
+
*
|
|
21
|
+
* try {
|
|
22
|
+
* ctx.renderPage = () =>
|
|
23
|
+
* originalRenderPage({
|
|
24
|
+
* enhanceApp: (App) =>
|
|
25
|
+
* function AppEnhanced(props) {
|
|
26
|
+
* return sheet.collectStyles(<App {...props} />);
|
|
27
|
+
* },
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* const initialProps = await Document.getInitialProps(ctx);
|
|
31
|
+
* return {
|
|
32
|
+
* ...initialProps,
|
|
33
|
+
* styles: (
|
|
34
|
+
* <>
|
|
35
|
+
* {\/**
|
|
36
|
+
* * Order of injecting important so we:
|
|
37
|
+
* * 1. Inject global css from next
|
|
38
|
+
* * 2. Inject ui-component styles
|
|
39
|
+
* * 3. Inject our styled-component styles (with possible overrides ui-component overrides)
|
|
40
|
+
* *\/}
|
|
41
|
+
* {initialProps.styles}
|
|
42
|
+
* <UiComponentsSsrStyleRegistry />
|
|
43
|
+
* {sheet.getStyleElement()}
|
|
44
|
+
* </>
|
|
45
|
+
* ),
|
|
46
|
+
* };
|
|
47
|
+
* } finally {
|
|
48
|
+
* sheet.seal();
|
|
49
|
+
* }
|
|
50
|
+
* }
|
|
51
|
+
*/
|
|
52
|
+
export declare const UiComponentsSsrStyleRegistryPagesRouter: import("react").NamedExoticComponent<object>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var constants = require('./constants.js');
|
|
6
|
+
"use strict";
|
|
7
|
+
const UiComponentsSsrStyleRegistryPagesRouter = react.memo(function UiComponentsSsrStyleRegistryPagesRouter2() {
|
|
8
|
+
const injections = globalThis[constants.SSR_INJECT_ID];
|
|
9
|
+
const injectionsExist = !!injections && Array.isArray(injections) && !!injections.length;
|
|
10
|
+
return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
11
|
+
children: [/* @__PURE__ */jsxRuntime.jsx("noscript", {
|
|
12
|
+
"data-uic-style": ""
|
|
13
|
+
}, "data-uic-reference"), injectionsExist && injections?.map(module => /* @__PURE__ */jsxRuntime.jsx("style", {
|
|
14
|
+
"data-uic-style": module.id,
|
|
15
|
+
dangerouslySetInnerHTML: {
|
|
16
|
+
__html: module.css
|
|
17
|
+
}
|
|
18
|
+
}, module.id))]
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
exports.UiComponentsSsrStyleRegistryPagesRouter = UiComponentsSsrStyleRegistryPagesRouter;
|
|
22
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sources":["../../../../src/utils/nextjs/ssr/registry.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { SSR_INJECT_ID } from \"./constants\";\nimport type { InjectedModule } from \"./types\";\n\n/**\n * Helper to read injected styles from SSR and inject them into header so first-render is styled correctly.\n * See `./style-inject.ts` for more info!\n *\n * Based on:\n * @see https://github.com/egoist/style-inject/pull/28/files\n *\n * @example\n * \\/**\n * * Add styled-components server-side render support\n * * Taken from https://github.com/vercel/next.js/blob/master/examples/with-styled-components/pages/_document.js\n * *\\/\n * static override async getInitialProps(ctx: DocumentContext): Promise<{\n * styles: JSX.Element;\n * html: string;\n * head?: (JSX.Element | null)[] | undefined;\n * }> {\n * const sheet = new ServerStyleSheet();\n * const originalRenderPage = ctx.renderPage;\n *\n * try {\n * ctx.renderPage = () =>\n * originalRenderPage({\n * enhanceApp: (App) =>\n * function AppEnhanced(props) {\n * return sheet.collectStyles(<App {...props} />);\n * },\n * });\n *\n * const initialProps = await Document.getInitialProps(ctx);\n * return {\n * ...initialProps,\n * styles: (\n * <>\n * {\\/**\n * * Order of injecting important so we:\n * * 1. Inject global css from next\n * * 2. Inject ui-component styles\n * * 3. Inject our styled-component styles (with possible overrides ui-component overrides)\n * *\\/}\n * {initialProps.styles}\n * <UiComponentsSsrStyleRegistry />\n * {sheet.getStyleElement()}\n * </>\n * ),\n * };\n * } finally {\n * sheet.seal();\n * }\n * }\n */\nexport const UiComponentsSsrStyleRegistryPagesRouter = memo(\n function UiComponentsSsrStyleRegistryPagesRouter() {\n // @ts-expect-error Dangerously accessing globalThis\n const injections = globalThis[SSR_INJECT_ID] as unknown as\n | InjectedModule[]\n | undefined;\n\n const injectionsExist =\n !!injections && Array.isArray(injections) && !!injections.length;\n\n // TODO: For app router will have to migrate to using `useServerInsertedHTML`, see\n // https://nextjs.org/docs/app/building-your-application/styling/css-in-js#styled-components\n\n // Create a style element for each injection\n return (\n <>\n {/* Empty style element as \"bookmark\" for style-inject to know for first insertion where to place first style tag */}\n <noscript data-uic-style=\"\" key=\"data-uic-reference\" />\n {injectionsExist &&\n injections?.map((module: { id: string; css: string }) => (\n <style\n data-uic-style={module.id}\n key={module.id}\n // Dangerouslt set inner HTML to inject the CSS to not escape `content: \"\"`\n dangerouslySetInnerHTML={{ __html: module.css }}\n />\n ))}\n </>\n );\n },\n);\n"],"names":["UiComponentsSsrStyleRegistryPagesRouter","memo","UiComponentsSsrStyleRegistryPagesRouter2","injections","globalThis","SSR_INJECT_ID","injectionsExist","Array","isArray","length","jsxs","Fragment","children","jsx","map","module","id","dangerouslySetInnerHTML","__html","css"],"mappings":";;;;;;AAwDO,MAAMA,uCAA0C,GAAAC,KAAA,CAAAA,IAAA,CACrD,SAASD,wCAA0CE,CAAA,EAAA;EAE3C,MAAAC,UAAA,GAAaC,WAAWC,SAAAA,CAAAA,aAAa,CAAA;EAIrC,MAAAC,eAAA,GACJ,CAAC,CAACH,UAAc,IAAAI,KAAA,CAAMC,QAAQL,UAAU,CAAA,IAAK,CAAC,CAACA,UAAW,CAAAM,MAAA;EAM5D,sBAGIC,UAAA,CAAAA,IAAA,CAAAC,mBAAA,EAAA;IAAAC,QAAA,EAAA,CAACC,eAAAA,UAAAA,CAAAA,GAAA,CAAA,UAAA,EAAA;MAAS,gBAAe,EAAA;IAAA,CAAA,EAAO,oBAAqB,CAAA,EACpDP,eACC,IAAAH,UAAA,EAAYW,GAAI,CAACC,MACf,IAAA,eAAAF,UAAA,CAAAA,GAAA,CAAC,OAAA,EAAA;MACC,kBAAgBE,MAAO,CAAAC,EAAA;MAGvBC,uBAAyB,EAAA;QAAEC,MAAQ,EAAAH,MAAA,CAAOI;MAAI;IAAA,CAAA,EAFzCJ,MAAO,CAAAC,EAAA,CAIf,CAAA;EACL,CAAA,CAAA;AAEJ,CACF,CAAA;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { SSR_INJECT_ID } from './constants.mjs';
|
|
4
|
+
"use strict";
|
|
5
|
+
const UiComponentsSsrStyleRegistryPagesRouter = memo(function UiComponentsSsrStyleRegistryPagesRouter2() {
|
|
6
|
+
const injections = globalThis[SSR_INJECT_ID];
|
|
7
|
+
const injectionsExist = !!injections && Array.isArray(injections) && !!injections.length;
|
|
8
|
+
return /* @__PURE__ */jsxs(Fragment, {
|
|
9
|
+
children: [/* @__PURE__ */jsx("noscript", {
|
|
10
|
+
"data-uic-style": ""
|
|
11
|
+
}, "data-uic-reference"), injectionsExist && injections?.map(module => /* @__PURE__ */jsx("style", {
|
|
12
|
+
"data-uic-style": module.id,
|
|
13
|
+
dangerouslySetInnerHTML: {
|
|
14
|
+
__html: module.css
|
|
15
|
+
}
|
|
16
|
+
}, module.id))]
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
export { UiComponentsSsrStyleRegistryPagesRouter };
|
|
20
|
+
//# sourceMappingURL=registry.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.mjs","sources":["../../../../src/utils/nextjs/ssr/registry.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { SSR_INJECT_ID } from \"./constants\";\nimport type { InjectedModule } from \"./types\";\n\n/**\n * Helper to read injected styles from SSR and inject them into header so first-render is styled correctly.\n * See `./style-inject.ts` for more info!\n *\n * Based on:\n * @see https://github.com/egoist/style-inject/pull/28/files\n *\n * @example\n * \\/**\n * * Add styled-components server-side render support\n * * Taken from https://github.com/vercel/next.js/blob/master/examples/with-styled-components/pages/_document.js\n * *\\/\n * static override async getInitialProps(ctx: DocumentContext): Promise<{\n * styles: JSX.Element;\n * html: string;\n * head?: (JSX.Element | null)[] | undefined;\n * }> {\n * const sheet = new ServerStyleSheet();\n * const originalRenderPage = ctx.renderPage;\n *\n * try {\n * ctx.renderPage = () =>\n * originalRenderPage({\n * enhanceApp: (App) =>\n * function AppEnhanced(props) {\n * return sheet.collectStyles(<App {...props} />);\n * },\n * });\n *\n * const initialProps = await Document.getInitialProps(ctx);\n * return {\n * ...initialProps,\n * styles: (\n * <>\n * {\\/**\n * * Order of injecting important so we:\n * * 1. Inject global css from next\n * * 2. Inject ui-component styles\n * * 3. Inject our styled-component styles (with possible overrides ui-component overrides)\n * *\\/}\n * {initialProps.styles}\n * <UiComponentsSsrStyleRegistry />\n * {sheet.getStyleElement()}\n * </>\n * ),\n * };\n * } finally {\n * sheet.seal();\n * }\n * }\n */\nexport const UiComponentsSsrStyleRegistryPagesRouter = memo(\n function UiComponentsSsrStyleRegistryPagesRouter() {\n // @ts-expect-error Dangerously accessing globalThis\n const injections = globalThis[SSR_INJECT_ID] as unknown as\n | InjectedModule[]\n | undefined;\n\n const injectionsExist =\n !!injections && Array.isArray(injections) && !!injections.length;\n\n // TODO: For app router will have to migrate to using `useServerInsertedHTML`, see\n // https://nextjs.org/docs/app/building-your-application/styling/css-in-js#styled-components\n\n // Create a style element for each injection\n return (\n <>\n {/* Empty style element as \"bookmark\" for style-inject to know for first insertion where to place first style tag */}\n <noscript data-uic-style=\"\" key=\"data-uic-reference\" />\n {injectionsExist &&\n injections?.map((module: { id: string; css: string }) => (\n <style\n data-uic-style={module.id}\n key={module.id}\n // Dangerouslt set inner HTML to inject the CSS to not escape `content: \"\"`\n dangerouslySetInnerHTML={{ __html: module.css }}\n />\n ))}\n </>\n );\n },\n);\n"],"names":["UiComponentsSsrStyleRegistryPagesRouter","memo","UiComponentsSsrStyleRegistryPagesRouter2","injections","globalThis","SSR_INJECT_ID","injectionsExist","Array","isArray","length","jsxs","Fragment","children","jsx","map","module","id","dangerouslySetInnerHTML","__html","css"],"mappings":";;;;AAwDO,MAAMA,uCAA0C,GAAAC,IAAA,CACrD,SAASD,wCAA0CE,CAAA,EAAA;EAE3C,MAAAC,UAAA,GAAaC,WAAWC,aAAa,CAAA;EAIrC,MAAAC,eAAA,GACJ,CAAC,CAACH,UAAc,IAAAI,KAAA,CAAMC,QAAQL,UAAU,CAAA,IAAK,CAAC,CAACA,UAAW,CAAAM,MAAA;EAM5D,sBAGIC,IAAA,CAAAC,QAAA,EAAA;IAAAC,QAAA,EAAA,CAAC,eAAAC,GAAA,CAAA,UAAA,EAAA;MAAS,gBAAe,EAAA;IAAA,CAAA,EAAO,oBAAqB,CAAA,EACpDP,eACC,IAAAH,UAAA,EAAYW,GAAI,CAACC,MACf,IAAA,eAAAF,GAAA,CAAC,OAAA,EAAA;MACC,kBAAgBE,MAAO,CAAAC,EAAA;MAGvBC,uBAAyB,EAAA;QAAEC,MAAQ,EAAAH,MAAA,CAAOI;MAAI;IAAA,CAAA,EAFzCJ,MAAO,CAAAC,EAAA,CAIf,CAAA;EACL,CAAA,CAAA;AAEJ,CACF,CAAA;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type InjectedModule = {
|
|
2
|
+
/**
|
|
3
|
+
* The ID of the style tag (typically some stable unique hash derived CSS content)
|
|
4
|
+
*/
|
|
5
|
+
id: string;
|
|
6
|
+
/**
|
|
7
|
+
* The CSS string to inject
|
|
8
|
+
*/
|
|
9
|
+
css: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Util to inject styles into the DOM, this is a patched version of the original styled-inject.
|
|
13
|
+
*
|
|
14
|
+
* @see https://github.com/ubiquiti/shared-ui.ui-components/blob/develop/rollup.config.js
|
|
15
|
+
* @see https://github.com/ubiquiti/shared-ui.ui-components/blob/develop/scripts/rollup-plugin-local-style-inject.js
|
|
16
|
+
* @see https://github.com/ubiquiti/shared-ui.ui-components/blob/develop/src/docs/helpers/style-inject.es.js
|
|
17
|
+
* - Original styled-inject: https://github.com/egoist/style-inject/blob/master/src/index.js
|
|
18
|
+
* - SSR Patch: https://github.com/egoist/style-inject/pull/28/files
|
|
19
|
+
*/
|
|
20
|
+
export default function styleInject(css: InjectedModule["css"], id: InjectedModule["id"]): void;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
"use strict";
|
|
7
|
+
const SSR_INJECT_ID = "__styleInject_SSR_MODULES";
|
|
8
|
+
const SSR_NODE_DATA_ID = "data-uic-style";
|
|
9
|
+
function styleInject(css, id) {
|
|
10
|
+
if (!css) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (!globalThis[SSR_INJECT_ID]) {
|
|
14
|
+
globalThis[SSR_INJECT_ID] = [];
|
|
15
|
+
}
|
|
16
|
+
if (globalThis[SSR_INJECT_ID].find(item => item.id === id)) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
globalThis[SSR_INJECT_ID].push({
|
|
20
|
+
id,
|
|
21
|
+
css
|
|
22
|
+
});
|
|
23
|
+
if (typeof document === "undefined") {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const injectedStyles = document.head.querySelectorAll(`:scope > [${SSR_NODE_DATA_ID}]`);
|
|
27
|
+
const injectedStylesLength = injectedStyles.length;
|
|
28
|
+
for (let i = 0; i < injectedStylesLength; i++) {
|
|
29
|
+
const style2 = injectedStyles[i];
|
|
30
|
+
if (!!style2 && style2.getAttribute(SSR_NODE_DATA_ID) === id) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const style = document.createElement("style");
|
|
35
|
+
style.setAttribute(SSR_NODE_DATA_ID, id);
|
|
36
|
+
style.innerHTML = css;
|
|
37
|
+
if (injectedStylesLength) {
|
|
38
|
+
const lastStyle = injectedStyles[injectedStylesLength - 1];
|
|
39
|
+
if (lastStyle) {
|
|
40
|
+
lastStyle.after(style);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
document.head.appendChild(style);
|
|
45
|
+
}
|
|
46
|
+
exports["default"] = styleInject;
|
|
47
|
+
//# sourceMappingURL=style-inject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-inject.js","sources":["../../../../src/utils/nextjs/ssr/style-inject.ts"],"sourcesContent":["// #############################################################################\n// ! This file can't contain any imports, as it's copy-pasted into the bundled code!\n// #############################################################################\n\n/**\n * Name for the global object that will be used to store the SSR modules when injecting them into the page.\n */\nconst SSR_INJECT_ID = \"__styleInject_SSR_MODULES\";\n\n/**\n * Data attribute that indicates that given `<style>` node was injected by us\n */\nconst SSR_NODE_DATA_ID = \"data-uic-style\";\n\ntype InjectedModule = {\n /**\n * The ID of the style tag (typically some stable unique hash derived CSS content)\n */\n id: string;\n /**\n * The CSS string to inject\n */\n css: string;\n};\n\n// #############################################################################\n\n/**\n * Util to inject styles into the DOM, this is a patched version of the original styled-inject.\n *\n * @see https://github.com/ubiquiti/shared-ui.ui-components/blob/develop/rollup.config.js\n * @see https://github.com/ubiquiti/shared-ui.ui-components/blob/develop/scripts/rollup-plugin-local-style-inject.js\n * @see https://github.com/ubiquiti/shared-ui.ui-components/blob/develop/src/docs/helpers/style-inject.es.js\n * - Original styled-inject: https://github.com/egoist/style-inject/blob/master/src/index.js\n * - SSR Patch: https://github.com/egoist/style-inject/pull/28/files\n */\nexport default function styleInject(\n css: InjectedModule[\"css\"],\n id: InjectedModule[\"id\"],\n) {\n // Nothing to inject\n if (!css) {\n return;\n }\n\n // Patch missing global variable\n // @ts-expect-error Dangerously accessing globalThis\n if (!globalThis[SSR_INJECT_ID]) {\n // @ts-expect-error Dangerously accessing globalThis\n globalThis[SSR_INJECT_ID] = [];\n }\n\n // Exit early if the style is already injected/registered\n // @ts-expect-error Dangerously accessing globalThis\n if (globalThis[SSR_INJECT_ID].find((item) => item.id === id)) {\n return;\n }\n\n // Register the injected module\n // @ts-expect-error Dangerously accessing globalThis\n globalThis[SSR_INJECT_ID].push({ id, css });\n\n // Exit early as we can't inject styles on the server, registering is enough\n if (typeof document === \"undefined\") {\n return;\n }\n\n // Try to find either bookmark `<noscript/>` or last injected `<style/>`\n const injectedStyles = document.head.querySelectorAll(\n `:scope > [${SSR_NODE_DATA_ID}]`,\n );\n const injectedStylesLength = injectedStyles.length;\n\n // Check if the style is already injected and return early if needed\n for (let i = 0; i < injectedStylesLength; i++) {\n const style = injectedStyles[i];\n\n if (!!style && style.getAttribute(SSR_NODE_DATA_ID) === id) {\n return;\n }\n }\n\n // Create a style tag\n const style = document.createElement(\"style\");\n // Set a data element so for next DOM inject we can append to the last element we appended\n style.setAttribute(SSR_NODE_DATA_ID, id);\n /**\n * Experimented with various ways of injecting the CSS as many approaches escapes certain CSS. E.g. `content: \"\";` -->\n * `content:&qout;&qout;;;` which would partially break the given style tag and cause random layout issues as partial\n * styles would be applied.\n *\n * - Didn't work as escaped the CSS content:\n * - `style.textContent = css;`\n * - `style.innerText = css;`\n * Old way:\n * - `style.styleSheet.cssText = css`\n * Worked:\n * - `style.innerHTML = css;\n * TODO: maybe in 2025 look at `CSSStyleSheet` constructor and `insertRule` method - https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet\n */\n style.innerHTML = css;\n\n // Attempt to append the style (to preserve overriding logic with styled-components)\n if (injectedStylesLength) {\n const lastStyle = injectedStyles[injectedStylesLength - 1];\n\n if (lastStyle) {\n lastStyle.after(style);\n return;\n }\n }\n\n // If that didn't work append to end of head (should have been handled by the bookmark, but just in case)\n document.head.appendChild(style);\n}\n"],"names":["SSR_INJECT_ID","SSR_NODE_DATA_ID","styleInject","css","id","globalThis","find","item","push","document","injectedStyles","head","querySelectorAll","injectedStylesLength","length","i","style","getAttribute","createElement","setAttribute","innerHTML","lastStyle","after","appendChild"],"mappings":";;;;;;AAOA,MAAMA,aAAgB,GAAA,2BAAA;AAKtB,MAAMC,gBAAmB,GAAA,gBAAA;AAwBD,SAAAC,WAAAA,CACtBC,KACAC,EACA,EAAA;EAEA,IAAI,CAACD,GAAK,EAAA;IACR;EACF;EAII,IAAA,CAACE,UAAW,CAAAL,aAAa,CAAG,EAAA;IAEnBK,UAAA,CAAAL,aAAa,IAAI,EAAC;EAC/B;EAII,IAAAK,UAAA,CAAWL,aAAa,CAAE,CAAAM,IAAA,CAAMC,IAAS,IAAAA,IAAA,CAAKH,EAAO,KAAAA,EAAE,CAAG,EAAA;IAC5D;EACF;EAIAC,UAAA,CAAWL,aAAa,CAAE,CAAAQ,IAAA,CAAK;IAAEJ,EAAA;IAAID;GAAK,CAAA;EAGtC,IAAA,OAAOM,aAAa,WAAa,EAAA;IACnC;EACF;EAGM,MAAAC,cAAA,GAAiBD,SAASE,IAAK,CAAAC,gBAAA,CACnC,aAAaX,gBAAgB,GAAA,CAC/B;EACA,MAAMY,uBAAuBH,cAAe,CAAAI,MAAA;EAG5C,KAAA,IAASC,CAAI,GAAA,CAAA,EAAGA,CAAI,GAAAF,oBAAA,EAAsBE,CAAK,EAAA,EAAA;IACvCC,MAAAA,MAAAA,GAAQN,eAAeK,CAAC,CAAA;IAE9B,IAAI,CAAC,CAACC,MAAAA,IAASA,OAAMC,YAAa,CAAAhB,gBAAgB,MAAMG,EAAI,EAAA;MAC1D;IACF;EACF;EAGM,MAAAY,KAAA,GAAQP,QAAS,CAAAS,aAAA,CAAc,OAAO,CAAA;EAEtCF,KAAA,CAAAG,YAAA,CAAalB,kBAAkBG,EAAE,CAAA;EAevCY,KAAA,CAAMI,SAAY,GAAAjB,GAAA;EAGlB,IAAIU,oBAAsB,EAAA;IAClB,MAAAQ,SAAA,GAAYX,cAAe,CAAAG,oBAAA,GAAuB,CAAC,CAAA;IAEzD,IAAIQ,SAAW,EAAA;MACbA,SAAA,CAAUC,MAAMN,KAAK,CAAA;MACrB;IACF;EACF;EAGSP,QAAA,CAAAE,IAAA,CAAKY,YAAYP,KAAK,CAAA;AACjC;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const SSR_INJECT_ID = "__styleInject_SSR_MODULES";
|
|
4
|
+
const SSR_NODE_DATA_ID = "data-uic-style";
|
|
5
|
+
function styleInject(css, id) {
|
|
6
|
+
if (!css) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (!globalThis[SSR_INJECT_ID]) {
|
|
10
|
+
globalThis[SSR_INJECT_ID] = [];
|
|
11
|
+
}
|
|
12
|
+
if (globalThis[SSR_INJECT_ID].find(item => item.id === id)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
globalThis[SSR_INJECT_ID].push({
|
|
16
|
+
id,
|
|
17
|
+
css
|
|
18
|
+
});
|
|
19
|
+
if (typeof document === "undefined") {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const injectedStyles = document.head.querySelectorAll(`:scope > [${SSR_NODE_DATA_ID}]`);
|
|
23
|
+
const injectedStylesLength = injectedStyles.length;
|
|
24
|
+
for (let i = 0; i < injectedStylesLength; i++) {
|
|
25
|
+
const style2 = injectedStyles[i];
|
|
26
|
+
if (!!style2 && style2.getAttribute(SSR_NODE_DATA_ID) === id) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const style = document.createElement("style");
|
|
31
|
+
style.setAttribute(SSR_NODE_DATA_ID, id);
|
|
32
|
+
style.innerHTML = css;
|
|
33
|
+
if (injectedStylesLength) {
|
|
34
|
+
const lastStyle = injectedStyles[injectedStylesLength - 1];
|
|
35
|
+
if (lastStyle) {
|
|
36
|
+
lastStyle.after(style);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
document.head.appendChild(style);
|
|
41
|
+
}
|
|
42
|
+
export { styleInject as default };
|
|
43
|
+
//# sourceMappingURL=style-inject.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-inject.mjs","sources":["../../../../src/utils/nextjs/ssr/style-inject.ts"],"sourcesContent":["// #############################################################################\n// ! This file can't contain any imports, as it's copy-pasted into the bundled code!\n// #############################################################################\n\n/**\n * Name for the global object that will be used to store the SSR modules when injecting them into the page.\n */\nconst SSR_INJECT_ID = \"__styleInject_SSR_MODULES\";\n\n/**\n * Data attribute that indicates that given `<style>` node was injected by us\n */\nconst SSR_NODE_DATA_ID = \"data-uic-style\";\n\ntype InjectedModule = {\n /**\n * The ID of the style tag (typically some stable unique hash derived CSS content)\n */\n id: string;\n /**\n * The CSS string to inject\n */\n css: string;\n};\n\n// #############################################################################\n\n/**\n * Util to inject styles into the DOM, this is a patched version of the original styled-inject.\n *\n * @see https://github.com/ubiquiti/shared-ui.ui-components/blob/develop/rollup.config.js\n * @see https://github.com/ubiquiti/shared-ui.ui-components/blob/develop/scripts/rollup-plugin-local-style-inject.js\n * @see https://github.com/ubiquiti/shared-ui.ui-components/blob/develop/src/docs/helpers/style-inject.es.js\n * - Original styled-inject: https://github.com/egoist/style-inject/blob/master/src/index.js\n * - SSR Patch: https://github.com/egoist/style-inject/pull/28/files\n */\nexport default function styleInject(\n css: InjectedModule[\"css\"],\n id: InjectedModule[\"id\"],\n) {\n // Nothing to inject\n if (!css) {\n return;\n }\n\n // Patch missing global variable\n // @ts-expect-error Dangerously accessing globalThis\n if (!globalThis[SSR_INJECT_ID]) {\n // @ts-expect-error Dangerously accessing globalThis\n globalThis[SSR_INJECT_ID] = [];\n }\n\n // Exit early if the style is already injected/registered\n // @ts-expect-error Dangerously accessing globalThis\n if (globalThis[SSR_INJECT_ID].find((item) => item.id === id)) {\n return;\n }\n\n // Register the injected module\n // @ts-expect-error Dangerously accessing globalThis\n globalThis[SSR_INJECT_ID].push({ id, css });\n\n // Exit early as we can't inject styles on the server, registering is enough\n if (typeof document === \"undefined\") {\n return;\n }\n\n // Try to find either bookmark `<noscript/>` or last injected `<style/>`\n const injectedStyles = document.head.querySelectorAll(\n `:scope > [${SSR_NODE_DATA_ID}]`,\n );\n const injectedStylesLength = injectedStyles.length;\n\n // Check if the style is already injected and return early if needed\n for (let i = 0; i < injectedStylesLength; i++) {\n const style = injectedStyles[i];\n\n if (!!style && style.getAttribute(SSR_NODE_DATA_ID) === id) {\n return;\n }\n }\n\n // Create a style tag\n const style = document.createElement(\"style\");\n // Set a data element so for next DOM inject we can append to the last element we appended\n style.setAttribute(SSR_NODE_DATA_ID, id);\n /**\n * Experimented with various ways of injecting the CSS as many approaches escapes certain CSS. E.g. `content: \"\";` -->\n * `content:&qout;&qout;;;` which would partially break the given style tag and cause random layout issues as partial\n * styles would be applied.\n *\n * - Didn't work as escaped the CSS content:\n * - `style.textContent = css;`\n * - `style.innerText = css;`\n * Old way:\n * - `style.styleSheet.cssText = css`\n * Worked:\n * - `style.innerHTML = css;\n * TODO: maybe in 2025 look at `CSSStyleSheet` constructor and `insertRule` method - https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet\n */\n style.innerHTML = css;\n\n // Attempt to append the style (to preserve overriding logic with styled-components)\n if (injectedStylesLength) {\n const lastStyle = injectedStyles[injectedStylesLength - 1];\n\n if (lastStyle) {\n lastStyle.after(style);\n return;\n }\n }\n\n // If that didn't work append to end of head (should have been handled by the bookmark, but just in case)\n document.head.appendChild(style);\n}\n"],"names":["SSR_INJECT_ID","SSR_NODE_DATA_ID","styleInject","css","id","globalThis","find","item","push","document","injectedStyles","head","querySelectorAll","injectedStylesLength","length","i","style","getAttribute","createElement","setAttribute","innerHTML","lastStyle","after","appendChild"],"mappings":";;AAOA,MAAMA,aAAgB,GAAA,2BAAA;AAKtB,MAAMC,gBAAmB,GAAA,gBAAA;AAwBD,SAAAC,WAAAA,CACtBC,KACAC,EACA,EAAA;EAEA,IAAI,CAACD,GAAK,EAAA;IACR;EACF;EAII,IAAA,CAACE,UAAW,CAAAL,aAAa,CAAG,EAAA;IAEnBK,UAAA,CAAAL,aAAa,IAAI,EAAC;EAC/B;EAII,IAAAK,UAAA,CAAWL,aAAa,CAAE,CAAAM,IAAA,CAAMC,IAAS,IAAAA,IAAA,CAAKH,EAAO,KAAAA,EAAE,CAAG,EAAA;IAC5D;EACF;EAIAC,UAAA,CAAWL,aAAa,CAAE,CAAAQ,IAAA,CAAK;IAAEJ,EAAA;IAAID;GAAK,CAAA;EAGtC,IAAA,OAAOM,aAAa,WAAa,EAAA;IACnC;EACF;EAGM,MAAAC,cAAA,GAAiBD,SAASE,IAAK,CAAAC,gBAAA,CACnC,aAAaX,gBAAgB,GAAA,CAC/B;EACA,MAAMY,uBAAuBH,cAAe,CAAAI,MAAA;EAG5C,KAAA,IAASC,CAAI,GAAA,CAAA,EAAGA,CAAI,GAAAF,oBAAA,EAAsBE,CAAK,EAAA,EAAA;IACvCC,MAAAA,MAAAA,GAAQN,eAAeK,CAAC,CAAA;IAE9B,IAAI,CAAC,CAACC,MAAAA,IAASA,OAAMC,YAAa,CAAAhB,gBAAgB,MAAMG,EAAI,EAAA;MAC1D;IACF;EACF;EAGM,MAAAY,KAAA,GAAQP,QAAS,CAAAS,aAAA,CAAc,OAAO,CAAA;EAEtCF,KAAA,CAAAG,YAAA,CAAalB,kBAAkBG,EAAE,CAAA;EAevCY,KAAA,CAAMI,SAAY,GAAAjB,GAAA;EAGlB,IAAIU,oBAAsB,EAAA;IAClB,MAAAQ,SAAA,GAAYX,cAAe,CAAAG,oBAAA,GAAuB,CAAC,CAAA;IAEzD,IAAIQ,SAAW,EAAA;MACbA,SAAA,CAAUC,MAAMN,KAAK,CAAA;MACrB;IACF;EACF;EAGSP,QAAA,CAAAE,IAAA,CAAKY,YAAYP,KAAK,CAAA;AACjC;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PluginObj } from "@babel/core";
|
|
2
|
+
type Plugin = PluginObj<{
|
|
3
|
+
defaultImportName: null | string;
|
|
4
|
+
}>;
|
|
5
|
+
/**
|
|
6
|
+
* FIXME: Currently this plugin won't:
|
|
7
|
+
* - Handle existing source maps correctly and would strip from the output: "//#
|
|
8
|
+
* sourceMappingURL=BubbleContainer.module.css.js.map"
|
|
9
|
+
*/
|
|
10
|
+
export declare const transformCssModule: () => Plugin;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var t = require('@babel/types');
|
|
4
|
+
var crypto = require('node:crypto');
|
|
5
|
+
function _interopDefault(e) {
|
|
6
|
+
return e && e.__esModule ? e : {
|
|
7
|
+
default: e
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
Object.keys(e).forEach(function (k) {
|
|
15
|
+
if (k !== 'default') {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return e[k];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n["default"] = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
var t__namespace = /*#__PURE__*/_interopNamespace(t);
|
|
30
|
+
var crypto__default = /*#__PURE__*/_interopDefault(crypto);
|
|
31
|
+
"use strict";
|
|
32
|
+
function generateMd5(input) {
|
|
33
|
+
return crypto__default["default"].createHash("md5").update(input).digest("hex");
|
|
34
|
+
}
|
|
35
|
+
const transformCssModule = () => {
|
|
36
|
+
return {
|
|
37
|
+
visitor: {
|
|
38
|
+
// Step 0: Setup state
|
|
39
|
+
Program(_path, state) {
|
|
40
|
+
state["defaultImportName"] = null;
|
|
41
|
+
},
|
|
42
|
+
// Step 1: Find the default import from "style-inject.es.js"
|
|
43
|
+
ImportDeclaration(path, state) {
|
|
44
|
+
if (state["defaultImportName"]) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const importSource = path.node.source.value;
|
|
48
|
+
if (!importSource.endsWith("style-inject.es.js")) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const defaultSpecifier = path.node.specifiers.find(specifier => t__namespace.isImportDefaultSpecifier(specifier));
|
|
52
|
+
if (defaultSpecifier) {
|
|
53
|
+
state["defaultImportName"] = defaultSpecifier.local.name;
|
|
54
|
+
} else {
|
|
55
|
+
throw new Error("Import for `style-inject.es.js` file not found in file");
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
// Step 2: Find all calls to the imported identifier
|
|
59
|
+
CallExpression(path, state) {
|
|
60
|
+
if (!state["defaultImportName"]) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const callee = path.node.callee;
|
|
64
|
+
if (t__namespace.isIdentifier(callee) && callee.name === state["defaultImportName"]) {
|
|
65
|
+
const args = path.node.arguments;
|
|
66
|
+
if (!(args.length >= 1 && args.length <= 2)) {
|
|
67
|
+
throw new Error("Unexpected number of arguments");
|
|
68
|
+
}
|
|
69
|
+
if (!((t__namespace.isStringLiteral(args[0]) || t__namespace.isIdentifier(args[0])) && (!args[1] || t__namespace.isStringLiteral(args[1])))) {
|
|
70
|
+
throw new Error("Unexpected argument types");
|
|
71
|
+
}
|
|
72
|
+
let cssString = "";
|
|
73
|
+
if (t__namespace.isStringLiteral(args[0])) {
|
|
74
|
+
cssString = args[0].value;
|
|
75
|
+
let reusedVariable = null;
|
|
76
|
+
path.scope.path.traverse({
|
|
77
|
+
VariableDeclarator(variablePath) {
|
|
78
|
+
const {
|
|
79
|
+
id,
|
|
80
|
+
init
|
|
81
|
+
} = variablePath.node;
|
|
82
|
+
if (t__namespace.isStringLiteral(init, {
|
|
83
|
+
value: cssString
|
|
84
|
+
})) {
|
|
85
|
+
reusedVariable = id;
|
|
86
|
+
variablePath.stop();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
if (reusedVariable) {
|
|
91
|
+
path.node.arguments[0] = reusedVariable;
|
|
92
|
+
}
|
|
93
|
+
} else if (t__namespace.isIdentifier(args[0])) {
|
|
94
|
+
const binding = path.scope.getBinding(args[0].name);
|
|
95
|
+
if (binding && t__namespace.isVariableDeclarator(binding.path.node) && t__namespace.isStringLiteral(binding.path.node.init)) {
|
|
96
|
+
cssString = binding.path.node.init.value;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (!cssString) {
|
|
100
|
+
throw new Error("Invalid first argument value");
|
|
101
|
+
}
|
|
102
|
+
const hash = generateMd5(cssString);
|
|
103
|
+
const hashArg = t__namespace.stringLiteral(hash);
|
|
104
|
+
if (args.length > 1) {
|
|
105
|
+
args[1] = hashArg;
|
|
106
|
+
} else {
|
|
107
|
+
args.push(hashArg);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
exports.transformCssModule = transformCssModule;
|
|
115
|
+
//# sourceMappingURL=transform-css-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-css-module.js","sources":["../../../../src/utils/nextjs/ssr/transform-css-module.ts"],"sourcesContent":["import type { PluginObj } from \"@babel/core\";\nimport * as t from \"@babel/types\";\nimport crypto from \"node:crypto\";\n\nfunction generateMd5(input: string): string {\n return crypto.createHash(\"md5\").update(input).digest(\"hex\");\n}\n\ntype Plugin = PluginObj<{\n // Store the name of the default import identifier for \"style-inject.es.js\"\n defaultImportName: null | string;\n}>;\n\n/**\n * FIXME: Currently this plugin won't:\n * - Handle existing source maps correctly and would strip from the output: \"//#\n * sourceMappingURL=BubbleContainer.module.css.js.map\"\n */\nexport const transformCssModule = (): Plugin => {\n return {\n visitor: {\n // Step 0: Setup state\n Program(_path, state) {\n state[\"defaultImportName\"] = null;\n },\n // Step 1: Find the default import from \"style-inject.es.js\"\n ImportDeclaration(path, state) {\n // Skip, if the default import name is already found (assuming there is only one per-file)\n if (state[\"defaultImportName\"]) {\n return;\n }\n\n // Look for imports for \"style-inject.es.js\" file\n const importSource = path.node.source.value;\n if (!importSource.endsWith(\"style-inject.es.js\")) {\n return;\n }\n\n // Check for default import specifier\n const defaultSpecifier = path.node.specifiers.find((specifier) =>\n t.isImportDefaultSpecifier(specifier),\n ) as t.ImportDefaultSpecifier | undefined;\n\n // Store the default import name\n if (defaultSpecifier) {\n // Fail if two instances of file is found\n state[\"defaultImportName\"] = defaultSpecifier.local.name;\n } else {\n throw new Error(\n \"Import for `style-inject.es.js` file not found in file\",\n );\n }\n },\n\n // Step 2: Find all calls to the imported identifier\n CallExpression(path, state) {\n // Ignore if the default import name is not found\n if (!state[\"defaultImportName\"]) {\n return;\n }\n\n // Check if the callee is the default import identifier\n const callee = path.node.callee;\n if (\n t.isIdentifier(callee) &&\n callee.name === state[\"defaultImportName\"]\n ) {\n const args = path.node.arguments;\n\n // If arguments are not between 1 and 2, fail\n if (!(args.length >= 1 && args.length <= 2)) {\n throw new Error(\"Unexpected number of arguments\");\n }\n\n /**\n * Validates that the function arguments are:\n * 1. needs to be a string literal or variable holding string\n * 2. (optional) string literal\n */\n if (\n !(\n (t.isStringLiteral(args[0]) || t.isIdentifier(args[0])) &&\n (!args[1] || t.isStringLiteral(args[1]))\n )\n ) {\n throw new Error(\"Unexpected argument types\");\n }\n\n // CSS string\n let cssString: string = \"\";\n\n // Try to remove duplicate string literal as first argument and instead re-use the a already generated variable\n if (t.isStringLiteral(args[0])) {\n cssString = args[0].value;\n\n let reusedVariable = null;\n path.scope.path.traverse({\n VariableDeclarator(variablePath) {\n const { id, init } = variablePath.node;\n\n // Match variables initialized with the same string value.\n if (t.isStringLiteral(init, { value: cssString })) {\n reusedVariable = id;\n variablePath.stop(); // Stop traversing once a match is found.\n }\n },\n });\n\n // Replace the string literal with the existing variable reference.\n if (reusedVariable) {\n path.node.arguments[0] = reusedVariable;\n }\n } else if (t.isIdentifier(args[0])) {\n // Extract value from variable\n const binding = path.scope.getBinding(args[0].name);\n if (\n binding &&\n t.isVariableDeclarator(binding.path.node) &&\n t.isStringLiteral(binding.path.node.init)\n ) {\n cssString = binding.path.node.init.value;\n }\n }\n\n if (!cssString) {\n throw new Error(\"Invalid first argument value\");\n }\n\n // Generate MD5 hash of the first argument's value\n // TODO: Looked into that styled-components use murmurhash. Also it's possible to use sha1 for longer key\n // (less % of collision)\n const hash = generateMd5(cssString);\n\n // Add the hash as the second argument\n const hashArg = t.stringLiteral(hash);\n if (args.length > 1) {\n // If a second argument exists, replace it\n args[1] = hashArg;\n } else {\n // Otherwise, add it as a new second argument\n args.push(hashArg);\n }\n }\n },\n },\n } satisfies Plugin;\n};\n"],"names":["generateMd5","input","crypto","createHash","update","digest","transformCssModule","visitor","Program","_path","state","ImportDeclaration","path","importSource","node","source","value","endsWith","defaultSpecifier","specifiers","find","specifier","t","isImportDefaultSpecifier","local","name","Error","CallExpression","callee","isIdentifier","args","arguments","length","isStringLiteral","cssString","reusedVariable","scope","traverse","VariableDeclarator","variablePath","id","init","stop","binding","getBinding","isVariableDeclarator","hash","hashArg","stringLiteral","push"],"mappings":"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"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import crypto from 'node:crypto';
|
|
3
|
+
"use strict";
|
|
4
|
+
function generateMd5(input) {
|
|
5
|
+
return crypto.createHash("md5").update(input).digest("hex");
|
|
6
|
+
}
|
|
7
|
+
const transformCssModule = () => {
|
|
8
|
+
return {
|
|
9
|
+
visitor: {
|
|
10
|
+
// Step 0: Setup state
|
|
11
|
+
Program(_path, state) {
|
|
12
|
+
state["defaultImportName"] = null;
|
|
13
|
+
},
|
|
14
|
+
// Step 1: Find the default import from "style-inject.es.js"
|
|
15
|
+
ImportDeclaration(path, state) {
|
|
16
|
+
if (state["defaultImportName"]) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const importSource = path.node.source.value;
|
|
20
|
+
if (!importSource.endsWith("style-inject.es.js")) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const defaultSpecifier = path.node.specifiers.find(specifier => t.isImportDefaultSpecifier(specifier));
|
|
24
|
+
if (defaultSpecifier) {
|
|
25
|
+
state["defaultImportName"] = defaultSpecifier.local.name;
|
|
26
|
+
} else {
|
|
27
|
+
throw new Error("Import for `style-inject.es.js` file not found in file");
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
// Step 2: Find all calls to the imported identifier
|
|
31
|
+
CallExpression(path, state) {
|
|
32
|
+
if (!state["defaultImportName"]) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const callee = path.node.callee;
|
|
36
|
+
if (t.isIdentifier(callee) && callee.name === state["defaultImportName"]) {
|
|
37
|
+
const args = path.node.arguments;
|
|
38
|
+
if (!(args.length >= 1 && args.length <= 2)) {
|
|
39
|
+
throw new Error("Unexpected number of arguments");
|
|
40
|
+
}
|
|
41
|
+
if (!((t.isStringLiteral(args[0]) || t.isIdentifier(args[0])) && (!args[1] || t.isStringLiteral(args[1])))) {
|
|
42
|
+
throw new Error("Unexpected argument types");
|
|
43
|
+
}
|
|
44
|
+
let cssString = "";
|
|
45
|
+
if (t.isStringLiteral(args[0])) {
|
|
46
|
+
cssString = args[0].value;
|
|
47
|
+
let reusedVariable = null;
|
|
48
|
+
path.scope.path.traverse({
|
|
49
|
+
VariableDeclarator(variablePath) {
|
|
50
|
+
const {
|
|
51
|
+
id,
|
|
52
|
+
init
|
|
53
|
+
} = variablePath.node;
|
|
54
|
+
if (t.isStringLiteral(init, {
|
|
55
|
+
value: cssString
|
|
56
|
+
})) {
|
|
57
|
+
reusedVariable = id;
|
|
58
|
+
variablePath.stop();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
if (reusedVariable) {
|
|
63
|
+
path.node.arguments[0] = reusedVariable;
|
|
64
|
+
}
|
|
65
|
+
} else if (t.isIdentifier(args[0])) {
|
|
66
|
+
const binding = path.scope.getBinding(args[0].name);
|
|
67
|
+
if (binding && t.isVariableDeclarator(binding.path.node) && t.isStringLiteral(binding.path.node.init)) {
|
|
68
|
+
cssString = binding.path.node.init.value;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (!cssString) {
|
|
72
|
+
throw new Error("Invalid first argument value");
|
|
73
|
+
}
|
|
74
|
+
const hash = generateMd5(cssString);
|
|
75
|
+
const hashArg = t.stringLiteral(hash);
|
|
76
|
+
if (args.length > 1) {
|
|
77
|
+
args[1] = hashArg;
|
|
78
|
+
} else {
|
|
79
|
+
args.push(hashArg);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export { transformCssModule };
|
|
87
|
+
//# sourceMappingURL=transform-css-module.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-css-module.mjs","sources":["../../../../src/utils/nextjs/ssr/transform-css-module.ts"],"sourcesContent":["import type { PluginObj } from \"@babel/core\";\nimport * as t from \"@babel/types\";\nimport crypto from \"node:crypto\";\n\nfunction generateMd5(input: string): string {\n return crypto.createHash(\"md5\").update(input).digest(\"hex\");\n}\n\ntype Plugin = PluginObj<{\n // Store the name of the default import identifier for \"style-inject.es.js\"\n defaultImportName: null | string;\n}>;\n\n/**\n * FIXME: Currently this plugin won't:\n * - Handle existing source maps correctly and would strip from the output: \"//#\n * sourceMappingURL=BubbleContainer.module.css.js.map\"\n */\nexport const transformCssModule = (): Plugin => {\n return {\n visitor: {\n // Step 0: Setup state\n Program(_path, state) {\n state[\"defaultImportName\"] = null;\n },\n // Step 1: Find the default import from \"style-inject.es.js\"\n ImportDeclaration(path, state) {\n // Skip, if the default import name is already found (assuming there is only one per-file)\n if (state[\"defaultImportName\"]) {\n return;\n }\n\n // Look for imports for \"style-inject.es.js\" file\n const importSource = path.node.source.value;\n if (!importSource.endsWith(\"style-inject.es.js\")) {\n return;\n }\n\n // Check for default import specifier\n const defaultSpecifier = path.node.specifiers.find((specifier) =>\n t.isImportDefaultSpecifier(specifier),\n ) as t.ImportDefaultSpecifier | undefined;\n\n // Store the default import name\n if (defaultSpecifier) {\n // Fail if two instances of file is found\n state[\"defaultImportName\"] = defaultSpecifier.local.name;\n } else {\n throw new Error(\n \"Import for `style-inject.es.js` file not found in file\",\n );\n }\n },\n\n // Step 2: Find all calls to the imported identifier\n CallExpression(path, state) {\n // Ignore if the default import name is not found\n if (!state[\"defaultImportName\"]) {\n return;\n }\n\n // Check if the callee is the default import identifier\n const callee = path.node.callee;\n if (\n t.isIdentifier(callee) &&\n callee.name === state[\"defaultImportName\"]\n ) {\n const args = path.node.arguments;\n\n // If arguments are not between 1 and 2, fail\n if (!(args.length >= 1 && args.length <= 2)) {\n throw new Error(\"Unexpected number of arguments\");\n }\n\n /**\n * Validates that the function arguments are:\n * 1. needs to be a string literal or variable holding string\n * 2. (optional) string literal\n */\n if (\n !(\n (t.isStringLiteral(args[0]) || t.isIdentifier(args[0])) &&\n (!args[1] || t.isStringLiteral(args[1]))\n )\n ) {\n throw new Error(\"Unexpected argument types\");\n }\n\n // CSS string\n let cssString: string = \"\";\n\n // Try to remove duplicate string literal as first argument and instead re-use the a already generated variable\n if (t.isStringLiteral(args[0])) {\n cssString = args[0].value;\n\n let reusedVariable = null;\n path.scope.path.traverse({\n VariableDeclarator(variablePath) {\n const { id, init } = variablePath.node;\n\n // Match variables initialized with the same string value.\n if (t.isStringLiteral(init, { value: cssString })) {\n reusedVariable = id;\n variablePath.stop(); // Stop traversing once a match is found.\n }\n },\n });\n\n // Replace the string literal with the existing variable reference.\n if (reusedVariable) {\n path.node.arguments[0] = reusedVariable;\n }\n } else if (t.isIdentifier(args[0])) {\n // Extract value from variable\n const binding = path.scope.getBinding(args[0].name);\n if (\n binding &&\n t.isVariableDeclarator(binding.path.node) &&\n t.isStringLiteral(binding.path.node.init)\n ) {\n cssString = binding.path.node.init.value;\n }\n }\n\n if (!cssString) {\n throw new Error(\"Invalid first argument value\");\n }\n\n // Generate MD5 hash of the first argument's value\n // TODO: Looked into that styled-components use murmurhash. Also it's possible to use sha1 for longer key\n // (less % of collision)\n const hash = generateMd5(cssString);\n\n // Add the hash as the second argument\n const hashArg = t.stringLiteral(hash);\n if (args.length > 1) {\n // If a second argument exists, replace it\n args[1] = hashArg;\n } else {\n // Otherwise, add it as a new second argument\n args.push(hashArg);\n }\n }\n },\n },\n } satisfies Plugin;\n};\n"],"names":["generateMd5","input","crypto","createHash","update","digest","transformCssModule","visitor","Program","_path","state","ImportDeclaration","path","importSource","node","source","value","endsWith","defaultSpecifier","specifiers","find","specifier","t","isImportDefaultSpecifier","local","name","Error","CallExpression","callee","isIdentifier","args","arguments","length","isStringLiteral","cssString","reusedVariable","scope","traverse","VariableDeclarator","variablePath","id","init","stop","binding","getBinding","isVariableDeclarator","hash","hashArg","stringLiteral","push"],"mappings":"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"}
|