Skip to content

Commit c45ca7e

Browse files
Wurielleactions-user
authored andcommitted
style: prettier formatting
1 parent 20554e6 commit c45ca7e

File tree

5 files changed

+147
-130
lines changed

5 files changed

+147
-130
lines changed

apps/app/electron-builder.config.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ function getElectronVersion() {
1818
* @see https://www.electron.build/configuration/configuration
1919
*/
2020
module.exports = {
21-
$schema:
22-
'https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json',
23-
asar: true,
24-
productName: pkg.productName,
25-
directories: {
26-
output: 'dist_electron',
27-
},
28-
files: ['dist', 'dist-electron'],
29-
nsis: {
30-
oneClick: true,
31-
perMachine: false,
32-
allowToChangeInstallationDirectory: false,
33-
deleteAppDataOnUninstall: false,
34-
},
35-
appId: 'com.nhs.izabela',
36-
generateUpdatesFilesForAllChannels: true,
37-
// eslint-disable-next-line no-template-curly-in-string
38-
artifactName: '${name}-setup-${version}-${os}.${ext}',
39-
publish: ['github'],
40-
electronVersion: getElectronVersion(),
41-
extraFiles: ['./resources/**'],
21+
$schema:
22+
'https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json',
23+
asar: true,
24+
productName: pkg.productName,
25+
directories: {
26+
output: 'dist_electron',
27+
},
28+
files: ['dist', 'dist-electron'],
29+
nsis: {
30+
oneClick: true,
31+
perMachine: false,
32+
allowToChangeInstallationDirectory: false,
33+
deleteAppDataOnUninstall: false,
34+
},
35+
appId: 'com.nhs.izabela',
36+
generateUpdatesFilesForAllChannels: true,
37+
// eslint-disable-next-line no-template-curly-in-string
38+
artifactName: '${name}-setup-${version}-${os}.${ext}',
39+
publish: ['github'],
40+
electronVersion: getElectronVersion(),
41+
extraFiles: ['./resources/**'],
4242
}

apps/app/src/plugins/speech-engines/ibm-watson/NvSettings.vue

Lines changed: 51 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,107 @@
11
<template>
22
<NvAccessBlocker
3-
:allowed="
4-
(speechStore.hasUniversalApiCredentials && !getProperty('useLocalCredentials')) ||
3+
:allowed="
4+
(speechStore.hasUniversalApiCredentials &&
5+
!getProperty('useLocalCredentials')) ||
56
[getProperty('apiKey', true), getProperty('url')].every(Boolean)
67
"
7-
reason="Credentials required"
8+
reason="Credentials required"
89
>
910
<NvStack spacing="5">
1011
<NvFormItem label="Voice">
11-
<NvVoiceSelect/>
12+
<NvVoiceSelect />
1213
</NvFormItem>
13-
<NvDivider direction="horizontal"/>
14+
<NvDivider direction="horizontal" />
1415
<NvFormItem label="Speaking Rate">
1516
<NvGroup>
1617
<NvRangeInput
17-
:max="300"
18-
:min="-300"
19-
:step="1"
20-
class="!grow"
21-
v-bind="{
18+
:max="300"
19+
:min="-300"
20+
:step="1"
21+
class="!grow"
22+
v-bind="{
2223
modelValue: getProperty('ratePercentage'),
2324
'onUpdate:modelValue': (value) =>
2425
setProperty('ratePercentage', value),
2526
}"
2627
/>
2728
<NvNumberInput
28-
:max="300"
29-
:min="-300"
30-
:step="1"
31-
v-bind="{
29+
:max="300"
30+
:min="-300"
31+
:step="1"
32+
v-bind="{
3233
modelValue: getProperty('ratePercentage'),
3334
'onUpdate:modelValue': (value) =>
3435
setProperty('ratePercentage', value),
3536
}"
3637
/>
3738
</NvGroup>
3839
</NvFormItem>
39-
<NvDivider direction="horizontal"/>
40+
<NvDivider direction="horizontal" />
4041
<NvFormItem label="Pitch">
4142
<NvGroup>
4243
<NvRangeInput
43-
:max="300"
44-
:min="-300"
45-
:step="1"
46-
class="!grow"
47-
v-bind="{
44+
:max="300"
45+
:min="-300"
46+
:step="1"
47+
class="!grow"
48+
v-bind="{
4849
modelValue: getProperty('pitchPercentage'),
49-
'onUpdate:modelValue': (value) => setProperty('pitchPercentage', value),
50+
'onUpdate:modelValue': (value) =>
51+
setProperty('pitchPercentage', value),
5052
}"
5153
/>
5254
<NvNumberInput
53-
:max="300"
54-
:min="-300"
55-
:step="1"
56-
v-bind="{
55+
:max="300"
56+
:min="-300"
57+
:step="1"
58+
v-bind="{
5759
modelValue: getProperty('pitchPercentage'),
58-
'onUpdate:modelValue': (value) => setProperty('pitchPercentage', value),
60+
'onUpdate:modelValue': (value) =>
61+
setProperty('pitchPercentage', value),
5962
}"
6063
/>
6164
</NvGroup>
6265
</NvFormItem>
6366
</NvStack>
6467
</NvAccessBlocker>
6568
<template v-if="speechStore.hasUniversalApiCredentials">
66-
<NvDivider direction="horizontal"/>
69+
<NvDivider direction="horizontal" />
6770
<NvGroup justify="apart" no-wrap spacing="5">
6871
<NvStack>
6972
<NvText type="label">Use my own credentials</NvText>
7073
</NvStack>
7174
<NvSwitch
72-
:modelValue="getProperty('useLocalCredentials')"
73-
@update:modelValue="(value) => setProperty('useLocalCredentials', value)"
75+
:modelValue="getProperty('useLocalCredentials')"
76+
@update:modelValue="
77+
(value) => setProperty('useLocalCredentials', value)
78+
"
7479
/>
7580
</NvGroup>
7681
</template>
77-
<template v-if="getProperty('useLocalCredentials') || !speechStore.hasUniversalApiCredentials">
78-
<NvDivider direction="horizontal"/>
82+
<template
83+
v-if="
84+
getProperty('useLocalCredentials') ||
85+
!speechStore.hasUniversalApiCredentials
86+
"
87+
>
88+
<NvDivider direction="horizontal" />
7989
<NvStack spacing="5">
8090
<NvFormItem label="API Key">
8191
<NvInput
82-
:modelValue="getProperty('apiKey', true)"
83-
show-password
84-
type="password"
85-
@update:modelValue="(value) => setProperty('apiKey', value, true)"
92+
:modelValue="getProperty('apiKey', true)"
93+
show-password
94+
type="password"
95+
@update:modelValue="(value) => setProperty('apiKey', value, true)"
8696
/>
8797
</NvFormItem>
8898
</NvStack>
89-
<NvDivider direction="horizontal"/>
99+
<NvDivider direction="horizontal" />
90100
<NvStack spacing="5">
91101
<NvFormItem label="Url">
92102
<NvInput
93-
:modelValue="getProperty('url')"
94-
@update:modelValue="(value) => setProperty('url', value)"
103+
:modelValue="getProperty('url')"
104+
@update:modelValue="(value) => setProperty('url', value)"
95105
/>
96106
</NvFormItem>
97107
</NvStack>
@@ -103,7 +113,9 @@ import {
103113
NvDivider,
104114
NvFormItem,
105115
NvGroup,
106-
NvInput, NvNumberInput, NvRangeInput,
116+
NvInput,
117+
NvNumberInput,
118+
NvRangeInput,
107119
NvStack,
108120
NvSwitch,
109121
NvText,

apps/app/src/plugins/speech-engines/ibm-watson/register.ts

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,49 @@ import { ENGINE_ID, ENGINE_NAME, getVoiceName } from './shared'
77
import { getProperty, setProperty } from './store'
88

99
const getCredentials = () => ({
10-
apiKey: getProperty('apiKey', true),
11-
url: getProperty('url'),
10+
apiKey: getProperty('apiKey', true),
11+
url: getProperty('url'),
1212
})
1313

1414
const getSelectedVoice = () => getProperty('selectedVoice')
1515
registerEngine({
16-
id: ENGINE_ID,
17-
name: ENGINE_NAME,
18-
category: 'cloud',
19-
getSelectedVoice,
20-
getVoiceName,
21-
getCredentials,
22-
hasCredentials() {
23-
const speechStore = useSpeechStore()
24-
return speechStore.hasUniversalApiCredentials || Object.values(getCredentials()).every(Boolean)
25-
},
26-
getPayload({ text, translatedText, voice }) {
27-
return {
28-
text: translatedText || text,
29-
voice: (voice || getSelectedVoice()).name,
30-
ratePercentage: Number(getProperty('ratePercentage')),
31-
pitchPercentage: Number(getProperty('pitchPercentage')),
32-
}
33-
},
34-
getLanguageCode(voice) {
35-
return (voice || getSelectedVoice()).language
36-
},
37-
synthesizeSpeech({ credentials, payload }) {
38-
return api(getProperty('useLocalCredentials') ? 'local' : 'remote').post<Blob>(
39-
'/tts/ibm-watson/synthesize-speech',
40-
{
41-
credentials,
42-
payload,
43-
},
44-
{ responseType: 'blob' },
45-
)
46-
},
47-
voiceSelectComponent: NvVoiceSelect,
48-
settingsComponent: NvSettings,
49-
store: { setProperty, getProperty },
16+
id: ENGINE_ID,
17+
name: ENGINE_NAME,
18+
category: 'cloud',
19+
getSelectedVoice,
20+
getVoiceName,
21+
getCredentials,
22+
hasCredentials() {
23+
const speechStore = useSpeechStore()
24+
return (
25+
speechStore.hasUniversalApiCredentials ||
26+
Object.values(getCredentials()).every(Boolean)
27+
)
28+
},
29+
getPayload({ text, translatedText, voice }) {
30+
return {
31+
text: translatedText || text,
32+
voice: (voice || getSelectedVoice()).name,
33+
ratePercentage: Number(getProperty('ratePercentage')),
34+
pitchPercentage: Number(getProperty('pitchPercentage')),
35+
}
36+
},
37+
getLanguageCode(voice) {
38+
return (voice || getSelectedVoice()).language
39+
},
40+
synthesizeSpeech({ credentials, payload }) {
41+
return api(
42+
getProperty('useLocalCredentials') ? 'local' : 'remote',
43+
).post<Blob>(
44+
'/tts/ibm-watson/synthesize-speech',
45+
{
46+
credentials,
47+
payload,
48+
},
49+
{ responseType: 'blob' },
50+
)
51+
},
52+
voiceSelectComponent: NvVoiceSelect,
53+
settingsComponent: NvSettings,
54+
store: { setProperty, getProperty },
5055
})

apps/app/src/plugins/speech-engines/ibm-watson/store.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ import { definePluginStore } from '@/store'
22
import { ENGINE_ID } from './shared'
33

44
export const { setProperty, getProperty } = definePluginStore(ENGINE_ID, {
5-
apiKey: '',
6-
url: '',
7-
selectedVoice: {
8-
gender: 'female',
9-
supported_features: {
10-
custom_pronunciation: true,
11-
voice_transformation: false,
12-
},
13-
name: 'en-US_AllisonV3Voice',
14-
customizable: true,
15-
description: 'Allison: American English female voice. Dnn technology.',
16-
language: 'en-US',
5+
apiKey: '',
6+
url: '',
7+
selectedVoice: {
8+
gender: 'female',
9+
supported_features: {
10+
custom_pronunciation: true,
11+
voice_transformation: false,
1712
},
18-
useLocalCredentials: false,
19-
favoriteVoiceIds: [],
20-
ratePercentage: 0,
21-
pitchPercentage: 0,
13+
name: 'en-US_AllisonV3Voice',
14+
customizable: true,
15+
description: 'Allison: American English female voice. Dnn technology.',
16+
language: 'en-US',
17+
},
18+
useLocalCredentials: false,
19+
favoriteVoiceIds: [],
20+
ratePercentage: 0,
21+
pitchPercentage: 0,
2222
})

apps/app/src/teams/messenger/views/NvSettings.vue

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<NvText>Close</NvText>
1010
<template #reference>
1111
<NvButton
12-
icon-name="times"
13-
size="xs"
14-
type="plain"
15-
@click="$emit('close')"
12+
icon-name="times"
13+
size="xs"
14+
type="plain"
15+
@click="$emit('close')"
1616
/>
1717
</template>
1818
</NvTooltip>
@@ -32,19 +32,19 @@
3232
</NvText>
3333
<NvStack spacing="2">
3434
<template
35-
v-for="entry in category.children"
36-
:key="entry.name"
35+
v-for="entry in category.children"
36+
:key="entry.name"
3737
>
3838
<router-link
39-
:to="entry.to || { name: 'settings' }"
40-
class="w-full"
39+
:to="entry.to || { name: 'settings' }"
40+
class="w-full"
4141
>
4242
<NvButton
43-
:selected="currentRoute.name === entry.to?.name"
44-
class="w-full"
45-
size="sm"
46-
type="ghost-alt"
47-
>{{ entry.name }}
43+
:selected="currentRoute.name === entry.to?.name"
44+
class="w-full"
45+
size="sm"
46+
type="ghost-alt"
47+
>{{ entry.name }}
4848
</NvButton>
4949
</router-link>
5050
</template>
@@ -60,10 +60,10 @@
6060
<router-view v-slot="{ Component }">
6161
<Transition class="transition">
6262
<div
63-
:key="Component"
64-
class="absolute inset-0 overflow-y-auto"
63+
:key="Component"
64+
class="absolute inset-0 overflow-y-auto"
6565
>
66-
<component :is="Component"/>
66+
<component :is="Component" />
6767
</div>
6868
</Transition>
6969
</router-view>
@@ -81,8 +81,8 @@ import { useRoute } from 'vue-router'
8181
import { v4 as uuid } from 'uuid'
8282
import { provide } from 'vue'
8383
84-
const id = `_${ uuid() }`
85-
provide('portal-target', `#${ id }`)
84+
const id = `_${uuid()}`
85+
provide('portal-target', `#${id}`)
8686
8787
const navigation = [
8888
{

0 commit comments

Comments
 (0)