catalyst-core 0.3.0-beta.5 → 0.3.0-canary.2

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 (316) hide show
  1. package/changelog.md +185 -71
  2. package/dist/errors/generateDocs.js +100 -0
  3. package/dist/errors/index.js +243 -0
  4. package/dist/errors/registry.js +483 -0
  5. package/dist/errors-index.json +506 -0
  6. package/dist/globals.d.ts +62 -0
  7. package/dist/index.d.ts +5 -0
  8. package/dist/index.jsx +5 -8
  9. package/dist/logger.js +1 -1
  10. package/dist/native/androidProject/app/build.gradle.kts +142 -7
  11. package/dist/native/androidProject/app/src/main/AndroidManifest.xml +4 -0
  12. package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/NativeBridge.kt +2 -2
  13. package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/BarcodeDetector.kt +3 -0
  14. package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/CameraSessionManager.kt +3 -0
  15. package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/FrameworkServerUtils.kt +43 -8
  16. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/BridgeUtilsTest.kt +181 -1
  17. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/CameraUtilsTest.kt +156 -236
  18. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/FileSizeRouterUtilsTest.kt +471 -0
  19. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/FileUtilsTest.kt +222 -226
  20. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/FrameworkServerUtilsTest.kt +300 -0
  21. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/IntentUtilsTest.kt +244 -0
  22. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/MetricsMonitorTest.kt +359 -0
  23. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/NativeBridgeTest.kt +108 -63
  24. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/NotificationUtilsTest.kt +329 -385
  25. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/OfflineCacheServiceTest.kt +302 -0
  26. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/PerfEventBufferTest.kt +133 -0
  27. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/UtilsKtTest.kt +152 -0
  28. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/WebCacheManagerTest.kt +145 -324
  29. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/BarcodeDetectorTest.kt +132 -0
  30. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/HoldControllerTest.kt +155 -0
  31. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/TorchControllerTest.kt +150 -0
  32. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/VideoStreamStateMachineTest.kt +120 -0
  33. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/VideoStreamStateTest.kt +62 -0
  34. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/ViewfinderMapperTest.kt +143 -0
  35. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/ZoomControllerTest.kt +421 -0
  36. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/design/DesignTokensTest.kt +207 -0
  37. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/plugins/PluginBridgeTest.kt +368 -0
  38. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/security/FridaDetectorTest.kt +193 -0
  39. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/security/SecurityCheckManagerTest.kt +260 -0
  40. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/security/SecurityCheckSchedulerTest.kt +166 -0
  41. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/utils/DeviceInfoUtilsTest.kt +167 -0
  42. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/utils/DownloadUtilsTest.kt +197 -0
  43. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/utils/NetworkMonitorTest.kt +271 -0
  44. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/utils/PushNotificationUtilsTest.kt +119 -0
  45. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/utils/SafeAreaUtilsTest.kt +108 -0
  46. package/dist/native/androidProject/build.gradle.kts +1 -0
  47. package/dist/native/androidProject/gradle/libs.versions.toml +26 -0
  48. package/dist/native/androidProject/settings.gradle.kts +11 -8
  49. package/dist/native/androidSetup.js +2 -2
  50. package/dist/native/bridge/WebBridge.d.ts +98 -0
  51. package/dist/native/bridge/WebBridge.js +40 -6
  52. package/dist/native/bridge/constants/NativeInterfaces.d.ts +391 -0
  53. package/dist/native/bridge/errors.d.ts +67 -0
  54. package/dist/native/bridge/errors.js +66 -151
  55. package/dist/native/bridge/hooks/index.d.ts +13 -0
  56. package/dist/native/bridge/hooks/index.js +0 -6
  57. package/dist/native/bridge/hooks/useAI.d.ts +1 -0
  58. package/dist/native/bridge/hooks/useAI.js +3 -1
  59. package/dist/native/bridge/hooks/useCamera.d.ts +86 -0
  60. package/dist/native/bridge/hooks/useCamera.js +35 -6
  61. package/dist/native/bridge/hooks/useDataProtection.d.ts +17 -0
  62. package/dist/native/bridge/hooks/useDeviceInfo.d.ts +34 -0
  63. package/dist/native/bridge/hooks/useDeviceInfo.js +5 -0
  64. package/dist/native/bridge/hooks/useFilePicker.d.ts +53 -0
  65. package/dist/native/bridge/hooks/useFilePicker.js +13 -0
  66. package/dist/native/bridge/hooks/useGoogleSignIn.d.ts +12 -0
  67. package/dist/native/bridge/hooks/useHapticFeedback.d.ts +76 -0
  68. package/dist/native/bridge/hooks/useHapticFeedback.js +6 -1
  69. package/dist/native/bridge/hooks/useIntent.d.ts +33 -0
  70. package/dist/native/bridge/hooks/useIntent.js +2 -0
  71. package/dist/native/bridge/hooks/useNativeTransition.d.ts +53 -0
  72. package/dist/native/bridge/hooks/useNativeTransition.js +12 -5
  73. package/dist/native/bridge/hooks/useNetworkStatus.d.ts +22 -0
  74. package/dist/native/bridge/hooks/useNetworkStatus.js +7 -0
  75. package/dist/native/bridge/hooks/useNotification.d.ts +83 -0
  76. package/dist/native/bridge/hooks/useNotification.js +81 -34
  77. package/dist/native/bridge/hooks/useSafeArea.d.ts +12 -0
  78. package/dist/native/bridge/hooks/useSafeArea.js +8 -0
  79. package/dist/native/bridge/hooks/useVideoStream.d.ts +67 -0
  80. package/dist/native/bridge/hooks/useVideoStream.js +38 -52
  81. package/dist/native/bridge/hooks/utils.d.ts +4 -0
  82. package/dist/native/bridge/hooks.d.ts +1 -0
  83. package/dist/native/bridge/perf/collectors/ApiCollector.d.ts +30 -0
  84. package/dist/native/bridge/perf/collectors/ApiCollector.js +4 -0
  85. package/dist/native/bridge/perf/collectors/CacheCollector.d.ts +43 -0
  86. package/dist/native/bridge/perf/collectors/CacheCollector.js +4 -0
  87. package/dist/native/bridge/perf/collectors/HookCollector.d.ts +37 -0
  88. package/dist/native/bridge/perf/collectors/HookCollector.js +4 -0
  89. package/dist/native/bridge/perf/collectors/InsightsCollector.d.ts +103 -0
  90. package/dist/native/bridge/perf/collectors/InsightsCollector.js +4 -0
  91. package/dist/native/bridge/perf/collectors/InteractionCollector.d.ts +53 -0
  92. package/dist/native/bridge/perf/collectors/InteractionCollector.js +4 -0
  93. package/dist/native/bridge/perf/collectors/KeyboardCollector.d.ts +30 -0
  94. package/dist/native/bridge/perf/collectors/KeyboardCollector.js +4 -0
  95. package/dist/native/bridge/perf/collectors/NavigationCollector.d.ts +37 -0
  96. package/dist/native/bridge/perf/collectors/NavigationCollector.js +4 -0
  97. package/dist/native/bridge/perf/collectors/NetworkTimingCollector.d.ts +30 -0
  98. package/dist/native/bridge/perf/collectors/NetworkTimingCollector.js +4 -0
  99. package/dist/native/bridge/perf/collectors/RenderCollector.d.ts +47 -0
  100. package/dist/native/bridge/perf/collectors/RenderCollector.js +8 -0
  101. package/dist/native/bridge/perf/collectors/ScrollCollector.d.ts +29 -0
  102. package/dist/native/bridge/perf/collectors/ScrollCollector.js +4 -0
  103. package/dist/native/bridge/perf/collectors/ThreadCollector.d.ts +31 -0
  104. package/dist/native/bridge/perf/collectors/ThreadCollector.js +4 -0
  105. package/dist/native/bridge/perf/core/constants.d.ts +76 -0
  106. package/dist/native/bridge/perf/core/measure.d.ts +39 -0
  107. package/dist/native/bridge/perf/core/measure.js +4 -0
  108. package/dist/native/bridge/perf/core/session.d.ts +49 -0
  109. package/dist/native/bridge/perf/core/session.js +4 -0
  110. package/dist/native/bridge/perf/core/store.d.ts +37 -0
  111. package/dist/native/bridge/perf/core/store.js +4 -0
  112. package/dist/native/bridge/perf/core/summary.d.ts +60 -0
  113. package/dist/native/bridge/perf/core/traceExport.d.ts +10 -0
  114. package/dist/native/bridge/perf/core/waterfalls.d.ts +2 -0
  115. package/dist/native/bridge/perf/index.d.ts +63 -0
  116. package/dist/native/bridge/perf/index.js +4 -0
  117. package/dist/native/bridge/safeArea.d.ts +11 -0
  118. package/dist/native/bridge/safeArea.js +2 -0
  119. package/dist/native/bridge/useBaseHook.d.ts +137 -0
  120. package/dist/native/bridge/useBaseHook.js +34 -4
  121. package/dist/native/bridge/utils/CameraUtils.d.ts +94 -0
  122. package/dist/native/bridge/utils/CameraUtils.js +4 -0
  123. package/dist/native/bridge/utils/FileObjectConverter.d.ts +36 -0
  124. package/dist/native/bridge/utils/NativeBridge.d.ts +270 -0
  125. package/dist/native/bridge/utils/NativeBridge.js +10 -0
  126. package/dist/native/buildAndroid/index.js +1 -1
  127. package/dist/native/buildAppAndroid.js +9 -0
  128. package/dist/native/buildAppIos.js +16 -1
  129. package/dist/native/buildErrorFormat.js +57 -0
  130. package/dist/native/buildIos/config.js +15 -1
  131. package/dist/native/buildIos/index.js +1 -1
  132. package/dist/native/buildIos/plugins.js +10 -1
  133. package/dist/native/iosnativeWebView/CoreLogic/Package.swift +36 -0
  134. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Camera/VideoStreamState.swift +1 -1
  135. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Camera/VideoStreamStateMachine.swift +6 -4
  136. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/BootTimingUtility.swift +3 -3
  137. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/FrameworkServerUtils.swift +14 -9
  138. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/NetworkMonitor.swift +11 -9
  139. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/NotificationHandlerProvider.swift +1 -1
  140. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/URLWhitelistManager.swift +7 -7
  141. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/AnyCodableTests.swift +154 -0
  142. package/dist/native/iosnativeWebView/{iosnativeWebViewTests → CoreLogic/Tests/CatalystCoreLogicTests}/BootTimingUtilityTests.swift +23 -5
  143. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/CatalystConstantsTests.swift +192 -0
  144. package/dist/native/iosnativeWebView/{iosnativeWebViewTests → CoreLogic/Tests/CatalystCoreLogicTests}/ConfigMappingTests.swift +1 -1
  145. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/FrameworkServerUtilsErrorPathTests.swift +106 -0
  146. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/FrameworkServerUtilsLoopbackTests.swift +243 -0
  147. package/dist/native/iosnativeWebView/{iosnativeWebViewTests → CoreLogic/Tests/CatalystCoreLogicTests}/FrameworkServerUtilsTests.swift +1 -1
  148. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/NetworkMonitorTests.swift +119 -0
  149. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/NotificationHandlerProviderTests.swift +59 -0
  150. package/dist/native/iosnativeWebView/{iosnativeWebViewTests → CoreLogic/Tests/CatalystCoreLogicTests}/NotificationHandlerTests.swift +1 -1
  151. package/dist/native/iosnativeWebView/{iosnativeWebViewTests → CoreLogic/Tests/CatalystCoreLogicTests}/URLWhitelistManagerTests.swift +1 -1
  152. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/VideoStreamStateMachineTests.swift +171 -0
  153. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/VideoStreamStateTests.swift +91 -0
  154. package/dist/native/iosnativeWebView/Package.swift +10 -9
  155. package/dist/native/iosnativeWebView/Sources/CatalystNotifications/LocalNotificationHandler.swift +7 -2
  156. package/dist/native/iosnativeWebView/Sources/CatalystNotifications/NotificationManager.swift +1 -2
  157. package/dist/native/iosnativeWebView/Sources/CatalystNotifications/PushNotificationHandler.swift +5 -4
  158. package/dist/native/iosnativeWebView/Sources/Core/Camera/CameraSessionManager.swift +1 -0
  159. package/dist/native/iosnativeWebView/Sources/Core/Camera/HoldController.swift +1 -0
  160. package/dist/native/iosnativeWebView/Sources/Core/Camera/NativeCameraManager.swift +6 -5
  161. package/dist/native/iosnativeWebView/Sources/Core/Camera/ZoomController.swift +1 -0
  162. package/dist/native/iosnativeWebView/Sources/Core/Plugins/PluginBridge.swift +1 -0
  163. package/dist/native/iosnativeWebView/Sources/Core/Utils/CacheManager.swift +31 -30
  164. package/dist/native/iosnativeWebView/Sources/Core/Utils/CameraTransportUtils.swift +2 -1
  165. package/dist/native/iosnativeWebView/Sources/Core/Utils/DeviceInfoUtils.swift +1 -1
  166. package/dist/native/iosnativeWebView/Sources/Core/Utils/FilePickerHandler.swift +22 -19
  167. package/dist/native/iosnativeWebView/Sources/Core/Utils/ImageHandler.swift +40 -39
  168. package/dist/native/iosnativeWebView/Sources/Core/Utils/PerfEventBuffer.swift +1 -0
  169. package/dist/native/iosnativeWebView/Sources/Core/Utils/ResourceURLProtocol.swift +15 -15
  170. package/dist/native/iosnativeWebView/Sources/Core/Utils/WebKitConfig.swift +4 -3
  171. package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeCommandHandler.swift +6 -1
  172. package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeDelegateHandler.swift +1 -0
  173. package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeFileHandler.swift +2 -1
  174. package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeJavaScriptInterface.swift +2 -1
  175. package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeMessageValidator.swift +3 -5
  176. package/dist/native/iosnativeWebView/Sources/Core/WebView/NativeBridge.swift +20 -13
  177. package/dist/native/iosnativeWebView/Sources/Core/WebView/SplashView.swift +6 -5
  178. package/dist/native/iosnativeWebView/Sources/Core/WebView/SplashViewModel.swift +14 -13
  179. package/dist/native/iosnativeWebView/Sources/Core/WebView/TransitionManager.swift +3 -3
  180. package/dist/native/iosnativeWebView/Sources/Core/WebView/WebView.swift +9 -8
  181. package/dist/native/iosnativeWebView/Sources/Core/WebView/WebViewModel.swift +7 -6
  182. package/dist/native/iosnativeWebView/Sources/Core/WebView/WebViewNavigationDelegate.swift +24 -25
  183. package/dist/native/iosnativeWebView/iosnativeWebView/AppDelegate.swift +6 -1
  184. package/dist/native/iosnativeWebView/iosnativeWebView/ContentView.swift +1 -0
  185. package/dist/native/iosnativeWebView/iosnativeWebView/iosnativeWebViewApp.swift +4 -0
  186. package/dist/native/iosnativeWebView/iosnativeWebView.xcodeproj/project.pbxproj +2 -22
  187. package/dist/native/iosnativeWebView/iosnativeWebViewTests/BridgeMessageValidatorTests.swift +1 -0
  188. package/dist/native/iosnativeWebView/iosnativeWebViewTests/CacheManagerTests.swift +1 -0
  189. package/dist/native/iosnativeWebView/iosnativeWebViewTests/FilePickerHandlerTests.swift +2 -1
  190. package/dist/native/iosnativeWebView/iosnativeWebViewTests/NativeBridgeTests.swift +15 -9
  191. package/dist/native/iosnativeWebView/iosnativeWebViewTests/WebViewTests.swift +1 -0
  192. package/dist/native/setupEmulatorIos.js +2 -2
  193. package/dist/native/terminalProgress.js +17 -17
  194. package/dist/router/ClientRouter.d.ts +8 -0
  195. package/dist/router/ClientRouter.js +13 -11
  196. package/dist/router/ServerRouter.d.ts +13 -0
  197. package/dist/router/ServerRouter.js +19 -7
  198. package/dist/scripts/build.js +14 -2
  199. package/dist/scripts/loadEnvironmentVariables.js +3 -2
  200. package/dist/scripts/plugins.js +1 -1
  201. package/dist/scripts/preServerInit.js +49 -3
  202. package/dist/scripts/preflight.js +111 -0
  203. package/dist/scripts/scriptUtils.js +46 -1
  204. package/dist/scripts/serve.js +7 -3
  205. package/dist/scripts/start.js +8 -3
  206. package/dist/server/expressServer.d.ts +1 -0
  207. package/dist/server/expressServer.js +247 -271
  208. package/dist/server/manifestCache.d.ts +2 -0
  209. package/dist/server/manifestCache.js +25 -33
  210. package/dist/server/renderer/ChunkExtractor.d.ts +44 -0
  211. package/dist/server/renderer/ChunkExtractor.js +113 -125
  212. package/dist/server/renderer/document/Body.d.ts +21 -0
  213. package/dist/server/renderer/document/Body.jsx +45 -45
  214. package/dist/server/renderer/document/FastRefresh.d.ts +3 -0
  215. package/dist/server/renderer/document/FastRefresh.jsx +7 -13
  216. package/dist/server/renderer/document/Head.d.ts +20 -0
  217. package/dist/server/renderer/document/Head.jsx +32 -32
  218. package/dist/server/renderer/document/index.d.ts +2 -0
  219. package/dist/server/renderer/document/index.jsx +2 -2
  220. package/dist/server/renderer/extract.d.ts +67 -0
  221. package/dist/server/renderer/extract.js +92 -89
  222. package/dist/server/renderer/handler.d.ts +2 -0
  223. package/dist/server/renderer/handler.jsx +401 -404
  224. package/dist/server/renderer/index.d.ts +2 -0
  225. package/dist/server/renderer/index.js +5 -8
  226. package/dist/server/renderer/render.d.ts +35 -0
  227. package/dist/server/renderer/render.js +25 -32
  228. package/dist/server/utils/botDetectionMiddleware.d.ts +1 -0
  229. package/dist/server/utils/botDetectionMiddleware.js +33 -23
  230. package/dist/server/utils/cjsRequire.d.ts +8 -0
  231. package/dist/server/utils/cjsRequire.js +2 -2
  232. package/dist/server/utils/userAgentUtil.d.ts +7 -0
  233. package/dist/server/utils/userAgentUtil.js +68 -71
  234. package/dist/server/utils/validator.d.ts +31 -0
  235. package/dist/server/utils/validator.js +133 -158
  236. package/dist/vite/inject-cache-key-plugin.js +3 -27
  237. package/dist/vite/moduleAliases.js +36 -0
  238. package/dist/vite/node-loader.mjs +2 -29
  239. package/dist/vite/resolveDevServerConfig.js +4 -1
  240. package/dist/vite/vite.config.js +2 -29
  241. package/dist/web-router/components/MetaTag.d.ts +4 -0
  242. package/dist/web-router/components/MetaTag.jsx +26 -28
  243. package/dist/web-router/components/MetaTag.test.jsx +100 -0
  244. package/dist/web-router/components/RouterDataProvider.d.ts +96 -0
  245. package/dist/web-router/components/RouterDataProvider.jsx +260 -259
  246. package/dist/web-router/components/RouterDataProvider.server.test.jsx +98 -0
  247. package/dist/web-router/components/RouterDataProvider.test.jsx +310 -0
  248. package/dist/web-router/components/Split.d.ts +74 -0
  249. package/dist/web-router/components/Split.jsx +147 -156
  250. package/dist/web-router/components/Split.server.test.jsx +52 -0
  251. package/dist/web-router/components/Split.test.jsx +167 -0
  252. package/dist/web-router/components/SplitInview.d.ts +22 -0
  253. package/dist/web-router/components/SplitInview.jsx +78 -89
  254. package/dist/web-router/components/SplitInview.test.jsx +112 -0
  255. package/dist/web-router/components/SsrRequestContext.d.ts +20 -0
  256. package/dist/web-router/components/SsrRequestContext.jsx +17 -7
  257. package/dist/web-router/components/SsrRequestContext.test.jsx +53 -0
  258. package/dist/web-router/context.d.ts +15 -0
  259. package/dist/web-router/context.jsx +5 -5
  260. package/dist/web-router/context.test.jsx +10 -0
  261. package/dist/web-router/utils/metaDataUtils.d.ts +24 -0
  262. package/dist/web-router/utils/metaDataUtils.jsx +86 -86
  263. package/dist/web-router/utils/metaDataUtils.test.jsx +188 -0
  264. package/dist/web-router/vitest.setup.js +12 -0
  265. package/mcp_v2/knowledge-base.json +115 -17
  266. package/mcp_v2/mcp.js +141 -3
  267. package/mcp_v2/package-lock.json +2031 -0
  268. package/mcp_v2/package.json +13 -2
  269. package/mcp_v2/scripts/copyErrorsIndex.cjs +34 -0
  270. package/mcp_v2/test/errors.test.ts +123 -0
  271. package/mcp_v2/test/github.test.ts +177 -0
  272. package/mcp_v2/tools/errors.d.ts +20 -0
  273. package/mcp_v2/tools/errors.js +63 -0
  274. package/mcp_v2/tools/github.d.ts +41 -0
  275. package/mcp_v2/tools/github.js +231 -0
  276. package/mcp_v2/vitest.config.mjs +22 -0
  277. package/package.json +60 -11
  278. package/test/errors/docsDrift.test.ts +113 -0
  279. package/test/errors/index.test.ts +200 -0
  280. package/test/errors/registry.test.ts +108 -0
  281. package/test/scripts/preflight.test.ts +118 -0
  282. package/test/server/ChunkExtractor.test.ts +97 -0
  283. package/test/server/extract.test.ts +128 -0
  284. package/test/server/fixtures/template/server/document.jsx +19 -0
  285. package/test/server/fixtures/template/server/index.js +10 -0
  286. package/test/server/fixtures/template/src/js/containers/App/index.jsx +33 -0
  287. package/test/server/fixtures/template/src/js/routes/index.jsx +72 -0
  288. package/test/server/fixtures/template/src/js/routes/utils.jsx +39 -0
  289. package/test/server/fixtures/template/src/js/store/index.js +19 -0
  290. package/test/server/handler.assets.test.ts +330 -0
  291. package/test/server/handler.test.ts +208 -0
  292. package/test/server/manifestCache.test.ts +71 -0
  293. package/test/server/render.test.ts +71 -0
  294. package/test/server/scriptUtils.test.ts +103 -0
  295. package/test/server/userAgentUtil.test.ts +48 -0
  296. package/test/server/validator.test.ts +225 -0
  297. package/test/vite/resolveDevServerConfig.test.js +4 -1
  298. package/tsconfig.test.json +23 -0
  299. package/vitest.config.ts +93 -0
  300. package/dist/caching.js +0 -1
  301. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/DeviceInfoUtilsTest.kt +0 -187
  302. package/dist/native/bridge/standardizedHooks.js +0 -611
  303. package/dist/router.js +0 -1
  304. package/dist/scripts/validator.js +0 -149
  305. package/dist/web-router/hooks.jsx +0 -72
  306. package/dist/web-router/types/components/MetaTag.d.ts +0 -2
  307. package/dist/web-router/types/components/RouterDataProvider.d.ts +0 -95
  308. package/dist/web-router/types/context.d.ts +0 -14
  309. package/dist/web-router/types/hooks.d.ts +0 -1
  310. package/dist/web-router/types/index.d.ts +0 -3
  311. package/dist/web-router/types/utils/metaDataUtils.d.ts +0 -40
  312. /package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Constants/CatalystConstants.swift +0 -0
  313. /package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Constants/ConfigConstants.swift +0 -0
  314. /package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Notifications/NotificationModels.swift +0 -0
  315. /package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Protocols/NotificationHandlerProtocol.swift +0 -0
  316. /package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/NullNotificationHandler.swift +0 -0
