@explorer-1/vue 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +9 -0
- package/components.d.ts +215 -0
- package/index.html +18 -0
- package/lib/main.ts +78 -0
- package/package.json +54 -0
- package/postcss.config.js +7 -0
- package/public/edu/.gitkeep +0 -0
- package/public/edu/explorer-1/bg-stars-edu.png +0 -0
- package/public/edu/explorer-1/bg-stars.jpg +0 -0
- package/public/explorer-1/bg-stars-edu.png +0 -0
- package/public/explorer-1/bg-stars.jpg +0 -0
- package/src/App.vue +30 -0
- package/src/assets/fonts/README.md +12 -0
- package/src/assets/fonts/archivo-narrow/ArchivoNarrow-Bold.woff2 +0 -0
- package/src/assets/fonts/archivo-narrow/ArchivoNarrow-BoldItalic.woff2 +0 -0
- package/src/assets/fonts/archivo-narrow/ArchivoNarrow-SemiBold.woff2 +0 -0
- package/src/assets/fonts/archivo-narrow/ArchivoNarrow-SemiBoldItalic.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-Bold.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-BoldItalic.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-ExtraBold.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-Medium.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-MediumItalic.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-Regular.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-RegularItalic.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-SemiBold.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-SemiBoldItalic.woff2 +0 -0
- package/src/assets/scss/styles.scss +1 -0
- package/src/components/AsteroidWatchWidget/AsteroidWatchWidget.stories.js +156 -0
- package/src/components/AsteroidWatchWidget/AsteroidWatchWidget.vue +156 -0
- package/src/components/BackToTop/BackToTop.stories.js +24 -0
- package/src/components/BackToTop/BackToTop.vue +76 -0
- package/src/components/BaseAudio/BaseAudio.stories.js +29 -0
- package/src/components/BaseAudio/BaseAudio.vue +359 -0
- package/src/components/BaseButton/BaseButton.stories.ts +65 -0
- package/src/components/BaseButton/BaseButton.vue +114 -0
- package/src/components/BaseCheckboxGroup/BaseCheckboxGroup.stories.mdx +68 -0
- package/src/components/BaseCheckboxGroup/BaseCheckboxGroup.vue +101 -0
- package/src/components/BaseHeading/BaseHeading.stories.js +75 -0
- package/src/components/BaseHeading/BaseHeading.vue +58 -0
- package/src/components/BaseImage/BaseImage.stories.ts +52 -0
- package/src/components/BaseImage/BaseImage.vue +120 -0
- package/src/components/BaseImageCaption/BaseImageCaption.stories.js +27 -0
- package/src/components/BaseImageCaption/BaseImageCaption.vue +51 -0
- package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.stories.js +73 -0
- package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.vue +90 -0
- package/src/components/BaseLightboxCloseButton/BaseLightboxCloseButton.vue +45 -0
- package/src/components/BaseLightboxOpenButton/BaseLightboxOpenButton.vue +46 -0
- package/src/components/BaseLink/BaseLink.stories.js +47 -0
- package/src/components/BaseLink/BaseLink.vue +227 -0
- package/src/components/BaseModal/BaseModal.stories.js +90 -0
- package/src/components/BaseModal/BaseModal.vue +54 -0
- package/src/components/BaseModal/BaseModalDialog.vue +59 -0
- package/src/components/BasePlaceholder/BasePlaceholder.stories.js +29 -0
- package/src/components/BasePlaceholder/BasePlaceholder.vue +30 -0
- package/src/components/BaseRadioGroup/BaseRadioGroup.stories.mdx +68 -0
- package/src/components/BaseRadioGroup/BaseRadioGroup.vue +102 -0
- package/src/components/BaseSwimlane/BaseSwimlane.stories.mdx +64 -0
- package/src/components/BaseSwimlane/BaseSwimlane.vue +204 -0
- package/src/components/BaseTag/BaseTag.stories.js +34 -0
- package/src/components/BaseTag/BaseTag.vue +36 -0
- package/src/components/BaseTimer/BaseTimer.stories.js +78 -0
- package/src/components/BaseTimer/BaseTimer.test.js +15 -0
- package/src/components/BaseTimer/BaseTimer.vue +270 -0
- package/src/components/BaseUnitToggle/BaseUnitToggle.stories.js +86 -0
- package/src/components/BaseUnitToggle/BaseUnitToggle.test.js +26 -0
- package/src/components/BaseUnitToggle/BaseUnitToggle.vue +255 -0
- package/src/components/BaseVideo/BaseVideo.stories.js +31 -0
- package/src/components/BaseVideo/BaseVideo.vue +73 -0
- package/src/components/BlockAnchor/BlockAnchor.vue +38 -0
- package/src/components/BlockAudio/BlockAudio.stories.js +29 -0
- package/src/components/BlockAudio/BlockAudio.vue +78 -0
- package/src/components/BlockCard/BlockCard.stories.js +24 -0
- package/src/components/BlockCard/BlockCard.vue +88 -0
- package/src/components/BlockCardGroup/BlockCardGroup.stories.js +71 -0
- package/src/components/BlockCardGroup/BlockCardGroup.vue +61 -0
- package/src/components/BlockCircleImageCard/BlockCircleImageCard.stories.js +55 -0
- package/src/components/BlockCircleImageCard/BlockCircleImageCard.vue +120 -0
- package/src/components/BlockCta/BlockCta.stories.js +35 -0
- package/src/components/BlockCta/BlockCta.vue +55 -0
- package/src/components/BlockHeading/BlockHeading.stories.js +22 -0
- package/src/components/BlockHeading/BlockHeading.vue +27 -0
- package/src/components/BlockIframeEmbed/BlockIframeEmbed.stories.js +40 -0
- package/src/components/BlockIframeEmbed/BlockIframeEmbed.vue +84 -0
- package/src/components/BlockImage/BlockImage.stories.js +137 -0
- package/src/components/BlockImage/BlockImage.vue +48 -0
- package/src/components/BlockImage/BlockImageFullBleed.vue +119 -0
- package/src/components/BlockImage/BlockImageStandard.vue +106 -0
- package/src/components/BlockImageCarousel/BlockImageCarousel.stories.js +108 -0
- package/src/components/BlockImageCarousel/BlockImageCarousel.vue +201 -0
- package/src/components/BlockImageCarouselItem/BlockImageCarouselItem.stories.js +63 -0
- package/src/components/BlockImageCarouselItem/BlockImageCarouselItem.vue +120 -0
- package/src/components/BlockImageComparison/BlockImageComparison.stories.js +46 -0
- package/src/components/BlockImageComparison/BlockImageComparison.vue +59 -0
- package/src/components/BlockImageGallery/BlockImageGallery.stories.js +55 -0
- package/src/components/BlockImageGallery/BlockImageGallery.vue +128 -0
- package/src/components/BlockInlineImage/BlockInlineImage.stories.js +68 -0
- package/src/components/BlockInlineImage/BlockInlineImage.vue +124 -0
- package/src/components/BlockKeyPoints/BlockKeyPoints.stories.js +28 -0
- package/src/components/BlockKeyPoints/BlockKeyPoints.vue +48 -0
- package/src/components/BlockLinkCard/BlockLinkCard.stories.js +102 -0
- package/src/components/BlockLinkCard/BlockLinkCard.vue +197 -0
- package/src/components/BlockLinkCarousel/BlockLinkCarousel.stories.js +217 -0
- package/src/components/BlockLinkCarousel/BlockLinkCarousel.vue +68 -0
- package/src/components/BlockLinkTile/BlockLinkTile.stories.js +72 -0
- package/src/components/BlockLinkTile/BlockLinkTile.vue +193 -0
- package/src/components/BlockListCards/BlockListCards.stories.js +69 -0
- package/src/components/BlockListCards/BlockListCards.vue +129 -0
- package/src/components/BlockQuote/BlockQuote.stories.js +84 -0
- package/src/components/BlockQuote/BlockQuote.vue +87 -0
- package/src/components/BlockRelatedLinks/BlockRelatedLinks.stories.js +60 -0
- package/src/components/BlockRelatedLinks/BlockRelatedLinks.vue +77 -0
- package/src/components/BlockRelatedLinks/RelatedLink.vue +85 -0
- package/src/components/BlockStreamfield/BlockStreamfield.stories.js +88 -0
- package/src/components/BlockStreamfield/BlockStreamfield.vue +333 -0
- package/src/components/BlockTable/BlockTable.stories.js +20 -0
- package/src/components/BlockTable/BlockTable.vue +73 -0
- package/src/components/BlockTeaser/BlockTeaser.stories.js +74 -0
- package/src/components/BlockTeaser/BlockTeaser.test.js +12 -0
- package/src/components/BlockTeaser/BlockTeaser.vue +174 -0
- package/src/components/BlockText/BlockText.stories.js +21 -0
- package/src/components/BlockText/BlockText.vue +44 -0
- package/src/components/BlockTwitterEmbed/BlockTwitterEmbed.stories.js +19 -0
- package/src/components/BlockTwitterEmbed/BlockTwitterEmbed.vue +61 -0
- package/src/components/BlockVideo/BlockVideo.stories.js +23 -0
- package/src/components/BlockVideo/BlockVideo.vue +41 -0
- package/src/components/BlockVideoEmbed/BlockVideoEmbed.stories.js +20 -0
- package/src/components/BlockVideoEmbed/BlockVideoEmbed.vue +71 -0
- package/src/components/CalendarButton/CalendarButton.stories.js +36 -0
- package/src/components/CalendarButton/CalendarButton.vue +86 -0
- package/src/components/DetailHeadline/DetailHeadline.stories.js +48 -0
- package/src/components/DetailHeadline/DetailHeadline.vue +143 -0
- package/src/components/DsnWidget/DsnWidget.stories.js +29 -0
- package/src/components/DsnWidget/DsnWidget.vue +96 -0
- package/src/components/EventCard/EventCard.vue +188 -0
- package/src/components/EventDetailHero/EventDetailHero.stories.js +53 -0
- package/src/components/EventDetailHero/EventDetailHero.vue +64 -0
- package/src/components/FormContact/FormContact.stories.js +16 -0
- package/src/components/FormContact/FormContact.vue +202 -0
- package/src/components/FormNewsletterSignup/FormNewsletterSignup.stories.js +16 -0
- package/src/components/FormNewsletterSignup/FormNewsletterSignup.vue +355 -0
- package/src/components/HeroLarge/HeroLarge.stories.js +46 -0
- package/src/components/HeroLarge/HeroLarge.vue +93 -0
- package/src/components/HeroListingIndex/HeroListingIndex.stories.js +156 -0
- package/src/components/HeroListingIndex/HeroListingIndex.vue +80 -0
- package/src/components/HeroMedia/HeroMedia.stories.js +135 -0
- package/src/components/HeroMedia/HeroMedia.vue +174 -0
- package/src/components/HeroMedium/HeroMedium.stories.js +73 -0
- package/src/components/HeroMedium/HeroMedium.vue +166 -0
- package/src/components/HomepageCarousel/HomepageCarousel.stories.js +112 -0
- package/src/components/HomepageCarousel/HomepageCarousel.vue +382 -0
- package/src/components/HomepageCarouselItem/HomepageCarouselItem.stories.js +60 -0
- package/src/components/HomepageCarouselItem/HomepageCarouselItem.vue +168 -0
- package/src/components/HomepageEmbedBlock/HomepageEmbedBlock.stories.js +35 -0
- package/src/components/HomepageEmbedBlock/HomepageEmbedBlock.vue +39 -0
- package/src/components/HomepageFeaturedRobot/HomepageFeaturedRobot.stories.js +93 -0
- package/src/components/HomepageFeaturedRobot/HomepageFeaturedRobot.vue +129 -0
- package/src/components/HomepageMissionsCarousel/HomepageMissionsCarousel.stories.js +153 -0
- package/src/components/HomepageMissionsCarousel/HomepageMissionsCarousel.vue +282 -0
- package/src/components/HomepageMissionsCarousel/HomepageMissionsCarouselItem.vue +143 -0
- package/src/components/HomepageStats/HomepageStats.stories.js +155 -0
- package/src/components/HomepageStats/HomepageStats.vue +362 -0
- package/src/components/HomepageTeaserBlock/HomepageTeaserBlock.stories.js +90 -0
- package/src/components/HomepageTeaserBlock/HomepageTeaserBlock.vue +156 -0
- package/src/components/HomepageTeaserBlock/HomepageTeaserBlockCardImage.vue +58 -0
- package/src/components/Icons/Icon360.vue +29 -0
- package/src/components/Icons/IconArrow.vue +26 -0
- package/src/components/Icons/IconArrows.vue +43 -0
- package/src/components/Icons/IconAudio.vue +27 -0
- package/src/components/Icons/IconBook.vue +21 -0
- package/src/components/Icons/IconBookUser.vue +21 -0
- package/src/components/Icons/IconBriefcase.vue +21 -0
- package/src/components/Icons/IconCalendar.vue +25 -0
- package/src/components/Icons/IconCaret.vue +26 -0
- package/src/components/Icons/IconCheckbox.vue +26 -0
- package/src/components/Icons/IconCheckboxSelected.vue +35 -0
- package/src/components/Icons/IconClose.vue +27 -0
- package/src/components/Icons/IconCloseLightbox.vue +25 -0
- package/src/components/Icons/IconDownload.vue +31 -0
- package/src/components/Icons/IconDropdown.vue +25 -0
- package/src/components/Icons/IconEnvelope.vue +21 -0
- package/src/components/Icons/IconExpand.vue +28 -0
- package/src/components/Icons/IconExternal.vue +25 -0
- package/src/components/Icons/IconFilter.vue +25 -0
- package/src/components/Icons/IconForwardTen.vue +38 -0
- package/src/components/Icons/IconGrid.vue +25 -0
- package/src/components/Icons/IconHand.vue +21 -0
- package/src/components/Icons/IconInfo.vue +26 -0
- package/src/components/Icons/IconLink.vue +27 -0
- package/src/components/Icons/IconList.vue +25 -0
- package/src/components/Icons/IconLocation.vue +37 -0
- package/src/components/Icons/IconMagnifyingGlass.vue +21 -0
- package/src/components/Icons/IconMedal.vue +21 -0
- package/src/components/Icons/IconMenu.vue +27 -0
- package/src/components/Icons/IconMinus.vue +26 -0
- package/src/components/Icons/IconMute.vue +27 -0
- package/src/components/Icons/IconNext.vue +25 -0
- package/src/components/Icons/IconPause.vue +28 -0
- package/src/components/Icons/IconPlay.vue +28 -0
- package/src/components/Icons/IconPlus.vue +25 -0
- package/src/components/Icons/IconPrev.vue +25 -0
- package/src/components/Icons/IconRewindTen.vue +42 -0
- package/src/components/Icons/IconSearch.vue +25 -0
- package/src/components/Icons/IconShare.vue +30 -0
- package/src/components/Icons/IconSlideshow.vue +30 -0
- package/src/components/Icons/IconSocialEmail.vue +26 -0
- package/src/components/Icons/IconSocialFacebook.vue +26 -0
- package/src/components/Icons/IconSocialGoogleClassroom.vue +26 -0
- package/src/components/Icons/IconSocialInstagram.vue +35 -0
- package/src/components/Icons/IconSocialPinterest.vue +26 -0
- package/src/components/Icons/IconSocialReddit.vue +25 -0
- package/src/components/Icons/IconSocialTwitter.vue +25 -0
- package/src/components/Icons/IconSocialYoutube.vue +35 -0
- package/src/components/Icons/IconStop.vue +27 -0
- package/src/components/Icons/IconTime.vue +25 -0
- package/src/components/Icons/IconUniversity.vue +21 -0
- package/src/components/Icons/IconUser.vue +26 -0
- package/src/components/Icons/IconVolume.vue +27 -0
- package/src/components/Icons/Icons.stories.ts +440 -0
- package/src/components/ImageDetailContextImage/ImageDetailContextImage.vue +125 -0
- package/src/components/LayoutHelper/LayoutHelper.vue +38 -0
- package/src/components/LoadingTransition/LoadingTransition.vue +48 -0
- package/src/components/LogoCaltech/LogoCaltech.stories.js +39 -0
- package/src/components/LogoCaltech/LogoCaltech.vue +29 -0
- package/src/components/LogoTribrand/LogoTribrand.stories.js +76 -0
- package/src/components/LogoTribrand/LogoTribrand.vue +93 -0
- package/src/components/MissionDetailAbout/MissionDetailAbout.stories.js +70 -0
- package/src/components/MissionDetailAbout/MissionDetailAbout.vue +204 -0
- package/src/components/MissionDetailHero/MissionDetailHero.stories.js +303 -0
- package/src/components/MissionDetailHero/MissionDetailHero.vue +292 -0
- package/src/components/MissionDetailHighlights/MissionDetailHighlights.stories.js +278 -0
- package/src/components/MissionDetailHighlights/MissionDetailHighlights.vue +332 -0
- package/src/components/MissionDetailHighlights/MissionDetailHighlightsCarousel.vue +160 -0
- package/src/components/MissionDetailHighlights/MissionDetailHighlightsCarouselItem.vue +123 -0
- package/src/components/MissionDetailInlineImage/MissionDetailInlineImage.stories.js +43 -0
- package/src/components/MissionDetailInlineImage/MissionDetailInlineImage.vue +97 -0
- package/src/components/MissionDetailStats/DistanceStats.test.js +133 -0
- package/src/components/MissionDetailStats/DistanceStats.vue +250 -0
- package/src/components/MissionDetailStats/MissionDetailStats.stories.js +95 -0
- package/src/components/MissionDetailStats/MissionDetailStats.test.js +23 -0
- package/src/components/MissionDetailStats/MissionDetailStats.vue +187 -0
- package/src/components/MissionDetailStats/MissionDetailStatsMicro.vue +52 -0
- package/src/components/MissionDetailStats/MissionDetailStatsMini.vue +109 -0
- package/src/components/MissionDetailStreamfield/MissionDetailStreamfield.stories.js +55 -0
- package/src/components/MissionDetailStreamfield/MissionDetailStreamfield.vue +95 -0
- package/src/components/MixinAnimationCaret/MixinAnimationCaret.stories.ts +24 -0
- package/src/components/MixinAnimationCaret/MixinAnimationCaret.vue +81 -0
- package/src/components/MixinCarousel/MixinCarousel.docs.mdx +33 -0
- package/src/components/MixinCarousel/MixinCarousel.stories.js +53 -0
- package/src/components/MixinCarousel/MixinCarousel.vue +236 -0
- package/src/components/MixinDropdownToggle/MixinDropdownToggle.vue +53 -0
- package/src/components/MixinFancybox/MixinFancybox.vue +405 -0
- package/src/components/MixinFancybox/MixinFancyboxOpenButton.vue +35 -0
- package/src/components/MixinVideoBg/MixinVideoBg.stories.js +23 -0
- package/src/components/MixinVideoBg/MixinVideoBg.vue +39 -0
- package/src/components/NavDesktop/NavDesktop.stories.js +254 -0
- package/src/components/NavDesktop/NavDesktop.vue +355 -0
- package/src/components/NavDesktop/NavDesktopDropdown.vue +201 -0
- package/src/components/NavDesktop/NavDesktopDropdownContent.vue +87 -0
- package/src/components/NavDesktop/NavDesktopDropdownMore.vue +112 -0
- package/src/components/NavDesktop/NavDesktopTopHat.vue +56 -0
- package/src/components/NavHeading/NavHeading.stories.js +23 -0
- package/src/components/NavHeading/NavHeading.vue +40 -0
- package/src/components/NavHighlight/NavHighlight.stories.js +42 -0
- package/src/components/NavHighlight/NavHighlight.vue +67 -0
- package/src/components/NavLinkList/NavLinkList.stories.js +46 -0
- package/src/components/NavLinkList/NavLinkList.vue +66 -0
- package/src/components/NavLogoLinks/NavLogoLinks.stories.js +22 -0
- package/src/components/NavLogoLinks/NavLogoLinks.vue +57 -0
- package/src/components/NavMobile/NavMobile.stories.js +231 -0
- package/src/components/NavMobile/NavMobile.vue +280 -0
- package/src/components/NavMobile/NavMobileDropdown.vue +175 -0
- package/src/components/NavMobile/NavMobileLink.vue +69 -0
- package/src/components/NavMobile/NavMobileSecondaryDropdown.vue +124 -0
- package/src/components/NavSearchForm/NavSearchForm.stories.js +13 -0
- package/src/components/NavSearchForm/NavSearchForm.vue +102 -0
- package/src/components/NavSecondary/NavSecondary.stories.js +24 -0
- package/src/components/NavSecondary/NavSecondary.vue +191 -0
- package/src/components/NavSecondary/NavSecondaryDropdown.vue +181 -0
- package/src/components/NavSecondary/NavSecondaryDropdownContent.vue +140 -0
- package/src/components/NavSecondary/NavSecondaryLink.vue +62 -0
- package/src/components/NavSocial/NavSocial.stories.js +20 -0
- package/src/components/NavSocial/NavSocial.vue +97 -0
- package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.stories.js +60 -0
- package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.test.js +30 -0
- package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.vue +73 -0
- package/src/components/ParallaxContainer/ParallaxContainer.stories.js +47 -0
- package/src/components/ParallaxContainer/ParallaxContainer.vue +76 -0
- package/src/components/ParallaxElement/ParallaxElement.vue +25 -0
- package/src/components/PastEventsCarousel/PastEventsCarousel.vue +86 -0
- package/src/components/PodcastEpisodeCard/PodcastEpisodeCard.vue +251 -0
- package/src/components/PodcastSeriesCarousel/PodcastSeriesCarousel.stories.js +235 -0
- package/src/components/PodcastSeriesCarousel/PodcastSeriesCarousel.vue +171 -0
- package/src/components/ProfileDetailSectionGroup/ProfileDetailSectionGroup.vue +84 -0
- package/src/components/RoboticsDetailStats/RoboticsDetailStats.stories.js +97 -0
- package/src/components/RoboticsDetailStats/RoboticsDetailStats.test.js +21 -0
- package/src/components/RoboticsDetailStats/RoboticsDetailStats.vue +217 -0
- package/src/components/RoboticsDetailStats/RoboticsDetailStatsMini.vue +182 -0
- package/src/components/SearchFilterGroup/SearchFilterGroup.stories.js +59 -0
- package/src/components/SearchFilterGroup/SearchFilterGroup.vue +221 -0
- package/src/components/SearchInput/SearchInput.stories.js +35 -0
- package/src/components/SearchInput/SearchInput.vue +93 -0
- package/src/components/SearchPagination/SearchPagination.stories.js +55 -0
- package/src/components/SearchPagination/SearchPagination.vue +173 -0
- package/src/components/SearchResultCard/SearchResultCard.stories.js +57 -0
- package/src/components/SearchResultCard/SearchResultCard.vue +282 -0
- package/src/components/SearchResultGridItem/SearchResultGridItem.stories.js +70 -0
- package/src/components/SearchResultGridItem/SearchResultGridItem.vue +140 -0
- package/src/components/SearchResultsList/SearchResultsList.vue +183 -0
- package/src/components/SearchSelectMenu/SearchSelectMenu.stories.js +25 -0
- package/src/components/SearchSelectMenu/SearchSelectMenu.vue +86 -0
- package/src/components/ShareButtons/ShareButtons.stories.js +16 -0
- package/src/components/ShareButtons/ShareButtons.vue +132 -0
- package/src/components/ShareButtonsEdu/ShareButtonsEdu.stories.js +14 -0
- package/src/components/ShareButtonsEdu/ShareButtonsEdu.vue +215 -0
- package/src/components/SkipLink/SkipLink.stories.js +9 -0
- package/src/components/SkipLink/SkipLink.vue +53 -0
- package/src/components/SwimlaneCTA/SwimlaneCTA.stories.mdx +77 -0
- package/src/components/SwimlaneCTA/SwimlaneCTA.vue +281 -0
- package/src/components/TheFooter/TheFooter.stories.js +602 -0
- package/src/components/TheFooter/TheFooter.vue +228 -0
- package/src/components/TheFooter/TheFooterSignUp.vue +61 -0
- package/src/components/ThumbnailCarousel/ThumbnailCarousel.stories.js +106 -0
- package/src/components/ThumbnailCarousel/ThumbnailCarousel.vue +76 -0
- package/src/components/TopicDetailMissionCarousel/TopicDetailMissionCarousel.stories.js +93 -0
- package/src/components/TopicDetailMissionCarousel/TopicDetailMissionCarousel.vue +68 -0
- package/src/components/TopicDetailMissionCarouselItem/TopicDetailMissionCarouselItem.stories.js +38 -0
- package/src/components/TopicDetailMissionCarouselItem/TopicDetailMissionCarouselItem.vue +104 -0
- package/src/components/TopicDetailMissionSpotlight/TopicDetailMissionSpotlight.stories.js +84 -0
- package/src/components/TopicDetailMissionSpotlight/TopicDetailMissionSpotlight.vue +112 -0
- package/src/components/TopicDetailMore/TopicDetailMore.stories.js +221 -0
- package/src/components/TopicDetailMore/TopicDetailMore.vue +124 -0
- package/src/components/TopicDetailMore/TopicDetailMoreVisibility.vue +51 -0
- package/src/components/TopicDetailMoreItem/TopicDetailMoreItem.stories.js +116 -0
- package/src/components/TopicDetailMoreItem/TopicDetailMoreItem.vue +130 -0
- package/src/components/TopicDetailStreamfield/TopicDetailStreamfield.stories.js +34 -0
- package/src/components/TopicDetailStreamfield/TopicDetailStreamfield.vue +98 -0
- package/src/components/YearTicker/YearTicker.stories.js +37 -0
- package/src/components/YearTicker/YearTicker.vue +132 -0
- package/src/docs/foundation/DynamicTokens.vue +106 -0
- package/src/docs/foundation/FontVariants.vue +80 -0
- package/src/docs/foundation/color.docs.mdx +112 -0
- package/src/docs/foundation/grid.docs.mdx +189 -0
- package/src/docs/foundation/grid.stories.js +263 -0
- package/src/docs/foundation/grid_layouthelpers.docs.mdx +78 -0
- package/src/docs/foundation/grid_layouthelpers.stories.js +53 -0
- package/src/docs/foundation/themes.docs.mdx +71 -0
- package/src/docs/foundation/themes.stories.js +63 -0
- package/src/docs/foundation/typography.docs.mdx +50 -0
- package/src/docs/foundation/typography.stories.js +119 -0
- package/src/interfaces.ts +129 -0
- package/src/main.ts +34 -0
- package/src/store/header.ts +40 -0
- package/src/store/theme.ts +27 -0
- package/src/templates/PageContent/PageContent.stories.js +92 -0
- package/src/templates/PageContent/PageContent.vue +140 -0
- package/src/templates/PageEventDetail/PageEventDetail.stories.js +104 -0
- package/src/templates/PageEventDetail/PageEventDetail.vue +358 -0
- package/src/templates/PageNewsDetail/PageNewsDetail.stories.js +158 -0
- package/src/templates/PageNewsDetail/PageNewsDetail.vue +242 -0
- package/src/templates/edu/PageEduNewsDetail.stories.js +64 -0
- package/src/templates/edu/PageEduNewsDetail.vue +155 -0
- package/src/templates/www/HomePage/HomePage.vue +30 -0
- package/src/utils/dayjs.js +32 -0
- package/src/utils/filters.js +33 -0
- package/src/utils/mixins.ts +353 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.js +24 -0
- package/tsconfig.json +29 -0
- package/tsconfig.node.json +11 -0
- package/vite.config.ts +55 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="text || image"
|
|
4
|
+
class="MissionDetailInlineImage lg:BaseGrid container mx-auto"
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
class="flex flex-row items-start col-span-4"
|
|
8
|
+
:class="alignment === 'right' ? 'col-start-2 order-1' : 'col-start-9 order-2'"
|
|
9
|
+
>
|
|
10
|
+
<div class="lg:mb-10 xl:mb-3 mb-2">
|
|
11
|
+
<BlockText
|
|
12
|
+
v-if="text"
|
|
13
|
+
class="lg:mb-0 mb-5"
|
|
14
|
+
:text="text"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div
|
|
19
|
+
class="col-span-6"
|
|
20
|
+
:class="alignment === 'right' ? 'col-start-7 order-2' : 'col-start-2 order-1'"
|
|
21
|
+
>
|
|
22
|
+
<div class="justify-items-center relative block">
|
|
23
|
+
<BaseImagePlaceholder
|
|
24
|
+
aspect-ratio="1:1"
|
|
25
|
+
dark-mode
|
|
26
|
+
>
|
|
27
|
+
<BaseImage
|
|
28
|
+
v-if="image && image.src"
|
|
29
|
+
:src="image.src.url"
|
|
30
|
+
:srcset="theSrcSet"
|
|
31
|
+
:width="image.src.width"
|
|
32
|
+
:height="image.src.height"
|
|
33
|
+
alt=""
|
|
34
|
+
object-fit-class="cover"
|
|
35
|
+
loading="lazy"
|
|
36
|
+
/>
|
|
37
|
+
</BaseImagePlaceholder>
|
|
38
|
+
<BaseImageCaption
|
|
39
|
+
class="lg:mt-3 mt-2"
|
|
40
|
+
:data="image"
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script lang="ts">
|
|
48
|
+
import { defineComponent } from 'vue'
|
|
49
|
+
import { mixinGetSrcSet } from '../../utils/mixins'
|
|
50
|
+
import BlockText from './../BlockText/BlockText.vue'
|
|
51
|
+
import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
|
|
52
|
+
import BaseImage from './../BaseImage/BaseImage.vue'
|
|
53
|
+
import BaseImageCaption from './../BaseImageCaption/BaseImageCaption.vue'
|
|
54
|
+
|
|
55
|
+
export default defineComponent({
|
|
56
|
+
name: 'MissionDetailInlineImage',
|
|
57
|
+
components: {
|
|
58
|
+
BlockText,
|
|
59
|
+
BaseImagePlaceholder,
|
|
60
|
+
BaseImage,
|
|
61
|
+
BaseImageCaption
|
|
62
|
+
},
|
|
63
|
+
props: {
|
|
64
|
+
alignment: {
|
|
65
|
+
type: String,
|
|
66
|
+
required: false,
|
|
67
|
+
default: 'right'
|
|
68
|
+
},
|
|
69
|
+
text: {
|
|
70
|
+
type: String,
|
|
71
|
+
required: false
|
|
72
|
+
},
|
|
73
|
+
image: {
|
|
74
|
+
type: Object,
|
|
75
|
+
required: false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
computed: {
|
|
79
|
+
theSrcSet() {
|
|
80
|
+
if (this.image) {
|
|
81
|
+
return mixinGetSrcSet(this.image)
|
|
82
|
+
}
|
|
83
|
+
return undefined
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<style lang="scss">
|
|
90
|
+
.MissionDetailInlineImage {
|
|
91
|
+
.ThemeVariantDark & {
|
|
92
|
+
> div {
|
|
93
|
+
@apply text-white;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { supportedAPIPaths } from './DistanceStats.vue'
|
|
2
|
+
|
|
3
|
+
const consoleError = console.error
|
|
4
|
+
|
|
5
|
+
describe('DistanceStats - /api/v1/missions/', () => {
|
|
6
|
+
const config = supportedAPIPaths['/api/v1/missions/']
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
console.error = () => {}
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
console.error = consoleError
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
test('gets the correct path', () => {
|
|
17
|
+
expect(config.getPath('https://mars.nasa.gov/api/v1/missions/2/', '/api/v1/missions/')).toBe(
|
|
18
|
+
'/api/mars/api/v1/missions/2/'
|
|
19
|
+
)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
test('throws', () => {
|
|
23
|
+
const config = supportedAPIPaths['/api/v1/missions/']
|
|
24
|
+
expect(() => {
|
|
25
|
+
config.getPath('https://mars.nasa.gov/api/v2/potato/')
|
|
26
|
+
}).toThrow('/api/v1/missions/')
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
test('gets the correct distance', () => {
|
|
30
|
+
expect(config.getDistance({ mi_traveled: 10.22 })).toEqual({
|
|
31
|
+
value: 10.22,
|
|
32
|
+
system: 'imperial'
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
test('throws', () => {
|
|
37
|
+
expect(() => {
|
|
38
|
+
config.getDistance({})
|
|
39
|
+
}).toThrow('/api/v1/missions/')
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
describe('DistanceStats - /spice_data/getRangefromT1/', () => {
|
|
44
|
+
const config = supportedAPIPaths['/spice_data/getRangefromT1/']
|
|
45
|
+
|
|
46
|
+
beforeEach(() => {
|
|
47
|
+
console.error = () => {}
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
afterEach(() => {
|
|
51
|
+
console.error = consoleError
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
test('gets the correct path', () => {
|
|
55
|
+
expect(
|
|
56
|
+
config.getPath(
|
|
57
|
+
'https://mars.nasa.gov/spice_data/getRangefromT1/EARTH/MARS/2020-10-19T11:29:0/2020-10-19T11:34:0/1/',
|
|
58
|
+
'/spice_data/getRangefromT1/'
|
|
59
|
+
)
|
|
60
|
+
).toMatch(/\/api\/mars\/spice_data\/getRangefromT1\/EARTH\/MARS\/.+\/.+\/1\//)
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
test('also gets the correct path', () => {
|
|
64
|
+
expect(
|
|
65
|
+
config.getPath(
|
|
66
|
+
'https://mars.nasa.gov/spice_data/getRangefromT1/VENUS/MARS/',
|
|
67
|
+
'/spice_data/getRangefromT1/'
|
|
68
|
+
)
|
|
69
|
+
).toMatch(/\/api\/mars\/spice_data\/getRangefromT1\/VENUS\/MARS\/.+\/.+\/1\//)
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
test('throws', () => {
|
|
73
|
+
const config = supportedAPIPaths['/spice_data/getRangefromT1/']
|
|
74
|
+
expect(() => {
|
|
75
|
+
config.getPath('https://mars.nasa.gov/spice_data/getRangefromT1/1')
|
|
76
|
+
}).toThrow()
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
test('gets the correct distance', () => {
|
|
80
|
+
expect(
|
|
81
|
+
config.getDistance(
|
|
82
|
+
{
|
|
83
|
+
items: [{ value: (4500.23).toString() }],
|
|
84
|
+
error: false,
|
|
85
|
+
units: 'KM'
|
|
86
|
+
},
|
|
87
|
+
0
|
|
88
|
+
)
|
|
89
|
+
).toEqual({
|
|
90
|
+
value: 4500,
|
|
91
|
+
system: 'metric'
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
test('throws if error flag is set', () => {
|
|
96
|
+
expect(() => {
|
|
97
|
+
config.getDistance(
|
|
98
|
+
{
|
|
99
|
+
items: [{ value: (4500.23).toString() }],
|
|
100
|
+
error: true,
|
|
101
|
+
units: 'KM'
|
|
102
|
+
},
|
|
103
|
+
0
|
|
104
|
+
)
|
|
105
|
+
}).toThrow()
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
test('throws if unit is unexpected', () => {
|
|
109
|
+
expect(() => {
|
|
110
|
+
config.getDistance(
|
|
111
|
+
{
|
|
112
|
+
items: [{ value: (4500.23).toString() }],
|
|
113
|
+
error: false,
|
|
114
|
+
units: 'AU'
|
|
115
|
+
},
|
|
116
|
+
0
|
|
117
|
+
)
|
|
118
|
+
}).toThrow()
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
test('throws if there is no data', () => {
|
|
122
|
+
expect(() => {
|
|
123
|
+
config.getDistance(
|
|
124
|
+
{
|
|
125
|
+
items: [],
|
|
126
|
+
error: false,
|
|
127
|
+
units: 'KM'
|
|
128
|
+
},
|
|
129
|
+
0
|
|
130
|
+
)
|
|
131
|
+
}).toThrow()
|
|
132
|
+
})
|
|
133
|
+
})
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="typeof value !== 'undefined' || distanceApiUrls"
|
|
4
|
+
class="DistanceStats"
|
|
5
|
+
>
|
|
6
|
+
<slot
|
|
7
|
+
name="label"
|
|
8
|
+
:label="distanceTypeLabel"
|
|
9
|
+
>
|
|
10
|
+
<p>{{ distanceTypeLabel }}</p>
|
|
11
|
+
</slot>
|
|
12
|
+
<p v-if="showError">Unavailable</p>
|
|
13
|
+
<p v-else-if="isLoading">Loading…</p>
|
|
14
|
+
<BaseUnitToggle
|
|
15
|
+
v-else-if="loadedValue"
|
|
16
|
+
v-slot="slotProps"
|
|
17
|
+
unit-pair="MI_KM"
|
|
18
|
+
:value="loadedValue"
|
|
19
|
+
:value-system="loadedSystem"
|
|
20
|
+
>
|
|
21
|
+
<slot
|
|
22
|
+
name="value"
|
|
23
|
+
:formatted-value="slotProps.formattedValue"
|
|
24
|
+
>
|
|
25
|
+
{{ slotProps.formattedValue }}
|
|
26
|
+
</slot>
|
|
27
|
+
</BaseUnitToggle>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
<script lang="ts">
|
|
31
|
+
// @ts-nocheck
|
|
32
|
+
import type { PropType } from 'vue'
|
|
33
|
+
import { defineComponent } from 'vue'
|
|
34
|
+
import dayjs from 'dayjs'
|
|
35
|
+
import BaseUnitToggle, { UnitSystemName } from './../BaseUnitToggle/BaseUnitToggle.vue'
|
|
36
|
+
|
|
37
|
+
export const distanceTypes = {
|
|
38
|
+
earth: 'Distance from Earth',
|
|
39
|
+
mars: 'Distance traveled on Mars'
|
|
40
|
+
} as const
|
|
41
|
+
export type DistanceType = keyof typeof distanceTypes
|
|
42
|
+
|
|
43
|
+
type APIDistance = { value: number; system: UnitSystemName }
|
|
44
|
+
|
|
45
|
+
type SPICEPlanetsResponse = {
|
|
46
|
+
items: {
|
|
47
|
+
date: string
|
|
48
|
+
value: string
|
|
49
|
+
}[]
|
|
50
|
+
error: boolean
|
|
51
|
+
units: 'KM'
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Map from mars.nasa.gov API endpoint URLs to our corresponding proxied path.
|
|
56
|
+
*/
|
|
57
|
+
export const supportedAPIPaths = {
|
|
58
|
+
'/api/v1/missions/': {
|
|
59
|
+
/**
|
|
60
|
+
* Query based on mission ID only.
|
|
61
|
+
* Throws an error if there is no mission ID.
|
|
62
|
+
*/
|
|
63
|
+
getPath: (endpointURL: string, match: string): string => {
|
|
64
|
+
const query = endpointURL.split(match)[1]
|
|
65
|
+
|
|
66
|
+
if (!query) {
|
|
67
|
+
console.error(endpointURL, match)
|
|
68
|
+
throw new Error('Error querying /api/v1/missions/ API')
|
|
69
|
+
}
|
|
70
|
+
return `/api/mars${match}${query}`
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* Extract the distance from the single field.
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
getDistance: (data: { mi_traveled: number }): APIDistance => {
|
|
77
|
+
const value = data?.mi_traveled
|
|
78
|
+
|
|
79
|
+
if (typeof value === 'undefined') {
|
|
80
|
+
console.error(data)
|
|
81
|
+
throw new Error('Error processing /api/v1/missions/ data')
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
value: data.mi_traveled,
|
|
85
|
+
system: 'imperial'
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
'/spice_data/getRangefromT1/': {
|
|
90
|
+
/**
|
|
91
|
+
* Query SPICE data based on a planets pair and a pair of current time + future datetime (arbitrary).
|
|
92
|
+
* Fails if the endpoint URL is not of the expected format.
|
|
93
|
+
*/
|
|
94
|
+
getPath: (endpointURL: string, match: string): string => {
|
|
95
|
+
const query = endpointURL.split(match)[1]
|
|
96
|
+
const queryParams = query.split('/')
|
|
97
|
+
const planets = `${queryParams[0]}/${queryParams[1]}/`
|
|
98
|
+
const range = [dayjs(), dayjs().add(1, 'minute')]
|
|
99
|
+
// Generates the date format expected by the endpoint – ISO 8601, minus milliseconds and zero UTC offset indicator.
|
|
100
|
+
.map((d) => d.toISOString().replace(/\.\d+Z$/, ''))
|
|
101
|
+
.join('/')
|
|
102
|
+
return `/api/mars/spice_data/getRangefromT1/${planets}${range}/1/`
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* Extract a single value from a SPICE data array.
|
|
106
|
+
*/
|
|
107
|
+
getDistance: (data: SPICEPlanetsResponse, index: number): APIDistance => {
|
|
108
|
+
const value = data?.items[index]?.value
|
|
109
|
+
if (data.error || data.units !== 'KM' || typeof value === 'undefined') {
|
|
110
|
+
console.error(data, index)
|
|
111
|
+
throw new Error('Error processing /spice_data/getRangefromT1/ data')
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
// Matches the rounding from the reference implementation, https://mars.nasa.gov/msl/home/.
|
|
115
|
+
value: Math.round(Number(value)),
|
|
116
|
+
system: 'metric'
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
} as const
|
|
121
|
+
type SupportedAPI = keyof typeof supportedAPIPaths
|
|
122
|
+
type SPICEAPIConfig = (typeof supportedAPIPaths)['/spice_data/getRangefromT1/']
|
|
123
|
+
const supportedPaths = Object.keys(supportedAPIPaths) as SupportedAPI[]
|
|
124
|
+
|
|
125
|
+
// Normally this should just be `number`, but due to our usage of `@types/node`
|
|
126
|
+
// we need to define this in a way that is compatible with both Node and browser code.
|
|
127
|
+
type Timeout = ReturnType<typeof setTimeout>
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Display a distance stat – label, value, unit toggle,
|
|
131
|
+
* either from a predefined value, or supported API endpoint.
|
|
132
|
+
*/
|
|
133
|
+
export default defineComponent({
|
|
134
|
+
name: 'DistanceStats',
|
|
135
|
+
components: {
|
|
136
|
+
BaseUnitToggle
|
|
137
|
+
},
|
|
138
|
+
props: {
|
|
139
|
+
distanceType: {
|
|
140
|
+
type: String as PropType<DistanceType | ''>,
|
|
141
|
+
required: true,
|
|
142
|
+
validator: (val: string): boolean => val === '' || Object.keys(distanceTypes).includes(val)
|
|
143
|
+
},
|
|
144
|
+
value: Number,
|
|
145
|
+
valueSystem: {
|
|
146
|
+
type: String as PropType<UnitSystemName>,
|
|
147
|
+
required: false,
|
|
148
|
+
default: 'imperial'
|
|
149
|
+
},
|
|
150
|
+
distanceApiUrls: {
|
|
151
|
+
type: String,
|
|
152
|
+
required: false,
|
|
153
|
+
validator: (val: string): boolean => supportedPaths.some((p) => val.includes(p) || val === '')
|
|
154
|
+
},
|
|
155
|
+
labelClass: String
|
|
156
|
+
},
|
|
157
|
+
data(): {
|
|
158
|
+
apiDistance: APIDistance | null
|
|
159
|
+
showError: boolean
|
|
160
|
+
timeout: Timeout | null
|
|
161
|
+
} {
|
|
162
|
+
return {
|
|
163
|
+
apiDistance: null,
|
|
164
|
+
showError: false,
|
|
165
|
+
timeout: null
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
computed: {
|
|
169
|
+
distanceTypeLabel(): string {
|
|
170
|
+
return distanceTypes[this.distanceType as DistanceType] || this.distanceType
|
|
171
|
+
},
|
|
172
|
+
loadedValue(): number | undefined {
|
|
173
|
+
if (this.distanceApiUrls) {
|
|
174
|
+
return this.apiDistance?.value || 0
|
|
175
|
+
}
|
|
176
|
+
return this.value
|
|
177
|
+
},
|
|
178
|
+
loadedSystem(): UnitSystemName {
|
|
179
|
+
if (this.distanceApiUrls) {
|
|
180
|
+
return this.apiDistance?.system || 'imperial'
|
|
181
|
+
}
|
|
182
|
+
return this.valueSystem
|
|
183
|
+
},
|
|
184
|
+
isLoading(): boolean {
|
|
185
|
+
return !!this.distanceApiUrls && this.apiDistance === null
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
mounted() {
|
|
189
|
+
if (this.distanceApiUrls) {
|
|
190
|
+
this.getAPIDistance()
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
beforeUnmount(): void {
|
|
194
|
+
clearTimeout(this.timeout as Timeout)
|
|
195
|
+
},
|
|
196
|
+
methods: {
|
|
197
|
+
/**
|
|
198
|
+
* Retrieve distance data from supported API endpoints.
|
|
199
|
+
*/
|
|
200
|
+
async getAPIDistance(): Promise<void> {
|
|
201
|
+
// Wrap everything in a try…catch. All this code depends
|
|
202
|
+
// on the APIs’ data formats, which may change, and should
|
|
203
|
+
// be handled elegantly if possible.
|
|
204
|
+
try {
|
|
205
|
+
const match = supportedPaths.find((key: SupportedAPI) =>
|
|
206
|
+
this.distanceApiUrls?.includes(key)
|
|
207
|
+
)
|
|
208
|
+
if (match && this.distanceApiUrls) {
|
|
209
|
+
const apiConfig = supportedAPIPaths[match]
|
|
210
|
+
const path = apiConfig.getPath(this.distanceApiUrls, match)
|
|
211
|
+
const data = await this.$axios.$get(path)
|
|
212
|
+
|
|
213
|
+
// Special treatment for SPICE data that returns an array of predicted distances for future times, in 1-sec increments.
|
|
214
|
+
if (match === '/spice_data/getRangefromT1/') {
|
|
215
|
+
this.updateSPICEData(apiConfig as SPICEAPIConfig, data, 0)
|
|
216
|
+
} else {
|
|
217
|
+
this.apiDistance = apiConfig.getDistance(data, 0)
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
} catch (e) {
|
|
221
|
+
console.error(e)
|
|
222
|
+
this.showError = true
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Special logic for SPICE data that can be live-updated.
|
|
228
|
+
* Automatically cycles through the data array, and
|
|
229
|
+
* automatically makes more requests for more data when needed.
|
|
230
|
+
*/
|
|
231
|
+
async updateSPICEData(
|
|
232
|
+
apiConfig: SPICEAPIConfig,
|
|
233
|
+
data: SPICEPlanetsResponse,
|
|
234
|
+
index: number
|
|
235
|
+
): Promise<void> {
|
|
236
|
+
this.apiDistance = apiConfig.getDistance(data, index)
|
|
237
|
+
const next = index + 1
|
|
238
|
+
|
|
239
|
+
if (next < data?.items?.length) {
|
|
240
|
+
this.timeout = setTimeout(this.updateSPICEData.bind(this, apiConfig, data, next), 1000)
|
|
241
|
+
} else if (this.distanceApiUrls) {
|
|
242
|
+
const nextData = await this.$axios.$get(
|
|
243
|
+
apiConfig.getPath(this.distanceApiUrls, '/spice_data/getRangefromT1/')
|
|
244
|
+
)
|
|
245
|
+
this.updateSPICEData(apiConfig, nextData, 0)
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
})
|
|
250
|
+
</script>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import MissionDetailStats, { statuses, clockTypes } from './MissionDetailStats.vue'
|
|
2
|
+
import MissionDetailStatsMini from './MissionDetailStatsMini.vue'
|
|
3
|
+
import MissionDetailStatsMicro from './MissionDetailStatsMicro.vue'
|
|
4
|
+
import { distanceTypes } from './DistanceStats.vue'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'WWW/MissionDetail/MissionDetailStats',
|
|
8
|
+
component: MissionDetailStats,
|
|
9
|
+
subcomponents: { MissionDetailStatsMini, MissionDetailStatsMicro },
|
|
10
|
+
decorators: [
|
|
11
|
+
() => ({
|
|
12
|
+
template: `<div id="storyDecorator" class="mt-20"><story/></div>`
|
|
13
|
+
})
|
|
14
|
+
],
|
|
15
|
+
parameters: {
|
|
16
|
+
html: {
|
|
17
|
+
root: '#storyDecorator'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
excludeStories: /.*(Data)$/,
|
|
21
|
+
argTypes: {
|
|
22
|
+
status: {
|
|
23
|
+
control: { type: 'select' },
|
|
24
|
+
options: Object.keys(statuses)
|
|
25
|
+
},
|
|
26
|
+
clockType: {
|
|
27
|
+
control: { type: 'select' },
|
|
28
|
+
options: Object.keys(clockTypes)
|
|
29
|
+
},
|
|
30
|
+
distanceType: {
|
|
31
|
+
control: {
|
|
32
|
+
type: 'select'
|
|
33
|
+
},
|
|
34
|
+
options: Object.keys(distanceTypes).concat([''])
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const MissionDetailStatsData = {
|
|
40
|
+
showClock: true,
|
|
41
|
+
showDistance: true,
|
|
42
|
+
clockType: 'countdown',
|
|
43
|
+
startDateTime: '2021-02-18T20:55:00+00:00',
|
|
44
|
+
distanceType: 'earth',
|
|
45
|
+
distanceValue: 4986444,
|
|
46
|
+
distanceApiUrls: '',
|
|
47
|
+
displayDate: 'Oct. 1, 2020',
|
|
48
|
+
missionTypes: [{ missionType: 'Landers/Rovers' }],
|
|
49
|
+
missionTargets: [{ target: 'Mars' }],
|
|
50
|
+
status: 'future'
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const Full = {
|
|
54
|
+
args: MissionDetailStatsData,
|
|
55
|
+
render: (args) => ({
|
|
56
|
+
setup() {
|
|
57
|
+
return { args }
|
|
58
|
+
},
|
|
59
|
+
components: { MissionDetailStats },
|
|
60
|
+
template: '<MissionDetailStats v-bind="args" />'
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const Mini = {
|
|
65
|
+
args: {
|
|
66
|
+
showClock: MissionDetailStatsData.showClock,
|
|
67
|
+
showDistance: MissionDetailStatsData.showDistance,
|
|
68
|
+
clockType: MissionDetailStatsData.clockType,
|
|
69
|
+
startDateTime: '2021-02-18T20:55:00+00:00',
|
|
70
|
+
distanceType: MissionDetailStatsData.distanceType,
|
|
71
|
+
distanceValue: MissionDetailStatsData.distanceValue
|
|
72
|
+
},
|
|
73
|
+
render: (args) => ({
|
|
74
|
+
setup() {
|
|
75
|
+
return { args }
|
|
76
|
+
},
|
|
77
|
+
components: { MissionDetailStatsMini },
|
|
78
|
+
template: '<MissionDetailStatsMini v-bind="args" />'
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const Micro = {
|
|
83
|
+
args: {
|
|
84
|
+
showClock: MissionDetailStatsData.showClock,
|
|
85
|
+
clockType: MissionDetailStatsData.clockType,
|
|
86
|
+
startDateTime: '2021-02-18T20:55:00+00:00'
|
|
87
|
+
},
|
|
88
|
+
render: (args) => ({
|
|
89
|
+
setup() {
|
|
90
|
+
return { args }
|
|
91
|
+
},
|
|
92
|
+
components: { MissionDetailStatsMicro },
|
|
93
|
+
template: '<MissionDetailStatsMicro v-bind="args" />'
|
|
94
|
+
})
|
|
95
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils'
|
|
2
|
+
|
|
3
|
+
import MissionDetailStats from './MissionDetailStats.vue'
|
|
4
|
+
|
|
5
|
+
describe('MissionDetailStats', () => {
|
|
6
|
+
test('renders with partial data', () => {
|
|
7
|
+
mount(MissionDetailStats, {
|
|
8
|
+
propsData: {
|
|
9
|
+
showClock: false,
|
|
10
|
+
showDistance: false,
|
|
11
|
+
clockType: 'countdown',
|
|
12
|
+
startDateTime: null,
|
|
13
|
+
distanceType: '',
|
|
14
|
+
distanceValue: null,
|
|
15
|
+
distanceApiUrls: '',
|
|
16
|
+
displayDate: null,
|
|
17
|
+
missionTypes: [],
|
|
18
|
+
missionTargets: [],
|
|
19
|
+
status: 'draft'
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
})
|