@explorer-1/vue 0.1.2 → 0.1.3

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.1.2",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -28,7 +28,7 @@
28
28
  "vue": "^3.4.21",
29
29
  "vue-observe-visibility": "^1.0.0",
30
30
  "vue3-compare-image": "^1.2.5",
31
- "@explorer-1/common": "1.0.4"
31
+ "@explorer-1/common": "1.0.5"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@vitejs/plugin-vue": "^5.0.4",
@@ -26,7 +26,7 @@ export default defineComponent({
26
26
  size: {
27
27
  type: String as PropType<HeadingLevel>,
28
28
  required: false,
29
- default: 'h2',
29
+ default: '',
30
30
  validator: (prop: string): boolean => Object.keys(headings).includes(prop)
31
31
  }
32
32
  },
@@ -2,7 +2,6 @@
2
2
  <BaseHeading
3
3
  v-if="data"
4
4
  :level="data.level"
5
- :size="data.size"
6
5
  >
7
6
  {{ data.heading }}
8
7
  </BaseHeading>
@@ -49,6 +49,16 @@ export const BlockStreamfieldData = {
49
49
  '<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><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'
50
50
  },
51
51
  BlockInlineImageData.block,
52
+ {
53
+ blockType: 'HeadingBlock',
54
+ heading: 'Heading 2',
55
+ level: 'h2'
56
+ },
57
+ {
58
+ blockType: 'HeadingBlock',
59
+ heading: 'Heading 3',
60
+ level: 'h3'
61
+ },
52
62
  {
53
63
  blockType: 'RichTextBlock',
54
64
  value:
@@ -65,9 +65,5 @@ export default defineComponent({
65
65
  </script>
66
66
 
67
67
  <style lang="scss">
68
- @import '@explorer-1/common/src/scss/typography';
69
- // required for @apply text-subtitle in _BlockTable.scss
70
- @import '@explorer-1/common/src/scss/components/BlockText';
71
- // required for @extend .BlockText in _BlockTable.scss
72
68
  @import '@explorer-1/common/src/scss/components/BlockTable';
73
69
  </style>
@@ -1,12 +1,16 @@
1
1
  <script lang="ts">
2
2
  import { defineComponent } from 'vue'
3
3
  import { useRoute } from 'vue-router'
4
+ import { mapStores } from 'pinia'
5
+ import { useThemeStore } from '../../store/theme'
6
+
4
7
  import HeroMedia from '@explorer-1/vue/src/components/HeroMedia/HeroMedia.vue'
5
8
  import NavSecondary from '@explorer-1/vue/src/components/NavSecondary/NavSecondary.vue'
6
9
  import LayoutHelper from '@explorer-1/vue/src/components/LayoutHelper/LayoutHelper.vue'
7
10
  import DetailHeadline from '@explorer-1/vue/src/components/DetailHeadline/DetailHeadline.vue'
8
11
  import BlockImageStandard from '@explorer-1/vue/src/components/BlockImage/BlockImageStandard.vue'
9
12
  import ShareButtons from '@explorer-1/vue/src/components/ShareButtons/ShareButtons.vue'
13
+ import ShareButtonsEdu from '@explorer-1/vue/src/components/ShareButtonsEdu/ShareButtonsEdu.vue'
10
14
  import BlockStreamfield from '@explorer-1/vue/src/components/BlockStreamfield/BlockStreamfield.vue'
11
15
  import BlockRelatedLinks from '@explorer-1/vue/src/components/BlockRelatedLinks/BlockRelatedLinks.vue'
12
16
  import FormContact from '@explorer-1/vue/src/components/FormContact/FormContact.vue'
@@ -24,6 +28,7 @@ export default defineComponent({
24
28
  DetailHeadline,
25
29
  BlockImageStandard,
26
30
  ShareButtons,
31
+ ShareButtonsEdu,
27
32
  BlockStreamfield,
28
33
  BlockRelatedLinks,
29
34
  FormContact,
@@ -38,6 +43,10 @@ export default defineComponent({
38
43
  }
39
44
  },
40
45
  computed: {
46
+ ...mapStores(useThemeStore),
47
+ isEdu() {
48
+ return this.themeStore.theme === 'ThemeEdu'
49
+ },
41
50
  heroInline() {
42
51
  if (this.data?.heroPosition === 'inline') {
43
52
  return true
@@ -92,6 +101,13 @@ export default defineComponent({
92
101
  :label="data.displayLabel"
93
102
  :class="{ 'sr-only': hideH1 }"
94
103
  />
104
+ <ShareButtonsEdu
105
+ v-if="isEdu && data?.url"
106
+ class="mt-4"
107
+ :url="data.url"
108
+ :title="data.title"
109
+ :image="data.thumbnailImage?.original"
110
+ />
95
111
  </LayoutHelper>
96
112
 
97
113
  <!-- inline hero -->
@@ -114,7 +130,7 @@ export default defineComponent({
114
130
  class="lg:mb-0 relative mb-8"
115
131
  >
116
132
  <ShareButtons
117
- v-if="data.title && data.url"
133
+ v-if="data.title && data.url && !isEdu"
118
134
  :title="data.title"
119
135
  :url="data.url"
120
136
  />
@@ -0,0 +1,31 @@
1
+ import { ContentPageData } from './../PageContent/PageContent.stories.js'
2
+ import PageContent from './../PageContent/PageContent.vue'
3
+
4
+ export default {
5
+ title: 'Templates/EDU/PageContent',
6
+ component: PageContent,
7
+ decorators: [
8
+ () => ({
9
+ template: `<div id="storyDecorator" class="ThemeEdu"><story/></div>`
10
+ })
11
+ ],
12
+ parameters: {
13
+ html: {
14
+ root: '#storyDecorator'
15
+ },
16
+ docs: {
17
+ description: {
18
+ component:
19
+ 'EDU uses the same `PageContent` component as WWW. The only difference is the theme class used on the site.'
20
+ }
21
+ }
22
+ },
23
+ excludeStories: /.*(Data)$/
24
+ }
25
+
26
+ // stories
27
+ export const BaseStory = {
28
+ args: {
29
+ data: ContentPageData
30
+ }
31
+ }
@@ -101,7 +101,7 @@ const dateTimeArray = computed(() => {
101
101
  :topics="data.getTopicsForDisplay"
102
102
  schema
103
103
  />
104
- <share-buttons-edu
104
+ <ShareButtonsEdu
105
105
  v-if="data?.url"
106
106
  class="mt-4"
107
107
  :url="data.url"