@@ -0,0 +1,59 @@
1
+ import XCTest
2
+ @testable import CatalystCoreLogic
3
+
4
+ /// A minimal, test-local stub used only to prove NotificationHandlerProvider
5
+ /// actually stores and returns whatever is injected — distinct from
6
+ /// NullNotificationHandler so identity comparison is meaningful.
7
+ private final class StubNotificationHandler: NotificationHandlerProtocol {
8
+ func requestPermission() async -> Bool { true }
9
+ func getPermissionStatusString() async -> String { "GRANTED" }
10
+ func scheduleLocal(_ config: NotificationConfig) -> String { "stub-id" }
11
+ func cancelLocal(_ notificationId: String) -> Bool { true }
12
+ func cancelAllLocal() {}
13
+ func initializePush() async -> (token: String?, error: String?) { ("stub-token", nil) }
14
+ func subscribeToTopic(_ topic: String) async -> Bool { true }
15
+ func unsubscribeFromTopic(_ topic: String) async -> Bool { true }
16
+ func getSubscribedTopics() async -> [String] { ["stub-topic"] }
17
+ func updateBadge(_ count: Int) {}
18
+ func setNavigationHandler(_ handler: @escaping (URL) -> Void) {}
19
+ }
20
+
21
+ /**
22
+ * Unit tests for NotificationHandlerProvider
23
+ *
24
+ * Covers the default (NullNotificationHandler) value and inject() replacing
25
+ * it — the two lines of real logic in this 3-line file.
26
+ */
27
+ final class NotificationHandlerProviderTests: XCTestCase {
28
+
29
+ override func tearDown() {
30
+ // Restore the default so other tests / files aren't affected by
31
+ // this file's injection (NotificationHandlerProvider.shared is
32
+ // process-global mutable state).
33
+ NotificationHandlerProvider.shared = NullNotificationHandler.shared
34
+ super.tearDown()
35
+ }
36
+
37
+ func testDefaultShared_IsNullNotificationHandler() {
38
+ NotificationHandlerProvider.shared = NullNotificationHandler.shared
39
+ XCTAssertTrue(NotificationHandlerProvider.shared as AnyObject === NullNotificationHandler.shared)
40
+ }
41
+
42
+ func testInject_ReplacesSharedHandler() {
43
+ let stub = StubNotificationHandler()
44
+
45
+ NotificationHandlerProvider.inject(stub)
46
+
47
+ XCTAssertTrue(NotificationHandlerProvider.shared as AnyObject === stub)
48
+ XCTAssertFalse(NotificationHandlerProvider.shared as AnyObject === NullNotificationHandler.shared)
49
+ }
50
+
51
+ func testInject_InjectedHandlerBehavesAsProvided() async {
52
+ let stub = StubNotificationHandler()
53
+ NotificationHandlerProvider.inject(stub)
54
+
55
+ let granted = await NotificationHandlerProvider.shared.requestPermission()
56
+
57
+ XCTAssertTrue(granted)
58
+ }
59
+ }
@@ -1,6 +1,6 @@
1
1
  import XCTest
