@live-change/user-frontend 0.8.87 → 0.8.89
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/front/locales/en.js +29 -0
- package/front/locales/en.json +11 -0
- package/front/src/config.js +26 -0
- package/front/src/entry-client.js +3 -1
- package/front/src/entry-server.js +3 -2
- package/front/src/identification/ObjectIdentification.vue +3 -1
- package/front/src/identification/UserIdentification.vue +13 -14
- package/front/src/locale/LocaleSettings.vue +5 -2
- package/front/src/settings/SettingsIndex.vue +1 -1
- package/front/src/settings/SettingsMenu.vue +2 -2
- package/front/src/sign/SignInEmail.vue +5 -2
- package/front/src/sign/SignUpEmail.vue +6 -1
- package/index.js +5 -0
- package/package.json +26 -26
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import messages from "./en.json"
|
|
2
|
+
|
|
3
|
+
import { locales as autoFormLocales } from "@live-change/frontend-auto-form"
|
|
4
|
+
|
|
5
|
+
export { messages }
|
|
6
|
+
|
|
7
|
+
export const numberFormats ={
|
|
8
|
+
"usd": {
|
|
9
|
+
"style": "currency",
|
|
10
|
+
"currency": "USD",
|
|
11
|
+
"notation": "standard"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const datetimeFormats = {
|
|
16
|
+
"short": {
|
|
17
|
+
"year": "numeric", "month": "short", "day": "numeric"
|
|
18
|
+
},
|
|
19
|
+
"shortTime": {
|
|
20
|
+
"dateStyle": "short", "timeStyle": "short", "hour12": false
|
|
21
|
+
},
|
|
22
|
+
"shortestTime": {
|
|
23
|
+
"month": "numeric", "day": "numeric", "hour": "numeric", "minute": "numeric", "hour12": false
|
|
24
|
+
},
|
|
25
|
+
"long": {
|
|
26
|
+
"year": "numeric", "month": "short", "day": "numeric",
|
|
27
|
+
"weekday": "short", "hour": "numeric", "minute": "numeric"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"errors": {
|
|
3
|
+
"emailTaken": "Email is already registered, try to sign-in.",
|
|
4
|
+
"phoneTaken": "Phone is already registered, try to sign-in."
|
|
5
|
+
},
|
|
6
|
+
"app": {
|
|
7
|
+
"updateAvailable": "Update available!",
|
|
8
|
+
"newVersions": "New version of app is available!",
|
|
9
|
+
"reload": "Reload"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import deepmerge from 'deepmerge';
|
|
2
|
+
|
|
3
|
+
import * as en from "../locales/en.js"
|
|
4
|
+
import { locales as autoFormLocales } from "@live-change/frontend-auto-form"
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
defaultLocale: 'en',
|
|
8
|
+
i18n: {
|
|
9
|
+
messages: {
|
|
10
|
+
en: deepmerge.all([
|
|
11
|
+
autoFormLocales.en,
|
|
12
|
+
en.messages
|
|
13
|
+
])
|
|
14
|
+
},
|
|
15
|
+
numberFormats: {
|
|
16
|
+
en: deepmerge.all([
|
|
17
|
+
en.numberFormats
|
|
18
|
+
])
|
|
19
|
+
},
|
|
20
|
+
datetimeFormats: {
|
|
21
|
+
en: deepmerge.all([
|
|
22
|
+
en.datetimeFormats
|
|
23
|
+
])
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { clientEntry } from '@live-change/frontend-base/client-entry.js'
|
|
2
2
|
import App from './App.vue'
|
|
3
3
|
import { createRouter } from './router'
|
|
4
|
+
import config from './config.js'
|
|
4
5
|
|
|
6
|
+
clientEntry(App, createRouter, config)
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
window.appStarted = true
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { serverEntry, sitemapEntry } from '@live-change/frontend-base/server-entry.js'
|
|
2
2
|
import App from './App.vue'
|
|
3
3
|
import { createRouter, sitemap as routerSitemap } from './router'
|
|
4
|
+
import config from './config.js'
|
|
4
5
|
|
|
5
|
-
const render = serverEntry(App, createRouter)
|
|
6
|
-
const sitemap = sitemapEntry(App, createRouter, routerSitemap)
|
|
6
|
+
const render = serverEntry(App, createRouter, config)
|
|
7
|
+
const sitemap = sitemapEntry(App, createRouter, routerSitemap, config)
|
|
7
8
|
export { render, sitemap }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<UserIdentification v-if="objectType
|
|
2
|
+
<UserIdentification v-if="objectType === 'session_Session' || objectType === 'user_User'"
|
|
3
3
|
:ownerType="objectType" :owner="object"
|
|
4
4
|
:data="data" :inline="inline" />
|
|
5
5
|
<span v-else><strong>{{ objectType }}</strong>: {{ object }}</span>
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
<script setup>
|
|
9
9
|
|
|
10
|
+
import { UserIdentification } from '../../../index.js'
|
|
11
|
+
|
|
10
12
|
const props = defineProps({
|
|
11
13
|
objectType: {
|
|
12
14
|
type: String,
|
|
@@ -65,8 +65,7 @@
|
|
|
65
65
|
const blockImageSize = '28px'
|
|
66
66
|
|
|
67
67
|
import { toRefs } from "@vueuse/core"
|
|
68
|
-
const { data, inline } = toRefs(props)
|
|
69
|
-
const { ownerType, owner } = props
|
|
68
|
+
const { data, inline, ownerType, owner } = toRefs(props)
|
|
70
69
|
|
|
71
70
|
import { useRouter } from 'vue-router'
|
|
72
71
|
const router = useRouter()
|
|
@@ -75,36 +74,36 @@
|
|
|
75
74
|
import { usePath, live, actions } from '@live-change/vue3-ssr'
|
|
76
75
|
|
|
77
76
|
const path = usePath()
|
|
78
|
-
const userIdentificationPath =
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
const userIdentificationPath = computed(() => ownerType.value && owner.value &&
|
|
78
|
+
path.userIdentification.sessionOrUserOwnedIdentification({
|
|
79
|
+
sessionOrUserType: ownerType.value, sessionOrUser: owner.value
|
|
80
|
+
}) || null
|
|
81
|
+
)
|
|
81
82
|
|
|
82
83
|
const dataPromise = data.value !== undefined ? Promise.resolve(data) :
|
|
83
84
|
live(userIdentificationPath)
|
|
84
85
|
|
|
85
|
-
const identiconUrl = `/api/identicon/jdenticon/${ownerType}:${owner}/28.svg`
|
|
86
|
+
const identiconUrl = computed(() => `/api/identicon/jdenticon/${ownerType.value}:${owner.value}/28.svg`)
|
|
86
87
|
|
|
87
88
|
import { computed } from 'vue'
|
|
88
89
|
|
|
89
90
|
const imageStyle = computed(() => inline
|
|
90
|
-
? { width: inlineImageSize, height: inlineImageSize }
|
|
91
|
+
? { width: inlineImageSize, height: inlineImageSize, verticalAlign: 'middle' }
|
|
91
92
|
: { width: blockImageSize, height: blockImageSize }
|
|
92
93
|
)
|
|
93
94
|
|
|
94
95
|
const [ userData ] = await Promise.all([ dataPromise ])
|
|
95
96
|
|
|
96
|
-
const nameGeneratorConfig = {
|
|
97
|
-
dictionaries: [/*["anonymous", "unnamed"],*/ colors, animals],
|
|
98
|
-
separator: ' ',
|
|
99
|
-
seed: ownerType + '_' + owner
|
|
100
|
-
}
|
|
101
|
-
|
|
102
97
|
const name = computed(() => userData.value?.name
|
|
103
98
|
|| ((userData.value?.firstName && userData.value?.lastName)
|
|
104
99
|
? userData.value?.firstName + ' ' + userData.value?.lastName
|
|
105
100
|
: userData.value?.firstName)
|
|
106
101
|
|| props.anonymous
|
|
107
|
-
|| uniqueNamesGenerator(
|
|
102
|
+
|| uniqueNamesGenerator({
|
|
103
|
+
dictionaries: [/*["anonymous", "unnamed"],*/ colors, animals],
|
|
104
|
+
separator: ' ',
|
|
105
|
+
seed: ownerType.value + '_' + owner.value
|
|
106
|
+
}))
|
|
108
107
|
|
|
109
108
|
</script>
|
|
110
109
|
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
:filter="availableLocales.length > 10"
|
|
25
25
|
placeholder="Auto-detect"
|
|
26
26
|
class="w-full" />
|
|
27
|
-
<small v-if="data.languageError" id="language-help" class="p-error">
|
|
27
|
+
<small v-if="data.languageError" id="language-help" class="p-error">
|
|
28
|
+
{{ t(`errors.${data.languageError}`) }}
|
|
29
|
+
</small>
|
|
28
30
|
</div>
|
|
29
31
|
|
|
30
32
|
<Button type="submit" label="Apply" class="mt-1" icon="pi pi-save" />
|
|
@@ -53,8 +55,9 @@
|
|
|
53
55
|
const { t, availableLocales, locale, getLocaleMessage } = useI18n()
|
|
54
56
|
|
|
55
57
|
function languageLabel(option) {
|
|
58
|
+
console.log("LANGUAGE LABEL", option)
|
|
56
59
|
if(!option) return `Auto-detect (${navigator.language})`
|
|
57
|
-
return getLocaleMessage(option).languageName
|
|
60
|
+
return getLocaleMessage(option).languageName ?? option
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
console.log("availableLocales", availableLocales)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<SettingsMenu class="h-full block md:hidden surface-section" />
|
|
4
4
|
|
|
5
5
|
<div class="flex-column flex-auto align-items-center p-5 hidden md:flex">
|
|
6
|
-
<LocaleSettings class="mb-5"
|
|
6
|
+
<!-- <LocaleSettings class="mb-5" />-->
|
|
7
7
|
<Connected class="mb-5" />
|
|
8
8
|
<ChangePassword />
|
|
9
9
|
</div>
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
<SettingsMenuItem name="user:identification" icon="id-card" label="Identification" class="hidden md:block" />
|
|
10
10
|
|
|
11
|
-
<SettingsMenuItem v-if="client.user" name="user:settings" icon="
|
|
11
|
+
<SettingsMenuItem v-if="client.user" name="user:settings" icon="cog" label="General Settings" class="hidden md:block" />
|
|
12
12
|
|
|
13
|
-
<SettingsMenuItem name="user:locale" icon="
|
|
13
|
+
<SettingsMenuItem name="user:locale" icon="language" label="Language and Locale" class="hidden md:block" />
|
|
14
14
|
|
|
15
15
|
<!-- <SettingsMenuItem name="user:notificationsSettings" icon="exclamation-circle" label="Notifications" />-->
|
|
16
16
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<InputText id="email" type="text" class="w-full"
|
|
21
21
|
aria-describedby="email-help" :class="{ 'p-invalid': data.emailError }"
|
|
22
22
|
v-model="data.email" />
|
|
23
|
-
<small id="email-help" class="p-error">{{ data.emailError }}</small>
|
|
23
|
+
<small id="email-help" class="p-error">{{ t(`errors.${data.emailError}`) }}</small>
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
26
|
<div class="p-field mb-3">
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<Password id="password" class="w-full" inputClass="w-full" toggleMask :feedback="false"
|
|
29
29
|
aria-describedby="password-help" :class="{ 'p-invalid': data.passwordHashError }"
|
|
30
30
|
v-model="data.passwordHash" />
|
|
31
|
-
<small id="password-help" class="p-error">{{ data.passwordHashError }}</small>
|
|
31
|
+
<small id="password-help" class="p-error">{{ t(`errors.${data.passwordHashError}`) }}</small>
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
34
|
<div class="flex align-items-center justify-content-between mb-6">
|
|
@@ -87,6 +87,9 @@
|
|
|
87
87
|
import { useRouter } from 'vue-router'
|
|
88
88
|
const router = useRouter()
|
|
89
89
|
|
|
90
|
+
import { useI18n } from 'vue-i18n'
|
|
91
|
+
const { t } = useI18n()
|
|
92
|
+
|
|
90
93
|
function handleDone({ parameters, result }) {
|
|
91
94
|
console.log("DONE RESULT", result)
|
|
92
95
|
if(result.type === 'sent') {
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
<InputText id="email" type="text" class="w-full"
|
|
20
20
|
aria-describedby="email-help" :class="{ 'p-invalid': data.emailError}"
|
|
21
21
|
v-model="data.email" />
|
|
22
|
-
<small v-if="data.emailError" id="email-help" class="p-error">
|
|
22
|
+
<small v-if="data.emailError" id="email-help" class="p-error">
|
|
23
|
+
{{ t(`errors.${data.emailError}`) }}
|
|
24
|
+
</small>
|
|
23
25
|
</div>
|
|
24
26
|
|
|
25
27
|
<Button label="Sign Up with email" icon="pi pi-user" class="w-full" type="submit" />
|
|
@@ -51,6 +53,9 @@
|
|
|
51
53
|
import { useRouter } from 'vue-router'
|
|
52
54
|
const router = useRouter()
|
|
53
55
|
|
|
56
|
+
import { useI18n } from 'vue-i18n'
|
|
57
|
+
const { t } = useI18n()
|
|
58
|
+
|
|
54
59
|
function handleSent({ parameters, result }) {
|
|
55
60
|
const { authentication } = result
|
|
56
61
|
router.push({
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/user-frontend",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.89",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"memDev": "node --inspect --expose-gc server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
|
|
6
6
|
"localDevInit": "rm tmp.db; node server/start.js localDev --enableSessions --initScript ./init.js",
|
|
@@ -22,29 +22,29 @@
|
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@live-change/cli": "^0.8.
|
|
26
|
-
"@live-change/dao": "^0.8.
|
|
27
|
-
"@live-change/dao-vue3": "^0.8.
|
|
28
|
-
"@live-change/dao-websocket": "^0.8.
|
|
29
|
-
"@live-change/email-service": "^0.8.
|
|
30
|
-
"@live-change/framework": "^0.8.
|
|
31
|
-
"@live-change/identicon-service": "^0.8.
|
|
32
|
-
"@live-change/image-frontend": "^0.8.
|
|
33
|
-
"@live-change/message-authentication-service": "^0.8.
|
|
34
|
-
"@live-change/notification-service": "^0.8.
|
|
35
|
-
"@live-change/password-authentication-service": "^0.8.
|
|
36
|
-
"@live-change/pattern": "^0.8.
|
|
37
|
-
"@live-change/secret-code-service": "^0.8.
|
|
38
|
-
"@live-change/secret-link-service": "^0.8.
|
|
39
|
-
"@live-change/security-frontend": "^0.8.
|
|
40
|
-
"@live-change/security-service": "^0.8.
|
|
41
|
-
"@live-change/session-service": "^0.8.
|
|
42
|
-
"@live-change/timer-service": "^0.8.
|
|
43
|
-
"@live-change/upload-service": "^0.8.
|
|
44
|
-
"@live-change/user-identification-service": "^0.8.
|
|
45
|
-
"@live-change/user-service": "^0.8.
|
|
46
|
-
"@live-change/vue3-components": "^0.8.
|
|
47
|
-
"@live-change/vue3-ssr": "^0.8.
|
|
25
|
+
"@live-change/cli": "^0.8.89",
|
|
26
|
+
"@live-change/dao": "^0.8.89",
|
|
27
|
+
"@live-change/dao-vue3": "^0.8.89",
|
|
28
|
+
"@live-change/dao-websocket": "^0.8.89",
|
|
29
|
+
"@live-change/email-service": "^0.8.89",
|
|
30
|
+
"@live-change/framework": "^0.8.89",
|
|
31
|
+
"@live-change/identicon-service": "^0.8.89",
|
|
32
|
+
"@live-change/image-frontend": "^0.8.89",
|
|
33
|
+
"@live-change/message-authentication-service": "^0.8.89",
|
|
34
|
+
"@live-change/notification-service": "^0.8.89",
|
|
35
|
+
"@live-change/password-authentication-service": "^0.8.89",
|
|
36
|
+
"@live-change/pattern": "^0.8.89",
|
|
37
|
+
"@live-change/secret-code-service": "^0.8.89",
|
|
38
|
+
"@live-change/secret-link-service": "^0.8.89",
|
|
39
|
+
"@live-change/security-frontend": "^0.8.89",
|
|
40
|
+
"@live-change/security-service": "^0.8.89",
|
|
41
|
+
"@live-change/session-service": "^0.8.89",
|
|
42
|
+
"@live-change/timer-service": "^0.8.89",
|
|
43
|
+
"@live-change/upload-service": "^0.8.89",
|
|
44
|
+
"@live-change/user-identification-service": "^0.8.89",
|
|
45
|
+
"@live-change/user-service": "^0.8.89",
|
|
46
|
+
"@live-change/vue3-components": "^0.8.89",
|
|
47
|
+
"@live-change/vue3-ssr": "^0.8.89",
|
|
48
48
|
"@vueuse/core": "^10.11.0",
|
|
49
49
|
"codeceptjs-assert": "^0.0.5",
|
|
50
50
|
"codeceptjs-video-helper": "0.1.3",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"wtfnode": "^0.9.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@live-change/codeceptjs-helper": "^0.8.
|
|
68
|
+
"@live-change/codeceptjs-helper": "^0.8.89",
|
|
69
69
|
"codeceptjs": "^3.6.5",
|
|
70
70
|
"generate-password": "1.7.1",
|
|
71
71
|
"playwright": "^1.41.2",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"author": "Michał Łaszczewski <michal@laszczewski.pl>",
|
|
77
77
|
"license": "BSD-3-Clause",
|
|
78
78
|
"description": "",
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "15d4b3dc445480608c993e4057be208192e97023"
|
|
80
80
|
}
|