react-native-monflowts 0.0.0-stage → 0.5.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.
- package/LICENSE +20 -0
- package/Monflowts.podspec +22 -0
- package/README.md +229 -2
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +8 -0
- package/android/src/main/java/com/monflowts/MonflowtsAssetsModule.kt +219 -0
- package/android/src/main/java/com/monflowts/MonflowtsCrashFeedModule.kt +175 -0
- package/android/src/main/java/com/monflowts/MonflowtsHapticModule.kt +170 -0
- package/android/src/main/java/com/monflowts/MonflowtsLottieView.kt +96 -0
- package/android/src/main/java/com/monflowts/MonflowtsLottieViewManager.kt +53 -0
- package/android/src/main/java/com/monflowts/MonflowtsPackage.kt +70 -0
- package/android/src/main/java/com/monflowts/MonflowtsSoundModule.kt +132 -0
- package/android/src/main/java/com/monflowts/MonflowtsSpeechModule.kt +81 -0
- package/android/src/main/java/com/monflowts/MonflowtsSvgView.kt +355 -0
- package/android/src/main/java/com/monflowts/MonflowtsSvgViewManager.kt +59 -0
- package/android/src/main/java/com/monflowts/MonflowtsWebView.kt +86 -0
- package/android/src/main/java/com/monflowts/MonflowtsWebViewManager.kt +33 -0
- package/android/src/main/java/com/monflowts/MonflowtsWheelView.kt +98 -0
- package/android/src/main/java/com/monflowts/MonflowtsWheelViewManager.kt +46 -0
- package/ios/Monflowts-Bridging-Header.h +5 -0
- package/ios/MonflowtsAssetsBridge.m +14 -0
- package/ios/MonflowtsAssetsModule.swift +217 -0
- package/ios/MonflowtsCrashFeedBridge.m +9 -0
- package/ios/MonflowtsCrashFeedModule.swift +88 -0
- package/ios/MonflowtsHTTP1EventSource.swift +296 -0
- package/ios/MonflowtsHapticBridge.m +8 -0
- package/ios/MonflowtsHapticModule.swift +55 -0
- package/ios/MonflowtsLottieBridge.m +12 -0
- package/ios/MonflowtsLottieUIView.swift +95 -0
- package/ios/MonflowtsLottieViewManager.swift +13 -0
- package/ios/MonflowtsSSEParser.swift +58 -0
- package/ios/MonflowtsSoundBridge.m +8 -0
- package/ios/MonflowtsSoundModule.swift +100 -0
- package/ios/MonflowtsSpeechBridge.m +9 -0
- package/ios/MonflowtsSpeechModule.swift +61 -0
- package/ios/MonflowtsSvgBridge.m +11 -0
- package/ios/MonflowtsSvgUIView.swift +431 -0
- package/ios/MonflowtsSvgViewManager.swift +13 -0
- package/ios/MonflowtsWebBridge.m +8 -0
- package/ios/MonflowtsWebUIView.swift +92 -0
- package/ios/MonflowtsWebViewManager.swift +14 -0
- package/ios/MonflowtsWheelBridge.m +7 -0
- package/ios/MonflowtsWheelUIView.swift +126 -0
- package/ios/MonflowtsWheelViewManager.swift +14 -0
- package/lib/module/HapticsManager.js +93 -0
- package/lib/module/HapticsManager.js.map +1 -0
- package/lib/module/HubContent.js +642 -0
- package/lib/module/HubContent.js.map +1 -0
- package/lib/module/Icons.js +64 -0
- package/lib/module/Icons.js.map +1 -0
- package/lib/module/MonflowtsHub.js +233 -0
- package/lib/module/MonflowtsHub.js.map +1 -0
- package/lib/module/NativeLottieView.js +6 -0
- package/lib/module/NativeLottieView.js.map +1 -0
- package/lib/module/NativeSvgView.js +6 -0
- package/lib/module/NativeSvgView.js.map +1 -0
- package/lib/module/NativeWebView.js +14 -0
- package/lib/module/NativeWebView.js.map +1 -0
- package/lib/module/NativeWheelView.js +6 -0
- package/lib/module/NativeWheelView.js.map +1 -0
- package/lib/module/SoundManager.js +120 -0
- package/lib/module/SoundManager.js.map +1 -0
- package/lib/module/SpeechManager.js +40 -0
- package/lib/module/SpeechManager.js.map +1 -0
- package/lib/module/api/client.js +109 -0
- package/lib/module/api/client.js.map +1 -0
- package/lib/module/api/gameTypes.js +2 -0
- package/lib/module/api/gameTypes.js.map +1 -0
- package/lib/module/api/http.js +252 -0
- package/lib/module/api/http.js.map +1 -0
- package/lib/module/api/mutations.js +359 -0
- package/lib/module/api/mutations.js.map +1 -0
- package/lib/module/api/playerTypes.js +2 -0
- package/lib/module/api/playerTypes.js.map +1 -0
- package/lib/module/api/queries.js +403 -0
- package/lib/module/api/queries.js.map +1 -0
- package/lib/module/api/sdkTypes.js +2 -0
- package/lib/module/api/sdkTypes.js.map +1 -0
- package/lib/module/assets/assetKeys.js +4 -0
- package/lib/module/assets/assetKeys.js.map +1 -0
- package/lib/module/assets/assetSync.js +61 -0
- package/lib/module/assets/assetSync.js.map +1 -0
- package/lib/module/assets/nativeAssets.js +25 -0
- package/lib/module/assets/nativeAssets.js.map +1 -0
- package/lib/module/assets/remote.js +47 -0
- package/lib/module/assets/remote.js.map +1 -0
- package/lib/module/components/AbandonPolicyNotice.js +200 -0
- package/lib/module/components/AbandonPolicyNotice.js.map +1 -0
- package/lib/module/components/AnimatedAmount.js +39 -0
- package/lib/module/components/AnimatedAmount.js.map +1 -0
- package/lib/module/components/CoinFlyOverlay.js +157 -0
- package/lib/module/components/CoinFlyOverlay.js.map +1 -0
- package/lib/module/components/GameCharacter.js +45 -0
- package/lib/module/components/GameCharacter.js.map +1 -0
- package/lib/module/components/GameRulesModal.js +279 -0
- package/lib/module/components/GameRulesModal.js.map +1 -0
- package/lib/module/components/HypeCallout.js +103 -0
- package/lib/module/components/HypeCallout.js.map +1 -0
- package/lib/module/components/InsufficientFundsOverlay.js +285 -0
- package/lib/module/components/InsufficientFundsOverlay.js.map +1 -0
- package/lib/module/components/JackpotNearMiss.js +89 -0
- package/lib/module/components/JackpotNearMiss.js.map +1 -0
- package/lib/module/components/JackpotTeaser.js +341 -0
- package/lib/module/components/JackpotTeaser.js.map +1 -0
- package/lib/module/components/MonflowtsButton.js +129 -0
- package/lib/module/components/MonflowtsButton.js.map +1 -0
- package/lib/module/components/MonflowtsChipGroup.js +40 -0
- package/lib/module/components/MonflowtsChipGroup.js.map +1 -0
- package/lib/module/components/MonflowtsPressable.js +42 -0
- package/lib/module/components/MonflowtsPressable.js.map +1 -0
- package/lib/module/components/QuitConfirmModal.js +180 -0
- package/lib/module/components/QuitConfirmModal.js.map +1 -0
- package/lib/module/components/SessionTimer.js +77 -0
- package/lib/module/components/SessionTimer.js.map +1 -0
- package/lib/module/components/SideDemoTab.js +110 -0
- package/lib/module/components/SideDemoTab.js.map +1 -0
- package/lib/module/components/StakeInput.js +138 -0
- package/lib/module/components/StakeInput.js.map +1 -0
- package/lib/module/constants.js +50 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/content.js +21 -0
- package/lib/module/content.js.map +1 -0
- package/lib/module/effects/EffectBurst.js +56 -0
- package/lib/module/effects/EffectBurst.js.map +1 -0
- package/lib/module/effects/beaverStates.js +11 -0
- package/lib/module/effects/beaverStates.js.map +1 -0
- package/lib/module/effects/hypePhrases.js +67 -0
- package/lib/module/effects/hypePhrases.js.map +1 -0
- package/lib/module/effects/particleAnims.js +17 -0
- package/lib/module/effects/particleAnims.js.map +1 -0
- package/lib/module/hooks/useAvailableGames.js +29 -0
- package/lib/module/hooks/useAvailableGames.js.map +1 -0
- package/lib/module/hooks/useCrash.js +137 -0
- package/lib/module/hooks/useCrash.js.map +1 -0
- package/lib/module/hooks/useCrashFeed.js +49 -0
- package/lib/module/hooks/useCrashFeed.js.map +1 -0
- package/lib/module/hooks/useCurrency.js +13 -0
- package/lib/module/hooks/useCurrency.js.map +1 -0
- package/lib/module/hooks/useFairSeed.js +55 -0
- package/lib/module/hooks/useFairSeed.js.map +1 -0
- package/lib/module/hooks/useGameEvents.js +186 -0
- package/lib/module/hooks/useGameEvents.js.map +1 -0
- package/lib/module/hooks/useGameHistory.js +55 -0
- package/lib/module/hooks/useGameHistory.js.map +1 -0
- package/lib/module/hooks/useLeaderboard.js +83 -0
- package/lib/module/hooks/useLeaderboard.js.map +1 -0
- package/lib/module/hooks/useMines.js +166 -0
- package/lib/module/hooks/useMines.js.map +1 -0
- package/lib/module/hooks/useNotifications.js +66 -0
- package/lib/module/hooks/useNotifications.js.map +1 -0
- package/lib/module/hooks/usePlayGame.js +408 -0
- package/lib/module/hooks/usePlayGame.js.map +1 -0
- package/lib/module/hooks/usePlinko.js +75 -0
- package/lib/module/hooks/usePlinko.js.map +1 -0
- package/lib/module/hooks/useRaffleDrawState.js +57 -0
- package/lib/module/hooks/useRaffleDrawState.js.map +1 -0
- package/lib/module/hooks/useRefreshWallet.js +24 -0
- package/lib/module/hooks/useRefreshWallet.js.map +1 -0
- package/lib/module/hooks/useResponsive.js +16 -0
- package/lib/module/hooks/useResponsive.js.map +1 -0
- package/lib/module/hooks/useRevealWin.js +120 -0
- package/lib/module/hooks/useRevealWin.js.map +1 -0
- package/lib/module/hooks/useScreenShake.js +32 -0
- package/lib/module/hooks/useScreenShake.js.map +1 -0
- package/lib/module/hooks/useWallet.js +77 -0
- package/lib/module/hooks/useWallet.js.map +1 -0
- package/lib/module/i18n.js +104 -0
- package/lib/module/i18n.js.map +1 -0
- package/lib/module/index.js +22 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/lottieAnimations.js +15 -0
- package/lib/module/lottieAnimations.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/stores/assetStore.js +140 -0
- package/lib/module/stores/assetStore.js.map +1 -0
- package/lib/module/stores/authStore.js +47 -0
- package/lib/module/stores/authStore.js.map +1 -0
- package/lib/module/stores/gameStore.js +23 -0
- package/lib/module/stores/gameStore.js.map +1 -0
- package/lib/module/stores/sdkInitStore.js +155 -0
- package/lib/module/stores/sdkInitStore.js.map +1 -0
- package/lib/module/stores/settingsStore.js +40 -0
- package/lib/module/stores/settingsStore.js.map +1 -0
- package/lib/module/theme.js +160 -0
- package/lib/module/theme.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils/apolloError.js +69 -0
- package/lib/module/utils/apolloError.js.map +1 -0
- package/lib/module/utils/crashMultiplier.js +8 -0
- package/lib/module/utils/crashMultiplier.js.map +1 -0
- package/lib/module/utils/crashMultiplier.test.js +34 -0
- package/lib/module/utils/crashMultiplier.test.js.map +1 -0
- package/lib/module/utils/deviceAnalytics.js +51 -0
- package/lib/module/utils/deviceAnalytics.js.map +1 -0
- package/lib/module/utils/idempotency.js +66 -0
- package/lib/module/utils/idempotency.js.map +1 -0
- package/lib/module/utils/layout.js +14 -0
- package/lib/module/utils/layout.js.map +1 -0
- package/lib/module/utils/safeInlineScript.js +12 -0
- package/lib/module/utils/safeInlineScript.js.map +1 -0
- package/lib/module/utils/sseClient.js +40 -0
- package/lib/module/utils/sseClient.js.map +1 -0
- package/lib/module/views/DepositSelect.js +275 -0
- package/lib/module/views/DepositSelect.js.map +1 -0
- package/lib/module/views/Dice.js +111 -0
- package/lib/module/views/Dice.js.map +1 -0
- package/lib/module/views/DiceBattle.js +815 -0
- package/lib/module/views/DiceBattle.js.map +1 -0
- package/lib/module/views/DiceLobby.js +577 -0
- package/lib/module/views/DiceLobby.js.map +1 -0
- package/lib/module/views/FortuneWheel.js +892 -0
- package/lib/module/views/FortuneWheel.js.map +1 -0
- package/lib/module/views/Freefall.js +808 -0
- package/lib/module/views/Freefall.js.map +1 -0
- package/lib/module/views/History.js +366 -0
- package/lib/module/views/History.js.map +1 -0
- package/lib/module/views/Home.js +554 -0
- package/lib/module/views/Home.js.map +1 -0
- package/lib/module/views/Jetstream.js +889 -0
- package/lib/module/views/Jetstream.js.map +1 -0
- package/lib/module/views/Leaderboard.js +1206 -0
- package/lib/module/views/Leaderboard.js.map +1 -0
- package/lib/module/views/MillionaireHunter.js +1697 -0
- package/lib/module/views/MillionaireHunter.js.map +1 -0
- package/lib/module/views/Minefield.js +826 -0
- package/lib/module/views/Minefield.js.map +1 -0
- package/lib/module/views/PaymentWebView.js +546 -0
- package/lib/module/views/PaymentWebView.js.map +1 -0
- package/lib/module/views/PlayerCard.js +184 -0
- package/lib/module/views/PlayerCard.js.map +1 -0
- package/lib/module/views/Profile.js +531 -0
- package/lib/module/views/Profile.js.map +1 -0
- package/lib/module/views/RaffleDraw.js +1242 -0
- package/lib/module/views/RaffleDraw.js.map +1 -0
- package/lib/module/views/RevealWin.js +1267 -0
- package/lib/module/views/RevealWin.js.map +1 -0
- package/lib/module/views/Splash.js +363 -0
- package/lib/module/views/Splash.js.map +1 -0
- package/lib/module/views/Success.js +363 -0
- package/lib/module/views/Success.js.map +1 -0
- package/lib/module/views/TicketShop.js +372 -0
- package/lib/module/views/TicketShop.js.map +1 -0
- package/lib/module/views/TriviaLobby.js +582 -0
- package/lib/module/views/TriviaLobby.js.map +1 -0
- package/lib/module/views/TriviaMaster.js +884 -0
- package/lib/module/views/TriviaMaster.js.map +1 -0
- package/lib/module/views/Wallet.js +622 -0
- package/lib/module/views/Wallet.js.map +1 -0
- package/lib/module/views/WithdrawFlow.js +445 -0
- package/lib/module/views/WithdrawFlow.js.map +1 -0
- package/lib/module/views/gridGeometry.js +26 -0
- package/lib/module/views/gridGeometry.js.map +1 -0
- package/lib/module/views/revealWinHelpers.js +29 -0
- package/lib/module/views/revealWinHelpers.js.map +1 -0
- package/lib/module/views/ticketBundlePresets.js +29 -0
- package/lib/module/views/ticketBundlePresets.js.map +1 -0
- package/lib/module/views/triviaHelpers.js +78 -0
- package/lib/module/views/triviaHelpers.js.map +1 -0
- package/lib/module/voiceClips.js +16 -0
- package/lib/module/voiceClips.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/HapticsManager.d.ts +28 -0
- package/lib/typescript/src/HapticsManager.d.ts.map +1 -0
- package/lib/typescript/src/HubContent.d.ts +7 -0
- package/lib/typescript/src/HubContent.d.ts.map +1 -0
- package/lib/typescript/src/Icons.d.ts +14 -0
- package/lib/typescript/src/Icons.d.ts.map +1 -0
- package/lib/typescript/src/MonflowtsHub.d.ts +5 -0
- package/lib/typescript/src/MonflowtsHub.d.ts.map +1 -0
- package/lib/typescript/src/NativeLottieView.d.ts +13 -0
- package/lib/typescript/src/NativeLottieView.d.ts.map +1 -0
- package/lib/typescript/src/NativeSvgView.d.ts +12 -0
- package/lib/typescript/src/NativeSvgView.d.ts.map +1 -0
- package/lib/typescript/src/NativeWebView.d.ts +22 -0
- package/lib/typescript/src/NativeWebView.d.ts.map +1 -0
- package/lib/typescript/src/NativeWheelView.d.ts +9 -0
- package/lib/typescript/src/NativeWheelView.d.ts.map +1 -0
- package/lib/typescript/src/SoundManager.d.ts +29 -0
- package/lib/typescript/src/SoundManager.d.ts.map +1 -0
- package/lib/typescript/src/SpeechManager.d.ts +10 -0
- package/lib/typescript/src/SpeechManager.d.ts.map +1 -0
- package/lib/typescript/src/api/client.d.ts +7 -0
- package/lib/typescript/src/api/client.d.ts.map +1 -0
- package/lib/typescript/src/api/gameTypes.d.ts +326 -0
- package/lib/typescript/src/api/gameTypes.d.ts.map +1 -0
- package/lib/typescript/src/api/http.d.ts +61 -0
- package/lib/typescript/src/api/http.d.ts.map +1 -0
- package/lib/typescript/src/api/mutations.d.ts +22 -0
- package/lib/typescript/src/api/mutations.d.ts.map +1 -0
- package/lib/typescript/src/api/playerTypes.d.ts +53 -0
- package/lib/typescript/src/api/playerTypes.d.ts.map +1 -0
- package/lib/typescript/src/api/queries.d.ts +21 -0
- package/lib/typescript/src/api/queries.d.ts.map +1 -0
- package/lib/typescript/src/api/sdkTypes.d.ts +87 -0
- package/lib/typescript/src/api/sdkTypes.d.ts.map +1 -0
- package/lib/typescript/src/assets/assetKeys.d.ts +3 -0
- package/lib/typescript/src/assets/assetKeys.d.ts.map +1 -0
- package/lib/typescript/src/assets/assetSync.d.ts +41 -0
- package/lib/typescript/src/assets/assetSync.d.ts.map +1 -0
- package/lib/typescript/src/assets/nativeAssets.d.ts +30 -0
- package/lib/typescript/src/assets/nativeAssets.d.ts.map +1 -0
- package/lib/typescript/src/assets/remote.d.ts +8 -0
- package/lib/typescript/src/assets/remote.d.ts.map +1 -0
- package/lib/typescript/src/components/AbandonPolicyNotice.d.ts +16 -0
- package/lib/typescript/src/components/AbandonPolicyNotice.d.ts.map +1 -0
- package/lib/typescript/src/components/AnimatedAmount.d.ts +12 -0
- package/lib/typescript/src/components/AnimatedAmount.d.ts.map +1 -0
- package/lib/typescript/src/components/CoinFlyOverlay.d.ts +17 -0
- package/lib/typescript/src/components/CoinFlyOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/GameCharacter.d.ts +14 -0
- package/lib/typescript/src/components/GameCharacter.d.ts.map +1 -0
- package/lib/typescript/src/components/GameRulesModal.d.ts +10 -0
- package/lib/typescript/src/components/GameRulesModal.d.ts.map +1 -0
- package/lib/typescript/src/components/HypeCallout.d.ts +11 -0
- package/lib/typescript/src/components/HypeCallout.d.ts.map +1 -0
- package/lib/typescript/src/components/InsufficientFundsOverlay.d.ts +12 -0
- package/lib/typescript/src/components/InsufficientFundsOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/JackpotNearMiss.d.ts +8 -0
- package/lib/typescript/src/components/JackpotNearMiss.d.ts.map +1 -0
- package/lib/typescript/src/components/JackpotTeaser.d.ts +13 -0
- package/lib/typescript/src/components/JackpotTeaser.d.ts.map +1 -0
- package/lib/typescript/src/components/MonflowtsButton.d.ts +21 -0
- package/lib/typescript/src/components/MonflowtsButton.d.ts.map +1 -0
- package/lib/typescript/src/components/MonflowtsChipGroup.d.ts +18 -0
- package/lib/typescript/src/components/MonflowtsChipGroup.d.ts.map +1 -0
- package/lib/typescript/src/components/MonflowtsPressable.d.ts +39 -0
- package/lib/typescript/src/components/MonflowtsPressable.d.ts.map +1 -0
- package/lib/typescript/src/components/QuitConfirmModal.d.ts +11 -0
- package/lib/typescript/src/components/QuitConfirmModal.d.ts.map +1 -0
- package/lib/typescript/src/components/SessionTimer.d.ts +14 -0
- package/lib/typescript/src/components/SessionTimer.d.ts.map +1 -0
- package/lib/typescript/src/components/SideDemoTab.d.ts +18 -0
- package/lib/typescript/src/components/SideDemoTab.d.ts.map +1 -0
- package/lib/typescript/src/components/StakeInput.d.ts +16 -0
- package/lib/typescript/src/components/StakeInput.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +21 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/content.d.ts +53 -0
- package/lib/typescript/src/content.d.ts.map +1 -0
- package/lib/typescript/src/effects/EffectBurst.d.ts +20 -0
- package/lib/typescript/src/effects/EffectBurst.d.ts.map +1 -0
- package/lib/typescript/src/effects/beaverStates.d.ts +4 -0
- package/lib/typescript/src/effects/beaverStates.d.ts.map +1 -0
- package/lib/typescript/src/effects/hypePhrases.d.ts +11 -0
- package/lib/typescript/src/effects/hypePhrases.d.ts.map +1 -0
- package/lib/typescript/src/effects/particleAnims.d.ts +9 -0
- package/lib/typescript/src/effects/particleAnims.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useAvailableGames.d.ts +14 -0
- package/lib/typescript/src/hooks/useAvailableGames.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCrash.d.ts +13 -0
- package/lib/typescript/src/hooks/useCrash.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCrashFeed.d.ts +22 -0
- package/lib/typescript/src/hooks/useCrashFeed.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCurrency.d.ts +6 -0
- package/lib/typescript/src/hooks/useCurrency.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useFairSeed.d.ts +8 -0
- package/lib/typescript/src/hooks/useFairSeed.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useGameEvents.d.ts +50 -0
- package/lib/typescript/src/hooks/useGameEvents.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useGameHistory.d.ts +14 -0
- package/lib/typescript/src/hooks/useGameHistory.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useLeaderboard.d.ts +71 -0
- package/lib/typescript/src/hooks/useLeaderboard.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useMines.d.ts +11 -0
- package/lib/typescript/src/hooks/useMines.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNotifications.d.ts +26 -0
- package/lib/typescript/src/hooks/useNotifications.d.ts.map +1 -0
- package/lib/typescript/src/hooks/usePlayGame.d.ts +62 -0
- package/lib/typescript/src/hooks/usePlayGame.d.ts.map +1 -0
- package/lib/typescript/src/hooks/usePlinko.d.ts +8 -0
- package/lib/typescript/src/hooks/usePlinko.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useRaffleDrawState.d.ts +50 -0
- package/lib/typescript/src/hooks/useRaffleDrawState.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useRefreshWallet.d.ts +8 -0
- package/lib/typescript/src/hooks/useRefreshWallet.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useResponsive.d.ts +8 -0
- package/lib/typescript/src/hooks/useResponsive.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useRevealWin.d.ts +10 -0
- package/lib/typescript/src/hooks/useRevealWin.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useScreenShake.d.ts +14 -0
- package/lib/typescript/src/hooks/useScreenShake.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useWallet.d.ts +23 -0
- package/lib/typescript/src/hooks/useWallet.d.ts.map +1 -0
- package/lib/typescript/src/i18n.d.ts +29 -0
- package/lib/typescript/src/i18n.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +12 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/lottieAnimations.d.ts +2 -0
- package/lib/typescript/src/lottieAnimations.d.ts.map +1 -0
- package/lib/typescript/src/stores/assetStore.d.ts +17 -0
- package/lib/typescript/src/stores/assetStore.d.ts.map +1 -0
- package/lib/typescript/src/stores/authStore.d.ts +25 -0
- package/lib/typescript/src/stores/authStore.d.ts.map +1 -0
- package/lib/typescript/src/stores/gameStore.d.ts +14 -0
- package/lib/typescript/src/stores/gameStore.d.ts.map +1 -0
- package/lib/typescript/src/stores/sdkInitStore.d.ts +38 -0
- package/lib/typescript/src/stores/sdkInitStore.d.ts.map +1 -0
- package/lib/typescript/src/stores/settingsStore.d.ts +23 -0
- package/lib/typescript/src/stores/settingsStore.d.ts.map +1 -0
- package/lib/typescript/src/theme.d.ts +149 -0
- package/lib/typescript/src/theme.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +49 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/apolloError.d.ts +12 -0
- package/lib/typescript/src/utils/apolloError.d.ts.map +1 -0
- package/lib/typescript/src/utils/crashMultiplier.d.ts +2 -0
- package/lib/typescript/src/utils/crashMultiplier.d.ts.map +1 -0
- package/lib/typescript/src/utils/crashMultiplier.test.d.ts +2 -0
- package/lib/typescript/src/utils/crashMultiplier.test.d.ts.map +1 -0
- package/lib/typescript/src/utils/deviceAnalytics.d.ts +3 -0
- package/lib/typescript/src/utils/deviceAnalytics.d.ts.map +1 -0
- package/lib/typescript/src/utils/idempotency.d.ts +14 -0
- package/lib/typescript/src/utils/idempotency.d.ts.map +1 -0
- package/lib/typescript/src/utils/layout.d.ts +10 -0
- package/lib/typescript/src/utils/layout.d.ts.map +1 -0
- package/lib/typescript/src/utils/safeInlineScript.d.ts +5 -0
- package/lib/typescript/src/utils/safeInlineScript.d.ts.map +1 -0
- package/lib/typescript/src/utils/sseClient.d.ts +5 -0
- package/lib/typescript/src/utils/sseClient.d.ts.map +1 -0
- package/lib/typescript/src/views/DepositSelect.d.ts +9 -0
- package/lib/typescript/src/views/DepositSelect.d.ts.map +1 -0
- package/lib/typescript/src/views/Dice.d.ts +10 -0
- package/lib/typescript/src/views/Dice.d.ts.map +1 -0
- package/lib/typescript/src/views/DiceBattle.d.ts +15 -0
- package/lib/typescript/src/views/DiceBattle.d.ts.map +1 -0
- package/lib/typescript/src/views/DiceLobby.d.ts +12 -0
- package/lib/typescript/src/views/DiceLobby.d.ts.map +1 -0
- package/lib/typescript/src/views/FortuneWheel.d.ts +13 -0
- package/lib/typescript/src/views/FortuneWheel.d.ts.map +1 -0
- package/lib/typescript/src/views/Freefall.d.ts +13 -0
- package/lib/typescript/src/views/Freefall.d.ts.map +1 -0
- package/lib/typescript/src/views/History.d.ts +7 -0
- package/lib/typescript/src/views/History.d.ts.map +1 -0
- package/lib/typescript/src/views/Home.d.ts +13 -0
- package/lib/typescript/src/views/Home.d.ts.map +1 -0
- package/lib/typescript/src/views/Jetstream.d.ts +14 -0
- package/lib/typescript/src/views/Jetstream.d.ts.map +1 -0
- package/lib/typescript/src/views/Leaderboard.d.ts +8 -0
- package/lib/typescript/src/views/Leaderboard.d.ts.map +1 -0
- package/lib/typescript/src/views/MillionaireHunter.d.ts +13 -0
- package/lib/typescript/src/views/MillionaireHunter.d.ts.map +1 -0
- package/lib/typescript/src/views/Minefield.d.ts +13 -0
- package/lib/typescript/src/views/Minefield.d.ts.map +1 -0
- package/lib/typescript/src/views/PaymentWebView.d.ts +29 -0
- package/lib/typescript/src/views/PaymentWebView.d.ts.map +1 -0
- package/lib/typescript/src/views/PlayerCard.d.ts +15 -0
- package/lib/typescript/src/views/PlayerCard.d.ts.map +1 -0
- package/lib/typescript/src/views/Profile.d.ts +9 -0
- package/lib/typescript/src/views/Profile.d.ts.map +1 -0
- package/lib/typescript/src/views/RaffleDraw.d.ts +12 -0
- package/lib/typescript/src/views/RaffleDraw.d.ts.map +1 -0
- package/lib/typescript/src/views/RevealWin.d.ts +13 -0
- package/lib/typescript/src/views/RevealWin.d.ts.map +1 -0
- package/lib/typescript/src/views/Splash.d.ts +10 -0
- package/lib/typescript/src/views/Splash.d.ts.map +1 -0
- package/lib/typescript/src/views/Success.d.ts +12 -0
- package/lib/typescript/src/views/Success.d.ts.map +1 -0
- package/lib/typescript/src/views/TicketShop.d.ts +15 -0
- package/lib/typescript/src/views/TicketShop.d.ts.map +1 -0
- package/lib/typescript/src/views/TriviaLobby.d.ts +12 -0
- package/lib/typescript/src/views/TriviaLobby.d.ts.map +1 -0
- package/lib/typescript/src/views/TriviaMaster.d.ts +16 -0
- package/lib/typescript/src/views/TriviaMaster.d.ts.map +1 -0
- package/lib/typescript/src/views/Wallet.d.ts +10 -0
- package/lib/typescript/src/views/Wallet.d.ts.map +1 -0
- package/lib/typescript/src/views/WithdrawFlow.d.ts +9 -0
- package/lib/typescript/src/views/WithdrawFlow.d.ts.map +1 -0
- package/lib/typescript/src/views/gridGeometry.d.ts +19 -0
- package/lib/typescript/src/views/gridGeometry.d.ts.map +1 -0
- package/lib/typescript/src/views/revealWinHelpers.d.ts +15 -0
- package/lib/typescript/src/views/revealWinHelpers.d.ts.map +1 -0
- package/lib/typescript/src/views/ticketBundlePresets.d.ts +18 -0
- package/lib/typescript/src/views/ticketBundlePresets.d.ts.map +1 -0
- package/lib/typescript/src/views/triviaHelpers.d.ts +31 -0
- package/lib/typescript/src/views/triviaHelpers.d.ts.map +1 -0
- package/lib/typescript/src/voiceClips.d.ts +4 -0
- package/lib/typescript/src/voiceClips.d.ts.map +1 -0
- package/package.json +160 -4
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
package com.monflowts
|
|
2
|
+
|
|
3
|
+
import android.speech.tts.TextToSpeech
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
6
|
+
import com.facebook.react.bridge.ReactMethod
|
|
7
|
+
import com.facebook.react.bridge.ReadableMap
|
|
8
|
+
|
|
9
|
+
class MonflowtsSpeechModule(reactContext: ReactApplicationContext) :
|
|
10
|
+
ReactContextBaseJavaModule(reactContext), TextToSpeech.OnInitListener {
|
|
11
|
+
|
|
12
|
+
private var tts: TextToSpeech? = TextToSpeech(reactContext, this)
|
|
13
|
+
private var ready = false
|
|
14
|
+
private var player: android.media.MediaPlayer? = null
|
|
15
|
+
|
|
16
|
+
override fun onInit(status: Int) {
|
|
17
|
+
ready = status == TextToSpeech.SUCCESS
|
|
18
|
+
if (!ready) return
|
|
19
|
+
val engine = tts ?: return
|
|
20
|
+
val best = engine.voices
|
|
21
|
+
?.filter { it.locale.language == "en" && !it.isNetworkConnectionRequired }
|
|
22
|
+
?.maxByOrNull { it.quality }
|
|
23
|
+
if (best != null && best.quality >= 300) {
|
|
24
|
+
engine.voice = best
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
override fun getName() = "MonflowtsSpeech"
|
|
29
|
+
|
|
30
|
+
@ReactMethod
|
|
31
|
+
fun speak(params: ReadableMap) {
|
|
32
|
+
val engine = tts
|
|
33
|
+
if (!ready || engine == null) return
|
|
34
|
+
val text = if (params.hasKey("text")) params.getString("text") ?: "" else ""
|
|
35
|
+
if (text.isEmpty()) return
|
|
36
|
+
val pitch = if (params.hasKey("pitch")) params.getDouble("pitch").toFloat() else 1.1f
|
|
37
|
+
val rate = if (params.hasKey("androidRate")) params.getDouble("androidRate").toFloat() else 1.05f
|
|
38
|
+
engine.setPitch(pitch)
|
|
39
|
+
engine.setSpeechRate(rate)
|
|
40
|
+
engine.speak(text, TextToSpeech.QUEUE_FLUSH, null, "monflowts-speech")
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@ReactMethod
|
|
44
|
+
fun playClip(url: String) {
|
|
45
|
+
try {
|
|
46
|
+
tts?.stop()
|
|
47
|
+
player?.release()
|
|
48
|
+
val next = android.media.MediaPlayer()
|
|
49
|
+
next.setDataSource(url)
|
|
50
|
+
next.setOnPreparedListener { it.start() }
|
|
51
|
+
next.setOnCompletionListener {
|
|
52
|
+
it.release()
|
|
53
|
+
if (player === it) player = null
|
|
54
|
+
}
|
|
55
|
+
next.prepareAsync()
|
|
56
|
+
player = next
|
|
57
|
+
} catch (_: Exception) {
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@ReactMethod
|
|
62
|
+
fun stop() {
|
|
63
|
+
tts?.stop()
|
|
64
|
+
try {
|
|
65
|
+
player?.release()
|
|
66
|
+
} catch (_: Exception) {
|
|
67
|
+
}
|
|
68
|
+
player = null
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
override fun invalidate() {
|
|
72
|
+
tts?.shutdown()
|
|
73
|
+
tts = null
|
|
74
|
+
try {
|
|
75
|
+
player?.release()
|
|
76
|
+
} catch (_: Exception) {
|
|
77
|
+
}
|
|
78
|
+
player = null
|
|
79
|
+
super.invalidate()
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
package com.monflowts
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.graphics.*
|
|
5
|
+
import android.view.View
|
|
6
|
+
import kotlin.math.*
|
|
7
|
+
|
|
8
|
+
class MonflowtsSvgView(context: Context) : View(context) {
|
|
9
|
+
|
|
10
|
+
private var pathData: String = ""
|
|
11
|
+
private var fillPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
|
12
|
+
style = Paint.Style.FILL
|
|
13
|
+
color = Color.TRANSPARENT
|
|
14
|
+
}
|
|
15
|
+
private var strokePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
|
16
|
+
style = Paint.Style.STROKE
|
|
17
|
+
color = Color.TRANSPARENT
|
|
18
|
+
strokeCap = Paint.Cap.ROUND
|
|
19
|
+
strokeJoin = Paint.Join.ROUND
|
|
20
|
+
}
|
|
21
|
+
private var vbX = 0f
|
|
22
|
+
private var vbY = 0f
|
|
23
|
+
private var vbW = 24f
|
|
24
|
+
private var vbH = 24f
|
|
25
|
+
private var parsedPath: Path? = null
|
|
26
|
+
|
|
27
|
+
fun setPathData(d: String) {
|
|
28
|
+
pathData = d
|
|
29
|
+
parsedPath = null
|
|
30
|
+
invalidate()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
fun setFillColor(color: Int) {
|
|
34
|
+
fillPaint.color = color
|
|
35
|
+
invalidate()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
fun setStrokeColor(color: Int) {
|
|
39
|
+
strokePaint.color = color
|
|
40
|
+
invalidate()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
fun setSvgStrokeWidth(w: Float) {
|
|
44
|
+
strokePaint.strokeWidth = w
|
|
45
|
+
invalidate()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
fun setSvgViewBox(vb: String) {
|
|
49
|
+
val parts = vb.trim().split("\\s+".toRegex())
|
|
50
|
+
if (parts.size == 4) {
|
|
51
|
+
vbX = parts[0].toFloatOrNull() ?: 0f
|
|
52
|
+
vbY = parts[1].toFloatOrNull() ?: 0f
|
|
53
|
+
vbW = parts[2].toFloatOrNull() ?: 24f
|
|
54
|
+
vbH = parts[3].toFloatOrNull() ?: 24f
|
|
55
|
+
}
|
|
56
|
+
parsedPath = null
|
|
57
|
+
invalidate()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
override fun onDraw(canvas: Canvas) {
|
|
61
|
+
super.onDraw(canvas)
|
|
62
|
+
if (pathData.isEmpty()) return
|
|
63
|
+
|
|
64
|
+
if (parsedPath == null) {
|
|
65
|
+
parsedPath = parseSvgPath(pathData)
|
|
66
|
+
}
|
|
67
|
+
val path = parsedPath ?: return
|
|
68
|
+
|
|
69
|
+
val w = width.toFloat()
|
|
70
|
+
val h = height.toFloat()
|
|
71
|
+
val scaleX = w / vbW
|
|
72
|
+
val scaleY = h / vbH
|
|
73
|
+
val scale = min(scaleX, scaleY)
|
|
74
|
+
val tx = (w - vbW * scale) / 2f - vbX * scale
|
|
75
|
+
val ty = (h - vbH * scale) / 2f - vbY * scale
|
|
76
|
+
|
|
77
|
+
canvas.save()
|
|
78
|
+
canvas.translate(tx, ty)
|
|
79
|
+
canvas.scale(scale, scale)
|
|
80
|
+
|
|
81
|
+
if (fillPaint.color != Color.TRANSPARENT) {
|
|
82
|
+
canvas.drawPath(path, fillPaint)
|
|
83
|
+
}
|
|
84
|
+
if (strokePaint.color != Color.TRANSPARENT && strokePaint.strokeWidth > 0) {
|
|
85
|
+
canvas.drawPath(path, strokePaint)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
canvas.restore()
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ---- SVG Path Parser ----
|
|
92
|
+
|
|
93
|
+
private fun parseSvgPath(d: String): Path {
|
|
94
|
+
val path = Path()
|
|
95
|
+
path.fillType = Path.FillType.EVEN_ODD
|
|
96
|
+
val tokens = tokenize(d)
|
|
97
|
+
var i = 0
|
|
98
|
+
var curX = 0f
|
|
99
|
+
var curY = 0f
|
|
100
|
+
var lastCmd = ' '
|
|
101
|
+
var lastCX = 0f
|
|
102
|
+
var lastCY = 0f
|
|
103
|
+
var subpathStartX = 0f
|
|
104
|
+
var subpathStartY = 0f
|
|
105
|
+
|
|
106
|
+
fun nextNum(): Float {
|
|
107
|
+
if (i >= tokens.size) return 0f
|
|
108
|
+
val v = tokens[i].toFloatOrNull() ?: 0f
|
|
109
|
+
i++
|
|
110
|
+
return v
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
while (i < tokens.size) {
|
|
114
|
+
val token = tokens[i]
|
|
115
|
+
val first = token.firstOrNull()
|
|
116
|
+
if (first == null) { i++; continue }
|
|
117
|
+
|
|
118
|
+
if (first.isLetter()) {
|
|
119
|
+
lastCmd = first
|
|
120
|
+
i++
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
when (lastCmd) {
|
|
124
|
+
'M' -> {
|
|
125
|
+
val x = nextNum(); val y = nextNum()
|
|
126
|
+
path.moveTo(x, y)
|
|
127
|
+
curX = x; curY = y
|
|
128
|
+
subpathStartX = x; subpathStartY = y
|
|
129
|
+
lastCmd = 'L'
|
|
130
|
+
}
|
|
131
|
+
'm' -> {
|
|
132
|
+
val dx = nextNum(); val dy = nextNum()
|
|
133
|
+
curX += dx; curY += dy
|
|
134
|
+
path.moveTo(curX, curY)
|
|
135
|
+
subpathStartX = curX; subpathStartY = curY
|
|
136
|
+
lastCmd = 'l'
|
|
137
|
+
}
|
|
138
|
+
'L' -> {
|
|
139
|
+
val x = nextNum(); val y = nextNum()
|
|
140
|
+
path.lineTo(x, y)
|
|
141
|
+
curX = x; curY = y
|
|
142
|
+
}
|
|
143
|
+
'l' -> {
|
|
144
|
+
val dx = nextNum(); val dy = nextNum()
|
|
145
|
+
curX += dx; curY += dy
|
|
146
|
+
path.lineTo(curX, curY)
|
|
147
|
+
}
|
|
148
|
+
'H' -> {
|
|
149
|
+
val x = nextNum()
|
|
150
|
+
path.lineTo(x, curY)
|
|
151
|
+
curX = x
|
|
152
|
+
}
|
|
153
|
+
'h' -> {
|
|
154
|
+
val dx = nextNum()
|
|
155
|
+
curX += dx
|
|
156
|
+
path.lineTo(curX, curY)
|
|
157
|
+
}
|
|
158
|
+
'V' -> {
|
|
159
|
+
val y = nextNum()
|
|
160
|
+
path.lineTo(curX, y)
|
|
161
|
+
curY = y
|
|
162
|
+
}
|
|
163
|
+
'v' -> {
|
|
164
|
+
val dy = nextNum()
|
|
165
|
+
curY += dy
|
|
166
|
+
path.lineTo(curX, curY)
|
|
167
|
+
}
|
|
168
|
+
'C' -> {
|
|
169
|
+
val x1 = nextNum(); val y1 = nextNum()
|
|
170
|
+
val x2 = nextNum(); val y2 = nextNum()
|
|
171
|
+
val x = nextNum(); val y = nextNum()
|
|
172
|
+
path.cubicTo(x1, y1, x2, y2, x, y)
|
|
173
|
+
lastCX = x2; lastCY = y2
|
|
174
|
+
curX = x; curY = y
|
|
175
|
+
}
|
|
176
|
+
'c' -> {
|
|
177
|
+
val dx1 = nextNum(); val dy1 = nextNum()
|
|
178
|
+
val dx2 = nextNum(); val dy2 = nextNum()
|
|
179
|
+
val dx = nextNum(); val dy = nextNum()
|
|
180
|
+
val x1 = curX + dx1; val y1 = curY + dy1
|
|
181
|
+
val x2 = curX + dx2; val y2 = curY + dy2
|
|
182
|
+
curX += dx; curY += dy
|
|
183
|
+
path.cubicTo(x1, y1, x2, y2, curX, curY)
|
|
184
|
+
lastCX = x2; lastCY = y2
|
|
185
|
+
}
|
|
186
|
+
'S' -> {
|
|
187
|
+
val cx1 = 2 * curX - lastCX
|
|
188
|
+
val cy1 = 2 * curY - lastCY
|
|
189
|
+
val x2 = nextNum(); val y2 = nextNum()
|
|
190
|
+
val x = nextNum(); val y = nextNum()
|
|
191
|
+
path.cubicTo(cx1, cy1, x2, y2, x, y)
|
|
192
|
+
lastCX = x2; lastCY = y2
|
|
193
|
+
curX = x; curY = y
|
|
194
|
+
}
|
|
195
|
+
's' -> {
|
|
196
|
+
val cx1 = 2 * curX - lastCX
|
|
197
|
+
val cy1 = 2 * curY - lastCY
|
|
198
|
+
val dx2 = nextNum(); val dy2 = nextNum()
|
|
199
|
+
val dx = nextNum(); val dy = nextNum()
|
|
200
|
+
val x2 = curX + dx2; val y2 = curY + dy2
|
|
201
|
+
curX += dx; curY += dy
|
|
202
|
+
path.cubicTo(cx1, cy1, x2, y2, curX, curY)
|
|
203
|
+
lastCX = x2; lastCY = y2
|
|
204
|
+
}
|
|
205
|
+
'Q' -> {
|
|
206
|
+
val cx = nextNum(); val cy = nextNum()
|
|
207
|
+
val x = nextNum(); val y = nextNum()
|
|
208
|
+
path.quadTo(cx, cy, x, y)
|
|
209
|
+
lastCX = cx; lastCY = cy
|
|
210
|
+
curX = x; curY = y
|
|
211
|
+
}
|
|
212
|
+
'q' -> {
|
|
213
|
+
val dcx = nextNum(); val dcy = nextNum()
|
|
214
|
+
val dx = nextNum(); val dy = nextNum()
|
|
215
|
+
val cx = curX + dcx; val cy = curY + dcy
|
|
216
|
+
curX += dx; curY += dy
|
|
217
|
+
path.quadTo(cx, cy, curX, curY)
|
|
218
|
+
lastCX = cx; lastCY = cy
|
|
219
|
+
}
|
|
220
|
+
'T' -> {
|
|
221
|
+
val cx = 2 * curX - lastCX
|
|
222
|
+
val cy = 2 * curY - lastCY
|
|
223
|
+
val x = nextNum(); val y = nextNum()
|
|
224
|
+
path.quadTo(cx, cy, x, y)
|
|
225
|
+
lastCX = cx; lastCY = cy
|
|
226
|
+
curX = x; curY = y
|
|
227
|
+
}
|
|
228
|
+
't' -> {
|
|
229
|
+
val cx = 2 * curX - lastCX
|
|
230
|
+
val cy = 2 * curY - lastCY
|
|
231
|
+
val dx = nextNum(); val dy = nextNum()
|
|
232
|
+
curX += dx; curY += dy
|
|
233
|
+
path.quadTo(cx, cy, curX, curY)
|
|
234
|
+
lastCX = cx; lastCY = cy
|
|
235
|
+
}
|
|
236
|
+
'A', 'a' -> {
|
|
237
|
+
val isRel = lastCmd == 'a'
|
|
238
|
+
val rx = nextNum(); val ry = nextNum()
|
|
239
|
+
val xRot = nextNum()
|
|
240
|
+
val largeArc = nextNum()
|
|
241
|
+
val sweep = nextNum()
|
|
242
|
+
var ex = nextNum(); var ey = nextNum()
|
|
243
|
+
if (isRel) { ex += curX; ey += curY }
|
|
244
|
+
addArc(path, rx, ry, xRot, largeArc != 0f, sweep != 0f,
|
|
245
|
+
curX, curY, ex, ey)
|
|
246
|
+
curX = ex; curY = ey
|
|
247
|
+
}
|
|
248
|
+
'Z', 'z' -> {
|
|
249
|
+
path.close()
|
|
250
|
+
curX = subpathStartX; curY = subpathStartY
|
|
251
|
+
}
|
|
252
|
+
else -> i++
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return path
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
private fun tokenize(d: String): List<String> {
|
|
259
|
+
val tokens = mutableListOf<String>()
|
|
260
|
+
val sb = StringBuilder()
|
|
261
|
+
for (ch in d) {
|
|
262
|
+
when {
|
|
263
|
+
ch == ' ' || ch == ',' || ch == '\n' || ch == '\r' || ch == '\t' -> {
|
|
264
|
+
if (sb.isNotEmpty()) { tokens.add(sb.toString()); sb.clear() }
|
|
265
|
+
}
|
|
266
|
+
ch.isLetter() -> {
|
|
267
|
+
if (sb.isNotEmpty()) { tokens.add(sb.toString()); sb.clear() }
|
|
268
|
+
tokens.add(ch.toString())
|
|
269
|
+
}
|
|
270
|
+
ch == '-' || ch == '+' -> {
|
|
271
|
+
if (sb.isNotEmpty()) { tokens.add(sb.toString()); sb.clear() }
|
|
272
|
+
sb.append(ch)
|
|
273
|
+
}
|
|
274
|
+
ch == '.' -> {
|
|
275
|
+
if (sb.contains('.')) {
|
|
276
|
+
tokens.add(sb.toString()); sb.clear()
|
|
277
|
+
}
|
|
278
|
+
sb.append(ch)
|
|
279
|
+
}
|
|
280
|
+
ch.isDigit() -> sb.append(ch)
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (sb.isNotEmpty()) tokens.add(sb.toString())
|
|
284
|
+
return tokens
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// ---- SVG Arc converted to cubic bezier ----
|
|
288
|
+
|
|
289
|
+
private fun addArc(path: Path, inputRx: Float, inputRy: Float,
|
|
290
|
+
xRotation: Float, largeArc: Boolean, sweep: Boolean,
|
|
291
|
+
x1: Float, y1: Float, x2: Float, y2: Float) {
|
|
292
|
+
var rx = abs(inputRx)
|
|
293
|
+
var ry = abs(inputRy)
|
|
294
|
+
if (rx == 0f || ry == 0f) { path.lineTo(x2, y2); return }
|
|
295
|
+
|
|
296
|
+
val phi = Math.toRadians(xRotation.toDouble()).toFloat()
|
|
297
|
+
val cosPhi = cos(phi)
|
|
298
|
+
val sinPhi = sin(phi)
|
|
299
|
+
|
|
300
|
+
val dx = (x1 - x2) / 2f
|
|
301
|
+
val dy = (y1 - y2) / 2f
|
|
302
|
+
val x1p = cosPhi * dx + sinPhi * dy
|
|
303
|
+
val y1p = -sinPhi * dx + cosPhi * dy
|
|
304
|
+
|
|
305
|
+
var lambda = (x1p * x1p) / (rx * rx) + (y1p * y1p) / (ry * ry)
|
|
306
|
+
if (lambda > 1f) { val s = sqrt(lambda); rx *= s; ry *= s }
|
|
307
|
+
|
|
308
|
+
val num = maxOf(rx * rx * ry * ry - rx * rx * y1p * y1p - ry * ry * x1p * x1p, 0f)
|
|
309
|
+
val den = rx * rx * y1p * y1p + ry * ry * x1p * x1p
|
|
310
|
+
var sq = sqrt(num / maxOf(den, 1e-10f))
|
|
311
|
+
if (largeArc == sweep) sq = -sq
|
|
312
|
+
|
|
313
|
+
val cxp = sq * rx * y1p / ry
|
|
314
|
+
val cyp = -sq * ry * x1p / rx
|
|
315
|
+
val cx = cosPhi * cxp - sinPhi * cyp + (x1 + x2) / 2f
|
|
316
|
+
val cy = sinPhi * cxp + cosPhi * cyp + (y1 + y2) / 2f
|
|
317
|
+
|
|
318
|
+
fun angle(ux: Float, uy: Float, vx: Float, vy: Float): Float {
|
|
319
|
+
val dot = ux * vx + uy * vy
|
|
320
|
+
val len = sqrt(ux * ux + uy * uy) * sqrt(vx * vx + vy * vy)
|
|
321
|
+
var a = acos(maxOf(-1f, minOf(1f, dot / maxOf(len, 1e-10f))))
|
|
322
|
+
if (ux * vy - uy * vx < 0) a = -a
|
|
323
|
+
return a
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
val theta1 = angle(1f, 0f, (x1p - cxp) / rx, (y1p - cyp) / ry)
|
|
327
|
+
var dtheta = angle((x1p - cxp) / rx, (y1p - cyp) / ry,
|
|
328
|
+
(-x1p - cxp) / rx, (-y1p - cyp) / ry)
|
|
329
|
+
if (!sweep && dtheta > 0) dtheta -= 2 * PI.toFloat()
|
|
330
|
+
if (sweep && dtheta < 0) dtheta += 2 * PI.toFloat()
|
|
331
|
+
|
|
332
|
+
val segments = maxOf(1, ceil(abs(dtheta) / (PI.toFloat() / 2f)).toInt())
|
|
333
|
+
val delta = dtheta / segments
|
|
334
|
+
val t = 4f / 3f * tan(delta / 4f)
|
|
335
|
+
|
|
336
|
+
var th = theta1
|
|
337
|
+
for (seg in 0 until segments) {
|
|
338
|
+
val costh = cos(th); val sinth = sin(th)
|
|
339
|
+
val costh2 = cos(th + delta); val sinth2 = sin(th + delta)
|
|
340
|
+
|
|
341
|
+
val ep2x = cosPhi * rx * costh2 - sinPhi * ry * sinth2 + cx
|
|
342
|
+
val ep2y = sinPhi * rx * costh2 + cosPhi * ry * sinth2 + cy
|
|
343
|
+
|
|
344
|
+
val cp1x = (cosPhi * rx * costh - sinPhi * ry * sinth + cx) +
|
|
345
|
+
t * (-cosPhi * rx * sinth - sinPhi * ry * costh)
|
|
346
|
+
val cp1y = (sinPhi * rx * costh + cosPhi * ry * sinth + cy) +
|
|
347
|
+
t * (-sinPhi * rx * sinth + cosPhi * ry * costh)
|
|
348
|
+
val cp2x = ep2x - t * (-cosPhi * rx * sinth2 - sinPhi * ry * costh2)
|
|
349
|
+
val cp2y = ep2y - t * (-sinPhi * rx * sinth2 + cosPhi * ry * costh2)
|
|
350
|
+
|
|
351
|
+
path.cubicTo(cp1x, cp1y, cp2x, cp2y, ep2x, ep2y)
|
|
352
|
+
th += delta
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
package com.monflowts
|
|
2
|
+
|
|
3
|
+
import android.graphics.Color
|
|
4
|
+
import com.facebook.react.module.annotations.ReactModule
|
|
5
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
6
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
7
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
8
|
+
|
|
9
|
+
@ReactModule(name = MonflowtsSvgViewManager.NAME)
|
|
10
|
+
class MonflowtsSvgViewManager : SimpleViewManager<MonflowtsSvgView>() {
|
|
11
|
+
|
|
12
|
+
companion object {
|
|
13
|
+
const val NAME = "MonflowtsSvgView"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
override fun getName(): String = NAME
|
|
17
|
+
|
|
18
|
+
override fun createViewInstance(context: ThemedReactContext): MonflowtsSvgView {
|
|
19
|
+
return MonflowtsSvgView(context)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@ReactProp(name = "d")
|
|
23
|
+
fun setD(view: MonflowtsSvgView, d: String?) {
|
|
24
|
+
view.setPathData(d ?: "")
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@ReactProp(name = "fill")
|
|
28
|
+
fun setFill(view: MonflowtsSvgView, fill: String?) {
|
|
29
|
+
val color = parseColor(fill)
|
|
30
|
+
view.setFillColor(color)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@ReactProp(name = "stroke")
|
|
34
|
+
fun setStroke(view: MonflowtsSvgView, stroke: String?) {
|
|
35
|
+
val color = parseColor(stroke)
|
|
36
|
+
view.setStrokeColor(color)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@ReactProp(name = "strokeWidth", defaultFloat = 0f)
|
|
40
|
+
fun setStrokeWidth(view: MonflowtsSvgView, width: Float) {
|
|
41
|
+
view.setSvgStrokeWidth(width)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@ReactProp(name = "svgViewBox")
|
|
45
|
+
fun setViewBox(view: MonflowtsSvgView, viewBox: String?) {
|
|
46
|
+
view.setSvgViewBox(viewBox ?: "0 0 24 24")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private fun parseColor(colorStr: String?): Int {
|
|
50
|
+
if (colorStr.isNullOrEmpty() || colorStr == "none" || colorStr == "transparent") {
|
|
51
|
+
return Color.TRANSPARENT
|
|
52
|
+
}
|
|
53
|
+
return try {
|
|
54
|
+
Color.parseColor(colorStr)
|
|
55
|
+
} catch (e: Exception) {
|
|
56
|
+
Color.TRANSPARENT
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
package com.monflowts
|
|
2
|
+
|
|
3
|
+
import android.annotation.SuppressLint
|
|
4
|
+
import android.net.Uri
|
|
5
|
+
import android.os.Build
|
|
6
|
+
import android.webkit.JavascriptInterface
|
|
7
|
+
import android.webkit.WebChromeClient
|
|
8
|
+
import android.webkit.WebSettings
|
|
9
|
+
import android.webkit.WebView
|
|
10
|
+
import android.webkit.WebViewClient
|
|
11
|
+
import android.widget.FrameLayout
|
|
12
|
+
import com.facebook.react.bridge.Arguments
|
|
13
|
+
import com.facebook.react.bridge.ReactContext
|
|
14
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
15
|
+
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
16
|
+
|
|
17
|
+
@SuppressLint("SetJavaScriptEnabled", "ViewConstructor")
|
|
18
|
+
class MonflowtsWebView(context: ThemedReactContext) : FrameLayout(context) {
|
|
19
|
+
|
|
20
|
+
private val reactContext: ThemedReactContext = context
|
|
21
|
+
|
|
22
|
+
private val webView: WebView = WebView(context).apply {
|
|
23
|
+
settings.javaScriptEnabled = true
|
|
24
|
+
settings.domStorageEnabled = true
|
|
25
|
+
settings.mixedContentMode = WebSettings.MIXED_CONTENT_NEVER_ALLOW
|
|
26
|
+
settings.mediaPlaybackRequiresUserGesture = false
|
|
27
|
+
settings.allowFileAccess = false
|
|
28
|
+
settings.allowContentAccess = false
|
|
29
|
+
settings.javaScriptCanOpenWindowsAutomatically = false
|
|
30
|
+
settings.setSupportMultipleWindows(false)
|
|
31
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
32
|
+
settings.safeBrowsingEnabled = true
|
|
33
|
+
}
|
|
34
|
+
webViewClient = WebViewClient()
|
|
35
|
+
webChromeClient = WebChromeClient()
|
|
36
|
+
|
|
37
|
+
// JS → Native bridge: window.monflowtsBridge.postMessage(string)
|
|
38
|
+
addJavascriptInterface(MonflowtsJSBridge(), "monflowtsBridge")
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
init {
|
|
42
|
+
addView(webView, LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT))
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
fun setHtml(html: String?) {
|
|
46
|
+
if (html.isNullOrEmpty()) return
|
|
47
|
+
webView.loadDataWithBaseURL(
|
|
48
|
+
"https://localhost",
|
|
49
|
+
html,
|
|
50
|
+
"text/html",
|
|
51
|
+
"UTF-8",
|
|
52
|
+
null
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private fun sendEvent(data: String) {
|
|
57
|
+
val event = Arguments.createMap().apply {
|
|
58
|
+
putString("data", data)
|
|
59
|
+
}
|
|
60
|
+
reactContext
|
|
61
|
+
.getJSModule(RCTEventEmitter::class.java)
|
|
62
|
+
.receiveEvent(id, "topMessage", event)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private fun hasTrustedBridgeOrigin(): Boolean {
|
|
66
|
+
val currentUrl = webView.url ?: return false
|
|
67
|
+
val uri = Uri.parse(currentUrl)
|
|
68
|
+
return uri.scheme.equals("https", ignoreCase = true)
|
|
69
|
+
&& uri.host.equals("localhost", ignoreCase = true)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
inner class MonflowtsJSBridge {
|
|
73
|
+
@JavascriptInterface
|
|
74
|
+
fun postMessage(message: String) {
|
|
75
|
+
post {
|
|
76
|
+
if (hasTrustedBridgeOrigin()) sendEvent(message)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
override fun onDetachedFromWindow() {
|
|
82
|
+
super.onDetachedFromWindow()
|
|
83
|
+
webView.removeJavascriptInterface("monflowtsBridge")
|
|
84
|
+
webView.destroy()
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
package com.monflowts
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.common.MapBuilder
|
|
4
|
+
import com.facebook.react.module.annotations.ReactModule
|
|
5
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
6
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
7
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
8
|
+
|
|
9
|
+
@ReactModule(name = MonflowtsWebViewManager.NAME)
|
|
10
|
+
class MonflowtsWebViewManager : SimpleViewManager<MonflowtsWebView>() {
|
|
11
|
+
|
|
12
|
+
companion object {
|
|
13
|
+
const val NAME = "MonflowtsWebView"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
override fun getName(): String = NAME
|
|
17
|
+
|
|
18
|
+
override fun createViewInstance(context: ThemedReactContext): MonflowtsWebView {
|
|
19
|
+
return MonflowtsWebView(context)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@ReactProp(name = "html")
|
|
23
|
+
fun setHtml(view: MonflowtsWebView, html: String?) {
|
|
24
|
+
view.setHtml(html)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
override fun getExportedCustomDirectEventTypeConstants(): MutableMap<String, Any>? {
|
|
28
|
+
return MapBuilder.builder<String, Any>()
|
|
29
|
+
.put("topMessage", MapBuilder.of("registrationName", "onMessage"))
|
|
30
|
+
.build()
|
|
31
|
+
.toMutableMap()
|
|
32
|
+
}
|
|
33
|
+
}
|