2
2
  import Foundation
3
- @testable import CatalystCore
3
+ @testable import CatalystCoreLogic
4
4
 
5
5
  /**
6
6
  * Unit tests for NotificationHandler
@@ -1,5 +1,5 @@
1
1
  import XCTest
2
- @testable import CatalystCore
2
+ @testable import CatalystCoreLogic
3
3
 
4
4
  /// Unit tests for URLWhitelistManager
5
5
  /// Tests pattern matching, access control, URL cleaning, and thread safety
@@ -0,0 +1,171 @@
1
+ import XCTest
2
+ @testable import CatalystCoreLogic
3
+
4
+ /// A test-local listener that records every callback it receives, and can
5
+ /// be used to exercise both the notification path and the weak-reference
6
+ /// compaction path (by letting it deallocate while still registered).
7
+ private final class RecordingListener: VideoStreamStateListener {
8
+ struct Event: Equatable {
9
+ let prev: String
10
+ let next: String
11
+ }
12
+
13
+ private(set) var events: [Event] = []
14
+
15
+ func onStateChanged(prev: VideoStreamState, next: VideoStreamState) {
16
+ events.append(Event(prev: describe(prev), next: describe(next)))
17
+ }
18
+
19
+ private func describe(_ state: VideoStreamState) -> String {
20
+ switch state {
21
+ case .idle: return "idle"
22
+ case .starting: return "starting"
23
+ case .streaming: return "streaming"
24
+ case .hold: return "hold"
25
+ case .flipping: return "flipping"
26
+ case .stopping: return "stopping"
27
+ }
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Unit tests for VideoStreamStateMachine
33
+ *
34
+ * Covers: initial state, valid/invalid transitions, isActive derivation,
35
+ * listener add/remove/notify, and weak-listener compaction on dealloc.
36
+ */
37
+ final class VideoStreamStateMachineTests: XCTestCase {
38
+
39
+ func testInitialState_IsIdle() {
40
+ let machine = VideoStreamStateMachine()
41
+ XCTAssertEqual(machine.state, .idle)
42
+ XCTAssertFalse(machine.isActive)
43
+ }
44
+
45
+ func testValidTransition_UpdatesStateAndReturnsTrue() {
46
+ let machine = VideoStreamStateMachine()
47
+
48
+ let result = machine.transition(to: .starting)
49
+
50
+ XCTAssertTrue(result)
51
+ XCTAssertEqual(machine.state, .starting)
52
+ }
53
+
54
+ func testInvalidTransition_LeavesStateUnchangedAndReturnsFalse() {
55
+ let machine = VideoStreamStateMachine()
56
+
57
+ // idle -> streaming is not a valid direct transition
58
+ let result = machine.transition(to: .streaming)
59
+
60
+ XCTAssertFalse(result)
61
+ XCTAssertEqual(machine.state, .idle)
62
+ }
63
+
64
+ func testIsActive_TrueWhileStreamingHoldOrFlipping() {
65
+ let machine = VideoStreamStateMachine()
66
+
67
+ machine.transition(to: .starting)
68
+ machine.transition(to: .streaming)
69
+ XCTAssertTrue(machine.isActive)
70
+
71
+ machine.transition(to: .hold)
72
+ XCTAssertTrue(machine.isActive)
73
+
74
+ machine.transition(to: .streaming)
75
+ machine.transition(to: .flipping)
76
+ XCTAssertTrue(machine.isActive)
77
+ }
78
+
79
+ func testIsActive_FalseOnceStopped() {
80
+ let machine = VideoStreamStateMachine()
81
+
82
+ machine.transition(to: .starting)
83
+ machine.transition(to: .streaming)
84
+ machine.transition(to: .stopping)
85
+ XCTAssertFalse(machine.isActive)
86
+
87
+ machine.transition(to: .idle)
88
+ XCTAssertFalse(machine.isActive)
89
+ }
90
+
91
+ func testListener_ReceivesNotificationOnValidTransition() {
92
+ let machine = VideoStreamStateMachine()
93
+ let listener = RecordingListener()
94
+ machine.addListener(listener)
95
+
96
+ machine.transition(to: .starting)
97
+
98
+ XCTAssertEqual(listener.events, [.init(prev: "idle", next: "starting")])
99
+ }
100
+
101
+ func testListener_DoesNotFireOnInvalidTransition() {
102
+ let machine = VideoStreamStateMachine()
103
+ let listener = RecordingListener()
104
+ machine.addListener(listener)
105
+
106
+ let result = machine.transition(to: .streaming) // idle -> streaming is invalid
107
+
108
+ XCTAssertFalse(result)
109
+ XCTAssertTrue(listener.events.isEmpty)
110
+ }
111
+
112
+ func testListener_ReceivesMultipleSequentialTransitions() {
113
+ let machine = VideoStreamStateMachine()
114
+ let listener = RecordingListener()
115
+ machine.addListener(listener)
116
+
117
+ machine.transition(to: .starting)
118
+ machine.transition(to: .streaming)
119
+ machine.transition(to: .stopping)
120
+ machine.transition(to: .idle)
121
+
122
+ XCTAssertEqual(listener.events, [
123
+ .init(prev: "idle", next: "starting"),
124
+ .init(prev: "starting", next: "streaming"),
125
+ .init(prev: "streaming", next: "stopping"),
126
+ .init(prev: "stopping", next: "idle"),
127
+ ])
128
+ }
129
+
130
+ func testRemoveListener_StopsFurtherNotifications() {
131
+ let machine = VideoStreamStateMachine()
132
+ let listener = RecordingListener()
133
+ machine.addListener(listener)
134
+
135
+ machine.transition(to: .starting)
136
+ machine.removeListener(listener)
137
+ machine.transition(to: .streaming)
138
+
139
+ XCTAssertEqual(listener.events, [.init(prev: "idle", next: "starting")])
140
+ }
141
+
142
+ func testWeakListener_DeallocatedListenerDoesNotCrashOnNextTransition() {
143
+ let machine = VideoStreamStateMachine()
144
+
145
+ // Register a listener that immediately goes out of scope; the
146
+ // WeakListenerBox holding it should be compacted away on the next
147
+ // transition rather than crash on a dangling reference.
148
+ autoreleasepool {
149
+ let shortLived = RecordingListener()
150
+ machine.addListener(shortLived)
151
+ }
152
+
153
+ // Should not crash, and should still perform the transition normally.
154
+ let result = machine.transition(to: .starting)
155
+ XCTAssertTrue(result)
156
+ XCTAssertEqual(machine.state, .starting)
157
+ }
158
+
159
+ func testMultipleListeners_AllReceiveNotification() {
160
+ let machine = VideoStreamStateMachine()
161
+ let listenerA = RecordingListener()
162
+ let listenerB = RecordingListener()
163
+ machine.addListener(listenerA)
164
+ machine.addListener(listenerB)
165
+
166
+ machine.transition(to: .starting)
167
+
168
+ XCTAssertEqual(listenerA.events, [.init(prev: "idle", next: "starting")])
169
+ XCTAssertEqual(listenerB.events, [.init(prev: "idle", next: "starting")])
170
+ }
171
+ }
@@ -0,0 +1,91 @@
1
+ import XCTest
2
+ @testable import CatalystCoreLogic
3
+
4
+ /**
5
+ * Unit tests for VideoStreamState
6
+ *
7
+ * Exhaustive truth-table coverage of the state transition rules documented
8
+ * directly in VideoStreamState.swift:
9
+ *
10
+ * IDLE → STARTING (start() called)
11
+ * STARTING → STREAMING (session running)
12
+ * STARTING → IDLE (permission denied or bind failure)
13
+ * STREAMING → HOLD (QR detected)
14
+ * HOLD → STREAMING (hold expired)
15
+ * STREAMING → FLIPPING (flip() called)
16
+ * FLIPPING → STREAMING (rebind complete)
17
+ * STREAMING → STOPPING (stop() called)
18
+ * FLIPPING → STOPPING (stop() called mid-flip)
19
+ * HOLD → STOPPING (stop() called during hold)
20
+ * STOPPING → IDLE (session torn down)
21
+ *
22
+ * Every other (from, to) pair among the 6 states must be rejected.
23
+ */
24
+ final class VideoStreamStateTests: XCTestCase {
25
+
26
+ private static let allStates: [VideoStreamState] = [
27
+ .idle, .starting, .streaming, .hold, .flipping, .stopping,
28
+ ]
29
+
30
+ /// The exact set of valid transitions, mirroring the doc comment above.
31
+ private static let validTransitions: Set<[String]> = [
32
+ ["idle", "starting"],
33
+ ["starting", "streaming"],
34
+ ["starting", "idle"],
35
+ ["streaming", "hold"],
36
+ ["hold", "streaming"],
37
+ ["streaming", "flipping"],
38
+ ["flipping", "streaming"],
39
+ ["streaming", "stopping"],
40
+ ["flipping", "stopping"],
41
+ ["hold", "stopping"],
42
+ ["stopping", "idle"],
43
+ ]
44
+
45
+ private func name(_ state: VideoStreamState) -> String {
46
+ switch state {
47
+ case .idle: return "idle"
48
+ case .starting: return "starting"
49
+ case .streaming: return "streaming"
50
+ case .hold: return "hold"
51
+ case .flipping: return "flipping"
52
+ case .stopping: return "stopping"
53
+ }
54
+ }
55
+
56
+ func testCanTransitionTo_ExhaustiveTruthTable() {
57
+ for from in Self.allStates {
58
+ for to in Self.allStates {
59
+ let expected = Self.validTransitions.contains([name(from), name(to)])
60
+ let actual = from.canTransitionTo(to)
61
+ XCTAssertEqual(
62
+ actual, expected,
63
+ "canTransitionTo mismatch: \(name(from)) -> \(name(to)), expected \(expected), got \(actual)"
64
+ )
65
+ }
66
+ }
67
+ }
68
+
69
+ func testIsActive_StreamingHoldFlippingAreActive() {
70
+ XCTAssertTrue(VideoStreamState.streaming.isActive)
71
+ XCTAssertTrue(VideoStreamState.hold.isActive)
72
+ XCTAssertTrue(VideoStreamState.flipping.isActive)
73
+ }
74
+
75
+ func testIsActive_IdleStartingStoppingAreNotActive() {
76
+ XCTAssertFalse(VideoStreamState.idle.isActive)
77
+ XCTAssertFalse(VideoStreamState.starting.isActive)
78
+ XCTAssertFalse(VideoStreamState.stopping.isActive)
79
+ }
80
+
81
+ func testIsActive_AllStatesCoveredExactlyOnce() {
82
+ // Sanity check that the two tests above between them cover every
83
+ // case in the enum — guards against silently missing a case if the
84
+ // enum ever grows.
85
+ let activeCount = Self.allStates.filter { $0.isActive }.count
86
+ let inactiveCount = Self.allStates.filter { !$0.isActive }.count
87
+ XCTAssertEqual(activeCount, 3)
88
+ XCTAssertEqual(inactiveCount, 3)
89
+ XCTAssertEqual(activeCount + inactiveCount, Self.allStates.count)
90
+ }
91
+ }
@@ -6,11 +6,12 @@ import PackageDescription
6
6
  // TODO: haven't made this conditional yet
