@live-change/user-frontend 0.8.87 → 0.8.88

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.
@@ -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,7 @@
1
+ {
2
+ "app": {
3
+ "updateAvailable": "Update available!",
4
+ "newVersions": "New version of app is available!",
5
+ "reload": "Reload"
6
+ }
7
+ }
@@ -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
- clientEntry(App, createRouter)
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 == 'session_Session' || objectType == 'user_User'"
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 = path.userIdentification.sessionOrUserOwnedIdentification({
79
- sessionOrUserType: ownerType, sessionOrUser: owner
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(nameGeneratorConfig))
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">{{ t(`errors.${data.languageError}`) }}</small>
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="id-card" label="General Settings" class="hidden md:block" />
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="id-card" label="Language and Locale" class="hidden md:block" />
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/user-frontend",
3
- "version": "0.8.87",
3
+ "version": "0.8.88",
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.87",
26
- "@live-change/dao": "^0.8.87",
27
- "@live-change/dao-vue3": "^0.8.87",
28
- "@live-change/dao-websocket": "^0.8.87",
29
- "@live-change/email-service": "^0.8.87",
30
- "@live-change/framework": "^0.8.87",
31
- "@live-change/identicon-service": "^0.8.87",
32
- "@live-change/image-frontend": "^0.8.87",
33
- "@live-change/message-authentication-service": "^0.8.87",
34
- "@live-change/notification-service": "^0.8.87",
35
- "@live-change/password-authentication-service": "^0.8.87",
36
- "@live-change/pattern": "^0.8.87",
37
- "@live-change/secret-code-service": "^0.8.87",
38
- "@live-change/secret-link-service": "^0.8.87",
39
- "@live-change/security-frontend": "^0.8.87",
40
- "@live-change/security-service": "^0.8.87",
41
- "@live-change/session-service": "^0.8.87",
42
- "@live-change/timer-service": "^0.8.87",
43
- "@live-change/upload-service": "^0.8.87",
44
- "@live-change/user-identification-service": "^0.8.87",
45
- "@live-change/user-service": "^0.8.87",
46
- "@live-change/vue3-components": "^0.8.87",
47
- "@live-change/vue3-ssr": "^0.8.87",
25
+ "@live-change/cli": "^0.8.88",
26
+ "@live-change/dao": "^0.8.88",
27
+ "@live-change/dao-vue3": "^0.8.88",
28
+ "@live-change/dao-websocket": "^0.8.88",
29
+ "@live-change/email-service": "^0.8.88",
30
+ "@live-change/framework": "^0.8.88",
31
+ "@live-change/identicon-service": "^0.8.88",
32
+ "@live-change/image-frontend": "^0.8.88",
33
+ "@live-change/message-authentication-service": "^0.8.88",
34
+ "@live-change/notification-service": "^0.8.88",
35
+ "@live-change/password-authentication-service": "^0.8.88",
36
+ "@live-change/pattern": "^0.8.88",
37
+ "@live-change/secret-code-service": "^0.8.88",
38
+ "@live-change/secret-link-service": "^0.8.88",
39
+ "@live-change/security-frontend": "^0.8.88",
40
+ "@live-change/security-service": "^0.8.88",
41
+ "@live-change/session-service": "^0.8.88",
42
+ "@live-change/timer-service": "^0.8.88",
43
+ "@live-change/upload-service": "^0.8.88",
44
+ "@live-change/user-identification-service": "^0.8.88",
45
+ "@live-change/user-service": "^0.8.88",
46
+ "@live-change/vue3-components": "^0.8.88",
47
+ "@live-change/vue3-ssr": "^0.8.88",
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.87",
68
+ "@live-change/codeceptjs-helper": "^0.8.88",
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": "133e0785e028c37eb6f903d7355e5470b2cc65d3"
79
+ "gitHead": "f80b7c8bf00dc6cc41124fa402edebc7b596e83c"
80
80
  }