@explorer-1/vue 0.2.31 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorer-1/vue",
3
- "version": "0.2.31",
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,7 +164,14 @@ 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: [
@@ -173,7 +180,15 @@ export const BaseStory = {
173
180
  stepsNumbering: true,
174
181
  steps: [
175
182
  {
176
- blocks: BlockStreamfieldMinimalData.body
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
+ ]
177
192
  },
178
193
  {
179
194
  blocks: BlockStreamfieldMinimalData.body
@@ -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,18 +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
- :text="value.text"
346
- :image="value.image"
347
- />
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>
348
349
  </template>
349
350
 
350
351
  <!-- streamfield blocks -->
@@ -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