@mentra/crust 0.1.0-beta.0

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 (66) hide show
  1. package/README.md +41 -0
  2. package/android/build.gradle +146 -0
  3. package/android/src/internal/AndroidManifest.xml +9 -0
  4. package/android/src/internal/java/com/mentra/crust/receivers/CaptionsTesterIncidentReceiver.kt +46 -0
  5. package/android/src/main/AndroidManifest.xml +19 -0
  6. package/android/src/main/java/com/mentra/crust/CrustModule.kt +1042 -0
  7. package/android/src/main/java/com/mentra/crust/CrustView.kt +30 -0
  8. package/android/src/main/java/com/mentra/crust/heading/HeadingManager.kt +150 -0
  9. package/android/src/main/java/com/mentra/crust/jsc/JSCDispatcher.kt +189 -0
  10. package/android/src/main/java/com/mentra/crust/jsc/JSCPolyfillBridge.kt +287 -0
  11. package/android/src/main/java/com/mentra/crust/jsc/JSCRuntime.kt +593 -0
  12. package/android/src/main/java/com/mentra/crust/navigation/NavigationManager.kt +1445 -0
  13. package/android/src/main/java/com/mentra/crust/services/NotificationListener.kt +319 -0
  14. package/android/src/main/java/com/mentra/crust/utils/ImageProcessor.java +452 -0
  15. package/android/src/main/java/com/mentra/crust/utils/VideoStabilizer.kt +556 -0
  16. package/android/src/main/res/values/strings.xml +3 -0
  17. package/app.plugin.js +3 -0
  18. package/build/Crust.types.d.ts +148 -0
  19. package/build/Crust.types.d.ts.map +1 -0
  20. package/build/Crust.types.js +2 -0
  21. package/build/Crust.types.js.map +1 -0
  22. package/build/CrustModule.d.ts +182 -0
  23. package/build/CrustModule.d.ts.map +1 -0
  24. package/build/CrustModule.js +4 -0
  25. package/build/CrustModule.js.map +1 -0
  26. package/build/CrustModule.web.d.ts +34 -0
  27. package/build/CrustModule.web.d.ts.map +1 -0
  28. package/build/CrustModule.web.js +63 -0
  29. package/build/CrustModule.web.js.map +1 -0
  30. package/build/CrustView.d.ts +4 -0
  31. package/build/CrustView.d.ts.map +1 -0
  32. package/build/CrustView.js +7 -0
  33. package/build/CrustView.js.map +1 -0
  34. package/build/CrustView.web.d.ts +4 -0
  35. package/build/CrustView.web.d.ts.map +1 -0
  36. package/build/CrustView.web.js +7 -0
  37. package/build/CrustView.web.js.map +1 -0
  38. package/build/index.d.ts +4 -0
  39. package/build/index.d.ts.map +1 -0
  40. package/build/index.js +6 -0
  41. package/build/index.js.map +1 -0
  42. package/expo-module.config.json +9 -0
  43. package/ios/Crust.podspec +65 -0
  44. package/ios/CrustModule.swift +781 -0
  45. package/ios/CrustView.swift +38 -0
  46. package/ios/Resources/startup.js +814 -0
  47. package/ios/Source/JSCDispatcher.swift +226 -0
  48. package/ios/Source/JSCPolyfillBridge.swift +378 -0
  49. package/ios/Source/JSCRuntime.swift +673 -0
  50. package/ios/Source/utils/ImageProcessor.swift +392 -0
  51. package/ios/Source/utils/SystemGestures.swift +53 -0
  52. package/ios/Source/utils/VideoStabilizer.swift +374 -0
  53. package/ios/heading/HeadingManager.swift +74 -0
  54. package/ios/navigation/NavPayloads.swift +62 -0
  55. package/ios/navigation/NavigationManager.swift +720 -0
  56. package/package.json +69 -0
  57. package/plugin/build/index.d.ts +19 -0
  58. package/plugin/build/index.js +23 -0
  59. package/plugin/build/withAndroid.d.ts +2 -0
  60. package/plugin/build/withAndroid.js +78 -0
  61. package/src/Crust.types.ts +157 -0
  62. package/src/CrustModule.ts +191 -0
  63. package/src/CrustModule.web.ts +66 -0
  64. package/src/CrustView.tsx +10 -0
  65. package/src/CrustView.web.tsx +11 -0
  66. package/src/index.ts +5 -0
