first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

2
node_modules/expo-asset/.eslintrc.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
// @generated by expo-module-scripts
module.exports = require('expo-module-scripts/eslintrc.base.js');

470
node_modules/expo-asset/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,470 @@
# Changelog
## Unpublished
### 🛠 Breaking changes
### 🎉 New features
### 🐛 Bug fixes
### 💡 Others
## 55.0.8 — 2026-02-26
_This version does not introduce any user-facing changes._
## 55.0.7 — 2026-02-25
_This version does not introduce any user-facing changes._
## 55.0.6 — 2026-02-20
_This version does not introduce any user-facing changes._
## 55.0.5 — 2026-02-16
_This version does not introduce any user-facing changes._
## 55.0.4 — 2026-02-08
_This version does not introduce any user-facing changes._
## 55.0.3 — 2026-02-03
_This version does not introduce any user-facing changes._
## 55.0.2 — 2026-01-26
_This version does not introduce any user-facing changes._
## 55.0.1 — 2026-01-22
_This version does not introduce any user-facing changes._
## 55.0.0 — 2026-01-21
### 🐛 Bug fixes
- [Android] Fix asset loading when Metro server runs over HTTPS by deriving scheme from `manifestBaseUrl` instead of hardcoding `http://`. ([#42184](https://github.com/expo/expo/pull/42184) by [@ink404](https://github.com/ink404))
### 💡 Others
- validate asset names with `isAndroidAssetNameValid` from `expo/config-plugins` ([#39883](https://github.com/expo/expo/pull/39883) by [@vonovak](https://github.com/vonovak))
## 12.0.11 - 2025-12-05
_This version does not introduce any user-facing changes._
## 12.0.10 - 2025-11-17
_This version does not introduce any user-facing changes._
## 12.0.9 - 2025-09-18
_This version does not introduce any user-facing changes._
## 12.0.8 — 2025-09-10
_This version does not introduce any user-facing changes._
## 12.0.7 — 2025-09-02
_This version does not introduce any user-facing changes._
## 12.0.6 — 2025-08-31
_This version does not introduce any user-facing changes._
## 12.0.5 — 2025-08-27
_This version does not introduce any user-facing changes._
## 12.0.4 — 2025-08-25
_This version does not introduce any user-facing changes._
## 12.0.3 — 2025-08-21
_This version does not introduce any user-facing changes._
## 12.0.2 — 2025-08-16
_This version does not introduce any user-facing changes._
## 12.0.1 — 2025-08-15
_This version does not introduce any user-facing changes._
## 12.0.0 — 2025-08-13
### 🎉 New features
- Add resource name validation for Android. ([#37322](https://github.com/expo/expo/pull/37322) by [@aleqsio](https://github.com/aleqsio))
### 🐛 Bug fixes
- [Android] fix file scheme handling in `downloadAsync` ([#38227](https://github.com/expo/expo/pull/38227) by [@vonovak](https://github.com/vonovak))
### 💡 Others
- [android] throw when loading empty font file ([#38229](https://github.com/expo/expo/pull/38229) by [@vonovak](https://github.com/vonovak))
- Update remaining `@expo/config-plugins` in config plugin to `expo/config-plugins` ([#38580](https://github.com/expo/expo/pull/38580) by [@kitten](https://github.com/kitten))
## 11.1.7 - 2025-07-03
_This version does not introduce any user-facing changes._
## 11.1.6 - 2025-07-01
### 💡 Others
- Remove "Please" from warnings and errors ([#36862](https://github.com/expo/expo/pull/36862) by [@brentvatne](https://github.com/brentvatne))
## 11.1.5 — 2025-05-03
_This version does not introduce any user-facing changes._
## 11.1.4 — 2025-04-30
_This version does not introduce any user-facing changes._
## 11.1.3 — 2025-04-25
_This version does not introduce any user-facing changes._
## 11.1.2 — 2025-04-14
### 💡 Others
- Added `file:///android_res/` format support. ([#36058](https://github.com/expo/expo/pull/36058) by [@kudo](https://github.com/kudo))
## 11.1.1 — 2025-04-09
_This version does not introduce any user-facing changes._
## 11.1.0 — 2025-04-04
### 🛠 Breaking changes
- Bump minimum macOS version to 11.0. ([#34980](https://github.com/expo/expo/pull/34980) by [@gabrieldonadel](https://github.com/gabrieldonadel))
### 🎉 New features
- Add RSC support. ([#34213](https://github.com/expo/expo/pull/34213) by [@EvanBacon](https://github.com/EvanBacon))
- Add .riv to accepted media types ([#35758](https://github.com/expo/expo/pull/35758) by [@alextoudic](https://github.com/alextoudic))
### 🐛 Bug fixes
- [macOS] Add macOS platform support ([#33505](https://github.com/expo/expo/pull/33505) by [@hassankhan](https://github.com/hassankhan))
### 💡 Others
- Deprecate `expo-asset/tools/hashAssetFiles` in favor of built-in hashing support in `expo/metro-config`. ([#34208](https://github.com/expo/expo/pull/34208) by [@EvanBacon](https://github.com/EvanBacon))
- [Android] Started using expo modules gradle plugin. ([#34176](https://github.com/expo/expo/pull/34176) by [@lukmccall](https://github.com/lukmccall))
- Drop `invariant` and `md5-file` dependencies. ([#35328](https://github.com/expo/expo/pull/35328) by [@kitten](https://github.com/kitten))
- [iOS] Fix warnings which will become errors in Swift 6. ([#35288](https://github.com/expo/expo/pull/35288) by [@behenate](https://github.com/behenate))
## 11.0.5 - 2025-03-20
_This version does not introduce any user-facing changes._
## 11.0.4 - 2025-02-19
_This version does not introduce any user-facing changes._
## 11.0.3 - 2025-01-31
_This version does not introduce any user-facing changes._
## 11.0.2 - 2025-01-10
_This version does not introduce any user-facing changes._
## 11.0.1 — 2024-11-10
### 🐛 Bug fixes
- Add support for simplified object asset format. ([#32728](https://github.com/expo/expo/pull/32728) by [@EvanBacon](https://github.com/EvanBacon))
## 11.0.0 — 2024-10-22
### 🛠 Breaking changes
- Bumped iOS and tvOS deployment target to 15.1. ([#30840](https://github.com/expo/expo/pull/30840) by [@tsapeta](https://github.com/tsapeta))
### 🐛 Bug fixes
- Add missing dependencies and follow proper dependency chains. ([#30500](https://github.com/expo/expo/pull/30500) by [@byCedric](https://github.com/byCedric))
### 💡 Others
- Remove unused `pathJoin` function. ([#29963](https://github.com/expo/expo/pull/29963) by [@EvanBacon](https://github.com/EvanBacon))
- Replaced `@testing-library/react-hooks` with `@testing-library/react-native`. ([#30742](https://github.com/expo/expo/pull/30742) by [@byCedric](https://github.com/byCedric))
## 10.0.10 - 2024-06-20
### 🐛 Bug fixes
- Fixed `PlatformUtils.ts` to have the correct export placeholders for react-native-web ([#29791](https://github.com/expo/expo/pull/29791) by [@Bram-dc](https://github.com/Bram-dc))
- Add missing `react` and `react-native` peer dependencies for isolated modules. ([#30454](https://github.com/expo/expo/pull/30454) by [@byCedric](https://github.com/byCedric))
## 10.0.9 - 2024-06-13
### 💡 Others
- Removed @react-native/assets-registry dependency. ([#29541](https://github.com/expo/expo/pull/29541) by [@kudo](https://github.com/kudo))
## 10.0.8 - 2024-06-06
_This version does not introduce any user-facing changes._
## 10.0.7 - 2024-06-05
### 💡 Others
- Pin @react-native subpackage versions to 0.74.83. ([#29441](https://github.com/expo/expo/pull/29441) by [@kudo](https://github.com/kudo))
## 10.0.6 — 2024-05-03
### 🐛 Bug fixes
- Fixed `downloadAsync()` does not support Android resources from release builds. ([#28604](https://github.com/expo/expo/pull/28604) by [@kudo](https://github.com/kudo))
## 10.0.5 — 2024-05-02
_This version does not introduce any user-facing changes._
## 10.0.4 — 2024-05-01
_This version does not introduce any user-facing changes._
## 10.0.3 — 2024-04-24
### 🐛 Bug fixes
- Fix `TypeError: (0, _ExpoAsset.downloadAsync) is not a function` when loading assets using Expo Web. ([#28405](https://github.com/expo/expo/pull/28405) by [@jamiees2](https://github.com/jamiees2))
### 💡 Others
- Update mocks for SDK51. ([#28424](https://github.com/expo/expo/pull/28424) by [@aleqsio](https://github.com/aleqsio))
## 10.0.2 — 2024-04-23
_This version does not introduce any user-facing changes._
## 10.0.1 — 2024-04-22
_This version does not introduce any user-facing changes._
## 10.0.0 — 2024-04-18
### 🎉 New features
- Added config plugin to allow assets to be linked at build time. ([#27052](https://github.com/expo/expo/pull/27052) by [@alanjhughes](https://github.com/alanjhughes))
- Add Apple TV support to the new iOS native module. ([#27823](https://github.com/expo/expo/pull/27823) by [@douglowder](https://github.com/douglowder))
### 🐛 Bug fixes
- Fixed "Tried to resolve a promise more than once" crash on iOS. ([#27672](https://github.com/expo/expo/pull/27672) by [@kudo](https://github.com/kudo))
### 💡 Others
- Create native module for iOS and Android. Migrate `downloadAsync` to a native implementation. ([#27369](https://github.com/expo/expo/pull/27369) by [@aleqsio](https://github.com/aleqsio))
- Remove MD5 checksum verification for remote assets. This does not change method signatures nor require changes to your application code, and should not affect any apps in practice since this behavior was used only for apps that used Classic Updates, support for which ended with SDK 50. ([#25614](https://github.com/expo/expo/pull/25614) by [@ide](https://github.com/ide))
- [expo-updates] Migrate to requireNativeModule/requireOptionalNativeModule. ([#25648](https://github.com/expo/expo/pull/25648) by [@wschurman](https://github.com/wschurman))
- Clean up some asset stuff. ([#26310](https://github.com/expo/expo/pull/26310) by [@wschurman](https://github.com/wschurman))
- Remove most of Constants.appOwnership. ([#26313](https://github.com/expo/expo/pull/26313) by [@wschurman](https://github.com/wschurman))
- Remove assetUrlOverride and assetMapOverride. ([#26314](https://github.com/expo/expo/pull/26314) by [@wschurman](https://github.com/wschurman))
- Improve updates types and clarity in expo-asset. ([#26337](https://github.com/expo/expo/pull/26337) by [@wschurman](https://github.com/wschurman))
- Removed deprecated backward compatible Gradle settings. ([#28083](https://github.com/expo/expo/pull/28083) by [@kudo](https://github.com/kudo))
## 9.0.2 - 2024-01-05
### 🐛 Bug fixes
- Fix relative URLs and support for `unstable_path` in development. ([#26084](https://github.com/expo/expo/pull/26084) by [@EvanBacon](https://github.com/EvanBacon))
## 9.0.1 — 2023-12-13
_This version does not introduce any user-facing changes._
## 9.0.0 — 2023-12-12
### 🛠 Breaking changes
- Removed support for the Classic Updates service for SDK 50 ([announcement](https://blog.expo.dev/sunsetting-expo-publish-and-classic-updates-6cb9cd295378)). Specifically, references to the Classic Updates CDN were removed. [Migrate](https://docs.expo.dev/eas-update/migrate-from-classic-updates/) to EAS or other service that conforms to the modern [Expo Updates protocol](https://docs.expo.dev/technical-specs/expo-updates-1/). ([#25613](https://github.com/expo/expo/pull/25613) by [@ide](https://github.com/ide))
### 🎉 New features
- Added support for React Native 0.73.0. ([#24971](https://github.com/expo/expo/pull/24971), [#25453](https://github.com/expo/expo/pull/25453) by [@gabrieldonadel](https://github.com/gabrieldonadel))
### 💡 Others
- Removed references to legacy `bundledAssets` constant from `expo-file-system` that was used only in standalone apps. ([#25484](https://github.com/expo/expo/pull/25484) by [@tsapeta](https://github.com/tsapeta))
## 8.14.0 — 2023-11-14
### 🐛 Bug fixes
- fix URLs in development. ([#25202](https://github.com/expo/expo/pull/25202) by [@EvanBacon](https://github.com/EvanBacon))
### 💡 Others
- Collapse re-export of `react-native/Libraries/Image/AssetRegistry` to `@react-native/assets-registry/registry`. ([#25265](https://github.com/expo/expo/pull/25265) by [@EvanBacon](https://github.com/EvanBacon))
- Migrate to new standard `URL` support on native. ([#24941](https://github.com/expo/expo/pull/24941) by [@EvanBacon](https://github.com/EvanBacon))
- Renamed `unimodule.json` to `expo-module.config.json`. ([#25100](https://github.com/expo/expo/pull/25100) by [@reichhartd](https://github.com/reichhartd))
## 8.13.0 — 2023-10-17
### 🐛 Bug fixes
- URL encode asset paths defined as query parameter. ([#24562](https://github.com/expo/expo/pull/24562) by [@byCedric](https://github.com/byCedric))
## 8.12.1 — 2023-09-16
_This version does not introduce any user-facing changes._
## 8.12.0 — 2023-09-04
### 🛠 Breaking changes
- Convert `../` to `_` for the property `httpServerLocation` in `hashAssetFiles` (Metro asset pre-processor) to support assets in monorepos the same everywhere. ([#24090](https://github.com/expo/expo/pull/24090) by [@EvanBacon](https://github.com/EvanBacon))
## 8.11.0 — 2023-08-02
_This version does not introduce any user-facing changes._
## 8.10.1 — 2023-06-24
_This version does not introduce any user-facing changes._
## 8.10.0 — 2023-06-13
_This version does not introduce any user-facing changes._
## 8.9.2 — 2023-05-08
### 🐛 Bug fixes
- Fixed monorepo asset resolution in production for Metro web. ([#22094](https://github.com/expo/expo/pull/22094) by [@EvanBacon](https://github.com/EvanBacon))
## 8.9.1 - 2023-03-08
### 🐛 Bug fixes
- Fixed `@react-native/assets-registry` module not found issue on Web. ([#21469](https://github.com/expo/expo/pull/21469) by [@kudo](https://github.com/kudo))
## 8.9.0 — 2023-02-09
_This version does not introduce any user-facing changes._
## 8.8.0 — 2023-02-03
### 🐛 Bug fixes
- Fix loading Metro web assets from origins other than `/`. ([#20258](https://github.com/expo/expo/pull/20258) by [@EvanBacon](https://github.com/EvanBacon))
### 💡 Others
- Remove unused web features. ([#20258](https://github.com/expo/expo/pull/20258) by [@EvanBacon](https://github.com/EvanBacon))
## 8.6.2 — 2022-10-25
_This version does not introduce any user-facing changes._
## 8.6.1 — 2022-07-19
_This version does not introduce any user-facing changes._
## 8.6.0 — 2022-07-07
_This version does not introduce any user-facing changes._
## 8.5.0 — 2022-04-18
### 💡 Others
- Swap out Cloudfront CDN for `classic-assets.eascdn.net`. ([#15781](https://github.com/expo/expo/pull/15781)) by [@quinlanj](https://github.com/quinlanj)
## 8.4.6 - 2022-01-13
### 🐛 Bug fixes
- Fix missing `getManifest2()` function on web. ([#15891](https://github.com/expo/expo/pull/15891)) by [@jonsamp](https://github.com/jonsamp) ([#15891](https://github.com/expo/expo/pull/15891) by [@jonsamp](https://github.com/jonsamp))
## 8.4.5 — 2021-12-21
### 🐛 Bug fixes
- Fix an issue preventing the loading of assets using expo-updates manifests during local development. ([#15667](https://github.com/expo/expo/pull/15667)) by [@jonsamp](https://github.com/jonsamp)
## 8.4.4 — 2021-11-17
### 🐛 Bug fixes
- Fix `fromModule` on restrictive (Snack) web environments. ([#14435](https://github.com/expo/expo/pull/14435) by [@IjzerenHein](https://github.com/IjzerenHein))
## 8.4.1 — 2021-10-01
### 💡 Others
- Updated `@testing-library/react-hooks` to version `7.0.1`. ([#14552](https://github.com/expo/expo/pull/14552)) by [@Simek](https://github.com/Simek))
## 8.4.0 — 2021-09-08
### 🎉 New features
- Reapply [#12624](https://github.com/expo/expo/pull/12624) ([#13789](https://github.com/expo/expo/pull/13789) by [@jkhales](https://github.com/jkhales))
## 8.3.2 — 2021-04-21
### 🎉 New features
- Find local assets without extensions. ([#12624](https://github.com/expo/expo/pull/12624) by [@jkhales](https://github.com/jkhales))
## 8.3.1 — 2021-03-23
### 🐛 Bug fixes
- Removed annoying yellowbox warning message in bare workflow when there's no manifest available. ([#12237](https://github.com/expo/expo/pull/12237) by [@bbarthec](https://github.com/bbarthec))
## 8.3.0 — 2021-03-10
### 🐛 Bug fixes
- Remove peerDependencies and unimodulePeerDependencies from Expo modules. ([#11980](https://github.com/expo/expo/pull/11980) by [@brentvatne](https://github.com/brentvatne))
## 8.2.2 — 2021-01-15
_This version does not introduce any user-facing changes._
## 8.2.1 — 2020-11-17
_This version does not introduce any user-facing changes._
## 8.2.0 — 2020-08-18
### 🎉 New features
- Add `useAssets` hook to simplify assets handling. ([#8928](https://github.com/expo/expo/pull/8928) by [@bycedric](https://github.com/bycedric))
### 🐛 Bug fixes
- Fixed `Asset.loadAsync()` TypeScript signature to match `Asset.fromModule()` types. ([#9246](https://github.com/expo/expo/pull/9246) by [@barthap](https://github.com/barthap))
## 8.1.7 — 2020-05-29
_This version does not introduce any user-facing changes._
## 8.1.6 — 2020-05-27
_This version does not introduce any user-facing changes._
## 8.1.5
### 🎉 New features
- `asset.downloadAsync()` returns the resolved `Asset` when it resolves. ([#8646](https://github.com/expo/expo/pull/8646) by [@EvanBacon](https://github.com/EvanBacon))
- `Asset.loadAsync()` returns an array of resolved `Asset`s when it finishes loading the resources. ([#8646](https://github.com/expo/expo/pull/8646) by [@EvanBacon](https://github.com/EvanBacon))
- Added support for the `expo-updates` **no-publish workflow**. ([#8003](https://github.com/expo/expo/pull/8003) by [@esamelson](https://github.com/esamelson))

26
node_modules/expo-asset/README.md generated vendored Normal file
View File

@@ -0,0 +1,26 @@
# expo-asset
An Expo universal module to download assets and pass them into other APIs
# API documentation
- [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/asset/)
- [Documentation for the main branch](https://docs.expo.dev/versions/unversioned/sdk/asset/)
# Installation in managed Expo projects
For [managed](https://docs.expo.dev/archive/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/asset/). If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
# Installation in bare React Native projects
For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
### Add the package to your npm dependencies
```
npx expo install expo-asset
```
# Contributing
Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).

22
node_modules/expo-asset/android/build.gradle generated vendored Normal file
View File

@@ -0,0 +1,22 @@
plugins {
id 'com.android.library'
id 'expo-module-gradle-plugin'
}
group = 'expo.modules.asset'
version = '55.0.8'
android {
namespace "expo.modules.asset"
defaultConfig {
versionCode 1
versionName "55.0.8"
}
}
dependencies {
testImplementation 'io.mockk:mockk:1.13.11'
testImplementation 'androidx.test:core:1.7.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.16'
}

View File

@@ -0,0 +1,2 @@
<manifest>
</manifest>

View File

@@ -0,0 +1,105 @@
package expo.modules.asset
import android.content.Context
import android.net.Uri
import android.util.Log
import expo.modules.kotlin.AppContext
import expo.modules.kotlin.exception.CodedException
import expo.modules.kotlin.exception.Exceptions
import expo.modules.kotlin.functions.Coroutine
import expo.modules.kotlin.modules.Module
import expo.modules.kotlin.modules.ModuleDefinition
import expo.modules.kotlin.services.FilePermissionService
import kotlinx.coroutines.withContext
import java.io.File
import java.io.FileInputStream
import java.net.URI
import java.security.DigestInputStream
import java.security.MessageDigest
internal class UnableToDownloadAssetException(url: String) :
CodedException("Unable to download asset from url: $url")
class AssetModule : Module() {
private val context: Context
get() = appContext.reactContext ?: throw Exceptions.AppContextLost()
private fun getMD5HashOfFilePath(uri: URI): String {
val md = MessageDigest.getInstance("MD5")
return md.digest(uri.toString().toByteArray()).joinToString("") { "%02x".format(it) }
}
private fun getMD5HashOfFileContent(file: File): String? {
return try {
FileInputStream(file).use { inputStream ->
DigestInputStream(
inputStream,
MessageDigest.getInstance("MD5")
).use { digestInputStream ->
digestInputStream.messageDigest.digest().joinToString(separator = "") { "%02x".format(it) }
}
}
} catch (e: Exception) {
e.printStackTrace()
null
}
}
private suspend fun downloadAsset(appContext: AppContext, uri: URI, localUrl: File): Uri {
if (localUrl.parentFile?.exists() != true) {
localUrl.mkdirs()
}
if (!appContext.filePermission.getPathPermissions(context, requireNotNull(localUrl.parent))
.contains(FilePermissionService.Permission.WRITE)
) {
throw UnableToDownloadAssetException(uri.toString())
}
return withContext(appContext.backgroundCoroutineScope.coroutineContext) {
try {
val inputStream = when {
uri.toString().contains(":").not() -> openAssetResourceStream(context, uri.toString())
uri.toString().startsWith(ANDROID_EMBEDDED_URL_BASE_RESOURCE) -> openAndroidResStream(context, uri.toString())
else -> uri.toURL().openStream()
}
inputStream.use { input ->
localUrl.outputStream().use { output ->
val bytesCopied = input.copyTo(output)
if (bytesCopied == 0L) {
Log.w("ExpoAsset", "Asset downloaded to $localUrl is empty. It might be conflicting with another asset, or corrupted.")
}
}
}
Uri.fromFile(localUrl)
} catch (e: Exception) {
throw UnableToDownloadAssetException(uri.toString())
}
}
}
override fun definition() = ModuleDefinition {
Name("ExpoAsset")
AsyncFunction("downloadAsync") Coroutine { uri: URI, md5Hash: String?, type: String ->
if (uri.scheme == "file" && !uri.toString().startsWith(ANDROID_EMBEDDED_URL_BASE_RESOURCE)) {
return@Coroutine uri
}
val cacheFileId = md5Hash ?: getMD5HashOfFilePath(uri)
val cacheDirectory = appContext.cacheDirectory
val localUrl = File("$cacheDirectory/ExponentAsset-$cacheFileId.$type")
if (!localUrl.exists()) {
return@Coroutine downloadAsset(appContext, uri, localUrl)
}
if (md5Hash == null || md5Hash == getMD5HashOfFileContent(localUrl)) {
return@Coroutine Uri.fromFile(localUrl)
}
return@Coroutine downloadAsset(appContext, uri, localUrl)
}
}
}

View File

@@ -0,0 +1,61 @@
package expo.modules.asset
import android.annotation.SuppressLint
import android.content.Context
import android.content.res.Resources
import androidx.core.net.toUri
import expo.modules.core.errors.InvalidArgumentException
import java.io.InputStream
internal const val ANDROID_EMBEDDED_URL_BASE_RESOURCE = "file:///android_res/"
/**
* Opens an Android resource as stream.
*/
internal fun openAssetResourceStream(context: Context, assetName: String): InputStream {
val resId = findResourceId(context, assetName) ?: throw Resources.NotFoundException(assetName)
return context.resources.openRawResource(resId)
}
/**
* Opens an Android resource as stream for `file:///android_res/` format
*/
internal fun openAndroidResStream(context: Context, resourceFilePath: String): InputStream {
val resId = findResourceIdForAndroidResPath(context, resourceFilePath)
?: throw Resources.NotFoundException(resourceFilePath)
return context.resources.openRawResource(resId)
}
@SuppressLint("DiscouragedApi")
private fun findResourceId(context: Context, assetName: String): Int? {
val resources = context.resources
val packageName = context.packageName
// react-native core and expo-assets plugin will put resource in `res/raw` or `res/drawable`
return resources.getIdentifier(assetName, "raw", packageName).takeIf { it != 0 }
?: resources.getIdentifier(assetName, "drawable", packageName).takeIf { it != 0 }
}
@SuppressLint("DiscouragedApi")
private fun findResourceIdForAndroidResPath(context: Context, resourceFilePath: String): Int? {
if (!resourceFilePath.startsWith(ANDROID_EMBEDDED_URL_BASE_RESOURCE)) {
throw InvalidArgumentException("Invalid resource file path: $resourceFilePath")
}
val uri = resourceFilePath.toUri()
val pathSegments = uri.pathSegments
if (pathSegments.size < 3) {
throw InvalidArgumentException("Invalid resource file path: $resourceFilePath")
}
// Strip any qualifiers after a dash, for example "drawable-xhdpi" becomes "drawable"
val resourceDirectory = pathSegments[1].substringBefore('-')
// Strip file extension for resource name
val resourceFilename = pathSegments[2]
val resourceName = resourceFilename.substringBeforeLast('.', resourceFilename)
return context.resources.getIdentifier(
resourceName,
resourceDirectory,
context.packageName
).takeIf { it != 0 }
}

1
node_modules/expo-asset/app.plugin.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require('./plugin/build/withAssets');

109
node_modules/expo-asset/build/Asset.d.ts generated vendored Normal file
View File

@@ -0,0 +1,109 @@
import { AssetMetadata } from './AssetSources';
export type AssetDescriptor = {
name: string;
type: string;
hash?: string | null;
uri: string;
width?: number | null;
height?: number | null;
};
export { AssetMetadata };
/**
* Android resource URL prefix.
* @hidden
*/
export declare const ANDROID_EMBEDDED_URL_BASE_RESOURCE = "file:///android_res/";
/**
* The `Asset` class represents an asset in your app. It gives metadata about the asset (such as its
* name and type) and provides facilities to load the asset data.
*/
export declare class Asset {
private static byHash;
private static byUri;
/**
* The name of the asset file without the extension. Also without the part from `@` onward in the
* filename (used to specify scale factor for images).
*/
name: string;
/**
* The extension of the asset filename.
*/
readonly type: string;
/**
* The MD5 hash of the asset's data.
*/
readonly hash: string | null;
/**
* A URI that points to the asset's data on the remote server. When running the published version
* of your app, this refers to the location on Expo's asset server where Expo has stored your
* asset. When running the app from Expo CLI during development, this URI points to Expo CLI's
* server running on your computer and the asset is served directly from your computer. If you
* are not using Classic Updates (legacy), this field should be ignored as we ensure your assets
* are on device before running your application logic.
*/
readonly uri: string;
/**
* If the asset has been downloaded (by calling [`downloadAsync()`](#downloadasync)), the
* `file://` URI pointing to the local file on the device that contains the asset data.
*/
localUri: string | null;
/**
* If the asset is an image, the width of the image data divided by the scale factor. The scale
* factor is the number after `@` in the filename, or `1` if not present.
*/
width: number | null;
/**
* If the asset is an image, the height of the image data divided by the scale factor. The scale factor is the number after `@` in the filename, or `1` if not present.
*/
height: number | null;
private downloading;
/**
* Whether the asset has finished downloading from a call to [`downloadAsync()`](#downloadasync).
*/
downloaded: boolean;
private _downloadCallbacks;
constructor({ name, type, hash, uri, width, height }: AssetDescriptor);
/**
* A helper that wraps `Asset.fromModule(module).downloadAsync` for convenience.
* @param moduleId An array of `require('path/to/file')` or external network URLs. Can also be
* just one module or URL without an Array.
* @return Returns a Promise that fulfills with an array of `Asset`s when the asset(s) has been
* saved to disk.
* @example
* ```ts
* const [{ localUri }] = await Asset.loadAsync(require('./assets/snack-icon.png'));
* ```
*/
static loadAsync(moduleId: number | number[] | string | string[]): Promise<Asset[]>;
/**
* Returns the [`Asset`](#asset) instance representing an asset given its module or URL.
* @param virtualAssetModule The value of `require('path/to/file')` for the asset or external
* network URL
* @return The [`Asset`](#asset) instance for the asset.
*/
static fromModule(virtualAssetModule: number | string | {
uri: string;
width: number;
height: number;
}): Asset;
static fromMetadata(meta: AssetMetadata): Asset;
static fromURI(uri: string): Asset;
/**
* Downloads the asset data to a local file in the device's cache directory. Once the returned
* promise is fulfilled without error, the [`localUri`](#localuri) field of this asset points
* to a local file containing the asset data. The asset is only downloaded if an up-to-date local
* file for the asset isn't already present due to an earlier download. The downloaded `Asset`
* will be returned when the promise is resolved.
*
* > **Note:** There is no guarantee that files downloaded via `downloadAsync` persist between app sessions.
* `downloadAsync` stores files in the caches directory, so it's up to the OS to clear this folder at its
* own discretion or when the user manually purges the caches directory. Downloaded assets are stored as
* `ExponentAsset-{cacheFileId}.{extension}` within the cache directory.
* > To manually clear cached assets, you can use [`expo-file-system`](./filesystem/) to
* delete the cache directory: `Paths.cache.delete()` or use the legacy API `deleteAsync(cacheDirectory)`.
*
* @return Returns a Promise which fulfills with an `Asset` instance.
*/
downloadAsync(): Promise<this>;
}
//# sourceMappingURL=Asset.d.ts.map

1
node_modules/expo-asset/build/Asset.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../src/Asset.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAqB,MAAM,gBAAgB,CAAC;AASlE,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAOF,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;GAGG;AACH,eAAO,MAAM,kCAAkC,yBAAyB,CAAC;AAEzE;;;GAGG;AACH,qBAAa,KAAK;IAChB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAyC;IAC9D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAyC;IAE7D;;;OAGG;IACI,IAAI,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC3C;;;;;;;OAOG;IACH,SAAgB,GAAG,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACI,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtC;;;OAGG;IACI,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IACnC;;OAEG;IACI,MAAM,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEpC,OAAO,CAAC,WAAW,CAAkB;IAErC;;OAEG;IACI,UAAU,EAAE,OAAO,CAAS;IAEnC,OAAO,CAAC,kBAAkB,CAAkC;gBAEhD,EAAE,IAAI,EAAE,IAAI,EAAE,IAAW,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,eAAe;IAmC5E;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAMnF;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CACf,kBAAkB,EAAE,MAAM,GAAG,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GACnF,KAAK;IAwDR,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,KAAK;IAuB/C,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK;IA2BlC;;;;;;;;;;;;;;;OAeG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;CAoCrC"}

2
node_modules/expo-asset/build/Asset.fx.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=Asset.fx.d.ts.map

1
node_modules/expo-asset/build/Asset.fx.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Asset.fx.d.ts","sourceRoot":"","sources":["../src/Asset.fx.ts"],"names":[],"mappings":""}

29
node_modules/expo-asset/build/Asset.fx.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
import { Asset, ANDROID_EMBEDDED_URL_BASE_RESOURCE } from './Asset';
import { IS_ENV_WITH_LOCAL_ASSETS } from './PlatformUtils';
import resolveAssetSource, { setCustomSourceTransformer } from './resolveAssetSource';
// Override React Native's asset resolution for `Image` components in contexts where it matters
if (IS_ENV_WITH_LOCAL_ASSETS) {
const setTransformer = resolveAssetSource.setCustomSourceTransformer || setCustomSourceTransformer;
setTransformer(function expoAssetTransformer(resolver) {
try {
// Bundler is using the hashAssetFiles plugin if and only if the fileHashes property exists
if ('fileHashes' in resolver.asset && resolver.asset.fileHashes) {
const asset = Asset.fromMetadata(resolver.asset);
if (asset.uri.startsWith(ANDROID_EMBEDDED_URL_BASE_RESOURCE)) {
// TODO(@kitten): See https://github.com/expo/expo/commit/ec940b57a87d99ab4f1d06d87126e662c3f04f04#r155340943
// It's unclear whether this is sound since this may be our own AssetSourceResolver, which doesn't have this method
// Please compare `AssetSourceResolver` type from `react-native/Libraries/Image/AssetSourceResolver` against `./AssetSourceResolver`
return resolver.resourceIdentifierWithoutScale();
}
return resolver.fromSource(asset.downloaded ? asset.localUri : asset.uri);
}
else {
return resolver.defaultAsset();
}
}
catch {
return resolver.defaultAsset();
}
});
}
//# sourceMappingURL=Asset.fx.js.map

1
node_modules/expo-asset/build/Asset.fx.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Asset.fx.js","sourceRoot":"","sources":["../src/Asset.fx.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,kCAAkC,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,kBAAkB,EAAE,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAEtF,+FAA+F;AAC/F,IAAI,wBAAwB,EAAE,CAAC;IAC7B,MAAM,cAAc,GAClB,kBAAkB,CAAC,0BAA0B,IAAI,0BAA0B,CAAC;IAC9E,cAAc,CAAC,SAAS,oBAAoB,CAAC,QAAQ;QACnD,IAAI,CAAC;YACH,2FAA2F;YAC3F,IAAI,YAAY,IAAI,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;gBAChE,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACjD,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,kCAAkC,CAAC,EAAE,CAAC;oBAC7D,6GAA6G;oBAC7G,mHAAmH;oBACnH,oIAAoI;oBACpI,OACE,QACD,CAAC,8BAA8B,EAAS,CAAC;gBAC5C,CAAC;gBACD,OAAO,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,QAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC7E,CAAC;iBAAM,CAAC;gBACN,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;YACjC,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;QACjC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { default as AssetSourceResolver } from 'react-native/Libraries/Image/AssetSourceResolver';\n\nimport { Asset, ANDROID_EMBEDDED_URL_BASE_RESOURCE } from './Asset';\nimport { IS_ENV_WITH_LOCAL_ASSETS } from './PlatformUtils';\nimport resolveAssetSource, { setCustomSourceTransformer } from './resolveAssetSource';\n\n// Override React Native's asset resolution for `Image` components in contexts where it matters\nif (IS_ENV_WITH_LOCAL_ASSETS) {\n const setTransformer =\n resolveAssetSource.setCustomSourceTransformer || setCustomSourceTransformer;\n setTransformer(function expoAssetTransformer(resolver) {\n try {\n // Bundler is using the hashAssetFiles plugin if and only if the fileHashes property exists\n if ('fileHashes' in resolver.asset && resolver.asset.fileHashes) {\n const asset = Asset.fromMetadata(resolver.asset);\n if (asset.uri.startsWith(ANDROID_EMBEDDED_URL_BASE_RESOURCE)) {\n // TODO(@kitten): See https://github.com/expo/expo/commit/ec940b57a87d99ab4f1d06d87126e662c3f04f04#r155340943\n // It's unclear whether this is sound since this may be our own AssetSourceResolver, which doesn't have this method\n // Please compare `AssetSourceResolver` type from `react-native/Libraries/Image/AssetSourceResolver` against `./AssetSourceResolver`\n return (\n resolver as unknown as AssetSourceResolver\n ).resourceIdentifierWithoutScale() as any;\n }\n return resolver.fromSource(asset.downloaded ? asset.localUri! : asset.uri);\n } else {\n return resolver.defaultAsset();\n }\n } catch {\n return resolver.defaultAsset();\n }\n });\n}\n"]}

263
node_modules/expo-asset/build/Asset.js generated vendored Normal file
View File

@@ -0,0 +1,263 @@
import { getAssetByID } from '@react-native/assets-registry/registry';
import { Platform } from 'expo-modules-core';
import { selectAssetSource } from './AssetSources';
import * as AssetUris from './AssetUris';
import { downloadAsync } from './ExpoAsset';
import * as ImageAssets from './ImageAssets';
import { getLocalAssetUri } from './LocalAssets';
import { IS_ENV_WITH_LOCAL_ASSETS } from './PlatformUtils';
import resolveAssetSource from './resolveAssetSource';
/**
* Android resource URL prefix.
* @hidden
*/
export const ANDROID_EMBEDDED_URL_BASE_RESOURCE = 'file:///android_res/';
/**
* The `Asset` class represents an asset in your app. It gives metadata about the asset (such as its
* name and type) and provides facilities to load the asset data.
*/
export class Asset {
static byHash = {};
static byUri = {};
/**
* The name of the asset file without the extension. Also without the part from `@` onward in the
* filename (used to specify scale factor for images).
*/
name;
/**
* The extension of the asset filename.
*/
type;
/**
* The MD5 hash of the asset's data.
*/
hash = null;
/**
* A URI that points to the asset's data on the remote server. When running the published version
* of your app, this refers to the location on Expo's asset server where Expo has stored your
* asset. When running the app from Expo CLI during development, this URI points to Expo CLI's
* server running on your computer and the asset is served directly from your computer. If you
* are not using Classic Updates (legacy), this field should be ignored as we ensure your assets
* are on device before running your application logic.
*/
uri;
/**
* If the asset has been downloaded (by calling [`downloadAsync()`](#downloadasync)), the
* `file://` URI pointing to the local file on the device that contains the asset data.
*/
localUri = null;
/**
* If the asset is an image, the width of the image data divided by the scale factor. The scale
* factor is the number after `@` in the filename, or `1` if not present.
*/
width = null;
/**
* If the asset is an image, the height of the image data divided by the scale factor. The scale factor is the number after `@` in the filename, or `1` if not present.
*/
height = null;
downloading = false;
/**
* Whether the asset has finished downloading from a call to [`downloadAsync()`](#downloadasync).
*/
downloaded = false;
_downloadCallbacks = [];
constructor({ name, type, hash = null, uri, width, height }) {
this.name = name;
this.type = type;
this.hash = hash;
this.uri = uri;
if (typeof width === 'number') {
this.width = width;
}
if (typeof height === 'number') {
this.height = height;
}
if (hash) {
this.localUri = getLocalAssetUri(hash, type);
if (this.localUri?.startsWith(ANDROID_EMBEDDED_URL_BASE_RESOURCE)) {
// Treat Android embedded resources as not downloaded state, because the uri is not direct accessible.
this.uri = this.localUri;
this.localUri = null;
}
else if (this.localUri) {
this.downloaded = true;
}
}
if (Platform.OS === 'web') {
if (!name) {
this.name = AssetUris.getFilename(uri);
}
if (!type) {
this.type = AssetUris.getFileExtension(uri);
}
}
}
// @needsAudit
/**
* A helper that wraps `Asset.fromModule(module).downloadAsync` for convenience.
* @param moduleId An array of `require('path/to/file')` or external network URLs. Can also be
* just one module or URL without an Array.
* @return Returns a Promise that fulfills with an array of `Asset`s when the asset(s) has been
* saved to disk.
* @example
* ```ts
* const [{ localUri }] = await Asset.loadAsync(require('./assets/snack-icon.png'));
* ```
*/
static loadAsync(moduleId) {
const moduleIds = Array.isArray(moduleId) ? moduleId : [moduleId];
return Promise.all(moduleIds.map((moduleId) => Asset.fromModule(moduleId).downloadAsync()));
}
// @needsAudit
/**
* Returns the [`Asset`](#asset) instance representing an asset given its module or URL.
* @param virtualAssetModule The value of `require('path/to/file')` for the asset or external
* network URL
* @return The [`Asset`](#asset) instance for the asset.
*/
static fromModule(virtualAssetModule) {
if (typeof virtualAssetModule === 'string') {
return Asset.fromURI(virtualAssetModule);
}
if (typeof virtualAssetModule === 'object' &&
'uri' in virtualAssetModule &&
typeof virtualAssetModule.uri === 'string') {
const extension = AssetUris.getFileExtension(virtualAssetModule.uri);
return new Asset({
name: '',
type: extension.startsWith('.') ? extension.substring(1) : extension,
hash: null,
uri: virtualAssetModule.uri,
width: virtualAssetModule.width,
height: virtualAssetModule.height,
});
}
const meta = getAssetByID(virtualAssetModule);
if (!meta) {
throw new Error(`Module "${virtualAssetModule}" is missing from the asset registry`);
}
// Outside of the managed env we need the moduleId to initialize the asset
// because resolveAssetSource depends on it
if (!IS_ENV_WITH_LOCAL_ASSETS) {
// null-check is performed above with `getAssetByID`.
const { uri } = resolveAssetSource(virtualAssetModule);
const asset = new Asset({
name: meta.name,
type: meta.type,
hash: meta.hash,
uri,
width: meta.width,
height: meta.height,
});
// For images backward compatibility,
// keeps localUri the same as uri for React Native's Image that
// works fine with drawable resource names.
if (Platform.OS === 'android' && !uri.includes(':') && (meta.width || meta.height)) {
asset.localUri = asset.uri;
asset.downloaded = true;
}
Asset.byHash[meta.hash] = asset;
return asset;
}
return Asset.fromMetadata(meta);
}
// @docsMissing
static fromMetadata(meta) {
// The hash of the whole asset, not to be confused with the hash of a specific file returned
// from `selectAssetSource`
const metaHash = meta.hash;
const assetByHash = Asset.byHash[metaHash];
if (assetByHash) {
return assetByHash;
}
const { uri, hash } = selectAssetSource(meta);
const asset = new Asset({
name: meta.name,
type: meta.type,
hash,
uri,
width: meta.width,
height: meta.height,
});
Asset.byHash[metaHash] = asset;
return asset;
}
// @docsMissing
static fromURI(uri) {
if (Asset.byUri[uri]) {
return Asset.byUri[uri];
}
// Possibly a Base64-encoded URI
let type = '';
if (uri.indexOf(';base64') > -1) {
type = uri.split(';')[0].split('/')[1];
}
else {
const extension = AssetUris.getFileExtension(uri);
type = extension.startsWith('.') ? extension.substring(1) : extension;
}
const asset = new Asset({
name: '',
type,
hash: null,
uri,
});
Asset.byUri[uri] = asset;
return asset;
}
// @needsAudit
/**
* Downloads the asset data to a local file in the device's cache directory. Once the returned
* promise is fulfilled without error, the [`localUri`](#localuri) field of this asset points
* to a local file containing the asset data. The asset is only downloaded if an up-to-date local
* file for the asset isn't already present due to an earlier download. The downloaded `Asset`
* will be returned when the promise is resolved.
*
* > **Note:** There is no guarantee that files downloaded via `downloadAsync` persist between app sessions.
* `downloadAsync` stores files in the caches directory, so it's up to the OS to clear this folder at its
* own discretion or when the user manually purges the caches directory. Downloaded assets are stored as
* `ExponentAsset-{cacheFileId}.{extension}` within the cache directory.
* > To manually clear cached assets, you can use [`expo-file-system`](./filesystem/) to
* delete the cache directory: `Paths.cache.delete()` or use the legacy API `deleteAsync(cacheDirectory)`.
*
* @return Returns a Promise which fulfills with an `Asset` instance.
*/
async downloadAsync() {
if (this.downloaded) {
return this;
}
if (this.downloading) {
await new Promise((resolve, reject) => {
this._downloadCallbacks.push({ resolve, reject });
});
return this;
}
this.downloading = true;
try {
if (Platform.OS === 'web') {
if (ImageAssets.isImageType(this.type)) {
const { width, height, name } = await ImageAssets.getImageInfoAsync(this.uri);
this.width = width;
this.height = height;
this.name = name;
}
else {
this.name = AssetUris.getFilename(this.uri);
}
}
this.localUri = await downloadAsync(this.uri, this.hash, this.type);
this.downloaded = true;
this._downloadCallbacks.forEach(({ resolve }) => resolve());
}
catch (e) {
this._downloadCallbacks.forEach(({ reject }) => reject(e));
throw e;
}
finally {
this.downloading = false;
this._downloadCallbacks = [];
}
return this;
}
}
//# sourceMappingURL=Asset.js.map

1
node_modules/expo-asset/build/Asset.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

25
node_modules/expo-asset/build/Asset.server.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
import type { AssetDescriptor } from './Asset';
import type { AssetMetadata } from './AssetSources';
export declare class Asset {
private static byHash;
private static byUri;
name: string;
readonly type: string;
readonly hash: string | null;
readonly uri: string;
localUri: string | null;
width: number | null;
height: number | null;
downloaded: boolean;
constructor({ name, type, hash, uri, width, height }: AssetDescriptor);
static loadAsync(moduleId: number | number[] | string | string[]): Promise<Asset[]>;
static fromModule(virtualAssetModule: number | string | {
uri: string;
width: number;
height: number;
}): Asset;
static fromMetadata(meta: AssetMetadata): Asset;
static fromURI(uri: string): Asset;
downloadAsync(): Promise<this>;
}
//# sourceMappingURL=Asset.server.d.ts.map

1
node_modules/expo-asset/build/Asset.server.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Asset.server.d.ts","sourceRoot":"","sources":["../src/Asset.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,gBAAgB,CAAC;AAIjE,qBAAa,KAAK;IAChB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAyC;IAC9D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAyC;IAEtD,IAAI,EAAE,MAAM,CAAC;IACpB,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC3C,SAAgB,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC7B,UAAU,EAAE,OAAO,CAAQ;gBAEtB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAW,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,eAAe;IA2B5E,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAKnF,MAAM,CAAC,UAAU,CACf,kBAAkB,EAAE,MAAM,GAAG,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GACnF,KAAK;IA0BR,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,KAAK;IAoB/C,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK;IA0B5B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;CAGrC"}

152
node_modules/expo-asset/build/Asset.server.js generated vendored Normal file
View File

@@ -0,0 +1,152 @@
import * as AssetUris from './AssetUris';
import * as ImageAssets from './ImageAssets';
export class Asset {
static byHash = {};
static byUri = {};
name;
type;
hash = null;
uri;
localUri = null;
width = null;
height = null;
downloaded = true;
constructor({ name, type, hash = null, uri, width, height }) {
this.name = name;
this.type = type;
this.hash = hash;
this.uri = uri;
if (typeof width === 'number') {
this.width = width;
}
if (typeof height === 'number') {
this.height = height;
}
this.name ??= AssetUris.getFilename(uri);
this.type ??= AssetUris.getFileExtension(uri);
// Essentially run the contents of downloadAsync here.
if (ImageAssets.isImageType(this.type)) {
this.width = 0;
this.height = 0;
this.name = AssetUris.getFilename(this.uri);
}
else {
this.name = AssetUris.getFilename(this.uri);
}
this.localUri = this.uri;
}
static loadAsync(moduleId) {
const moduleIds = Array.isArray(moduleId) ? moduleId : [moduleId];
return Promise.all(moduleIds.map((moduleId) => Asset.fromModule(moduleId).downloadAsync()));
}
static fromModule(virtualAssetModule) {
if (typeof virtualAssetModule === 'string') {
return Asset.fromURI(virtualAssetModule);
}
else if (typeof virtualAssetModule === 'number') {
throw new Error('Cannot resolve numeric asset IDs on the server as they are non-deterministic identifiers.');
}
if (typeof virtualAssetModule === 'object' &&
'uri' in virtualAssetModule &&
typeof virtualAssetModule.uri === 'string') {
const extension = AssetUris.getFileExtension(virtualAssetModule.uri);
return new Asset({
name: '',
type: extension.startsWith('.') ? extension.substring(1) : extension,
hash: null,
uri: virtualAssetModule.uri,
width: virtualAssetModule.width,
height: virtualAssetModule.height,
});
}
throw new Error('Unexpected asset module ID type: ' + typeof virtualAssetModule);
}
static fromMetadata(meta) {
const metaHash = meta.hash;
const maybeHash = Asset.byHash[metaHash];
if (maybeHash) {
return maybeHash;
}
const { uri, hash } = selectAssetSource(meta);
const asset = new Asset({
name: meta.name,
type: meta.type,
hash,
uri,
width: meta.width,
height: meta.height,
});
Asset.byHash[metaHash] = asset;
return asset;
}
static fromURI(uri) {
if (Asset.byUri[uri]) {
return Asset.byUri[uri];
}
// Possibly a Base64-encoded URI
let type = '';
if (uri.indexOf(';base64') > -1) {
type = uri.split(';')[0].split('/')[1];
}
else {
const extension = AssetUris.getFileExtension(uri);
type = extension.startsWith('.') ? extension.substring(1) : extension;
}
const asset = new Asset({
name: '',
type,
hash: null,
uri,
});
Asset.byUri[uri] = asset;
return asset;
}
async downloadAsync() {
return this;
}
}
function pickScale(scales, deviceScale) {
for (let i = 0; i < scales.length; i++) {
if (scales[i] >= deviceScale) {
return scales[i];
}
}
return scales[scales.length - 1] || 1;
}
/**
* Selects the best file for the given asset (ex: choosing the best scale for images) and returns
* a { uri, hash } pair for the specific asset file.
*
* If the asset isn't an image with multiple scales, the first file is selected.
*/
function selectAssetSource(meta) {
// This logic is based on that of AssetSourceResolver, with additional support for file hashes and
// explicitly provided URIs
const scale = pickScale(meta.scales, 1);
const index = meta.scales.findIndex((s) => s === scale);
const hash = meta.fileHashes ? (meta.fileHashes[index] ?? meta.fileHashes[0]) : meta.hash;
// Allow asset processors to directly provide the URL to load
const uri = meta.fileUris ? (meta.fileUris[index] ?? meta.fileUris[0]) : meta.uri;
if (uri) {
return { uri, hash };
}
const fileScale = scale === 1 ? '' : `@${scale}x`;
const fileExtension = meta.type ? `.${encodeURIComponent(meta.type)}` : '';
const suffix = `/${encodeURIComponent(meta.name)}${fileScale}${fileExtension}`;
const params = new URLSearchParams({
platform: process.env.EXPO_OS,
hash: meta.hash,
});
// For assets with a specified absolute URL, we use the existing origin instead of prepending the
// development server or production CDN URL origin
if (/^https?:\/\//.test(meta.httpServerLocation)) {
const uri = meta.httpServerLocation + suffix + '?' + params;
return { uri, hash };
}
// In correctly configured apps, we arrive here if the asset is locally available on disk due to
// being managed by expo-updates, and `getLocalAssetUri(hash)` must return a local URI for this
// hash. Since the asset is local, we don't have a remote URL and specify an invalid URL (an empty
// string) as a placeholder.
return { uri: '', hash };
}
//# sourceMappingURL=Asset.server.js.map

1
node_modules/expo-asset/build/Asset.server.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

23
node_modules/expo-asset/build/AssetHooks.d.ts generated vendored Normal file
View File

@@ -0,0 +1,23 @@
import { Asset } from './Asset';
/**
* Downloads and stores one or more assets locally.
* After the assets are loaded, this hook returns a list of asset instances.
* If something went wrong when loading the assets, an error is returned.
*
* > Note, the assets are not "reloaded" when you dynamically change the asset list.
*
* @return Returns an array containing:
* - on the first position, a list of all loaded assets. If they aren't loaded yet, this value is
* `undefined`.
* - on the second position, an error which encountered when loading the assets. If there was no
* error, this value is `undefined`.
*
* @example
* ```tsx
* const [assets, error] = useAssets([require('path/to/asset.jpg'), require('path/to/other.png')]);
*
* return assets ? <Image source={assets[0]} /> : null;
* ```
*/
export declare function useAssets(moduleIds: number | number[]): [Asset[] | undefined, Error | undefined];
//# sourceMappingURL=AssetHooks.d.ts.map

1
node_modules/expo-asset/build/AssetHooks.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"AssetHooks.d.ts","sourceRoot":"","sources":["../src/AssetHooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CAAC,CAShG"}

32
node_modules/expo-asset/build/AssetHooks.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
import { useEffect, useState } from 'react';
import { Asset } from './Asset';
// @needsAudit
/**
* Downloads and stores one or more assets locally.
* After the assets are loaded, this hook returns a list of asset instances.
* If something went wrong when loading the assets, an error is returned.
*
* > Note, the assets are not "reloaded" when you dynamically change the asset list.
*
* @return Returns an array containing:
* - on the first position, a list of all loaded assets. If they aren't loaded yet, this value is
* `undefined`.
* - on the second position, an error which encountered when loading the assets. If there was no
* error, this value is `undefined`.
*
* @example
* ```tsx
* const [assets, error] = useAssets([require('path/to/asset.jpg'), require('path/to/other.png')]);
*
* return assets ? <Image source={assets[0]} /> : null;
* ```
*/
export function useAssets(moduleIds) {
const [assets, setAssets] = useState();
const [error, setError] = useState();
useEffect(() => {
Asset.loadAsync(moduleIds).then(setAssets).catch(setError);
}, []);
return [assets, error];
}
//# sourceMappingURL=AssetHooks.js.map

1
node_modules/expo-asset/build/AssetHooks.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"AssetHooks.js","sourceRoot":"","sources":["../src/AssetHooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,cAAc;AACd;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,SAAS,CAAC,SAA4B;IACpD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAAW,CAAC;IAChD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAS,CAAC;IAE5C,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { Asset } from './Asset';\n\n// @needsAudit\n/**\n * Downloads and stores one or more assets locally.\n * After the assets are loaded, this hook returns a list of asset instances.\n * If something went wrong when loading the assets, an error is returned.\n *\n * > Note, the assets are not \"reloaded\" when you dynamically change the asset list.\n *\n * @return Returns an array containing:\n * - on the first position, a list of all loaded assets. If they aren't loaded yet, this value is\n * `undefined`.\n * - on the second position, an error which encountered when loading the assets. If there was no\n * error, this value is `undefined`.\n *\n * @example\n * ```tsx\n * const [assets, error] = useAssets([require('path/to/asset.jpg'), require('path/to/other.png')]);\n *\n * return assets ? <Image source={assets[0]} /> : null;\n * ```\n */\nexport function useAssets(moduleIds: number | number[]): [Asset[] | undefined, Error | undefined] {\n const [assets, setAssets] = useState<Asset[]>();\n const [error, setError] = useState<Error>();\n\n useEffect(() => {\n Asset.loadAsync(moduleIds).then(setAssets).catch(setError);\n }, []);\n\n return [assets, error];\n}\n"]}

25
node_modules/expo-asset/build/AssetSourceResolver.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
import type { PackagerAsset } from '@react-native/assets-registry/registry';
import type { AssetMetadata } from './AssetSources';
export type ResolvedAssetSource = {
__packager_asset: boolean;
width?: number;
height?: number;
uri: string;
scale: number;
};
export default class AssetSourceResolver {
private readonly serverUrl;
private readonly jsbundleUrl;
readonly asset: PackagerAsset | AssetMetadata;
constructor(serverUrl: string | undefined | null, jsbundleUrl: string | undefined | null, asset: PackagerAsset);
isLoadedFromServer(): boolean;
isLoadedFromFileSystem(): boolean;
defaultAsset(): ResolvedAssetSource;
/**
* @returns absolute remote URL for the hosted asset.
*/
assetServerURL(): ResolvedAssetSource;
fromSource(source: string): ResolvedAssetSource;
static pickScale(scales: number[], deviceScale: number): number;
}
//# sourceMappingURL=AssetSourceResolver.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"AssetSourceResolver.d.ts","sourceRoot":"","sources":["../src/AssetSourceResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAI5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAcF,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACtC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAInC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4B;IAExD,SAAgB,KAAK,EAAE,aAAa,GAAG,aAAa,CAAC;gBAGnD,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACpC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACtC,KAAK,EAAE,aAAa;IAQtB,kBAAkB,IAAI,OAAO;IAK7B,sBAAsB,IAAI,OAAO;IAIjC,YAAY,IAAI,mBAAmB;IAInC;;OAEG;IACH,cAAc,IAAI,mBAAmB;IAUrC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB;IAU/C,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM;CAQhE"}

68
node_modules/expo-asset/build/AssetSourceResolver.js generated vendored Normal file
View File

@@ -0,0 +1,68 @@
import { Platform } from 'expo-modules-core';
import { PixelRatio } from 'react-native';
// Returns the Metro dev server-specific asset location.
function getScaledAssetPath(asset) {
const scale = AssetSourceResolver.pickScale(asset.scales, PixelRatio.get());
const scaleSuffix = scale === 1 ? '' : '@' + scale + 'x';
const type = !asset.type ? '' : `.${asset.type}`;
if (__DEV__) {
return asset.httpServerLocation + '/' + asset.name + scaleSuffix + type;
}
else {
return asset.httpServerLocation.replace(/\.\.\//g, '_') + '/' + asset.name + scaleSuffix + type;
}
}
export default class AssetSourceResolver {
serverUrl;
// where the jsbundle is being run from
// NOTE(EvanBacon): Never defined on web.
// @ts-expect-error: Never read locally
jsbundleUrl;
// the asset to resolve
asset;
constructor(serverUrl, jsbundleUrl, asset) {
this.serverUrl = serverUrl || 'https://expo.dev';
this.jsbundleUrl = null;
this.asset = asset;
}
// Always true for web runtimes
isLoadedFromServer() {
return true;
}
// Always false for web runtimes
isLoadedFromFileSystem() {
return false;
}
defaultAsset() {
return this.assetServerURL();
}
/**
* @returns absolute remote URL for the hosted asset.
*/
assetServerURL() {
const fromUrl = new URL(getScaledAssetPath(this.asset), this.serverUrl);
fromUrl.searchParams.set('platform', Platform.OS);
fromUrl.searchParams.set('hash', this.asset.hash);
return this.fromSource(
// Relative on web
fromUrl.toString().replace(fromUrl.origin, ''));
}
fromSource(source) {
return {
__packager_asset: true,
width: this.asset.width ?? undefined,
height: this.asset.height ?? undefined,
uri: source,
scale: AssetSourceResolver.pickScale(this.asset.scales, PixelRatio.get()),
};
}
static pickScale(scales, deviceScale) {
for (let i = 0; i < scales.length; i++) {
if (scales[i] >= deviceScale) {
return scales[i];
}
}
return scales[scales.length - 1] || 1;
}
}
//# sourceMappingURL=AssetSourceResolver.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
import AssetSourceResolver from 'react-native/Libraries/Image/AssetSourceResolver';
export default AssetSourceResolver;
export * from 'react-native/Libraries/Image/AssetSourceResolver';
//# sourceMappingURL=AssetSourceResolver.native.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"AssetSourceResolver.native.d.ts","sourceRoot":"","sources":["../src/AssetSourceResolver.native.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,kDAAkD,CAAC;AACnF,eAAe,mBAAmB,CAAC;AACnC,cAAc,kDAAkD,CAAC"}

View File

@@ -0,0 +1,4 @@
import AssetSourceResolver from 'react-native/Libraries/Image/AssetSourceResolver';
export default AssetSourceResolver;
export * from 'react-native/Libraries/Image/AssetSourceResolver';
//# sourceMappingURL=AssetSourceResolver.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"AssetSourceResolver.native.js","sourceRoot":"","sources":["../src/AssetSourceResolver.native.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,kDAAkD,CAAC;AACnF,eAAe,mBAAmB,CAAC;AACnC,cAAc,kDAAkD,CAAC","sourcesContent":["import AssetSourceResolver from 'react-native/Libraries/Image/AssetSourceResolver';\nexport default AssetSourceResolver;\nexport * from 'react-native/Libraries/Image/AssetSourceResolver';\n"]}

24
node_modules/expo-asset/build/AssetSources.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import type { PackagerAsset } from '@react-native/assets-registry/registry';
export type AssetMetadata = Pick<PackagerAsset, 'httpServerLocation' | 'name' | 'hash' | 'type' | 'scales' | 'width' | 'height'> & {
uri?: string;
fileHashes?: string[];
fileUris?: string[];
};
export type AssetSource = {
uri: string;
hash: string;
};
/**
* Selects the best file for the given asset (ex: choosing the best scale for images) and returns
* a { uri, hash } pair for the specific asset file.
*
* If the asset isn't an image with multiple scales, the first file is selected.
*/
export declare function selectAssetSource(meta: AssetMetadata): AssetSource;
/**
* Resolves the given URI to an absolute URI. If the given URI is already an absolute URI, it is
* simply returned. Otherwise, if it is a relative URI, it is resolved relative to the manifest's
* base URI.
*/
export declare function resolveUri(uri: string): string;
//# sourceMappingURL=AssetSources.d.ts.map

1
node_modules/expo-asset/build/AssetSources.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"AssetSources.d.ts","sourceRoot":"","sources":["../src/AssetSources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAQ5E,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,aAAa,EACb,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAChF,GAAG;IACF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,WAAW,CAyDlE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG9C"}

70
node_modules/expo-asset/build/AssetSources.js generated vendored Normal file
View File

@@ -0,0 +1,70 @@
import { Platform } from 'expo-modules-core';
import { PixelRatio, NativeModules } from 'react-native';
import AssetSourceResolver from './AssetSourceResolver';
import { getManifest2, manifestBaseUrl } from './PlatformUtils';
/**
* Selects the best file for the given asset (ex: choosing the best scale for images) and returns
* a { uri, hash } pair for the specific asset file.
*
* If the asset isn't an image with multiple scales, the first file is selected.
*/
export function selectAssetSource(meta) {
// This logic is based on that of AssetSourceResolver, with additional support for file hashes and
// explicitly provided URIs
const scale = AssetSourceResolver.pickScale(meta.scales, PixelRatio.get());
const index = meta.scales.findIndex((s) => s === scale);
const hash = meta.fileHashes ? (meta.fileHashes[index] ?? meta.fileHashes[0]) : meta.hash;
// Allow asset processors to directly provide the URL to load
const uri = meta.fileUris ? (meta.fileUris[index] ?? meta.fileUris[0]) : meta.uri;
if (uri) {
return { uri: resolveUri(uri), hash };
}
const fileScale = scale === 1 ? '' : `@${scale}x`;
const fileExtension = meta.type ? `.${encodeURIComponent(meta.type)}` : '';
const suffix = `/${encodeURIComponent(meta.name)}${fileScale}${fileExtension}`;
const params = new URLSearchParams({
platform: Platform.OS,
hash: meta.hash,
});
// For assets with a specified absolute URL, we use the existing origin instead of prepending the
// development server or production CDN URL origin
if (/^https?:\/\//.test(meta.httpServerLocation)) {
const uri = meta.httpServerLocation + suffix + '?' + params;
return { uri, hash };
}
// For assets during development using manifest2, we use the development server's URL origin
const manifest2 = getManifest2();
// Use the scheme from manifestBaseUrl (derived from experienceUrl) to support HTTPS dev servers
const scheme = manifestBaseUrl?.startsWith('https://') ? 'https://' : 'http://';
const devServerUrl = manifest2?.extra?.expoGo?.developer
? scheme + manifest2.extra.expoGo.debuggerHost
: null;
if (devServerUrl) {
const baseUrl = new URL(meta.httpServerLocation + suffix, devServerUrl);
baseUrl.searchParams.set('platform', Platform.OS);
baseUrl.searchParams.set('hash', meta.hash);
return {
uri: baseUrl.href,
hash,
};
}
// Temporary fallback for loading assets in Expo Go home
if (NativeModules['ExponentKernel']) {
return { uri: `https://classic-assets.eascdn.net/~assets/${encodeURIComponent(hash)}`, hash };
}
// In correctly configured apps, we arrive here if the asset is locally available on disk due to
// being managed by expo-updates, and `getLocalAssetUri(hash)` must return a local URI for this
// hash. Since the asset is local, we don't have a remote URL and specify an invalid URL (an empty
// string) as a placeholder.
return { uri: '', hash };
}
/**
* Resolves the given URI to an absolute URI. If the given URI is already an absolute URI, it is
* simply returned. Otherwise, if it is a relative URI, it is resolved relative to the manifest's
* base URI.
*/
export function resolveUri(uri) {
// `manifestBaseUrl` is always an absolute URL or `null`.
return manifestBaseUrl ? new URL(uri, manifestBaseUrl).href : uri;
}
//# sourceMappingURL=AssetSources.js.map

1
node_modules/expo-asset/build/AssetSources.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

15
node_modules/expo-asset/build/AssetUris.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
export declare function getFilename(url: string): string;
export declare function getFileExtension(url: string): string;
/**
* Returns the base URL from a manifest's URL. For example, given a manifest hosted at
* https://example.com/app/manifest.json, the base URL would be https://example.com/app/. Query
* parameters and fragments also are removed.
*
* For an Expo-hosted project with a manifest hosted at https://exp.host/@user/project/index.exp, the
* base URL would be https://exp.host/@user/project.
*
* We also normalize the "exp" protocol to "http" to handle internal URLs with the Expo schemes used
* to tell the OS to open the URLs in the the Expo client.
*/
export declare function getManifestBaseUrl(manifestUrl: string): string;
//# sourceMappingURL=AssetUris.d.ts.map

1
node_modules/expo-asset/build/AssetUris.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"AssetUris.d.ts","sourceRoot":"","sources":["../src/AssetUris.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAe/C;AAMD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAuB9D"}

57
node_modules/expo-asset/build/AssetUris.js generated vendored Normal file
View File

@@ -0,0 +1,57 @@
export function getFilename(url) {
const { pathname, searchParams } = new URL(url, 'https://e');
// When attached to a dev server, we use `unstable_path` to represent the file path. This ensures
// the file name is not canonicalized by the browser.
// NOTE(EvanBacon): This is technically not tied to `__DEV__` as it's possible to use this while bundling in production
// mode.
if (__DEV__) {
if (searchParams.has('unstable_path')) {
const encodedFilePath = decodeURIComponent(searchParams.get('unstable_path'));
return getBasename(encodedFilePath);
}
}
return getBasename(pathname);
}
function getBasename(pathname) {
return pathname.substring(pathname.lastIndexOf('/') + 1);
}
export function getFileExtension(url) {
const filename = getFilename(url);
const dotIndex = filename.lastIndexOf('.');
// Ignore leading dots for hidden files
return dotIndex > 0 ? filename.substring(dotIndex) : '';
}
/**
* Returns the base URL from a manifest's URL. For example, given a manifest hosted at
* https://example.com/app/manifest.json, the base URL would be https://example.com/app/. Query
* parameters and fragments also are removed.
*
* For an Expo-hosted project with a manifest hosted at https://exp.host/@user/project/index.exp, the
* base URL would be https://exp.host/@user/project.
*
* We also normalize the "exp" protocol to "http" to handle internal URLs with the Expo schemes used
* to tell the OS to open the URLs in the the Expo client.
*/
export function getManifestBaseUrl(manifestUrl) {
const urlObject = new URL(manifestUrl);
let nextProtocol = urlObject.protocol;
// Change the scheme to http(s) if it is exp(s)
if (nextProtocol === 'exp:') {
nextProtocol = 'http:';
}
else if (nextProtocol === 'exps:') {
nextProtocol = 'https:';
}
urlObject.protocol = nextProtocol;
// Trim filename, query parameters, and fragment, if any
const directory = urlObject.pathname.substring(0, urlObject.pathname.lastIndexOf('/') + 1);
urlObject.pathname = directory;
urlObject.search = '';
urlObject.hash = '';
// The URL spec doesn't allow for changing the protocol to `http` or `https`
// without a port set so instead, we'll just swap the protocol manually.
return urlObject.protocol !== nextProtocol
? urlObject.href.replace(urlObject.protocol, nextProtocol)
: urlObject.href;
}
//# sourceMappingURL=AssetUris.js.map

1
node_modules/expo-asset/build/AssetUris.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"AssetUris.js","sourceRoot":"","sources":["../src/AssetUris.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAE7D,iGAAiG;IACjG,qDAAqD;IACrD,uHAAuH;IACvH,QAAQ;IACR,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,YAAY,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;YACtC,MAAM,eAAe,GAAG,kBAAkB,CAAC,YAAY,CAAC,GAAG,CAAC,eAAe,CAAE,CAAC,CAAC;YAC/E,OAAO,WAAW,CAAC,eAAe,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,WAAW,CAAC,QAAgB;IACnC,OAAO,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC3C,uCAAuC;IACvC,OAAO,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IAEvC,IAAI,YAAY,GAAG,SAAS,CAAC,QAAQ,CAAC;IACtC,+CAA+C;IAC/C,IAAI,YAAY,KAAK,MAAM,EAAE,CAAC;QAC5B,YAAY,GAAG,OAAO,CAAC;IACzB,CAAC;SAAM,IAAI,YAAY,KAAK,OAAO,EAAE,CAAC;QACpC,YAAY,GAAG,QAAQ,CAAC;IAC1B,CAAC;IACD,SAAS,CAAC,QAAQ,GAAG,YAAY,CAAC;IAElC,wDAAwD;IACxD,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3F,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,MAAM,GAAG,EAAE,CAAC;IACtB,SAAS,CAAC,IAAI,GAAG,EAAE,CAAC;IAEpB,4EAA4E;IAC5E,wEAAwE;IACxE,OAAO,SAAS,CAAC,QAAQ,KAAK,YAAY;QACxC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC;QAC1D,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC;AACrB,CAAC","sourcesContent":["export function getFilename(url: string): string {\n const { pathname, searchParams } = new URL(url, 'https://e');\n\n // When attached to a dev server, we use `unstable_path` to represent the file path. This ensures\n // the file name is not canonicalized by the browser.\n // NOTE(EvanBacon): This is technically not tied to `__DEV__` as it's possible to use this while bundling in production\n // mode.\n if (__DEV__) {\n if (searchParams.has('unstable_path')) {\n const encodedFilePath = decodeURIComponent(searchParams.get('unstable_path')!);\n return getBasename(encodedFilePath);\n }\n }\n\n return getBasename(pathname);\n}\n\nfunction getBasename(pathname: string): string {\n return pathname.substring(pathname.lastIndexOf('/') + 1);\n}\n\nexport function getFileExtension(url: string): string {\n const filename = getFilename(url);\n const dotIndex = filename.lastIndexOf('.');\n // Ignore leading dots for hidden files\n return dotIndex > 0 ? filename.substring(dotIndex) : '';\n}\n\n/**\n * Returns the base URL from a manifest's URL. For example, given a manifest hosted at\n * https://example.com/app/manifest.json, the base URL would be https://example.com/app/. Query\n * parameters and fragments also are removed.\n *\n * For an Expo-hosted project with a manifest hosted at https://exp.host/@user/project/index.exp, the\n * base URL would be https://exp.host/@user/project.\n *\n * We also normalize the \"exp\" protocol to \"http\" to handle internal URLs with the Expo schemes used\n * to tell the OS to open the URLs in the the Expo client.\n */\nexport function getManifestBaseUrl(manifestUrl: string): string {\n const urlObject = new URL(manifestUrl);\n\n let nextProtocol = urlObject.protocol;\n // Change the scheme to http(s) if it is exp(s)\n if (nextProtocol === 'exp:') {\n nextProtocol = 'http:';\n } else if (nextProtocol === 'exps:') {\n nextProtocol = 'https:';\n }\n urlObject.protocol = nextProtocol;\n\n // Trim filename, query parameters, and fragment, if any\n const directory = urlObject.pathname.substring(0, urlObject.pathname.lastIndexOf('/') + 1);\n urlObject.pathname = directory;\n urlObject.search = '';\n urlObject.hash = '';\n\n // The URL spec doesn't allow for changing the protocol to `http` or `https`\n // without a port set so instead, we'll just swap the protocol manually.\n return urlObject.protocol !== nextProtocol\n ? urlObject.href.replace(urlObject.protocol, nextProtocol)\n : urlObject.href;\n}\n"]}

11
node_modules/expo-asset/build/ExpoAsset.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* Downloads the asset from the given URL to a local cache and returns the local URL of the cached
* file.
*
* If there is already a locally cached file and its MD5 hash matches the given `md5Hash` parameter,
* if present, the remote asset is not downloaded. The `hash` property is included in Metro's asset
* metadata objects when this module's `hashAssetFiles` plugin is used, which is the typical way the
* `md5Hash` parameter of this function is provided.
*/
export declare function downloadAsync(url: string, md5Hash: string | null, type: string): Promise<string>;
//# sourceMappingURL=ExpoAsset.d.ts.map

1
node_modules/expo-asset/build/ExpoAsset.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ExpoAsset.d.ts","sourceRoot":"","sources":["../src/ExpoAsset.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAEjB"}

15
node_modules/expo-asset/build/ExpoAsset.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import { requireNativeModule } from 'expo-modules-core';
const AssetModule = requireNativeModule('ExpoAsset');
/**
* Downloads the asset from the given URL to a local cache and returns the local URL of the cached
* file.
*
* If there is already a locally cached file and its MD5 hash matches the given `md5Hash` parameter,
* if present, the remote asset is not downloaded. The `hash` property is included in Metro's asset
* metadata objects when this module's `hashAssetFiles` plugin is used, which is the typical way the
* `md5Hash` parameter of this function is provided.
*/
export async function downloadAsync(url, md5Hash, type) {
return AssetModule.downloadAsync(url, md5Hash, type);
}
//# sourceMappingURL=ExpoAsset.js.map

1
node_modules/expo-asset/build/ExpoAsset.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ExpoAsset.js","sourceRoot":"","sources":["../src/ExpoAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,WAAW,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAW,EACX,OAAsB,EACtB,IAAY;IAEZ,OAAO,WAAW,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACvD,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nconst AssetModule = requireNativeModule('ExpoAsset');\n\n/**\n * Downloads the asset from the given URL to a local cache and returns the local URL of the cached\n * file.\n *\n * If there is already a locally cached file and its MD5 hash matches the given `md5Hash` parameter,\n * if present, the remote asset is not downloaded. The `hash` property is included in Metro's asset\n * metadata objects when this module's `hashAssetFiles` plugin is used, which is the typical way the\n * `md5Hash` parameter of this function is provided.\n */\nexport async function downloadAsync(\n url: string,\n md5Hash: string | null,\n type: string\n): Promise<string> {\n return AssetModule.downloadAsync(url, md5Hash, type);\n}\n"]}

2
node_modules/expo-asset/build/ExpoAsset.web.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare function downloadAsync(url: string, _hash: string | null, _type: string): Promise<string>;
//# sourceMappingURL=ExpoAsset.web.d.ts.map

1
node_modules/expo-asset/build/ExpoAsset.web.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ExpoAsset.web.d.ts","sourceRoot":"","sources":["../src/ExpoAsset.web.ts"],"names":[],"mappings":"AAAA,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,CAEjB"}

4
node_modules/expo-asset/build/ExpoAsset.web.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export async function downloadAsync(url, _hash, _type) {
return url;
}
//# sourceMappingURL=ExpoAsset.web.js.map

1
node_modules/expo-asset/build/ExpoAsset.web.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ExpoAsset.web.js","sourceRoot":"","sources":["../src/ExpoAsset.web.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAW,EACX,KAAoB,EACpB,KAAa;IAEb,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["export async function downloadAsync(\n url: string,\n _hash: string | null,\n _type: string\n): Promise<string> {\n return url;\n}\n"]}

9
node_modules/expo-asset/build/ImageAssets.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
type ImageInfo = {
name: string;
width: number;
height: number;
};
export declare function isImageType(type: string): boolean;
export declare function getImageInfoAsync(url: string): Promise<ImageInfo>;
export {};
//# sourceMappingURL=ImageAssets.d.ts.map

1
node_modules/expo-asset/build/ImageAssets.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ImageAssets.d.ts","sourceRoot":"","sources":["../src/ImageAssets.ts"],"names":[],"mappings":"AAGA,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAgBjE"}

23
node_modules/expo-asset/build/ImageAssets.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
/* eslint-env browser */
import { getFilename } from './AssetUris';
export function isImageType(type) {
return /^(jpeg|jpg|gif|png|bmp|webp|heic)$/i.test(type);
}
export function getImageInfoAsync(url) {
if (typeof window === 'undefined') {
return Promise.resolve({ name: getFilename(url), width: 0, height: 0 });
}
return new Promise((resolve, reject) => {
const img = new Image();
img.onerror = reject;
img.onload = () => {
resolve({
name: getFilename(url),
width: img.naturalWidth,
height: img.naturalHeight,
});
};
img.src = url;
});
}
//# sourceMappingURL=ImageAssets.js.map

1
node_modules/expo-asset/build/ImageAssets.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ImageAssets.js","sourceRoot":"","sources":["../src/ImageAssets.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ1C,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,qCAAqC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;QACrB,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE;YAChB,OAAO,CAAC;gBACN,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC;gBACtB,KAAK,EAAE,GAAG,CAAC,YAAY;gBACvB,MAAM,EAAE,GAAG,CAAC,aAAa;aAC1B,CAAC,CAAC;QACL,CAAC,CAAC;QACF,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/* eslint-env browser */\nimport { getFilename } from './AssetUris';\n\ntype ImageInfo = {\n name: string;\n width: number;\n height: number;\n};\n\nexport function isImageType(type: string): boolean {\n return /^(jpeg|jpg|gif|png|bmp|webp|heic)$/i.test(type);\n}\n\nexport function getImageInfoAsync(url: string): Promise<ImageInfo> {\n if (typeof window === 'undefined') {\n return Promise.resolve({ name: getFilename(url), width: 0, height: 0 });\n }\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onerror = reject;\n img.onload = () => {\n resolve({\n name: getFilename(url),\n width: img.naturalWidth,\n height: img.naturalHeight,\n });\n };\n img.src = url;\n });\n}\n"]}

5
node_modules/expo-asset/build/LocalAssets.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
/**
* Returns the URI of a local asset from its hash, or null if the asset is not available locally
*/
export declare function getLocalAssetUri(hash: string, type: string | null): string | null;
//# sourceMappingURL=LocalAssets.d.ts.map

1
node_modules/expo-asset/build/LocalAssets.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"LocalAssets.d.ts","sourceRoot":"","sources":["../src/LocalAssets.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAejF"}

22
node_modules/expo-asset/build/LocalAssets.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
import { getLocalAssets } from './PlatformUtils';
// localAssets are provided by the expo-updates module
const localAssets = getLocalAssets();
/**
* Returns the URI of a local asset from its hash, or null if the asset is not available locally
*/
export function getLocalAssetUri(hash, type) {
const localAssetsKey = hash;
const legacyLocalAssetsKey = `${hash}.${type ?? ''}`;
switch (true) {
case localAssetsKey in localAssets: {
return localAssets[localAssetsKey];
}
case legacyLocalAssetsKey in localAssets: {
// legacy updates store assets with an extension
return localAssets[legacyLocalAssetsKey];
}
default:
return null;
}
}
//# sourceMappingURL=LocalAssets.js.map

1
node_modules/expo-asset/build/LocalAssets.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"LocalAssets.js","sourceRoot":"","sources":["../src/LocalAssets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,sDAAsD;AACtD,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;AAErC;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,IAAmB;IAChE,MAAM,cAAc,GAAG,IAAI,CAAC;IAC5B,MAAM,oBAAoB,GAAG,GAAG,IAAI,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;IAErD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,cAAc,IAAI,WAAW,CAAC,CAAC,CAAC;YACnC,OAAO,WAAW,CAAC,cAAc,CAAC,CAAC;QACrC,CAAC;QACD,KAAK,oBAAoB,IAAI,WAAW,CAAC,CAAC,CAAC;YACzC,gDAAgD;YAChD,OAAO,WAAW,CAAC,oBAAoB,CAAC,CAAC;QAC3C,CAAC;QACD;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC","sourcesContent":["import { getLocalAssets } from './PlatformUtils';\n\n// localAssets are provided by the expo-updates module\nconst localAssets = getLocalAssets();\n\n/**\n * Returns the URI of a local asset from its hash, or null if the asset is not available locally\n */\nexport function getLocalAssetUri(hash: string, type: string | null): string | null {\n const localAssetsKey = hash;\n const legacyLocalAssetsKey = `${hash}.${type ?? ''}`;\n\n switch (true) {\n case localAssetsKey in localAssets: {\n return localAssets[localAssetsKey];\n }\n case legacyLocalAssetsKey in localAssets: {\n // legacy updates store assets with an extension\n return localAssets[legacyLocalAssetsKey];\n }\n default:\n return null;\n }\n}\n"]}

2
node_modules/expo-asset/build/LocalAssets.web.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare function getLocalAssetUri(hash: string, type: string | null): string | null;
//# sourceMappingURL=LocalAssets.web.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"LocalAssets.web.d.ts","sourceRoot":"","sources":["../src/LocalAssets.web.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAGjF"}

5
node_modules/expo-asset/build/LocalAssets.web.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export function getLocalAssetUri(hash, type) {
// noop on web
return null;
}
//# sourceMappingURL=LocalAssets.web.js.map

1
node_modules/expo-asset/build/LocalAssets.web.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"LocalAssets.web.js","sourceRoot":"","sources":["../src/LocalAssets.web.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,IAAmB;IAChE,cAAc;IACd,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["export function getLocalAssetUri(hash: string, type: string | null): string | null {\n // noop on web\n return null;\n}\n"]}

6
node_modules/expo-asset/build/PlatformUtils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import Constants from 'expo-constants';
export declare const IS_ENV_WITH_LOCAL_ASSETS: boolean;
export declare function getLocalAssets(): Record<string, string>;
export declare function getManifest2(): typeof Constants.__unsafeNoWarnManifest2;
export declare const manifestBaseUrl: string | null;
//# sourceMappingURL=PlatformUtils.d.ts.map

1
node_modules/expo-asset/build/PlatformUtils.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"PlatformUtils.d.ts","sourceRoot":"","sources":["../src/PlatformUtils.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAiCvC,eAAO,MAAM,wBAAwB,SAAyD,CAAC;AAI/F,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEvD;AAED,wBAAgB,YAAY,IAAI,OAAO,SAAS,CAAC,uBAAuB,CAEvE;AAGD,eAAO,MAAM,eAAe,eAEpB,CAAC"}

38
node_modules/expo-asset/build/PlatformUtils.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
import Constants from 'expo-constants';
import { requireNativeModule, requireOptionalNativeModule } from 'expo-modules-core';
import { getManifestBaseUrl } from './AssetUris';
const ExpoUpdates = requireOptionalNativeModule('ExpoUpdates');
const NativeExpoGoModule = (() => {
try {
return requireNativeModule('ExpoGo');
}
catch {
return null;
}
})();
function isRunningInExpoGo() {
return NativeExpoGoModule != null;
}
// expo-updates (and Expo Go expo-updates override) manages assets from updates and exposes
// the ExpoUpdates.localAssets constant containing information about the assets.
const expoUpdatesIsInstalledAndEnabled = !!ExpoUpdates?.isEnabled;
const expoUpdatesIsUsingEmbeddedAssets = ExpoUpdates?.isUsingEmbeddedAssets;
// if expo-updates is installed but we're running directly from the embedded bundle, we don't want
// to override the AssetSourceResolver.
const shouldUseUpdatesAssetResolution = expoUpdatesIsInstalledAndEnabled && !expoUpdatesIsUsingEmbeddedAssets;
// Expo Go always uses the updates module for asset resolution (local assets) since it
// overrides the expo-updates module.
export const IS_ENV_WITH_LOCAL_ASSETS = isRunningInExpoGo() || shouldUseUpdatesAssetResolution;
// Get the localAssets property from the ExpoUpdates native module so that we do
// not need to include expo-updates as a dependency of expo-asset
export function getLocalAssets() {
return ExpoUpdates?.localAssets ?? {};
}
export function getManifest2() {
return Constants.__unsafeNoWarnManifest2;
}
// Compute manifest base URL if available
export const manifestBaseUrl = Constants.experienceUrl
? getManifestBaseUrl(Constants.experienceUrl)
: null;
//# sourceMappingURL=PlatformUtils.js.map

1
node_modules/expo-asset/build/PlatformUtils.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"PlatformUtils.js","sourceRoot":"","sources":["../src/PlatformUtils.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAIrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,GAAG,2BAA2B,CAAoB,aAAa,CAAC,CAAC;AAElF,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE;IAC/B,IAAI,CAAC;QACH,OAAO,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC,EAAE,CAAC;AAEL,SAAS,iBAAiB;IACxB,OAAO,kBAAkB,IAAI,IAAI,CAAC;AACpC,CAAC;AAED,2FAA2F;AAC3F,gFAAgF;AAChF,MAAM,gCAAgC,GAAG,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC;AAClE,MAAM,gCAAgC,GAAG,WAAW,EAAE,qBAAqB,CAAC;AAE5E,kGAAkG;AAClG,uCAAuC;AACvC,MAAM,+BAA+B,GACnC,gCAAgC,IAAI,CAAC,gCAAgC,CAAC;AAExE,sFAAsF;AACtF,qCAAqC;AACrC,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,EAAE,IAAI,+BAA+B,CAAC;AAE/F,gFAAgF;AAChF,iEAAiE;AACjE,MAAM,UAAU,cAAc;IAC5B,OAAO,WAAW,EAAE,WAAW,IAAI,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,SAAS,CAAC,uBAAuB,CAAC;AAC3C,CAAC;AAED,yCAAyC;AACzC,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,aAAa;IACpD,CAAC,CAAC,kBAAkB,CAAC,SAAS,CAAC,aAAa,CAAC;IAC7C,CAAC,CAAC,IAAI,CAAC","sourcesContent":["import Constants from 'expo-constants';\nimport { requireNativeModule, requireOptionalNativeModule } from 'expo-modules-core';\n// @ts-ignore -- optional interface, will gracefully degrade to `any` if not installed\nimport type { ExpoUpdatesModule } from 'expo-updates';\n\nimport { getManifestBaseUrl } from './AssetUris';\n\nconst ExpoUpdates = requireOptionalNativeModule<ExpoUpdatesModule>('ExpoUpdates');\n\nconst NativeExpoGoModule = (() => {\n try {\n return requireNativeModule('ExpoGo');\n } catch {\n return null;\n }\n})();\n\nfunction isRunningInExpoGo(): boolean {\n return NativeExpoGoModule != null;\n}\n\n// expo-updates (and Expo Go expo-updates override) manages assets from updates and exposes\n// the ExpoUpdates.localAssets constant containing information about the assets.\nconst expoUpdatesIsInstalledAndEnabled = !!ExpoUpdates?.isEnabled;\nconst expoUpdatesIsUsingEmbeddedAssets = ExpoUpdates?.isUsingEmbeddedAssets;\n\n// if expo-updates is installed but we're running directly from the embedded bundle, we don't want\n// to override the AssetSourceResolver.\nconst shouldUseUpdatesAssetResolution =\n expoUpdatesIsInstalledAndEnabled && !expoUpdatesIsUsingEmbeddedAssets;\n\n// Expo Go always uses the updates module for asset resolution (local assets) since it\n// overrides the expo-updates module.\nexport const IS_ENV_WITH_LOCAL_ASSETS = isRunningInExpoGo() || shouldUseUpdatesAssetResolution;\n\n// Get the localAssets property from the ExpoUpdates native module so that we do\n// not need to include expo-updates as a dependency of expo-asset\nexport function getLocalAssets(): Record<string, string> {\n return ExpoUpdates?.localAssets ?? {};\n}\n\nexport function getManifest2(): typeof Constants.__unsafeNoWarnManifest2 {\n return Constants.__unsafeNoWarnManifest2;\n}\n\n// Compute manifest base URL if available\nexport const manifestBaseUrl = Constants.experienceUrl\n ? getManifestBaseUrl(Constants.experienceUrl)\n : null;\n"]}

5
node_modules/expo-asset/build/PlatformUtils.web.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export declare const IS_ENV_WITH_LOCAL_ASSETS = false;
export declare function getLocalAssets(): Record<string, string>;
export declare function getManifest2(): {};
export declare const manifestBaseUrl: null;
//# sourceMappingURL=PlatformUtils.web.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"PlatformUtils.web.d.ts","sourceRoot":"","sources":["../src/PlatformUtils.web.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAE9C,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEvD;AAED,wBAAgB,YAAY,OAE3B;AAGD,eAAO,MAAM,eAAe,MAAO,CAAC"}

10
node_modules/expo-asset/build/PlatformUtils.web.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
export const IS_ENV_WITH_LOCAL_ASSETS = false;
export function getLocalAssets() {
return {};
}
export function getManifest2() {
return {};
}
// Compute manifest base URL if available
export const manifestBaseUrl = null;
//# sourceMappingURL=PlatformUtils.web.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"PlatformUtils.web.js","sourceRoot":"","sources":["../src/PlatformUtils.web.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAE9C,MAAM,UAAU,cAAc;IAC5B,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,yCAAyC;AACzC,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC","sourcesContent":["export const IS_ENV_WITH_LOCAL_ASSETS = false;\n\nexport function getLocalAssets(): Record<string, string> {\n return {};\n}\n\nexport function getManifest2() {\n return {};\n}\n\n// Compute manifest base URL if available\nexport const manifestBaseUrl = null;\n"]}

4
node_modules/expo-asset/build/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import './Asset.fx';
export * from './Asset';
export * from './AssetHooks';
//# sourceMappingURL=index.d.ts.map

1
node_modules/expo-asset/build/index.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AAEpB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}

4
node_modules/expo-asset/build/index.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import './Asset.fx';
export * from './Asset';
export * from './AssetHooks';
//# sourceMappingURL=index.js.map

1
node_modules/expo-asset/build/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AAEpB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC","sourcesContent":["import './Asset.fx';\n\nexport * from './Asset';\nexport * from './AssetHooks';\n"]}

3
node_modules/expo-asset/build/index.server.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export * from './Asset.server';
export declare function useAssets(): (never[] | undefined)[];
//# sourceMappingURL=index.server.d.ts.map

1
node_modules/expo-asset/build/index.server.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B,wBAAgB,SAAS,4BAExB"}

5
node_modules/expo-asset/build/index.server.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export * from './Asset.server';
export function useAssets() {
return [[], undefined];
}
//# sourceMappingURL=index.server.js.map

1
node_modules/expo-asset/build/index.server.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.server.js","sourceRoot":"","sources":["../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B,MAAM,UAAU,SAAS;IACvB,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;AACzB,CAAC","sourcesContent":["export * from './Asset.server';\n\nexport function useAssets() {\n return [[], undefined];\n}\n"]}

15
node_modules/expo-asset/build/resolveAssetSource.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import AssetSourceResolver, { ResolvedAssetSource } from './AssetSourceResolver';
export declare function setCustomSourceTransformer(transformer: (resolver: AssetSourceResolver) => ResolvedAssetSource): void;
interface resolveAssetSource {
(source: any): ResolvedAssetSource | null;
setCustomSourceTransformer(transformer: (resolver: AssetSourceResolver) => ResolvedAssetSource): ResolvedAssetSource;
}
/**
* `source` is either a number (opaque type returned by require('./foo.png'))
* or an `ImageSource` like { uri: '<http location || file path>' }
*/
declare function resolveAssetSource(source: any): ResolvedAssetSource | null;
declare const _default: resolveAssetSource;
export default _default;
export declare const pickScale: typeof AssetSourceResolver.pickScale;
//# sourceMappingURL=resolveAssetSource.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"resolveAssetSource.d.ts","sourceRoot":"","sources":["../src/resolveAssetSource.ts"],"names":[],"mappings":"AAEA,OAAO,mBAAmB,EAAE,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAIjF,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,mBAAmB,GAClE,IAAI,CAEN;AAED,UAAU,kBAAkB;IAC1B,CAAC,MAAM,EAAE,GAAG,GAAG,mBAAmB,GAAG,IAAI,CAAC;IAC1C,0BAA0B,CACxB,WAAW,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,mBAAmB,GAClE,mBAAmB,CAAC;CACxB;AAED;;;GAGG;AACH,iBAAS,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,mBAAmB,GAAG,IAAI,CAoBnE;wBAQoC,kBAAkB;AAAvD,wBAAwD;AAExD,eAAO,MAAQ,SAAS,sCAAwB,CAAC"}

34
node_modules/expo-asset/build/resolveAssetSource.js generated vendored Normal file
View File

@@ -0,0 +1,34 @@
import { getAssetByID } from '@react-native/assets-registry/registry';
import AssetSourceResolver from './AssetSourceResolver';
let _customSourceTransformer;
export function setCustomSourceTransformer(transformer) {
_customSourceTransformer = transformer;
}
/**
* `source` is either a number (opaque type returned by require('./foo.png'))
* or an `ImageSource` like { uri: '<http location || file path>' }
*/
function resolveAssetSource(source) {
if (typeof source === 'object') {
return source;
}
const asset = getAssetByID(source);
if (!asset) {
return null;
}
const resolver = new AssetSourceResolver(
// Doesn't matter since this is removed on web
'https://expo.dev', null, asset);
if (_customSourceTransformer) {
return _customSourceTransformer(resolver);
}
return resolver.defaultAsset();
}
Object.defineProperty(resolveAssetSource, 'setCustomSourceTransformer', {
get() {
return setCustomSourceTransformer;
},
});
export default resolveAssetSource;
export const { pickScale } = AssetSourceResolver;
//# sourceMappingURL=resolveAssetSource.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"resolveAssetSource.js","sourceRoot":"","sources":["../src/resolveAssetSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE,OAAO,mBAA4C,MAAM,uBAAuB,CAAC;AAEjF,IAAI,wBAAgF,CAAC;AAErF,MAAM,UAAU,0BAA0B,CACxC,WAAmE;IAEnE,wBAAwB,GAAG,WAAW,CAAC;AACzC,CAAC;AASD;;;GAGG;AACH,SAAS,kBAAkB,CAAC,MAAW;IACrC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACnC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,mBAAmB;IACtC,8CAA8C;IAC9C,kBAAkB,EAClB,IAAI,EACJ,KAAK,CACN,CAAC;IACF,IAAI,wBAAwB,EAAE,CAAC;QAC7B,OAAO,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,cAAc,CAAC,kBAAkB,EAAE,4BAA4B,EAAE;IACtE,GAAG;QACD,OAAO,0BAA0B,CAAC;IACpC,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,kBAAwC,CAAC;AAExD,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,mBAAmB,CAAC","sourcesContent":["import { getAssetByID } from '@react-native/assets-registry/registry';\n\nimport AssetSourceResolver, { ResolvedAssetSource } from './AssetSourceResolver';\n\nlet _customSourceTransformer: (resolver: AssetSourceResolver) => ResolvedAssetSource;\n\nexport function setCustomSourceTransformer(\n transformer: (resolver: AssetSourceResolver) => ResolvedAssetSource\n): void {\n _customSourceTransformer = transformer;\n}\n\ninterface resolveAssetSource {\n (source: any): ResolvedAssetSource | null;\n setCustomSourceTransformer(\n transformer: (resolver: AssetSourceResolver) => ResolvedAssetSource\n ): ResolvedAssetSource;\n}\n\n/**\n * `source` is either a number (opaque type returned by require('./foo.png'))\n * or an `ImageSource` like { uri: '<http location || file path>' }\n */\nfunction resolveAssetSource(source: any): ResolvedAssetSource | null {\n if (typeof source === 'object') {\n return source;\n }\n\n const asset = getAssetByID(source);\n if (!asset) {\n return null;\n }\n\n const resolver = new AssetSourceResolver(\n // Doesn't matter since this is removed on web\n 'https://expo.dev',\n null,\n asset\n );\n if (_customSourceTransformer) {\n return _customSourceTransformer(resolver);\n }\n return resolver.defaultAsset();\n}\n\nObject.defineProperty(resolveAssetSource, 'setCustomSourceTransformer', {\n get() {\n return setCustomSourceTransformer;\n },\n});\n\nexport default resolveAssetSource as resolveAssetSource;\n\nexport const { pickScale } = AssetSourceResolver;\n"]}

View File

@@ -0,0 +1,4 @@
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
export default resolveAssetSource;
export * from 'react-native/Libraries/Image/resolveAssetSource';
//# sourceMappingURL=resolveAssetSource.native.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"resolveAssetSource.native.d.ts","sourceRoot":"","sources":["../src/resolveAssetSource.native.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,iDAAiD,CAAC;AACjF,eAAe,kBAAkB,CAAC;AAClC,cAAc,iDAAiD,CAAC"}

View File

@@ -0,0 +1,4 @@
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
export default resolveAssetSource;
export * from 'react-native/Libraries/Image/resolveAssetSource';
//# sourceMappingURL=resolveAssetSource.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"resolveAssetSource.native.js","sourceRoot":"","sources":["../src/resolveAssetSource.native.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,iDAAiD,CAAC;AACjF,eAAe,kBAAkB,CAAC;AAClC,cAAc,iDAAiD,CAAC","sourcesContent":["import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';\nexport default resolveAssetSource;\nexport * from 'react-native/Libraries/Image/resolveAssetSource';\n"]}

15
node_modules/expo-asset/expo-module.config.json generated vendored Normal file
View File

@@ -0,0 +1,15 @@
{
"platforms": ["apple", "android", "web"],
"apple": {
"modules": ["AssetModule"]
},
"android": {
"modules": ["expo.modules.asset.AssetModule"],
"publication": {
"groupId": "expo.modules.asset",
"artifactId": "expo.modules.asset",
"version": "55.0.8",
"repository": "local-maven-repo"
}
}
}

94
node_modules/expo-asset/ios/AssetModule.swift generated vendored Normal file
View File

@@ -0,0 +1,94 @@
import ExpoModulesCore
import CryptoKit
internal final class UnableToDownloadAssetException: GenericException<URL> {
override var reason: String {
"Unable to download asset from url: '\(param.absoluteString)'"
}
}
internal final class UnableToSaveAssetToDirectoryException: GenericException<URL> {
override var reason: String {
"Unable to save asset to directory: '\(param.absoluteString)'"
}
}
public class AssetModule: Module {
public func definition() -> ModuleDefinition {
Name("ExpoAsset")
// NOTE: this is exposed in JS as globalThis.expo.modules.ExpoAsset.downloadAsync
// and potentially consumed outside of Expo (e.g. RN vector icons)
// do NOT change the function signature as it'll break consumers!
AsyncFunction("downloadAsync") { (url: URL, md5Hash: String?, type: String, promise: Promise) in
if url.isFileURL {
promise.resolve(url.standardizedFileURL.absoluteString)
return
}
guard let cacheFileId = md5Hash ?? getMD5Hash(fromURL: url),
let cachesDirectory = appContext?.fileSystem?.cachesDirectory,
let appContext = appContext else {
promise.reject(UnableToDownloadAssetException(url))
return
}
let localUrl = URL(fileURLWithPath: "\(cachesDirectory)/ExponentAsset-\(cacheFileId).\(type)")
guard let fileData = FileManager.default.contents(atPath: localUrl.path) else {
downloadAsset(appContext: appContext, url: url, localUrl: localUrl, promise: promise)
return
}
if md5Hash == nil || md5Hash == getMD5Hash(fromData: fileData) {
promise.resolve(localUrl.standardizedFileURL.absoluteString)
return
}
downloadAsset(appContext: appContext, url: url, localUrl: localUrl, promise: promise)
}
}
private func getMD5Hash(fromURL url: URL) -> String? {
guard let urlData = url.absoluteString.data(using: .utf8) else {
return nil
}
return getMD5Hash(fromData: urlData)
}
private func getMD5Hash(fromData data: Data?) -> String? {
guard let data = data else {
return nil
}
return Data(Insecure.MD5.hash(data: data)).map { String(format: "%02hhx", $0) }.joined()
}
func downloadAsset(appContext: AppContext, url: URL, localUrl: URL, promise: Promise) {
guard let fileSystem = appContext.fileSystem else {
promise.reject(UnableToSaveAssetToDirectoryException(url))
return
}
if !fileSystem.ensureDirExists(withPath: localUrl.path) {
promise.reject(UnableToSaveAssetToDirectoryException(localUrl))
return
}
guard fileSystem.permissions(forURI: localUrl).contains(EXFileSystemPermissionFlags.write) else {
promise.reject(UnableToSaveAssetToDirectoryException(localUrl))
return
}
let downloadTask = URLSession.shared.downloadTask(with: url) { urlOrNil, _, _ in
guard let fileURL = urlOrNil else {
promise.reject(UnableToDownloadAssetException(url))
return
}
do {
// the file may already exist, so we need to remove it first
try? FileManager.default.removeItem(at: localUrl)
try FileManager.default.moveItem(at: fileURL, to: localUrl)
promise.resolve(localUrl.standardizedFileURL.absoluteString)
} catch {
promise.reject(UnableToSaveAssetToDirectoryException(localUrl))
}
}
downloadTask.resume()
}
}

31
node_modules/expo-asset/ios/ExpoAsset.podspec generated vendored Normal file
View File

@@ -0,0 +1,31 @@
require 'json'
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
Pod::Spec.new do |s|
s.name = 'ExpoAsset'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s.author = package['author']
s.homepage = package['homepage']
s.platforms = {
:ios => '15.1',
:osx => '11.0',
:tvos => '15.1'
}
s.swift_version = '5.9'
s.source = { git: 'https://github.com/expo/expo.git' }
s.static_framework = true
s.dependency 'ExpoModulesCore'
# Swift/Objective-C compatibility
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'SWIFT_COMPILATION_MODE' => 'wholemodule'
}
s.source_files = "**/*.{h,m,swift}"
end

1
node_modules/expo-asset/jest-rsc.config.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require('jest-expo/rsc/jest-preset');

View File

@@ -0,0 +1 @@
8e2f33a27293a455d41ca41cb67f972e

View File

@@ -0,0 +1 @@
bb7979f4281875729f53f83d34d75c45f3c0a2a5

View File

@@ -0,0 +1 @@
9b96e6331098b86046be816bfea10e7577b1176c791f680d7542e4f299ed660d

View File

@@ -0,0 +1 @@
ccf68d379c3851c73eea8006261d73b0ef959e31e286c14d74938b6a031125c7b54cde17580569668e0299f00a4a60b3eada82f11072b1a4ed6cd26b0e1859fb

View File

@@ -0,0 +1 @@
4b1cc9dd18d869d049c3af586ec5221b

View File

@@ -0,0 +1 @@
22e302ad01c1a29f1a27814e160054585ac25677

View File

@@ -0,0 +1 @@
fc16e813bb5595a4aef781dfe4fc16da200e56ab3b975dab634c59e4ae608cdb

View File

@@ -0,0 +1 @@
84d6fc721172f79e3fb95d9dce54ab6def3695e020d372de22adeef7b91166fc8a844baf8b1b5ebb2b9dd46417c6f6ab5963f8c6acaa8aeb1cab4c5d5c37c578

View File

@@ -0,0 +1,87 @@
{
"formatVersion": "1.1",
"component": {
"group": "expo.modules.asset",
"module": "expo.modules.asset",
"version": "55.0.8",
"attributes": {
"org.gradle.status": "release"
}
},
"createdBy": {
"gradle": {
"version": "9.0.0"
}
},
"variants": [
{
"name": "releaseVariantReleaseApiPublication",
"attributes": {
"org.gradle.category": "library",
"org.gradle.dependency.bundling": "external",
"org.gradle.libraryelements": "aar",
"org.gradle.usage": "java-api"
},
"files": [
{
"name": "expo.modules.asset-55.0.8.aar",
"url": "expo.modules.asset-55.0.8.aar",
"size": 19586,
"sha512": "84d6fc721172f79e3fb95d9dce54ab6def3695e020d372de22adeef7b91166fc8a844baf8b1b5ebb2b9dd46417c6f6ab5963f8c6acaa8aeb1cab4c5d5c37c578",
"sha256": "fc16e813bb5595a4aef781dfe4fc16da200e56ab3b975dab634c59e4ae608cdb",
"sha1": "22e302ad01c1a29f1a27814e160054585ac25677",
"md5": "4b1cc9dd18d869d049c3af586ec5221b"
}
]
},
{
"name": "releaseVariantReleaseRuntimePublication",
"attributes": {
"org.gradle.category": "library",
"org.gradle.dependency.bundling": "external",
"org.gradle.libraryelements": "aar",
"org.gradle.usage": "java-runtime"
},
"dependencies": [
{
"group": "org.jetbrains.kotlin",
"module": "kotlin-stdlib-jdk7",
"version": {
"requires": "2.1.20"
}
}
],
"files": [
{
"name": "expo.modules.asset-55.0.8.aar",
"url": "expo.modules.asset-55.0.8.aar",
"size": 19586,
"sha512": "84d6fc721172f79e3fb95d9dce54ab6def3695e020d372de22adeef7b91166fc8a844baf8b1b5ebb2b9dd46417c6f6ab5963f8c6acaa8aeb1cab4c5d5c37c578",
"sha256": "fc16e813bb5595a4aef781dfe4fc16da200e56ab3b975dab634c59e4ae608cdb",
"sha1": "22e302ad01c1a29f1a27814e160054585ac25677",
"md5": "4b1cc9dd18d869d049c3af586ec5221b"
}
]
},
{
"name": "releaseVariantReleaseSourcePublication",
"attributes": {
"org.gradle.category": "documentation",
"org.gradle.dependency.bundling": "external",
"org.gradle.docstype": "sources",
"org.gradle.usage": "java-runtime"
},
"files": [
{
"name": "expo.modules.asset-55.0.8-sources.jar",
"url": "expo.modules.asset-55.0.8-sources.jar",
"size": 3229,
"sha512": "ccf68d379c3851c73eea8006261d73b0ef959e31e286c14d74938b6a031125c7b54cde17580569668e0299f00a4a60b3eada82f11072b1a4ed6cd26b0e1859fb",
"sha256": "9b96e6331098b86046be816bfea10e7577b1176c791f680d7542e4f299ed660d",
"sha1": "bb7979f4281875729f53f83d34d75c45f3c0a2a5",
"md5": "8e2f33a27293a455d41ca41cb67f972e"
}
]
}
]
}

View File

@@ -0,0 +1 @@
06ebfb9b5918a22d5011dda7ae75bac4

Some files were not shown because too many files have changed in this diff Show More