expo-asset 8.4.6 → 8.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +16 -2
  2. package/README.md +3 -3
  3. package/build/Asset.d.ts +1 -0
  4. package/build/Asset.d.ts.map +1 -0
  5. package/build/Asset.fx.d.ts +1 -0
  6. package/build/Asset.fx.d.ts.map +1 -0
  7. package/build/Asset.fx.js +1 -1
  8. package/build/Asset.fx.js.map +1 -1
  9. package/build/AssetHooks.d.ts +1 -0
  10. package/build/AssetHooks.d.ts.map +1 -0
  11. package/build/AssetRegistry.d.ts +1 -0
  12. package/build/AssetRegistry.d.ts.map +1 -0
  13. package/build/AssetRegistry.web.d.ts +1 -0
  14. package/build/AssetRegistry.web.d.ts.map +1 -0
  15. package/build/AssetSourceResolver.d.ts +1 -0
  16. package/build/AssetSourceResolver.d.ts.map +1 -0
  17. package/build/AssetSourceResolver.web.d.ts +1 -0
  18. package/build/AssetSourceResolver.web.d.ts.map +1 -0
  19. package/build/AssetSources.d.ts +1 -0
  20. package/build/AssetSources.d.ts.map +1 -0
  21. package/build/AssetSources.js +1 -1
  22. package/build/AssetSources.js.map +1 -1
  23. package/build/AssetUris.d.ts +3 -2
  24. package/build/AssetUris.d.ts.map +1 -0
  25. package/build/AssetUris.js +2 -2
  26. package/build/AssetUris.js.map +1 -1
  27. package/build/ImageAssets.d.ts +1 -0
  28. package/build/ImageAssets.d.ts.map +1 -0
  29. package/build/LocalAssets.d.ts +1 -0
  30. package/build/LocalAssets.d.ts.map +1 -0
  31. package/build/LocalAssets.web.d.ts +1 -0
  32. package/build/LocalAssets.web.d.ts.map +1 -0
  33. package/build/PlatformUtils.d.ts +1 -0
  34. package/build/PlatformUtils.d.ts.map +1 -0
  35. package/build/PlatformUtils.web.d.ts +1 -0
  36. package/build/PlatformUtils.web.d.ts.map +1 -0
  37. package/build/index.d.ts +1 -0
  38. package/build/index.d.ts.map +1 -0
  39. package/build/resolveAssetSource.d.ts +1 -0
  40. package/build/resolveAssetSource.d.ts.map +1 -0
  41. package/build/resolveAssetSource.web.d.ts +1 -0
  42. package/build/resolveAssetSource.web.d.ts.map +1 -0
  43. package/package.json +5 -3
  44. package/src/Asset.fx.ts +1 -1
  45. package/src/AssetSources.ts +1 -1
  46. package/src/AssetUris.ts +2 -2
  47. package/tsconfig.json +1 -1
