From 87b7d9b9f74d848891eb71b7c7aeb20ef86c3297 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 21:32:48 +0000 Subject: [PATCH 01/30] chore(deps): bump semver in /examples/custom-engine-api Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] --- examples/custom-engine-api/yarn.lock | 53 +++------------------------- 1 file changed, 4 insertions(+), 49 deletions(-) diff --git a/examples/custom-engine-api/yarn.lock b/examples/custom-engine-api/yarn.lock index c77af4ce..b4427849 100644 --- a/examples/custom-engine-api/yarn.lock +++ b/examples/custom-engine-api/yarn.lock @@ -28,20 +28,6 @@ array-flatten@1.1.1: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - -axios@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.3.3.tgz#e7011384ba839b885007c9c9fae1ff23dceb295b" - integrity sha512-eYq77dYIFS77AQlhzEL937yUBSepBfPIe8FcgEDN35vMNZKMrs81pgnyrQpwfy4NF4b4XWX1Zgx7yX+25w8QJA== - dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -113,13 +99,6 @@ chokidar@^3.5.2: optionalDependencies: fsevents "~2.3.2" -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -161,11 +140,6 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -253,20 +227,6 @@ finalhandler@1.2.0: statuses "2.0.1" unpipe "~1.0.0" -follow-redirects@^1.15.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== - -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -397,7 +357,7 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@~2.1.24, mime-types@~2.1.34: +mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -499,11 +459,6 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" -proxy-from-env@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - pstree.remy@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" @@ -556,9 +511,9 @@ say@^0.16.0: one-time "0.0.4" semver@^5.7.1: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== semver@~7.0.0: version "7.0.0" From 2f7ba85447cf033628f3319abbfabd7e0c782424 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 21:33:12 +0000 Subject: [PATCH 02/30] chore(deps): bump semver in /examples/custom-translation-api Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] --- examples/custom-translation-api/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/custom-translation-api/yarn.lock b/examples/custom-translation-api/yarn.lock index ff70987f..bbf023b8 100644 --- a/examples/custom-translation-api/yarn.lock +++ b/examples/custom-translation-api/yarn.lock @@ -544,9 +544,9 @@ safe-buffer@5.2.1: integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== semver@^5.7.1: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== semver@~7.0.0: version "7.0.0" From 9b6f751278ff1006a8527d7584f40f15e152d586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=8E=E3=82=A2?= Date: Tue, 18 Jul 2023 09:36:50 +0200 Subject: [PATCH 03/30] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa735e67..17258374 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@

- Your speech Assistant ✨ + Your speech assistant ✨