7
7
  let package = Package(
8
8
  name: "iosnativeWebView",
9
- platforms: [.iOS(.v17)],
9
+ platforms: [.iOS(.v17), .macOS(.v13)],
10
10
  products: [
11
11
  .library(name: "CatalystCore", targets: ["CatalystCore"])
12
12
  ],
13
13
  dependencies: [
14
+ .package(path: "CoreLogic"),
14
15
  .package(url: "https://github.com/kylef/JSONSchema.swift", from: "0.6.0"),
15
16
  .package(url: "https://github.com/google/GoogleSignIn-iOS", from: "7.0.0")
16
17
  ],
@@ -20,18 +21,18 @@ let package = Package(
20
21
  .target(
21
22
  name: "CatalystCore",
22
23
  dependencies: [
24
+ .product(name: "CatalystCoreLogic", package: "CoreLogic"),
23
25
  .product(name: "JSONSchema", package: "JSONSchema.swift"),
24
26
  .product(name: "GoogleSignIn", package: "GoogleSignIn-iOS")
25
27
  ],
26
28
  path: "Sources/Core"
27
- ),
28
- // Test target for CatalystCore
29
- // Tests are excluded from npm package via .npmignore
30
- // Run with: swift test (from iosnativeWebView directory)
31
- .testTarget(
32
- name: "CatalystCoreTests",
33
- dependencies: ["CatalystCore"],
34
- path: "Tests/CatalystCoreTests"
35
29
  )
30
+ // Note: no .testTarget here for CatalystCore's own simulator-based tests
31
+ // (iosnativeWebViewTests) — those are declared and run via the Xcode
32
+ // project/scheme, not `swift test` at this package root. The
33
+ // CatalystCoreLogicTests test target lives in the nested CoreLogic/
34
+ // package (see CoreLogic/Package.swift) so `swift test --package-path
35
+ // CoreLogic` can run with zero simulator, zero remote dependency
36
+ // resolution.
36
37
  ]
37
38
  )