package/CHANGELOG.md CHANGED
@@ -10,11 +10,25 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 8.4.6 — 2022-01-13
13
+ ## 8.6.1 — 2022-07-19
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 8.6.0 — 2022-07-07
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
21
+ ## 8.5.0 — 2022-04-18
22
+
23
+ ### 💡 Others
24
+
25
+ - Swap out Cloudfront CDN for `classic-assets.eascdn.net`. ([#15781](https://github.com/expo/expo/pull/15781)) by [@quinlanj](https://github.com/quinlanj)
26
+
27
+ ## 8.4.6 - 2022-01-13
14
28
 
15
29
  ### 🐛 Bug fixes
16
30
 
17
- - Fix missing `getManifest2()` function on web. ([#15891](https://github.com/expo/expo/pull/15891)) by [@jonsamp](https://github.com/jonsamp)
31
+ - 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))
18
32
 
19
33
  ## 8.4.5 — 2021-12-21
20
34
 
package/README.md CHANGED
@@ -4,12 +4,12 @@ An Expo universal module to download assets and pass them into other APIs
4
4
 
5
5
  # API documentation
6
6
 
7
- - [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/asset.md)
8
- - [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/asset/)
7
+ - [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/asset.md)
8
+ - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/asset/)
9
9
 
10
10
  # Installation in managed Expo projects
11
11
 
12
- For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/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.
12
+ For [managed](https://docs.expo.dev/versions/latest/introduction/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.
13
13
 
14
14
  # Installation in bare React Native projects
15
15
 
package/build/Asset.d.ts CHANGED
@@ -97,3 +97,4 @@ export declare class Asset {
97
97
  */
98
98
  downloadAsync(): Promise<this>;
99
99
  }
100
+ //# sourceMappingURL=Asset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../src/Asset.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAqB,MAAM,gBAAgB,CAAC;AAQlE,oBAAY,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;AAEF,aAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC;AAGzB;;;GAGG;AACH,qBAAa,KAAK;IAChB;;OAEG;IACH,MAAM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appings":""}
package/build/Asset.fx.js CHANGED
@@ -14,7 +14,7 @@ if (IS_ENV_WITH_UPDATES_ENABLED) {
14
14
  return resolver.defaultAsset();
15
15
  }
16
16
  }
17
- catch (e) {
17
+ catch {
18
18
  return resolver.defaultAsset();
19
19
  }
20
20
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Asset.fx.js","sourceRoot":"","sources":["../src/Asset.fx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE,+FAA+F;AAC/F,IAAI,2BAA2B,EAAE;IAC/B,0BAA0B,CAAC,CAAC,QAAQ,EAAE,EAAE;QACtC,IAAI;YACF,2FAA2F;YAC3F,IAAI,QAAQ,CAAC,KAAK,CAAC,UAAU,EAAE;gBAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACjD,OAAO,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,QAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aAC5E;iBAAM;gBACL,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;aAChC;SACF;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;SAChC;IACH,CAAC,CAAC,CAAC;CACJ","sourcesContent":["import { Asset } from './Asset';\nimport { IS_ENV_WITH_UPDATES_ENABLED } from './PlatformUtils';\nimport { setCustomSourceTransformer } from './resolveAssetSource';\n\n// Override React Native's asset resolution for `Image` components in contexts where it matters\nif (IS_ENV_WITH_UPDATES_ENABLED) {\n setCustomSourceTransformer((resolver) => {\n try {\n // Bundler is using the hashAssetFiles plugin if and only if the fileHashes property exists\n if (resolver.asset.fileHashes) {\n const asset = Asset.fromMetadata(resolver.asset);\n return resolver.fromSource(asset.downloaded ? asset.localUri! : asset.uri);\n } else {\n return resolver.defaultAsset();\n }\n } catch (e) {\n return resolver.defaultAsset();\n }\n });\n}\n"]}
1
+ {"version":3,"file":"Asset.fx.js","sourceRoot":"","sources":["../src/Asset.fx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE,+FAA+F;AAC/F,IAAI,2BAA2B,EAAE;IAC/B,0BAA0B,CAAC,CAAC,QAAQ,EAAE,EAAE;QACtC,IAAI;YACF,2FAA2F;YAC3F,IAAI,QAAQ,CAAC,KAAK,CAAC,UAAU,EAAE;gBAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACjD,OAAO,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,QAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aAC5E;iBAAM;gBACL,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;aAChC;SACF;QAAC,MAAM;YACN,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;SAChC;IACH,CAAC,CAAC,CAAC;CACJ","sourcesContent":["import { Asset } from './Asset';\nimport { IS_ENV_WITH_UPDATES_ENABLED } from './PlatformUtils';\nimport { setCustomSourceTransformer } from './resolveAssetSource';\n\n// Override React Native's asset resolution for `Image` components in contexts where it matters\nif (IS_ENV_WITH_UPDATES_ENABLED) {\n setCustomSourceTransformer((resolver) => {\n try {\n // Bundler is using the hashAssetFiles plugin if and only if the fileHashes property exists\n if (resolver.asset.fileHashes) {\n const asset = Asset.fromMetadata(resolver.asset);\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"]}
@@ -20,3 +20,4 @@ import { Asset } from './Asset';
20
20
  * ```
21
21
  */
22
22
  export declare function useAssets(moduleIds: number | number[]): [Asset[] | undefined, Error | undefined];
23
+ //# sourceMappingURL=AssetHooks.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -1 +1,2 @@
1
1
  export * from 'react-native/Libraries/Image/AssetRegistry';
2
+ //# sourceMappingURL=AssetRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetRegistry.d.ts","sourceRoot":"","sources":["../src/AssetRegistry.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from 'react-native-web/dist/modules/AssetRegistry';
2
+ //# sourceMappingURL=AssetRegistry.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetRegistry.web.d.ts","sourceRoot":"","sources":["../src/AssetRegistry.web.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import AssetSourceResolver from 'react-native/Libraries/Image/AssetSourceResolver';
2
2
  export default AssetSourceResolver;
3
3
  export * from 'react-native/Libraries/Image/AssetSourceResolver';
4
+ //# sourceMappingURL=AssetSourceResolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetSourceResolver.d.ts","sourceRoot":"","sources":["../src/AssetSourceResolver.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,kDAAkD,CAAC;AACnF,eAAe,mBAAmB,CAAC;AACnC,cAAc,kDAAkD,CAAC"}
@@ -33,3 +33,4 @@ export default class AssetSourceResolver {
33
33
  static pickScale(scales: number[], deviceScale: number): number;
34
34
  }
35
35
  export {};
36
+ //# sourceMappingURL=AssetSourceResolver.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetSourceResolver.web.d.ts","sourceRoot":"","sources":["../src/AssetSourceResolver.web.ts"],"names":[],"mappings":"AAIA,aAAK,aAAa,GAAG;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AASF,oBAAY,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;AAaF,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACtC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,KAAK,EAAE,aAAa,CAAC;gBAGnB,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACpC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACtC,KAAK,EAAE,aAAa;IAMtB,kBAAkB,IAAI,OAAO;IAG7B,sBAAsB,IAAI,OAAO;IAGjC,YAAY,IAAI,mBAAmB;IAOnC,cAAc,IAAI,mBAAmB;IAWrC,eAAe,IAAI,mBAAmB;IAGtC,wBAAwB,IAAI,mBAAmB;IAI/C,8BAA8B,IAAI,mBAAmB;IAGrD,sBAAsB,IAAI,mBAAmB;IAG7C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB;IAU/C,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM;CAQhE"}
@@ -27,3 +27,4 @@ export declare function selectAssetSource(meta: AssetMetadata): AssetSource;
27
27
  * base URI.
28
28
  */
29
29
  export declare function resolveUri(uri: string): string;
30
+ //# sourceMappingURL=AssetSources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetSources.d.ts","sourceRoot":"","sources":["../src/AssetSources.ts"],"names":[],"mappings":"AASA,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAKF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,WAAW,CAiElE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAc9C"}
@@ -60,7 +60,7 @@ export function selectAssetSource(meta) {
60
60
  }
61
61
  // Production CDN URIs are based on each asset file hash
62
62
  return {
63
- uri: `https://d1wp6m56sqw74a.cloudfront.net/~assets/${encodeURIComponent(hash)}`,
63
+ uri: `https://classic-assets.eascdn.net/~assets/${encodeURIComponent(hash)}`,
64
64
  hash,
65
65
  };
66
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AssetSources.js","sourceRoot":"","sources":["../src/AssetSources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,GAAG,MAAM,WAAW,CAAC;AAE5B,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAqB7E,mEAAmE;AACnE,MAAM,gBAAgB,GAAG,WAAW,EAAE,CAAC,gBAAgB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAmB;IACnD,uDAAuD;IACvD,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAClE,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;KACpD;IAED,kGAAkG;IAClG,2BAA2B;IAC3B,MAAM,KAAK,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CA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C,CAAC;IACzC,MAAM,YAAY,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IACtC,OAAO,OAAO,CAAC,IAAI,CAAC;AACtB,CAAC","sourcesContent":["import { Platform } from 'expo-modules-core';\nimport path from 'path-browserify';\nimport { PixelRatio } from 'react-native';\nimport URL from 'url-parse';\n\nimport AssetSourceResolver from './AssetSourceResolver';\nimport { manifestBaseUrl, getManifest, getManifest2 } from './PlatformUtils';\n\n// @docsMissing\nexport type AssetMetadata = {\n hash: string;\n name: string;\n type: string;\n width?: number;\n height?: number;\n scales: number[];\n httpServerLocation: string;\n uri?: string;\n fileHashes?: string[];\n fileUris?: string[];\n};\n\nexport type AssetSource = {\n uri: string;\n hash: string;\n};\n\n// Fast lookup check if asset map has any overrides in the manifest\nconst assetMapOverride = getManifest().assetMapOverride;\n\n/**\n * Selects the best file for the given asset (ex: choosing the best scale for images) and returns\n * a { uri, hash } pair for the specific asset file.\n *\n * If the asset isn't an image with multiple scales, the first file is selected.\n */\nexport function selectAssetSource(meta: AssetMetadata): AssetSource {\n // Override with the asset map in manifest if available\n if (assetMapOverride && assetMapOverride.hasOwnProperty(meta.hash)) {\n meta = { ...meta, ...assetMapOverride[meta.hash] };\n }\n\n // This logic is based on that of AssetSourceResolver, with additional support for file hashes and\n // explicitly provided URIs\n const scale = AssetSourceResolver.pickScale(meta.scales, PixelRatio.get());\n const index = meta.scales.findIndex((s) => s === scale);\n const hash = meta.fileHashes ? meta.fileHashes[index] || meta.fileHashes[0] : meta.hash;\n\n // Allow asset processors to directly provide the URL to load\n const uri = meta.fileUris ? meta.fileUris[index] || meta.fileUris[0] : meta.uri;\n if (uri) {\n return { uri: resolveUri(uri), hash };\n }\n\n // Check if the assetUrl was overridden in the manifest\n const assetUrlOverride = getManifest().assetUrlOverride;\n if (assetUrlOverride) {\n const uri = path.join(assetUrlOverride, hash);\n return { uri: resolveUri(uri), hash };\n }\n\n const fileScale = scale === 1 ? '' : `@${scale}x`;\n const fileExtension = meta.type ? `.${encodeURIComponent(meta.type)}` : '';\n const suffix = `/${encodeURIComponent(\n meta.name\n )}${fileScale}${fileExtension}?platform=${encodeURIComponent(\n Platform.OS\n )}&hash=${encodeURIComponent(meta.hash)}`;\n\n // For assets with a specified absolute URL, we use the existing origin instead of prepending the\n // development server or production CDN URL origin\n if (/^https?:\\/\\//.test(meta.httpServerLocation)) {\n const uri = meta.httpServerLocation + suffix;\n return { uri, hash };\n }\n\n // For assets during development using manifest2, we use the development server's URL origin\n const manifest2 = getManifest2();\n\n if (manifest2?.extra?.expoGo?.developer) {\n const baseUrl = new URL(`http://${manifest2.extra.expoGo.debuggerHost}`);\n baseUrl.set('pathname', meta.httpServerLocation + suffix);\n\n return {\n uri: baseUrl.href,\n hash,\n };\n }\n\n // For assets during development, we use the development server's URL origin\n if (getManifest().developer) {\n const baseUrl = new URL(getManifest().bundleUrl);\n baseUrl.set('pathname', meta.httpServerLocation + suffix);\n return { uri: baseUrl.href, hash };\n }\n\n // Production CDN URIs are based on each asset file hash\n return {\n uri: `https://d1wp6m56sqw74a.cloudfront.net/~assets/${encodeURIComponent(hash)}`,\n hash,\n };\n}\n\n/**\n * Resolves the given URI to an absolute URI. If the given URI is already an absolute URI, it is\n * simply returned. Otherwise, if it is a relative URI, it is resolved relative to the manifest's\n * base URI.\n */\nexport function resolveUri(uri: string): string {\n if (!manifestBaseUrl) {\n return uri;\n }\n\n const { protocol } = new URL(uri);\n if (protocol !== '') {\n return uri;\n }\n\n const baseUrl = new URL(manifestBaseUrl);\n const resolvedPath = uri.startsWith('/') ? uri : path.join(baseUrl.pathname, uri);\n baseUrl.set('pathname', resolvedPath);\n return baseUrl.href;\n}\n"]}
1
+ {"version":3,"file":"Asset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C;IACtC,OAAO,OAAO,CAAC,IAAI,CAAC;AACtB,CAAC","sourcesContent":["import { Platform } from 'expo-modules-core';\nimport path from 'path-browserify';\nimport { PixelRatio } from 'react-native';\nimport URL from 'url-parse';\n\nimport AssetSourceResolver from './AssetSourceResolver';\nimport { manifestBaseUrl, getManifest, getManifest2 } from './PlatformUtils';\n\n// @docsMissing\nexport type AssetMetadata = {\n hash: string;\n name: string;\n type: string;\n width?: number;\n height?: number;\n scales: number[];\n httpServerLocation: string;\n uri?: string;\n fileHashes?: string[];\n fileUris?: string[];\n};\n\nexport type AssetSource = {\n uri: string;\n hash: string;\n};\n\n// Fast lookup check if asset map has any overrides in the manifest\nconst assetMapOverride = getManifest().assetMapOverride;\n\n/**\n * Selects the best file for the given asset (ex: choosing the best scale for images) and returns\n * a { uri, hash } pair for the specific asset file.\n *\n * If the asset isn't an image with multiple scales, the first file is selected.\n */\nexport function selectAssetSource(meta: AssetMetadata): AssetSource {\n // Override with the asset map in manifest if available\n if (assetMapOverride && assetMapOverride.hasOwnProperty(meta.hash)) {\n meta = { ...meta, ...assetMapOverride[meta.hash] };\n }\n\n // This logic is based on that of AssetSourceResolver, with additional support for file hashes and\n // explicitly provided URIs\n const scale = AssetSourceResolver.pickScale(meta.scales, PixelRatio.get());\n const index = meta.scales.findIndex((s) => s === scale);\n const hash = meta.fileHashes ? meta.fileHashes[index] || meta.fileHashes[0] : meta.hash;\n\n // Allow asset processors to directly provide the URL to load\n const uri = meta.fileUris ? meta.fileUris[index] || meta.fileUris[0] : meta.uri;\n if (uri) {\n return { uri: resolveUri(uri), hash };\n }\n\n // Check if the assetUrl was overridden in the manifest\n const assetUrlOverride = getManifest().assetUrlOverride;\n if (assetUrlOverride) {\n const uri = path.join(assetUrlOverride, hash);\n return { uri: resolveUri(uri), hash };\n }\n\n const fileScale = scale === 1 ? '' : `@${scale}x`;\n const fileExtension = meta.type ? `.${encodeURIComponent(meta.type)}` : '';\n const suffix = `/${encodeURIComponent(\n meta.name\n )}${fileScale}${fileExtension}?platform=${encodeURIComponent(\n Platform.OS\n )}&hash=${encodeURIComponent(meta.hash)}`;\n\n // For assets with a specified absolute URL, we use the existing origin instead of prepending the\n // development server or production CDN URL origin\n if (/^https?:\\/\\//.test(meta.httpServerLocation)) {\n const uri = meta.httpServerLocation + suffix;\n return { uri, hash };\n }\n\n // For assets during development using manifest2, we use the development server's URL origin\n const manifest2 = getManifest2();\n\n if (manifest2?.extra?.expoGo?.developer) {\n const baseUrl = new URL(`http://${manifest2.extra.expoGo.debuggerHost}`);\n baseUrl.set('pathname', meta.httpServerLocation + suffix);\n\n return {\n uri: baseUrl.href,\n hash,\n };\n }\n\n // For assets during development, we use the development server's URL origin\n if (getManifest().developer) {\n const baseUrl = new URL(getManifest().bundleUrl);\n baseUrl.set('pathname', meta.httpServerLocation + suffix);\n return { uri: baseUrl.href, hash };\n }\n\n // Production CDN URIs are based on each asset file hash\n return {\n uri: `https://classic-assets.eascdn.net/~assets/${encodeURIComponent(hash)}`,\n hash,\n };\n}\n\n/**\n * Resolves the given URI to an absolute URI. If the given URI is already an absolute URI, it is\n * simply returned. Otherwise, if it is a relative URI, it is resolved relative to the manifest's\n * base URI.\n */\nexport function resolveUri(uri: string): string {\n if (!manifestBaseUrl) {\n return uri;\n }\n\n const { protocol } = new URL(uri);\n if (protocol !== '') {\n return uri;\n }\n\n const baseUrl = new URL(manifestBaseUrl);\n const resolvedPath = uri.startsWith('/') ? uri : path.join(baseUrl.pathname, uri);\n baseUrl.set('pathname', resolvedPath);\n return baseUrl.href;\n}\n"]}
@@ -5,10 +5,11 @@ export declare function getFileExtension(url: string): string;
5
5
  * https://example.com/app/manifest.json, the base URL would be https://example.com/app/. Query
6
6
  * parameters and fragments also are removed.
7
7
  *
8
- * For an Expo-hosted project with a manifest hosted at https://expo.io/@user/project/index.exp, the
9
- * base URL would be https://expo.io/@user/project.
8
+ * For an Expo-hosted project with a manifest hosted at https://exp.host/@user/project/index.exp, the
9
+ * base URL would be https://exp.host/@user/project.
10
10
  *
11
11
  * We also normalize the "exp" protocol to "http" to handle internal URLs with the Expo schemes used
12
12
  * to tell the OS to open the URLs in the the Expo client.
13
13
  */
14
14
  export declare function getManifestBaseUrl(manifestUrl: string): string;
15
+ //# sourceMappingURL=AssetUris.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetUris.d.ts","sourceRoot":"","sources":["../src/AssetUris.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAiB9D"}
@@ -14,8 +14,8 @@ export function getFileExtension(url) {
14
14
  * https://example.com/app/manifest.json, the base URL would be https://example.com/app/. Query
15
15
  * parameters and fragments also are removed.
16
16
  *
17
- * For an Expo-hosted project with a manifest hosted at https://expo.io/@user/project/index.exp, the
18
- * base URL would be https://expo.io/@user/project.
17
+ * For an Expo-hosted project with a manifest hosted at https://exp.host/@user/project/index.exp, the
18
+ * base URL would be https://exp.host/@user/project.
19
19
  *
20
20
  * We also normalize the "exp" protocol to "http" to handle internal URLs with the Expo schemes used
21
21
  * to tell the OS to open the URLs in the the Expo client.
@@ -1 +1 @@
1
- {"version":3,"file":"AssetUris.js","sourceRoot":"","sources":["../src/AssetUris.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,WAAW,CAAC;AAE5B,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACtC,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,EAAE,EAAE,CAAC,CAAC;IAE3C,+CAA+C;IAC/C,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM,EAAE;QACjC,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;KACpC;SAAM,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,EAAE;QACzC,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;KACrC;IAED,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,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACrC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAE1B,OAAO,SAAS,CAAC,IAAI,CAAC;AACxB,CAAC","sourcesContent":["import URL from 'url-parse';\n\nexport function getFilename(url: string): string {\n const { pathname } = new URL(url, {});\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://expo.io/@user/project/index.exp, the\n * base URL would be https://expo.io/@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 // Change the scheme to http(s) if it is exp(s)\n if (urlObject.protocol === 'exp:') {\n urlObject.set('protocol', 'http:');\n } else if (urlObject.protocol === 'exps:') {\n urlObject.set('protocol', 'https:');\n }\n\n // Trim filename, query parameters, and fragment, if any\n const directory = urlObject.pathname.substring(0, urlObject.pathname.lastIndexOf('/') + 1);\n urlObject.set('pathname', directory);\n urlObject.set('query', '');\n urlObject.set('hash', '');\n\n return urlObject.href;\n}\n"]}
1
+ {"version":3,"file":"AssetUris.js","sourceRoot":"","sources":["../src/AssetUris.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,WAAW,CAAC;AAE5B,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACtC,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,EAAE,EAAE,CAAC,CAAC;IAE3C,+CAA+C;IAC/C,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM,EAAE;QACjC,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;KACpC;SAAM,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,EAAE;QACzC,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;KACrC;IAED,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,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACrC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAE1B,OAAO,SAAS,CAAC,IAAI,CAAC;AACxB,CAAC","sourcesContent":["import URL from 'url-parse';\n\nexport function getFilename(url: string): string {\n const { pathname } = new URL(url, {});\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 // Change the scheme to http(s) if it is exp(s)\n if (urlObject.protocol === 'exp:') {\n urlObject.set('protocol', 'http:');\n } else if (urlObject.protocol === 'exps:') {\n urlObject.set('protocol', 'https:');\n }\n\n // Trim filename, query parameters, and fragment, if any\n const directory = urlObject.pathname.substring(0, urlObject.pathname.lastIndexOf('/') + 1);\n urlObject.set('pathname', directory);\n urlObject.set('query', '');\n urlObject.set('hash', '');\n\n return urlObject.href;\n}\n"]}
@@ -6,3 +6,4 @@ declare type ImageInfo = {
6
6
  export declare function isImageType(type: string): boolean;
7
7
  export declare function getImageInfoAsync(url: string): Promise<ImageInfo>;
8
8
  export {};
9
+ //# sourceMappingURL=ImageAssets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageAssets.d.ts","sourceRoot":"","sources":["../src/ImageAssets.ts"],"names":[],"mappings":"AAGA,aAAK,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,CAajE"}
@@ -2,3 +2,4 @@
2
2
  * Returns the URI of a local asset from its hash, or null if the asset is not available locally
3
3
  */
4
4
  export declare function getLocalAssetUri(hash: string, type: string | null): string | null;
5
+ //# sourceMappingURL=LocalAssets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalAssets.d.ts","sourceRoot":"","sources":["../src/LocalAssets.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAwBjF"}
@@ -1 +1,2 @@
1
1
  export declare function getLocalAssetUri(hash: string, type: string | null): string | null;
2
+ //# sourceMappingURL=LocalAssets.web.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -10,3 +10,4 @@ export declare function getManifest(): {
10
10
  export declare function getManifest2(): Manifest | undefined;
11
11
  export declare const manifestBaseUrl: string | null;
12
12
  export declare function downloadAsync(uri: any, hash: any, type: any, name: any): Promise<string>;
13
+ //# sourceMappingURL=PlatformUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlatformUtils.d.ts","sourceRoot":"","sources":["../src/PlatformUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAOhE,eAAO,MAAM,cAAc,SAA2B,CAAC;AAKvD,eAAO,MAAM,wBAAwB,SAKmB,CAAC;AAEzD,eAAO,MAAM,2BAA2B,SAA6C,CAAC;AAGtF,eAAO,MAAM,2BAA2B,SAA+C,CAAC;AAIxF,wBAAgB,cAAc,QAE7B;AAED,wBAAgB,WAAW,IAAI;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAEpD;AAED,wBAAgB,YAAY,IAAI,QAAQ,GAAG,SAAS,CAEnD;AAGD,eAAO,MAAM,eAAe,eAEpB,CAAC;AAGT,wBAAsB,aAAa,CAAC,GAAG,KAAA,EAAE,IAAI,KAAA,EAAE,IAAI,KAAA,EAAE,IAAI,KAAA,GAAG,OAAO,CAAC,MAAM,CAAC,CAM1E"}
@@ -5,3 +5,4 @@ export declare const manifestBaseUrl: null;
5
5
  export declare function downloadAsync(uri: any, hash: any, type: any, name: any): Promise<string>;
6
6
  export declare function getManifest(): {};
7
7
  export declare function getManifest2(): {};
8
+ //# sourceMappingURL=PlatformUtils.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlatformUtils.web.d.ts","sourceRoot":"","sources":["../src/PlatformUtils.web.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QAAQ,CAAC;AACpC,eAAO,MAAM,2BAA2B,QAAQ,CAAC;AACjD,eAAO,MAAM,8BAA8B,QAAQ,CAAC;AAGpD,eAAO,MAAM,eAAe,MAAO,CAAC;AAEpC,wBAAsB,aAAa,CAAC,GAAG,KAAA,EAAE,IAAI,KAAA,EAAE,IAAI,KAAA,EAAE,IAAI,KAAA,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1E;AAED,wBAAgB,WAAW,OAE1B;AAED,wBAAgB,YAAY,OAE3B"}
package/build/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import './Asset.fx';
2
2
  export * from './Asset';
3
3
  export * from './AssetHooks';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -1,3 +1,4 @@
1
1
  import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
2
2
  export default resolveAssetSource;
3
3
  export * from 'react-native/Libraries/Image/resolveAssetSource';
4
+ //# sourceMappingURL=resolveAssetSource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveAssetSource.d.ts","sourceRoot":"","sources":["../src/resolveAssetSource.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,iDAAiD,CAAC;AACjF,eAAe,kBAAkB,CAAC;AAClC,cAAc,iDAAiD,CAAC"}
@@ -6,3 +6,4 @@ export declare function setCustomSourceTransformer(transformer: (resolver: Asset
6
6
  */
7
7
  export default function resolveAssetSource(source: any): ResolvedAssetSource | undefined;
8
8
  export declare const pickScale: typeof AssetSourceResolver.pickScale;
9
+ //# sourceMappingURL=resolveAssetSource.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveAssetSource.web.d.ts","sourceRoot":"","sources":["../src/resolveAssetSource.web.ts"],"names":[],"mappings":"AAGA,OAAO,mBAAmB,EAAE,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAoCjF,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,mBAAmB,GAClE,IAAI,CAEN;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,mBAAmB,GAAG,SAAS,CAevF;AAQD,eAAO,MAAQ,SAAS,sCAAwB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-asset",
3
- "version": "8.4.6",
3
+ "version": "8.6.1",
4
4
  "description": "An Expo universal module to download assets and pass them into other APIs",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -41,12 +41,14 @@
41
41
  "invariant": "^2.2.4",
42
42
  "md5-file": "^3.2.3",
43
43
  "path-browserify": "^1.0.0",
44
- "url-parse": "^1.4.4"
44
+ "url-parse": "^1.5.9",
45
+ "expo-constants": "~13.2.2",
46
+ "expo-file-system": "~14.1.0"
45
47
  },
46
48
  "devDependencies": {
47
49
  "@testing-library/react-hooks": "^7.0.1",
48
50
  "@types/url-parse": "^1.4.1",
49
51
  "expo-module-scripts": "^2.0.0"
50
52
  },
51
- "gitHead": "a21848f3ed4b04a23aee5d3b78a9f60b3c6f59e0"
53
+ "gitHead": "e72a59879ba9ae8d6c7d6118e60c1a29c3e9ea36"
52
54
  }
package/src/Asset.fx.ts CHANGED
@@ -13,7 +13,7 @@ if (IS_ENV_WITH_UPDATES_ENABLED) {
13
13
  } else {
14
14
  return resolver.defaultAsset();
15
15
  }
16
- } catch (e) {
16
+ } catch {
17
17
  return resolver.defaultAsset();
18
18
  }
19
19
  });
@@ -96,7 +96,7 @@ export function selectAssetSource(meta: AssetMetadata): AssetSource {
96
96
 
97
97
  // Production CDN URIs are based on each asset file hash
98
98
  return {
99
- uri: `https://d1wp6m56sqw74a.cloudfront.net/~assets/${encodeURIComponent(hash)}`,
99
+ uri: `https://classic-assets.eascdn.net/~assets/${encodeURIComponent(hash)}`,
100
100
  hash,
101
101
  };
102
102
  }
package/src/AssetUris.ts CHANGED
@@ -17,8 +17,8 @@ export function getFileExtension(url: string): string {
17
17
  * https://example.com/app/manifest.json, the base URL would be https://example.com/app/. Query
18
18
  * parameters and fragments also are removed.
19
19
  *
20
- * For an Expo-hosted project with a manifest hosted at https://expo.io/@user/project/index.exp, the
21
- * base URL would be https://expo.io/@user/project.
20
+ * For an Expo-hosted project with a manifest hosted at https://exp.host/@user/project/index.exp, the
21
+ * base URL would be https://exp.host/@user/project.
22
22
  *
23
23
  * We also normalize the "exp" protocol to "http" to handle internal URLs with the Expo schemes used
24
24
  * to tell the OS to open the URLs in the the Expo client.
package/tsconfig.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "outDir": "./build"
6
6
  },
7
7
  "include": ["./src"],
8
- "exclude": ["**/__mocks__/*", "**/__tests__/*"]
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*", "**/__stories__/*"]
9
9
  }