@iqual/nuxt-icms 1.2.1 → 1.2.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.
Files changed (39) hide show
  1. package/components/DesignSystem/Molecules/MediaLightbox.vue +273 -0
  2. package/components/DesignSystem/Molecules/MediaSlider.vue +19 -25
  3. package/components/DesignSystem/README.md +489 -0
  4. package/components/Media/RemoteVideo/index.vue +3 -3
  5. package/components/Node/Icms/Page/index.vue +5 -3
  6. package/components/Paragraph/Card/Layout/index.vue +2 -2
  7. package/components/Paragraph/Contact/index.vue +1 -2
  8. package/components/Paragraph/Downloads/index.vue +1 -2
  9. package/components/Paragraph/FAQ/Layout/index.vue +1 -2
  10. package/components/Paragraph/FlipTeasers/index.vue +2 -2
  11. package/components/Paragraph/Gallery/index.vue +16 -14
  12. package/components/Paragraph/IconText/Layout/index.vue +1 -2
  13. package/components/Paragraph/Table/index.vue +2 -2
  14. package/components/Paragraph/Team/Layout/index.vue +2 -2
  15. package/components/Paragraph/Teasers/index.vue +3 -3
  16. package/components/Paragraph/Timeline/Layout/index.vue +6 -3
  17. package/components/Paragraph/iFrame/index.vue +16 -2
  18. package/components/Section/Footer/index.vue +15 -14
  19. package/components/Section/Header/GlobalMenu.vue +34 -34
  20. package/components/Section/Header/MetaMenu.vue +17 -19
  21. package/components/Section/Header/index.vue +21 -22
  22. package/composables/useGlobalConfig.ts +57 -0
  23. package/composables/useGraphqlCacheability.ts +22 -0
  24. package/composables/useInitData.ts +20 -112
  25. package/composables/useMediaLightbox.ts +114 -0
  26. package/composables/useMenu.ts +66 -0
  27. package/modules/dynamicEntityComponentResolver.ts +0 -20
  28. package/nuxt.config.ts +0 -5
  29. package/package.json +1 -2
  30. package/plugins/graphqlMiddleware.ts +27 -68
  31. package/plugins/initData.ts +105 -0
  32. package/{composables → queries}/query.initData.graphql +2 -8
  33. package/queries/query.loadTranslations.graphql +5 -0
  34. package/types/initData.ts +1 -0
  35. package/components/Section/Header/SearchLink.vue +0 -26
  36. package/composables/useLightbox.ts +0 -81
  37. package/composables/useMainMenuLinks.ts +0 -69
  38. package/composables/useMetaMenuLinks.ts +0 -44
  39. package/types/fslightbox-vue.d.ts +0 -1
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <DesignSystemAtomsContainer :spacing="spacing" :colorScheme="colorScheme">
3
3
  <DesignSystemAtomsGridRow>
4
- <div class="col-span-12 md:col-span-8">
4
+ <div class="col-span-12 md:col-span-12">
5
5
  <DesignSystemOrganismsContentBlock
6
6
  :pretitle="pretitle"
7
7
  :title="title"
@@ -11,7 +11,7 @@
11
11
  :subtitle="subtitle"
12
12
  />
13
13
  </div>
14
- <div class="col-span-12 md:col-span-8">
14
+ <div class="col-span-12 md:col-span-9">
15
15
  <DesignSystemOrganismsContentBlock :text="text" />
16
16
  </div>
17
17
  </DesignSystemAtomsGridRow>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <DesignSystemAtomsContainer :colorScheme="colorScheme" :spacing="spacing">
3
3
  <DesignSystemAtomsGridRow>
4
- <div class="col-span-12 md:col-span-8">
4
+ <div class="col-span-12 md:col-span-12">
5
5
  <DesignSystemOrganismsContentBlock
6
6
  :pretitle="pretitle"
7
7
  :title="title"
@@ -12,7 +12,7 @@
12
12
  :colorScheme="colorScheme"
13
13
  />
14
14
  </div>
15
- <div class="col-span-12 md:col-span-8">
15
+ <div class="col-span-12 md:col-span-9">
16
16
  <DesignSystemOrganismsContentBlock
17
17
  :text="text"
18
18
  :colorScheme="colorScheme"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <DesignSystemAtomsContainer :colorScheme="colorScheme" :spacing="spacing">
