@explorer-1/vue 0.2.26 → 0.2.27
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/components.d.ts +2 -0
- package/dist/explorer-1-vue.js +1159 -1109
- package/dist/explorer-1-vue.umd.cjs +13 -13
- package/dist/src/components/BasePill/BasePill.vue.d.ts +4 -0
- package/dist/src/components/HeroLarge/HeroLarge.vue.d.ts +45 -3
- package/dist/src/components/HeroMedium/HeroMedium.vue.d.ts +1 -1
- package/dist/src/interfaces.d.ts +2 -0
- package/dist/src/templates/edu/PageEduCollectionsDetail/PageEduCollectionsDetail.stories.d.ts +123 -0
- package/dist/src/templates/edu/PageEduLesson/PageEduLesson.stories.d.ts +1 -0
- package/dist/src/templates/edu/PageEduTeachableMoment/PageEduTeachableMoment.stories.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/BasePill/BasePill.vue +4 -1
- package/src/components/BlockLinkCard/BlockLinkCard.vue +2 -2
- package/src/components/HeroInlineMedia/HeroInlineMedia.vue +77 -0
- package/src/components/HeroLarge/HeroLarge.vue +49 -10
- package/src/components/HeroMedium/HeroMedium.vue +1 -1
- package/src/components/MetaPanel/MetaPanel.vue +1 -1
- package/src/components/MetaPanelItems/MetaPanelItems.vue +11 -8
- package/src/constants.ts +11 -0
- package/src/interfaces.ts +1 -0
- package/src/templates/edu/PageEduCollectionsDetail/PageEduCollectionsDetail.stories.js +103 -0
- package/src/templates/edu/PageEduCollectionsDetail/PageEduCollectionsDetail.vue +146 -0
- package/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.vue +5 -42
- package/src/templates/edu/PageEduLesson/PageEduLesson.vue +4 -36
- package/src/templates/edu/PageEduTeachableMoment/PageEduTeachableMoment.vue +4 -42
- package/src/templates/www/PageRoboticsDetail/PageRoboticsDetail.vue +1 -1
- package/src/templates/www/PageTopicDetail/PageTopicDetail.vue +1 -1
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import { eduMetadataDictionary } from './../../constants'
|
|
|
6
6
|
// using borders to vertically center wonky font face
|
|
7
7
|
const variantMap: Attributes = {
|
|
8
8
|
primary: 'bg-primary border-primary',
|
|
9
|
+
'primary-inverted': 'bg-gray-light-mid !text-primary-darker border-gray-light-mid',
|
|
9
10
|
secondary: 'bg-secondary border-secondary',
|
|
10
11
|
action: 'bg-action border-action'
|
|
11
12
|
}
|
|
@@ -20,13 +21,15 @@ interface BasePillProps {
|
|
|
20
21
|
variant?: string
|
|
21
22
|
size?: string
|
|
22
23
|
contentType?: string
|
|
24
|
+
invert?: boolean
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
// define props
|
|
26
28
|
const props = withDefaults(defineProps<BasePillProps>(), {
|
|
27
29
|
variant: 'primary',
|
|
28
30
|
size: 'md',
|
|
29
|
-
contentType: undefined
|
|
31
|
+
contentType: undefined,
|
|
32
|
+
invert: false
|
|
30
33
|
})
|
|
31
34
|
|
|
32
35
|
const metadataType = computed(() => {
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
<MetadataEduResource
|
|
125
125
|
v-else-if="metadataAttrs.type === 'resource'"
|
|
126
126
|
:resource="theItem as EduResourceCardObject"
|
|
127
|
-
:variant="metadataAttrs.
|
|
127
|
+
:variant="metadataAttrs.icons"
|
|
128
128
|
compact
|
|
129
129
|
/>
|
|
130
130
|
</div>
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
<div
|
|
133
133
|
v-if="!large"
|
|
134
134
|
class="BlockLinkCard__CardArrow ThemeVariantLight can-hover:block can-hover:-ml-3 can-hover:group-hover:delay-200 can-hover:opacity-0 can-hover:group-hover:ml-0 can-hover:group-hover:opacity-100 hidden -mt-1 text-2xl leading-normal transition-all duration-200 ease-in"
|
|
135
|
-
:class="metadataAttrs ? `text-${metadataAttrs.
|
|
135
|
+
:class="metadataAttrs ? `text-${metadataAttrs.icons}` : 'text-primary'"
|
|
136
136
|
>
|
|
137
137
|
<IconArrow />
|
|
138
138
|
</div>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, reactive } from 'vue'
|
|
3
|
+
import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
|
|
4
|
+
import BlockIframeEmbed from './../BlockIframeEmbed/BlockIframeEmbed.vue'
|
|
5
|
+
import BlockImageComparison from './../BlockImageComparison/BlockImageComparison.vue'
|
|
6
|
+
import BlockImageCarousel from './../BlockImageCarousel/BlockImageCarousel.vue'
|
|
7
|
+
import BlockImageStandard from './../BlockImage/BlockImageStandard.vue'
|
|
8
|
+
import BlockVideo from './../BlockVideo/BlockVideo.vue'
|
|
9
|
+
import type { StreamfieldBlockData } from './../../interfaces'
|
|
10
|
+
|
|
11
|
+
interface HeroInlineMediaProps {
|
|
12
|
+
heroBlocks: StreamfieldBlockData[]
|
|
13
|
+
constrain?: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const props = withDefaults(defineProps<HeroInlineMediaProps>(), {
|
|
17
|
+
heroBlocks: undefined,
|
|
18
|
+
constrain: false
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const { heroBlocks, constrain } = reactive(props)
|
|
22
|
+
|
|
23
|
+
const heroInline = computed(() => {
|
|
24
|
+
// heroes with interactive elements have special handling
|
|
25
|
+
if (heroBlocks?.length) {
|
|
26
|
+
// excludes VideoBlock as this will autoplay
|
|
27
|
+
if (heroBlocks[0].blockType === 'VideoBlock') {
|
|
28
|
+
return false
|
|
29
|
+
} else if (
|
|
30
|
+
heroBlocks[0].blockType === 'HeroImageBlock' ||
|
|
31
|
+
heroBlocks[0].blockType === 'CarouselBlock' ||
|
|
32
|
+
heroBlocks[0].blockType === 'IframeEmbedBlock' ||
|
|
33
|
+
heroBlocks[0].blockType === 'VideoEmbedBlock' ||
|
|
34
|
+
heroBlocks[0].blockType === 'ImageComparisonBlock'
|
|
35
|
+
) {
|
|
36
|
+
return true
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return false
|
|
40
|
+
})
|
|
41
|
+
</script>
|
|
42
|
+
<template>
|
|
43
|
+
<div v-if="heroBlocks?.length && heroInline">
|
|
44
|
+
<BlockImageStandard
|
|
45
|
+
v-if="heroBlocks[0].blockType === 'HeroImageBlock'"
|
|
46
|
+
:data="heroBlocks[0].imageInline"
|
|
47
|
+
:display-caption="heroBlocks[0].displayCaption"
|
|
48
|
+
:caption="heroBlocks[0].caption"
|
|
49
|
+
:constrain="constrain"
|
|
50
|
+
/>
|
|
51
|
+
<BlockImageCarousel
|
|
52
|
+
v-else-if="heroBlocks[0].blockType === 'CarouselBlock'"
|
|
53
|
+
:items="heroBlocks[0].blocks"
|
|
54
|
+
:block-id="heroBlocks[0].id"
|
|
55
|
+
/>
|
|
56
|
+
<BlockIframeEmbed
|
|
57
|
+
v-else-if="heroBlocks[0].blockType === 'IframeEmbedBlock'"
|
|
58
|
+
:data="heroBlocks[0]"
|
|
59
|
+
/>
|
|
60
|
+
<BlockVideo
|
|
61
|
+
v-else-if="heroBlocks[0].blockType === 'VideoBlock'"
|
|
62
|
+
:data="heroBlocks[0]"
|
|
63
|
+
autoplay
|
|
64
|
+
/>
|
|
65
|
+
<BaseImagePlaceholder
|
|
66
|
+
v-else-if="heroBlocks[0].blockType === 'VideoEmbedBlock'"
|
|
67
|
+
aspect-ratio="16:9"
|
|
68
|
+
dark-mode
|
|
69
|
+
>
|
|
70
|
+
<div v-html="heroBlocks[0].embed?.embed"></div>
|
|
71
|
+
</BaseImagePlaceholder>
|
|
72
|
+
<BlockImageComparison
|
|
73
|
+
v-else-if="heroBlocks[0].blockType === 'ImageComparisonBlock'"
|
|
74
|
+
:data="heroBlocks[0]"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
</template>
|
|
@@ -31,15 +31,30 @@
|
|
|
31
31
|
:class="{ 'pt-10': hasOverlay }"
|
|
32
32
|
>
|
|
33
33
|
<div
|
|
34
|
-
v-if="
|
|
35
|
-
class="lg:mb-6
|
|
34
|
+
v-if="customPill || customPillType || label"
|
|
35
|
+
class="lg:mb-6 mb-4"
|
|
36
36
|
>
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
<BasePill
|
|
38
|
+
v-if="customPill || customPillType"
|
|
39
|
+
variant="primary"
|
|
40
|
+
size="lg"
|
|
41
|
+
class="mr-3"
|
|
42
|
+
:content-type="customPillType"
|
|
43
|
+
>
|
|
44
|
+
{{ customPill }}
|
|
45
|
+
</BasePill>
|
|
46
|
+
<div
|
|
47
|
+
v-else-if="label"
|
|
48
|
+
class="font-secondary text-base font-semibold tracking-wider no-underline uppercase"
|
|
49
|
+
>
|
|
50
|
+
{{ label }}
|
|
51
|
+
<span class="sr-only">.</span>
|
|
52
|
+
</div>
|
|
39
53
|
</div>
|
|
40
54
|
<h1
|
|
41
55
|
v-if="title"
|
|
42
|
-
class="lg:w-3/4 xl:w-3/5 xl:text-10xl lg:text-9xl md:text-8xl text-7xl lg:tracking-tightest lg:leading-tighter mb-5 font-bold leading-tight
|
|
56
|
+
class="lg:w-3/4 xl:w-3/5 xl:text-10xl lg:text-9xl md:text-8xl text-7xl lg:tracking-tightest lg:leading-tighter mb-5 font-bold leading-tight"
|
|
57
|
+
:class="{ uppercase: !themeStore.isEdu }"
|
|
43
58
|
>
|
|
44
59
|
{{ title }}
|
|
45
60
|
</h1>
|
|
@@ -58,24 +73,45 @@
|
|
|
58
73
|
<script lang="ts">
|
|
59
74
|
import { defineComponent } from 'vue'
|
|
60
75
|
import { mixinTransparentHeader } from './../../utils/mixins'
|
|
76
|
+
import { mapStores } from 'pinia'
|
|
77
|
+
import { useThemeStore } from '../../store/theme'
|
|
78
|
+
import BasePill from './../BasePill/BasePill.vue'
|
|
79
|
+
|
|
61
80
|
export default defineComponent({
|
|
62
81
|
name: 'HeroLarge',
|
|
82
|
+
components: {
|
|
83
|
+
BasePill
|
|
84
|
+
},
|
|
63
85
|
props: {
|
|
64
|
-
|
|
86
|
+
label: {
|
|
87
|
+
type: String,
|
|
88
|
+
required: false,
|
|
89
|
+
default: undefined
|
|
90
|
+
},
|
|
91
|
+
customPill: {
|
|
65
92
|
type: String,
|
|
66
|
-
required: false
|
|
93
|
+
required: false,
|
|
94
|
+
default: undefined
|
|
95
|
+
},
|
|
96
|
+
customPillType: {
|
|
97
|
+
type: String,
|
|
98
|
+
required: false,
|
|
99
|
+
default: undefined
|
|
67
100
|
},
|
|
68
101
|
title: {
|
|
69
102
|
type: String,
|
|
70
|
-
required: false
|
|
103
|
+
required: false,
|
|
104
|
+
default: undefined
|
|
71
105
|
},
|
|
72
106
|
summary: {
|
|
73
107
|
type: String,
|
|
74
|
-
required: false
|
|
108
|
+
required: false,
|
|
109
|
+
default: undefined
|
|
75
110
|
},
|
|
76
111
|
image: {
|
|
77
112
|
type: Object,
|
|
78
|
-
required: false
|
|
113
|
+
required: false,
|
|
114
|
+
default: undefined
|
|
79
115
|
},
|
|
80
116
|
// If secondary nav is also on this page, will add more space above hero text
|
|
81
117
|
hasOverlay: {
|
|
@@ -83,6 +119,9 @@ export default defineComponent({
|
|
|
83
119
|
default: false
|
|
84
120
|
}
|
|
85
121
|
},
|
|
122
|
+
computed: {
|
|
123
|
+
...mapStores(useThemeStore)
|
|
124
|
+
},
|
|
86
125
|
mounted() {
|
|
87
126
|
mixinTransparentHeader()
|
|
88
127
|
}
|
|
@@ -126,7 +126,7 @@ const standardsIste = computed(() => {
|
|
|
126
126
|
class="col-start-container lg:col-start-indent-col-2 col-end-bleed lg:grid grid-cols-subgrid"
|
|
127
127
|
:class="backgroundClass"
|
|
128
128
|
>
|
|
129
|
-
<div class="
|
|
129
|
+
<div class="col-start-container lg:col-start-indent-col-2 col-end-container">
|
|
130
130
|
<div class="MetaPanel-heading lg:grid grid-cols-12 col-end-container container">
|
|
131
131
|
<div class="col-start-1 col-end-10 xl:col-end-9 pl-4 lg:pl-10 pr-2 py-6 lg:py-10">
|
|
132
132
|
<MetaPanelItems
|
|
@@ -13,7 +13,7 @@ import IconTime from './../Icons/IconTime.vue'
|
|
|
13
13
|
|
|
14
14
|
interface MetaPanelProps {
|
|
15
15
|
theme?: MetaPanelTheme
|
|
16
|
-
primarySubject
|
|
16
|
+
primarySubject?: EduResourcesSubject
|
|
17
17
|
additionalSubjects?: EduResourcesSubject[]
|
|
18
18
|
gradeLevels?: EduResourcesGradeLevel[]
|
|
19
19
|
time?: EduResourcesTime
|
|
@@ -35,14 +35,17 @@ const audience = computed(() => {
|
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
const subjects = computed(() => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
if (primarySubject?.subject) {
|
|
39
|
+
let combinedArray = [primarySubject.subject]
|
|
40
|
+
let output = undefined
|
|
41
|
+
if (additionalSubjects) {
|
|
42
|
+
const filteredArray = additionalSubjects.map((item) => item.subject)
|
|
43
|
+
combinedArray = combinedArray.concat(filteredArray)
|
|
44
|
+
}
|
|
45
|
+
output = combinedArray.join(', ')
|
|
46
|
+
return output
|
|
43
47
|
}
|
|
44
|
-
|
|
45
|
-
return output
|
|
48
|
+
return undefined
|
|
46
49
|
})
|
|
47
50
|
|
|
48
51
|
const iconColor = computed(() => {
|
package/src/constants.ts
CHANGED
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
import type { DictionaryInterface, PillDictionaryInterface } from './interfaces'
|
|
2
2
|
|
|
3
3
|
export const eduMetadataDictionary: PillDictionaryInterface = {
|
|
4
|
+
EDUCollectionsDetailPage: {
|
|
5
|
+
label: 'Collection',
|
|
6
|
+
variant: 'primary-inverted',
|
|
7
|
+
icons: 'primary',
|
|
8
|
+
type: 'resource'
|
|
9
|
+
},
|
|
4
10
|
EDUExplainerArticlePage: {
|
|
5
11
|
label: 'Explainer Article',
|
|
6
12
|
variant: 'secondary',
|
|
13
|
+
icons: 'secondary',
|
|
7
14
|
type: 'resource'
|
|
8
15
|
},
|
|
9
16
|
EDULessonPage: {
|
|
10
17
|
label: 'Lesson',
|
|
11
18
|
variant: 'primary',
|
|
19
|
+
icons: 'primary',
|
|
12
20
|
type: 'resource'
|
|
13
21
|
},
|
|
14
22
|
EDUTeachableMomentPage: {
|
|
15
23
|
label: 'Teachable Moment',
|
|
16
24
|
variant: 'primary',
|
|
25
|
+
icons: 'primary',
|
|
17
26
|
type: 'resource'
|
|
18
27
|
},
|
|
19
28
|
EDUEventPage: {
|
|
20
29
|
variant: 'primary',
|
|
30
|
+
icons: 'primary',
|
|
21
31
|
type: 'event'
|
|
22
32
|
}
|
|
23
33
|
}
|
|
@@ -28,6 +38,7 @@ export const searchContentTypeToPageType: DictionaryInterface = {
|
|
|
28
38
|
events_eventpage: 'EventPage',
|
|
29
39
|
missions_mission: 'Mission',
|
|
30
40
|
eduevents_edueventpage: 'EDUEventPage',
|
|
41
|
+
eduresources_educollectionsdetailpage: 'EDUCollectionsDetailPage',
|
|
31
42
|
eduresources_eduexplainerarticlepage: 'EDUExplainerArticlePage',
|
|
32
43
|
eduresources_edulessonpage: 'EDULessonPage',
|
|
33
44
|
eduresources_eduteachablemomentpage: 'EDUTeachableMomentPage'
|
package/src/interfaces.ts
CHANGED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { BlockRelatedLinksData } from './../../../components/BlockRelatedLinks/BlockRelatedLinks.stories.js'
|
|
2
|
+
import { BlockLinkCardCarouselData } from './../../../components/BlockLinkCarousel/BlockLinkCarousel.stories.js'
|
|
3
|
+
import { BlockStreamfieldMinimalData } from './../../../components/BlockStreamfield/BlockStreamfield.stories'
|
|
4
|
+
import PageEduCollectionsDetail from './PageEduCollectionsDetail.vue'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Templates/EDU/PageEduCollectionsDetail',
|
|
8
|
+
component: PageEduCollectionsDetail,
|
|
9
|
+
tags: ['!autodocs'],
|
|
10
|
+
decorators: [
|
|
11
|
+
() => ({
|
|
12
|
+
template: `<div id="storyDecorator" class="disable-nav-offset"><story/></div>`
|
|
13
|
+
})
|
|
14
|
+
],
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: 'fullscreen',
|
|
17
|
+
html: {
|
|
18
|
+
root: '#storyDecorator'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
excludeStories: /.*Data$/
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const BaseStory = {
|
|
25
|
+
name: 'PageEduCollectionsDetail',
|
|
26
|
+
args: {
|
|
27
|
+
data: {
|
|
28
|
+
__typename: 'EDUCollectionsDetailPage',
|
|
29
|
+
title: 'A collections page',
|
|
30
|
+
lastPublishedAt: '2024-08-22T02:33:13.507206+00:00',
|
|
31
|
+
url: 'http://localhost:3000/edu/resources/collections-detail',
|
|
32
|
+
pageType: 'EDUCollectionsDetailPage',
|
|
33
|
+
contentType: 'edu_resources.EDUCollectionsDetailPage',
|
|
34
|
+
showJumpMenu: true,
|
|
35
|
+
showMetaPanel: true,
|
|
36
|
+
thumbnailImage: {
|
|
37
|
+
__typename: 'CustomImage',
|
|
38
|
+
original: 'http://127.0.0.1:9000/media/original_images/imagessirtfsirtf-090303-16.jpg',
|
|
39
|
+
alt: ''
|
|
40
|
+
},
|
|
41
|
+
heroImage: {
|
|
42
|
+
src: {
|
|
43
|
+
url: 'https://picsum.photos/id/973/1800/1200',
|
|
44
|
+
width: 1800,
|
|
45
|
+
height: 1200
|
|
46
|
+
},
|
|
47
|
+
srcSet:
|
|
48
|
+
'https://picsum.photos/id/865/768/548 768w, https://picsum.photos/id/865/1024/684 1024w, https://picsum.photos/id/865/1440/770 1440w, https://picsum.photos/id/865/1800/963 1800w',
|
|
49
|
+
screenMd: {
|
|
50
|
+
url: 'https://picsum.photos/id/921/800/640'
|
|
51
|
+
},
|
|
52
|
+
screenSm: {
|
|
53
|
+
url: 'https://picsum.photos/id/247/640/900'
|
|
54
|
+
},
|
|
55
|
+
alt: 'The alt text'
|
|
56
|
+
},
|
|
57
|
+
heroImageCaption: '<p>Lorem ipsum dolor sit amet</p>',
|
|
58
|
+
heroConstrain: true,
|
|
59
|
+
heroPosition: 'full_bleed',
|
|
60
|
+
primarySubject: {
|
|
61
|
+
subject: 'Arts'
|
|
62
|
+
},
|
|
63
|
+
additionalSubjects: [
|
|
64
|
+
{
|
|
65
|
+
subject: 'Science'
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
gradeLevels: [
|
|
69
|
+
{
|
|
70
|
+
gradeLevel: 'K'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
gradeLevel: '1'
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
|
|
77
|
+
body: BlockStreamfieldMinimalData.body,
|
|
78
|
+
|
|
79
|
+
relatedLinks: BlockRelatedLinksData.data,
|
|
80
|
+
relatedContentHeading: 'Related Content',
|
|
81
|
+
relatedContent: BlockLinkCardCarouselData
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const Inline = {
|
|
87
|
+
args: {
|
|
88
|
+
data: {
|
|
89
|
+
...BaseStory.args.data,
|
|
90
|
+
heroPosition: 'inline',
|
|
91
|
+
heroConstrain: false
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const NoMetaPanel = {
|
|
97
|
+
args: {
|
|
98
|
+
data: {
|
|
99
|
+
...BaseStory.args.data,
|
|
100
|
+
showMetaPanel: false
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, reactive, ref } from 'vue'
|
|
3
|
+
import type { ImageObject, PageEduResourcesObject } from './../../../interfaces'
|
|
4
|
+
import BlockLinkCarousel from './../../../components/BlockLinkCarousel/BlockLinkCarousel.vue'
|
|
5
|
+
import LayoutHelper from './../../../components/LayoutHelper/LayoutHelper.vue'
|
|
6
|
+
import DetailHeadline from './../../../components/DetailHeadline/DetailHeadline.vue'
|
|
7
|
+
import BlockImageStandard from './../../../components/BlockImage/BlockImageStandard.vue'
|
|
8
|
+
import BlockStreamfield from './../../../components/BlockStreamfield/BlockStreamfield.vue'
|
|
9
|
+
import BlockRelatedLinks from '../../../components/BlockRelatedLinks/BlockRelatedLinks.vue'
|
|
10
|
+
import HeroLarge from './../../../components/HeroLarge/HeroLarge.vue'
|
|
11
|
+
import NavJumpMenu from './../../../components/NavJumpMenu/NavJumpMenu.vue'
|
|
12
|
+
import MetaPanel from '../../../components/MetaPanel/MetaPanel.vue'
|
|
13
|
+
|
|
14
|
+
interface PageEduCollectionsDetail extends PageEduResourcesObject {
|
|
15
|
+
heroImage: ImageObject
|
|
16
|
+
heroImageCaption: string
|
|
17
|
+
showMetaPanel: boolean
|
|
18
|
+
heroSubtitle: string
|
|
19
|
+
}
|
|
20
|
+
interface PageEduCollectionsDetailProps {
|
|
21
|
+
data?: PageEduCollectionsDetail
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(defineProps<PageEduCollectionsDetailProps>(), {
|
|
25
|
+
data: undefined
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const { data } = reactive(props)
|
|
29
|
+
|
|
30
|
+
const PageEduCollectionsDetailJumpMenu = ref()
|
|
31
|
+
|
|
32
|
+
defineExpose({
|
|
33
|
+
PageEduCollectionsDetailJumpMenu
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const heroInline = computed((): boolean => {
|
|
37
|
+
return data?.heroPosition === 'inline'
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const computedClass = computed((): string => {
|
|
41
|
+
if (heroInline.value || !data?.heroImage) {
|
|
42
|
+
return 'pt-5 lg:pt-12'
|
|
43
|
+
} else if (!heroInline.value) {
|
|
44
|
+
return '-nav-offset'
|
|
45
|
+
}
|
|
46
|
+
return ''
|
|
47
|
+
})
|
|
48
|
+
</script>
|
|
49
|
+
<template>
|
|
50
|
+
<div
|
|
51
|
+
v-if="data"
|
|
52
|
+
class="ThemeEdu ThemeVariantLight"
|
|
53
|
+
:class="computedClass"
|
|
54
|
+
>
|
|
55
|
+
<!-- hero large -->
|
|
56
|
+
<HeroLarge
|
|
57
|
+
v-if="!heroInline && data.heroImage"
|
|
58
|
+
:title="data.title"
|
|
59
|
+
:image="data.heroImage"
|
|
60
|
+
:summary="'Test test test lorem ipsum dolor sit amet yep.'"
|
|
61
|
+
:custom-pill-type="data.__typename"
|
|
62
|
+
:class="!data.showMetaPanel ? 'mb-10 lg:mb-22' : ''"
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<NavJumpMenu
|
|
66
|
+
ref="PageEduCollectionsDetailJumpMenu"
|
|
67
|
+
:title="data.title"
|
|
68
|
+
:blocks="data.body"
|
|
69
|
+
:enabled="data.showJumpMenu"
|
|
70
|
+
dropdown-text="In this collection"
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
<LayoutHelper
|
|
74
|
+
v-if="heroInline || !data.heroImage"
|
|
75
|
+
indent="col-2"
|
|
76
|
+
class="mb-10"
|
|
77
|
+
>
|
|
78
|
+
<DetailHeadline
|
|
79
|
+
:title="data.title"
|
|
80
|
+
label="Collection"
|
|
81
|
+
pill
|
|
82
|
+
pill-color="primary-inverted"
|
|
83
|
+
/>
|
|
84
|
+
</LayoutHelper>
|
|
85
|
+
<MetaPanel
|
|
86
|
+
v-if="data.showMetaPanel"
|
|
87
|
+
theme="primary"
|
|
88
|
+
:class="{ 'mb-10 lg:mb-14': true }"
|
|
89
|
+
:primary-subject="data.primarySubject"
|
|
90
|
+
:additional-subjects="data.additionalSubjects"
|
|
91
|
+
:grade-levels="data.gradeLevels"
|
|
92
|
+
:negative-top="!heroInline"
|
|
93
|
+
:negative-bottom="heroInline"
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<!-- TODO: put this in a component (exclude layout though) -->
|
|
97
|
+
<LayoutHelper
|
|
98
|
+
v-if="data.heroImage && heroInline"
|
|
99
|
+
class="lg:mb-22 mb-10"
|
|
100
|
+
>
|
|
101
|
+
<BlockImageStandard
|
|
102
|
+
:data="data.heroImage"
|
|
103
|
+
:display-caption="data.heroImageCaption ? true : false"
|
|
104
|
+
:caption="data.heroImageCaption"
|
|
105
|
+
:constrain="data.heroConstrain"
|
|
106
|
+
/>
|
|
107
|
+
</LayoutHelper>
|
|
108
|
+
|
|
109
|
+
<!-- streamfield blocks -->
|
|
110
|
+
<BlockStreamfield :data="data.body" />
|
|
111
|
+
|
|
112
|
+
<!-- related links -->
|
|
113
|
+
<LayoutHelper
|
|
114
|
+
v-if="data.relatedLinks && data.relatedLinks.length"
|
|
115
|
+
indent="col-3"
|
|
116
|
+
class="lg:my-18 my-10"
|
|
117
|
+
>
|
|
118
|
+
<BlockRelatedLinks :data="data.relatedLinks[0]" />
|
|
119
|
+
</LayoutHelper>
|
|
120
|
+
|
|
121
|
+
<LayoutHelper
|
|
122
|
+
v-if="data.lastPublishedAt"
|
|
123
|
+
indent="col-3"
|
|
124
|
+
class="lg:my-18 my-10"
|
|
125
|
+
>
|
|
126
|
+
<p class="border-t border-gray-light-mid pt-8">
|
|
127
|
+
<strong>Collection Last Updated:</strong>
|
|
128
|
+
{{
|
|
129
|
+
// @ts-ignore
|
|
130
|
+
$filters.displayDate(data.lastPublishedAt)
|
|
131
|
+
}}
|
|
132
|
+
</p>
|
|
133
|
+
</LayoutHelper>
|
|
134
|
+
<!-- explore more -->
|
|
135
|
+
<div
|
|
136
|
+
v-if="data.relatedContent?.length"
|
|
137
|
+
class="bg-stars bg-primary-darker pt-14 pb-20 ThemeVariantDark text-white"
|
|
138
|
+
>
|
|
139
|
+
<BlockLinkCarousel
|
|
140
|
+
item-type="cards"
|
|
141
|
+
heading="Explore more"
|
|
142
|
+
:items="data.relatedContent"
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</template>
|
|
@@ -1,38 +1,28 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { defineComponent } from 'vue'
|
|
3
3
|
import HeroMedia from './../../../components/HeroMedia/HeroMedia.vue'
|
|
4
|
-
import BaseImagePlaceholder from './../../../components/BaseImagePlaceholder/BaseImagePlaceholder.vue'
|
|
5
|
-
import BlockImageCarousel from './../../../components/BlockImageCarousel/BlockImageCarousel.vue'
|
|
6
|
-
import BlockImageComparison from './../../../components/BlockImageComparison/BlockImageComparison.vue'
|
|
7
4
|
import BlockLinkCarousel from './../../../components/BlockLinkCarousel/BlockLinkCarousel.vue'
|
|
8
5
|
import BlockText from './../../../components/BlockText/BlockText.vue'
|
|
9
|
-
import BlockVideo from './../../../components/BlockVideo/BlockVideo.vue'
|
|
10
6
|
import LayoutHelper from './../../../components/LayoutHelper/LayoutHelper.vue'
|
|
11
7
|
import DetailHeadline from './../../../components/DetailHeadline/DetailHeadline.vue'
|
|
12
|
-
import BlockImageStandard from './../../../components/BlockImage/BlockImageStandard.vue'
|
|
13
8
|
import ShareButtonsEdu from './../../../components/ShareButtonsEdu/ShareButtonsEdu.vue'
|
|
14
9
|
import BlockStreamfield from './../../../components/BlockStreamfield/BlockStreamfield.vue'
|
|
15
|
-
import BlockIframeEmbed from '../../../components/BlockIframeEmbed/BlockIframeEmbed.vue'
|
|
16
10
|
import BlockRelatedLinks from '../../../components/BlockRelatedLinks/BlockRelatedLinks.vue'
|
|
17
11
|
import NavJumpMenu from './../../../components/NavJumpMenu/NavJumpMenu.vue'
|
|
12
|
+
import HeroInlineMedia from './../../../components/HeroInlineMedia/HeroInlineMedia.vue'
|
|
18
13
|
|
|
19
14
|
export default defineComponent({
|
|
20
15
|
name: 'PageEduExplainerArticle',
|
|
21
16
|
components: {
|
|
22
17
|
HeroMedia,
|
|
23
|
-
|
|
18
|
+
HeroInlineMedia,
|
|
24
19
|
LayoutHelper,
|
|
25
20
|
DetailHeadline,
|
|
26
|
-
BlockImageStandard,
|
|
27
|
-
BlockIframeEmbed,
|
|
28
21
|
ShareButtonsEdu,
|
|
29
22
|
BlockStreamfield,
|
|
30
|
-
BlockImageCarousel,
|
|
31
|
-
BlockImageComparison,
|
|
32
23
|
BlockLinkCarousel,
|
|
33
24
|
BlockRelatedLinks,
|
|
34
25
|
BlockText,
|
|
35
|
-
BlockVideo,
|
|
36
26
|
NavJumpMenu
|
|
37
27
|
},
|
|
38
28
|
props: {
|
|
@@ -134,43 +124,16 @@ export default defineComponent({
|
|
|
134
124
|
dropdown-text="In this article"
|
|
135
125
|
/>
|
|
136
126
|
<!-- inline hero content -->
|
|
127
|
+
|
|
137
128
|
<LayoutHelper
|
|
138
129
|
v-if="!heroEmpty && heroInline"
|
|
139
130
|
indent="col-2"
|
|
140
131
|
class="lg:mb-22 mt-10 mb-10"
|
|
141
132
|
>
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
:data="data.hero[0].imageInline"
|
|
145
|
-
:display-caption="data.hero[0].displayCaption"
|
|
146
|
-
:caption="data.hero[0].caption"
|
|
133
|
+
<HeroInlineMedia
|
|
134
|
+
:hero-blocks="data.hero"
|
|
147
135
|
:constrain="data.heroConstrain"
|
|
148
136
|
/>
|
|
149
|
-
<BlockImageCarousel
|
|
150
|
-
v-else-if="data.hero[0].blockType === 'CarouselBlock'"
|
|
151
|
-
:items="data.hero[0].blocks"
|
|
152
|
-
:block-id="data.hero[0].id"
|
|
153
|
-
/>
|
|
154
|
-
<BlockIframeEmbed
|
|
155
|
-
v-else-if="data.hero[0].blockType === 'IframeEmbedBlock'"
|
|
156
|
-
:data="data.hero[0]"
|
|
157
|
-
/>
|
|
158
|
-
<BlockVideo
|
|
159
|
-
v-else-if="data.hero[0].blockType === 'VideoBlock'"
|
|
160
|
-
:data="data.hero[0]"
|
|
161
|
-
autoplay
|
|
162
|
-
/>
|
|
163
|
-
<BaseImagePlaceholder
|
|
164
|
-
v-else-if="data.hero[0].blockType === 'VideoEmbedBlock'"
|
|
165
|
-
aspect-ratio="16:9"
|
|
166
|
-
dark-mode
|
|
167
|
-
>
|
|
168
|
-
<div v-html="data.hero[0].embed.embed"></div>
|
|
169
|
-
</BaseImagePlaceholder>
|
|
170
|
-
<BlockImageComparison
|
|
171
|
-
v-else-if="data.hero[0].blockType === 'ImageComparisonBlock'"
|
|
172
|
-
:data="data.hero[0]"
|
|
173
|
-
/>
|
|
174
137
|
</LayoutHelper>
|
|
175
138
|
|
|
176
139
|
<LayoutHelper
|