@explorer-1/vue 0.2.39 → 0.2.41

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.
Files changed (72) hide show
  1. package/components.d.ts +3 -0
  2. package/dist/explorer-1-vue.js +4912 -4553
  3. package/dist/explorer-1-vue.umd.cjs +13 -13
  4. package/dist/src/components/BasePill/BasePill.vue.d.ts +4 -10
  5. package/dist/src/components/BaseSwimlane/BaseSwimlane.vue.d.ts +2 -2
  6. package/dist/src/components/BlockIframeEmbed/BlockIframeEmbed.vue.d.ts +9 -1
  7. package/dist/src/components/BlockImage/BlockImageFullBleed.vue.d.ts +23 -4
  8. package/dist/src/components/BlockImage/BlockImageStandard.vue.d.ts +23 -4
  9. package/dist/src/components/BlockImageComparison/BlockImageComparison.vue.d.ts +11 -1
  10. package/dist/src/components/BlockVideo/BlockVideo.vue.d.ts +19 -1
  11. package/dist/src/components/BlockVideoEmbed/BlockVideoEmbed.vue.d.ts +9 -0
  12. package/dist/src/components/DetailHeadline/DetailHeadline.vue.d.ts +9 -0
  13. package/dist/src/components/HeroListingIndex/HeroListingIndex.stories.d.ts +82 -93
  14. package/dist/src/components/MetadataEduResource/MetadataEduResource.vue.d.ts +4 -0
  15. package/dist/src/components/MetadataEvent/MetadataEvent.stories.d.ts +1 -0
  16. package/dist/src/components/MixinCarousel/MixinCarousel.stories.d.ts +4 -4
  17. package/dist/src/components/MixinCarousel/MixinCarousel.vue.d.ts +2 -2
  18. package/dist/src/components/MixinFancybox/MixinFancybox.vue.d.ts +1 -1
  19. package/dist/src/components/NavDesktop/NavDesktop.stories.d.ts +4 -4
  20. package/dist/src/components/NavDesktop/NavDesktop.vue.d.ts +2 -2
  21. package/dist/src/components/NavDesktopEdu/NavDesktopEdu.stories.d.ts +2 -2
  22. package/dist/src/components/NavMobile/NavMobile.stories.d.ts +3 -3
  23. package/dist/src/components/NavMobile/NavMobile.vue.d.ts +1 -1
  24. package/dist/src/components/NavMobile/NavMobileEdu.stories.d.ts +3 -3
  25. package/dist/src/components/NavSecondary/NavSecondaryDropdown.vue.d.ts +4 -4
  26. package/dist/src/components/NewsDetailMediaContact/NewsDetailMediaContact.vue.d.ts +1 -1
  27. package/dist/src/components/SearchFilterGroup/SearchFilterGroup.vue.d.ts +7 -0
  28. package/dist/src/components/SearchResultCard/SearchResultCard.vue.d.ts +54 -5
  29. package/dist/src/components/SearchResultGridItem/SearchResultGridItem.vue.d.ts +42 -4
  30. package/dist/src/components/TextArea/TextArea.vue.d.ts +9 -9
  31. package/dist/src/components/TextInput/TextInput.vue.d.ts +9 -9
  32. package/dist/src/constants.d.ts +12 -2
  33. package/dist/src/interfaces.d.ts +16 -9
  34. package/dist/src/templates/edu/PageEduGalleryDetail/PageEduGalleryDetail.stories.d.ts +284 -0
  35. package/dist/src/templates/edu/PageEduLesson/PageEduLesson.stories.d.ts +8 -2
  36. package/dist/src/templates/edu/PageEduMultimediaDetail/PageEduMultimediaDetail.stories.d.ts +359 -0
  37. package/dist/src/utils/getHeadingId.d.ts +1 -3
  38. package/dist/src/utils/lookupContentType.d.ts +3 -0
  39. package/dist/src/utils/mixins.d.ts +1 -1
  40. package/dist/style.css +1 -1
  41. package/package.json +2 -2
  42. package/src/components/BaseButton/BaseButton.vue +3 -3
  43. package/src/components/BaseCarousel/BaseCarousel.vue +152 -0
  44. package/src/components/BaseImageCaption/BaseImageCaption.vue +10 -7
  45. package/src/components/BlockImage/BlockImageFullBleed.vue +37 -7
  46. package/src/components/BlockImage/BlockImageStandard.vue +36 -8
  47. package/src/components/BlockImageComparison/BlockImageComparison.vue +23 -20
  48. package/src/components/BlockLinkCard/BlockLinkCard.vue +1 -0
  49. package/src/components/BlockRelatedLinks/RelatedLink.vue +2 -2
  50. package/src/components/BlockVideo/BlockVideo.vue +22 -2
  51. package/src/components/BlockVideoEmbed/BlockVideoEmbed.vue +10 -2
  52. package/src/components/DetailHeadline/DetailHeadline.vue +11 -6
  53. package/src/components/HeroListingIndex/HeroListingIndex.stories.js +92 -100
  54. package/src/components/HeroListingIndex/HeroListingIndex.vue +13 -15
  55. package/src/components/HeroMedium/HeroMedium.vue +1 -1
  56. package/src/components/MetadataEduResource/MetadataEduResource.vue +8 -2
  57. package/src/components/MetadataEvent/MetadataEvent.stories.js +1 -0
  58. package/src/components/MetadataEvent/MetadataEvent.vue +24 -8
  59. package/src/components/NavDesktop/NavDesktop.vue +6 -4
  60. package/src/components/NavDesktopEdu/NavDesktopEdu.vue +7 -3
  61. package/src/components/NavMobile/NavMobile.vue +5 -3
  62. package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.vue +5 -3
  63. package/src/components/SearchFilterGroup/SearchFilterGroup.vue +26 -24
  64. package/src/components/SearchResultCard/SearchResultCard.vue +17 -1
  65. package/src/components/SearchResultGridItem/SearchResultGridItem.vue +17 -1
  66. package/src/components/SearchResultsList/SearchResultsList.vue +25 -1
  67. package/src/interfaces.ts +4 -0
  68. package/src/templates/edu/PageEduGalleryDetail/PageEduGalleryDetail.stories.js +13 -4
  69. package/src/templates/edu/PageEduGalleryDetail/PageEduGalleryDetail.vue +36 -18
  70. package/src/templates/edu/PageEduMultimediaDetail/PageEduMultimediaDetail.vue +1 -0
  71. package/src/templates/www/PageTimeline/PageTimeline.vue +5 -1
  72. package/src/utils/mixins.ts +8 -6