@@ -87,7 +87,7 @@ Here's a list of all the text-to-speech engines that are supported in Izabela: | Izabela (multiple engines) | Yes | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/izabela-sample.mp3?raw=true) | https://github.com/Weilbyte/tiktok-tts | | Amazon Polly | Yes | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/amazon-polly-sample.mp3?raw=true) | https://aws.amazon.com/polly/ | | Google Cloud TTS | Yes | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/google-cloud-tts-sample.mp3?raw=true) | https://cloud.google.com/text-to-speech | -| IBM Watson TTS | Yes | | https://www.ibm.com/cloud/watson-text-to-speech | +| IBM Watson TTS | Will be available at a later date | | https://www.ibm.com/cloud/watson-text-to-speech | | Microsoft Azure TTS | Yes | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/microsoft-azure-tts-sample.mp3?raw=true) | https://azure.microsoft.com/en-us/products/cognitive-services/text-to-speech/ | | Say | Included by default | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/say-sample.mp3?raw=true) | https://github.com/Marak/say.js/ | | Sam | Included by default | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/sam-sample.mp3?raw=true) | https://github.com/discordier/sam / https://github.com/Imrane03/better-sam | From 4ba239fe36923014a38fb9d657980cdf58d127a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=8E=E3=82=A2?= Date: Wed, 19 Jul 2023 09:36:02 +0200 Subject: [PATCH 04/30] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 17258374..bb497f87 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Here's a list of all the text-to-speech engines that are supported in Izabela: | Izabela (multiple engines) | Yes | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/izabela-sample.mp3?raw=true) | https://github.com/Weilbyte/tiktok-tts | | Amazon Polly | Yes | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/amazon-polly-sample.mp3?raw=true) | https://aws.amazon.com/polly/ | | Google Cloud TTS | Yes | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/google-cloud-tts-sample.mp3?raw=true) | https://cloud.google.com/text-to-speech | -| IBM Watson TTS | Will be available at a later date | | https://www.ibm.com/cloud/watson-text-to-speech | +| IBM Watson TTS | Temporarily unavailable | | https://www.ibm.com/cloud/watson-text-to-speech | | Microsoft Azure TTS | Yes | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/microsoft-azure-tts-sample.mp3?raw=true) | https://azure.microsoft.com/en-us/products/cognitive-services/text-to-speech/ | | Say | Included by default | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/say-sample.mp3?raw=true) | https://github.com/Marak/say.js/ | | Sam | Included by default | [Download](https://github.com/nature-heart-software/izabela/blob/dev/assets/sam-sample.mp3?raw=true) | https://github.com/discordier/sam / https://github.com/Imrane03/better-sam | From 83648dfa50851651fc0a6487fb79ec0e8f4b8acf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jul 2023 14:41:52 +0000 Subject: [PATCH 05/30] chore(deps-dev): bump word-wrap in /packages/win-mouse Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] --- packages/win-mouse/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/win-mouse/package-lock.json b/packages/win-mouse/package-lock.json index f8f32262..4f47f0a9 100644 --- a/packages/win-mouse/package-lock.json +++ b/packages/win-mouse/package-lock.json @@ -1942,9 +1942,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true }, "wrappy": { From 1b03bf9f720483b39050a518f4472e284fc5cf85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 10:39:06 +0000 Subject: [PATCH 06/30] chore(deps): bump axios in /examples/custom-translation-api Bumps [axios](https://github.com/axios/axios) from 1.3.3 to 1.6.0. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v1.3.3...v1.6.0) --- updated-dependencies: - dependency-name: axios dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- examples/custom-translation-api/package.json | 2 +- examples/custom-translation-api/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/custom-translation-api/package.json b/examples/custom-translation-api/package.json index 87b8c552..cc616bae 100644 --- a/examples/custom-translation-api/package.json +++ b/examples/custom-translation-api/package.json @@ -7,7 +7,7 @@ "start": "nodemon index.js" }, "dependencies": { - "axios": "^1.3.3", + "axios": "^1.6.0", "express": "^4.18.2", "nodemon": "^2.0.20" } diff --git a/examples/custom-translation-api/yarn.lock b/examples/custom-translation-api/yarn.lock index bbf023b8..edc20555 100644 --- a/examples/custom-translation-api/yarn.lock +++ b/examples/custom-translation-api/yarn.lock @@ -33,10 +33,10 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -axios@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.3.3.tgz#e7011384ba839b885007c9c9fae1ff23dceb295b" - integrity sha512-eYq77dYIFS77AQlhzEL937yUBSepBfPIe8FcgEDN35vMNZKMrs81pgnyrQpwfy4NF4b4XWX1Zgx7yX+25w8QJA== +axios@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" + integrity sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg== dependencies: follow-redirects "^1.15.0" form-data "^4.0.0" From 4e0230796484ad438d00c665696471141b2a4a32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 10:40:03 +0000 Subject: [PATCH 07/30] chore(deps): bump electron in /packages/electron-pinia Bumps [electron](https://github.com/electron/electron) from 20.3.8 to 22.3.25. - [Release notes](https://github.com/electron/electron/releases) - [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md) - [Commits](https://github.com/electron/electron/compare/v20.3.8...v22.3.25) --- updated-dependencies: - dependency-name: electron dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- packages/electron-pinia/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/electron-pinia/package.json b/packages/electron-pinia/package.json index 124921d6..bbfe3fc0 100644 --- a/packages/electron-pinia/package.json +++ b/packages/electron-pinia/package.json @@ -36,7 +36,7 @@ ], "dependencies": { "@packages/toolbox": "^0.0.0", - "electron": "20.3.8", + "electron": "22.3.25", "pinia": "^2.0.21", "vue": "^3.2.37", "electron-store": "^8.1.0", From 36c6f17910f607f12d68c8cc4a7f0c2fa4ef5488 Mon Sep 17 00:00:00 2001 From: Wurielle Date: Sat, 23 Dec 2023 20:15:05 +0100 Subject: [PATCH 08/30] feat: add development infos --- .dockerignore | 3 +++ .yarnrc | 2 ++ Dockerfile | 33 ++++++++++++++++++++++++ README.md | 10 +++++++ install_vs_build_tools.ps1 | 6 +++++ lerna.json.prod | 10 +++++++ package.json | 1 + scripts/install-nodejs.ps1 | 9 +++++++ scripts/install-python.ps1 | 7 +++++ scripts/install-vs-build-tools-win10.ps1 | 8 ++++++ scripts/install-vs-build-tools.ps1 | 8 ++++++ scripts/install-yarn.ps1 | 6 +++++ yarn.lock | 26 ++++++++++++++++++- 13 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 .yarnrc create mode 100644 Dockerfile create mode 100644 install_vs_build_tools.ps1 create mode 100644 lerna.json.prod create mode 100644 scripts/install-nodejs.ps1 create mode 100644 scripts/install-python.ps1 create mode 100644 scripts/install-vs-build-tools-win10.ps1 create mode 100644 scripts/install-vs-build-tools.ps1 create mode 100644 scripts/install-yarn.ps1 diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..2ad13cfb --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +npm-debug.log +yarn-error.log diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 00000000..95b04d08 --- /dev/null +++ b/.yarnrc @@ -0,0 +1,2 @@ +httpTimeout 600000 +network-timeout 600000 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..239e3e96 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM mcr.microsoft.com/windows/servercore:ltsc2019 + +WORKDIR /app + +RUN icacls "C:\app" /grant:r everyone:(OI)(CI)F /t + +COPY ./scripts/install-nodejs.ps1 ./scripts/install-nodejs.ps1 +RUN powershell -Command ./scripts/install-nodejs.ps1 + +COPY ./scripts/install-yarn.ps1 ./scripts/install-yarn.ps1 +RUN powershell -Command ./scripts/install-yarn.ps1 + +COPY ./scripts/install-python.ps1 ./scripts/install-python.ps1 +RUN powershell -Command ./scripts/install-python.ps1 + +COPY ./scripts/install-vs-build-tools.ps1 ./scripts/install-vs-build-tools.ps1 +RUN powershell -Command ./scripts/install-vs-build-tools.ps1 + +ENV PATH="C:\nodejs;C:\Program Files (x86)\Yarn\bin;C:\Python310;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64;${PATH}" + +ENV PYTHON="C:\Python310\python.exe" + +ENV NODE_OPTIONS="--max-old-space-size=4096" + +RUN npm config set python C:\Python310\python.exe + +RUN npm config set msvs_version 2022 + +COPY ./ ./ + +COPY ./lerna.json.prod ./lerna.json + +RUN npm run build diff --git a/README.md b/README.md index bb497f87..5e61892f 100644 --- a/README.md +++ b/README.md @@ -101,3 +101,13 @@ Find guides and API documentation on the [Wiki](https://github.com/nature-heart- ## Resources - [Figma](https://www.figma.com/proto/U4A6IwSY8T4W2tm2agW92S/Izabela-v1.0.0?node-id=103%3A4&scaling=min-zoom&page-id=103%3A3&starting-point-node-id=103%3A4) + +## Development + +The project requires the following in order to run: +- Node 16 +- Yarn +- Python 3.10 +- Visual Studio Build Tools 2019 or higher + - Desktop development with C++ + - Node.js build tools diff --git a/install_vs_build_tools.ps1 b/install_vs_build_tools.ps1 new file mode 100644 index 00000000..dea92233 --- /dev/null +++ b/install_vs_build_tools.ps1 @@ -0,0 +1,6 @@ +# install_vs_build_tools.ps1 + +$vsBuildToolsUri = "https://aka.ms/vs/16/release/vs_buildtools.exe" +Invoke-WebRequest -Uri $vsBuildToolsUri -OutFile vs_buildtools.exe +Start-Process -Wait -FilePath .\vs_buildtools.exe -ArgumentList "--quiet", "--wait", "--norestart", "--nocache", "--installPath=C:\BuildTools", "--add", "Microsoft.VisualStudio.Workload.VCTools", "--add", "Microsoft.VisualStudio.Workload.NodeBuildTools", "--add", "Microsoft.VisualStudio.Component.VC.14.29.C++.x86.x64" +Remove-Item vs_buildtools.exe -Force diff --git a/lerna.json.prod b/lerna.json.prod new file mode 100644 index 00000000..a7da3dbb --- /dev/null +++ b/lerna.json.prod @@ -0,0 +1,10 @@ +{ + "useNx": false, + "version": "0.0.0", + "$schema": "node_modules/lerna/schemas/lerna-schema.json", + "useWorkspaces": true, + "npmClient": "yarn", + "npmClientArgs": [ + "--prefer-offline" + ] +} diff --git a/package.json b/package.json index a9fbc26a..a7278eeb 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "bootstrap": "yarn lerna bootstrap --no-ci", "dev": "yarn bootstrap && yarn lerna run serve --scope izabela-next --stream", "build": "yarn install && yarn bootstrap && yarn lerna run build", + "docker:build": "docker build -t izabela . && docker create --name dummy izabela && docker cp dummy:dist_electron dist_electron && docker rm -f dummy", "build:deps": "yarn bootstrap && yarn lerna run build --scope '{@packages/*,@apps/app-server}' --stream", "build:app": "yarn bootstrap && yarn lerna run build --scope '{@packages/*,@apps/app-server,izabela-next}' --stream", "patch": "yarn patch-package", diff --git a/scripts/install-nodejs.ps1 b/scripts/install-nodejs.ps1 new file mode 100644 index 00000000..a7eb958c --- /dev/null +++ b/scripts/install-nodejs.ps1 @@ -0,0 +1,9 @@ +# install_nodejs.ps1 + +# Install Node.js +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +Invoke-WebRequest -OutFile nodejs.zip -UseBasicParsing "https://nodejs.org/dist/v16.20.2/node-v16.20.2-win-x64.zip" +Expand-Archive nodejs.zip -DestinationPath C:\ +Rename-Item "C:/node-v16.20.2-win-x64" C:\nodejs +Remove-Item nodejs.zip -Force +[System.Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';C:\nodejs\;C:\nodejs\node_modules\npm\bin', [System.EnvironmentVariableTarget]::Machine) diff --git a/scripts/install-python.ps1 b/scripts/install-python.ps1 new file mode 100644 index 00000000..ec74b95e --- /dev/null +++ b/scripts/install-python.ps1 @@ -0,0 +1,7 @@ +# install_python.ps1 + +# Install Python 3.10 +Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe" -OutFile python-installer.exe +Start-Process -Wait -FilePath python-installer.exe -ArgumentList "/quiet", "InstallAllUsers=1", "TargetDir=C:\Python310" +Remove-Item python-installer.exe -Force +[System.Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';C:\Python310;C:\Python310\Scripts', [System.EnvironmentVariableTarget]::Machine) diff --git a/scripts/install-vs-build-tools-win10.ps1 b/scripts/install-vs-build-tools-win10.ps1 new file mode 100644 index 00000000..36d2bcd6 --- /dev/null +++ b/scripts/install-vs-build-tools-win10.ps1 @@ -0,0 +1,8 @@ +# install_vs_build_tools.ps1 + +# Install Visual Studio Build Tools 2022 +Invoke-WebRequest -Uri "https://aka.ms/vs/17/release/vs_buildtools.exe" -OutFile vs_buildtools.exe +Start-Process -Wait -FilePath vs_buildtools.exe -ArgumentList "--quiet --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK --includeRecommended --includeOptional --nocache" +Remove-Item vs_buildtools.exe -Force + +# List of tools: https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022&preserve-view=true#desktop-development-with-c diff --git a/scripts/install-vs-build-tools.ps1 b/scripts/install-vs-build-tools.ps1 new file mode 100644 index 00000000..e91e8308 --- /dev/null +++ b/scripts/install-vs-build-tools.ps1 @@ -0,0 +1,8 @@ +# install_vs_build_tools.ps1 + +# Install Visual Studio Build Tools 2022 +Invoke-WebRequest -Uri "https://aka.ms/vs/17/release/vs_buildtools.exe" -OutFile vs_buildtools.exe +Start-Process -Wait -FilePath vs_buildtools.exe -ArgumentList "--quiet --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows11SDK.22000 --includeRecommended --includeOptional --nocache" +Remove-Item vs_buildtools.exe -Force + +# List of tools: https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022&preserve-view=true#desktop-development-with-c diff --git a/scripts/install-yarn.ps1 b/scripts/install-yarn.ps1 new file mode 100644 index 00000000..771d13d9 --- /dev/null +++ b/scripts/install-yarn.ps1 @@ -0,0 +1,6 @@ +# install_yarn.ps1 + +# Install Yarn +Invoke-WebRequest -Uri "https://yarnpkg.com/latest.msi" -OutFile yarn.msi +Start-Process -Wait -FilePath msiexec.exe -ArgumentList "/i", "yarn.msi", "/quiet" +Remove-Item yarn.msi -Force diff --git a/yarn.lock b/yarn.lock index 94db6700..cfc0460d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1978,6 +1978,21 @@ global-agent "^3.0.0" global-tunnel-ng "^2.7.1" +"@electron/get@^2.0.0": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@electron/get/-/get-2.0.3.tgz#fba552683d387aebd9f3fcadbcafc8e12ee4f960" + integrity sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ== + dependencies: + debug "^4.1.1" + env-paths "^2.2.0" + fs-extra "^8.1.0" + got "^11.8.5" + progress "^2.0.3" + semver "^6.2.0" + sumchecker "^3.0.1" + optionalDependencies: + global-agent "^3.0.0" + "@electron/universal@1.0.5": version "1.0.5" resolved "https://registry.yarnpkg.com/@electron/universal/-/universal-1.0.5.tgz#b812340e4ef21da2b3ee77b2b4d35c9b86defe37" @@ -9906,6 +9921,15 @@ electron@20.3.8: "@types/node" "^16.11.26" extract-zip "^2.0.1" +electron@22.3.25: + version "22.3.25" + resolved "https://registry.yarnpkg.com/electron/-/electron-22.3.25.tgz#a9a70b63a6712c658cd7fab343129b2a78450f80" + integrity sha512-AjrP7bebMs/IPsgmyowptbA7jycTkrJC7jLZTb5JoH30PkBC6pZx/7XQ0aDok82SsmSiF4UJDOg+HoLrEBiqmg== + dependencies: + "@electron/get" "^2.0.0" + "@types/node" "^16.11.26" + extract-zip "^2.0.1" + element-plus@^1.2.0-beta.6: version "1.2.0-beta.6" resolved "https://registry.yarnpkg.com/element-plus/-/element-plus-1.2.0-beta.6.tgz#9fa01a06950eb0380f0454cb75aefaaf5b81b043" @@ -12204,7 +12228,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -got@^11.7.0: +got@^11.7.0, got@^11.8.5: version "11.8.6" resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g== From f1d93d838aff6287d65ae1ee0cb7b0e2d54024f8 Mon Sep 17 00:00:00 2001 From: Wurielle Date: Sat, 23 Dec 2023 19:15:55 +0000 Subject: [PATCH 09/30] style: prettier formatting --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5e61892f..ae1ba84a 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ Find guides and API documentation on the [Wiki](https://github.com/nature-heart- ## Development The project requires the following in order to run: + - Node 16 - Yarn - Python 3.10 From ef0ffacc1798f82394f266e276410371f46e7276 Mon Sep 17 00:00:00 2001 From: Wurielle Date: Sat, 23 Dec 2023 21:25:22 +0100 Subject: [PATCH 10/30] fix: tray exit --- apps/app/src/electron/app.ts | 5 +++++ apps/app/src/teams/tray/electron-tray.ts | 4 ++-- package.json | 2 +- yarn.lock | 26 +++++++++++++++++++++++- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/apps/app/src/electron/app.ts b/apps/app/src/electron/app.ts index 3c15ccfd..27dad96c 100644 --- a/apps/app/src/electron/app.ts +++ b/apps/app/src/electron/app.ts @@ -72,6 +72,10 @@ const App = () => { } const onQuit = () => { + /* fixes app.quit(): https://stackoverflow.com/a/75369483 */ + ElectronWindowManager.getInstances().forEach(({window})=>{ + window.removeAllListeners() + }) destroyWinMouse() } @@ -111,6 +115,7 @@ const App = () => { handleQuit(true) } }) + ;['SIGINT', 'SIGTERM', 'SIGQUIT'].forEach((signal) => { process.on(signal, () => { handleQuit(true) diff --git a/apps/app/src/teams/tray/electron-tray.ts b/apps/app/src/teams/tray/electron-tray.ts index 829ca28c..08315e32 100644 --- a/apps/app/src/teams/tray/electron-tray.ts +++ b/apps/app/src/teams/tray/electron-tray.ts @@ -26,7 +26,7 @@ const createTray = (): Promise => { label: 'Display', submenu: allDisplays.map(({ id }) => ({ - label: `${(id === primaryDisplay.id && '(Primary) ') || ''}${id}`, + label: `${ (id === primaryDisplay.id && '(Primary) ') || '' }${ id }`, type: 'radio', checked: settingsStore.display !== null @@ -54,7 +54,7 @@ const createTray = (): Promise => tray.setContextMenu(getContextMenu()) } - tray.setToolTip(`${app.name} - v${app.getVersion()}`) + tray.setToolTip(`${ app.name } - v${ app.getVersion() }`) tray.setContextMenu(getContextMenu()) tray.on('click', electronMessengerWindow.show) updateContextMenu() diff --git a/package.json b/package.json index a9fbc26a..38415f37 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "install:deps": "yarn && yarn build:deps", "bootstrap": "yarn lerna bootstrap --no-ci", - "dev": "yarn bootstrap && yarn lerna run serve --scope izabela-next --stream", + "dev": "yarn lerna run serve --scope izabela-next --stream", "build": "yarn install && yarn bootstrap && yarn lerna run build", "build:deps": "yarn bootstrap && yarn lerna run build --scope '{@packages/*,@apps/app-server}' --stream", "build:app": "yarn bootstrap && yarn lerna run build --scope '{@packages/*,@apps/app-server,izabela-next}' --stream", diff --git a/yarn.lock b/yarn.lock index 94db6700..cfc0460d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1978,6 +1978,21 @@ global-agent "^3.0.0" global-tunnel-ng "^2.7.1" +"@electron/get@^2.0.0": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@electron/get/-/get-2.0.3.tgz#fba552683d387aebd9f3fcadbcafc8e12ee4f960" + integrity sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ== + dependencies: + debug "^4.1.1" + env-paths "^2.2.0" + fs-extra "^8.1.0" + got "^11.8.5" + progress "^2.0.3" + semver "^6.2.0" + sumchecker "^3.0.1" + optionalDependencies: + global-agent "^3.0.0" + "@electron/universal@1.0.5": version "1.0.5" resolved "https://registry.yarnpkg.com/@electron/universal/-/universal-1.0.5.tgz#b812340e4ef21da2b3ee77b2b4d35c9b86defe37" @@ -9906,6 +9921,15 @@ electron@20.3.8: "@types/node" "^16.11.26" extract-zip "^2.0.1" +electron@22.3.25: + version "22.3.25" + resolved "https://registry.yarnpkg.com/electron/-/electron-22.3.25.tgz#a9a70b63a6712c658cd7fab343129b2a78450f80" + integrity sha512-AjrP7bebMs/IPsgmyowptbA7jycTkrJC7jLZTb5JoH30PkBC6pZx/7XQ0aDok82SsmSiF4UJDOg+HoLrEBiqmg== + dependencies: + "@electron/get" "^2.0.0" + "@types/node" "^16.11.26" + extract-zip "^2.0.1" + element-plus@^1.2.0-beta.6: version "1.2.0-beta.6" resolved "https://registry.yarnpkg.com/element-plus/-/element-plus-1.2.0-beta.6.tgz#9fa01a06950eb0380f0454cb75aefaaf5b81b043" @@ -12204,7 +12228,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -got@^11.7.0: +got@^11.7.0, got@^11.8.5: version "11.8.6" resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g== From 56542410e867c2b69cd19611a742f076d6d77bab Mon Sep 17 00:00:00 2001 From: Wurielle Date: Sat, 23 Dec 2023 20:26:07 +0000 Subject: [PATCH 11/30] style: prettier formatting --- apps/app/src/electron/app.ts | 3 +-- apps/app/src/teams/tray/electron-tray.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/app/src/electron/app.ts b/apps/app/src/electron/app.ts index 27dad96c..85733cfb 100644 --- a/apps/app/src/electron/app.ts +++ b/apps/app/src/electron/app.ts @@ -73,7 +73,7 @@ const App = () => { const onQuit = () => { /* fixes app.quit(): https://stackoverflow.com/a/75369483 */ - ElectronWindowManager.getInstances().forEach(({window})=>{ + ElectronWindowManager.getInstances().forEach(({ window }) => { window.removeAllListeners() }) destroyWinMouse() @@ -115,7 +115,6 @@ const App = () => { handleQuit(true) } }) - ;['SIGINT', 'SIGTERM', 'SIGQUIT'].forEach((signal) => { process.on(signal, () => { handleQuit(true) diff --git a/apps/app/src/teams/tray/electron-tray.ts b/apps/app/src/teams/tray/electron-tray.ts index 08315e32..829ca28c 100644 --- a/apps/app/src/teams/tray/electron-tray.ts +++ b/apps/app/src/teams/tray/electron-tray.ts @@ -26,7 +26,7 @@ const createTray = (): Promise => { label: 'Display', submenu: allDisplays.map(({ id }) => ({ - label: `${ (id === primaryDisplay.id && '(Primary) ') || '' }${ id }`, + label: `${(id === primaryDisplay.id && '(Primary) ') || ''}${id}`, type: 'radio', checked: settingsStore.display !== null @@ -54,7 +54,7 @@ const createTray = (): Promise => tray.setContextMenu(getContextMenu()) } - tray.setToolTip(`${ app.name } - v${ app.getVersion() }`) + tray.setToolTip(`${app.name} - v${app.getVersion()}`) tray.setContextMenu(getContextMenu()) tray.on('click', electronMessengerWindow.show) updateContextMenu() From 80181b5d52028d1984bf61eaba1d4670edc52d73 Mon Sep 17 00:00:00 2001 From: Wurielle Date: Sat, 23 Dec 2023 22:48:16 +0100 Subject: [PATCH 12/30] feat: add style and speaker boost --- apps/app-server/src/plugins/speech-apis/el.ts | 4 +- .../speech-engines/elevenlabs/NvSettings.vue | 38 ++++++++++++++++++- .../speech-engines/elevenlabs/register.ts | 2 + .../speech-engines/elevenlabs/store.ts | 4 +- 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/apps/app-server/src/plugins/speech-apis/el.ts b/apps/app-server/src/plugins/speech-apis/el.ts index 3b940fb6..78eeb544 100644 --- a/apps/app-server/src/plugins/speech-apis/el.ts +++ b/apps/app-server/src/plugins/speech-apis/el.ts @@ -34,7 +34,7 @@ const plugin: Izabela.Server.Plugin = ({ app }) => { { body: { credentials: { apiKey }, - payload: { text, voice, stability, similarity_boost }, + payload: { text, voice, stability, similarity_boost, use_speaker_boost, style }, }, }, res, @@ -43,6 +43,8 @@ const plugin: Izabela.Server.Plugin = ({ app }) => { const settings = { stability, similarity_boost, + use_speaker_boost, + style, } const hashedSettings = hash({ ...settings, voice_id: voice.voice_id }) if (settingsCache !== hashedSettings) { diff --git a/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue b/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue index 7116cc55..13d1e6b0 100644 --- a/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue +++ b/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue @@ -29,7 +29,7 @@ - + + + + + + + + + + + + Speaker Boost + + + @@ -75,7 +109,7 @@ import { NvInput, NvNumberInput, NvRangeInput, - NvStack, + NvStack, NvSwitch, NvText, } from '@packages/ui' import NvVoiceSelect from './NvVoiceSelect' import { getProperty, setProperty } from './store' diff --git a/apps/app/src/plugins/speech-engines/elevenlabs/register.ts b/apps/app/src/plugins/speech-engines/elevenlabs/register.ts index f954489f..92432179 100644 --- a/apps/app/src/plugins/speech-engines/elevenlabs/register.ts +++ b/apps/app/src/plugins/speech-engines/elevenlabs/register.ts @@ -27,6 +27,8 @@ registerEngine({ voice, stability: getProperty('stability'), similarity_boost: getProperty('similarity_boost'), + style: getProperty('style'), + use_speaker_boost: getProperty('use_speaker_boost'), } }, getLanguageCode() { diff --git a/apps/app/src/plugins/speech-engines/elevenlabs/store.ts b/apps/app/src/plugins/speech-engines/elevenlabs/store.ts index 46c7e7b8..78a08fa9 100644 --- a/apps/app/src/plugins/speech-engines/elevenlabs/store.ts +++ b/apps/app/src/plugins/speech-engines/elevenlabs/store.ts @@ -13,6 +13,8 @@ export const { setProperty, getProperty } = definePluginStore(ENGINE_ID, { available_for_tiers: [], settings: null, }, - stability: 0.75, + stability: 0.5, similarity_boost: 0.75, + style: 0, + use_speaker_boost: true, }) From eab9614d7494b0e97dc8738d5eeb752d642f3ddc Mon Sep 17 00:00:00 2001 From: Wurielle Date: Sat, 23 Dec 2023 21:48:53 +0000 Subject: [PATCH 13/30] style: prettier formatting --- apps/app-server/src/plugins/speech-apis/el.ts | 9 ++++++++- .../speech-engines/elevenlabs/NvSettings.vue | 15 +++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apps/app-server/src/plugins/speech-apis/el.ts b/apps/app-server/src/plugins/speech-apis/el.ts index 78eeb544..29b855c1 100644 --- a/apps/app-server/src/plugins/speech-apis/el.ts +++ b/apps/app-server/src/plugins/speech-apis/el.ts @@ -34,7 +34,14 @@ const plugin: Izabela.Server.Plugin = ({ app }) => { { body: { credentials: { apiKey }, - payload: { text, voice, stability, similarity_boost, use_speaker_boost, style }, + payload: { + text, + voice, + stability, + similarity_boost, + use_speaker_boost, + style, + }, }, }, res, diff --git a/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue b/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue index 13d1e6b0..c149cd52 100644 --- a/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue +++ b/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue @@ -2,9 +2,9 @@ - + - + - + - + +import { getProperty, setProperty } from './store' + From 1d8cd4ea81bd03946e0e93fed2ee873a200037a8 Mon Sep 17 00:00:00 2001 From: Wurielle Date: Sat, 23 Dec 2023 23:43:28 +0100 Subject: [PATCH 14/30] feat: add model select --- apps/app-server/src/plugins/speech-apis/el.ts | 40 +++++++++++------- .../elevenlabs/NvModelSelect.vue | 41 +++++++++++++++++++ .../speech-engines/elevenlabs/NvSettings.vue | 7 +++- .../speech-engines/elevenlabs/hooks.ts | 15 ++++++- .../speech-engines/elevenlabs/register.ts | 1 + .../speech-engines/elevenlabs/shared.ts | 1 + .../speech-engines/elevenlabs/store.ts | 1 + 7 files changed, 90 insertions(+), 16 deletions(-) create mode 100644 apps/app/src/plugins/speech-engines/elevenlabs/NvModelSelect.vue diff --git a/apps/app-server/src/plugins/speech-apis/el.ts b/apps/app-server/src/plugins/speech-apis/el.ts index 78eeb544..bec01565 100644 --- a/apps/app-server/src/plugins/speech-apis/el.ts +++ b/apps/app-server/src/plugins/speech-apis/el.ts @@ -1,13 +1,11 @@ import { RequestHandler } from 'express' import axios from 'axios' import { handleError } from '../../utils/requests' -import hash from 'object-hash' const plugin: Izabela.Server.Plugin = ({ app }) => { const api = axios.create({ baseURL: 'https://api.elevenlabs.io/v1', }) - let settingsCache: string = '' const listVoicesHandler: RequestHandler = async ( { body: { @@ -30,34 +28,47 @@ const plugin: Izabela.Server.Plugin = ({ app }) => { } } + const listModelsHandler: RequestHandler = async ( + { + body: { + credentials: { apiKey }, + }, + }, + res, + ) => { + try { + const { + data: models, + } = await api.get('/models', { + headers: { + 'xi-api-key': apiKey, + }, + }) + res.status(200).json(models) + } catch (e: any) { + handleError(res, 'Internal server error', e.message, 500) + } + } + const synthesizeSpeechHandler: RequestHandler = async ( { body: { credentials: { apiKey }, - payload: { text, voice, stability, similarity_boost, use_speaker_boost, style }, + payload: { text, voice, stability, similarity_boost, use_speaker_boost, style, model_id }, }, }, res, ) => { try { - const settings = { + const voice_settings = { stability, similarity_boost, use_speaker_boost, style, } - const hashedSettings = hash({ ...settings, voice_id: voice.voice_id }) - if (settingsCache !== hashedSettings) { - await api.post(`/voices/${voice.voice_id}/settings/edit`, settings, { - headers: { - 'xi-api-key': apiKey, - }, - }) - settingsCache = hashedSettings - } const { data } = await api.post( `/text-to-speech/${voice.voice_id}/stream`, - { text }, + { model_id, text, voice_settings }, { headers: { 'xi-api-key': apiKey, @@ -75,6 +86,7 @@ const plugin: Izabela.Server.Plugin = ({ app }) => { } } app.post('/api/tts/elevenlabs/list-voices', listVoicesHandler) + app.post('/api/tts/elevenlabs/list-models', listModelsHandler) app.post('/api/tts/elevenlabs/synthesize-speech', synthesizeSpeechHandler) } diff --git a/apps/app/src/plugins/speech-engines/elevenlabs/NvModelSelect.vue b/apps/app/src/plugins/speech-engines/elevenlabs/NvModelSelect.vue new file mode 100644 index 00000000..41336144 --- /dev/null +++ b/apps/app/src/plugins/speech-engines/elevenlabs/NvModelSelect.vue @@ -0,0 +1,41 @@ + + diff --git a/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue b/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue index 13d1e6b0..b6a8b1f4 100644 --- a/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue +++ b/apps/app/src/plugins/speech-engines/elevenlabs/NvSettings.vue @@ -1,6 +1,9 @@ diff --git a/apps/app/src/teams/messenger/components/NvMessengerMessageBar.vue b/apps/app/src/teams/messenger/components/NvMessengerMessageBar.vue index 85590912..4a5ecbcb 100644 --- a/apps/app/src/teams/messenger/components/NvMessengerMessageBar.vue +++ b/apps/app/src/teams/messenger/components/NvMessengerMessageBar.vue @@ -101,9 +101,9 @@ diff --git a/packages/ui/src/components/forms/Button/button.shared.ts b/packages/ui/src/components/forms/Button/button.shared.ts index aa0c909d..71a34426 100644 --- a/packages/ui/src/components/forms/Button/button.shared.ts +++ b/packages/ui/src/components/forms/Button/button.shared.ts @@ -4,7 +4,7 @@ import { sizeValues as defaultSizeValues } from '@/utils/css-in-js' export const sizeValues = ['xs', ...defaultSizeValues] as const export type Size = typeof sizeValues[number] -export const typeValues = ['default', 'plain', 'ghost', 'ghost-alt'] as const +export const typeValues = ['default', 'plain', 'ghost', 'ghost-alt', 'active'] as const export type Type = typeof typeValues[number] export const props = { diff --git a/packages/ui/src/components/forms/Button/button.styled.ts b/packages/ui/src/components/forms/Button/button.styled.ts index 945e08d0..e14c5000 100644 --- a/packages/ui/src/components/forms/Button/button.styled.ts +++ b/packages/ui/src/components/forms/Button/button.styled.ts @@ -114,6 +114,29 @@ export const StButton = styled('button', props)` `, ].filter(Boolean)} `, + type === 'active' && + ` + background-color: ${colors.white}; + border-color: ${colors.gray['100']}; + &:hover { + background-color: ${colors.gray['10']}; + } + + &:active { + background-color: ${colors.gray['30']}; + } + + &:focus { + box-shadow: 0 0 0 ${rem(borderWidth.lg)} ${colors.gray['10']}; + } + + ${[ + selected && + ` + background-color: ${colors.gray['20']}; + `, + ].filter(Boolean)} + `, type === 'plain' && ` color: ${colors.white}; diff --git a/packages/ui/vite.config.cjs b/packages/ui/vite.config.cjs index 8dd4ccde..54bfa7f3 100644 --- a/packages/ui/vite.config.cjs +++ b/packages/ui/vite.config.cjs @@ -62,6 +62,7 @@ var _default = (0, _vite.defineConfig)({ } }, build: { + emptyOutDir: false, lib: { entry: (0, _path.resolve)(__dirname, 'src/main.ts'), name: 'main', diff --git a/packages/ui/vite.config.ts b/packages/ui/vite.config.ts index d3ca0b4c..9d040174 100644 --- a/packages/ui/vite.config.ts +++ b/packages/ui/vite.config.ts @@ -69,6 +69,7 @@ export default defineConfig({ }, }, build: { + emptyOutDir: false, lib: { entry: resolve(__dirname, 'src/main.ts'), name: 'main', From 94d82c142cb9f786c41e2633b0c8e0f8b17f90a8 Mon Sep 17 00:00:00 2001 From: Wurielle Date: Sun, 24 Dec 2023 08:54:06 +0000 Subject: [PATCH 19/30] style: prettier formatting --- .../components/NvMessengerAudioBar.vue | 10 +++- .../components/NvMessengerMessageBar.vue | 52 ++++++++++--------- .../components/forms/Button/button.shared.ts | 12 +++-- .../components/forms/Button/button.styled.ts | 6 +-- 4 files changed, 48 insertions(+), 32 deletions(-) diff --git a/apps/app/src/teams/messenger/components/NvMessengerAudioBar.vue b/apps/app/src/teams/messenger/components/NvMessengerAudioBar.vue index cbaa8a0e..fc473055 100644 --- a/apps/app/src/teams/messenger/components/NvMessengerAudioBar.vue +++ b/apps/app/src/teams/messenger/components/NvMessengerAudioBar.vue @@ -123,9 +123,15 @@ diff --git a/apps/app/src/plugins/speech-engines/sam/register.ts b/apps/app/src/plugins/speech-engines/sam/register.ts index a6910bbd..de773621 100644 --- a/apps/app/src/plugins/speech-engines/sam/register.ts +++ b/apps/app/src/plugins/speech-engines/sam/register.ts @@ -46,7 +46,7 @@ const getSelectedVoice = () => { registerEngine({ id: ENGINE_ID, name: ENGINE_NAME, - category: 'Local', + category: 'local', getSelectedVoice, getVoiceName, getCredentials() { diff --git a/apps/app/src/plugins/speech-engines/sam/shared.ts b/apps/app/src/plugins/speech-engines/sam/shared.ts index c548fe0c..a1f57b94 100644 --- a/apps/app/src/plugins/speech-engines/sam/shared.ts +++ b/apps/app/src/plugins/speech-engines/sam/shared.ts @@ -2,7 +2,8 @@ export const ENGINE_ID = 'samtts' as const export const ENGINE_NAME = 'Sam' as const export const getVoiceName = (voice: any) => voice.name - +export const getVoiceId = (voice: any) => voice.name +export const getVoiceCategory = (voice: any) => 'Other' export const defaultVoice = { name: 'Default', speed: 72, diff --git a/apps/app/src/plugins/speech-engines/sam/store.ts b/apps/app/src/plugins/speech-engines/sam/store.ts index 79f959b4..ab89d0eb 100644 --- a/apps/app/src/plugins/speech-engines/sam/store.ts +++ b/apps/app/src/plugins/speech-engines/sam/store.ts @@ -9,4 +9,5 @@ export const { setProperty, getProperty } = definePluginStore(ENGINE_ID, { speech: 64, throat: 128, mouth: 128, + favoriteVoiceIds: [], }) diff --git a/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue index a63ce88f..b06e36dc 100644 --- a/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue @@ -7,23 +7,53 @@ 'onUpdate:modelValue': (value) => setProperty('selectedVoice', value), ...$attrs, }" - /> + > + + diff --git a/apps/app/src/plugins/speech-engines/say/register.ts b/apps/app/src/plugins/speech-engines/say/register.ts index a66b4feb..b2f1190d 100644 --- a/apps/app/src/plugins/speech-engines/say/register.ts +++ b/apps/app/src/plugins/speech-engines/say/register.ts @@ -10,7 +10,7 @@ const getSelectedVoice = () => getProperty('selectedVoice') registerEngine({ id: ENGINE_ID, name: ENGINE_NAME, - category: 'Local', + category: 'local', getSelectedVoice, getVoiceName, getCredentials() { diff --git a/apps/app/src/plugins/speech-engines/say/shared.ts b/apps/app/src/plugins/speech-engines/say/shared.ts index 42015503..471dbee6 100644 --- a/apps/app/src/plugins/speech-engines/say/shared.ts +++ b/apps/app/src/plugins/speech-engines/say/shared.ts @@ -3,3 +3,5 @@ export const ENGINE_NAME = 'Say' as const export const LIST_VOICES_QUERY_KEY = 'saytts-list-voices' as const export const getVoiceName = (voice: any) => voice || 'Default' +export const getVoiceId = (voice: any) => voice +export const getVoiceCategory = (voice: any) => 'Other' diff --git a/apps/app/src/plugins/speech-engines/say/store.ts b/apps/app/src/plugins/speech-engines/say/store.ts index 7e2c5666..b4ec6033 100644 --- a/apps/app/src/plugins/speech-engines/say/store.ts +++ b/apps/app/src/plugins/speech-engines/say/store.ts @@ -3,4 +3,5 @@ import { ENGINE_ID } from './shared' export const { setProperty, getProperty } = definePluginStore(ENGINE_ID, { selectedVoice: null, + favoriteVoiceIds: [], }) diff --git a/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue index 43906938..f61fbafa 100644 --- a/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue @@ -8,18 +8,25 @@ ...$attrs, }" valueKey="voicemodel_uuid" - /> + > + + diff --git a/apps/app/src/plugins/speech-engines/animalese/register.ts b/apps/app/src/plugins/speech-engines/animalese/register.ts index 9238758d..b7373b09 100644 --- a/apps/app/src/plugins/speech-engines/animalese/register.ts +++ b/apps/app/src/plugins/speech-engines/animalese/register.ts @@ -29,10 +29,10 @@ const getSelectedVoice = () => { const voice = getProperty('selectedVoice') return voice.name === 'Custom' ? { - ...voice, - pitch: getProperty('pitch'), - shortened: getProperty('shortened'), - } + ...voice, + pitch: getProperty('pitch'), + shortened: getProperty('shortened'), + } : voice } registerEngine({ diff --git a/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue index 7cb7e2a6..ce0c710b 100644 --- a/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue @@ -9,11 +9,16 @@ }" valueKey="name" > - @@ -49,20 +54,21 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) watch( diff --git a/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue index 81c5983b..f94f3ac7 100644 --- a/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue @@ -9,11 +9,16 @@ }" valueKey="voice_id" > - @@ -28,7 +33,6 @@ import { useListVoicesQuery } from './hooks' import { getVoiceCategory, getVoiceId, getVoiceName, LIST_VOICES_QUERY_KEY } from './shared' import { getProperty, setProperty } from './store' - const queryClient = useQueryClient() const computedParams = computed(() => ({ credentials: { @@ -48,20 +52,21 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) watch( diff --git a/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue index 1b99b584..d64bb21b 100644 --- a/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue @@ -9,11 +9,16 @@ }" valueKey="name" > - @@ -29,7 +34,6 @@ import { useListVoicesQuery } from './hooks' import { getVoiceCategory, getVoiceId, getVoiceName, LIST_VOICES_QUERY_KEY } from './shared' import { getProperty, setProperty } from './store' - const queryClient = useQueryClient() const computedParams = computed(() => ({ credentials: { @@ -54,20 +58,21 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) watch( diff --git a/apps/app/src/plugins/speech-engines/google-cloud/shared.ts b/apps/app/src/plugins/speech-engines/google-cloud/shared.ts index 2ecae693..aa00ce43 100644 --- a/apps/app/src/plugins/speech-engines/google-cloud/shared.ts +++ b/apps/app/src/plugins/speech-engines/google-cloud/shared.ts @@ -1,6 +1,6 @@ export const ENGINE_ID = 'gctts' as const export const ENGINE_NAME = 'Google Cloud' as const export const LIST_VOICES_QUERY_KEY = 'gctts-list-voices' as const -export const getVoiceName = (voice: any) => `${ voice.name } - ${ voice.ssmlGender }` +export const getVoiceName = (voice: any) => `${voice.name} - ${voice.ssmlGender}` export const getVoiceId = (voice: any) => voice.name export const getVoiceCategory = (voice: any) => 'Other' diff --git a/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue index 200edadb..7536b24b 100644 --- a/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue @@ -9,11 +9,16 @@ }" valueKey="name" > - @@ -29,7 +34,6 @@ import { useListVoicesQuery } from './hooks' import { getVoiceCategory, getVoiceId, getVoiceName, LIST_VOICES_QUERY_KEY } from './shared' import { getProperty, setProperty } from './store' - const queryClient = useQueryClient() const computedParams = computed(() => ({ @@ -56,20 +60,21 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) watch( diff --git a/apps/app/src/plugins/speech-engines/ibm-watson/shared.ts b/apps/app/src/plugins/speech-engines/ibm-watson/shared.ts index afc902fb..49688cee 100644 --- a/apps/app/src/plugins/speech-engines/ibm-watson/shared.ts +++ b/apps/app/src/plugins/speech-engines/ibm-watson/shared.ts @@ -1,6 +1,6 @@ export const ENGINE_ID = 'iwtts' as const export const ENGINE_NAME = 'IBM Watson' as const export const LIST_VOICES_QUERY_KEY = 'iwtts-list-voices' as const -export const getVoiceName = (voice: any) => `${ voice.name } - ${ voice.gender }` +export const getVoiceName = (voice: any) => `${voice.name} - ${voice.gender}` export const getVoiceId = (voice: any) => voice.name export const getVoiceCategory = (voice: any) => 'Other' diff --git a/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue index c0d01eb0..83db23f3 100644 --- a/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue @@ -9,11 +9,16 @@ }" valueKey="name" > - @@ -39,13 +44,18 @@ const canFetch = computed(() => speechStore.hasUniversalApiCredentials) const { data, isFetching } = useListVoicesQuery(computedParams, { enabled: canFetch, }) -const voices = computed(() => [ - { - id: null, - label: 'Default', - value: null, - category: 'Default', - }, ...data.value] || []) +const voices = computed( + () => + [ + { + id: null, + label: 'Default', + value: null, + category: 'Default', + }, + ...data.value, + ] || [], +) const getOptionFromVoice = (voice: any) => ({ id: getVoiceId(voice), label: getVoiceName(voice), @@ -54,20 +64,21 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) watch( diff --git a/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue index 674400d6..d600bea6 100644 --- a/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue @@ -9,11 +9,16 @@ }" valueKey="Name" > - @@ -29,7 +34,6 @@ import { useListVoicesQuery } from './hooks' import { getVoiceCategory, getVoiceId, getVoiceName, LIST_VOICES_QUERY_KEY } from './shared' import { getProperty, setProperty } from './store' - const queryClient = useQueryClient() const computedParams = computed(() => ({ @@ -56,20 +60,21 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) watch( diff --git a/apps/app/src/plugins/speech-engines/microsoft-azure/shared.ts b/apps/app/src/plugins/speech-engines/microsoft-azure/shared.ts index 10fb5c00..6dfe2abd 100644 --- a/apps/app/src/plugins/speech-engines/microsoft-azure/shared.ts +++ b/apps/app/src/plugins/speech-engines/microsoft-azure/shared.ts @@ -1,6 +1,6 @@ export const ENGINE_ID = 'matts' as const export const ENGINE_NAME = 'Microsoft Azure' as const export const LIST_VOICES_QUERY_KEY = 'matts-list-voices' as const -export const getVoiceName = (voice: any) => `${ voice.Locale } ${ voice.DisplayName } - ${ voice.Gender }` +export const getVoiceName = (voice: any) => `${voice.Locale} ${voice.DisplayName} - ${voice.Gender}` export const getVoiceId = (voice: any) => voice.Name export const getVoiceCategory = (voice: any) => voice.LocaleName diff --git a/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue index 510bd95c..a4f9c936 100644 --- a/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue @@ -8,11 +8,16 @@ }" valueKey="name" > - @@ -24,11 +29,9 @@ import { groupOptions } from '@/utils/select' import { getProperty, setProperty } from './store' import { getVoiceCategory, getVoiceId, getVoiceName, voices as defaultVoices } from './shared' - const voices = computed(() => [ { name: 'Custom', - }, ...defaultVoices, ]) @@ -40,20 +43,21 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) diff --git a/apps/app/src/plugins/speech-engines/sam/register.ts b/apps/app/src/plugins/speech-engines/sam/register.ts index de773621..03527500 100644 --- a/apps/app/src/plugins/speech-engines/sam/register.ts +++ b/apps/app/src/plugins/speech-engines/sam/register.ts @@ -35,12 +35,12 @@ const getSelectedVoice = () => { const voice = getProperty('selectedVoice') return voice.name === 'Custom' ? { - ...voice, - speed: getProperty('speed'), - speech: getProperty('speech'), - throat: getProperty('throat'), - mouth: getProperty('mouth'), - } + ...voice, + speed: getProperty('speed'), + speech: getProperty('speech'), + throat: getProperty('throat'), + mouth: getProperty('mouth'), + } : voice } registerEngine({ @@ -66,20 +66,20 @@ registerEngine({ const sam = new SamJs(payload.voice) const audioBuffer = sam.buf8(payload.text) const realBuffer = new Uint8Array( - 4+ // "RIFF" - 4+ // uint32 filesize - 4+ // "WAVE" - 4+ // "fmt " - 4+ // uint32 fmt length - 2+ // uint16 fmt - 2+ // uint16 channels - 4+ // uint32 sample rate - 4+ // uint32 bytes per second - 2+ // uint16 block align - 2+ // uint16 bits per sample - 4+ // "data" - 4+ // uint32 chunk length - audioBuffer.length, + 4 + // "RIFF" + 4 + // uint32 filesize + 4 + // "WAVE" + 4 + // "fmt " + 4 + // uint32 fmt length + 2 + // uint16 fmt + 2 + // uint16 channels + 4 + // uint32 sample rate + 4 + // uint32 bytes per second + 2 + // uint16 block align + 2 + // uint16 bits per sample + 4 + // "data" + 4 + // uint32 chunk length + audioBuffer.length, ) let pos = 0 @@ -90,7 +90,7 @@ registerEngine({ write(text2Uint8Array('RIFF')) // chunkID - write(Uint32ToUint8Array(audioBuffer.length+12+16+8-8)) // ChunkSize + write(Uint32ToUint8Array(audioBuffer.length + 12 + 16 + 8 - 8)) // ChunkSize write(text2Uint8Array('WAVE')) // riffType // format chunk diff --git a/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue index b06e36dc..1c7597b1 100644 --- a/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue @@ -8,11 +8,16 @@ ...$attrs, }" > - @@ -36,24 +41,24 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = [ - { id: null, label: 'Default', value: null, category: 'Default' }, - ...groupOptions(voices.value.map(getOptionFromVoice), 'category'), - ] - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = [ + { id: null, label: 'Default', value: null, category: 'Default' }, + ...groupOptions(voices.value.map(getOptionFromVoice), 'category'), + ] + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) - diff --git a/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue index f61fbafa..f5a2a6d8 100644 --- a/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue @@ -9,11 +9,16 @@ }" valueKey="voicemodel_uuid" > - @@ -55,20 +60,21 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) diff --git a/apps/app/src/plugins/speech-engines/uberduck/shared.ts b/apps/app/src/plugins/speech-engines/uberduck/shared.ts index 0e0d5211..f562d5b3 100644 --- a/apps/app/src/plugins/speech-engines/uberduck/shared.ts +++ b/apps/app/src/plugins/speech-engines/uberduck/shared.ts @@ -2,6 +2,6 @@ export const ENGINE_ID = 'uberduck' as const export const ENGINE_NAME = 'Uberduck' as const export const LIST_VOICES_QUERY_KEY = 'uberduck-list-voices' as const -export const getVoiceName = (voice: any) => `${ voice.display_name }` +export const getVoiceName = (voice: any) => `${voice.display_name}` export const getVoiceId = (voice: any) => voice.voicemodel_uuid export const getVoiceCategory = (voice: any) => voice.category || 'Other' From 397f082969b12c64ba39c23a96861a6f8631f102 Mon Sep 17 00:00:00 2001 From: Wurielle Date: Tue, 26 Dec 2023 00:05:41 +0100 Subject: [PATCH 26/30] fix: fix option selection in some cases --- .../speech-engines/animalese/NvVoiceSelect.vue | 1 - .../src/plugins/speech-engines/animalese/shared.ts | 2 +- .../app/src/plugins/speech-engines/custom/shared.ts | 2 +- .../plugins/speech-engines/google-cloud/shared.ts | 2 +- .../src/plugins/speech-engines/ibm-watson/shared.ts | 2 +- .../speech-engines/izabela/NvVoiceSelect.vue | 10 +++++----- .../plugins/speech-engines/sam/NvVoiceSelect.vue | 2 +- apps/app/src/plugins/speech-engines/sam/shared.ts | 2 +- .../plugins/speech-engines/say/NvVoiceSelect.vue | 13 +++++-------- apps/app/src/plugins/speech-engines/say/shared.ts | 2 +- .../src/plugins/speech-engines/uberduck/shared.ts | 2 +- 11 files changed, 18 insertions(+), 22 deletions(-) diff --git a/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue index b08aa53b..3a910eb9 100644 --- a/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue @@ -27,7 +27,6 @@ import { defaultVoice, getVoiceCategory, getVoiceId, getVoiceName } from './shar const voices = computed(() => [{ ...defaultVoice, - category: 'Default', }, { name: 'Custom', diff --git a/apps/app/src/plugins/speech-engines/animalese/shared.ts b/apps/app/src/plugins/speech-engines/animalese/shared.ts index 8ffdc0b9..53990311 100644 --- a/apps/app/src/plugins/speech-engines/animalese/shared.ts +++ b/apps/app/src/plugins/speech-engines/animalese/shared.ts @@ -3,7 +3,7 @@ export const ENGINE_NAME = 'Animalese' as const export const getVoiceName = (voice: any) => voice.name export const getVoiceId = (voice: any) => voice.name -export const getVoiceCategory = (voice: any) => voice.category || 'Other' +export const getVoiceCategory = (voice: any) => voice.category || 'General' export const defaultVoice = { name: 'Default', pitch: 1, diff --git a/apps/app/src/plugins/speech-engines/custom/shared.ts b/apps/app/src/plugins/speech-engines/custom/shared.ts index debc0575..5c3b4537 100644 --- a/apps/app/src/plugins/speech-engines/custom/shared.ts +++ b/apps/app/src/plugins/speech-engines/custom/shared.ts @@ -3,4 +3,4 @@ export const ENGINE_NAME = 'Custom' as const export const LIST_VOICES_QUERY_KEY = 'customtts-list-voices' as const export const getVoiceName = (voice: any) => voice?.name || 'None' export const getVoiceId = (voice: any) => voice.name -export const getVoiceCategory = (voice: any) => voice.category || 'Other' +export const getVoiceCategory = (voice: any) => voice.category || 'General' diff --git a/apps/app/src/plugins/speech-engines/google-cloud/shared.ts b/apps/app/src/plugins/speech-engines/google-cloud/shared.ts index 2ecae693..3f03aa2c 100644 --- a/apps/app/src/plugins/speech-engines/google-cloud/shared.ts +++ b/apps/app/src/plugins/speech-engines/google-cloud/shared.ts @@ -3,4 +3,4 @@ export const ENGINE_NAME = 'Google Cloud' as const export const LIST_VOICES_QUERY_KEY = 'gctts-list-voices' as const export const getVoiceName = (voice: any) => `${ voice.name } - ${ voice.ssmlGender }` export const getVoiceId = (voice: any) => voice.name -export const getVoiceCategory = (voice: any) => 'Other' +export const getVoiceCategory = (voice: any) => 'General' diff --git a/apps/app/src/plugins/speech-engines/ibm-watson/shared.ts b/apps/app/src/plugins/speech-engines/ibm-watson/shared.ts index afc902fb..71dc6a2c 100644 --- a/apps/app/src/plugins/speech-engines/ibm-watson/shared.ts +++ b/apps/app/src/plugins/speech-engines/ibm-watson/shared.ts @@ -3,4 +3,4 @@ export const ENGINE_NAME = 'IBM Watson' as const export const LIST_VOICES_QUERY_KEY = 'iwtts-list-voices' as const export const getVoiceName = (voice: any) => `${ voice.name } - ${ voice.gender }` export const getVoiceId = (voice: any) => voice.name -export const getVoiceCategory = (voice: any) => 'Other' +export const getVoiceCategory = (voice: any) => 'General' diff --git a/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue index c0d01eb0..f1388894 100644 --- a/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue @@ -41,15 +41,15 @@ const { data, isFetching } = useListVoicesQuery(computedParams, { }) const voices = computed(() => [ { - id: null, - label: 'Default', + id: 'Default', + name: 'Default', value: null, - category: 'Default', - }, ...data.value] || []) + category: 'General', + }, ...(data.value || [])]) const getOptionFromVoice = (voice: any) => ({ id: getVoiceId(voice), label: getVoiceName(voice), - value: voice, + value: voice.name === 'Default' ? null : voice, category: getVoiceCategory(voice), }) diff --git a/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue index 510bd95c..301b5db0 100644 --- a/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue @@ -21,6 +21,7 @@ import { computed } from 'vue' import { NvButton, NvSelect } from '@packages/ui' import { xor } from 'lodash' import { groupOptions } from '@/utils/select' +import { purify } from '@packages/toolbox' import { getProperty, setProperty } from './store' import { getVoiceCategory, getVoiceId, getVoiceName, voices as defaultVoices } from './shared' @@ -28,7 +29,6 @@ import { getVoiceCategory, getVoiceId, getVoiceName, voices as defaultVoices } f const voices = computed(() => [ { name: 'Custom', - }, ...defaultVoices, ]) diff --git a/apps/app/src/plugins/speech-engines/sam/shared.ts b/apps/app/src/plugins/speech-engines/sam/shared.ts index a1f57b94..d4f0bb5e 100644 --- a/apps/app/src/plugins/speech-engines/sam/shared.ts +++ b/apps/app/src/plugins/speech-engines/sam/shared.ts @@ -3,7 +3,7 @@ export const ENGINE_NAME = 'Sam' as const export const getVoiceName = (voice: any) => voice.name export const getVoiceId = (voice: any) => voice.name -export const getVoiceCategory = (voice: any) => 'Other' +export const getVoiceCategory = (voice: any) => 'General' export const defaultVoice = { name: 'Default', speed: 72, diff --git a/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue index b06e36dc..8b18cecf 100644 --- a/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue @@ -20,26 +20,23 @@ import { computed } from 'vue' import { NvButton, NvSelect } from '@packages/ui' import { sortBy, xor } from 'lodash' -import { getVoiceCategory, getVoiceId, getVoiceName } from '@/plugins/speech-engines/say/shared' - import { groupOptions } from '@/utils/select' +import { getVoiceCategory, getVoiceId, getVoiceName } from './shared' + import { useListVoicesQuery } from './hooks' import { getProperty, setProperty } from './store' const { data, isFetching } = useListVoicesQuery() -const voices = computed(() => sortBy(data.value || [])) +const voices = computed(() => sortBy(['Default', ...(data.value || [])])) const getOptionFromVoice = (voice: any) => ({ id: getVoiceId(voice), label: getVoiceName(voice), - value: voice, + value: voice === 'Default' ? null : voice, category: getVoiceCategory(voice), }) const options = computed(() => { - const localOptions = [ - { id: null, label: 'Default', value: null, category: 'Default' }, - ...groupOptions(voices.value.map(getOptionFromVoice), 'category'), - ] + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') const favoriteVoiceIds = getProperty('favoriteVoiceIds') if (favoriteVoiceIds) { const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) diff --git a/apps/app/src/plugins/speech-engines/say/shared.ts b/apps/app/src/plugins/speech-engines/say/shared.ts index 471dbee6..e7232108 100644 --- a/apps/app/src/plugins/speech-engines/say/shared.ts +++ b/apps/app/src/plugins/speech-engines/say/shared.ts @@ -4,4 +4,4 @@ export const LIST_VOICES_QUERY_KEY = 'saytts-list-voices' as const export const getVoiceName = (voice: any) => voice || 'Default' export const getVoiceId = (voice: any) => voice -export const getVoiceCategory = (voice: any) => 'Other' +export const getVoiceCategory = (voice: any) => 'General' diff --git a/apps/app/src/plugins/speech-engines/uberduck/shared.ts b/apps/app/src/plugins/speech-engines/uberduck/shared.ts index 0e0d5211..5188ad6c 100644 --- a/apps/app/src/plugins/speech-engines/uberduck/shared.ts +++ b/apps/app/src/plugins/speech-engines/uberduck/shared.ts @@ -4,4 +4,4 @@ export const LIST_VOICES_QUERY_KEY = 'uberduck-list-voices' as const export const getVoiceName = (voice: any) => `${ voice.display_name }` export const getVoiceId = (voice: any) => voice.voicemodel_uuid -export const getVoiceCategory = (voice: any) => voice.category || 'Other' +export const getVoiceCategory = (voice: any) => voice.category || 'General' From 0436478b490aa297d17324a375e029f53c6415f8 Mon Sep 17 00:00:00 2001 From: Wurielle Date: Tue, 26 Dec 2023 20:05:25 +0100 Subject: [PATCH 27/30] feat: improve visual clarity --- .../amazon-polly/NvVoiceSelect.vue | 20 ++++---- .../animalese/NvVoiceSelect.vue | 15 ++++-- .../speech-engines/custom/NvVoiceSelect.vue | 20 ++++---- .../elevenlabs/NvVoiceSelect.vue | 20 ++++---- .../google-cloud/NvVoiceSelect.vue | 20 ++++---- .../ibm-watson/NvVoiceSelect.vue | 20 ++++---- .../speech-engines/izabela/NvVoiceSelect.vue | 15 ++++-- .../microsoft-azure/NvVoiceSelect.vue | 20 ++++---- .../speech-engines/sam/NvVoiceSelect.vue | 20 ++++---- .../speech-engines/say/NvVoiceSelect.vue | 16 +++++-- .../speech-engines/uberduck/NvVoiceSelect.vue | 20 ++++---- .../plugins/speech-engines/uberduck/store.ts | 48 ++++++++++++------- .../src/components/forms/Select/NvOption.vue | 12 +++-- .../src/components/forms/Select/NvSelect.vue | 16 +++---- 14 files changed, 158 insertions(+), 124 deletions(-) diff --git a/apps/app/src/plugins/speech-engines/amazon-polly/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/amazon-polly/NvVoiceSelect.vue index 6a032685..465d1880 100644 --- a/apps/app/src/plugins/speech-engines/amazon-polly/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/amazon-polly/NvVoiceSelect.vue @@ -9,16 +9,16 @@ }" valueKey="Id" > - diff --git a/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue index 3a910eb9..3fab2721 100644 --- a/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue @@ -8,11 +8,16 @@ }" valueKey="name" > - diff --git a/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue index ce0c710b..6c98561c 100644 --- a/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue @@ -9,16 +9,16 @@ }" valueKey="name" > - diff --git a/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue index f94f3ac7..419853c8 100644 --- a/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue @@ -9,16 +9,16 @@ }" valueKey="voice_id" > - diff --git a/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue index d64bb21b..5cb9f847 100644 --- a/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue @@ -9,16 +9,16 @@ }" valueKey="name" > - diff --git a/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue index 7536b24b..64d34f5a 100644 --- a/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue @@ -9,16 +9,16 @@ }" valueKey="name" > - diff --git a/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue index f1388894..9d916824 100644 --- a/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue @@ -9,11 +9,16 @@ }" valueKey="name" > - diff --git a/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue index d600bea6..d7920310 100644 --- a/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue @@ -9,16 +9,16 @@ }" valueKey="Name" > - diff --git a/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue index 734b85ad..3b3338c8 100644 --- a/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue @@ -8,16 +8,16 @@ }" valueKey="name" > - diff --git a/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue index 8b18cecf..d6d23345 100644 --- a/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue @@ -8,11 +8,17 @@ ...$attrs, }" > - diff --git a/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue index f5a2a6d8..8159f0e5 100644 --- a/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue @@ -9,16 +9,16 @@ }" valueKey="voicemodel_uuid" > - diff --git a/apps/app/src/plugins/speech-engines/uberduck/store.ts b/apps/app/src/plugins/speech-engines/uberduck/store.ts index afb6e2d1..4d63bc72 100644 --- a/apps/app/src/plugins/speech-engines/uberduck/store.ts +++ b/apps/app/src/plugins/speech-engines/uberduck/store.ts @@ -5,23 +5,37 @@ export const { setProperty, getProperty } = definePluginStore(ENGINE_ID, { publicKey: '', privateKey: '', selectedVoice: { - architecture: 'tacotron2', - category: 'Portal', - contributors: ['scruffygamer'], - controls: false, - display_name: 'GLaDOS (Portal 2) (Crust)', - is_active: true, - model_id: '89b07ed5-3b04-4e4d-a2c6-0e36f54ef412', - memberships: [], - is_private: false, - is_primary: true, - name: 'glados-p2', - symbol_set: 'nvidia_taco2', - voicemodel_uuid: '42b79bb6-0b41-44dd-9824-e840d336c343', - hifi_gan_vocoder: 'talknet/talknet-glados-talknet-2021-08-18/hifiganmodel', - ml_model_id: 7943, - speaker_id: 0, - language: 'english', + "added_at": null, + "architecture": "talknet", + "category": "Speaking", + "contributors": [ + "sam-koelle", + ], + "controls": false, + "display_name": "Carolyn", + "is_active": true, + "memberships": [ + { + "name": "creator", + "id": 1, + }, + ], + "is_private": false, + "is_primary": true, + "name": "carolyn-speaking", + "symbol_set": "nvidia_taco2", + "voicemodel_uuid": "60c910d0-d924-4f74-a47c-6c9e44e2bb8b", + "hifi_gan_vocoder": "talknet/talknet-carolyn-2022-03-13/hifiganmodel", + "ml_model_id": 6610, + "speaker_id": null, + "language": "english", + "gender": "", + "mood": "", + "style": "", + "accent": "", + "age": "", + "description": "", + "image_url": "https://uberduck-images.s3.amazonaws.com/commercial/carolyn.png", }, useLocalCredentials: false, favoriteVoiceIds: [], diff --git a/packages/ui/src/components/forms/Select/NvOption.vue b/packages/ui/src/components/forms/Select/NvOption.vue index cfcfbe0b..d604cd47 100644 --- a/packages/ui/src/components/forms/Select/NvOption.vue +++ b/packages/ui/src/components/forms/Select/NvOption.vue @@ -1,17 +1,21 @@ diff --git a/packages/ui/src/components/forms/Select/NvSelect.vue b/packages/ui/src/components/forms/Select/NvSelect.vue index 012e023c..f9446210 100644 --- a/packages/ui/src/components/forms/Select/NvSelect.vue +++ b/packages/ui/src/components/forms/Select/NvSelect.vue @@ -61,6 +61,7 @@ v-if="item" :active="active" :disabled="item.disabled" + :readonly="item.children" :selected=" selectedValues.find( (v) => @@ -71,13 +72,12 @@ :title="item.label" v-bind="item.attrs || {}" @mousedown="!item.children && handleValue(item.value)" - :readonly="item.children" >

