@explorer-1/vue 0.2.60 → 0.2.61

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorer-1/vue",
3
- "version": "0.2.60",
3
+ "version": "0.2.61",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -6,7 +6,9 @@
6
6
  class="BlockHeading"
7
7
  :class="{ 'has-anchor': generateId }"
8
8
  >
9
- {{ data.heading }}
9
+ <slot>
10
+ {{ data.heading }}
11
+ </slot>
10
12
  </BaseHeading>
11
13
  </template>
12
14
 
@@ -111,7 +111,7 @@
111
111
  </nav>
112
112
  <div class="pl-8">
113
113
  <nav
114
- v-if="data.footerMoreFromJpl && data.footerMoreFromJpl.length > 0"
114
+ v-if="data.footerMoreFromJpl?.length"
115
115
  aria-label="Other JPL Sites"
116
116
  class="mt-6"
117
117
  >
@@ -133,7 +133,6 @@
133
133
  </transition>
134
134
  </template>
135
135
  <script lang="ts">
136
- // @ts-nocheck
137
136
  import { defineComponent } from 'vue'
138
137
  import { mapStores } from 'pinia'
139
138
  import { eventBus } from './../../utils/eventBus'
@@ -256,19 +255,19 @@ export default defineComponent({
256
255
  if (this.menuVisible) {
257
256
  this.menuVisible = false
258
257
  this.$emit('closeMobileMenu')
259
- document.body.classList.remove('overflow-hidden')
258
+ if (document.body) document.body.classList.remove('overflow-hidden')
260
259
  }
261
260
  },
262
261
  openMenu() {
263
262
  if (!this.menuVisible) {
264
263
  this.menuVisible = true
265
264
  this.$emit('openMobileMenu')
266
- document.body.classList.add('overflow-hidden')
265
+ if (document.body) document.body.classList.add('overflow-hidden')
267
266
  }
268
267
  },
269
268
  // safe way to retrieve url key from nav items. used with breadcrumb to determine active class.
270
269
  getUrlKey(item: LinkObject): string | null {
271
- if (item.linkPage) {
270
+ if (item?.linkPage) {
272
271
  return item.linkPage.url
273
272
  }
274
273
  return null
@@ -276,7 +275,7 @@ export default defineComponent({
276
275
  // to determine active class on menu links and 'more' menu links
277
276
  checkActive(item: LinkObject) {
278
277
  const urlKey = this.getUrlKey(item)
279
- if (urlKey && this.breadcrumb && this.breadcrumb.menu_links) {
278
+ if (urlKey && this.breadcrumb?.menu_links) {
280
279
  // key into the breadcrumbs for each section
281
280
  const objArray = this.breadcrumb.menu_links[urlKey]
282
281
  // check if any of the paths contained in the array are active
@@ -87,7 +87,7 @@ export default defineComponent({
87
87
  <template>
88
88
  <div
89
89
  v-if="data"
90
- class="ThemeVariantLight"
90
+ class="ThemeVariantLight PageEduExplainerArticle"
91
91
  :class="computedClass"
92
92
  itemscope
93
93
  itemtype="http://schema.org/Article"
@@ -226,3 +226,16 @@ export default defineComponent({
226
226
  </LayoutHelper>
227
227
  </div>
228
228
  </template>
229
+ <style lang="scss">
230
+ .PageEduExplainerArticle {
231
+ .BlockText {
232
+ ul {
233
+ li {
234
+ &::before {
235
+ @apply bg-secondary;
236
+ }
237
+ }
238
+ }
239
+ }
240
+ }
241
+ </style>
@@ -257,5 +257,14 @@ const { data } = reactive(props)
257
257
  }
258
258
  }
259
259
  }
260
+ .BlockText {
261
+ ul {
262
+ li {
263
+ &::before {
264
+ @apply bg-secondary;
265
+ }
266
+ }
267
+ }
268
+ }
260
269
  }
261
270
  </style>
@@ -240,7 +240,7 @@ const computedClass = computed((): string => {
240
240
  <template>
241
241
  <div
242
242
  v-if="data"
243
- class="ThemeVariantLight"
243
+ class="ThemeVariantLight PageEduStudentProject"
244
244
  :class="computedClass"
245
245
  >
246
246
  <!-- hero title -->
@@ -446,3 +446,16 @@ const computedClass = computed((): string => {
446
446
  </LayoutHelper>
447
447
  </div>
448
448
  </template>
449
+ <style lang="scss">
450
+ .PageEduStudentProject {
451
+ .BlockText {
452
+ ul {
453
+ li {
454
+ &::before {
455
+ @apply bg-secondary;
456
+ }
457
+ }
458
+ }
459
+ }
460
+ }
461
+ </style>
@@ -1,16 +1,17 @@
1
1
  <script setup lang="ts">
2
2
  import { reactive } from 'vue'
3
3
  import type { ImageObject, StreamfieldBlockData } from './../../../interfaces'
4
+ import BaseHeading from './../../../components/BaseHeading/BaseHeading.vue'
4
5
  import BlockHeading, {
5
6
  type BlockHeadingObject
6
7
  } from './../../../components/BlockHeading/BlockHeading.vue'
7
8
  import type { EduStudentProjectStep } from './PageEduStudentProject.vue'
8
- import BaseHeading from './../../../components/BaseHeading/BaseHeading.vue'
9
9
  import HeroInlineMedia from './../../../components/HeroInlineMedia/HeroInlineMedia.vue'
10
- import BlockText from './../../../components/BlockText/BlockText.vue'
11
10
  import LayoutHelper from './../../../components/LayoutHelper/LayoutHelper.vue'
11
+ import BlockInlineImage from './../../../components/BlockInlineImage/BlockInlineImage.vue'
12
12
  import BlockImageStandard from './../../../components/BlockImage/BlockImageStandard.vue'
13
13
  import BlockStreamfield from './../../../components/BlockStreamfield/BlockStreamfield.vue'
14
+ import { getHeadingId } from './../../../utils/getHeadingId'
14
15
 
15
16
  export interface PageEduStudentProjectSectionProps {
16
17
  heading?: BlockHeadingObject
@@ -48,8 +49,19 @@ const { heading, blocks, image, steps, stepsNumbering, text } = reactive(props)
48
49
  />
49
50
  </LayoutHelper>
50
51
 
52
+ <!-- simple richtext -->
53
+ <BlockInlineImage
54
+ v-if="text"
55
+ :data="{
56
+ text: text,
57
+ image: image,
58
+ alignTo: 'right'
59
+ }"
60
+ class="lg:mb-18 mb-10"
61
+ />
62
+
51
63
  <LayoutHelper
52
- v-if="image"
64
+ v-else-if="image"
53
65
  indent="col-2"
54
66
  class="lg:mb-8 mb-5"
55
67
  >
@@ -71,6 +83,7 @@ const { heading, blocks, image, steps, stepsNumbering, text } = reactive(props)
71
83
  <li
72
84
  v-for="(step, index) in steps"
73
85
  :key="index"
86
+ v-bind-once="{ id: step.heading ? getHeadingId(step.heading) : undefined }"
74
87
  class="PageEduStudentProjectStep lg:mb-12 mb-10 px-4 lg:px-0"
75
88
  >
76
89
  <LayoutHelper
@@ -149,15 +162,6 @@ const { heading, blocks, image, steps, stepsNumbering, text } = reactive(props)
149
162
  </LayoutHelper>
150
163
  </li>
151
164
  </component>
152
-
153
- <!-- simple richtext -->
154
- <LayoutHelper
155
- v-else-if="text"
156
- indent="col-3"
157
- class="lg:mb-18 mb-10"
158
- >
159
- <BlockText :text="text" />
160
- </LayoutHelper>
161
165
  </section>
162
166
  </template>
163
167
  <style lang="scss">
@@ -167,6 +171,9 @@ const { heading, blocks, image, steps, stepsNumbering, text } = reactive(props)
167
171
  @return math.div($pxValue, 16) * 1rem;
168
172
  }
169
173
  .PageEduStudentProjectStep {
174
+ &:target {
175
+ @apply scroll-mt-14;
176
+ }
170
177
  .BlockStreamfield {
171
178
  div:last-child {
172
179
  @apply mb-0 #{!important};
@@ -179,7 +186,6 @@ const { heading, blocks, image, steps, stepsNumbering, text } = reactive(props)
179
186
  // intentionally overriding correction that occurs within ThemeVariantGray
180
187
  @apply text-jpl-red;
181
188
  }
182
-
183
189
  .PageEduStudentProjectStep__fullWidth {
184
190
  .LayoutHelper > div > .BlockText {
185
191
  @screen lg {