@dargmuesli/nuxt-vio 1.2.3 → 1.4.0

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.
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <div class="h-px grow bg-gray-300 dark:bg-gray-600" />
3
+ </template>
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <a
3
+ v-if="to.match(/^((ftp|http(s)?):\/\/|(mailto):)/)"
4
+ :aria-label="ariaLabel"
5
+ :class="classes"
6
+ :href="to"
7
+ :rel="
8
+ [...(nofollow ? ['nofollow'] : []), 'noopener', 'noreferrer'].join(' ')
9
+ "
10
+ target="_blank"
11
+ @click="emit('click')"
12
+ >
13
+ <slot />
14
+ </a>
15
+ <NuxtLink
16
+ v-else
17
+ :aria-label="ariaLabel"
18
+ :class="classes"
19
+ :to="isToRelative ? append(route.path, to) : to"
20
+ @click="emit('click')"
21
+ >
22
+ <slot />
23
+ </NuxtLink>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ export interface Props {
28
+ ariaLabel?: string
29
+ isColored?: boolean
30
+ isToRelative?: boolean
31
+ isUnderlined?: boolean
32
+ nofollow?: boolean
33
+ to: string
34
+ }
35
+ const props = withDefaults(defineProps<Props>(), {
36
+ ariaLabel: undefined,
37
+ isColored: true,
38
+ isToRelative: false,
39
+ isUnderlined: false,
40
+ nofollow: false,
41
+ })
42
+
43
+ const emit = defineEmits<{
44
+ (e: 'click'): void
45
+ }>()
46
+
47
+ const route = useRoute()
48
+
49
+ // computations
50
+ const classes = computed(() => {
51
+ return [
52
+ 'rounded',
53
+ ...(props.isColored ? ['text-link-dark dark:text-link-bright'] : []),
54
+ ...(props.isUnderlined ? ['underline'] : []),
55
+ ].join(' ')
56
+ })
57
+ </script>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <div class="p-4 md:px-8">
3
+ <main>
4
+ <slot />
5
+ </main>
6
+ </div>
7
+ </template>
package/nuxt.config.ts CHANGED
@@ -1,6 +1,30 @@
1
+ import { SITE_NAME } from './utils/constants'
2
+
1
3
  // https://v3.nuxtjs.org/api/configuration/nuxt.config
2
4
  export default defineNuxtConfig({
5
+ app: {
6
+ head: {
7
+ htmlAttrs: {
8
+ lang: "en", // fallback data to prevent invalid html at generation
9
+ },
10
+ titleTemplate: `%s`,
11
+ title: SITE_NAME, // fallback data to prevent invalid html at generation
12
+ },
13
+ },
14
+ css: ['@/assets/css/main.css'],
3
15
  nitro: {
4
16
  compressPublicAssets: true,
5
17
  },
6
- })
18
+ postcss: {
19
+ plugins: { tailwindcss: {}, autoprefixer: {} },
20
+ },
21
+ typescript: {
22
+ shim: false,
23
+ strict: true,
24
+ tsConfig: {
25
+ vueCompilerOptions: {
26
+ htmlAttributes: [], // https://github.com/johnsoncodehk/volar/issues/1970#issuecomment-1276994634
27
+ },
28
+ },
29
+ },
30
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-vio",
3
- "version": "1.2.3",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -10,7 +10,9 @@
10
10
  },
11
11
  "packageManager": "pnpm@8.2.0",
12
12
  "files": [
13
+ "components",
13
14
  "composables",
15
+ "layouts",
14
16
  "server",
15
17
  "plugins",
16
18
  "utils",
@@ -25,6 +27,7 @@
25
27
  "lint": "eslint ."
26
28
  },
27
29
  "dependencies": {
30
+ "@nuxtjs/i18n": "8.0.0-beta.10",
28
31
  "vue-gtag": "2.0.1"
29
32
  },
30
33
  "devDependencies": {
@@ -1 +1,16 @@
1
- export const CYPRESS_BASE_URL = 'http://localhost:3000'
1
+ import { LocaleObject } from "@nuxtjs/i18n/dist/runtime/composables";
2
+
3
+ export const CYPRESS_BASE_URL = "http://localhost:3000";
4
+ export const LOCALES: LocaleObject[] = [
5
+ {
6
+ code: "en",
7
+ name: "English",
8
+ iso: "en", // Will be used as catchall locale by default.
9
+ },
10
+ {
11
+ code: "de",
12
+ name: "Deutsch",
13
+ iso: "de",
14
+ },
15
+ ];
16
+ export const SITE_NAME = "Vio";