@@ -3,6 +3,7 @@ import UserNotifications
3
3
  import UIKit
4
4
  import os
5
5
  import CatalystCore
6
+ import CatalystCoreLogic
6
7
 
7
8
  private let logger = Logger(subsystem: Bundle.main.bundleIdentifier ?? "com.app", category: "LocalNotificationHandler")
8
9
 
@@ -194,7 +195,11 @@ class LocalNotificationHandler: NSObject, UNUserNotificationCenterDelegate {
194
195
  completionHandler()
195
196
  }
196
197
 
197
- func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
198
+ func userNotificationCenter(
199
+ _ center: UNUserNotificationCenter,
200
+ willPresent notification: UNNotification,
201
+ withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
202
+ ) {
198
203
 
199
204
  // Show notification even when app is in foreground
200
205
  // Check if notification has sound (vibrate enabled)
@@ -290,4 +295,4 @@ class LocalNotificationHandler: NSObject, UNUserNotificationCenterDelegate {
290
295
  return url
291
296
  }
292
297
 
293
- }
298
+ }
@@ -3,6 +3,7 @@ import UserNotifications
3
3
  import UIKit
4
4
  import os
5
5
  import CatalystCore
6
+ import CatalystCoreLogic
6
7
  import FirebaseCore
7
8
  import FirebaseMessaging
