@explorer-1/vue 0.2.21 → 0.2.23
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 +8119 -7836
- package/dist/explorer-1-vue.umd.cjs +14 -14
- package/dist/src/components/BaseAccordionItem/BaseAccordionItem.vue.d.ts +54 -0
- package/dist/src/components/BaseButton/BaseButton.stories.d.ts +0 -13
- package/dist/src/components/BaseButton/BaseButton.vue.d.ts +0 -14
- package/dist/src/components/BaseImageCaption/BaseImageCaption.vue.d.ts +18 -0
- package/dist/src/components/BaseModal/BaseModal.stories.d.ts +0 -26
- package/dist/src/components/BaseSwimlane/BaseSwimlane.vue.d.ts +2 -2
- package/dist/src/components/BaseTimer/BaseTimer.vue.d.ts +2 -2
- package/dist/src/components/BlockAccordion/BlockAccordion.stories.d.ts +25 -40
- package/dist/src/components/BlockAccordion/BlockAccordion.vue.d.ts +51 -0
- package/dist/src/components/BlockGist/BlockGist.stories.d.ts +19 -0
- package/dist/src/components/BlockGist/BlockGist.vue.d.ts +19 -0
- package/dist/src/components/BlockGist/GitHub404.vue.d.ts +2 -0
- package/dist/src/components/BlockLinkCard/BlockLinkCard.stories.d.ts +71 -15
- package/dist/src/components/BlockLinkCard/BlockLinkCard.vue.d.ts +10 -2
- package/dist/src/components/BlockStreamfield/BlockStreamfield.stories.d.ts +127 -27
- package/dist/src/components/BlockTeaser/BlockTeaser.vue.d.ts +3 -2
- package/dist/src/components/CalendarButton/CalendarButton.vue.d.ts +12 -2
- package/dist/src/components/LayoutHelper/LayoutHelper.vue.d.ts +1 -1
- package/dist/src/components/MetaPanel/MetaPanel.stories.d.ts +6 -2
- package/dist/src/components/MetadataEvent/MetadataEvent.vue.d.ts +8 -0
- package/dist/src/components/MixinFancybox/MixinFancybox.vue.d.ts +1 -1
- package/dist/src/components/NavDesktop/NavDesktop.stories.d.ts +49 -0
- package/dist/src/components/NavDropdownToggle/NavDropdownToggle.vue.d.ts +1 -1
- package/dist/src/docs/foundation/grid_layouthelpers.stories.d.ts +4 -4
- package/dist/src/interfaces.d.ts +4 -0
- package/dist/src/templates/PageContent/PageContent.vue.d.ts +1 -0
- package/dist/src/templates/edu/PageContentEdu.stories.d.ts +179 -2
- package/dist/src/templates/edu/PageEduEventDetail/PageEduEventDetail.stories.d.ts +37 -18
- package/dist/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.stories.d.ts +3 -1
- package/dist/src/templates/edu/PageEduLesson/PageEduLesson.stories.d.ts +28 -46
- package/dist/src/templates/edu/PageEduNewsDetail/PageEduNewsDetail.stories.d.ts +378 -81
- package/dist/src/templates/www/PageAsteroidWatchIndex/PageAsteroidWatchIndex.stories.d.ts +126 -27
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/BaseAccordionItem/BaseAccordionItem.vue +8 -11
- package/src/components/BaseImageCaption/BaseImageCaption.vue +16 -0
- package/src/components/BlockAccordion/BlockAccordion.stories.js +64 -19
- package/src/components/BlockAccordion/BlockAccordion.vue +99 -18
- package/src/components/BlockCardGrid/BlockCardGrid.vue +1 -1
- package/src/components/BlockGist/BlockGist.stories.js +2 -3
- package/src/components/BlockGist/BlockGist.vue +11 -38
- package/src/components/BlockStreamfield/BlockStreamfield.stories.js +9 -0
- package/src/components/BlockStreamfield/BlockStreamfield.vue +17 -5
- package/src/components/BlockTeaser/BlockTeaser.vue +20 -17
- package/src/components/NavDesktop/NavDesktop.stories.js +2 -6
- package/src/components/NavHeading/NavHeading.vue +1 -1
- package/src/components/NavJumpMenu/NavJumpMenu.vue +14 -2
- package/src/components/NavLinkList/NavLinkList.stories.js +1 -1
- package/src/components/NavSecondary/NavSecondaryDropdown.vue +4 -5
- package/src/components/NavSecondary/NavSecondaryLink.vue +6 -4
- package/src/components/TheFooter/TheFooter.vue +1 -1
- package/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.stories.js +3 -1
- package/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.vue +9 -7
- package/src/templates/edu/PageEduLesson/PageEduLesson.vue +1 -0
- package/src/templates/edu/PageEduNewsDetail/PageEduNewsDetail.vue +1 -0
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, reactive, ref } from 'vue'
|
|
3
|
-
import { AccordionItemObject } from './../../interfaces.ts'
|
|
3
|
+
import type { AccordionItemObject } from './../../interfaces.ts'
|
|
4
4
|
import { uniqueId } from 'lodash'
|
|
5
5
|
import IconPlus from './../Icons/IconPlus.vue'
|
|
6
|
-
import BlockStreamfield from './../BlockStreamfield/BlockStreamfield.vue'
|
|
7
6
|
|
|
8
7
|
export interface BaseAccordionItemProps {
|
|
9
8
|
headingLevel?: string
|
|
@@ -58,9 +57,12 @@ const emit = defineEmits(['accordionItemOpened', 'accordionItemClosed'])
|
|
|
58
57
|
<slot name="header">
|
|
59
58
|
<div
|
|
60
59
|
v-if="headingLevel && item"
|
|
61
|
-
class="border-b border-gray-light-mid"
|
|
60
|
+
:class="{ 'border-b border-gray-light-mid': isHidden }"
|
|
62
61
|
>
|
|
63
|
-
<component
|
|
62
|
+
<component
|
|
63
|
+
:is="headingLevel"
|
|
64
|
+
class="!font-medium"
|
|
65
|
+
>
|
|
64
66
|
<button
|
|
65
67
|
v-bind-once="{ id: headingId, 'aria-controls': panelId }"
|
|
66
68
|
:aria-expanded="ariaExpanded"
|
|
@@ -91,15 +93,10 @@ const emit = defineEmits(['accordionItemOpened', 'accordionItemClosed'])
|
|
|
91
93
|
<div
|
|
92
94
|
v-bind-once="{ id: panelId, 'aria-labelledby': headingId }"
|
|
93
95
|
role="region"
|
|
94
|
-
class="BaseAccordion-panel"
|
|
96
|
+
class="BaseAccordion-panel border-b border-gray-light-mid"
|
|
95
97
|
>
|
|
96
98
|
<slot name="panelContents">
|
|
97
|
-
<
|
|
98
|
-
<BlockStreamfield
|
|
99
|
-
:data="item.body"
|
|
100
|
-
variant="fluid"
|
|
101
|
-
/>
|
|
102
|
-
</div>
|
|
99
|
+
<pre>{{ item.body }}</pre>
|
|
103
100
|
</slot>
|
|
104
101
|
</div>
|
|
105
102
|
</slot>
|
|
@@ -14,6 +14,14 @@ export default defineComponent({
|
|
|
14
14
|
type: Object as PropType<Partial<ImageObject>>,
|
|
15
15
|
required: true,
|
|
16
16
|
default: undefined
|
|
17
|
+
},
|
|
18
|
+
customLink: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: undefined
|
|
21
|
+
},
|
|
22
|
+
customLinkText: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'Custom Link'
|
|
17
25
|
}
|
|
18
26
|
}
|
|
19
27
|
})
|
|
@@ -43,6 +51,14 @@ export default defineComponent({
|
|
|
43
51
|
>
|
|
44
52
|
Full Image Details
|
|
45
53
|
</BaseLink>
|
|
54
|
+
<BaseLink
|
|
55
|
+
v-else-if="customLink"
|
|
56
|
+
class="inline-block"
|
|
57
|
+
variant="default"
|
|
58
|
+
:to="customLink"
|
|
59
|
+
>
|
|
60
|
+
{{ customLinkText }}
|
|
61
|
+
</BaseLink>
|
|
46
62
|
</div>
|
|
47
63
|
</template>
|
|
48
64
|
|
|
@@ -1,29 +1,74 @@
|
|
|
1
1
|
import BlockAccordion from './BlockAccordion.vue'
|
|
2
|
-
import {
|
|
2
|
+
import { BlockImageData } from './../BlockImage/BlockImage.stories'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Components/Blocks/BlockAccordion',
|
|
6
|
-
component: BlockAccordion
|
|
6
|
+
component: BlockAccordion,
|
|
7
|
+
tags: ['!autodocs'],
|
|
8
|
+
excludeStories: /.*Data$/
|
|
7
9
|
}
|
|
8
10
|
|
|
11
|
+
const AccordionItemStreamfieldData = [
|
|
12
|
+
{
|
|
13
|
+
blockType: 'RichTextBlock',
|
|
14
|
+
value:
|
|
15
|
+
'<p>Lorem ipsum <a href="/missions/test-mission/">dolor</a> sit amet, consectetur adipiscing elit. Quisque vitae justo quis justo malesuada molestie. Cras sed tincidunt dui.</p>\n'
|
|
16
|
+
},
|
|
17
|
+
{ ...BlockImageData, blockType: 'ImageBlock' },
|
|
18
|
+
{
|
|
19
|
+
blockType: 'RichTextBlock',
|
|
20
|
+
value:
|
|
21
|
+
'<p>Integer imperdiet blandit neque vitae euismod. Nulla aliquet lacus nibh, vel tincidunt urna efficitur non. In et eros vitae ex posuere maximus quis eget urna. Suspendisse fringilla posuere velit sit amet posuere. Morbi malesuada bibendum vehicula. Donec faucibus ut erat ut mattis. Suspendisse ornare, quam at placerat cursus, dolor mi lacinia nunc, eget maximus augue nulla in dolor.</p>\n'
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
export const BlockAccordionData = {
|
|
26
|
+
blockType: 'AccordionBlock',
|
|
27
|
+
accordionItemsHeadingLevel: '3',
|
|
28
|
+
accordionItems: [
|
|
29
|
+
{
|
|
30
|
+
blockType: 'AccordionItemBlock',
|
|
31
|
+
blocks: [
|
|
32
|
+
{
|
|
33
|
+
blockType: 'CharBlock',
|
|
34
|
+
value: 'First Accordion Item'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
blockType: 'AccordionBodyStreamfieldBlock',
|
|
38
|
+
blocks: AccordionItemStreamfieldData
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
blockType: 'AccordionItemBlock',
|
|
44
|
+
blocks: [
|
|
45
|
+
{
|
|
46
|
+
blockType: 'CharBlock',
|
|
47
|
+
value: 'Second Accordion Item'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
blockType: 'AccordionBodyStreamfieldBlock',
|
|
51
|
+
blocks: AccordionItemStreamfieldData
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
blockType: 'AccordionItemBlock',
|
|
57
|
+
blocks: [
|
|
58
|
+
{
|
|
59
|
+
blockType: 'CharBlock',
|
|
60
|
+
value: 'Third Accordion Item'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
blockType: 'AccordionBodyStreamfieldBlock',
|
|
64
|
+
blocks: AccordionItemStreamfieldData
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
9
70
|
// stories
|
|
10
71
|
export const BaseStory = {
|
|
11
72
|
name: 'BlockAccordion',
|
|
12
|
-
args: {
|
|
13
|
-
headingLevel: 'h5',
|
|
14
|
-
items: [
|
|
15
|
-
{
|
|
16
|
-
title: 'Title for the accordion',
|
|
17
|
-
body: BlockStreamfieldTruncatedData.body
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
title: 'Another',
|
|
21
|
-
body: BlockStreamfieldTruncatedData.body
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
title: 'Yet another',
|
|
25
|
-
body: BlockStreamfieldTruncatedData.body
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
73
|
+
args: { data: BlockAccordionData }
|
|
29
74
|
}
|
|
@@ -1,32 +1,113 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { reactive } from 'vue'
|
|
3
|
-
import { AccordionItemObject } from '../../interfaces'
|
|
2
|
+
import { computed, reactive } from 'vue'
|
|
3
|
+
import type { AccordionItemObject, ImageBlock, ImageObject } from '../../interfaces'
|
|
4
4
|
import BaseAccordionItem from './../BaseAccordionItem/BaseAccordionItem.vue'
|
|
5
|
+
import BlockImageStandard from './../BlockImage/BlockImageStandard.vue'
|
|
6
|
+
import BlockText from './../BlockText/BlockText.vue'
|
|
5
7
|
|
|
8
|
+
interface AccordionItemCharBlock {
|
|
9
|
+
blockType: 'CharBlock'
|
|
10
|
+
value: string
|
|
11
|
+
}
|
|
12
|
+
interface RichTextBlock {
|
|
13
|
+
blockType: 'RichTextBlock'
|
|
14
|
+
text: string
|
|
15
|
+
variant: string
|
|
16
|
+
}
|
|
17
|
+
interface AccordionBodyStreamfieldBlock {
|
|
18
|
+
blockType: 'AccordionBodyStreamfieldBlock'
|
|
19
|
+
blocks: (ImageBlock | RichTextBlock)[]
|
|
20
|
+
}
|
|
21
|
+
interface AccordionItemBlock {
|
|
22
|
+
blockType: 'AccordionItemBlock'
|
|
23
|
+
blocks: (AccordionBodyStreamfieldBlock | AccordionItemCharBlock)[]
|
|
24
|
+
}
|
|
25
|
+
export interface AccordionBlockObject {
|
|
26
|
+
accordionItemsHeadingLevel: string
|
|
27
|
+
accordionItems: AccordionItemBlock[]
|
|
28
|
+
}
|
|
6
29
|
interface BlockAccordionProps {
|
|
7
|
-
|
|
8
|
-
headingLevel?: string
|
|
9
|
-
items?: AccordionItemObject[]
|
|
30
|
+
data: AccordionBlockObject
|
|
10
31
|
}
|
|
11
32
|
|
|
12
33
|
// define props
|
|
13
34
|
const props = withDefaults(defineProps<BlockAccordionProps>(), {
|
|
14
|
-
|
|
15
|
-
headingLevel: 'h2',
|
|
16
|
-
items: undefined
|
|
35
|
+
data: undefined
|
|
17
36
|
})
|
|
18
37
|
|
|
19
|
-
const {
|
|
38
|
+
const { data } = reactive(props)
|
|
39
|
+
|
|
40
|
+
const headingLevel = computed(() => {
|
|
41
|
+
return data ? `h${data?.accordionItemsHeadingLevel}` : undefined
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const remappedAccordionItems = computed((): AccordionItemObject[] | undefined => {
|
|
45
|
+
if (data?.accordionItems) {
|
|
46
|
+
const remappedItems = data.accordionItems.map((item) => {
|
|
47
|
+
let title = ''
|
|
48
|
+
let body: (ImageBlock | RichTextBlock)[] = []
|
|
49
|
+
|
|
50
|
+
item.blocks.forEach((block) => {
|
|
51
|
+
if (block.blockType === 'CharBlock') {
|
|
52
|
+
title = (block as AccordionItemCharBlock).value || ''
|
|
53
|
+
} else if (block.blockType === 'AccordionBodyStreamfieldBlock') {
|
|
54
|
+
body = (block as AccordionBodyStreamfieldBlock).blocks || []
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
return {
|
|
58
|
+
title,
|
|
59
|
+
body
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
return remappedItems
|
|
63
|
+
}
|
|
64
|
+
return undefined
|
|
65
|
+
})
|
|
20
66
|
</script>
|
|
21
67
|
<template>
|
|
22
|
-
<div class="BlockAccordion">
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
68
|
+
<div class="BlockAccordion border-t border-gray-light-mid">
|
|
69
|
+
<BaseAccordionItem
|
|
70
|
+
v-for="(item, index) in remappedAccordionItems"
|
|
71
|
+
:key="index"
|
|
72
|
+
:heading-level="headingLevel"
|
|
73
|
+
:item="item"
|
|
74
|
+
>
|
|
75
|
+
<template #panelContents>
|
|
76
|
+
<div
|
|
77
|
+
v-if="item.body"
|
|
78
|
+
class="px-4 pb-8"
|
|
79
|
+
>
|
|
80
|
+
<div
|
|
81
|
+
v-for="(block, block_index) in item.body"
|
|
82
|
+
:key="block_index"
|
|
83
|
+
:class="{ 'mb-5': Number(block_index) + 1 != item.body.length }"
|
|
84
|
+
>
|
|
85
|
+
<template v-if="block.blockType === 'ImageBlock'">
|
|
86
|
+
<BlockImageStandard
|
|
87
|
+
class="AccordionItemImage"
|
|
88
|
+
:data="block.image as ImageObject"
|
|
89
|
+
:caption="block.caption"
|
|
90
|
+
:display-bacpotion="block.displayCaption"
|
|
91
|
+
/>
|
|
92
|
+
</template>
|
|
93
|
+
<template v-else-if="block.blockType === 'RichTextBlock'">
|
|
94
|
+
<BlockText
|
|
95
|
+
:text="block.value"
|
|
96
|
+
variant="medium"
|
|
97
|
+
/>
|
|
98
|
+
</template>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</template>
|
|
102
|
+
</BaseAccordionItem>
|
|
31
103
|
</div>
|
|
32
104
|
</template>
|
|
105
|
+
<style lang="scss">
|
|
106
|
+
.BlockAccordion {
|
|
107
|
+
.AccordionItemImage {
|
|
108
|
+
div.p-4 {
|
|
109
|
+
@apply px-0 #{!important};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
@@ -8,10 +8,9 @@ export default {
|
|
|
8
8
|
|
|
9
9
|
export const BlockGistData = {
|
|
10
10
|
blockType: 'GitHubGistBlock',
|
|
11
|
-
caption:
|
|
12
|
-
'<p data-block-key="a7ves">The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.</p>',
|
|
11
|
+
caption: '<p>Caption for gist block</p>',
|
|
13
12
|
id: 'cefc8e20-2833-4d0b-a4d6-7f469d5dbd02',
|
|
14
|
-
url: 'https://gist.github.com/
|
|
13
|
+
url: 'https://gist.github.com/nasajpledu/acb1a3f04895a9905570b267193d42ac'
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
// stories
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, watch } from 'vue'
|
|
3
|
+
import BaseImageCaption from './../BaseImageCaption/BaseImageCaption.vue'
|
|
3
4
|
import GitHub404 from './GitHub404.vue'
|
|
4
5
|
interface BlockGistProps {
|
|
5
6
|
data: {
|
|
@@ -46,7 +47,7 @@ watch(
|
|
|
46
47
|
<GitHub404 />
|
|
47
48
|
</template>
|
|
48
49
|
<template v-else-if="gistUrl">
|
|
49
|
-
<div class="
|
|
50
|
+
<div class="relative">
|
|
50
51
|
<div
|
|
51
52
|
id="iframe-description"
|
|
52
53
|
class="sr-only"
|
|
@@ -79,7 +80,6 @@ watch(
|
|
|
79
80
|
ref="frame"
|
|
80
81
|
:src="gistUrl"
|
|
81
82
|
:class="{ loaded }"
|
|
82
|
-
class="md:min-h-[313px] lg:min-h-[613px]"
|
|
83
83
|
width="100%"
|
|
84
84
|
frameborder="0"
|
|
85
85
|
title="Code snippet display"
|
|
@@ -87,17 +87,15 @@ watch(
|
|
|
87
87
|
aria-describedby="iframe-description"
|
|
88
88
|
aria-hidden="false"
|
|
89
89
|
></iframe>
|
|
90
|
-
<div
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
{{ 'View on GitHub' }}
|
|
100
|
-
</nuxt-link>
|
|
90
|
+
<div
|
|
91
|
+
v-if="data.caption"
|
|
92
|
+
class="py-4"
|
|
93
|
+
>
|
|
94
|
+
<BaseImageCaption
|
|
95
|
+
:data="data"
|
|
96
|
+
:custom-link="props.data.url"
|
|
97
|
+
custom-link-text="View on GitHub"
|
|
98
|
+
/>
|
|
101
99
|
</div>
|
|
102
100
|
</div>
|
|
103
101
|
</template>
|
|
@@ -106,8 +104,6 @@ watch(
|
|
|
106
104
|
|
|
107
105
|
<style scoped lang="scss">
|
|
108
106
|
.BlockGist {
|
|
109
|
-
margin: 2rem 0;
|
|
110
|
-
|
|
111
107
|
.GitHubIcon {
|
|
112
108
|
@apply h-5 pb-0.5 flex flex-row items-baseline flex-grow-0;
|
|
113
109
|
}
|
|
@@ -115,31 +111,12 @@ watch(
|
|
|
115
111
|
iframe {
|
|
116
112
|
@apply border border-gray-light-mid border-t-8 rounded-none;
|
|
117
113
|
}
|
|
118
|
-
|
|
119
|
-
.gist-caption {
|
|
120
|
-
@apply text-sm font-medium m-1 flex-wrap;
|
|
121
|
-
|
|
122
|
-
span {
|
|
123
|
-
p {
|
|
124
|
-
@apply text-gray-mid;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
a {
|
|
129
|
-
@apply underline text-action can-hover:hover:text-action-dark cursor-pointer;
|
|
130
|
-
white-space: nowrap; /* Prevents the link from wrapping onto a new line */
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
114
|
}
|
|
134
115
|
body.ThemeVariantLight {
|
|
135
116
|
.BlockGist {
|
|
136
117
|
iframe {
|
|
137
118
|
@apply border-gray-light-mid;
|
|
138
119
|
}
|
|
139
|
-
|
|
140
|
-
.gist-caption {
|
|
141
|
-
@apply text-gray-mid-dark;
|
|
142
|
-
}
|
|
143
120
|
}
|
|
144
121
|
}
|
|
145
122
|
|
|
@@ -148,10 +125,6 @@ body.ThemeVariantDark {
|
|
|
148
125
|
iframe {
|
|
149
126
|
@apply border-gray-mid-dark bg-gray-light;
|
|
150
127
|
}
|
|
151
|
-
|
|
152
|
-
.gist-caption {
|
|
153
|
-
@apply text-gray-light-mid;
|
|
154
|
-
}
|
|
155
128
|
}
|
|
156
129
|
}
|
|
157
130
|
</style>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockAccordionData } from './../BlockAccordion/BlockAccordion.stories'
|
|
1
2
|
import { BlockCardGridData } from './../BlockCardGrid/BlockCardGrid.stories'
|
|
2
3
|
import { BlockCtaData } from './../BlockCta/BlockCta.stories'
|
|
3
4
|
import { BlockHeadingData } from './../BlockHeading/BlockHeading.stories'
|
|
@@ -20,6 +21,7 @@ import BlockStreamfield, { variants } from './BlockStreamfield.vue'
|
|
|
20
21
|
export default {
|
|
21
22
|
title: 'Components/Blocks/BlockStreamfield',
|
|
22
23
|
component: BlockStreamfield,
|
|
24
|
+
tags: ['!autodocs'],
|
|
23
25
|
argTypes: {
|
|
24
26
|
variant: {
|
|
25
27
|
control: { type: 'select' },
|
|
@@ -85,11 +87,18 @@ export const BlockStreamfieldData = {
|
|
|
85
87
|
heading: 'Heading 2',
|
|
86
88
|
level: 'h2'
|
|
87
89
|
},
|
|
90
|
+
BlockAccordionData,
|
|
88
91
|
{
|
|
89
92
|
blockType: 'HeadingBlock',
|
|
90
93
|
heading: 'Heading 3',
|
|
91
94
|
level: 'h3'
|
|
92
95
|
},
|
|
96
|
+
{
|
|
97
|
+
blockType: 'GitHubGistBlock',
|
|
98
|
+
caption: '<p>Caption for gist block</p>',
|
|
99
|
+
id: 'cefc8e20-2833-4d0b-a4d6-7f469d5dbd02',
|
|
100
|
+
url: 'https://gist.github.com/nasajpledu/acb1a3f04895a9905570b267193d42ac'
|
|
101
|
+
},
|
|
93
102
|
{
|
|
94
103
|
blockType: 'RichTextBlock',
|
|
95
104
|
value:
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
<LayoutHelper
|
|
170
170
|
v-else-if="block.blockType == 'GitHubGistBlock'"
|
|
171
171
|
:key="`GitHubGistBlock${index}`"
|
|
172
|
-
indent="col-
|
|
172
|
+
indent="col-3"
|
|
173
173
|
class="lg:mb-18 mb-10"
|
|
174
174
|
>
|
|
175
175
|
<BlockGist :data="block" />
|
|
@@ -199,13 +199,21 @@
|
|
|
199
199
|
:data="block"
|
|
200
200
|
/>
|
|
201
201
|
|
|
202
|
-
<
|
|
202
|
+
<div
|
|
203
203
|
v-else-if="block.blockType == 'ListBlock' && block.field === 'card_grid'"
|
|
204
|
-
:key="`
|
|
205
|
-
indent="col-1"
|
|
204
|
+
:key="`cardGridBlock${index}`"
|
|
206
205
|
class="lg:mb-18 mb-10"
|
|
207
206
|
>
|
|
208
207
|
<BlockCardGrid :cards="block.items" />
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<LayoutHelper
|
|
211
|
+
v-else-if="block.blockType == 'AccordionBlock'"
|
|
212
|
+
:key="`accordionBlock${index}`"
|
|
213
|
+
indent="col-3"
|
|
214
|
+
class="lg:mb-18 mb-10"
|
|
215
|
+
>
|
|
216
|
+
<BlockAccordion :data="block as unknown as AccordionBlockObject" />
|
|
209
217
|
</LayoutHelper>
|
|
210
218
|
|
|
211
219
|
<div
|
|
@@ -248,6 +256,9 @@ import BlockVideoEmbed, {
|
|
|
248
256
|
type BlockData as VideoBlockEmbedData
|
|
249
257
|
} from './../BlockVideoEmbed/BlockVideoEmbed.vue'
|
|
250
258
|
import BlockAnchor from './../BlockAnchor/BlockAnchor.vue'
|
|
259
|
+
import BlockAccordion from './../BlockAccordion/BlockAccordion.vue'
|
|
260
|
+
import { type AccordionBlockObject } from './../BlockAccordion/BlockAccordion.vue'
|
|
261
|
+
|
|
251
262
|
interface Variants {
|
|
252
263
|
[key: string]: string
|
|
253
264
|
}
|
|
@@ -281,7 +292,8 @@ export default defineComponent({
|
|
|
281
292
|
BlockGist,
|
|
282
293
|
BlockVideo,
|
|
283
294
|
BlockVideoEmbed,
|
|
284
|
-
BlockAnchor
|
|
295
|
+
BlockAnchor,
|
|
296
|
+
BlockAccordion
|
|
285
297
|
},
|
|
286
298
|
props: {
|
|
287
299
|
variant: {
|
|
@@ -115,16 +115,14 @@ export default defineComponent({
|
|
|
115
115
|
* Fall back to the linked page’s label, if there is one.
|
|
116
116
|
*/
|
|
117
117
|
theLabel(): string {
|
|
118
|
-
return
|
|
119
|
-
this.customLabel || this.label || (this.theTeaserPage && this.theTeaserPage.label) || ''
|
|
120
|
-
)
|
|
118
|
+
return this.customLabel || this.label || this.theTeaserPage?.label || ''
|
|
121
119
|
},
|
|
122
120
|
|
|
123
121
|
/**
|
|
124
122
|
* Fall back to the linked page’s title, if there is one.
|
|
125
123
|
*/
|
|
126
124
|
theHeading(): string {
|
|
127
|
-
return this.heading ||
|
|
125
|
+
return this.heading || this.theTeaserPage?.title || ''
|
|
128
126
|
},
|
|
129
127
|
|
|
130
128
|
/**
|
|
@@ -146,25 +144,30 @@ export default defineComponent({
|
|
|
146
144
|
},
|
|
147
145
|
// necessary as the streamfield teaser block passes an array of blocks
|
|
148
146
|
// this is necessary to retrieve the label from the teaser pages
|
|
149
|
-
theTeaserPage(): teaserPageObject |
|
|
150
|
-
if (this.
|
|
147
|
+
theTeaserPage(): teaserPageObject | undefined {
|
|
148
|
+
if (this.teaserPageBlock) {
|
|
149
|
+
return this.teaserPageBlock
|
|
150
|
+
} else if (this.teaserPage && typeof this.teaserPage === 'object') {
|
|
151
151
|
return this.teaserPage as teaserPageObject
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
}
|
|
153
|
+
return undefined
|
|
154
|
+
},
|
|
155
|
+
teaserPageBlock(): teaserPageObject | undefined {
|
|
156
|
+
if (Array.isArray(this.teaserPage) && this.teaserPage?.length) {
|
|
157
|
+
const filteredBlocks = this.teaserPage.filter(
|
|
158
|
+
(block: teaserPageBlock) => block.blockType === 'PageChooserBlock'
|
|
159
|
+
)
|
|
160
|
+
if (filteredBlocks?.length) {
|
|
161
|
+
return filteredBlocks[0].page
|
|
156
162
|
}
|
|
157
163
|
}
|
|
158
|
-
return
|
|
164
|
+
return undefined
|
|
159
165
|
}
|
|
160
166
|
},
|
|
161
167
|
methods: {
|
|
162
|
-
getTeaserPageBlock(): teaserPageBlock[] | null {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
return theBlocks.filter((block: teaserPageBlock) => block.blockType === 'PageChooserBlock')
|
|
166
|
-
}
|
|
167
|
-
return null
|
|
168
|
+
getTeaserPageBlock(page: any[]): teaserPageBlock[] | null {
|
|
169
|
+
const theBlocks = page
|
|
170
|
+
return theBlocks.filter((block: teaserPageBlock) => block.blockType === 'PageChooserBlock')
|
|
168
171
|
}
|
|
169
172
|
}
|
|
170
173
|
})
|
|
@@ -120,14 +120,10 @@ export const NavDesktopData = {
|
|
|
120
120
|
title: 'Missions'
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
|
-
...MenuLinkColumnWithHeaderData
|
|
124
|
-
heading: null,
|
|
125
|
-
headingPage: null
|
|
123
|
+
...MenuLinkColumnWithHeaderData
|
|
126
124
|
},
|
|
127
125
|
{
|
|
128
|
-
...MenuLinkColumnWithHeaderData
|
|
129
|
-
heading: null,
|
|
130
|
-
headingPage: null
|
|
126
|
+
...MenuLinkColumnWithHeaderData
|
|
131
127
|
}
|
|
132
128
|
]
|
|
133
129
|
},
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
<template v-else-if="data.heading">
|
|
17
17
|
<div class="text-subtitle text-jpl-blue-lighter edu:text-primary-lighter inline-block mb-4">
|
|
18
|
-
<span class="
|
|
18
|
+
<span class="px-2 block">{{ data.heading }}</span>
|
|
19
19
|
</div>
|
|
20
20
|
</template>
|
|
21
21
|
</div>
|
|
@@ -50,6 +50,7 @@ interface NavJumpMenuProps {
|
|
|
50
50
|
headingLevel?: string
|
|
51
51
|
invert?: boolean
|
|
52
52
|
enabled?: boolean
|
|
53
|
+
dropdownText?: string
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
const props = withDefaults(defineProps<NavJumpMenuProps>(), {
|
|
@@ -59,7 +60,8 @@ const props = withDefaults(defineProps<NavJumpMenuProps>(), {
|
|
|
59
60
|
headingLevel: 'h2',
|
|
60
61
|
enabled: true,
|
|
61
62
|
invert: true,
|
|
62
|
-
hidden: false
|
|
63
|
+
hidden: false,
|
|
64
|
+
dropdownText: 'Jump to…'
|
|
63
65
|
})
|
|
64
66
|
|
|
65
67
|
const NavJumpMenuRef = ref()
|
|
@@ -102,7 +104,7 @@ const theBreadcrumbs = computed(() => {
|
|
|
102
104
|
path: '#siteTop'
|
|
103
105
|
}
|
|
104
106
|
const jumpMenu: BreadcrumbPathObject = {
|
|
105
|
-
title:
|
|
107
|
+
title: props.dropdownText,
|
|
106
108
|
path: '#',
|
|
107
109
|
children: theJumpLinks.value as BreadcrumbPathObject[]
|
|
108
110
|
}
|
|
@@ -139,5 +141,15 @@ watch(
|
|
|
139
141
|
@apply opacity-100 transition-all pointer-events-auto;
|
|
140
142
|
}
|
|
141
143
|
}
|
|
144
|
+
.NavSecondaryLink.secondary-root {
|
|
145
|
+
span {
|
|
146
|
+
@apply border-primary #{!important};
|
|
147
|
+
}
|
|
148
|
+
&.-invert {
|
|
149
|
+
span {
|
|
150
|
+
@apply border-white #{!important};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
142
154
|
}
|
|
143
155
|
</style>
|