@falcondev-oss/nuxt-layers-base 0.3.0 → 0.4.1

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.
@@ -13,8 +13,11 @@ const config = useRuntimeConfig()
13
13
 
14
14
  <template>
15
15
  <UApp v-bind="forwarded.app" :nonce="config.public.projectId">
16
- <NuxtLayout>
17
- <NuxtPage />
18
- </NuxtLayout>
16
+ <NuxtLoadingIndicator color="var(--color-brand-secondary, var(--color-brand-primary))" />
17
+ <Suspense>
18
+ <NuxtLayout>
19
+ <NuxtPage />
20
+ </NuxtLayout>
21
+ </Suspense>
19
22
  </UApp>
20
23
  </template>
@@ -7,6 +7,7 @@ import {
7
7
  hydrate,
8
8
  MutationCache,
9
9
  QueryClient,
10
+ useIsFetching,
10
11
  useQueryClient,
11
12
  VueQueryPlugin,
12
13
  } from '@tanstack/vue-query'
@@ -83,6 +84,23 @@ export function vueQueryPlugin(opts?: VueQueryNuxtPluginOptions) {
83
84
  hydrate(queryClient, vueQueryState.value)
84
85
  })
85
86
  }
87
+
88
+ // global nuxt loading indicator
89
+ const loadingIndicator = useLoadingIndicator()
90
+ const isFetching = useIsFetching()
91
+
92
+ let timeout: ReturnType<typeof setTimeout> | null = null
93
+ watch(isFetching, () => {
94
+ if (isFetching.value > 0) {
95
+ loadingIndicator.start()
96
+ timeout = setTimeout(() => {
97
+ loadingIndicator.set(0)
98
+ }, 300)
99
+ } else {
100
+ if (timeout) clearTimeout(timeout)
101
+ loadingIndicator.finish()
102
+ }
103
+ })
86
104
  },
87
105
  } satisfies ObjectPlugin
88
106
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@falcondev-oss/nuxt-layers-base",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.4.1",
5
5
  "description": "Nuxt layer with lots of useful helpers and @nuxt/ui components",
6
6
  "license": "MIT",
7
7
  "repository": "github:falcondev-oss/nuxt-layers",
@@ -13,7 +13,7 @@
13
13
  "node": "24",
14
14
  "pnpm": "10"
15
15
  },
16
- "dependencies": {
16
+ "peerDependencies": {
17
17
  "@falcondev-oss/form-core": "^0.18.5",
18
18
  "@falcondev-oss/form-vue": "^0.18.5",
19
19
  "@falcondev-oss/trpc-vue-query": "^0.5.2",
@@ -33,21 +33,21 @@
33
33
  "consola": "^3.4.2",
34
34
  "defu": "^6.1.4",
35
35
  "maska": "^3.2.0",
36
+ "nuxt": "^4.2.2",
36
37
  "reka-ui": "^2.7.0",
37
38
  "remeda": "^2.33.1",
38
39
  "superjson": "^2.2.6",
39
40
  "tailwindcss": "^4.1.18",
40
- "trpc-nuxt": "^2.0.1"
41
+ "trpc-nuxt": "^2.0.1",
42
+ "type-fest": "^5.4.0",
43
+ "vue": "^3.5.26",
44
+ "vue-router": "^4.6.4"
41
45
  },
42
46
  "devDependencies": {
43
47
  "@falcondev-oss/configs": "^5.0.2",
44
48
  "eslint": "^9.39.2",
45
- "nuxt": "^4.2.2",
46
49
  "prettier": "^3.7.4",
47
- "type-fest": "^5.3.1",
48
50
  "typescript": "^5.9.3",
49
- "vue": "^3.5.26",
50
- "vue-router": "^4.6.4",
51
51
  "vue-tsc": "^3.2.2",
52
52
  "zod": "^4.3.5"
53
53
  },