8
9
 
@@ -16,7 +17,6 @@ public final class NotificationManager: ObservableObject, NotificationHandlerPro
16
17
  private var navigationHandler: ((URL) -> Void)?
17
18
  private var baseURL: String = ""
18
19
 
19
-
20
20
  private init() {
21
21
  self.localHandler = LocalNotificationHandler(baseURL: "")
22
22
  self.pushHandler = PushNotificationHandler()
@@ -62,7 +62,6 @@ public final class NotificationManager: ObservableObject, NotificationHandlerPro
62
62
  NotificationChannelManager.setupChannels()
63
63
  }
64
64
 
65
-
66
65
  // MARK: - Permission Management
67
66
 
68
67
  public func requestPermission() async -> Bool {
@@ -2,6 +2,7 @@ import Foundation
2
2
  import UIKit
3
3
  import os
4
4
  import CatalystCore
5
+ import CatalystCoreLogic
5
6
  import FirebaseMessaging
6
7
  import FirebaseCore
7
8
 
@@ -66,19 +67,19 @@ class PushNotificationHandler: NSObject {
66
67
  }
67
68
  }
68
69
  }
69
-
70
+
70
71
  // Task 2: Timeout after 30 seconds
71
72
  group.addTask {
72
73
  try? await Task.sleep(nanoseconds: 30_000_000_000) // 30 seconds
73
74
  return (nil, "FCM token request timed out after 30 seconds. Check network connectivity and Firebase configuration.")
74
75
  }