@@ -0,0 +1,65 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = 'Crust'
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.description = package['description']
10
+ s.license = package['license']
11
+ s.author = package['author']
12
+ s.homepage = package['homepage']
13
+ s.platforms = {
14
+ :ios => '15.1',
15
+ :tvos => '15.1'
16
+ }
17
+ s.swift_version = '5.9'
18
+ s.source = { git: 'https://github.com/fossephate/crust' }
19
+ s.static_framework = true
20
+
21
+ s.dependency 'ExpoModulesCore'
22
+ # Mapbox Navigation SDK v3 for iOS (migrated from GoogleNavigation, matching
23
+ # the Android Mapbox migration). It is added as a SWIFT PACKAGE, not a
24
+ # CocoaPods dependency — Mapbox Nav v3 dropped reliable CocoaPods support, so
25
+ # `pod install` cannot resolve 'MapboxNavigationCore' ("Unable to find a
26
+ # specification"). The SPM package is wired into the Xcode project by
27
+ # mobile/plugins/mapbox-nav-ios.ts at prebuild, and its MapboxMaps dependency
28
+ # + Downloads-token auth come from the @rnmapbox/maps config plugin. So there
29
+ # is intentionally NO `s.dependency 'MapboxNavigationCore'` here.
30
+
31
+ # iOS frameworks required for media processing + navigation + heading
32
+ s.frameworks = 'AVFoundation', 'Photos', 'CoreImage', 'CoreGraphics', 'UIKit', 'CoreLocation', 'CoreMotion'
33
+
34
+ # Swift/Objective-C compatibility + Mapbox SPM module visibility.
35
+ #
36
+ # MapboxNavigationCore / MapboxMaps / MapboxDirections are linked into the
37
+ # Crust target as Swift Package products (see plugins/mapbox-nav-crust-link.ts).
38
+ # MapboxDirections builds as a STATIC LIBRARY, so SPM emits it as a bare
39
+ # `MapboxDirections.swiftmodule` in the build-products dir rather than a
40
+ # `.framework`. For `import MapboxDirections` to resolve from this CocoaPods
41
+ # target, its build-products dir must be on SWIFT_INCLUDE_PATHS (and the
42
+ # framework dir on FRAMEWORK_SEARCH_PATHS for the .framework deps like
43
+ # MapboxMaps/MapboxCommon/MapboxCoreMaps). ${PODS_CONFIGURATION_BUILD_DIR}
44
+ # resolves to Build/Products/$CONFIGURATION-$PLATFORM, where SPM drops them.
45
+ s.pod_target_xcconfig = {
46
+ 'DEFINES_MODULE' => 'YES',
47
+ 'SWIFT_INCLUDE_PATHS' => '$(inherited) "${PODS_CONFIGURATION_BUILD_DIR}"',
48
+ 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "${PODS_CONFIGURATION_BUILD_DIR}"',
49
+ 'OTHER_SWIFT_FLAGS' => '$(inherited) -I "${PODS_CONFIGURATION_BUILD_DIR}"',
50
+ }
51
+
52
+ s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}"
53
+
54
+ # Ship the MentraJS polyfill bundle inside the pod's resource bundle so
55
+ # JSCRuntime can read it at runtime via Bundle.main. The source of
56
+ # truth lives at `@mentra/jspolyfill/assets/startup.js`, but
57
+ # CocoaPods silently drops `..` paths from `resource_bundles` — so the
58
+ # runtime's build script mirrors the file to `ios/Resources/startup.js`
59
+ # (gitignored) and we point the glob at that local path. Run
60
+ # `bun run --filter @mentra/jspolyfill build` (or just `bun install`
61
+ # at the repo root) to regenerate it after editing the polyfill source.
62
+ s.resource_bundles = {
63
+ 'MentraJSRuntime' => ['Resources/startup.js']
64
+ }
65
+ end