3
3
  <DesignSystemAtomsGridRow>
4
- <div class="col-span-12 md:col-span-8">
4
+ <div class="col-span-12 md:col-span-12">
5
5
  <DesignSystemOrganismsContentBlock
6
6
  :pretitle="pretitle"
7
7
  :title="title"
@@ -11,7 +11,7 @@
11
11
  :colorScheme="colorScheme"
12
12
  />
13
13
  </div>
14
- <div class="col-span-12 md:col-span-8">
14
+ <div class="col-span-12 md:col-span-9">
15
15
  <DesignSystemOrganismsContentBlock
16
16
  :subtitle="subtitle"
17
17
  :text="text"
@@ -33,7 +33,7 @@ import type { ParagraphIcmsLayoutTeasersFragment } from '#graphql-operations'
33
33
 
34
34
  const props = defineProps<ParagraphIcmsLayoutTeasersFragment>()
35
35
 
36
- const { options, parentType } = useAttrs().blokkliData
36
+ const { options, parentType } = useAttrs().blokkliData as any
37
37
 
38
38
  const colorScheme = computed(() => {
39
39
  return options.value.colorScheme
@@ -1,16 +1,19 @@
1
1
  <template>
2
2
  <DesignSystemAtomsContainer :color-scheme="colorScheme" :spacing="spacing" :data-timeline="id">
3
3
  <DesignSystemAtomsGridRow v-if="pretitle || title || subtitle || text">
4
- <div class="col-span-12 md:col-span-8">
4
+ <div class="col-span-12 md:col-span-12">
5
5
  <DesignSystemOrganismsContentBlock
6
6
  :pretitle="pretitle"
7
7
  :title="title"
8
8
  :titleStyle="titleStyle"
9
9
  :titleWeight="titleWeight"
10
10
  :subtitle="subtitle"
11
- :text="text"
12
11
  :colorScheme="colorScheme"
13
- :hasDecorativeLine="Boolean(subtitle || text)"
12
+ />
13
+ </div>
14
+ <div class="col-span-12 md:col-span-9">
15
+ <DesignSystemOrganismsContentBlock
16
+ :text="text"
14
17
  />
15
18
  </div>
16
19
  </DesignSystemAtomsGridRow>
@@ -1,11 +1,16 @@
1
1
  <template>
2
2
  <DesignSystemAtomsContainer :colorScheme="colorScheme" :spacing="spacing">
3
3
  <DesignSystemAtomsGridRow>
4
- <div :class="textWrapperClassList">
4
+ <div :class="titleWrapperClassList">
5
5
  <DesignSystemOrganismsContentBlock
6
6
  :pretitle="pretitle"
7
7
  :title="title"
8
8
  :titleWeight="titleWeight"
9
+ :colorScheme="colorScheme"
10
+ />
11
+ </div>
12
+ <div :class="textWrapperClassList">
13
+ <DesignSystemOrganismsContentBlock
9
14
  :text="text"
10
15
  :colorScheme="colorScheme"
11
16
  />
@@ -28,13 +33,22 @@ const props = defineProps<ParagraphIcmsLayoutIframeFragment>()
28
33
 
29
34
  const { options, isEditing } = useAttrs().blokkliData
30
35
 
36
+ const titleWrapperClassList = computed(() => {
37
+ if (options.value.textWidth === 'medium') {
38
+ return ['col-span-8', 'col-start-3']
39
+ } else if (options.value.textWidth === 'narrow') {
40
+ return ['col-span-8', 'col-start-3', 'md:col-span-6', 'md:col-start-4']
41
+ }
42
+ return ['col-span-12']
43
+ })
44
+
31
45
  const textWrapperClassList = computed(() => {
32
46
  if (options.value.textWidth === 'medium') {
33
47
  return ['col-span-8', 'col-start-3']
34
48
  } else if (options.value.textWidth === 'narrow') {
35
49
  return ['col-span-8', 'col-start-3', 'md:col-span-6', 'md:col-start-4']
36
50
  }
37
- return ['col-span-8']
51
+ return ['col-span-9']
38
52
  })
39
53
 
40
54
  const colorScheme = computed(() => {
@@ -24,19 +24,19 @@
24
24
  class="col-span-3 mb-6 flex flex-col gap-8 lg:col-span-1 lg:flex-row"
25
25
  >
26
26
  <ul v-for="(link, index) in footerMenuLinks" :key="index">
27
- <p class="mb-5 font-bold" v-text="link.link.label" />
27
+ <p class="mb-5 font-bold" v-text="link.label" />
28
28
 
29
29
  <li
30
- v-for="(subLink, index) in link.subtree"
30
+ v-for="(subLink, index) in link?.children"
31
31
  :key="index"
32
32
  class="mb-3 last:mb-0"
33
33
  >
34
34
  <NuxtLink
35
- v-if="subLink.link.url"
36
- :to="subLink.link.url.path"
37
- :title="subLink.link.label"
35
+ v-if="subLink?.href"
36
+ :to="subLink?.href"
37
+ :title="subLink.label"
38
38
  class="transition-colors hover:text-primary-500 focus:text-primary-500"
39
- >{{ subLink.link.label }}</NuxtLink>
39
+ >{{ subLink.label }}</NuxtLink>
40
40
  </li>
41
41
  </ul>
42
42
  </div>
@@ -93,12 +93,12 @@
93
93
  <ul class="flex flex-col gap-4 md:flex-row md:gap-6">
94
94
  <li v-for="(link, index) in footerMetaMenuLinks" :key="index">
95
95
  <NuxtLink
96
- v-if="link.link.url"
97
- :to="link.link.url.path"
98
- :title="link.link.label"
96
+ v-if="link?.href"
97
+ :to="link?.href"
98
+ :title="link.label"
99
99
  class="underline transition-colors hover:text-primary-500 focus:text-primary-500"
100
100
  prefetch
101
- >{{ link.link.label }}</NuxtLink>
101
+ >{{ link.label }}</NuxtLink>
102
102
  </li>
103
103
  </ul>
104
104
  </div>
@@ -109,9 +109,10 @@
109
109
  </template>
110
110
 
111
111
  <script lang="ts" setup>
112
- import type { NuxtSvgSpriteSymbol } from '../../../../../.nuxt/nuxt-svg-sprite/runtime'
113
- const initData: Ref<InitData> = await useInitData()
114
- const { footerMenuLinks, footerMetaMenuLinks, globalConfig } = initData.value
112
+ import type { NuxtSvgSpriteSymbol } from '#nuxt-svg-icon-sprite/runtime'
113
+
114
+ const { menuItems: footerMenuLinks } = await useMenu('footerMenu')
115
+ const { menuItems: footerMetaMenuLinks } = await useMenu('footerMenu')
115
116
  const {
116
117
  companyLogo,
117
118
  companyName,
@@ -120,7 +121,7 @@ const {
120
121
  phoneNumber,
121
122
  emailAddress,
122
123
  socialMediaLinks,
123
- } = globalConfig
124
+ } = await useGlobalConfig()
124
125
 
125
126
  interface SocialMediaIconMeta {
126
127
  sprite: NuxtSvgSpriteSymbol
@@ -9,19 +9,19 @@
9
9
  class="flex flex-col flex-wrap justify-end text-base lg:h-full lg:flex-row lg:items-center lg:gap-8 lg:border-0 lg:font-medium"
10
10
  >
11
11
  <li
12
- v-for="(link, mainIndex) in links"
12
+ v-for="(link, mainIndex) in menuItems"
13
13
  :key="`global_${mainIndex}`"
14
14
  role="menuitem"
15
15
  class="group/main relative flex flex-col items-stretch lg:h-full lg:flex-row"
16
16
  >
17
17
  <VuepalLink
18
- :to="link.link?.url?.path"
18
+ :to="link?.href"
19
19
  :aria-controls="'firstLevel-' + mainIndex"
20
20
  :aria-expanded="hoverMain === mainIndex"
21
- :aria-haspopup="!!link.subtree?.length"
21
+ :aria-haspopup="!!link.children?.length"
22
22
  class="flex w-full items-center justify-between whitespace-nowrap group-hover/main:text-primary-500 motion-safe:transition-colors motion-safe:duration-200 lg:size-auto lg:py-0"
23
23
  :class="
24
- link.link?.url?.path === currentActiveMainLink?.link.url?.path
24
+ link?.href === menuItemActive?.href
25
25
  ? 'text-primary-500'
26
26
  : 'text-black'
27
27
  "
@@ -29,7 +29,7 @@
29
29
  @mouseleave="!isMobile && onMouseLeave()"
30
30
  @click="onLinkClick"
31
31
  >
32
- {{ link.link.label }}
32
+ {{ link.label }}
33
33
  <div
34
34
  class="grid size-10 place-content-center lg:size-auto"
35
35
  @click.prevent.stop="
@@ -37,7 +37,7 @@
37
37
  "
38
38
  >
39
39
  <SpriteSymbol
40
- v-show="link.subtree.length"
40
+ v-show="link?.children?.length"
41
41
  name="chevron-down"
42
42
  :aria-label="
43
43
  isMobile
@@ -57,27 +57,27 @@
57
57
  <!-- First level menu -->
58
58
  <transition :name="isMobile ? 'slideDown' : 'fade'">
59
59
  <div
60
- v-show="link.subtree?.length && hoverMain === mainIndex"
60
+ v-show="link.children?.length && hoverMain === mainIndex"
61
61
  :id="'firstLevel-' + mainIndex"
62
62
  class="w-max min-w-full lg:absolute lg:left-0 lg:top-full lg:border lg:border-gray-100 lg:bg-white lg:text-sm"
63
63
  >
64
64
  <ul role="menu" class="ml-4 lg:ml-0">
65
65
  <li
66
- v-for="(firstLevelLink, firstLevelIndex) in link.subtree"
66
+ v-for="(firstLevelLink, firstLevelIndex) in link.children"
67
67
  :key="`firstLevel_${firstLevelIndex}`"
68
68
  role="menuitem"
69
69
  class="group/first relative"
70
70
  @mouseleave="!isMobile && onMouseLeave()"
71
71
  >
72
72
  <VuepalLink
73
- :to="firstLevelLink.link.url?.path"
73
+ :to="firstLevelLink.href"
74
74
  :aria-controls="'secondLevel-' + firstLevelIndex"
75
75
  :aria-expanded="hoverFirst === firstLevelIndex"
76
- :aria-haspopup="!!firstLevelLink.subtree.length"
76
+ :aria-haspopup="!!firstLevelLink?.children?.length"
77
77
  class="flex w-full items-center justify-between whitespace-nowrap no-underline group-hover/first:text-primary-500 motion-safe:transition-colors motion-safe:duration-200 lg:px-4 lg:py-3"
78
78
  :class="
79
- firstLevelLink.link?.url?.path ===
80
- activeFirstLevelLink?.link.url?.path
79
+ firstLevelLink?.href ===
80
+ menuItemActiveLevel1?.href
81
81
  ? 'text-primary-500'
82
82
  : 'text-black'
83
83
  "
@@ -87,7 +87,7 @@
87
87
  @mouseleave="!isMobile && onMouseLeave()"
88
88
  @click="onLinkClick"
89
89
  >
90
- {{ firstLevelLink.link.label }}
90
+ {{ firstLevelLink.label }}
91
91
  <div
92
92
  class="grid size-10 place-content-center lg:size-auto"
93
93
  @click.prevent.stop="
@@ -95,7 +95,7 @@
95
95
  "
96
96
  >
97
97
  <SpriteSymbol
98
- v-show="firstLevelLink.subtree.length"
98
+ v-show="firstLevelLink?.children?.length"
99
99
  name="chevron-down"
100
100
  :aria-label="
101
101
  isMobile
@@ -117,7 +117,7 @@
117
117
  <transition :name="isMobile ? 'slideDown' : 'fade'">
118
118
  <div
119
119
  v-show="
120
- firstLevelLink.subtree?.length &&
120
+ firstLevelLink.children?.length &&
121
121
  hoverFirst === firstLevelIndex
122
122
  "
123
123
  :id="'secondLevel-' + firstLevelIndex"
@@ -127,20 +127,20 @@
127
127
  <li
128
128
  v-for="(
129
129
  secondLevelLink, secondLevelIndex
130
- ) in firstLevelLink.subtree"
130
+ ) in firstLevelLink.children"
131
131
  :key="`secondLevel_${secondLevelIndex}`"
132
132
  role="menuitem"
133
133
  class="group/second relative"
134
134
  >
135
135
  <VuepalLink
136
- :to="secondLevelLink.link.url?.path"
136
+ :to="secondLevelLink.href"
137
137
  :aria-controls="'thirdLevel-' + secondLevelIndex"
138
138
  :aria-expanded="hoverSecond === secondLevelIndex"
139
- :aria-haspopup="!!secondLevelLink.subtree.length"
139
+ :aria-haspopup="!!secondLevelLink?.children?.length"
140
140
  class="flex w-full items-center justify-between whitespace-nowrap no-underline group-hover/second:text-primary-500 motion-safe:transition-colors motion-safe:duration-200 lg:px-4 lg:py-3"
141
141
  :class="
142
- secondLevelLink.link?.url?.path ===
143
- activeSecondLevelLink?.link.url?.path
142
+ secondLevelLink?.href ===
143
+ menuItemActiveLevel2?.href
144
144
  ? 'text-primary-500'
145
145
  : 'text-black'
146
146
  "
@@ -151,7 +151,7 @@
151
151
  @mouseleave="!isMobile && onMouseLeave()"
152
152
  @click="onLinkClick"
153
153
  >
154
- {{ secondLevelLink.link.label }}
154
+ {{ secondLevelLink.label }}
155
155
  <div
156
156
  class="grid size-10 place-content-center lg:size-auto"
157
157
  @click.prevent.stop="
@@ -160,7 +160,7 @@
160
160
  "
161
161
  >
162
162
  <SpriteSymbol
163
- v-show="secondLevelLink.subtree.length"
163
+ v-show="secondLevelLink?.children?.length"
164
164
  name="chevron-down"
165
165
  :aria-label="
166
166
  isMobile
@@ -185,7 +185,7 @@
185
185
  <transition :name="isMobile ? 'slideDown' : 'fade'">
186
186
  <div
187
187
  v-show="
188
- secondLevelLink.subtree?.length &&
188
+ secondLevelLink.children?.length &&
189
189
  hoverSecond === secondLevelIndex
190
190
  "
191
191
  :id="'thirdLevel-' + secondLevelIndex"
@@ -195,17 +195,17 @@
195
195
  <li
196
196
  v-for="(
197
197
  thirdLevelLink, thirdLevelIndex
198
- ) in secondLevelLink.subtree"
198
+ ) in secondLevelLink.children"
199
199
  :key="`thirdLevel_${thirdLevelIndex}`"
200
200
  role="menuitem"
201
201
  class="group/third relative"
202
202
  >
203
203
  <VuepalLink
204
- :to="thirdLevelLink.link.url?.path"
204
+ :to="thirdLevelLink.href"
205
205
  class="flex h-10 w-full items-center whitespace-nowrap no-underline group-hover/third:text-primary-500 motion-safe:transition-colors motion-safe:duration-200 lg:h-auto lg:px-4 lg:py-3"
206
206
  :class="
207
- thirdLevelLink.link?.url?.path ===
208
- activeThirdLevelLink?.link.url?.path
207
+ thirdLevelLink?.href ===
208
+ menuTiemActiveLevel3?.href
209
209
  ? 'text-primary-500'
210
210
  : 'text-black'
211
211
  "
@@ -214,7 +214,7 @@
214
214
  "
215
215
  @click="onLinkClick"
216
216
  >
217
- {{ thirdLevelLink.link.label }}
217
+ {{ thirdLevelLink.label }}
218
218
  </VuepalLink>
219
219
  </li>
220
220
  </ul>
@@ -239,12 +239,12 @@ type menuLevel = 'main' | 'first' | 'second' | 'third'
239
239
  const globalMenu = ref<HTMLElement | null>(null)
240
240
  const { isMobile } = useIsMobile()
241
241
  const {
242
- links,
243
- currentActiveMainLink,
244
- activeFirstLevelLink,
245
- activeSecondLevelLink,
246
- activeThirdLevelLink,
247
- } = await useMainMenuLinks()
242
+ menuItems,
243
+ menuItemActive,
244
+ menuItemActiveLevel1,
245
+ menuItemActiveLevel2,
246
+ menuTiemActiveLevel3,
247
+ } = await useMenu('mainMenu')
248
248
  const hoverMain = ref(-1)
