@iqual/nuxt-icms 1.0.2
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/app.config.ts +1 -0
- package/app.vue +50 -0
- package/assets/css/backend.css +82 -0
- package/assets/css/ckeditor.css +15 -0
- package/assets/css/components/carousel.css +91 -0
- package/assets/css/components/ck-content.css +65 -0
- package/assets/css/components/container.css +17 -0
- package/assets/css/components/dialog.css +9 -0
- package/assets/css/components/grid-container.css +296 -0
- package/assets/css/components/link.css +21 -0
- package/assets/css/fe-fixes.css +105 -0
- package/assets/css/tailwind.css +104 -0
- package/assets/css/typography.css +67 -0
- package/assets/symbols/chevron-down.svg +1 -0
- package/assets/symbols/chevron-right.svg +3 -0
- package/assets/symbols/close.svg +3 -0
- package/assets/symbols/facebook.svg +3 -0
- package/assets/symbols/instagram.svg +13 -0
- package/assets/symbols/linkedin.svg +4 -0
- package/assets/symbols/logo.svg +22 -0
- package/assets/symbols/magnifyingglass.svg +4 -0
- package/assets/symbols/pinterest.svg +4 -0
- package/assets/symbols/play.svg +6 -0
- package/assets/symbols/tiktok.svg +4 -0
- package/assets/symbols/x.svg +4 -0
- package/bundles.ts +50 -0
- package/components/Blokkli/Button/Element/icon.svg +4 -0
- package/components/Blokkli/Button/Element/index.vue +18 -0
- package/components/Blokkli/CallToAction/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/CallToAction/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/CallToAction/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/CallToAction/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/CallToAction/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/CallToAction/icon.svg +5 -0
- package/components/Blokkli/CallToAction/index.vue +15 -0
- package/components/Blokkli/Card/Element/icon.svg +6 -0
- package/components/Blokkli/Card/Element/index.vue +14 -0
- package/components/Blokkli/Card/Layout/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Card/Layout/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Card/Layout/icon-blokkli-option-large-spacing.svg +1 -0
- package/components/Blokkli/Card/Layout/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Card/Layout/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Card/Layout/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Card/Layout/icon-blokkli-option-small-spacing.svg +1 -0
- package/components/Blokkli/Card/Layout/icon.svg +8 -0
- package/components/Blokkli/Card/Layout/index.vue +15 -0
- package/components/Blokkli/Contact/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Contact/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Contact/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Contact/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Contact/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Contact/icon.svg +5 -0
- package/components/Blokkli/Contact/index.vue +15 -0
- package/components/Blokkli/Downloads/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Downloads/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Downloads/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Downloads/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Downloads/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Downloads/icon.svg +5 -0
- package/components/Blokkli/Downloads/index.vue +16 -0
- package/components/Blokkli/FAQ/Element/icon-blokkli-option-large-spacing.svg +1 -0
- package/components/Blokkli/FAQ/Element/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/FAQ/Element/icon-blokkli-option-small-spacing.svg +1 -0
- package/components/Blokkli/FAQ/Element/icon.svg +3 -0
- package/components/Blokkli/FAQ/Element/index.vue +14 -0
- package/components/Blokkli/FAQ/Layout/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/FAQ/Layout/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/FAQ/Layout/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/FAQ/Layout/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/FAQ/Layout/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/FAQ/Layout/icon.svg +5 -0
- package/components/Blokkli/FAQ/Layout/index.vue +20 -0
- package/components/Blokkli/FlipTeasers/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/FlipTeasers/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/FlipTeasers/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/FlipTeasers/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/FlipTeasers/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/FlipTeasers/icon.svg +7 -0
- package/components/Blokkli/FlipTeasers/index.vue +15 -0
- package/components/Blokkli/Gallery/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Gallery/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Gallery/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Gallery/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Gallery/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Gallery/icon.svg +5 -0
- package/components/Blokkli/Gallery/index.vue +16 -0
- package/components/Blokkli/HeroImage/icon.svg +5 -0
- package/components/Blokkli/HeroImage/index.vue +15 -0
- package/components/Blokkli/IconText/Element/icon.svg +5 -0
- package/components/Blokkli/IconText/Element/index.vue +14 -0
- package/components/Blokkli/IconText/Layout/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/IconText/Layout/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/IconText/Layout/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/IconText/Layout/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/IconText/Layout/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/IconText/Layout/icon.svg +7 -0
- package/components/Blokkli/IconText/Layout/index.vue +20 -0
- package/components/Blokkli/Introduction/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Introduction/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Introduction/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Introduction/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Introduction/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Introduction/icon.svg +5 -0
- package/components/Blokkli/Introduction/index.vue +20 -0
- package/components/Blokkli/Logo/Element/icon.svg +6 -0
- package/components/Blokkli/Logo/Element/index.vue +14 -0
- package/components/Blokkli/Media/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Media/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Media/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Media/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Media/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Media/icon.svg +8 -0
- package/components/Blokkli/Media/index.vue +15 -0
- package/components/Blokkli/Partnerships/Element/icon.svg +3 -0
- package/components/Blokkli/Partnerships/Element/index.vue +13 -0
- package/components/Blokkli/Partnerships/Layout/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Partnerships/Layout/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Partnerships/Layout/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Partnerships/Layout/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Partnerships/Layout/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Partnerships/Layout/icon.svg +5 -0
- package/components/Blokkli/Partnerships/Layout/index.vue +15 -0
- package/components/Blokkli/SingleTestimonial/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/SingleTestimonial/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/SingleTestimonial/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/SingleTestimonial/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/SingleTestimonial/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/SingleTestimonial/icon.svg +5 -0
- package/components/Blokkli/SingleTestimonial/index.vue +20 -0
- package/components/Blokkli/Table/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Table/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Table/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Table/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Table/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Table/icon.svg +5 -0
- package/components/Blokkli/Table/index.vue +15 -0
- package/components/Blokkli/Tabs/Element/icon.svg +3 -0
- package/components/Blokkli/Tabs/Element/index.vue +14 -0
- package/components/Blokkli/Tabs/Layout/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Tabs/Layout/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Tabs/Layout/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Tabs/Layout/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Tabs/Layout/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Tabs/Layout/icon.svg +5 -0
- package/components/Blokkli/Tabs/Layout/index.vue +20 -0
- package/components/Blokkli/Team/Element/icon.svg +3 -0
- package/components/Blokkli/Team/Element/index.vue +14 -0
- package/components/Blokkli/Team/Layout/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Team/Layout/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Team/Layout/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Team/Layout/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Team/Layout/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Team/Layout/icon.svg +5 -0
- package/components/Blokkli/Team/Layout/index.vue +15 -0
- package/components/Blokkli/Teasers/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Teasers/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Teasers/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Teasers/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Teasers/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Teasers/icon.svg +6 -0
- package/components/Blokkli/Teasers/index.vue +15 -0
- package/components/Blokkli/Testimonial/Element/icon.svg +3 -0
- package/components/Blokkli/Testimonial/Element/index.vue +14 -0
- package/components/Blokkli/Testimonial/Layout/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Testimonial/Layout/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Testimonial/Layout/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Testimonial/Layout/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Testimonial/Layout/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Testimonial/Layout/icon.svg +5 -0
- package/components/Blokkli/Testimonial/Layout/index.vue +15 -0
- package/components/Blokkli/Text/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/Text/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/Text/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/Text/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/Text/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/Text/icon.svg +7 -0
- package/components/Blokkli/Text/index.vue +21 -0
- package/components/Blokkli/TextMedia/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/TextMedia/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/TextMedia/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/TextMedia/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/TextMedia/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/TextMedia/icon.svg +5 -0
- package/components/Blokkli/TextMedia/index.vue +22 -0
- package/components/Blokkli/TwoColumnText/Element/icon.svg +8 -0
- package/components/Blokkli/TwoColumnText/Element/index.vue +15 -0
- package/components/Blokkli/TwoColumnText/Layout/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/TwoColumnText/Layout/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/TwoColumnText/Layout/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/TwoColumnText/Layout/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/TwoColumnText/Layout/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/TwoColumnText/Layout/icon.svg +10 -0
- package/components/Blokkli/TwoColumnText/Layout/index.vue +18 -0
- package/components/Blokkli/iFrame/Element/icon.svg +5 -0
- package/components/Blokkli/iFrame/Element/index.vue +14 -0
- package/components/Blokkli/iFrame/Layout/icon-blokkli-option-large-spacing-bottom.svg +1 -0
- package/components/Blokkli/iFrame/Layout/icon-blokkli-option-large-spacing-top.svg +1 -0
- package/components/Blokkli/iFrame/Layout/icon-blokkli-option-no-spacing.svg +1 -0
- package/components/Blokkli/iFrame/Layout/icon-blokkli-option-small-spacing-bottom.svg +1 -0
- package/components/Blokkli/iFrame/Layout/icon-blokkli-option-small-spacing-top.svg +1 -0
- package/components/Blokkli/iFrame/Layout/icon.svg +7 -0
- package/components/Blokkli/iFrame/Layout/index.vue +18 -0
- package/components/DesignSystem/Atoms/Button.vue +144 -0
- package/components/DesignSystem/Atoms/Container.vue +54 -0
- package/components/DesignSystem/Atoms/GridRow.vue +13 -0
- package/components/DesignSystem/Molecules/ButtonGroup.vue +45 -0
- package/components/DesignSystem/Molecules/Card.vue +70 -0
- package/components/DesignSystem/Molecules/IconText.vue +62 -0
- package/components/DesignSystem/Molecules/MediaSlider.vue +72 -0
- package/components/DesignSystem/Molecules/Partnership.vue +40 -0
- package/components/DesignSystem/Molecules/Table.vue +170 -0
- package/components/DesignSystem/Molecules/TitleComposition.vue +66 -0
- package/components/DesignSystem/Molecules/iFrame.vue +22 -0
- package/components/DesignSystem/Organisms/ContentBlock.vue +82 -0
- package/components/DesignSystem/Organisms/FlipTeaser.vue +160 -0
- package/components/DesignSystem/Organisms/LogoElement.vue +37 -0
- package/components/DesignSystem/Organisms/TeamElement.vue +89 -0
- package/components/DesignSystem/Organisms/TeaserCard.vue +74 -0
- package/components/DesignSystem/Organisms/Testimonial.vue +53 -0
- package/components/DesignSystem/Organisms/TwoColumnTextElement.vue +42 -0
- package/components/Drupal/Breadcrumb/fragment.breadcrumb.graphql +6 -0
- package/components/Drupal/Breadcrumb/index.vue +88 -0
- package/components/Drupal/Messages/index.vue +29 -0
- package/components/Drupal/Webform/fragment.graphql +86 -0
- package/components/Drupal/Webform/index.vue +174 -0
- package/components/Drupal/Webform/mutation.graphql +8 -0
- package/components/Drupal/Webform/query.graphql +21 -0
- package/components/Form/CheckboxInput.vue +35 -0
- package/components/Form/CheckboxInputs.vue +44 -0
- package/components/Form/FileUploadInput.vue +34 -0
- package/components/Form/RadioButtonsInput.vue +44 -0
- package/components/Form/SelectInput.vue +54 -0
- package/components/Form/SubmitButton.vue +12 -0
- package/components/Form/TextAreaInput.vue +34 -0
- package/components/Form/TextEmailInput.vue +35 -0
- package/components/Form/TextInput.vue +35 -0
- package/components/Form/TextPhoneInput.vue +35 -0
- package/components/Form/WebformMarkup.vue +9 -0
- package/components/Form/composables/useFormElement.ts +84 -0
- package/components/Form/utils/types.ts +64 -0
- package/components/Media/Icon/fragment.mediaIcon.graphql +9 -0
- package/components/Media/Icon/index.vue +16 -0
- package/components/Media/Image/fragment.graphql +11 -0
- package/components/Media/Image/index.vue +215 -0
- package/components/Media/RemoteVideo/fragment.graphql +27 -0
- package/components/Media/RemoteVideo/index.vue +58 -0
- package/components/Media/Video/fragment.graphql +17 -0
- package/components/Media/Video/index.vue +44 -0
- package/components/Media/fragment.graphql +8 -0
- package/components/Media/index.vue +33 -0
- package/components/Node/Icms/Page/fragment.graphql +17 -0
- package/components/Node/Icms/Page/index.vue +14 -0
- package/components/Paragraph/Button/Element/fragment.graphql +14 -0
- package/components/Paragraph/Button/Element/index.vue +23 -0
- package/components/Paragraph/CallToAction/fragment.graphql +12 -0
- package/components/Paragraph/CallToAction/index.vue +60 -0
- package/components/Paragraph/Card/Element/fragment.graphql +10 -0
- package/components/Paragraph/Card/Element/index.vue +19 -0
- package/components/Paragraph/Card/Layout/fragment.graphql +14 -0
- package/components/Paragraph/Card/Layout/index.vue +58 -0
- package/components/Paragraph/Contact/fragment.graphql +20 -0
- package/components/Paragraph/Contact/index.vue +60 -0
- package/components/Paragraph/Downloads/fragment.graphql +15 -0
- package/components/Paragraph/Downloads/index.vue +104 -0
- package/components/Paragraph/FAQ/Element/fragment.graphql +10 -0
- package/components/Paragraph/FAQ/Element/index.vue +66 -0
- package/components/Paragraph/FAQ/Layout/fragment.graphql +23 -0
- package/components/Paragraph/FAQ/Layout/index.vue +84 -0
- package/components/Paragraph/FlipTeasers/fragment.graphql +25 -0
- package/components/Paragraph/FlipTeasers/index.vue +59 -0
- package/components/Paragraph/Gallery/fragment.graphql +11 -0
- package/components/Paragraph/Gallery/index.vue +223 -0
- package/components/Paragraph/HeroImage/fragment.graphql +17 -0
- package/components/Paragraph/HeroImage/index.vue +147 -0
- package/components/Paragraph/IconText/Element/fragment.graphql +8 -0
- package/components/Paragraph/IconText/Element/index.vue +18 -0
- package/components/Paragraph/IconText/Layout/fragment.graphql +23 -0
- package/components/Paragraph/IconText/Layout/index.vue +76 -0
- package/components/Paragraph/Introduction/fragment.graphql +20 -0
- package/components/Paragraph/Introduction/index.vue +94 -0
- package/components/Paragraph/Logo/Element/fragment.graphql +11 -0
- package/components/Paragraph/Logo/Element/index.vue +17 -0
- package/components/Paragraph/Media/fragment.graphql +5 -0
- package/components/Paragraph/Media/index.vue +83 -0
- package/components/Paragraph/Partnerships/Element/fragment.graphql +11 -0
- package/components/Paragraph/Partnerships/Element/index.vue +14 -0
- package/components/Paragraph/Partnerships/Layout/fragment.graphql +17 -0
- package/components/Paragraph/Partnerships/Layout/index.vue +119 -0
- package/components/Paragraph/SingleTestimonial/fragment.graphql +24 -0
- package/components/Paragraph/SingleTestimonial/index.vue +79 -0
- package/components/Paragraph/Table/fragment.graphql +11 -0
- package/components/Paragraph/Table/index.vue +43 -0
- package/components/Paragraph/Tabs/Element/fragment.graphql +17 -0
- package/components/Paragraph/Tabs/Element/index.vue +78 -0
- package/components/Paragraph/Tabs/Layout/fragment.graphql +11 -0
- package/components/Paragraph/Tabs/Layout/index.vue +191 -0
- package/components/Paragraph/Team/Element/fragment.graphql +17 -0
- package/components/Paragraph/Team/Element/index.vue +23 -0
- package/components/Paragraph/Team/Layout/fragment.graphql +14 -0
- package/components/Paragraph/Team/Layout/index.vue +51 -0
- package/components/Paragraph/Teasers/fragment.graphql +25 -0
- package/components/Paragraph/Teasers/index.vue +58 -0
- package/components/Paragraph/Testimonial/Element/fragment.graphql +13 -0
- package/components/Paragraph/Testimonial/Element/index.vue +29 -0
- package/components/Paragraph/Testimonial/Layout/fragment.graphql +13 -0
- package/components/Paragraph/Testimonial/Layout/index.vue +109 -0
- package/components/Paragraph/Text/fragment.graphql +14 -0
- package/components/Paragraph/Text/index.vue +66 -0
- package/components/Paragraph/TextMedia/fragment.graphql +17 -0
- package/components/Paragraph/TextMedia/index.vue +125 -0
- package/components/Paragraph/TwoColumnText/Element/fragment.graphql +8 -0
- package/components/Paragraph/TwoColumnText/Element/index.vue +31 -0
- package/components/Paragraph/TwoColumnText/Layout/fragment.graphql +8 -0
- package/components/Paragraph/TwoColumnText/Layout/index.vue +25 -0
- package/components/Paragraph/fragment.paragraphsFieldItem.graphql +6 -0
- package/components/Paragraph/iFrame/Element/fragment.graphql +9 -0
- package/components/Paragraph/iFrame/Element/index.vue +16 -0
- package/components/Paragraph/iFrame/Layout/fragment.graphql +13 -0
- package/components/Paragraph/iFrame/Layout/index.vue +161 -0
- package/components/Section/Footer/index.vue +144 -0
- package/components/Section/Header/GlobalMenu.vue +337 -0
- package/components/Section/Header/LanguageDropdown.vue +105 -0
- package/components/Section/Header/MenuIcon.vue +171 -0
- package/components/Section/Header/MetaMenu.vue +57 -0
- package/components/Section/Header/SearchLink.vue +26 -0
- package/components/Section/Header/index.vue +205 -0
- package/components/ui/accordion/Accordion.vue +19 -0
- package/components/ui/accordion/AccordionContent.vue +26 -0
- package/components/ui/accordion/AccordionItem.vue +27 -0
- package/components/ui/accordion/AccordionTrigger.vue +41 -0
- package/components/ui/accordion/index.ts +4 -0
- package/components/ui/button/Button.vue +26 -0
- package/components/ui/button/index.ts +36 -0
- package/components/ui/carousel/Carousel.vue +72 -0
- package/components/ui/carousel/CarouselContent.vue +30 -0
- package/components/ui/carousel/CarouselItem.vue +25 -0
- package/components/ui/carousel/CarouselNext.vue +33 -0
- package/components/ui/carousel/CarouselPrevious.vue +33 -0
- package/components/ui/carousel/index.ts +8 -0
- package/components/ui/carousel/interface.ts +24 -0
- package/components/ui/carousel/useCarousel.ts +66 -0
- package/components/ui/checkbox/Checkbox.vue +34 -0
- package/components/ui/checkbox/index.ts +1 -0
- package/components/ui/dialog/Dialog.vue +19 -0
- package/components/ui/dialog/DialogClose.vue +11 -0
- package/components/ui/dialog/DialogContent.vue +53 -0
- package/components/ui/dialog/DialogDescription.vue +30 -0
- package/components/ui/dialog/DialogFooter.vue +19 -0
- package/components/ui/dialog/DialogHeader.vue +16 -0
- package/components/ui/dialog/DialogScrollContent.vue +66 -0
- package/components/ui/dialog/DialogTitle.vue +28 -0
- package/components/ui/dialog/DialogTrigger.vue +11 -0
- package/components/ui/dialog/index.ts +9 -0
- package/components/ui/input/Input.vue +24 -0
- package/components/ui/input/index.ts +1 -0
- package/components/ui/label/Label.vue +29 -0
- package/components/ui/label/index.ts +1 -0
- package/components/ui/radio-group/RadioGroup.vue +27 -0
- package/components/ui/radio-group/RadioGroupItem.vue +41 -0
- package/components/ui/radio-group/index.ts +2 -0
- package/components/ui/select/Select.vue +15 -0
- package/components/ui/select/SelectContent.vue +54 -0
- package/components/ui/select/SelectGroup.vue +21 -0
- package/components/ui/select/SelectItem.vue +46 -0
- package/components/ui/select/SelectItemText.vue +12 -0
- package/components/ui/select/SelectLabel.vue +14 -0
- package/components/ui/select/SelectScrollDownButton.vue +26 -0
- package/components/ui/select/SelectScrollUpButton.vue +26 -0
- package/components/ui/select/SelectSeparator.vue +19 -0
- package/components/ui/select/SelectTrigger.vue +33 -0
- package/components/ui/select/SelectValue.vue +12 -0
- package/components/ui/select/index.ts +11 -0
- package/components/ui/tabs/Tabs.vue +15 -0
- package/components/ui/tabs/TabsContent.vue +29 -0
- package/components/ui/tabs/TabsList.vue +27 -0
- package/components/ui/tabs/TabsTrigger.vue +33 -0
- package/components/ui/tabs/index.ts +4 -0
- package/components/ui/textarea/Textarea.vue +24 -0
- package/components/ui/textarea/index.ts +1 -0
- package/components.json +18 -0
- package/composables/breadcrumb.ts +42 -0
- package/composables/languageLinks.ts +31 -0
- package/composables/query.initData.graphql +102 -0
- package/composables/useAccordionScroll.ts +30 -0
- package/composables/useChildTitleWeight.ts +13 -0
- package/composables/useCn.ts +7 -0
- package/composables/useCurrentLangcodeEnum.ts +18 -0
- package/composables/useDrupalMessages.ts +41 -0
- package/composables/useDrupalUser.ts +11 -0
- package/composables/useInitData.ts +118 -0
- package/composables/useIsMobile.ts +14 -0
- package/composables/useMainMenuLinks.ts +69 -0
- package/composables/useMetaMenuLinks.ts +44 -0
- package/composables/useNavigationOffset.ts +14 -0
- package/config/graphqlMiddleware/index.ts +41 -0
- package/config/multiCache/index.ts +28 -0
- package/config/postcss-drupal/postcss.config.cjs +14 -0
- package/config/runtimeConfig.ts +12 -0
- package/error.vue +39 -0
- package/eslint.config.mjs +111 -0
- package/formkit.config.ts +56 -0
- package/formkit.theme.ts +5000 -0
- package/layouts/default.vue +66 -0
- package/layouts/error.vue +98 -0
- package/layouts/library.vue +5 -0
- package/modules/dynamicNodeResolver.ts +95 -0
- package/modules/dynamicParagraphResolver.ts +69 -0
- package/nuxt.config.ts +551 -0
- package/package.json +64 -0
- package/pages/[...slug]/index.vue +27 -0
- package/pages/__tests__/index.ts +77 -0
- package/pages/blokkli/library-item/[uuid].vue +52 -0
- package/pages/blokkli/library-item/query.library.graphql +21 -0
- package/pages/index.vue +27 -0
- package/pages/node/[nid]/index.vue +25 -0
- package/pages/search/index.vue +69 -0
- package/pages/static-page/example.vue +40 -0
- package/plugins/clickaway.ts +12 -0
- package/plugins/drupalUser.ts +33 -0
- package/plugins/graphqlMiddleware.ts +115 -0
- package/queries/blokkli.graphql +5 -0
- package/queries/fragment.blokkliProps.graphql +8 -0
- package/queries/fragment.routeQuery.graphql +51 -0
- package/queries/query.drupalUser.graphql +10 -0
- package/server/api/content-search/index.ts +160 -0
- package/server/api/icon/[...params].ts +199 -0
- package/server/graphqlMiddleware.serverOptions.ts +87 -0
- package/server/helpers/index.ts +32 -0
- package/server/helpers/request.ts +44 -0
- package/server/middleware/spa.ts +45 -0
- package/server/multiCache.serverOptions.ts +32 -0
- package/server/tsconfig.json +3 -0
- package/server/utils/cacheability.ts +138 -0
- package/shims-vue.d.ts +5 -0
- package/tailwind.config.ts +228 -0
- package/vitest.config.mts +28 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import path from 'path'
|
|
2
|
+
import { promises as fsp } from 'fs'
|
|
3
|
+
import { describe, it, expect } from 'vitest'
|
|
4
|
+
import { glob } from 'glob'
|
|
5
|
+
import * as ts from 'typescript'
|
|
6
|
+
import { parse as parseSfc } from '@vue/compiler-sfc'
|
|
7
|
+
|
|
8
|
+
// Parse a Vue SFC and check if the component's script calls the given function at least once.
|
|
9
|
+
function functionIsCalledAtLeastOnce(
|
|
10
|
+
vueFileContents: string,
|
|
11
|
+
functionName: string,
|
|
12
|
+
): boolean {
|
|
13
|
+
const result = parseSfc(vueFileContents)
|
|
14
|
+
const script = result.descriptor.scriptSetup?.content
|
|
15
|
+
if (!script) {
|
|
16
|
+
return false
|
|
17
|
+
}
|
|
18
|
+
const sourceFile = ts.createSourceFile(
|
|
19
|
+
'temp.ts',
|
|
20
|
+
script,
|
|
21
|
+
ts.ScriptTarget.ES2015,
|
|
22
|
+
true,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
let isCalled = false
|
|
26
|
+
|
|
27
|
+
function visit(node: ts.Node) {
|
|
28
|
+
if (
|
|
29
|
+
ts.isCallExpression(node) &&
|
|
30
|
+
node.expression.getText(sourceFile) === functionName
|
|
31
|
+
) {
|
|
32
|
+
isCalled = true
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (!isCalled) {
|
|
36
|
+
ts.forEachChild(node, visit)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ts.forEachChild(sourceFile, visit)
|
|
41
|
+
|
|
42
|
+
return isCalled
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
describe('The Nuxt page component', async () => {
|
|
46
|
+
const pageComponentFiles = await glob(
|
|
47
|
+
path.resolve(__dirname, './../**/*.vue'),
|
|
48
|
+
{},
|
|
49
|
+
).then((pageFilePaths) => {
|
|
50
|
+
console.log(pageFilePaths)
|
|
51
|
+
return Promise.all(
|
|
52
|
+
pageFilePaths.map((filePath) => {
|
|
53
|
+
return fsp.readFile(filePath, { encoding: 'utf8' }).then((content) => {
|
|
54
|
+
return {
|
|
55
|
+
filePath,
|
|
56
|
+
content,
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
}),
|
|
60
|
+
)
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
pageComponentFiles.forEach(({ filePath, content }) => {
|
|
64
|
+
it(`"${filePath}" should call useDrupalRouteQuery()`, () => {
|
|
65
|
+
expect(functionIsCalledAtLeastOnce(content, 'useDrupalRoute')).toEqual(
|
|
66
|
+
true,
|
|
67
|
+
)
|
|
68
|
+
})
|
|
69
|
+
it(`"${filePath}" should call setBreadcrumbLinksFromRoute()`, () => {
|
|
70
|
+
expect(
|
|
71
|
+
functionIsCalledAtLeastOnce(content, 'setBreadcrumbLinksFromRoute') ||
|
|
72
|
+
functionIsCalledAtLeastOnce(content, 'setBreadcrumbLinks') ||
|
|
73
|
+
functionIsCalledAtLeastOnce(content, 'useDrupalRoute'),
|
|
74
|
+
).toEqual(true)
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
})
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BlokkliProvider
|
|
3
|
+
v-if="data?.blokkliProps"
|
|
4
|
+
v-slot="{ entity }"
|
|
5
|
+
v-bind="data.blokkliProps"
|
|
6
|
+
:entity="data"
|
|
7
|
+
>
|
|
8
|
+
<div class="container">
|
|
9
|
+
<p>Administrative title</p>
|
|
10
|
+
<h1 v-blokkli-editable:label>
|
|
11
|
+
{{ entity.libraryItemLabel || data.libraryItemLabel }}
|
|
12
|
+
</h1>
|
|
13
|
+
</div>
|
|
14
|
+
<BlokkliField name="paragraphs" :list="data.paragraphs" />
|
|
15
|
+
</BlokkliProvider>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
definePageMeta({
|
|
20
|
+
layout: 'library',
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const route = useRoute()
|
|
24
|
+
|
|
25
|
+
const uuid = computed<string>(() => {
|
|
26
|
+
if (route.params.uuid && typeof route.params.uuid === 'string') {
|
|
27
|
+
return route.params.uuid
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return ''
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const { data } = await useAsyncGraphqlQuery(
|
|
34
|
+
'paragraphsLibraryItem',
|
|
35
|
+
{
|
|
36
|
+
id: uuid.value,
|
|
37
|
+
uuid: uuid.value,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
transform: function (data) {
|
|
41
|
+
if (data.data.byUuid && 'blokkliProps' in data.data.byUuid) {
|
|
42
|
+
return data.data.byUuid
|
|
43
|
+
} else if (data.data.byId && 'blokkliProps' in data.data.byId) {
|
|
44
|
+
return data.data.byId
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return null
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
)
|
|
51
|
+
await renderPageDependencies()
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
query paragraphsLibraryItem($uuid: String!, $id: ID!) {
|
|
2
|
+
byUuid: entityByUuid(uuid: $uuid, entityType: PARAGRAPHS_LIBRARY_ITEM) {
|
|
3
|
+
...paragraphsLibraryItemCanonical
|
|
4
|
+
}
|
|
5
|
+
byId: entityById(id: $id, entityType: PARAGRAPHS_LIBRARY_ITEM) {
|
|
6
|
+
...paragraphsLibraryItemCanonical
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
fragment paragraphsLibraryItemCanonical on ParagraphsLibraryItem {
|
|
11
|
+
libraryItemLabel: label
|
|
12
|
+
blokkliProps {
|
|
13
|
+
...blokkliProps
|
|
14
|
+
}
|
|
15
|
+
paragraphs {
|
|
16
|
+
...paragraphsFieldItem
|
|
17
|
+
props {
|
|
18
|
+
...paragraph
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
package/pages/index.vue
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="pageComponent" v-bind="node"/>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
|
|
7
|
+
const { $resolveDynamicNodeComponent } = useNuxtApp()
|
|
8
|
+
|
|
9
|
+
defineOptions({
|
|
10
|
+
name: 'Homepage',
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
definePageMeta({
|
|
14
|
+
name: 'home',
|
|
15
|
+
hideBreadcrumb: true,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const { entity: node } = await useDrupalRouteQuery('slug')
|
|
19
|
+
|
|
20
|
+
const contentType = computed(() => node.value?.__typename)
|
|
21
|
+
|
|
22
|
+
const pageComponent = computed(() => {
|
|
23
|
+
return $resolveDynamicNodeComponent(contentType.value)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
await renderPageDependencies()
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="pageComponent" v-bind="node"/>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
|
|
7
|
+
const { $resolveDynamicNodeComponent } = useNuxtApp()
|
|
8
|
+
|
|
9
|
+
defineOptions({
|
|
10
|
+
name: 'PageNodeCanonical',
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
definePageMeta({
|
|
14
|
+
name: 'node-canonical',
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const { entity: node } = await useDrupalRouteQuery('nodeCanonical')
|
|
18
|
+
const contentType = computed(() => node.value?.__typename)
|
|
19
|
+
|
|
20
|
+
const pageComponent = computed(() => {
|
|
21
|
+
return $resolveDynamicNodeComponent(contentType.value)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
await renderPageDependencies()
|
|
25
|
+
</script>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<main :class="{ 'cursor-wait': pending }">
|
|
3
|
+
<section class="flex">
|
|
4
|
+
<div class="container">
|
|
5
|
+
<h1 v-if="node" class="pb-3 text-4xl lg:pb-6 lg:text-7xl">
|
|
6
|
+
{{ node.title }}
|
|
7
|
+
</h1>
|
|
8
|
+
<form @submit.prevent>
|
|
9
|
+
<SearchInput v-model="searchTerm" />
|
|
10
|
+
</form>
|
|
11
|
+
</div>
|
|
12
|
+
</section>
|
|
13
|
+
<template v-if="data && searchTerm">
|
|
14
|
+
<Container>
|
|
15
|
+
<ol class="mt-10">
|
|
16
|
+
<SearchResult v-for="hit in data" v-bind="hit" :key="hit.id" />
|
|
17
|
+
</ol>
|
|
18
|
+
</Container>
|
|
19
|
+
</template>
|
|
20
|
+
</main>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts" setup>
|
|
24
|
+
import type { NodeIcmsPageFragment } from '#graphql-operations'
|
|
25
|
+
|
|
26
|
+
definePageMeta({
|
|
27
|
+
name: 'search',
|
|
28
|
+
drupalFrontendRoute: true,
|
|
29
|
+
path: '/suche',
|
|
30
|
+
languageMapping: {
|
|
31
|
+
fr: '/chercher',
|
|
32
|
+
en: '/search',
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const nuxtRoute = useRoute()
|
|
37
|
+
const searchTerm = useQueryString('text')
|
|
38
|
+
const language = useCurrentLanguage()
|
|
39
|
+
|
|
40
|
+
const searchQuery = computed(() => {
|
|
41
|
+
return {
|
|
42
|
+
langcode: language.value,
|
|
43
|
+
size: 16,
|
|
44
|
+
text: searchTerm.value || undefined,
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const { data, pending } = await useFetch('/api/content-search', {
|
|
49
|
+
query: searchQuery,
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
// Get the data.
|
|
53
|
+
const { data: query } = await useAsyncData(nuxtRoute.path, () => {
|
|
54
|
+
return useGraphqlQuery('route', {
|
|
55
|
+
path: nuxtRoute.path,
|
|
56
|
+
}).then((v) => v.data)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
// Handles redirects and metatags.
|
|
60
|
+
const { entity: node } = await useDrupalRoute<NodeIcmsPageFragment>(
|
|
61
|
+
query.value,
|
|
62
|
+
{
|
|
63
|
+
noError: true,
|
|
64
|
+
},
|
|
65
|
+
)
|
|
66
|
+
setBreadcrumbLinksFromRoute(query.value)
|
|
67
|
+
setLanguageLinksFromRoute(query.value)
|
|
68
|
+
await renderPageDependencies()
|
|
69
|
+
</script>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container">
|
|
3
|
+
<h1 class="mb-10 text-4xl">Static Page example</h1>
|
|
4
|
+
<h2>{{ node.title }}</h2>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts" setup>
|
|
9
|
+
import type { NodePageFragment } from '#graphql-operations'
|
|
10
|
+
|
|
11
|
+
defineOptions({
|
|
12
|
+
name: 'StaticPageExample',
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
definePageMeta({
|
|
16
|
+
name: 'static-page-example',
|
|
17
|
+
drupalFrontendRoute: true,
|
|
18
|
+
path: '/statisch',
|
|
19
|
+
languageMapping: {
|
|
20
|
+
fr: '/statique',
|
|
21
|
+
en: '/static',
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const nuxtRoute = useRoute()
|
|
26
|
+
|
|
27
|
+
// Get the data.
|
|
28
|
+
const { data: query } = await useAsyncData('staticPageExample', async () => {
|
|
29
|
+
return await useGraphqlQuery('route', {
|
|
30
|
+
path: nuxtRoute.path,
|
|
31
|
+
}).then((v) => v.data)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
// Handles redirects and metatags.
|
|
35
|
+
const { entity: node } = await useDrupalRoute<NodePageFragment>(query.value)
|
|
36
|
+
|
|
37
|
+
setBreadcrumbLinks()
|
|
38
|
+
setLanguageLinksFromRoute(query.value)
|
|
39
|
+
await renderPageDependencies()
|
|
40
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { directive } from 'vue3-click-away'
|
|
2
|
+
import { defineNuxtPlugin } from '#app'
|
|
3
|
+
|
|
4
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
|
+
nuxtApp.vueApp.directive('click-away', {
|
|
6
|
+
...directive,
|
|
7
|
+
// Necessary for the directive to work at all.
|
|
8
|
+
getSSRProps() {
|
|
9
|
+
return {}
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from '#app'
|
|
2
|
+
import useDrupalUser from '~/composables/useDrupalUser'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Loads data about the current session.
|
|
6
|
+
*/
|
|
7
|
+
export default defineNuxtPlugin({
|
|
8
|
+
name: 'drupal-user',
|
|
9
|
+
async setup() {
|
|
10
|
+
const drupalUser = useDrupalUser()
|
|
11
|
+
|
|
12
|
+
// If the config has already been fetched, return.
|
|
13
|
+
// This is the case when we're client-side, because the config is already
|
|
14
|
+
// shipped via payload from the server.
|
|
15
|
+
if (drupalUser?.value.fetched) {
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const headers = useRequestHeaders()
|
|
20
|
+
const hasSessionCookie = (headers.cookie || '').includes('SSESS')
|
|
21
|
+
|
|
22
|
+
// Only query the backend for the user if we have a session cookie.
|
|
23
|
+
if (hasSessionCookie || import.meta.client) {
|
|
24
|
+
// Load the information about the Drupal user.
|
|
25
|
+
const { data } = await useGraphqlQuery('drupalUser')
|
|
26
|
+
if (data && data.currentDrupalUser) {
|
|
27
|
+
drupalUser.value.accessToolbar = data.currentDrupalUser.canAccessToolbar
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
drupalUser.value.fetched = true
|
|
32
|
+
},
|
|
33
|
+
})
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from 'nuxt/app'
|
|
2
|
+
import type { DrupalMessage } from '~/composables/useDrupalMessages'
|
|
3
|
+
import { useCDNHeaders } from '#nuxt-multi-cache/composables'
|
|
4
|
+
import type { GraphqlResponseTyped } from '#graphql-middleware-server-options-build'
|
|
5
|
+
|
|
6
|
+
type GraphqlMessengerMessage = {
|
|
7
|
+
type: string
|
|
8
|
+
message: string
|
|
9
|
+
escaped: string
|
|
10
|
+
safe: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Try to extract the messages from a GraphQL query or mutation.
|
|
15
|
+
*/
|
|
16
|
+
function extractMessages(data: GraphqlResponseTyped): DrupalMessage[] {
|
|
17
|
+
if (data.data && 'messengerMessages' in data.data) {
|
|
18
|
+
return data.data.messengerMessages.map((v: GraphqlMessengerMessage) => {
|
|
19
|
+
return {
|
|
20
|
+
type: v.type,
|
|
21
|
+
message: v.safe,
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return []
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This is only called when performing a query or mutation from within the nuxt
|
|
31
|
+
* app (e.g. not via custom server routes).
|
|
32
|
+
*/
|
|
33
|
+
export default defineNuxtPlugin(() => {
|
|
34
|
+
const state = useGraphqlState()
|
|
35
|
+
const { messages } = useDrupalMessages()
|
|
36
|
+
const language = useCurrentLanguage()
|
|
37
|
+
const config = useRuntimeConfig()
|
|
38
|
+
|
|
39
|
+
if (!state) {
|
|
40
|
+
return
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
state.fetchOptions = {
|
|
44
|
+
/**
|
|
45
|
+
* Interceptor called whenever a GraphQL response arrives.
|
|
46
|
+
*/
|
|
47
|
+
onResponse(result) {
|
|
48
|
+
const data = result.response?._data
|
|
49
|
+
if (!data) {
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Extract drupal messages from every GraphQL response.
|
|
54
|
+
extractMessages(data).forEach((v) => {
|
|
55
|
+
const exists = messages.value.find((m) => m.message === v.message)
|
|
56
|
+
if (!exists) {
|
|
57
|
+
messages.value.push(v)
|
|
58
|
+
|
|
59
|
+
// When there are messages, we have to make the whole request uncacheable.
|
|
60
|
+
useCDNHeaders((v) => v.private())
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
if (import.meta.server) {
|
|
65
|
+
const event = useRequestEvent()
|
|
66
|
+
|
|
67
|
+
useCDNHeaders((helper) => {
|
|
68
|
+
if (!data.__cacheability?.isCacheable) {
|
|
69
|
+
helper.private()
|
|
70
|
+
return
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
helper
|
|
74
|
+
.public()
|
|
75
|
+
.setNumeric('sharedMaxAge', data.__cacheability.sharedMaxAge)
|
|
76
|
+
.addTags(data.__cacheability.tagsCdn)
|
|
77
|
+
}, event)
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
onRequest({ options, request }) {
|
|
82
|
+
// if (import.meta.server && import.meta.dev) {
|
|
83
|
+
// console.log('GraphQL Query: ' + request)
|
|
84
|
+
// }
|
|
85
|
+
try {
|
|
86
|
+
if (!options.params) {
|
|
87
|
+
options.params = {}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
// Add the build hash to every GraphQL request.
|
|
92
|
+
// We do this so that after a deployment, if the user is using the
|
|
93
|
+
// "new" version of the app, the request URL issued is now different
|
|
94
|
+
// than the previous one and thus will not be served from cache.
|
|
95
|
+
options.params.__h = config.public.buildHash
|
|
96
|
+
|
|
97
|
+
// Add the current language to the URL
|
|
98
|
+
options.params.__l = language.value
|
|
99
|
+
|
|
100
|
+
if (import.meta.server) {
|
|
101
|
+
options.params.__server = 'true'
|
|
102
|
+
}
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
const requestHeaders = useRequestHeaders()
|
|
106
|
+
Object.keys(requestHeaders).forEach((key) => {
|
|
107
|
+
options.headers?.append(key, requestHeaders[key])
|
|
108
|
+
})
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
110
|
+
} catch (e) {
|
|
111
|
+
// Do nothing.
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
}
|
|
115
|
+
})
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
fragment routeQuery on Query {
|
|
2
|
+
messengerMessages
|
|
3
|
+
# Data used for the useDrupalRoute composable.
|
|
4
|
+
...useDrupalRoute
|
|
5
|
+
|
|
6
|
+
# Data used for rendering entities.
|
|
7
|
+
route(path: $path) {
|
|
8
|
+
__typename
|
|
9
|
+
... on EntityUrl {
|
|
10
|
+
breadcrumb {
|
|
11
|
+
...breadcrumb
|
|
12
|
+
}
|
|
13
|
+
...entityUrl
|
|
14
|
+
}
|
|
15
|
+
... on InternalUrl {
|
|
16
|
+
languageSwitchLinks {
|
|
17
|
+
...languageSwitchLink
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
fragment entityUrl on EntityUrl {
|
|
24
|
+
languageSwitchLinks {
|
|
25
|
+
...languageSwitchLink
|
|
26
|
+
}
|
|
27
|
+
entity {
|
|
28
|
+
uuid
|
|
29
|
+
}
|
|
30
|
+
entityGlobal: entity {
|
|
31
|
+
...entityGlobal
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
fragment entityGlobal on Entity {
|
|
36
|
+
__typename
|
|
37
|
+
canEdit: accessCheck(operation: "edit-blokkli")
|
|
38
|
+
id
|
|
39
|
+
bundle: entityBundle
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
fragment languageSwitchLink on LanguageSwitchLink {
|
|
43
|
+
active
|
|
44
|
+
language {
|
|
45
|
+
id
|
|
46
|
+
}
|
|
47
|
+
title
|
|
48
|
+
url {
|
|
49
|
+
path
|
|
50
|
+
}
|
|
51
|
+
}
|