@explorer-1/vue 0.2.30 → 0.2.32

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.
@@ -37,7 +37,10 @@ export namespace BaseStory {
37
37
  let additionalSubjects: {
38
38
  subject: string;
39
39
  }[];
40
- let time: string;
40
+ namespace time {
41
+ let time_1: string;
42
+ export { time_1 as time };
43
+ }
41
44
  let gradeLevels: {
42
45
  gradeLevel: string;
43
46
  }[];
@@ -13,10 +13,12 @@ export namespace MetadataEventData {
13
13
  export let location: string;
14
14
  export let startDate: string;
15
15
  export let startDatetime: string;
16
+ export let startTime: string;
16
17
  export let endDate: string;
18
+ export let endDatetime: string;
19
+ export let endTime: string;
17
20
  export let ongoing: boolean;
18
21
  export let isVirtualEvent: boolean;
19
- export let endDatetime: string;
20
22
  export let locationName: string;
21
23
  export let locationLink: string;
22
24
  export let customDate: undefined;
@@ -16,6 +16,10 @@ declare const _default: import('vue').DefineComponent<{
16
16
  required: false;
17
17
  default: boolean;
18
18
  };
19
+ jumpMenu: {
20
+ type: BooleanConstructor;
21
+ default: boolean;
22
+ };
19
23
  }, unknown, {
20
24
  isSticky: boolean;
21
25
  stickyElement?: HTMLElement | undefined;
@@ -58,9 +62,14 @@ declare const _default: import('vue').DefineComponent<{
58
62
  required: false;
59
63
  default: boolean;
60
64
  };
65
+ jumpMenu: {
66
+ type: BooleanConstructor;
67
+ default: boolean;
68
+ };
61
69
  }>>, {
62
70
  invert: boolean;
63
71
  breadcrumb: string;
64
72
  hasIntro: boolean;
73
+ jumpMenu: boolean;
65
74
  }, {}>;
66
75
  export default _default;
@@ -206,6 +206,7 @@ export interface PageObject {
206
206
  slug: string;
207
207
  url: string;
208
208
  title: string;
209
+ readTime?: string;
209
210
  getTopicsForDisplay?: Topic[];
210
211
  showJumpMenu?: boolean;
211
212
  label?: string;
@@ -54,6 +54,7 @@ export namespace BaseStory {
54
54
  let alt_1: string;
55
55
  export { alt_1 as alt };
56
56
  }
57
+ export let heroSummary: string;
57
58
  export let heroImageCaption: string;
58
59
  export let heroConstrain: boolean;
59
60
  export let heroPosition: string;
@@ -1,5 +1,6 @@
1
1
  import { default as PageEduExplainerArticle } from './PageEduExplainerArticle.vue';
2
2
  import { BlockLinkCardCarouselData } from './../../../components/BlockLinkCarousel/BlockLinkCarousel.stories.js';
3
+ import { AboutTheAuthorData } from './../../../components/AboutTheAuthor/AboutTheAuthor.stories';
3
4
  declare namespace _default {
4
5
  export let title: string;
5
6
  export { PageEduExplainerArticle as component };
@@ -169,6 +170,8 @@ export namespace BaseStory {
169
170
  let title_1: string;
170
171
  export { title_1 as title };
171
172
  export let readTime: string;
173
+ export let lastPublishedAt: string;
174
+ export { AboutTheAuthorData as authors };
172
175
  export let heroConstrain: boolean;
173
176
  export let heroPosition: string;
174
177
  export let hero: {
@@ -167,14 +167,26 @@ export namespace BaseStory {
167
167
  value: string;
168
168
  }[];
169
169
  export let backgroundHeading: string;
170
- export let procedures: {
171
- blocks: {
172
- blockType: string;
173
- value: string;
170
+ export let procedures: ({
171
+ sectionHeading: string;
172
+ stepsNumbering: boolean;
173
+ steps: {
174
+ blocks: {
175
+ blockType: string;
176
+ value: string;
177
+ }[];
174
178
  }[];
175
- }[];
179
+ } | {
180
+ stepsNumbering: boolean;
181
+ steps: {
182
+ blocks: {
183
+ blockType: string;
184
+ value: string;
185
+ }[];
186
+ }[];
187
+ sectionHeading?: undefined;
188
+ })[];
176
189
  export let proceduresHeading: string;
177
- export let proceduresStepsNumbering: boolean;
178
190
  export let discussion: {
179
191
  blockType: string;
180
192
  value: string;
@@ -27,6 +27,7 @@ export namespace BaseStory {
27
27
  export let url: string;
28
28
  export let pageType: string;
29
29
  export let contentType: string;
30
+ export let readTime: string;
30
31
  export let showJumpMenu: boolean;
31
32
  export namespace thumbnailImage {
32
33
  let __typename_1: string;
@@ -1,3 +1,3 @@
1
1
  import { GradeLevelsObject } from './../interfaces';
2
2
 
3
- export declare const rangeifyGrades: (gradeLevels: GradeLevelsObject[]) => string | undefined;
3
+ export declare const rangeifyGrades: (gradeLevels: GradeLevelsObject[], showLabel?: boolean) => string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorer-1/vue",
3
- "version": "0.2.30",
3
+ "version": "0.2.32",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -30,7 +30,7 @@
30
30
  "vue-bind-once": "^0.2.1",
31
31
  "vue-observe-visibility": "^1.0.0",
32
32
  "vue3-compare-image": "^1.2.5",
33
- "@explorer-1/common": "1.1.9"
33
+ "@explorer-1/common": "1.1.10"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@vitejs/plugin-vue": "^5.0.4",
@@ -55,7 +55,7 @@ export default defineComponent({
55
55
  &:target {
56
56
  @apply scroll-mt-14;
57
57
  @screen lg {
58
- @apply scroll-mt-20;
58
+ @apply scroll-mt-[8rem];
59
59
  }
60
60
  }
61
61
  }
@@ -164,22 +164,72 @@ export const BaseStory = {
164
164
  management: BlockStreamfieldMinimalData.body,
165
165
  managementHeading: 'Management stuff',
166
166
 
167
- background: BlockStreamfieldMinimalData.body,
167
+ background: [
168
+ ...BlockStreamfieldMinimalData.body,
169
+ {
170
+ blockType: 'RichTextBlock',
171
+ value:
172
+ '<ol><li data-block-key="wv2pw">A list<ol><li data-block-key="mc91">A nested list should be a.<ol><li data-block-key="3p0pb">Another nested should be i.<ol><li data-block-key="22afo">Another is a number again.</li></ol></li></ol></li></ol></li></ol>'
173
+ }
174
+ ],
168
175
  backgroundHeading: 'Background heading',
169
176
 
170
177
  procedures: [
171
178
  {
172
- blocks: BlockStreamfieldMinimalData.body
179
+ sectionHeading: 'Section Heading 1',
180
+ stepsNumbering: true,
181
+ steps: [
182
+ {
183
+ blocks: [
184
+ ...BlockStreamfieldMinimalData.body,
185
+
186
+ {
187
+ blockType: 'RichTextBlock',
188
+ value:
189
+ '<ol><li data-block-key="wv2pw">A list<ol><li data-block-key="mc91">A nested list should be a.<ol><li data-block-key="3p0pb">Another nested should be i.<ol><li data-block-key="22afo">Another is a number again.</li></ol></li></ol></li></ol></li></ol>'
190
+ }
191
+ ]
192
+ },
193
+ {
194
+ blocks: BlockStreamfieldMinimalData.body
195
+ },
196
+ {
197
+ blocks: BlockStreamfieldMinimalData.body
198
+ }
199
+ ]
173
200
  },
174
201
  {
175
- blocks: BlockStreamfieldMinimalData.body
202
+ // sectionHeading: 'Section Heading 2',
203
+ stepsNumbering: true,
204
+ steps: [
205
+ {
206
+ blocks: BlockStreamfieldMinimalData.body
207
+ },
208
+ {
209
+ blocks: BlockStreamfieldMinimalData.body
210
+ },
211
+ {
212
+ blocks: BlockStreamfieldMinimalData.body
213
+ }
214
+ ]
176
215
  },
177
216
  {
178
- blocks: BlockStreamfieldMinimalData.body
217
+ sectionHeading: 'Section Heading 3',
218
+ stepsNumbering: false,
219
+ steps: [
220
+ {
221
+ blocks: BlockStreamfieldMinimalData.body
222
+ },
223
+ {
224
+ blocks: BlockStreamfieldMinimalData.body
225
+ },
226
+ {
227
+ blocks: BlockStreamfieldMinimalData.body
228
+ }
229
+ ]
179
230
  }
180
231
  ],
181
232
  proceduresHeading: 'Procedures heading',
182
- proceduresStepsNumbering: true,
183
233
 
184
234
  discussion: BlockStreamfieldMinimalData.body,
185
235
  discussionHeading: 'Discussion heading',
@@ -231,8 +231,7 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => {
231
231
  : undefined,
232
232
  blocks: section !== 'materials' && section !== 'procedures' ? data[section] : undefined,
233
233
  text: section === 'materials' ? data[section] : undefined,
234
- procedures: section === 'procedures' ? data[section] : undefined,
235
- procedureSteps: section === 'procedures' ? data.proceduresStepsNumbering : false
234
+ procedures: section === 'procedures' ? data[section] : undefined
236
235
  })
237
236
  }
238
237
  // include custom "after_" sections
@@ -333,19 +332,20 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => {
333
332
  v-for="(value, _key) in consolidatedSections"
334
333
  :key="_key"
335
334
  >
336
- <BlockStreamfield
337
- v-if="value.type === 'streamfield'"
338
- :data="value.blocks"
339
- />
340
- <PageEduLessonSection
341
- v-else
342
- :heading="value.heading"
343
- :blocks="value.blocks"
344
- :procedures="value.procedures"
345
- :procedure-steps="value.procedureSteps"
346
- :text="value.text"
347
- :image="value.image"
348
- />
335
+ <template v-if="value.blocks?.length || value.procedures?.length">
336
+ <BlockStreamfield
337
+ v-if="value.type === 'streamfield'"
338
+ :data="value.blocks"
339
+ />
340
+ <PageEduLessonSection
341
+ v-else
342
+ :heading="value.heading"
343
+ :blocks="value.blocks"
344
+ :procedures="value.procedures"
345
+ :text="value.text"
346
+ :image="value.image"
347
+ />
348
+ </template>
349
349
  </template>
350
350
 
351
351
  <!-- streamfield blocks -->
@@ -15,9 +15,12 @@ export interface PageEduLessonSectionProps {
15
15
  heading: BlockHeadingObject
16
16
  blocks?: StreamfieldBlockData[]
17
17
  procedures?: {
18
- blocks: StreamfieldBlockData[]
18
+ sectionHeading: string
19
+ stepsNumbering: boolean
20
+ steps: {
21
+ blocks: StreamfieldBlockData[]
22
+ }[]
19
23
  }[]
20
- procedureSteps?: boolean
21
24
  text?: string
22
25
  image?: ImageObject
23
26
  }
@@ -26,7 +29,6 @@ const props = withDefaults(defineProps<PageEduLessonSectionProps>(), {
26
29
  heading: undefined,
27
30
  blocks: undefined,
28
31
  procedures: undefined,
29
- procedureSteps: false,
30
32
  text: undefined,
31
33
  image: undefined
32
34
  })
@@ -68,23 +70,51 @@ const anchorId = computed(() => {
68
70
  />
69
71
  <template v-else-if="procedures?.length">
70
72
  <template
71
- v-for="(item, index) in procedures"
72
- :key="index"
73
+ v-for="(section, _index) in procedures"
74
+ :key="_index"
73
75
  >
74
- <LayoutHelper
75
- v-if="procedureSteps"
76
- indent="col-3"
77
- class="lg:mb-8 mb-5"
78
- >
79
- <BaseHeading level="h3">
80
- {{ 'Section ' + (Number(index) + 1) }}
81
- </BaseHeading>
82
- </LayoutHelper>
83
76
  <div class="PageEduProcedureSection">
84
- <BlockStreamfield
85
- v-if="item?.blocks"
86
- :data="item.blocks"
87
- />
77
+ <LayoutHelper
78
+ v-if="section.sectionHeading"
79
+ indent="col-3"
80
+ class="lg:mb-8 mb-5"
81
+ >
82
+ <BaseHeading level="h3">
83
+ {{ section.sectionHeading }}
84
+ </BaseHeading>
85
+ </LayoutHelper>
86
+ <div
87
+ v-if="section.steps?.length"
88
+ class="PageEduProcedureSectionSteps"
89
+ >
90
+ <template v-if="section.stepsNumbering">
91
+ <ol class="PageEduProcedureSectionSingleStep">
92
+ <template
93
+ v-for="(step, _step_index) of section.steps"
94
+ :key="_step_index"
95
+ >
96
+ <li v-if="step.blocks?.length">
97
+ <BlockStreamfield
98
+ v-if="step?.blocks"
99
+ :data="step.blocks"
100
+ />
101
+ </li>
102
+ </template>
103
+ </ol>
104
+ </template>
105
+ <template v-else>
106
+ <template
107
+ v-for="(step, _step_index) of section.steps"
108
+ :key="_step_index"
109
+ >
110
+ <BlockStreamfield
111
+ v-if="step.blocks?.length"
112
+ class="PageEduProcedureSectionSingleStep"
113
+ :data="step.blocks"
114
+ />
115
+ </template>
116
+ </template>
117
+ </div>
88
118
  </div>
89
119
  </template>
90
120
  </template>
@@ -98,23 +128,55 @@ const anchorId = computed(() => {
98
128
  </section>
99
129
  </template>
100
130
  <style lang="scss">
131
+ @use 'sass:math';
132
+ @function pxToRem($pxValue) {
133
+ // Assumes font-size for body element is a constant 16px
134
+ @return math.div($pxValue, 16) * 1rem;
135
+ }
101
136
  .PageEduProcedureSection {
102
- counter-reset: listitem;
103
- .BlockText ol {
104
- list-style-type: none;
105
- counter-reset: nestedlistitem;
137
+ .PageEduProcedureSectionSteps {
138
+ counter-reset: step;
139
+ }
140
+ .PageEduProcedureSectionSingleStep {
141
+ li:not(:last-of-type) .BlockStreamfield {
142
+ @apply -mb-5 lg:-mb-10;
143
+ }
144
+ }
145
+ ol.PageEduProcedureSectionSingleStep {
146
+ @apply list-none;
106
147
  > li {
107
- counter-increment: listitem;
108
- &::marker {
109
- content: counter(listitem) '. ';
148
+ @apply relative w-full;
149
+ counter-increment: step;
150
+ &::before {
151
+ @apply relative block w-[45rem] mx-auto h-0 pl-3;
152
+ content: counter(step) '. ';
153
+ // mimicking .text-body-lg
154
+ font-size: pxToRem(18);
155
+ line-height: 1.6667;
110
156
  }
111
- }
112
- ol {
113
- list-style-type: none;
114
- > li {
115
- counter-increment: nestedlistitem;
116
- &::marker {
117
- content: counter(nestedlistitem) '. ';
157
+
158
+ @screen sm {
159
+ &::before {
160
+ @apply w-[47rem];
161
+ font-size: pxToRem(19);
162
+ }
163
+ }
164
+ @screen md {
165
+ &::before {
166
+ @apply w-[50rem];
167
+ font-size: pxToRem(20);
168
+ }
169
+ }
170
+ @screen lg {
171
+ &::before {
172
+ @apply w-[47rem] pl-0;
173
+ font-size: pxToRem(21);
174
+ }
175
+ }
176
+ @screen xl {
177
+ &::before {
178
+ @apply w-[59rem];
179
+ font-size: pxToRem(22);
118
180
  }
119
181
  }
120
182
  }
@@ -148,19 +148,21 @@ export const mixinHighlightPrimary = (value: boolean) => {
148
148
  Useful for dropdown toggles.
149
149
  */
150
150
  export const mixinIsActivePath = (itemPath: string): Boolean => {
151
- const route = useRoute()
152
- const currentPath = route ? route.path : false
153
- const path = itemPath.startsWith('http') ? itemPath.replace(/^.*\/\/[^/]+/, '') : itemPath
154
- const ancestorPath = path ? (path.endsWith('/') ? path : path + '/') : false
151
+ if (itemPath) {
152
+ const route = useRoute()
153
+ const currentPath = route ? route.path : false
154
+ const path = itemPath.startsWith('http') ? itemPath.replace(/^.*\/\/[^/]+/, '') : itemPath
155
+ const ancestorPath = path ? (path.endsWith('/') ? path : path + '/') : false
155
156
 
156
- if (currentPath && path && ancestorPath) {
157
- if (currentPath === path) {
158
- return true
159
- } else if (currentPath.startsWith('/edu/events')) {
160
- // special treatment since EDU combines News & Events in the main nav
161
- return path.startsWith('/edu/news')
162
- } else {
163
- return currentPath.startsWith(ancestorPath)
157
+ if (currentPath && path && ancestorPath) {
158
+ if (currentPath === path) {
159
+ return true
160
+ } else if (currentPath.startsWith('/edu/events')) {
161
+ // special treatment since EDU combines News & Events in the main nav
162
+ return path.startsWith('/edu/news')
163
+ } else {
164
+ return currentPath.startsWith(ancestorPath)
165
+ }
164
166
  }
165
167
  }
166
168
  return false