249
249
  const hoverFirst = ref(-1)
250
250
  const hoverSecond = ref(-1)
@@ -5,37 +5,35 @@
5
5
  class="flex size-full flex-col flex-wrap justify-end text-base lg:flex-row lg:items-center lg:gap-8 lg:font-medium"
6
6
  >
7
7
  <li
8
- v-for="(link, index) in links"
8
+ v-for="(menuItem, index) in menuItems"
9
9
  :key="`meta_${index}`"
10
10
  role="menuitem"
11
11
  class="group/main relative flex flex-col items-stretch lg:flex-row"
12
12
  >
13
13
  <VuepalLink
14
- :to="link.link?.url?.path"
14
+ :to="menuItem?.href"
15
15
  class="flex w-full items-center justify-between py-1 group-hover/main:text-primary-500 motion-safe:transition-colors motion-safe:duration-200 lg:size-auto lg:py-0"
16
16
  :class="
17
- link.link?.url?.path === currentActiveMetaLink?.link.url?.path
18
- ? 'text-primary-500'
19
- : 'text-black'
17
+ menuItem?.href === menuItemActive?.href ? 'text-primary-500' : 'text-black'
20
18
  "
21
19
  @click="onLangDropdownLinkClick"
22
20
  >
23
- {{ link.link.label }}
21
+ {{ menuItem.label }}
24
22
  </VuepalLink>