75
-
76
+
76
77
  // Return the first result (either token or timeout)
77
78
  if let result = await group.next() {
78
79
  group.cancelAll()
79
80
  return result
80
81
  }
81
-
82
+
82
83
  return (nil, "Unknown error getting FCM token")
83
84
  }
84
85
  #endif
@@ -196,4 +197,4 @@ extension PushNotificationHandler: MessagingDelegate {
196
197
  self.fcmToken = fcmToken
197
198
  onTokenRefresh?(fcmToken)
198
199
  }
199
- }
200
+ }
@@ -2,6 +2,7 @@ import Foundation
2
2
  import AVFoundation
3
3
  import UIKit
4
4
  import os
5
+ import CatalystCoreLogic
5
6
 
6
7
  private let logger = Logger(subsystem: Bundle.main.bundleIdentifier ?? "com.app", category: "CameraSessionManager")
7
8
 
@@ -1,5 +1,6 @@
1
1
  import Foundation
2
2
  import os
3
+ import CatalystCoreLogic
3
4
 
4
5
  private let logger = Logger(subsystem: Bundle.main.bundleIdentifier ?? "com.app", category: "HoldController")
5
6
 
@@ -2,6 +2,7 @@ import Foundation
2
2
  import AVFoundation
3
3
  import UIKit
