@dargmuesli/nuxt-vio 3.0.0-beta.1 → 3.0.0-beta.3
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 +34 -33
- package/components/{_ → vio/_}/VioApp.vue +20 -6
- package/components/{_ → vio/_}/VioError.vue +1 -1
- package/components/{_ → vio/_}/VioLink.vue +2 -2
- package/components/{layout → vio/layout}/VioLayout.vue +1 -1
- package/components/{page → vio/page}/VioPageLegalNotice.vue +9 -7
- package/components/{page → vio/page}/VioPagePrivacyPolicy.vue +18 -11
- package/composables/useAppLayout.ts +11 -17
- package/composables/useFavicons.ts +3 -31
- package/composables/useGetServiceHref.ts +2 -28
- package/composables/useHeadDefault.ts +13 -26
- package/error.vue +2 -0
- package/nuxt.config.ts +12 -10
- package/package.json +9 -12
- package/plugins/dayjs.ts +0 -12
- package/store/auth.ts +32 -0
- package/tailwind.config.ts +0 -2
- package/types/api.d.ts +7 -0
- package/types/fetch.d.ts +8 -0
- package/types/modules/gql.d.ts +6 -0
- package/types/modules/graphql.d.ts +6 -0
- package/utils/constants.ts +1 -0
- package/utils/networking.ts +26 -0
- package/LICENSE +0 -674
- package/composables/useHeadLayout.ts +0 -67
- /package/components/{button → vio/button}/VioButton.vue +0 -0
- /package/components/{button → vio/button}/VioButtonColored.vue +0 -0
- /package/components/{card → vio/card}/VioCard.vue +0 -0
- /package/components/{card → vio/card}/state/VioCardState.vue +0 -0
- /package/components/{card → vio/card}/state/VioCardStateAlert.vue +0 -0
- /package/components/{form → vio/form}/VioForm.vue +0 -0
- /package/components/{form → vio/form}/VioFormCheckbox.vue +0 -0
- /package/components/{form → vio/form}/input/VioFormInput.vue +0 -0
- /package/components/{form → vio/form}/input/VioFormInputIconWrapper.vue +0 -0
- /package/components/{form → vio/form}/input/VioFormInputUrl.vue +0 -0
- /package/components/{form → vio/form}/input/state/VioFormInputState.vue +0 -0
- /package/components/{form → vio/form}/input/state/VioFormInputStateError.vue +0 -0
- /package/components/{form → vio/form}/input/state/VioFormInputStateInfo.vue +0 -0
- /package/components/{icon → vio/icon}/IconArrowRight.vue +0 -0
- /package/components/{icon → vio/icon}/IconCalendar.vue +0 -0
- /package/components/{icon → vio/icon}/IconChatOutline.vue +0 -0
- /package/components/{icon → vio/icon}/IconChatSolid.vue +0 -0
- /package/components/{icon → vio/icon}/IconCheckCircle.vue +0 -0
- /package/components/{icon → vio/icon}/IconContainer.vue +0 -0
- /package/components/{icon → vio/icon}/IconDownload.vue +0 -0
- /package/components/{icon → vio/icon}/IconExclamationCircle.vue +0 -0
- /package/components/{icon → vio/icon}/IconHome.vue +0 -0
- /package/components/{icon → vio/icon}/IconHourglass.vue +0 -0
- /package/components/{icon → vio/icon}/IconLightbulb.vue +0 -0
- /package/components/{icon → vio/icon}/IconLogo.vue +0 -0
- /package/components/{icon → vio/icon}/IconMixcloud.vue +0 -0
- /package/components/{icon → vio/icon}/IconMusic.vue +0 -0
- /package/components/{icon → vio/icon}/IconPlay.vue +0 -0
- /package/components/{icon → vio/icon}/IconShare.vue +0 -0
- /package/components/{layout → vio/layout}/VioLayoutBreadcrumbs.vue +0 -0
- /package/components/{layout → vio/layout}/VioLayoutFooter.vue +0 -0
- /package/components/{layout → vio/layout}/VioLayoutFooterCategory.vue +0 -0
- /package/components/{layout → vio/layout}/VioLayoutHeader.vue +0 -0
- /package/components/{layout → vio/layout}/VioLayoutHr.vue +0 -0
- /package/components/{layout → vio/layout}/VioLayoutSpanList.vue +0 -0
- /package/components/{loader → vio/loader}/indicator/VioLoaderIndicator.vue +0 -0
- /package/components/{loader → vio/loader}/indicator/VioLoaderIndicatorPing.vue +0 -0
- /package/components/{loader → vio/loader}/indicator/VioLoaderIndicatorSpinner.vue +0 -0
package/store/auth.ts
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
import { decodeJwt, JWTPayload } from 'jose'
|
2
|
+
import { defineStore } from 'pinia'
|
3
|
+
import { ref } from 'vue'
|
4
|
+
|
5
|
+
export const useVioAuthStore = defineStore('vio-auth', () => {
|
6
|
+
const jwt = ref<string>()
|
7
|
+
const jwtDecoded = ref<JWTPayload>()
|
8
|
+
const signedInUsername = ref<string>()
|
9
|
+
|
10
|
+
const jwtRemove = () => jwtSet(undefined)
|
11
|
+
|
12
|
+
const jwtSet = (jwtNew?: string) => {
|
13
|
+
const jwtDecodedNew = jwtNew !== undefined ? decodeJwt(jwtNew) : undefined
|
14
|
+
|
15
|
+
jwt.value = jwtNew
|
16
|
+
jwtDecoded.value = jwtDecodedNew
|
17
|
+
signedInUsername.value =
|
18
|
+
jwtDecodedNew?.role === 'vio_account' &&
|
19
|
+
jwtDecodedNew.exp !== undefined &&
|
20
|
+
jwtDecodedNew.exp > Math.floor(Date.now() / 1000)
|
21
|
+
? (jwtDecodedNew.username as string | undefined)
|
22
|
+
: undefined
|
23
|
+
}
|
24
|
+
|
25
|
+
return {
|
26
|
+
jwt,
|
27
|
+
jwtDecoded,
|
28
|
+
signedInUsername,
|
29
|
+
jwtRemove,
|
30
|
+
jwtSet,
|
31
|
+
}
|
32
|
+
})
|
package/tailwind.config.ts
CHANGED
@@ -2,7 +2,6 @@ import { Config } from 'tailwindcss'
|
|
2
2
|
import colors from 'tailwindcss/colors'
|
3
3
|
import { PluginAPI } from 'tailwindcss/types/config'
|
4
4
|
import formsPlugin from '@tailwindcss/forms'
|
5
|
-
import lineClampPlugin from '@tailwindcss/line-clamp'
|
6
5
|
import typographyPlugin from '@tailwindcss/typography'
|
7
6
|
|
8
7
|
const heading = (theme: PluginAPI['theme']): Record<string, string> => ({
|
@@ -54,7 +53,6 @@ export default {
|
|
54
53
|
darkMode: 'class',
|
55
54
|
plugins: [
|
56
55
|
formsPlugin,
|
57
|
-
lineClampPlugin,
|
58
56
|
typographyPlugin,
|
59
57
|
({ addBase, addComponents, addUtilities, theme }: PluginAPI) => {
|
60
58
|
addBase({
|
package/types/api.d.ts
ADDED
package/types/fetch.d.ts
ADDED
package/utils/constants.ts
CHANGED
package/utils/networking.ts
CHANGED
@@ -80,6 +80,32 @@ export const getHost = (req: IncomingMessage) => {
|
|
80
80
|
return req.headers.host
|
81
81
|
}
|
82
82
|
|
83
|
+
export const getServiceHref = ({
|
84
|
+
host,
|
85
|
+
isSsr = true,
|
86
|
+
name,
|
87
|
+
port,
|
88
|
+
stagingHost,
|
89
|
+
}: {
|
90
|
+
host: string
|
91
|
+
isSsr?: boolean
|
92
|
+
name?: string
|
93
|
+
port?: number
|
94
|
+
stagingHost?: string
|
95
|
+
}) => {
|
96
|
+
const nameSubdomain = name?.replaceAll('_', '-')
|
97
|
+
const nameSubdomainString = nameSubdomain ? `${nameSubdomain}.` : ''
|
98
|
+
const portString = port ? `:${port}` : ''
|
99
|
+
|
100
|
+
if (stagingHost) {
|
101
|
+
return `https://${nameSubdomainString}${stagingHost}`
|
102
|
+
} else if (isSsr && process.server) {
|
103
|
+
return `http://${name}${portString}`
|
104
|
+
} else {
|
105
|
+
return `https://${nameSubdomainString}${getDomainTldPort(host)}`
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
83
109
|
export const getTimezone = async (event: H3Event) =>
|
84
110
|
getCookie(event, TIMEZONE_COOKIE_NAME) ||
|
85
111
|
(
|