25
23
  </li>
26
24
  </ul>
27
25
  </nav>
28
26
  <div v-if="props.links?.length !== 0" class="mb-8 flex gap-8 lg:mb-0 lg:ml-8">
29
27
  <DesignSystemAtomsButton
30
- v-for="link in props.links"
31
- :key="link.uuid"
32
- :label="link?.props?.label"
33
- :subline="link?.props?.subline"
34
- :title="link?.props?.title"
35
- :link="link?.props?.link?.uri?.path"
36
- :params="link?.props?.params"
37
- :target-blank="link?.props?.targetBlank"
38
- :style="link?.props?.buttonStyle"
28
+ v-for="(link, key) in links"
29
+ :key="key"
30
+ :label="link?.label"
31
+ :subline="link?.subline"
32
+ :title="link?.title"
33
+ :link="link?.link?.uri?.path"
34
+ :params="link?.params"
35
+ :target-blank="link?.targetBlank"
36
+ :style="link?.buttonStyle"
39
37
  buttonClass="no-underline"
40
38
  @click="onLangDropdownLinkClick"
41
39
  />
@@ -43,17 +41,17 @@
43
41
  </template>
44
42
 
45
43
  <script setup lang="ts">
46
- import type { ParagraphIcmsButtonElementFragment } from '#build/graphql-operations'
44
+ import type { GlobalConfigFragment } from '#build/graphql-operations'
47
45
 