{{ item.label }}
- @@ -112,7 +112,7 @@ import NvTag from '@/components/forms/Tag/NvTag.vue' import NvGroup from '@/components/miscellaneous/Group/NvGroup.vue' import NvStack from '@/components/miscellaneous/Stack/NvStack.vue' import NvOption from './NvOption.vue' -import { get, omit, flatten } from 'lodash' +import { flatten, get, omit } from 'lodash' import { v4 as uuid } from 'uuid' const props = defineProps(propsDefinition) @@ -138,10 +138,10 @@ const options = computed(() => ...o, })) return [{ - id: get(option.value, props.valueKey) || option.value || uuid(), - ...option, - children: mappedChildren, - }, + id: get(option.value, props.valueKey) || option.value || uuid(), + ...option, + children: mappedChildren, + }, ...mappedChildren, ] } From fddbe6a12cf0d9d29e6403d815e3fc551acaa833 Mon Sep 17 00:00:00 2001 From: Wurielle Date: Tue, 26 Dec 2023 19:06:22 +0000 Subject: [PATCH 28/30] style: prettier formatting --- .../amazon-polly/NvVoiceSelect.vue | 8 +- .../animalese/NvVoiceSelect.vue | 43 +++-- .../speech-engines/custom/NvVoiceSelect.vue | 8 +- .../elevenlabs/NvVoiceSelect.vue | 8 +- .../google-cloud/NvVoiceSelect.vue | 8 +- .../ibm-watson/NvVoiceSelect.vue | 8 +- .../speech-engines/izabela/NvVoiceSelect.vue | 39 ++-- .../microsoft-azure/NvVoiceSelect.vue | 8 +- .../speech-engines/sam/NvVoiceSelect.vue | 8 +- .../speech-engines/say/NvVoiceSelect.vue | 37 ++-- .../speech-engines/uberduck/NvVoiceSelect.vue | 8 +- .../plugins/speech-engines/uberduck/store.ts | 54 +++--- .../src/components/forms/Select/NvOption.vue | 4 +- .../src/components/forms/Select/NvSelect.vue | 180 +++++++++--------- 14 files changed, 238 insertions(+), 183 deletions(-) diff --git a/apps/app/src/plugins/speech-engines/amazon-polly/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/amazon-polly/NvVoiceSelect.vue index 465d1880..74554224 100644 --- a/apps/app/src/plugins/speech-engines/amazon-polly/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/amazon-polly/NvVoiceSelect.vue @@ -13,10 +13,14 @@ diff --git a/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue index 3fab2721..3b21ea3c 100644 --- a/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/animalese/NvVoiceSelect.vue @@ -12,10 +12,14 @@ @@ -29,10 +33,10 @@ import { groupOptions } from '@/utils/select' import { getProperty, setProperty } from './store' import { defaultVoice, getVoiceCategory, getVoiceId, getVoiceName } from './shared' - -const voices = computed(() => [{ - ...defaultVoice, -}, +const voices = computed(() => [ + { + ...defaultVoice, + }, { name: 'Custom', }, @@ -45,20 +49,21 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) diff --git a/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue index 6c98561c..ffb5956b 100644 --- a/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/custom/NvVoiceSelect.vue @@ -13,10 +13,14 @@ diff --git a/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue index 419853c8..bc6f9f7a 100644 --- a/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/elevenlabs/NvVoiceSelect.vue @@ -13,10 +13,14 @@ diff --git a/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue index 5cb9f847..1d63df1b 100644 --- a/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/google-cloud/NvVoiceSelect.vue @@ -13,10 +13,14 @@ diff --git a/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue index 64d34f5a..27e2eb98 100644 --- a/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/ibm-watson/NvVoiceSelect.vue @@ -13,10 +13,14 @@ diff --git a/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue index 9d916824..9df7930a 100644 --- a/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/izabela/NvVoiceSelect.vue @@ -13,10 +13,14 @@ @@ -50,7 +54,9 @@ const voices = computed(() => [ name: 'Default', value: null, category: 'General', - }, ...(data.value || [])]) + }, + ...(data.value || []), +]) const getOptionFromVoice = (voice: any) => ({ id: getVoiceId(voice), label: getVoiceName(voice), @@ -59,20 +65,21 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) watch( diff --git a/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue index d7920310..a9efea92 100644 --- a/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/microsoft-azure/NvVoiceSelect.vue @@ -13,10 +13,14 @@ diff --git a/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue index 3b3338c8..d196139b 100644 --- a/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/sam/NvVoiceSelect.vue @@ -12,10 +12,14 @@ diff --git a/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue index d6d23345..b83c7d49 100644 --- a/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/say/NvVoiceSelect.vue @@ -8,15 +8,18 @@ ...$attrs, }" > - @@ -42,21 +45,21 @@ const getOptionFromVoice = (voice: any) => ({ }) const options = computed(() => { - const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') - const favoriteVoiceIds = getProperty('favoriteVoiceIds') - if (favoriteVoiceIds) { - const favoriteVoices = voices.value.filter((voice: any) => favoriteVoiceIds.includes(getVoiceId(voice))) - if (favoriteVoices.length) { - localOptions.unshift({ - label: 'Favorites', - children: favoriteVoices.map(getOptionFromVoice), - }) - } + const localOptions = groupOptions(voices.value.map(getOptionFromVoice), 'category') + const favoriteVoiceIds = getProperty('favoriteVoiceIds') + if (favoriteVoiceIds) { + const favoriteVoices = voices.value.filter((voice: any) => + favoriteVoiceIds.includes(getVoiceId(voice)), + ) + if (favoriteVoices.length) { + localOptions.unshift({ + label: 'Favorites', + children: favoriteVoices.map(getOptionFromVoice), + }) } - return localOptions - }, -) + } + return localOptions +}) const favoriteVoiceIds = computed(() => getProperty('favoriteVoiceIds')) - diff --git a/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue b/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue index 8159f0e5..7b3ea7df 100644 --- a/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue +++ b/apps/app/src/plugins/speech-engines/uberduck/NvVoiceSelect.vue @@ -13,10 +13,14 @@ diff --git a/apps/app/src/plugins/speech-engines/uberduck/store.ts b/apps/app/src/plugins/speech-engines/uberduck/store.ts index 4d63bc72..ddbdb061 100644 --- a/apps/app/src/plugins/speech-engines/uberduck/store.ts +++ b/apps/app/src/plugins/speech-engines/uberduck/store.ts @@ -5,37 +5,35 @@ export const { setProperty, getProperty } = definePluginStore(ENGINE_ID, { publicKey: '', privateKey: '', selectedVoice: { - "added_at": null, - "architecture": "talknet", - "category": "Speaking", - "contributors": [ - "sam-koelle", - ], - "controls": false, - "display_name": "Carolyn", - "is_active": true, - "memberships": [ + added_at: null, + architecture: 'talknet', + category: 'Speaking', + contributors: ['sam-koelle'], + controls: false, + display_name: 'Carolyn', + is_active: true, + memberships: [ { - "name": "creator", - "id": 1, + name: 'creator', + id: 1, }, ], - "is_private": false, - "is_primary": true, - "name": "carolyn-speaking", - "symbol_set": "nvidia_taco2", - "voicemodel_uuid": "60c910d0-d924-4f74-a47c-6c9e44e2bb8b", - "hifi_gan_vocoder": "talknet/talknet-carolyn-2022-03-13/hifiganmodel", - "ml_model_id": 6610, - "speaker_id": null, - "language": "english", - "gender": "", - "mood": "", - "style": "", - "accent": "", - "age": "", - "description": "", - "image_url": "https://uberduck-images.s3.amazonaws.com/commercial/carolyn.png", + is_private: false, + is_primary: true, + name: 'carolyn-speaking', + symbol_set: 'nvidia_taco2', + voicemodel_uuid: '60c910d0-d924-4f74-a47c-6c9e44e2bb8b', + hifi_gan_vocoder: 'talknet/talknet-carolyn-2022-03-13/hifiganmodel', + ml_model_id: 6610, + speaker_id: null, + language: 'english', + gender: '', + mood: '', + style: '', + accent: '', + age: '', + description: '', + image_url: 'https://uberduck-images.s3.amazonaws.com/commercial/carolyn.png', }, useLocalCredentials: false, favoriteVoiceIds: [], diff --git a/packages/ui/src/components/forms/Select/NvOption.vue b/packages/ui/src/components/forms/Select/NvOption.vue index d604cd47..5f54dc33 100644 --- a/packages/ui/src/components/forms/Select/NvOption.vue +++ b/packages/ui/src/components/forms/Select/NvOption.vue @@ -1,10 +1,10 @@ diff --git a/packages/ui/src/components/forms/Select/NvSelect.vue b/packages/ui/src/components/forms/Select/NvSelect.vue index f9446210..73673e6b 100644 --- a/packages/ui/src/components/forms/Select/NvSelect.vue +++ b/packages/ui/src/components/forms/Select/NvSelect.vue @@ -1,20 +1,20 @@