-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/media-viewer
- Loading branch information
Showing
24 changed files
with
859 additions
and
553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG NODE_VERSION=20.18.0 | ||
ARG NODE_VERSION=22.13.0 | ||
ARG NGINX_VERSION=1.27.2 | ||
ARG UID=1000 | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts" setup> | ||
const { locale } = useI18n() | ||
locale.value = 'en' | ||
</script> | ||
|
||
<template> | ||
<NuxtStory> | ||
<NuxtStoryVariant title="Single"> | ||
<VTime datetime="2023-06-28T22:00:00+02:00" /> | ||
</NuxtStoryVariant> | ||
<NuxtStoryVariant title="Single (with minutes)"> | ||
<VTime datetime="2023-06-28T22:15:00+02:00" /> | ||
</NuxtStoryVariant> | ||
<NuxtStoryVariant title="Range (multi times / same day)"> | ||
<VTime :datetime="['2023-06-28T19:30:00+02:00', '2023-06-28T22:30:00+02:00']" /> | ||
</NuxtStoryVariant> | ||
<NuxtStoryVariant title="Range (multi days / same month)"> | ||
<VTime :datetime="['2023-06-28T22:30:00+02:00', '2023-06-29T22:30:00+02:00']" /> | ||
</NuxtStoryVariant> | ||
<NuxtStoryVariant title="Range (multi days / multi months)"> | ||
<VTime :datetime="['2023-06-28T22:30:00+02:00', '2023-07-12T22:30:00+02:00']" /> | ||
</NuxtStoryVariant> | ||
<NuxtStoryVariant title="Range (multi years)"> | ||
<VTime :datetime="['2023-06-28T22:30:00+02:00', '2024-07-12T22:30:00+02:00']" /> | ||
</NuxtStoryVariant> | ||
</NuxtStory> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<NuxtStory> | ||
<NuxtStoryVariant title="Mailto"> | ||
<VRoadizLink | ||
label="Link" | ||
url="mailto:[email protected]" | ||
/> | ||
</NuxtStoryVariant> | ||
<NuxtStoryVariant title="Script"> | ||
<VRoadizLink | ||
label="Link" | ||
url="javascript:alert('Hello')" | ||
/> | ||
</NuxtStoryVariant> | ||
<NuxtStoryVariant title="Phone"> | ||
<VRoadizLink | ||
label="Link" | ||
url="tel:+33123456789" | ||
/> | ||
</NuxtStoryVariant> | ||
</NuxtStory> | ||
</template> | ||
|
||
<script setup> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!-- <script setup lang="ts"></script> --> | ||
|
||
<template> | ||
<footer id="footer" /> | ||
</template> | ||
|
||
<!-- <style lang="scss" module></style> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<NuxtStory | ||
layout="fullscreen" | ||
:class="$style.root" | ||
> | ||
<VTopBar /> | ||
</NuxtStory> | ||
</template> | ||
|
||
<style lang="scss" module> | ||
.root { | ||
height: 600vh; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<script lang="ts" setup> | ||
import { VRoadizLink } from '#components' | ||
const { isHomePage, homePagePath } = await useHomePage() | ||
// Scroll behavior | ||
const { isHidden, isOnPageTop } = useTopBarScroll() | ||
// Style | ||
const $style = useCssModule() | ||
const rootClasses = computed(() => { | ||
return [ | ||
$style.root, | ||
isHomePage.value && $style['root--home'], | ||
isOnPageTop.value && $style['root--page-top'], | ||
isHidden.value && $style['root--hidden'], | ||
] | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div | ||
:class="rootClasses" | ||
> | ||
<component | ||
:is="isHomePage ? 'div' : VRoadizLink" | ||
:aria-label="isHomePage ? undefined : $t('back_home')" | ||
:class="$style['logo-wrapper']" | ||
:url="isHomePage ? undefined : homePagePath" | ||
> | ||
Logo | ||
</component> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" module> | ||
@use 'assets/scss/functions/rem' as *; | ||
@use 'assets/scss/functions/ease' as *; | ||
.root { | ||
position: sticky; | ||
z-index: 10; | ||
top: 0; | ||
height: rem(120); | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding-inline: rem(32); | ||
transition: | ||
background-color 0.4s ease(out-quad), | ||
translate 0.4s ease(out-quad); | ||
&--hidden { | ||
translate: 0 -100%; | ||
} | ||
&:not(.root--page-top) { | ||
background-color: #ccc; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { localeCodes, nuxtI18nOptions } from '#build/i18n.options.mjs' | ||
|
||
// Workaround for useCookieLocale() returning empty string | ||
// @see https://github.com/nuxt-modules/i18n/issues/2975 | ||
export function useI18nCookie(): Ref<string> { | ||
const locale: Ref<string> = ref('') | ||
const detect = nuxtI18nOptions.detectBrowserLanguage | ||
|
||
if (detect && detect.useCookie) { | ||
const cookieKey = detect.cookieKey | ||
const code = useCookie<string>(cookieKey).value ?? null | ||
|
||
if (code && localeCodes.includes(code)) { | ||
locale.value = code | ||
} | ||
} | ||
|
||
return locale | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { RoadizAlternateLink } from '@roadiz/types' | ||
import { nuxtI18nOptions } from '#build/i18n.options.mjs' | ||
|
||
export async function useRoadizDetectBrowserLanguage({ locale, alternateLinks }: { locale: string, alternateLinks: RoadizAlternateLink[] }) { | ||
const { detectBrowserLanguage } = nuxtI18nOptions | ||
|
||
if (!detectBrowserLanguage) return | ||
|
||
const isRootPath = useRoute().path === '/' || alternateLinks.some(link => link.url === '/') | ||
|
||
if (!isRootPath && detectBrowserLanguage.redirectOn === 'root') return | ||
|
||
const cookieLocale = useI18nCookie().value | ||
|
||
if (cookieLocale && detectBrowserLanguage.alwaysRedirect !== true) return | ||
|
||
const { $i18n } = useNuxtApp() | ||
const browserLocale = useBrowserLocale() | ||
const preferredLocale = detectBrowserLanguage.useCookie ? (cookieLocale || browserLocale) : browserLocale | ||
|
||
if (preferredLocale && preferredLocale !== locale && $i18n.locales.value.find(availableLocale => availableLocale.code === preferredLocale)) { | ||
const alternateLink = alternateLinks.find(link => link.locale === preferredLocale) | ||
|
||
if (alternateLink) await navigateTo(alternateLink.url, { replace: true, external: true }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const I18N_LOCALES = ['fr'] as const | ||
export const I18N_DEFAULT_LOCALE = 'fr' | ||
export const I18N_DEFAULT_TIMEZONE = 'Europe/Paris' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
Oops, something went wrong.