48
- const { links, currentActiveMetaLink } = await useMetaMenuLinks()
46
+ const { menuItems, menuItemActive } = await useMenu('metaMenu')
49
47
 
50
48
  const props = defineProps<{
51
- links: Array<ParagraphIcmsButtonElementFragment>
49
+ links?: GlobalConfigFragment['contactButtons']
52
50
  }>()
53
51
 
54
52
  const emit = defineEmits(['meta:empty', 'lang-dropdown:change'])
55
53
 
56
- if (links.value?.length === 0) {
54
+ if (menuItems.value?.length === 0) {
57
55
  emit('meta:empty')
58
56
  }
59
57
 
@@ -49,7 +49,7 @@
49
49
  <!-- Logo -->
50
50
  <NuxtLink
51
51
  :to="`/${currentLanguage}`"
52
- :title="globalConfig.companyName"
52
+ :title="companyName"
53
53
  prefetch
54
54
  >
55
55
  <Media
@@ -73,15 +73,15 @@
73
73
  class="ml-8 hidden items-center justify-center gap-8 lg:flex"
74
74
  >
75
75
  <DesignSystemAtomsButton
76
- v-for="contactButton in contactButtons"
77
- :key="contactButton.uuid"
78
- :label="contactButton?.props?.label"
79
- :subline="contactButton?.props?.subline"
80
- :title="contactButton?.props?.title"
81
- :link="contactButton?.props?.link?.uri?.path"
82
- :params="contactButton?.props?.params"
83
- :targetBlank="contactButton?.props?.targetBlank"
84
- :style="contactButton?.props?.buttonStyle"
76
+ v-for="(contactButton, key) in contactButtons"
77
+ :key="key"
78
+ :label="contactButton?.label"
79
+ :subline="contactButton?.subline"
80
+ :title="contactButton?.title"
81
+ :link="contactButton?.link?.uri?.path"
82
+ :params="contactButton?.params"
83
+ :targetBlank="contactButton?.targetBlank"
84
+ :style="contactButton?.buttonStyle"
85
85
  />
86
86
  </div>
87
87
 
@@ -125,15 +125,15 @@
125
125
  <!-- Mobile Contact button -->
126
126
  <div v-if="contactButtons?.length" class="flex gap-8 lg:ml-8">
127
127
  <DesignSystemAtomsButton
128
- v-for="contactButton in contactButtons"
129
- :key="contactButton.uuid"
130
- :label="contactButton?.props?.label"
131
- :subline="contactButton?.props?.subline"
132
- :title="contactButton?.props?.title"
133
- :link="contactButton?.props?.link?.uri?.path"
134
- :params="contactButton?.props?.params"
135
- :targetBlank="contactButton?.props?.targetBlank"
136
- :style="contactButton?.props?.buttonStyle"
128
+ v-for="(contactButton, key) in contactButtons"
129
+ :key="key"
130
+ :label="contactButton?.label"
131
+ :subline="contactButton?.subline"
132
+ :title="contactButton?.title"
133
+ :link="contactButton?.link?.uri?.path"
134
+ :params="contactButton?.params"
135
+ :targetBlank="contactButton?.targetBlank"
136
+ :style="contactButton?.buttonStyle"
137
137
  />
138
138
  </div>
139
139
  </div>
@@ -141,9 +141,8 @@
141
141
  </template>
142
142
 
143
143
  <script lang="ts" setup>
144
- const initData: Ref<InitData> = await useInitData()
145
- const { globalConfig } = initData.value
146
- const { companyLogo, contactButtons, metaLinks } = globalConfig
144
+
145
+ const { companyLogo, companyName, contactButtons, metaLinks } = await useGlobalConfig()
147
146
 
148
147
  const container = ref<HTMLElement | null>(null)
149
148
  const metaRef = useTemplateRef('metaRef')
@@ -0,0 +1,57 @@
1
+
2
+ export async function useGlobalConfig() {
3
+ const initData = useInitData()
4
+
5
+ const companyLogo = computed(() => {
6
+ return initData.globalConfig.value.companyLogo
7
+ })
8
+
9
+ const companyLogoAlt = computed(() => {
10
+ return initData.globalConfig.value.companyLogoAlt
11
+ })
12
+
13
+ const companyName = computed(() => {
14
+ return initData.globalConfig.value.companyName
15
+ })
16
+
17
+ const companyDescription = computed(() => {
18
+ return initData.globalConfig.value.companyDescription
19
+ })
20
+
21
+ const address = computed(() => {
22
+ return initData.globalConfig.value.address
23
+ })
24
+
25
+ const phoneNumber = computed(() => {
26
+ return initData.globalConfig.value.phoneNumber
27
+ })
28
+
29
+ const emailAddress = computed(() => {
30
+ return initData.globalConfig.value.emailAddress
31
+ })
32
+
33
+ const contactButtons = computed(() => {
34
+ return initData.globalConfig.value.contactButtons
35
+ })
36
+
37
+ const metaLinks = computed(() => {
38
+ return initData.globalConfig.value.metaLinks
39
+ })
40
+
41
+ const socialMediaLinks = computed(() => {
42
+ return initData.globalConfig.value.socialMediaLinks
43
+ })
44
+
45
+ return {
46
+ companyLogo,
47
+ companyLogoAlt,
48
+ companyName,
49
+ companyDescription,
50
+ address,
51
+ phoneNumber,
52
+ emailAddress,
53
+ contactButtons,
54
+ metaLinks,
55
+ socialMediaLinks,
56
+ }
57
+ }
@@ -0,0 +1,22 @@
1
+ import type { GraphqlResponseTyped } from '#nuxt-graphql-middleware/response'
2
+ import type { H3Event } from 'h3'
3
+
4
+ export function useGraphqlCacheability(
5
+ event: H3Event,
6
+ response?: GraphqlResponseTyped,
7
+ ) {
8
+ if (import.meta.server) {
9
+ useCDNHeaders((cdn) => {
10
+ const cacheability = response?.extensions.cacheability
11
+ if (!cacheability?.isCacheable) {
12
+ cdn.private()
13
+ return
14
+ }
15
+
16
+ cdn
17
+ .public()
18
+ .setNumeric('sharedMaxAge', cacheability.sharedMaxAge)
19
+ .addTags(cacheability.tagsCdn)
20
+ }, event)
21
+ }
22
+ }