@dargmuesli/nuxt-vio 3.0.0-beta.5 → 3.0.0-beta.7
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 +0 -2
- package/components/vio/form/input/VioFormInput.vue +2 -2
- package/components/vio/loader/indicator/VioLoaderIndicator.vue +1 -1
- package/components/vio/loader/indicator/VioLoaderIndicatorPing.vue +1 -1
- package/composables/useGetServiceHref.ts +2 -2
- package/locales/de.json +1 -1
- package/locales/en.json +1 -1
- package/nuxt.config.ts +6 -1
- package/package.json +10 -10
- package/plugins/dayjs.ts +0 -1
- package/server/middleware/headers.ts +5 -1
- package/server/tsconfig.json +1 -1
- package/server/utils/util.ts +2 -0
- package/tailwind.config.ts +3 -3
- package/types/api.d.ts +3 -1
- package/utils/networking.ts +18 -9
package/app.config.ts
CHANGED
@@ -53,7 +53,7 @@
|
|
53
53
|
<VioFormInputIconWrapper v-if="validationProperty.$pending">
|
54
54
|
<IconHourglass
|
55
55
|
class="text-blue-600"
|
56
|
-
:title="t('
|
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('
|
94
|
+
{{ t('globalStatusLoading') }}
|
95
95
|
</VioFormInputStateInfo>
|
96
96
|
</div>
|
97
97
|
<div class="md:w-1/3" />
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export const useGetServiceHref = () => {
|
2
2
|
const host = useHost()
|
3
|
-
const
|
3
|
+
const runtimeConfig = useRuntimeConfig()
|
4
4
|
|
5
5
|
return ({
|
6
6
|
isSsr = true,
|
@@ -16,6 +16,6 @@ export const useGetServiceHref = () => {
|
|
16
16
|
isSsr,
|
17
17
|
name,
|
18
18
|
port,
|
19
|
-
stagingHost:
|
19
|
+
stagingHost: runtimeConfig.public.stagingHost,
|
20
20
|
})
|
21
21
|
}
|
package/locales/de.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"globalLoading": "Lade...",
|
3
2
|
"globalPlaceholderUrl": "https://websei.te",
|
4
3
|
"globalStatusError": "Fehler",
|
4
|
+
"globalStatusLoading": "Lade...",
|
5
5
|
"globalValidationFailed": "Bitte überprüfe deine Eingaben 🙈",
|
6
6
|
"globalValidationFormatUrlHttps": "Muss mit \"https://\" beginnen",
|
7
7
|
"globalValidationLength": "Zu lang",
|
package/locales/en.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"globalLoading": "Loading...",
|
3
2
|
"globalPlaceholderUrl": "https://websi.te",
|
4
3
|
"globalStatusError": "Error",
|
4
|
+
"globalStatusLoading": "Loading...",
|
5
5
|
"globalValidationFailed": "Please check your input 🙈",
|
6
6
|
"globalValidationFormatUrlHttps": "Must start with \"https://\"",
|
7
7
|
"globalValidationLength": "Too long",
|
package/nuxt.config.ts
CHANGED
@@ -65,6 +65,11 @@ export default defineNuxtConfig({
|
|
65
65
|
},
|
66
66
|
isInProduction: process.env.NODE_ENV === 'production',
|
67
67
|
isTesting: false,
|
68
|
+
stagingHost:
|
69
|
+
process.env.NODE_ENV !== 'production' &&
|
70
|
+
!process.env.NUXT_PUBLIC_STACK_DOMAIN
|
71
|
+
? 'localhost:3000'
|
72
|
+
: undefined,
|
68
73
|
},
|
69
74
|
},
|
70
75
|
typescript: {
|
@@ -164,7 +169,7 @@ export default defineNuxtConfig({
|
|
164
169
|
url: BASE_URL,
|
165
170
|
},
|
166
171
|
sitemap: {
|
167
|
-
exclude: ['/api/**'],
|
172
|
+
exclude: ['/api/pages/**'],
|
168
173
|
},
|
169
174
|
tailwindcss: {
|
170
175
|
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.
|
3
|
+
"version": "3.0.0-beta.7",
|
4
4
|
"type": "module",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -29,17 +29,17 @@
|
|
29
29
|
],
|
30
30
|
"main": "nuxt.config.ts",
|
31
31
|
"scripts": {
|
32
|
-
"
|
33
|
-
"
|
34
|
-
"generate": "
|
35
|
-
"preview": "nuxi preview .playground",
|
36
|
-
"prepare": "nuxi prepare .playground",
|
37
|
-
"lint": "pnpm lint:js && pnpm lint:ts && pnpm lint:style",
|
32
|
+
"build": "nuxt build .playground",
|
33
|
+
"dev": "nuxt dev .playground",
|
34
|
+
"generate": "nuxt generate .playground",
|
38
35
|
"lint:fix": "pnpm lint:js --fix && pnpm lint:ts --fix && pnpm lint:style --fix",
|
39
36
|
"lint:js": "eslint --cache --ext .js,.ts,.vue --ignore-path .gitignore .",
|
40
37
|
"lint:staged": "lint-staged",
|
41
38
|
"lint:style": "stylelint **/*.{vue,css} --ignore-path .gitignore",
|
42
|
-
"lint:ts": "
|
39
|
+
"lint:ts": "nuxt typecheck",
|
40
|
+
"lint": "pnpm lint:js && pnpm lint:ts && pnpm lint:style",
|
41
|
+
"prepare": "nuxt prepare .playground",
|
42
|
+
"preview": "nuxt preview .playground"
|
43
43
|
},
|
44
44
|
"dependencies": {
|
45
45
|
"@dargmuesli/nuxt-cookie-control": "6.1.5",
|
@@ -57,8 +57,9 @@
|
|
57
57
|
"@urql/exchange-graphcache": "6.3.1",
|
58
58
|
"@urql/vue": "1.1.2",
|
59
59
|
"@vuelidate/core": "2.0.3",
|
60
|
+
"@vuelidate/validators": "2.0.3",
|
60
61
|
"clipboard": "2.0.11",
|
61
|
-
"dayjs": "
|
62
|
+
"dayjs": "2.0.0-alpha.4",
|
62
63
|
"is-https": "4.0.0",
|
63
64
|
"jose": "4.14.4",
|
64
65
|
"marked": "7.0.1",
|
@@ -85,7 +86,6 @@
|
|
85
86
|
"stylelint-config-standard": "34.0.0",
|
86
87
|
"stylelint-no-unsupported-browser-features": "7.0.0",
|
87
88
|
"tailwindcss": "3.3.3",
|
88
|
-
"typescript": "5.1.6",
|
89
89
|
"vue": "3.3.4",
|
90
90
|
"vue-tsc": "1.8.8"
|
91
91
|
}
|
package/plugins/dayjs.ts
CHANGED
@@ -6,7 +6,11 @@ import { TIMEZONE_HEADER_KEY } from '../../utils/constants'
|
|
6
6
|
import { getTimezone } from '../../utils/networking'
|
7
7
|
|
8
8
|
export default defineEventHandler(async (event) => {
|
9
|
-
setRequestHeader(
|
9
|
+
setRequestHeader(
|
10
|
+
event,
|
11
|
+
TIMEZONE_HEADER_KEY,
|
12
|
+
(await getTimezone(event)) || 'UTC',
|
13
|
+
)
|
10
14
|
// setContentSecurityPolicy(event);
|
11
15
|
setResponseHeaders(event)
|
12
16
|
})
|
package/server/tsconfig.json
CHANGED
package/tailwind.config.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { Config } from 'tailwindcss'
|
2
|
-
import colors from 'tailwindcss/colors'
|
3
|
-
import { PluginAPI } from 'tailwindcss/types/config'
|
4
1
|
import formsPlugin from '@tailwindcss/forms'
|
5
2
|
import typographyPlugin from '@tailwindcss/typography'
|
3
|
+
import type { Config } from 'tailwindcss'
|
4
|
+
import colors from 'tailwindcss/colors'
|
5
|
+
import type { PluginAPI } from 'tailwindcss/types/config'
|
6
6
|
|
7
7
|
const heading = (theme: PluginAPI['theme']): Record<string, string> => ({
|
8
8
|
fontWeight: theme('fontWeight.bold'),
|
package/types/api.d.ts
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
|
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 }
|
package/utils/networking.ts
CHANGED
@@ -60,9 +60,6 @@ export const getCombinedErrorMessages = (
|
|
60
60
|
return errorMessages
|
61
61
|
}
|
62
62
|
|
63
|
-
export const getCspAsString = (csp = {} as Record<string, Array<string>>) =>
|
64
|
-
Object.keys(csp).reduce((p, c) => (p += `${c} ${csp[c].join(' ')};`), '')
|
65
|
-
|
66
63
|
export const getDomainTldPort = (host: string) => {
|
67
64
|
const hostParts = host.split('.')
|
68
65
|
|
@@ -106,10 +103,22 @@ export const getServiceHref = ({
|
|
106
103
|
}
|
107
104
|
}
|
108
105
|
|
109
|
-
export const getTimezone = async (event: H3Event) =>
|
110
|
-
getCookie(event, TIMEZONE_COOKIE_NAME)
|
111
|
-
|
112
|
-
|
106
|
+
export const getTimezone = async (event: H3Event) => {
|
107
|
+
const timezoneCookie = getCookie(event, TIMEZONE_COOKIE_NAME)
|
108
|
+
|
109
|
+
if (timezoneCookie) {
|
110
|
+
return timezoneCookie
|
111
|
+
}
|
112
|
+
|
113
|
+
if (event.node.req.headers['x-real-ip']) {
|
114
|
+
const ipApiResult = await ofetch<{ timezone: string }>(
|
113
115
|
`http://ip-api.com/json/${event.node.req.headers['x-real-ip']}`,
|
114
|
-
)
|
115
|
-
|
116
|
+
).catch(() => {})
|
117
|
+
|
118
|
+
if (ipApiResult) {
|
119
|
+
return ipApiResult.timezone
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
return undefined
|
124
|
+
}
|