@dargmuesli/nuxt-vio 3.0.0-beta.5 → 3.0.0-beta.6

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.
@@ -53,7 +53,7 @@
53
53
  <VioFormInputIconWrapper v-if="validationProperty.$pending">
54
54
  <IconHourglass
55
55
  class="text-blue-600"
56
- :title="t('globalLoading')"
56
+ :title="t('globalStatusLoading')"
57
57
  />
58
58
  </VioFormInputIconWrapper>
59
59
  <VioFormInputIconWrapper
@@ -91,7 +91,7 @@
91
91
  <div class="md:w-2/3">
92
92
  <slot name="stateInfo" />
93
93
  <VioFormInputStateInfo v-if="value?.$pending">
94
- {{ t('globalLoading') }}
94
+ {{ t('globalStatusLoading') }}
95
95
  </VioFormInputStateInfo>
96
96
  </div>
97
97
  <div class="md:w-1/3" />
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  class="flex h-full items-center justify-center"
4
- :title="t('globalLoading')"
4
+ :title="t('globalStatusLoading')"
5
5
  >
6
6
  <div class="flex items-center justify-center w-1/2">
7
7
  <slot />
@@ -2,7 +2,7 @@
2
2
  <VioLoaderIndicator>
3
3
  <div
4
4
  class="w-1/2 aspect-square animate-ping rounded-full bg-gray-500"
5
- :title="t('globalLoading')"
5
+ :title="t('globalStatusLoading')"
6
6
  />
7
7
  </VioLoaderIndicator>
8
8
  </template>
package/locales/de.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "globalLoading": "Lade...",
2
+ "globalStatusLoading": "Lade...",
3
3
  "globalPlaceholderUrl": "https://websei.te",
4
4
  "globalStatusError": "Fehler",
5
5
  "globalValidationFailed": "Bitte überprüfe deine Eingaben 🙈",
package/locales/en.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "globalLoading": "Loading...",
2
+ "globalStatusLoading": "Loading...",
3
3
  "globalPlaceholderUrl": "https://websi.te",
4
4
  "globalStatusError": "Error",
5
5
  "globalValidationFailed": "Please check your input 🙈",
package/nuxt.config.ts CHANGED
@@ -164,7 +164,7 @@ export default defineNuxtConfig({
164
164
  url: BASE_URL,
165
165
  },
166
166
  sitemap: {
167
- exclude: ['/api/**'],
167
+ exclude: ['/api/pages/**'],
168
168
  },
169
169
  tailwindcss: {
170
170
  cssPath: join(currentDir, './assets/css/tailwind.css'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-vio",
3
- "version": "3.0.0-beta.5",
3
+ "version": "3.0.0-beta.6",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/types/api.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- export type BackendError = CombinedError | { errcode: string; message: string }
1
+ import type { CombinedError } from '@urql/core'
2
2
 
3
3
  export type ApiData = ComputedRef<{
4
4
  data?: Object
5
5
  errors: BackendError[]
6
6
  isFetching: boolean
7
7
  }>
8
+
9
+ export type BackendError = CombinedError | { errcode: string; message: string }
@@ -106,10 +106,22 @@ export const getServiceHref = ({
106
106
  }
107
107
  }
108
108
 
109
- export const getTimezone = async (event: H3Event) =>
110
- getCookie(event, TIMEZONE_COOKIE_NAME) ||
111
- (
112
- await ofetch(
109
+ export const getTimezone = async (event: H3Event) => {
110
+ const timezoneCookie = getCookie(event, TIMEZONE_COOKIE_NAME)
111
+
112
+ if (timezoneCookie) {
113
+ return timezoneCookie
114
+ }
115
+
116
+ if (event.node.req.headers['x-real-ip']) {
117
+ const ipApiResult = await ofetch(
113
118
  `http://ip-api.com/json/${event.node.req.headers['x-real-ip']}`,
114
- )
115
- ).timezone
119
+ ).catch(() => {})
120
+
121
+ if (ipApiResult) {
122
+ return ipApiResult.timezone
123
+ }
124
+ }
125
+
126
+ return undefined
127
+ }