@@ -31,6 +31,9 @@
31
31
  :event-type="page.eventType"
32
32
  :ongoing="page.ongoing"
33
33
  :location="page.location"
34
+ :primary-subject="page.primarySubject as unknown as PrimarySubjectObject"
35
+ :grade-levels="page.gradeLevels as unknown as GradeLevelsObject[]"
36
+ :time="page.time as unknown as EduResourcesTime"
34
37
  :title="page.title"
35
38
  :summary="page.summary"
36
39
  :featured="featureFirstResult ? index === 0 && currentPage === 1 : false"
@@ -53,6 +56,9 @@
53
56
  :event-type="page.eventType"
54
57
  :ongoing="page.ongoing"
55
58
  :location="page.location"
59
+ :primary-subject="page.primarySubject as unknown as PrimarySubjectObject"
60
+ :grade-levels="page.gradeLevels as unknown as GradeLevelsObject[]"
61
+ :time="page.time as unknown as EduResourcesTime"
56
62
  :title="page.title"
57
63
  heading-level="h2"
58
64
  />
@@ -64,7 +70,7 @@
64
70
  <script lang="ts">
65
71
  import { defineComponent } from 'vue'
66
72
  import type { ElasticSearchPage } from '../../interfaces'
67
-
73
+ import type { PrimarySubjectObject, GradeLevelsObject, EduResourcesTime } from './../../interfaces'
68
74
  // @ts-ignore
