@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,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides the endpoint for the content search.
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
import type { QueryObject, QueryValue } from 'ufo'
|
|
6
|
+
import { getQuery } from 'h3'
|
|
7
|
+
import type { estypes } from '@elastic/elasticsearch'
|
|
8
|
+
import { Client } from '@elastic/elasticsearch'
|
|
9
|
+
import { nonNullable } from '#vuepal/helpers/type'
|
|
10
|
+
|
|
11
|
+
const runtimeConfig = useRuntimeConfig()
|
|
12
|
+
|
|
13
|
+
function getSingleQueryValue(
|
|
14
|
+
v: QueryValue | QueryValue[],
|
|
15
|
+
defaultValue: any = '',
|
|
16
|
+
): string {
|
|
17
|
+
if (Array.isArray(v)) {
|
|
18
|
+
return getSingleQueryValue(v[0], defaultValue)
|
|
19
|
+
}
|
|
20
|
+
if (typeof v === 'string') {
|
|
21
|
+
return v
|
|
22
|
+
} else if (typeof v === 'number') {
|
|
23
|
+
return v.toString()
|
|
24
|
+
}
|
|
25
|
+
return defaultValue
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const config = useRuntimeConfig()
|
|
29
|
+
|
|
30
|
+
export const client = new Client({
|
|
31
|
+
node: config.elasticsearchUrl,
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
type ContentSearchItem = {
|
|
35
|
+
id: string
|
|
36
|
+
title: string
|
|
37
|
+
text: string
|
|
38
|
+
langcode: string
|
|
39
|
+
url: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface SearchDocument {
|
|
43
|
+
nid?: string[]
|
|
44
|
+
field_teaser?: string[]
|
|
45
|
+
title?: string[]
|
|
46
|
+
langcode?: string[]
|
|
47
|
+
entity_url?: string[]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function simpleHighlight(rgx: RegExp, text = ''): string {
|
|
51
|
+
return text.replace(rgx, (match) => `<em>${match}</em>`)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type Highlight = {
|
|
55
|
+
title?: string[]
|
|
56
|
+
text?: string[]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function mapSearchItem(
|
|
60
|
+
rgx: RegExp,
|
|
61
|
+
doc: SearchDocument,
|
|
62
|
+
highlight?: Highlight,
|
|
63
|
+
): ContentSearchItem {
|
|
64
|
+
return {
|
|
65
|
+
id: doc.nid?.[0] || '',
|
|
66
|
+
title: doc.title?.[0] || '',
|
|
67
|
+
text:
|
|
68
|
+
highlight?.text?.[0] || simpleHighlight(rgx, doc.field_teaser?.[0]) || '',
|
|
69
|
+
langcode: doc.langcode?.[0] || '',
|
|
70
|
+
url: doc.entity_url?.[0] || '',
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The fulltext Elasticsearch search.
|
|
76
|
+
*/
|
|
77
|
+
export default defineEventHandler<Promise<ContentSearchItem[]>>(
|
|
78
|
+
async (event) => {
|
|
79
|
+
try {
|
|
80
|
+
const query: QueryObject = getQuery(event)
|
|
81
|
+
const text = getSingleQueryValue(query.text)
|
|
82
|
+
const index = runtimeConfig.elasticsearchPrefix + 'content_search'
|
|
83
|
+
|
|
84
|
+
const filter: estypes.QueryDslQueryContainer[] = []
|
|
85
|
+
|
|
86
|
+
const response = await client.search<SearchDocument>({
|
|
87
|
+
index,
|
|
88
|
+
size: 30,
|
|
89
|
+
query: {
|
|
90
|
+
bool: {
|
|
91
|
+
filter,
|
|
92
|
+
must: [
|
|
93
|
+
{
|
|
94
|
+
bool: {
|
|
95
|
+
should: [
|
|
96
|
+
{
|
|
97
|
+
multi_match: {
|
|
98
|
+
query: text,
|
|
99
|
+
fields: ['text', 'title'],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
wildcard: {
|
|
104
|
+
title: {
|
|
105
|
+
value: `*${text}*`,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
highlight: {
|
|
116
|
+
fields: {
|
|
117
|
+
title: {
|
|
118
|
+
force_source: true,
|
|
119
|
+
number_of_fragments: 0,
|
|
120
|
+
highlight_query: {
|
|
121
|
+
match_phrase: {
|
|
122
|
+
title: text,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
text: {
|
|
127
|
+
force_source: true,
|
|
128
|
+
number_of_fragments: 0,
|
|
129
|
+
highlight_query: {
|
|
130
|
+
match_phrase: {
|
|
131
|
+
text,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
})
|
|
138
|
+
const words = text
|
|
139
|
+
.split(' ')
|
|
140
|
+
.map((word) => word.trim())
|
|
141
|
+
.filter(Boolean)
|
|
142
|
+
const pattern = words
|
|
143
|
+
.map((word) => word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))
|
|
144
|
+
.join('|')
|
|
145
|
+
|
|
146
|
+
const rgx = new RegExp(pattern, 'gi')
|
|
147
|
+
return response.hits.hits
|
|
148
|
+
.map((v) =>
|
|
149
|
+
v._source ? mapSearchItem(rgx, v._source, v.highlight) : undefined,
|
|
150
|
+
)
|
|
151
|
+
.filter(nonNullable)
|
|
152
|
+
} catch (e) {
|
|
153
|
+
setResponseStatus(event, 400)
|
|
154
|
+
if (e && typeof e === 'object' && 'meta' in e) {
|
|
155
|
+
return (e as any).meta.body
|
|
156
|
+
}
|
|
157
|
+
console.log(e)
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
)
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { getRouterParams, defaultContentType, defineEventHandler } from 'h3'
|
|
2
|
+
import type { H3Event } from 'h3'
|
|
3
|
+
import { optimize } from 'svgo'
|
|
4
|
+
import { useCDNHeaders, useDataCache } from '#nuxt-multi-cache/composables'
|
|
5
|
+
import { MAX_AGE } from '@iqual/nuxt-icms/server/helpers'
|
|
6
|
+
|
|
7
|
+
const config = useRuntimeConfig()
|
|
8
|
+
|
|
9
|
+
export function replaceColors(markup = '') {
|
|
10
|
+
return markup
|
|
11
|
+
.replaceAll(
|
|
12
|
+
/(?<=<\b[^<>]*)\s*\bfill=(["'](?!none)).*?\1/g,
|
|
13
|
+
` fill="currentColor"`,
|
|
14
|
+
)
|
|
15
|
+
.replaceAll(
|
|
16
|
+
/(?<=<\b[^<>]*)\s*\bstroke=(["'](?!none)).*?\1/g,
|
|
17
|
+
` stroke="currentColor"`,
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type ParsedSymbol = {
|
|
22
|
+
attributes: Record<string, string>
|
|
23
|
+
content: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function extractSymbol(source = ''): ParsedSymbol {
|
|
27
|
+
const [, parsedAttributes, content] =
|
|
28
|
+
source.match(/<svg(.*?)>(.*?)<\/svg>/is) || []
|
|
29
|
+
const matches = (parsedAttributes || '').match(
|
|
30
|
+
/([\w-:]+)(=)?("[^<>"]*"|'[^<>']*'|[\w-:]+)/g,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
const attributes =
|
|
34
|
+
matches?.reduce<Record<string, string>>((acc, attribute) => {
|
|
35
|
+
const [name, unformattedValue] = attribute.split('=')
|
|
36
|
+
acc[name] = unformattedValue
|
|
37
|
+
? unformattedValue.replace(/['"]/g, '')
|
|
38
|
+
: 'true'
|
|
39
|
+
|
|
40
|
+
return acc
|
|
41
|
+
}, {}) || {}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
attributes,
|
|
45
|
+
content,
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Process the raw SVG markup to be a <symbol>.
|
|
51
|
+
*
|
|
52
|
+
* @TODO: Needs a more reliable solution.
|
|
53
|
+
*/
|
|
54
|
+
function processIcon(markup = '') {
|
|
55
|
+
const optimized = optimize(markup, {
|
|
56
|
+
plugins: [
|
|
57
|
+
{
|
|
58
|
+
name: 'inlineStyles',
|
|
59
|
+
params: {
|
|
60
|
+
onlyMatchedOnce: false,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
'convertStyleToAttrs',
|
|
64
|
+
'cleanupIds',
|
|
65
|
+
'cleanupAttrs',
|
|
66
|
+
'removeComments',
|
|
67
|
+
'removeTitle',
|
|
68
|
+
'removeDesc',
|
|
69
|
+
'removeMetadata',
|
|
70
|
+
'removeComments',
|
|
71
|
+
'removeUselessDefs',
|
|
72
|
+
'removeUselessStrokeAndFill',
|
|
73
|
+
'mergePaths',
|
|
74
|
+
'removeDimensions',
|
|
75
|
+
],
|
|
76
|
+
}).data
|
|
77
|
+
const { content, attributes } = extractSymbol(optimized)
|
|
78
|
+
const attributesString = Object.keys(attributes)
|
|
79
|
+
.filter((v) => v !== 'id' && v !== 'xmlns')
|
|
80
|
+
.map((v) => {
|
|
81
|
+
return `${v}="${attributes[v]}"`
|
|
82
|
+
})
|
|
83
|
+
.join(' ')
|
|
84
|
+
return replaceColors(
|
|
85
|
+
`<svg xmlns="http://www.w3.org/2000/svg"><symbol id="icon" ${attributesString}>` +
|
|
86
|
+
content +
|
|
87
|
+
'</symbol></svg>',
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
type BuiltIcon = {
|
|
92
|
+
markup: string
|
|
93
|
+
tagsCdn: string[]
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Given the media entity ID, load the entity via GraphQL, fetch the file and
|
|
98
|
+
* return the SVG's markup.
|
|
99
|
+
*
|
|
100
|
+
* The result of this is cached in the data cache using the ID as the key.
|
|
101
|
+
*/
|
|
102
|
+
async function getIcon(
|
|
103
|
+
id: string | undefined,
|
|
104
|
+
event: H3Event,
|
|
105
|
+
): Promise<BuiltIcon | undefined> {
|
|
106
|
+
if (!id || !config.backendUrl) {
|
|
107
|
+
return
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const { value, addToCache } = await useDataCache<BuiltIcon>(
|
|
111
|
+
'api-icon-' + id,
|
|
112
|
+
event,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
if (value) {
|
|
116
|
+
return value
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const requestHeaders = getHeaders(event)
|
|
120
|
+
const host = requestHeaders.host || ''
|
|
121
|
+
|
|
122
|
+
// Fetch the SVG markup.
|
|
123
|
+
const url = `${config.backendUrl}/de/media/${id}/icon`
|
|
124
|
+
const response = await $fetch.raw<Blob>(url, {
|
|
125
|
+
headers: {
|
|
126
|
+
host,
|
|
127
|
+
cookie: requestHeaders.cookie || '',
|
|
128
|
+
referer: requestHeaders.referer || '',
|
|
129
|
+
},
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
const cacheability = extractCacheability(response, event)
|
|
133
|
+
|
|
134
|
+
const svgMarkup = await response._data?.text()
|
|
135
|
+
|
|
136
|
+
if (!svgMarkup) {
|
|
137
|
+
return
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const markup = processIcon(svgMarkup)
|
|
141
|
+
|
|
142
|
+
const builtIcon: BuiltIcon = {
|
|
143
|
+
markup,
|
|
144
|
+
tagsCdn: cacheability.tagsCdn,
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Store it in the data cache.
|
|
148
|
+
await addToCache(builtIcon, cacheability.tagsNuxt)
|
|
149
|
+
|
|
150
|
+
return builtIcon
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const EMPTY_RESPONSE = '<svg></svg>'
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Returns an icon media entity as a SVG sprite with the media's SVG as the
|
|
157
|
+
* single <symbol>.
|
|
158
|
+
*/
|
|
159
|
+
export default defineEventHandler(async (event) => {
|
|
160
|
+
try {
|
|
161
|
+
const params = getRouterParams(event)?.params
|
|
162
|
+
|
|
163
|
+
if (typeof params !== 'string') {
|
|
164
|
+
return EMPTY_RESPONSE
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const id = params.split('--')[0]
|
|
168
|
+
|
|
169
|
+
defaultContentType(event, 'image/svg+xml')
|
|
170
|
+
|
|
171
|
+
const result = await getIcon(id, event)
|
|
172
|
+
if (!result) {
|
|
173
|
+
console.log('Failed to load icon from Drupal: ' + id)
|
|
174
|
+
return EMPTY_RESPONSE
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
useCDNHeaders((v) => {
|
|
178
|
+
v.public()
|
|
179
|
+
.setNumeric('sharedMaxAge', MAX_AGE.ONE_YEAR)
|
|
180
|
+
.addTags(result.tagsCdn)
|
|
181
|
+
.addTags(['nuxt:api:icon'])
|
|
182
|
+
.set('staleIfError', MAX_AGE.ONE_DAY)
|
|
183
|
+
}, event)
|
|
184
|
+
|
|
185
|
+
// Set content type.
|
|
186
|
+
defaultContentType(event, 'image/svg+xml')
|
|
187
|
+
|
|
188
|
+
// Requests from the frontend include the changed date of the media entity
|
|
189
|
+
// as a query param. This means we can set a very high max age for our
|
|
190
|
+
// response.
|
|
191
|
+
setHeader(event, 'cache-control', 'public, max-age=604800')
|
|
192
|
+
return result.markup
|
|
193
|
+
} catch (e) {
|
|
194
|
+
console.log(e)
|
|
195
|
+
console.log('Failed to load icon from Drupal.', e)
|
|
196
|
+
// We don't want to return a message here, only an empty response.
|
|
197
|
+
return EMPTY_RESPONSE
|
|
198
|
+
}
|
|
199
|
+
})
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware/server-options'
|
|
2
|
+
import { extractCacheability } from '~/packages/nuxt-icms/server/utils/cacheability'
|
|
3
|
+
import type { GraphqlCacheability } from '~/packages/nuxt-icms/server/helpers'
|
|
4
|
+
import { defaultLangcode, langcodes } from '#nuxt-language-negotiation/config'
|
|
5
|
+
import { buildProxyRequestHeaders } from '~/packages/nuxt-icms/server/helpers/request'
|
|
6
|
+
|
|
7
|
+
export default defineGraphqlServerOptions<{
|
|
8
|
+
extensions: {
|
|
9
|
+
cacheability: GraphqlCacheability | null
|
|
10
|
+
}
|
|
11
|
+
}>({
|
|
12
|
+
graphqlEndpoint(_event, _operation, _operationName, context) {
|
|
13
|
+
const config = useRuntimeConfig()
|
|
14
|
+
const clientContextLanguage = context?.client?.language
|
|
15
|
+
if (
|
|
16
|
+
clientContextLanguage &&
|
|
17
|
+
langcodes.includes(clientContextLanguage as any)
|
|
18
|
+
) {
|
|
19
|
+
return `${config.backendUrl}/${clientContextLanguage}/graphql`
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return `${config.backendUrl}/${defaultLangcode}/graphql`
|
|
23
|
+
},
|
|
24
|
+
serverFetchOptions(event) {
|
|
25
|
+
const config = useRuntimeConfig()
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
headers: {
|
|
29
|
+
...buildProxyRequestHeaders(event),
|
|
30
|
+
'x-drupal-graphql-token': config.drupalGraphqlToken,
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
onServerResponse(
|
|
35
|
+
event,
|
|
36
|
+
graphqlResponse,
|
|
37
|
+
_operation,
|
|
38
|
+
_operationName,
|
|
39
|
+
context,
|
|
40
|
+
) {
|
|
41
|
+
// Pass the set-cookie header from the GraphQL response to the client.
|
|
42
|
+
const setCookie = graphqlResponse.headers.getSetCookie()
|
|
43
|
+
|
|
44
|
+
for (const cookie of setCookie) {
|
|
45
|
+
appendResponseHeader(event, 'set-cookie', cookie)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const cacheability = extractCacheability(graphqlResponse, event)
|
|
49
|
+
|
|
50
|
+
const hasMessages = !!(
|
|
51
|
+
graphqlResponse._data?.data &&
|
|
52
|
+
'messengerMessages' in graphqlResponse._data.data &&
|
|
53
|
+
graphqlResponse._data.data.messengerMessages?.length
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
// Mark as uncacheable if the response contains Drupal messages.
|
|
57
|
+
if (hasMessages) {
|
|
58
|
+
cacheability.isCacheable = false
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const isServerRequest = context?.client?.env === 'server'
|
|
62
|
+
|
|
63
|
+
// This is only provided when the request originates from SSR.
|
|
64
|
+
// We pass information about the cacheability along the GraphQL response,
|
|
65
|
+
// so that the Nuxt app is able to use this to determine if the
|
|
66
|
+
// rendered page can be cached or not.
|
|
67
|
+
const addCacheability = isServerRequest || import.meta.dev
|
|
68
|
+
|
|
69
|
+
// Return the GraphQL response.
|
|
70
|
+
return {
|
|
71
|
+
data: graphqlResponse._data!.data,
|
|
72
|
+
errors: graphqlResponse._data!.errors,
|
|
73
|
+
extensions: {
|
|
74
|
+
cacheability: addCacheability ? cacheability : null,
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
onServerError(event, error) {
|
|
79
|
+
setResponseStatus(event, 500)
|
|
80
|
+
console.log('onServerError', error)
|
|
81
|
+
return {
|
|
82
|
+
data: null,
|
|
83
|
+
errors: [],
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type GraphqlCacheability = {
|
|
2
|
+
isCacheable: boolean
|
|
3
|
+
tagsNuxt: string[]
|
|
4
|
+
tagsCdn: string[]
|
|
5
|
+
tagsDrupal: string[]
|
|
6
|
+
maxAge: number
|
|
7
|
+
sharedMaxAge: number
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const MAX_AGE = {
|
|
11
|
+
UNCACHEABLE: 0,
|
|
12
|
+
TWO_HOURS: 7200,
|
|
13
|
+
SIX_HOURS: 21_600,
|
|
14
|
+
FIVE_MINUTES: 5 * 60,
|
|
15
|
+
ONE_HOUR: 60 * 60,
|
|
16
|
+
ONE_DAY: 86_400,
|
|
17
|
+
ONE_WEEK: 86_400 * 7,
|
|
18
|
+
ONE_YEAR: 86_400 * 365,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const INTERVALS = {
|
|
22
|
+
'5min': 5 * 60,
|
|
23
|
+
'10min': 10 * 60,
|
|
24
|
+
'15min': 15 * 60,
|
|
25
|
+
'30min': 30 * 60,
|
|
26
|
+
'1hour': 60 * 60,
|
|
27
|
+
'2hours': 60 * 60 * 2,
|
|
28
|
+
'6hours': 60 * 60 * 6,
|
|
29
|
+
'1week': 60 * 60 * 24 * 7,
|
|
30
|
+
} as const
|
|
31
|
+
|
|
32
|
+
export type ValidInterval = keyof typeof INTERVALS | 'midnight'
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type H3Event, getRequestHeaders } from 'h3'
|
|
2
|
+
|
|
3
|
+
const PROXY_HEADERS = new Set([
|
|
4
|
+
'x-forwarded-for',
|
|
5
|
+
'x-forwarded-host',
|
|
6
|
+
'x-forwarded-server',
|
|
7
|
+
'x-forwarded-proto',
|
|
8
|
+
'x-forwarded-port',
|
|
9
|
+
'x-client-ip',
|
|
10
|
+
'x-real-ip',
|
|
11
|
+
'x-client-ssl',
|
|
12
|
+
'referer',
|
|
13
|
+
'user-agent',
|
|
14
|
+
'user-agent-https',
|
|
15
|
+
'cookie',
|
|
16
|
+
'authorization',
|
|
17
|
+
])
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Build headers that can be used for proxying requests in fetch requests
|
|
21
|
+
* to API server routes or backend requests.
|
|
22
|
+
*
|
|
23
|
+
* @param event - The request event
|
|
24
|
+
*
|
|
25
|
+
* @returns The request headers appropriate for proxying.
|
|
26
|
+
*/
|
|
27
|
+
export function buildProxyRequestHeaders(
|
|
28
|
+
event: H3Event,
|
|
29
|
+
): Record<string, string> {
|
|
30
|
+
if (import.meta.client) {
|
|
31
|
+
return {}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const requestHeaders = getRequestHeaders(event)
|
|
35
|
+
const proxyHeaders: Record<string, string> = {}
|
|
36
|
+
for (const name in requestHeaders) {
|
|
37
|
+
if (PROXY_HEADERS.has(name) && requestHeaders[name]) {
|
|
38
|
+
proxyHeaders[name] = requestHeaders[name]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return proxyHeaders
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enable SPA mode for logged in users.
|
|
3
|
+
*
|
|
4
|
+
* In order to reduce load on the server we disable SSR for logged in users.
|
|
5
|
+
*/
|
|
6
|
+
export default defineEventHandler((event) => {
|
|
7
|
+
if (!event.path) {
|
|
8
|
+
return
|
|
9
|
+
}
|
|
10
|
+
// Skip API calls.
|
|
11
|
+
if (
|
|
12
|
+
!event.path ||
|
|
13
|
+
event.path.includes('/api') ||
|
|
14
|
+
event.path.includes('/__nuxt') ||
|
|
15
|
+
event.path.match(/\.(js|woff|woff2|ico|svg)$/gm)
|
|
16
|
+
) {
|
|
17
|
+
return
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Check if we have a cookie.
|
|
21
|
+
const headers = event.node.req.headers
|
|
22
|
+
const cookie = headers.cookie
|
|
23
|
+
if (!cookie) {
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Check if a Drupal session cookie is present. If yes, set the magic header
|
|
28
|
+
// to enable SPA mode.
|
|
29
|
+
const hasSession = cookie.includes('SSESS')
|
|
30
|
+
if (
|
|
31
|
+
event.path.includes('blokkliEditing') ||
|
|
32
|
+
event.path.includes('blokkliPreview') ||
|
|
33
|
+
hasSession
|
|
34
|
+
) {
|
|
35
|
+
if (!event.context.nuxt) {
|
|
36
|
+
event.context.nuxt = {}
|
|
37
|
+
}
|
|
38
|
+
event.context.nuxt.noSSR = true
|
|
39
|
+
event.context.hasSession = hasSession
|
|
40
|
+
return
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Remove the incoming header so that SPA mode can't be forced.
|
|
44
|
+
delete event.node.req.headers['x-nuxt-no-ssr']
|
|
45
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import { defineMultiCacheOptions } from 'nuxt-multi-cache/dist/runtime/serverOptions'
|
|
3
|
+
import { getHeaders, type H3Event } from 'h3'
|
|
4
|
+
import lruCacheDriver from 'unstorage/drivers/lru-cache'
|
|
5
|
+
|
|
6
|
+
const multiCacheServerOptions = defineMultiCacheOptions({
|
|
7
|
+
api: {},
|
|
8
|
+
data: {},
|
|
9
|
+
enabledForRequest: (event: H3Event) => {
|
|
10
|
+
const hasSession = (event.node.req.headers.cookie || '').includes('SSESS')
|
|
11
|
+
return Promise.resolve(!hasSession)
|
|
12
|
+
},
|
|
13
|
+
route: {
|
|
14
|
+
storage: {
|
|
15
|
+
driver: lruCacheDriver({
|
|
16
|
+
max: 10000,
|
|
17
|
+
}),
|
|
18
|
+
},
|
|
19
|
+
buildCacheKey: (event: H3Event) => {
|
|
20
|
+
const path = (event.path || '')
|
|
21
|
+
.replaceAll('/', '__')
|
|
22
|
+
.replaceAll('?', '__')
|
|
23
|
+
.replaceAll('&', '__')
|
|
24
|
+
|
|
25
|
+
const headers = getHeaders(event)
|
|
26
|
+
const cookie = headers.cookie || 'anonymous'
|
|
27
|
+
return path + cookie
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
export default multiCacheServerOptions
|