4
4
  import os
5
+ import CatalystCoreLogic
5
6
 
6
7
  private let logger = Logger(subsystem: Bundle.main.bundleIdentifier ?? "com.app", category: "NativeCameraManager")
7
8
 
@@ -76,8 +77,8 @@ public class NativeCameraManager: ObservableObject {
76
77
  onZoomChanged: { zoomLevel, minZoom, maxZoom in
77
78
  let payload: [String: Any] = [
78
79
  "zoomLevel": round(Double(zoomLevel) * 10) / 10,
79
- "minZoom": round(Double(minZoom) * 10) / 10,
80
- "maxZoom": round(Double(maxZoom) * 10) / 10
80
+ "minZoom": round(Double(minZoom) * 10) / 10,
81
+ "maxZoom": round(Double(maxZoom) * 10) / 10
81
82
  ]
82
83
  eBox.call("ON_ZOOM_CHANGED", payload)
83
84
  }
@@ -96,15 +97,15 @@ public class NativeCameraManager: ObservableObject {
96
97
  zoomController: zoomController,
97
98
  torchController: torchController,
98
99
  barcodeDetector: barcodeDetector,
99
- onReady: { eBox.call("ON_VIDEO_STREAM_READY", nil) },
100
+ onReady: { eBox.call("ON_VIDEO_STREAM_READY", nil) },
100
101
  onStopped: { eBox.call("ON_VIDEO_STREAM_STOPPED", nil) },
101
- onError: { msg in errBox.call(msg) }
102
+ onError: { msg in errBox.call(msg) }
102
103
  )
103
104
 
104
105
  holdController = HoldController(stateMachine: sm, barcodeDetector: barcodeDetector)
105
106
 
106
107
  // Wire detection handler now that holdController exists
107
- barcodeDetector.detectionHandler = { [weak holdController, weak sm] value, type, bounds in
108
+ barcodeDetector.detectionHandler = { [weak holdController, weak sm] value, type, _ in
108
109
  guard sm?.state != .hold else { return }
109
110
  guard let hc = holdController else { return }
110
111
  if hc.isNewValue(value) {
@@ -2,6 +2,7 @@ import Foundation
2
2
  import AVFoundation
3
3
  import UIKit
4
4
  import os
5
+ import CatalystCoreLogic
5
6
 
6
7
  private let logger = Logger(subsystem: Bundle.main.bundleIdentifier ?? "com.app", category: "ZoomController")
7
8
 
@@ -2,6 +2,7 @@ import Foundation
2
2
  import WebKit
3
3
  import UIKit
4
4
  import os
5
+ import CatalystCoreLogic
5
6
 
6
7
  private let pluginBridgeLogger = Logger(subsystem: Bundle.main.bundleIdentifier ?? "com.app", category: "PluginBridge")
7
8