69
75
  import dayjs from 'dayjs'
70
76
  import SearchResultCard from './../SearchResultCard/SearchResultCard.vue'
@@ -131,6 +137,9 @@ export default defineComponent({
131
137
  // date field is different for mission and event detail pages
132
138
  let date
133
139
  let location
140
+ let primarySubject
141
+ let gradeLevels
142
+ let time
134
143
  let topic =
135
144
  handle === 'missions_mission'
136
145
  ? page._source[handle + '__status_filter']
@@ -152,6 +161,17 @@ export default defineComponent({
152
161
  } else if (handle === 'profiles_profilepage') {
153
162
  topic = page._source[handle + '__go_site_name']
154
163
  date = null
164
+ } else if (handle.startsWith('edu_resources')) {
165
+ date = null
166
+ primarySubject = page._source[handle + '__primary_subject'] as PrimarySubjectObject
167
+ if (page._source[handle + '__grade_levels']) {
168
+ gradeLevels = [] as GradeLevelsObject[]
169
+ // @ts-expect-error
170
+ page._source[handle + '__grade_levels'].forEach((level) => {
171
+ gradeLevels.push({ gradeLevel: level.grade_level })
172
+ })
173
+ }
174
+ time = { time: page._source.activity_time_label_filter } as EduResourcesTime
155
175
  } else {
156
176
  date =
157
177
  typeof page._source.publication_date_filter !== 'undefined'
@@ -196,6 +216,10 @@ export default defineComponent({
196
216
  handle === 'edu_events_edueventpage'
197
217
  ? page._source.edu_events_edueventpage__ongoing
198
218
  : undefined
219
+ // edu resources
220
+ page.gradeLevels = gradeLevels
221
+ page.time = time
222
+ page.primarySubject = primarySubject
199
223
  // properties that are different for profiles page
200
224
  page.summary =
201
225
  handle === 'profiles_profilepage'
package/src/interfaces.ts CHANGED
@@ -92,6 +92,9 @@ export interface ElasticSearchPage {
92
92
  summary?: string
93
93
  eventType?: string
94
94
  ongoing?: boolean
95
+ primarySubject?: string
96
+ gradeLevels: string
97
+ time: string
95
98
  }
96
99
 
97
100
  export interface FormOption {
@@ -129,6 +132,7 @@ export interface EventCardObject extends Card {
129
132
  eventType?: string
130
133
  ongoing?: boolean
131
134
  isVirtualEvent?: boolean
135
+ isInPersonEvent?: boolean
132
136
  locationName?: string
133
137
  location?: string
134
138
  locationLink?: string
@@ -1,4 +1,3 @@
1
- import { BlockKeyPointsData } from './../../../components/BlockKeyPoints/BlockKeyPoints.stories'
2
1
  import { BlockLinkCardCarouselData } from './../../../components/BlockLinkCarousel/BlockLinkCarousel.stories.js'
3
2
  import { EventsBlockLinkCarouselData } from './../../../components/BlockLinkCarousel/BlockLinkCarousel.stories'
4
3
  import { AboutTheAuthorData } from './../../../components/AboutTheAuthor/AboutTheAuthor.stories'
@@ -33,6 +32,12 @@ const PageEduGalleryDetailData = {
33
32
  authors: AboutTheAuthorData,
34
33
 
35
34
  body: [
35
+ {
36
+ blockType: 'HeadingBlock',
37
+ heading: 'Gallery Body',
38
+ level: 'h2',
39
+ size: 'h2'
40
+ },
36
41
  {
37
42
  blockType: 'RichTextBlock',
38
43
  value:
@@ -75,6 +80,7 @@ export const BaseStory = {
75
80
  {
76
81
  blockId: `${Math.random().toString(36).slice(2)}`,
77
82
  heading: 'Gallery Item Heading',
83
+ externalLink: 'https://nasa.gov',
78
84
  description:
79
85
  '<p data-block-key="53wg6">Description that is <strong>rich text</strong>.</p>',
80
86
  media: [{ ...BlockImageData, blockType: 'ImageBlock' }]
@@ -82,22 +88,25 @@ export const BaseStory = {
82
88
  {
83
89
  blockId: `${Math.random().toString(36).slice(2)}`,
84
90
  heading: 'Gallery Item Heading',
91
+ externalLink: 'https://nasa.gov',
85
92
  description:
86
- '<p data-block-key="53wg6">Description that is <strong>rich text</strong>.</p>',
93
+ '<p data-block-key="5f55p">Description with richtext images.</p><img alt="Perseverance Looks Back at &amp;#x27;Bright Angel&amp;#x27;" class="richtext-image full-width" height="600" src="https://picsum.photos/800/600" width="800"><p data-block-key="89jcq">More text and an image that&#x27;s full width (above)</p><p data-block-key="6jsp"></p><img alt="Carbon Mapper Coalition&amp;#x27;s Tanager Satellite" class="richtext-image right" height="263" src="https://picsum.photos/500/263" width="500"><p data-block-key="4409g">More text and an image that&#x27;s right-aligned. Morbi mollis magna erat, a tristique libero laoreet ut. Curabitur sit amet arcu laoreet, aliquet nibh at, dictum sapien. Duis a tempus nibh. Phasellus porta felis id diam fringilla tincidunt. Curabitur eget gravida leo. Vestibulum sapien nibh, pharetra eget ornare eu, tristique at purus.</p><p data-block-key="bid36"></p><img alt="Lecture Brings Galileo&amp;#x27;s Travels into Final Focus" class="richtext-image left" height="273" src="https://picsum.photos/500/273" width="500"><p data-block-key="1f4rd">More text and an image that&#x27;s left-aligned. Morbi mollis magna erat, a tristique libero laoreet ut. Curabitur sit amet arcu laoreet, aliquet nibh at, dictum sapien. Duis a tempus nibh. Phasellus porta felis id diam fringilla tincidunt. Curabitur eget gravida leo. Vestibulum sapien nibh, pharetra eget ornare eu, tristique at purus. Duis id risus sit amet est maximus placerat a quis sem. Donec lacus sem, cursus at quam sit amet, consequat vestibulum nulla. </p>',
87
94
  media: [BlockImageComparisonData]
88
95
  },
89
96
  {
90
97
  blockId: `${Math.random().toString(36).slice(2)}`,
91
98
  heading: 'Gallery Item Heading',
99
+ externalLink: 'https://nasa.gov',
92
100
  description:
93
- '<p data-block-key="53wg6">Description that is <strong>rich text</strong>.</p>',
101
+ '<p data-block-key="5f55p">Description with a richtext embedded video below it.</p><div>\n <iframe width="200" height="113" src="https://www.youtube.com/embed/C5aC-U9jHDE?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen title="How Do We Know Where Faraway Spacecraft Are?"></iframe>\n</div>\n<p data-block-key="4t2tv">More text below the embedded video.</p>',
94
102
  media: [BlockVideoData.block]
95
103
  },
96
104
  {
97
105
  blockId: `${Math.random().toString(36).slice(2)}`,
98
106
  heading: 'Gallery Item Heading',
107
+ externalLink: 'https://nasa.gov',
99
108
  description:
100
- '<p data-block-key="53wg6">Description that is <strong>rich text</strong>.</p>',
109
+ '<p data-block-key="5f55p">Description with richtext images.</p><img alt="Perseverance Looks Back at &amp;#x27;Bright Angel&amp;#x27;" class="richtext-image full-width" height="600" src="https://picsum.photos/800/600" width="800"><p data-block-key="89jcq">More text and another image that&#x27;s full width (above)</p><p data-block-key="6jsp"></p><img alt="Carbon Mapper Coalition&amp;#x27;s Tanager Satellite" class="richtext-image right" height="263" src="https://picsum.photos/500/263" width="500"><p data-block-key="4409g">Short text in-between two floating images.</p><p data-block-key="bid36"></p><img alt="Lecture Brings Galileo&amp;#x27;s Travels into Final Focus" class="richtext-image left" height="273" src="https://picsum.photos/500/273" width="500"><p data-block-key="1f4rd">More text and something that&#x27;s left-aligned. Morbi mollis magna erat, a tristique libero laoreet ut. Curabitur sit amet arcu laoreet, aliquet nibh at, dictum sapien. Duis a tempus nibh. Phasellus porta felis id diam fringilla tincidunt. Curabitur eget gravida leo. Vestibulum sapien nibh, pharetra eget ornare eu, tristique at purus.</p>',
101
110
  media: [BlockVideoEmbedData.data]
102
111
  }
103
112
  ]
@@ -16,6 +16,7 @@ import BlockVideoEmbed from './../../../components/BlockVideoEmbed/BlockVideoEmb
16
16
  import BlockRelatedLinks from './../../../components/BlockRelatedLinks/BlockRelatedLinks.vue'
17
17
  import BlockLinkCarousel from './../../../components/BlockLinkCarousel/BlockLinkCarousel.vue'
18
18
  import BlockText from './../../../components/BlockText/BlockText.vue'
19
+ import BlockStreamfield from './../../../components/BlockStreamfield/BlockStreamfield.vue'
19
20
  import NavJumpMenu from './../../../components/NavJumpMenu/NavJumpMenu.vue'
20
21
  import AboutTheAuthor from './../../../components/AboutTheAuthor/AboutTheAuthor.vue'
21
22
  import { getHeadingId } from '../../../utils/getHeadingId'
@@ -25,6 +26,7 @@ interface PageEduGalleryObject extends PageEduResourcesObject {
25
26
  blockId: string
26
27
  heading?: string
27
28
  description?: string
29
+ externalLink?: string
28
30
  media: StreamfieldBlockData[]
29
31
  }[]
30
32
  }
@@ -57,6 +59,7 @@ const jumpMenuHeadings = computed((): BreadcrumbPathObject[] => {
57
59
  }
58
60
  return itemHeadings
59
61
  })
62
+
60
63
  const { data } = reactive(props)
61
64
  </script>
62
65
  <template>
@@ -77,6 +80,7 @@ const { data } = reactive(props)
77
80
  :publication-date="data.publicationDate"
78
81
  schema
79
82
  pill
83
+ hide-date
80
84
  />
81
85
  <ShareButtonsEdu
82
86
  v-if="data?.url"
@@ -104,7 +108,10 @@ const { data } = reactive(props)
104
108
  :key="index"
105
109
  class="PageEduGalleryDetailItem"
106
110
  >
107
- <template v-if="item.media?.length">
111
+ <div
112
+ v-if="item.media?.length"
113
+ class="PageEduGalleryDetailItem__media mb-5 lg:mb-12"
114
+ >
108
115
  <template
109
116
  v-for="(block, _media_index) in item.media"
110
117
  :key="_media_index"
@@ -113,41 +120,41 @@ const { data } = reactive(props)
113
120
  <LayoutHelper
114
121
  v-if="block.image"
115
122
  indent="col-2"
116
- class="mb-5 lg:mb-10"
117
123
  >
118
124
  <BlockImageStandard
119
125
  :data="block.image"
120
126
  :caption="block.caption"
121
127
  :display-caption="block.displayCaption"
128
+ :custom-detail-url="item.externalLink"
122
129
  />
123
130
  </LayoutHelper>
124
131
  </template>
125
132
  <template v-else-if="block.blockType === 'ImageComparisonBlock'">
126
- <LayoutHelper
127
- indent="col-2"
128
- class="mb-5 lg:mb-10"
129
- >
130
- <BlockImageComparison :data="block" />
133
+ <LayoutHelper indent="col-2">
134
+ <BlockImageComparison
135
+ :data="block"
136
+ :custom-detail-url="item.externalLink"
137
+ />
131
138
  </LayoutHelper>
132
139
  </template>
133
140
  <template v-else-if="block.blockType === 'VideoBlock'">
134
- <LayoutHelper
135
- indent="col-2"
136
- class="mb-5 lg:mb-10"
137
- >
138
- <BlockVideo :data="block" />
141
+ <LayoutHelper indent="col-2">
142
+ <BlockVideo
143
+ :data="block"
144
+ :custom-detail-url="item.externalLink"
145
+ />
139
146
  </LayoutHelper>
140
147
  </template>
141
148
  <template v-else-if="block.blockType === 'VideoEmbedBlock'">
142
- <LayoutHelper
143
- indent="col-2"
144
- class="mb-5 lg:mb-10"
145
- >
146
- <BlockVideoEmbed :data="block" />
149
+ <LayoutHelper indent="col-2">
150
+ <BlockVideoEmbed
151
+ :data="block"
152
+ :custom-detail-url="item.externalLink"
153
+ />
147
154
  </LayoutHelper>
148
155
  </template>
149
156
  </template>
150
- </template>
157
+ </div>
151
158
  <LayoutHelper
152
159
  v-if="item.heading || item.description"
153
160
  indent="col-3"
@@ -164,6 +171,7 @@ const { data } = reactive(props)
164
171
  />
165
172
  </LayoutHelper>
166
173
  <LayoutHelper
174
+ v-if="index + 1 !== data.galleryItems?.length"
167
175
  indent="col-2"
168
176
  class="pt-10 lg:pt-18 mb-10 lg:mb-18"
169
177
  >
@@ -171,6 +179,16 @@ const { data } = reactive(props)
171
179
  </LayoutHelper>
172
180
  </div>
173
181
 
182
+ <div
183
+ v-if="data.body?.length"
184
+ class="my-10 lg:my-18"
185
+ >
186
+ <BlockStreamfield
187
+ v-if="data.body?.length"
188
+ :data="data.body"
189
+ />
190
+ </div>
191
+
174
192
  <!-- related links -->
175
193
  <LayoutHelper
176
194
  v-if="data.relatedLinks && data.relatedLinks.length"
@@ -180,6 +180,7 @@ const { data } = reactive(props)
180
180
  :publication-date="data.publicationDate"
181
181
  schema
182
182
  pill
183
+ hide-date
183
184
  />
184
185
  <ShareButtonsEdu
185
186
  v-if="data?.url"
@@ -209,7 +209,11 @@ export default defineComponent({
209
209
  },
210
210
  created() {
211
211
  const sortByParam = this.$route?.query.sortBy
212
- if (sortByParam && sortByOptions.some((option) => option.value === sortByParam)) {
212
+ if (
213
+ sortByParam &&
214
+ sortByOptions &&
215
+ sortByOptions.some((option) => option.value === sortByParam)
216
+ ) {
213
217
  this.sortBy = sortByParam as SortBy
214
218
  }
215
219
 
@@ -194,12 +194,14 @@ export const mixinIsActivePath = (itemPath: string): Boolean => {
194
194
  */
195
195
  export const mixinGetSrcSet = (srcSetObject: Partial<ImageObject>): string => {
196
196
  let srcSet = ''
197
- const valid = Object.keys(srcSetObject).some(function (key) {
198
- if (key.startsWith('screen')) {
199
- return true
200
- }
201
- return false
202
- })
197
+ const valid = Object.keys(srcSetObject)?.length
198
+ ? Object.keys(srcSetObject).some(function (key) {
199
+ if (key.startsWith('screen')) {
200
+ return true
201
+ }
202
+ return false
203
+ })
204
+ : false
203
205
  if (valid) {
204
206
  const srcSetArray: string[] = []
205
207
  for (const [key, value] of Object.entries(srcSetObject)) {