@explorer-1/vue 0.2.18 → 0.2.20

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.
@@ -93,11 +93,13 @@ const stringAsHeadingBlockData = (
93
93
  }
94
94
 
95
95
  const heroEmpty = computed((): boolean => {
96
- return !data?.hero?.length
96
+ return data?.hero?.length === 0
97
97
  })
98
98
 
99
99
  const heroInline = computed((): boolean => {
100
+ // heroes with interactive elements have special handling
100
101
  if (!heroEmpty.value && data?.hero) {
102
+ // excludes VideoBlock as this will autoplay
101
103
  if (data?.hero[0].blockType === 'VideoBlock') {
102
104
  return false
103
105
  } else if (
@@ -296,12 +298,13 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => {
296
298
  <MetaPanel
297
299
  button="View Standards"
298
300
  theme="primary"
301
+ :class="{ 'mb-10 lg:mb-14': heroInline || data?.hero?.length === 0 }"
299
302
  :primary-subject="data.primarySubject"
300
303
  :additional-subjects="data.additionalSubjects"
301
304
  :time="data.time"
302
305
  :grade-levels="data.gradeLevels"
303
306
  :standards="data.standards"
304
- negative-bottom
307
+ :negative-bottom="heroInline || data?.hero?.length !== 0"
305
308
  />
306
309
 
307
310
  <!-- hero media -->
@@ -366,45 +369,44 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => {
366
369
  :blocks="consolidatedBlocks"
367
370
  :enabled="true"
368
371
  />
369
- <div id="NavJumpMenuFrame">
370
- <template
371
- v-for="(value, _key) in consolidatedSections"
372
- :key="_key"
373
- >
374
- <BlockStreamfield
375
- v-if="value.type === 'streamfield'"
376
- :data="value.blocks"
377
- />
378
- <PageEduLessonSection
379
- v-else
380
- :heading="value.heading"
381
- :blocks="value.blocks"
382
- :procedures="value.procedures"
383
- :procedure-steps="value.procedureSteps"
384
- :text="value.text"
385
- :image="value.image"
386
- />
387
- </template>
388
372
 
389
- <!-- streamfield blocks -->
390
- <BlockStreamfield :data="data.body" />
373
+ <template
374
+ v-for="(value, _key) in consolidatedSections"
375
+ :key="_key"
376
+ >
377
+ <BlockStreamfield
378
+ v-if="value.type === 'streamfield'"
379
+ :data="value.blocks"
380
+ />
381
+ <PageEduLessonSection
382
+ v-else
383
+ :heading="value.heading"
384
+ :blocks="value.blocks"
385
+ :procedures="value.procedures"
386
+ :procedure-steps="value.procedureSteps"
387
+ :text="value.text"
388
+ :image="value.image"
389
+ />
390
+ </template>
391
391
 
392
- <!-- related links -->
393
- <LayoutHelper
394
- v-if="data.relatedLinks && data.relatedLinks.length"
395
- indent="col-3"
396
- class="lg:my-18 my-10"
397
- >
398
- <BlockRelatedLinks :data="data.relatedLinks[0]" />
399
- </LayoutHelper>
392
+ <!-- streamfield blocks -->
393
+ <BlockStreamfield :data="data.body" />
400
394
 
401
- <!-- related content -->
402
- <BlockLinkCarousel
403
- item-type="cards"
404
- class="lg:my-24 my-12 print:px-4"
405
- :heading="data.relatedContentHeading"
406
- :items="data.relatedContent"
407
- />
408
- </div>
395
+ <!-- related links -->
396
+ <LayoutHelper
397
+ v-if="data.relatedLinks && data.relatedLinks.length"
398
+ indent="col-3"
399
+ class="lg:my-18 my-10"
400
+ >
401
+ <BlockRelatedLinks :data="data.relatedLinks[0]" />
402
+ </LayoutHelper>
403
+
404
+ <!-- related content -->
405
+ <BlockLinkCarousel
406
+ item-type="cards"
407
+ class="lg:my-24 my-12 print:px-4"
408
+ :heading="data.relatedContentHeading"
409
+ :items="data.relatedContent"
410
+ />
409
411
  </div>
410
412
  </template>
@@ -8,6 +8,8 @@ import advancedFormat from 'dayjs/plugin/advancedFormat.js'
8
8
  // see https://github.com/iamkun/dayjs/tree/dev/src/locale
9
9
  import 'dayjs/locale/en-gb.js'
10
10
 
11
+ dayjs.extend(timezone)
12
+ dayjs.extend(advancedFormat)
11
13
  dayjs.extend(localizedFormat)
12
14
  dayjs.extend(updateLocale)
13
15
  dayjs.updateLocale('en', {
@@ -26,7 +28,5 @@ dayjs.updateLocale('en', {
26
28
  'Dec.'
27
29
  ]
28
30
  })
29
- dayjs.extend(timezone)
30
- dayjs.extend(advancedFormat)
31
31
 
32
32
  export default dayjs
@@ -63,7 +63,7 @@ export const rangeifyGrades = (gradeLevels: GradeLevelsObject[]) => {
63
63
  const filteredGrades = rangeify(gradesArray.filter(Number.isFinite))
64
64
  let preparedGrades: string = ''
65
65
  if (filteredGrades?.length) {
66
- const gradeString = filteredGrades.length > 1 ? 'Grades: ' : 'Grade: '
66
+ const gradeString = filteredGrades.length > 0 ? 'Grades: ' : 'Grade: '
67
67
  preparedGrades = filteredGrades
68
68
  .map((grade, index) => (index === 0 ? gradeString + grade : grade))
69
69
  .join(', ')