From 2ee71f8d8f526200ea70f676ee7ee546761c76be Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 27 May 2024 12:00:08 +0200 Subject: [PATCH 1/8] Add no password login error message --- back/src/Kyoo.Authentication/Views/AuthApi.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/back/src/Kyoo.Authentication/Views/AuthApi.cs b/back/src/Kyoo.Authentication/Views/AuthApi.cs index 6e3548f2..550e1990 100644 --- a/back/src/Kyoo.Authentication/Views/AuthApi.cs +++ b/back/src/Kyoo.Authentication/Views/AuthApi.cs @@ -211,6 +211,12 @@ public class AuthApi( User? user = await users.GetOrDefault( new Filter.Eq(nameof(Abstractions.Models.User.Username), request.Username) ); + if (user != null && user.Password == null) + return Forbid( + new RequestError( + "This account was registerd via oidc. Please login via oidc or add a password to your account in the settings first" + ) + ); if (user == null || !BCryptNet.Verify(request.Password, user.Password)) return Forbid(new RequestError("The user and password does not match.")); From c08134bf08807ddb5e5e5d6dbee76bc2b510aa82 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 27 May 2024 12:00:31 +0200 Subject: [PATCH 2/8] wip: Add android permissions --- front/apps/mobile/app.config.js | 72 --------------------------- front/apps/mobile/app.config.ts | 88 +++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 72 deletions(-) delete mode 100644 front/apps/mobile/app.config.js create mode 100644 front/apps/mobile/app.config.ts diff --git a/front/apps/mobile/app.config.js b/front/apps/mobile/app.config.js deleted file mode 100644 index b0abf42a..00000000 --- a/front/apps/mobile/app.config.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Kyoo - A portable and vast media library solution. - * Copyright (c) Kyoo. - * - * See AUTHORS.md and LICENSE file in the project root for full license information. - * - * Kyoo is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * Kyoo is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kyoo. If not, see . - */ - -const IS_DEV = process.env.APP_VARIANT === "development"; - -// Defined outside the config because dark splashscreen needs to be platform specific. -const splash = { - image: "./assets/icon.png", - resizeMode: "contain", - backgroundColor: "#eff1f5", - dark: { - image: "./assets/icon.png", - resizeMode: "contain", - backgroundColor: "#1e1e2e", - }, -}; - -const config = { - expo: { - name: IS_DEV ? "Kyoo Development" : "Kyoo", - slug: "kyoo", - scheme: "kyoo", - version: "1.0.0", - orientation: "default", - icon: "./assets/icon.png", - userInterfaceStyle: "automatic", - splash, - assetBundlePatterns: ["**/*"], - ios: { - supportsTablet: true, - }, - android: { - package: IS_DEV ? "dev.zoriya.kyoo.dev" : "dev.zoriya.kyoo", - adaptiveIcon: { - foregroundImage: "./assets/icon.png", - backgroundColor: "#eff1f5", - }, - splash, - }, - updates: { - url: "https://u.expo.dev/55de6b52-c649-4a15-9a45-569ff5ed036c", - fallbackToCacheTimeout: 0, - }, - runtimeVersion: { - policy: "sdkVersion", - }, - extra: { - eas: { - projectId: "55de6b52-c649-4a15-9a45-569ff5ed036c", - }, - }, - plugins: ["expo-build-properties", "expo-localization"], - }, -}; -export default config; diff --git a/front/apps/mobile/app.config.ts b/front/apps/mobile/app.config.ts new file mode 100644 index 00000000..ecf8cb7b --- /dev/null +++ b/front/apps/mobile/app.config.ts @@ -0,0 +1,88 @@ +/* + * Kyoo - A portable and vast media library solution. + * Copyright (c) Kyoo. + * + * See AUTHORS.md and LICENSE file in the project root for full license information. + * + * Kyoo is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * Kyoo is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Kyoo. If not, see . + */ + +// import "ts-node/register"; // Add this to import TypeScript files +import type { ExpoConfig } from "expo/config"; +import { withAndroidManifest } from "expo/config-plugins"; + +const IS_DEV = process.env.APP_VARIANT === "development"; + +// Defined outside the config because dark splashscreen needs to be platform specific. +const splash = { + image: "./assets/icon.png", + resizeMode: "contain", + backgroundColor: "#eff1f5", + dark: { + image: "./assets/icon.png", + resizeMode: "contain", + backgroundColor: "#1e1e2e", + }, +} as const; + +const config: ExpoConfig = { + name: IS_DEV ? "Kyoo Development" : "Kyoo", + slug: "kyoo", + scheme: "kyoo", + version: "1.0.0", + orientation: "default", + icon: "./assets/icon.png", + userInterfaceStyle: "automatic", + splash, + assetBundlePatterns: ["**/*"], + ios: { + supportsTablet: true, + }, + android: { + package: IS_DEV ? "dev.zoriya.kyoo.dev" : "dev.zoriya.kyoo", + adaptiveIcon: { + foregroundImage: "./assets/icon.png", + backgroundColor: "#eff1f5", + }, + splash, + permissions: [ + "android.permission.FOREGROUND_SERVICE", + "android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK", + ], + }, + updates: { + url: "https://u.expo.dev/55de6b52-c649-4a15-9a45-569ff5ed036c", + fallbackToCacheTimeout: 0, + }, + runtimeVersion: { + policy: "sdkVersion", + }, + extra: { + eas: { + projectId: "55de6b52-c649-4a15-9a45-569ff5ed036c", + }, + }, + plugins: ["expo-build-properties", "expo-localization"], +}; + +const withForegroundService = (c: ExpoConfig): ExpoConfig => { + return withAndroidManifest(c, async (config) => { + const manifest = config.modResults.manifest; + console.log(manifest); + // manifest.application!.push(); + return config; + }); +}; + +export default withForegroundService(config); From 6458f419aa6905dc414d4749c6cb9e421576cf91 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 27 May 2024 12:04:09 +0200 Subject: [PATCH 3/8] Upgrade npm packages --- front/apps/mobile/package.json | 16 +- front/apps/web/package.json | 14 +- front/packages/primitives/package.json | 4 +- front/yarn.lock | 390 +++++++++++++++---------- 4 files changed, 255 insertions(+), 169 deletions(-) diff --git a/front/apps/mobile/package.json b/front/apps/mobile/package.json index 370bf2af..4a311326 100644 --- a/front/apps/mobile/package.json +++ b/front/apps/mobile/package.json @@ -23,9 +23,9 @@ "@material-symbols/svg-400": "^0.18.0", "@react-native-community/netinfo": "11.3.1", "@shopify/flash-list": "1.6.4", - "@tanstack/query-sync-storage-persister": "^5.37.1", - "@tanstack/react-query": "^5.37.1", - "@tanstack/react-query-persist-client": "^5.37.1", + "@tanstack/query-sync-storage-persister": "^5.38.0", + "@tanstack/react-query": "^5.39.0", + "@tanstack/react-query-persist-client": "^5.39.0", "array-shuffle": "^3.0.0", "babel-plugin-transform-inline-environment-variables": "^0.4.4", "expo": "^51.0.8", @@ -44,14 +44,14 @@ "expo-secure-store": "~13.0.1", "expo-status-bar": "~1.12.1", "expo-updates": "~0.25.14", - "i18next": "^23.11.4", + "i18next": "^23.11.5", "intl-pluralrules": "^2.0.1", "moti": "^0.29.0", "react": "18.2.0", "react-dom": "18.2.0", - "react-i18next": "^14.1.1", + "react-i18next": "^14.1.2", "react-native": "0.74.1", - "react-native-blurhash": "^2.0.2", + "react-native-blurhash": "^2.0.3", "react-native-fast-image": "^8.6.3", "react-native-mmkv": "^2.12.2", "react-native-reanimated": "~3.10.1", @@ -59,11 +59,11 @@ "react-native-screens": "~3.31.1", "react-native-svg": "15.2.0", "react-native-uuid": "^2.0.2", - "react-native-video": "^6.0.0", + "react-native-video": "^6.1.2", "yoshiki": "1.2.14" }, "devDependencies": { - "@babel/core": "^7.24.5", + "@babel/core": "^7.24.6", "react-native-svg-transformer": "^1.4.0", "typescript": "~5.3.3" }, diff --git a/front/apps/web/package.json b/front/apps/web/package.json index 97e71a95..f25fb9bc 100644 --- a/front/apps/web/package.json +++ b/front/apps/web/package.json @@ -19,27 +19,27 @@ "@material-symbols/svg-400": "^0.18.0", "@radix-ui/react-dropdown-menu": "^2.0.6", "@radix-ui/react-select": "^2.0.0", - "@tanstack/react-query": "^5.37.1", - "@tanstack/react-query-devtools": "^5.37.1", + "@tanstack/react-query": "^5.39.0", + "@tanstack/react-query-devtools": "^5.39.0", "array-shuffle": "^3.0.0", "expo-image-picker": "~15.0.5", "expo-linear-gradient": "^13.0.2", "expo-modules-core": "^1.12.11", "hls.js": "^1.5.8", - "i18next": "^23.11.4", + "i18next": "^23.11.5", "jassub": "^1.7.15", - "jotai": "^2.8.0", + "jotai": "^2.8.1", "moti": "^0.29.0", "next": "14.2.3", "next-translate": "^2.6.2", "raf": "^3.4.1", "react": "18.3.1", "react-dom": "18.3.1", - "react-i18next": "^14.1.1", + "react-i18next": "^14.1.2", "react-native-reanimated": "3.11.0", "react-native-svg": "15.3.0", - "react-native-video": "^6.0.0", - "react-native-web": "0.19.11", + "react-native-video": "^6.1.2", + "react-native-web": "0.19.12", "react-tooltip": "^5.26.4", "solito": "^4.2.2", "srt-webvtt": "zoriya/srt-webvtt#build", diff --git a/front/packages/primitives/package.json b/front/packages/primitives/package.json index 4f390639..106165a1 100644 --- a/front/packages/primitives/package.json +++ b/front/packages/primitives/package.json @@ -53,13 +53,13 @@ }, "dependencies": { "@expo/html-elements": "^0.10.1", - "@tanstack/react-query": "^5.37.1", + "@tanstack/react-query": "^5.39.0", "solito": "^4.2.2" }, "optionalDependencies": { "@radix-ui/react-select": "^2.0.0", "blurhash": "^2.0.5", - "react-native-blurhash": "^2.0.2", + "react-native-blurhash": "^2.0.3", "react-native-fast-image": "^8.6.3", "react-native-safe-area-context": "4.10.1" } diff --git a/front/yarn.lock b/front/yarn.lock index 929716fe..eb296c9d 100644 --- a/front/yarn.lock +++ b/front/yarn.lock @@ -46,13 +46,13 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.24.2": - version: 7.24.2 - resolution: "@babel/code-frame@npm:7.24.2" +"@babel/code-frame@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/code-frame@npm:7.24.6" dependencies: - "@babel/highlight": ^7.24.2 + "@babel/highlight": ^7.24.6 picocolors: ^1.0.0 - checksum: 70e867340cfe09ca5488b2f36372c45cabf43c79a5b6426e6df5ef0611ff5dfa75a57dda841895693de6008f32c21a7c97027a8c7bcabd63a7d17416cbead6f8 + checksum: 0904514ea7079a9590c1c546cd20b9c1beab9649873f2a0703429860775c1713a8dfb2daacd781a0210bb3930c656c1c436013fb20eaa3644880fb3a2b34541d languageName: node linkType: hard @@ -63,6 +63,13 @@ __metadata: languageName: node linkType: hard +"@babel/compat-data@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/compat-data@npm:7.24.6" + checksum: 92233c708f7c349923c1f9a2b3c9354875a951ac3afaca0a2c159de1c808f6799ad4433652b90870015281aa466ec6e9aa8922e755cd7ac1413a3a5782cd685d + languageName: node + linkType: hard + "@babel/core@npm:*, @babel/core@npm:^7.13.16, @babel/core@npm:^7.20.0, @babel/core@npm:^7.21.3": version: 7.23.9 resolution: "@babel/core@npm:7.23.9" @@ -86,26 +93,26 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.24.5": - version: 7.24.5 - resolution: "@babel/core@npm:7.24.5" +"@babel/core@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/core@npm:7.24.6" dependencies: "@ampproject/remapping": ^2.2.0 - "@babel/code-frame": ^7.24.2 - "@babel/generator": ^7.24.5 - "@babel/helper-compilation-targets": ^7.23.6 - "@babel/helper-module-transforms": ^7.24.5 - "@babel/helpers": ^7.24.5 - "@babel/parser": ^7.24.5 - "@babel/template": ^7.24.0 - "@babel/traverse": ^7.24.5 - "@babel/types": ^7.24.5 + "@babel/code-frame": ^7.24.6 + "@babel/generator": ^7.24.6 + "@babel/helper-compilation-targets": ^7.24.6 + "@babel/helper-module-transforms": ^7.24.6 + "@babel/helpers": ^7.24.6 + "@babel/parser": ^7.24.6 + "@babel/template": ^7.24.6 + "@babel/traverse": ^7.24.6 + "@babel/types": ^7.24.6 convert-source-map: ^2.0.0 debug: ^4.1.0 gensync: ^1.0.0-beta.2 json5: ^2.2.3 semver: ^6.3.1 - checksum: f4f0eafde12b145f2cb9cc893085e5f1436e1ef265bb3b7d8aa6282515c9b4e740bbd5e2cbc32114adb9afed2dd62c2336758b9fabb7e46e8ba542f76d4f3f80 + checksum: f8af23de19865818c27c2fbe0d87b0834b118386da5ee09b20ae0cf7a5540065054ef2b70f377d025d9feee765db18df39900e4c18e905988b94b54a104c738e languageName: node linkType: hard @@ -121,15 +128,15 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.24.5": - version: 7.24.5 - resolution: "@babel/generator@npm:7.24.5" +"@babel/generator@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/generator@npm:7.24.6" dependencies: - "@babel/types": ^7.24.5 + "@babel/types": ^7.24.6 "@jridgewell/gen-mapping": ^0.3.5 "@jridgewell/trace-mapping": ^0.3.25 jsesc: ^2.5.1 - checksum: a08c0ab900b36e1a17863e18e3216153322ea993246fd7a358ba38a31cfb15bab2af1dc178b2adafe4cb8a9f3ab0e0ceafd3fe6e8ca870dffb435b53b2b2a803 + checksum: a477e03129106908f464b195c4f138052d732cfca47506b127edbed6a496371bae821662a8a4e51e6d144ac236a5d05dc2da0e145e29bb8e19d3e7c480ac00fe languageName: node linkType: hard @@ -164,6 +171,19 @@ __metadata: languageName: node linkType: hard +"@babel/helper-compilation-targets@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-compilation-targets@npm:7.24.6" + dependencies: + "@babel/compat-data": ^7.24.6 + "@babel/helper-validator-option": ^7.24.6 + browserslist: ^4.22.2 + lru-cache: ^5.1.1 + semver: ^6.3.1 + checksum: c66bf86387fbeefc617db9510de553880ed33dc91308421ee36a7b489d0e8c8eb615e0f467a9ec886eada7c05b03e421e55b2a724ff302402fdd4e0c0b2b0443 + languageName: node + linkType: hard + "@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.22.15, @babel/helper-create-class-features-plugin@npm:^7.23.6, @babel/helper-create-class-features-plugin@npm:^7.23.9": version: 7.23.9 resolution: "@babel/helper-create-class-features-plugin@npm:7.23.9" @@ -237,6 +257,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-environment-visitor@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-environment-visitor@npm:7.24.6" + checksum: 9c2b3f1ee7ba46b61b0482efab6d37f5c76f0ea4e9d9775df44a89644729c3a50101040a0233543ec6c3f416d8e548d337f310ff3e164f847945507428ee39e5 + languageName: node + linkType: hard + "@babel/helper-function-name@npm:^7.22.5, @babel/helper-function-name@npm:^7.23.0": version: 7.23.0 resolution: "@babel/helper-function-name@npm:7.23.0" @@ -247,6 +274,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-function-name@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-function-name@npm:7.24.6" + dependencies: + "@babel/template": ^7.24.6 + "@babel/types": ^7.24.6 + checksum: d7a2198b6bf2cae9767d5b0d6cb5d3cbd9a07640ad4b6798abb7d7242e8f32765a94fd98ab1a039d7607f0ddbeaf9ddc822dd536b856e499f7082899c6f455f0 + languageName: node + linkType: hard + "@babel/helper-hoist-variables@npm:^7.22.5": version: 7.22.5 resolution: "@babel/helper-hoist-variables@npm:7.22.5" @@ -256,6 +293,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-hoist-variables@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-hoist-variables@npm:7.24.6" + dependencies: + "@babel/types": ^7.24.6 + checksum: 4819b574393a5214aff6ae02a6e5250ace2564f8bcdb28d580ffec57bbb2092425e8f39563d75cfa268940a01fd425bad503c0b92717c12426f15cf6847855d3 + languageName: node + linkType: hard + "@babel/helper-member-expression-to-functions@npm:^7.22.15, @babel/helper-member-expression-to-functions@npm:^7.23.0": version: 7.23.0 resolution: "@babel/helper-member-expression-to-functions@npm:7.23.0" @@ -283,12 +329,12 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.24.3": - version: 7.24.3 - resolution: "@babel/helper-module-imports@npm:7.24.3" +"@babel/helper-module-imports@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-module-imports@npm:7.24.6" dependencies: - "@babel/types": ^7.24.0 - checksum: c23492189ba97a1ec7d37012336a5661174e8b88194836b6bbf90d13c3b72c1db4626263c654454986f924c6da8be7ba7f9447876d709cd00bd6ffde6ec00796 + "@babel/types": ^7.24.6 + checksum: 3484420c45529aac34cb14111a03c78edab84e5c4419634affe61176d832af82963395ea319f67c7235fd4106d9052a9f3ce012d2d57d56644572d3f7d495231 languageName: node linkType: hard @@ -307,18 +353,18 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.24.5": - version: 7.24.5 - resolution: "@babel/helper-module-transforms@npm:7.24.5" +"@babel/helper-module-transforms@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-module-transforms@npm:7.24.6" dependencies: - "@babel/helper-environment-visitor": ^7.22.20 - "@babel/helper-module-imports": ^7.24.3 - "@babel/helper-simple-access": ^7.24.5 - "@babel/helper-split-export-declaration": ^7.24.5 - "@babel/helper-validator-identifier": ^7.24.5 + "@babel/helper-environment-visitor": ^7.24.6 + "@babel/helper-module-imports": ^7.24.6 + "@babel/helper-simple-access": ^7.24.6 + "@babel/helper-split-export-declaration": ^7.24.6 + "@babel/helper-validator-identifier": ^7.24.6 peerDependencies: "@babel/core": ^7.0.0 - checksum: 208c2e3877536c367ae3f39345bb5c5954ad481fdb2204d4d1906063e53ae564e5b7b846951b1aa96ee716ec24ec3b6db01b41d128884c27315b415f62db9fd2 + checksum: 904e2a0701eb1eeb84b0d0df5dacdc40291307025b7e3a9a3c6f3eee912c893524f9dc7f5624225a5783a258dec2eb2489a9638bf5f3de26ebfcbcac1b5cc2fc languageName: node linkType: hard @@ -393,12 +439,12 @@ __metadata: languageName: node linkType: hard -"@babel/helper-simple-access@npm:^7.24.5": - version: 7.24.5 - resolution: "@babel/helper-simple-access@npm:7.24.5" +"@babel/helper-simple-access@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-simple-access@npm:7.24.6" dependencies: - "@babel/types": ^7.24.5 - checksum: 5616044603c98434342f09b056c869394acdeba7cd9ec29e6a9abb0dae1922f779d364aaba74dc2ae4facf85945c6156295adbe0511a8aaecaa8a1559d14757a + "@babel/types": ^7.24.6 + checksum: 929162e887efc1bcadd4e141ed7782b45fccc6873d5023a744fee9c94d16d3a13dbfb66eb259181613a36c2d35f7d2088ee37e76014223d3b9b6c9ef1094e4b6 languageName: node linkType: hard @@ -429,6 +475,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-split-export-declaration@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-split-export-declaration@npm:7.24.6" + dependencies: + "@babel/types": ^7.24.6 + checksum: b546fd7e186b4aa69f96e041b6c4c9154115a2579a297b86773719dbed53b938cfc3f6b4996ae410296bb8aa30ea031f9ff31f1255aa25c3af75026c5b7c4059 + languageName: node + linkType: hard + "@babel/helper-string-parser@npm:^7.23.4": version: 7.23.4 resolution: "@babel/helper-string-parser@npm:7.23.4" @@ -443,6 +498,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-string-parser@npm:7.24.6" + checksum: c8c614a663928b67c5c65cfea958ed20c858fa2af8c957d301bd852c0ab98adae0861f081fd8f5add16539d9393bd4b10b8c86a97a9d7304f70a6a67b2c2ff07 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.22.20": version: 7.22.20 resolution: "@babel/helper-validator-identifier@npm:7.22.20" @@ -457,6 +519,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-validator-identifier@npm:7.24.6" + checksum: a265a6fba570332dca63ad7e749b867d29b52da2573dc62bf19b5b8c5387d4f4296af33da9da7c71ffe3d3abecd743418278f56d38b057ad4b53f09b937fe113 + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.22.15, @babel/helper-validator-option@npm:^7.23.5": version: 7.23.5 resolution: "@babel/helper-validator-option@npm:7.23.5" @@ -464,6 +533,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-option@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-validator-option@npm:7.24.6" + checksum: 5defb2da74e1cac9497016f4e41698aeed75ec7a5e9dc07e777cdb67ef73cd2e27bd2bf8a3ab8d37e0b93a6a45524a9728f03e263afdef452436cf74794bde87 + languageName: node + linkType: hard + "@babel/helper-wrap-function@npm:^7.22.20": version: 7.22.20 resolution: "@babel/helper-wrap-function@npm:7.22.20" @@ -486,14 +562,13 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.24.5": - version: 7.24.5 - resolution: "@babel/helpers@npm:7.24.5" +"@babel/helpers@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helpers@npm:7.24.6" dependencies: - "@babel/template": ^7.24.0 - "@babel/traverse": ^7.24.5 - "@babel/types": ^7.24.5 - checksum: 941937456ca50ef44dbc5cdcb9a74c6ce18ce38971663acd80b622e7ecf1cc4fa034597de3ccccc37939d324139f159709f493fd8e7c385adbc162cb0888cfee + "@babel/template": ^7.24.6 + "@babel/types": ^7.24.6 + checksum: c936058fd5caf7173e157f790fdbe9535237a7b8bc2c3d084bdf16467a034f73bd5d731deb514aa84e356c72de1cc93500a376f9d481f5c1e335f5a563426e58 languageName: node linkType: hard @@ -508,15 +583,15 @@ __metadata: languageName: node linkType: hard -"@babel/highlight@npm:^7.24.2": - version: 7.24.5 - resolution: "@babel/highlight@npm:7.24.5" +"@babel/highlight@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/highlight@npm:7.24.6" dependencies: - "@babel/helper-validator-identifier": ^7.24.5 + "@babel/helper-validator-identifier": ^7.24.6 chalk: ^2.4.2 js-tokens: ^4.0.0 picocolors: ^1.0.0 - checksum: eece0e63e9210e902f1ee88f15cabfa31d2693bd2e56806eb849478b859d274c24477081c649cee6a241c4aed7da6f3e05c7afa5c3cd70094006ed095292b0d0 + checksum: 2f8f7f060eeccc3ddf03ba12c263995de0e6c0dd31ad224bed58d983b3bb08fe34dfc01440396266456a4cad83226c38ad6814805bc5d0c774a056cac9182eca languageName: node linkType: hard @@ -529,12 +604,12 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.5": - version: 7.24.5 - resolution: "@babel/parser@npm:7.24.5" +"@babel/parser@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/parser@npm:7.24.6" bin: parser: ./bin/babel-parser.js - checksum: a251ea41bf8b5f61048beb320d43017aff68af5a3506bd2ef392180f5fa32c1061513171d582bb3d46ea48e3659dece8b3ba52511a2566066e58abee300ce2a0 + checksum: ca3773f5b2a4a065b827990ca0c867e670f01d7a7d7278838bd64d583e68ed52356b5a613303c5aa736d20f024728fec80fc5845fed1eb751ab5f1bfbdc1dd3c languageName: node linkType: hard @@ -1988,14 +2063,14 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.24.0": - version: 7.24.0 - resolution: "@babel/template@npm:7.24.0" +"@babel/template@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/template@npm:7.24.6" dependencies: - "@babel/code-frame": ^7.23.5 - "@babel/parser": ^7.24.0 - "@babel/types": ^7.24.0 - checksum: f257b003c071a0cecdbfceca74185f18fe62c055469ab5c1d481aab12abeebed328e67e0a19fd978a2a8de97b28953fa4bc3da6d038a7345fdf37923b9fcdec8 + "@babel/code-frame": ^7.24.6 + "@babel/parser": ^7.24.6 + "@babel/types": ^7.24.6 + checksum: 8e532ebdd5e1398c030af16881061bad43b9c3b758a193a6289dc5be5988cc543f7aa56a360e15b755258c0b3d387f3cd78b505835b040a2729d0261d0ff1711 languageName: node linkType: hard @@ -2017,21 +2092,21 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.24.5": - version: 7.24.5 - resolution: "@babel/traverse@npm:7.24.5" +"@babel/traverse@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/traverse@npm:7.24.6" dependencies: - "@babel/code-frame": ^7.24.2 - "@babel/generator": ^7.24.5 - "@babel/helper-environment-visitor": ^7.22.20 - "@babel/helper-function-name": ^7.23.0 - "@babel/helper-hoist-variables": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.24.5 - "@babel/parser": ^7.24.5 - "@babel/types": ^7.24.5 + "@babel/code-frame": ^7.24.6 + "@babel/generator": ^7.24.6 + "@babel/helper-environment-visitor": ^7.24.6 + "@babel/helper-function-name": ^7.24.6 + "@babel/helper-hoist-variables": ^7.24.6 + "@babel/helper-split-export-declaration": ^7.24.6 + "@babel/parser": ^7.24.6 + "@babel/types": ^7.24.6 debug: ^4.3.1 globals: ^11.1.0 - checksum: a313fbf4a06946cc4b74b06e9846d7393a9ca1e8b6df6da60c669cff0a9426d6198c21a478041c60807b62b48f980473d4afbd3768764b0d9741ac80f5dfa04f + checksum: 654151b2ab5c9d5031c274cf197f707b8a27a1c70b38fcb8d1bf5ad2d8848f38675ab9c2a86aeb804657c5817124ac5be4cb6f5defa8ef7ac40596e1220697aa languageName: node linkType: hard @@ -2046,7 +2121,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.24.0, @babel/types@npm:^7.24.5": +"@babel/types@npm:^7.24.5": version: 7.24.5 resolution: "@babel/types@npm:7.24.5" dependencies: @@ -2057,6 +2132,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/types@npm:7.24.6" + dependencies: + "@babel/helper-string-parser": ^7.24.6 + "@babel/helper-validator-identifier": ^7.24.6 + to-fast-properties: ^2.0.0 + checksum: 58d798dd37e6b14f818730b4536795d68d28ccd5dc2a105fd977104789b20602be11d92cdd47cdbd48d8cce3cc0e14c7773813357ad9d5d6e94d70587eb45bf5 + languageName: node + linkType: hard + "@biomejs/biome@npm:1.7.3": version: 1.7.3 resolution: "@biomejs/biome@npm:1.7.3" @@ -3270,9 +3356,9 @@ __metadata: "@expo/html-elements": ^0.10.1 "@gorhom/portal": ^1.0.14 "@radix-ui/react-select": ^2.0.0 - "@tanstack/react-query": ^5.37.1 + "@tanstack/react-query": ^5.39.0 blurhash: ^2.0.5 - react-native-blurhash: ^2.0.2 + react-native-blurhash: ^2.0.3 react-native-fast-image: ^8.6.3 react-native-safe-area-context: 4.10.1 solito: ^4.2.2 @@ -5115,10 +5201,10 @@ __metadata: languageName: node linkType: hard -"@tanstack/query-core@npm:5.36.1": - version: 5.36.1 - resolution: "@tanstack/query-core@npm:5.36.1" - checksum: 9ac291eff02bcfd20c8460ce04683b2551d6b51635120eb9efb1be37c6839e8428ddf85ef94bf1b71ed162b5e5cd5dfef64e14f089058d725f7cee4d8ee07d0a +"@tanstack/query-core@npm:5.38.0": + version: 5.38.0 + resolution: "@tanstack/query-core@npm:5.38.0" + checksum: 65ad1affab2aedc91843f387e5b1e374187e4f83262905a781d76ba4576789466ef541d99c5121dac03f6dbffbfbd569fa1da0aa59b0556336395986051a1b3c languageName: node linkType: hard @@ -5129,57 +5215,57 @@ __metadata: languageName: node linkType: hard -"@tanstack/query-persist-client-core@npm:5.37.1": - version: 5.37.1 - resolution: "@tanstack/query-persist-client-core@npm:5.37.1" +"@tanstack/query-persist-client-core@npm:5.38.0": + version: 5.38.0 + resolution: "@tanstack/query-persist-client-core@npm:5.38.0" dependencies: - "@tanstack/query-core": 5.36.1 - checksum: c8a9eb626f803b46e051f441ec13c3036f37c925cf9e30bfad534f81e5a9707fe42c85f883835661cf7db24e3485c3cf02a6ba81692760f80f2a3998c2464312 + "@tanstack/query-core": 5.38.0 + checksum: ea3bbfc87e63d8b754d5e07f9a621ef6b5949c0cee621bac0c737b448b500c5550cf5b7e0fd7995ef7b300d063911a18f53215f04bc053a67ec5d397691ccd14 languageName: node linkType: hard -"@tanstack/query-sync-storage-persister@npm:^5.37.1": - version: 5.37.1 - resolution: "@tanstack/query-sync-storage-persister@npm:5.37.1" +"@tanstack/query-sync-storage-persister@npm:^5.38.0": + version: 5.38.0 + resolution: "@tanstack/query-sync-storage-persister@npm:5.38.0" dependencies: - "@tanstack/query-core": 5.36.1 - "@tanstack/query-persist-client-core": 5.37.1 - checksum: ba2942068ea50f212e3b714a235110a4df86101d63416530a6f11928afc53e973858b614d5fa20ac0860bc6214c0e6068a4a0afb4605be2efd208d30acba8b02 + "@tanstack/query-core": 5.38.0 + "@tanstack/query-persist-client-core": 5.38.0 + checksum: 839013940d5b4ab493e96d5818afc4c1365a661c7b202e0f89f6999f723446ff877d57478f2b3db69122e9108f9ff9e89d3b0f5459b53ccdced51609c7768c6f languageName: node linkType: hard -"@tanstack/react-query-devtools@npm:^5.37.1": - version: 5.37.1 - resolution: "@tanstack/react-query-devtools@npm:5.37.1" +"@tanstack/react-query-devtools@npm:^5.39.0": + version: 5.39.0 + resolution: "@tanstack/react-query-devtools@npm:5.39.0" dependencies: "@tanstack/query-devtools": 5.37.1 peerDependencies: - "@tanstack/react-query": ^5.37.1 - react: ^18.0.0 - checksum: b73191d6e582f219522a7b9bd855ef21d9af37bab5ece7592fc98f0768f65fcf0e4116ce18f8baab2fd7c779ddf9277d09d221c1fa5d9aebad11e5300aa917c0 + "@tanstack/react-query": ^5.39.0 + react: ^18 || ^19 + checksum: 98da3ef5ba631eae36d588dd2f77b218c82164973b1ebd89ed42b820f82153bad497448e05092a132a8e5c4f94f417271f8fb701b4a7ffa8072624aaa9485c1d languageName: node linkType: hard -"@tanstack/react-query-persist-client@npm:^5.37.1": - version: 5.37.1 - resolution: "@tanstack/react-query-persist-client@npm:5.37.1" +"@tanstack/react-query-persist-client@npm:^5.39.0": + version: 5.39.0 + resolution: "@tanstack/react-query-persist-client@npm:5.39.0" dependencies: - "@tanstack/query-persist-client-core": 5.37.1 + "@tanstack/query-persist-client-core": 5.38.0 peerDependencies: - "@tanstack/react-query": ^5.37.1 - react: ^18.0.0 - checksum: 9d56dd503de4ace73bc68085a36d65794291032f9b9ae9d4d2d6b5f162367e9412016739fa9c5f6e0cfb5dbac0692ce757cbf4cfc17189d681a920fe05db1093 + "@tanstack/react-query": ^5.39.0 + react: ^18 || ^19 + checksum: 6a0e46417e39bc6e95343d8fa6fdb891221fe9790dd4c39af3f049f1a1cf7297c7f1423c57e0689f464ba5b89afa3cccbef5ce0a5fce563e1f396140d2f29d4c languageName: node linkType: hard -"@tanstack/react-query@npm:^5.37.1": - version: 5.37.1 - resolution: "@tanstack/react-query@npm:5.37.1" +"@tanstack/react-query@npm:^5.39.0": + version: 5.39.0 + resolution: "@tanstack/react-query@npm:5.39.0" dependencies: - "@tanstack/query-core": 5.36.1 + "@tanstack/query-core": 5.38.0 peerDependencies: react: ^18.0.0 - checksum: 4bac8aeed5ab6718ba3eb527542784c9475e3eda5f2602eea1479f672b5dfcfb48289b4a26ccf5ef3cba793e4b5cc00070b33e85417dda6ecbe11a09d85ad1c5 + checksum: d43022347a93d55700fb51e29fcb9c81bae55fc8395b066b9b37bda698ca25655affba03e40acfec668a5c1c26420bb1075fd5845658d9e4a30b966cc9d99512 languageName: node linkType: hard @@ -8818,12 +8904,12 @@ __metadata: languageName: node linkType: hard -"i18next@npm:^23.11.4": - version: 23.11.4 - resolution: "i18next@npm:23.11.4" +"i18next@npm:^23.11.5": + version: 23.11.5 + resolution: "i18next@npm:23.11.5" dependencies: "@babel/runtime": ^7.23.2 - checksum: 8682a1c538fdc3309183997c5b5e2df2d1557be70a2d1bd947b2b020d70afb414d55492f9010387729dd9362bf191e15f782cc879023c6a495767334dc3e6320 + checksum: e9ec83703af59205af81f10929fd420314c0c976d1f4c42a191dc4d13f1284d13517105325286772571292953839c7183baa92e9bb43f41efe87dbc50c9aed1c languageName: node linkType: hard @@ -9410,9 +9496,9 @@ __metadata: languageName: node linkType: hard -"jotai@npm:^2.8.0": - version: 2.8.0 - resolution: "jotai@npm:2.8.0" +"jotai@npm:^2.8.1": + version: 2.8.1 + resolution: "jotai@npm:2.8.1" peerDependencies: "@types/react": ">=17.0.0" react: ">=17.0.0" @@ -9421,7 +9507,7 @@ __metadata: optional: true react: optional: true - checksum: b24e7676fb659e72fcd6ccd57b1e120b80fa9172353e5d9e9f980b29d4d176238e3fd0c1b555c51476a0a8dc0d2ea391c6b2840d3e7bfb315892e8a621fd8dfb + checksum: d31043fdcb74dcd48a7ea1df46cfff1d9ba63f9fba7b77c9f2a3bd9907d2bfc3a9a90a980d893e8f4280e99bc7b3124509b15b538a4b88630406b594c423167b languageName: node linkType: hard @@ -10433,7 +10519,7 @@ __metadata: version: 0.0.0-use.local resolution: "mobile@workspace:apps/mobile" dependencies: - "@babel/core": ^7.24.5 + "@babel/core": ^7.24.6 "@expo-google-fonts/poppins": ^0.2.3 "@formatjs/intl-displaynames": ^6.6.8 "@formatjs/intl-locale": ^4.0.0 @@ -10443,9 +10529,9 @@ __metadata: "@material-symbols/svg-400": ^0.18.0 "@react-native-community/netinfo": 11.3.1 "@shopify/flash-list": 1.6.4 - "@tanstack/query-sync-storage-persister": ^5.37.1 - "@tanstack/react-query": ^5.37.1 - "@tanstack/react-query-persist-client": ^5.37.1 + "@tanstack/query-sync-storage-persister": ^5.38.0 + "@tanstack/react-query": ^5.39.0 + "@tanstack/react-query-persist-client": ^5.39.0 array-shuffle: ^3.0.0 babel-plugin-transform-inline-environment-variables: ^0.4.4 expo: ^51.0.8 @@ -10464,14 +10550,14 @@ __metadata: expo-secure-store: ~13.0.1 expo-status-bar: ~1.12.1 expo-updates: ~0.25.14 - i18next: ^23.11.4 + i18next: ^23.11.5 intl-pluralrules: ^2.0.1 moti: ^0.29.0 react: 18.2.0 react-dom: 18.2.0 - react-i18next: ^14.1.1 + react-i18next: ^14.1.2 react-native: 0.74.1 - react-native-blurhash: ^2.0.2 + react-native-blurhash: ^2.0.3 react-native-fast-image: ^8.6.3 react-native-mmkv: ^2.12.2 react-native-reanimated: ~3.10.1 @@ -10480,7 +10566,7 @@ __metadata: react-native-svg: 15.2.0 react-native-svg-transformer: ^1.4.0 react-native-uuid: ^2.0.2 - react-native-video: ^6.0.0 + react-native-video: ^6.1.2 typescript: ~5.3.3 yoshiki: 1.2.14 languageName: unknown @@ -11536,9 +11622,9 @@ __metadata: languageName: node linkType: hard -"react-i18next@npm:^14.1.1": - version: 14.1.1 - resolution: "react-i18next@npm:14.1.1" +"react-i18next@npm:^14.1.2": + version: 14.1.2 + resolution: "react-i18next@npm:14.1.2" dependencies: "@babel/runtime": ^7.23.9 html-parse-stringify: ^3.0.1 @@ -11550,7 +11636,7 @@ __metadata: optional: true react-native: optional: true - checksum: e1a00f82f355c439bc9e98cb8bc6fccbab769fa8f0e5da1545cfb262dc228183615aa89bad91b90db6d8de1949bb54f0c1655aec04c8947daf8383af07b1eff3 + checksum: 1e943bc1537136a0054801f2df8cd114e0789aa94dd7397e0b98e2848371a2bb5c7d855e99393ac9381fe5d8242bb4e2c27cc6d8e7f3a0e9c1b241ecd2d4bdab languageName: node linkType: hard @@ -11575,13 +11661,13 @@ __metadata: languageName: node linkType: hard -"react-native-blurhash@npm:^2.0.2": - version: 2.0.2 - resolution: "react-native-blurhash@npm:2.0.2" +"react-native-blurhash@npm:^2.0.3": + version: 2.0.3 + resolution: "react-native-blurhash@npm:2.0.3" peerDependencies: react: ">=16.8.1" react-native: ">=0.60.0-rc.0 <1.0.x" - checksum: 9277b01fa8982a1896cd1d6166cea38b3e9786681faac212b53c977aa2308ca9f153ee56e7fa5a8585eb09da6c519f986e46b9e2943872935f01f894451bfbbc + checksum: 3beb6a3a5b3ff119f983c8e950c81e3826ecce5e9d614155cdeb26294622eaa8fc55764902a2bad6c417cc764b8c9ae0a6a7cce3661ede50c62b62a54faceea5 languageName: node linkType: hard @@ -11729,19 +11815,19 @@ __metadata: languageName: node linkType: hard -"react-native-video@npm:^6.0.0": - version: 6.0.0 - resolution: "react-native-video@npm:6.0.0" +"react-native-video@npm:^6.1.2": + version: 6.1.2 + resolution: "react-native-video@npm:6.1.2" peerDependencies: react: "*" react-native: "*" - checksum: 3320cf9b5d5845dd72d6fef3cf7d8d5cf543f6bcb78d8d1ea5a8eb6bb90d62bd43e467aa14f6d6e1b2170e3a95c3f739556c26deebe0239f1d45be152eb719a2 + checksum: 47c5079ba63dcedc8193e343205b8f73c0005e53f4846edcfac6be381b95da0e9f4eb455eb0e2fa090a200225d34026ce87e3dc47c14f4ec8924fe9bcadd2d84 languageName: node linkType: hard -"react-native-web@npm:0.19.11": - version: 0.19.11 - resolution: "react-native-web@npm:0.19.11" +"react-native-web@npm:0.19.12": + version: 0.19.12 + resolution: "react-native-web@npm:0.19.12" dependencies: "@babel/runtime": ^7.18.6 "@react-native/normalize-colors": ^0.74.1 @@ -11754,7 +11840,7 @@ __metadata: peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: 5e11b8daf34c4c19cad28f355cba2791817ba09aa3ddc46ae70cf6efd83eb226166cf20e7a15e9857d5f38499f4e8a45e3d5f43645ccd7e391ca1a4c6a82b66e + checksum: 676b1ba510c92e01dc69cb3102080f83976d2d209647323fb0a3a14113a455a6a506cf78d3e392c3fa33015135b61e2d6a3eed837a6876665064a6eb87516781 languageName: node linkType: hard @@ -13761,8 +13847,8 @@ __metadata: "@radix-ui/react-dropdown-menu": ^2.0.6 "@radix-ui/react-select": ^2.0.0 "@svgr/webpack": ^8.1.0 - "@tanstack/react-query": ^5.37.1 - "@tanstack/react-query-devtools": ^5.37.1 + "@tanstack/react-query": ^5.39.0 + "@tanstack/react-query-devtools": ^5.39.0 "@types/node": 20.12.12 "@types/react-dom": 18.3.0 array-shuffle: ^3.0.0 @@ -13771,21 +13857,21 @@ __metadata: expo-linear-gradient: ^13.0.2 expo-modules-core: ^1.12.11 hls.js: ^1.5.8 - i18next: ^23.11.4 + i18next: ^23.11.5 jassub: ^1.7.15 - jotai: ^2.8.0 + jotai: ^2.8.1 moti: ^0.29.0 next: 14.2.3 next-translate: ^2.6.2 raf: ^3.4.1 react: 18.3.1 react-dom: 18.3.1 - react-i18next: ^14.1.1 + react-i18next: ^14.1.2 react-native: 0.74.1 react-native-reanimated: 3.11.0 react-native-svg: 15.3.0 - react-native-video: ^6.0.0 - react-native-web: 0.19.11 + react-native-video: ^6.1.2 + react-native-web: 0.19.12 react-tooltip: ^5.26.4 solito: ^4.2.2 srt-webvtt: "zoriya/srt-webvtt#build" From 26a3c2c9843c214f7bc662cecc354a505868146f Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 27 May 2024 15:02:28 +0200 Subject: [PATCH 4/8] Rework skeleton to use reanimated instead of moti --- front/packages/primitives/src/skeleton.tsx | 86 +++++++++++++--------- 1 file changed, 52 insertions(+), 34 deletions(-) diff --git a/front/packages/primitives/src/skeleton.tsx b/front/packages/primitives/src/skeleton.tsx index 3470a75d..7dacc764 100644 --- a/front/packages/primitives/src/skeleton.tsx +++ b/front/packages/primitives/src/skeleton.tsx @@ -19,12 +19,20 @@ */ import { LinearGradient as LG } from "expo-linear-gradient"; -import { MotiView, motify } from "moti"; -import { useState } from "react"; -import { Platform, View, type ViewProps } from "react-native"; +import { memo, useEffect } from "react"; +import { Platform, StyleSheet, View, type ViewProps } from "react-native"; +import Animated, { + SharedValue, + useAnimatedStyle, + useDerivedValue, + useSharedValue, + withDelay, + withRepeat, + withTiming, +} from "react-native-reanimated"; import { em, percent, px, rem, useYoshiki } from "yoshiki/native"; -const LinearGradient = motify(LG)(); +const LinearGradient = Animated.createAnimatedComponent(LG); export const SkeletonCss = () => ( ); +const AnimatedGradient = memo( + function Gradient({ color, width }: { color: string; width: SharedValue }) { + const mult = useSharedValue(-1); + const animated = useAnimatedStyle(() => ({ + transform: [ + { + translateX: width.value * mult.value, + }, + ], + })); + + useEffect(() => { + mult.value = withRepeat(withDelay(800, withTiming(1, { duration: 800 })), 0); + }); + + return ( + + ); + }, + function propsAreEqual(prev, next) { + return prev.color === next.color; + }, +); + export const Skeleton = ({ children, show: forcedShow, @@ -55,8 +96,7 @@ export const Skeleton = ({ variant?: "text" | "header" | "round" | "custom" | "fill" | "filltext"; }) => { const { css, theme } = useYoshiki(); - const [width, setWidth] = useState(undefined); - const perc = (v: number) => (v / 100) * width!; + const width = useSharedValue(0); if (forcedShow === undefined && children && children !== true) return <>{children}; @@ -100,13 +140,11 @@ export const Skeleton = ({ > {(forcedShow || !children || children === true) && [...Array(lines)].map((_, i) => ( - setWidth(e.nativeEvent.layout.width)} + onLayout={(e) => { + width.value = e.nativeEvent.layout.width; + }} {...css([ { bg: (theme) => theme.overlay0, @@ -127,28 +165,8 @@ export const Skeleton = ({ }, ])} > - - + + ))} {children} From 13309bce201f53c76ce922b567f3c717ec2b1f11 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 27 May 2024 15:10:50 +0200 Subject: [PATCH 5/8] Merge gradient into main skeleton element --- front/packages/primitives/src/skeleton.tsx | 58 +++++++++------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/front/packages/primitives/src/skeleton.tsx b/front/packages/primitives/src/skeleton.tsx index 7dacc764..2c29b7e8 100644 --- a/front/packages/primitives/src/skeleton.tsx +++ b/front/packages/primitives/src/skeleton.tsx @@ -50,39 +50,6 @@ export const SkeletonCss = () => ( `} ); -const AnimatedGradient = memo( - function Gradient({ color, width }: { color: string; width: SharedValue }) { - const mult = useSharedValue(-1); - const animated = useAnimatedStyle(() => ({ - transform: [ - { - translateX: width.value * mult.value, - }, - ], - })); - - useEffect(() => { - mult.value = withRepeat(withDelay(800, withTiming(1, { duration: 800 })), 0); - }); - - return ( - - ); - }, - function propsAreEqual(prev, next) { - return prev.color === next.color; - }, -); - export const Skeleton = ({ children, show: forcedShow, @@ -96,7 +63,19 @@ export const Skeleton = ({ variant?: "text" | "header" | "round" | "custom" | "fill" | "filltext"; }) => { const { css, theme } = useYoshiki(); - const width = useSharedValue(0); + const width = useSharedValue(-900); + const mult = useSharedValue(-1); + const animated = useAnimatedStyle(() => ({ + transform: [ + { + translateX: width.value * mult.value, + }, + ], + })); + + useEffect(() => { + mult.value = withRepeat(withDelay(800, withTiming(1, { duration: 800 })), 0); + }); if (forcedShow === undefined && children && children !== true) return <>{children}; @@ -165,7 +144,16 @@ export const Skeleton = ({ }, ])} > - + ))} {children} From cb96e87ad7276f53b80ee9262d0f0971e18ffdb2 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 27 May 2024 17:32:53 +0200 Subject: [PATCH 6/8] Add service in android manifest for notifications --- front/apps/mobile/app.config.ts | 15 +++++++++++++-- front/apps/mobile/package.json | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/front/apps/mobile/app.config.ts b/front/apps/mobile/app.config.ts index ecf8cb7b..85044c04 100644 --- a/front/apps/mobile/app.config.ts +++ b/front/apps/mobile/app.config.ts @@ -79,8 +79,19 @@ const config: ExpoConfig = { const withForegroundService = (c: ExpoConfig): ExpoConfig => { return withAndroidManifest(c, async (config) => { const manifest = config.modResults.manifest; - console.log(manifest); - // manifest.application!.push(); + manifest.application![0].service ??= []; + manifest.application![0].service.push({ + $: { + "android:name": "com.brentvatne.exoplayer.VideoPlaybackService", + "android:exported": "false", + "android:foregroundServiceType": "mediaPlayback", + }, + "intent-filter": [ + { + action: [{ $: { "android:name": "androidx.media3.session.MediaSessionService" } }], + }, + ], + }); return config; }); }; diff --git a/front/apps/mobile/package.json b/front/apps/mobile/package.json index 4a311326..dc3cb697 100644 --- a/front/apps/mobile/package.json +++ b/front/apps/mobile/package.json @@ -5,8 +5,8 @@ "sideEffects": false, "scripts": { "dev": "expo start", - "android": "expo start --android", - "ios": "expo start --ios", + "android": "expo run:android", + "ios": "expo run:ios", "web": "expo start --web", "build": "eas build --profile production --platform android --non-interactive --auto-submit", "build:apk": "eas build --profile preview --platform android --non-interactive --json", From a87c6d1a090314b43f506ba347df8dc813972c55 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 27 May 2024 17:33:07 +0200 Subject: [PATCH 7/8] Fix more info link in home page --- front/packages/ui/src/home/header.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/front/packages/ui/src/home/header.tsx b/front/packages/ui/src/home/header.tsx index 4613b2c5..ad0f24b9 100644 --- a/front/packages/ui/src/home/header.tsx +++ b/front/packages/ui/src/home/header.tsx @@ -90,6 +90,7 @@ export const Header = ({ )} Date: Tue, 28 May 2024 00:26:26 +0200 Subject: [PATCH 8/8] Fix types --- front/packages/ui/src/player/video.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/front/packages/ui/src/player/video.tsx b/front/packages/ui/src/player/video.tsx index 2d9ec583..fcf75d71 100644 --- a/front/packages/ui/src/player/video.tsx +++ b/front/packages/ui/src/player/video.tsx @@ -179,7 +179,6 @@ export const QualitiesMenu = (props: CustomMenu) => { }} /> {/* TODO: Support video tracks when the play mode is not hls. */} - {/* @ts-expect-error They forgot to type this. */} {info?.videoTracks .sort((a: any, b: any) => b.height - a.height) .map((x: any, i: number) => (