@intentcomputing/koko-agent-sdk 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/CODE_OF_CONDUCT.md +3 -0
- package/CONTRIBUTING.md +9 -0
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/README.zh-CN.md +50 -0
- package/SECURITY.md +5 -0
- package/android/build.gradle +40 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/cn/intentcomputing/kokoagentsdk/KokoAgentSdkModule.java +1356 -0
- package/android/src/main/java/cn/intentcomputing/kokoagentsdk/KokoAgentSdkPackage.java +23 -0
- package/docs/INTEGRATION.md +168 -0
- package/docs/INTEGRATION.zh-CN.md +140 -0
- package/docs/PRIVACY.md +11 -0
- package/docs/PRIVACY.zh-CN.md +11 -0
- package/docs/PUBLISH.md +11 -0
- package/docs/PUBLISH.zh-CN.md +11 -0
- package/ios/KokoAgentSdk/KokoAgentSdk.h +5 -0
- package/ios/KokoAgentSdk/KokoAgentSdk.m +2464 -0
- package/ios/KokoAgentSdk/KokoOcrBounds.h +20 -0
- package/ios/KokoAgentSdk/KokoScrollBounds.h +21 -0
- package/koko-agent-sdk.podspec +23 -0
- package/lib/commonjs/KokoAgent.js +1427 -0
- package/lib/commonjs/KokoAgent.js.map +1 -0
- package/lib/commonjs/assist/OnDeviceAssist.js +94 -0
- package/lib/commonjs/assist/OnDeviceAssist.js.map +1 -0
- package/lib/commonjs/assist/intentClassify.js +100 -0
- package/lib/commonjs/assist/intentClassify.js.map +1 -0
- package/lib/commonjs/assist/nodeRank.js +120 -0
- package/lib/commonjs/assist/nodeRank.js.map +1 -0
- package/lib/commonjs/assist/ocrTarget.js +135 -0
- package/lib/commonjs/assist/ocrTarget.js.map +1 -0
- package/lib/commonjs/assist/webVisualChange.js +29 -0
- package/lib/commonjs/assist/webVisualChange.js.map +1 -0
- package/lib/commonjs/client/ActionOutcomeUnknownError.js +28 -0
- package/lib/commonjs/client/ActionOutcomeUnknownError.js.map +1 -0
- package/lib/commonjs/client/AgentSession.js +858 -0
- package/lib/commonjs/client/AgentSession.js.map +1 -0
- package/lib/commonjs/client/GatewayClient.js +302 -0
- package/lib/commonjs/client/GatewayClient.js.map +1 -0
- package/lib/commonjs/client/OperationReplayGuard.js +62 -0
- package/lib/commonjs/client/OperationReplayGuard.js.map +1 -0
- package/lib/commonjs/client/RunCheckpoint.js +139 -0
- package/lib/commonjs/client/RunCheckpoint.js.map +1 -0
- package/lib/commonjs/client/loopDetect.js +184 -0
- package/lib/commonjs/client/loopDetect.js.map +1 -0
- package/lib/commonjs/client/recentSearch.js +50 -0
- package/lib/commonjs/client/recentSearch.js.map +1 -0
- package/lib/commonjs/client/walletChoiceGuard.js +18 -0
- package/lib/commonjs/client/walletChoiceGuard.js.map +1 -0
- package/lib/commonjs/client/webResultCategory.js +38 -0
- package/lib/commonjs/client/webResultCategory.js.map +1 -0
- package/lib/commonjs/commercial/AccountStore.js +78 -0
- package/lib/commonjs/commercial/AccountStore.js.map +1 -0
- package/lib/commonjs/commercial/AgentDebug.js +104 -0
- package/lib/commonjs/commercial/AgentDebug.js.map +1 -0
- package/lib/commonjs/commercial/ExecutionGuard.js +53 -0
- package/lib/commonjs/commercial/ExecutionGuard.js.map +1 -0
- package/lib/commonjs/commercial/UsageBus.js +42 -0
- package/lib/commonjs/commercial/UsageBus.js.map +1 -0
- package/lib/commonjs/commercial/branding.js +69 -0
- package/lib/commonjs/commercial/branding.js.map +1 -0
- package/lib/commonjs/commercial/devMode.js +52 -0
- package/lib/commonjs/commercial/devMode.js.map +1 -0
- package/lib/commonjs/commercial/trust.js +69 -0
- package/lib/commonjs/commercial/trust.js.map +1 -0
- package/lib/commonjs/confirmation/gate.js +62 -0
- package/lib/commonjs/confirmation/gate.js.map +1 -0
- package/lib/commonjs/cursor/CursorOverlay.js +141 -0
- package/lib/commonjs/cursor/CursorOverlay.js.map +1 -0
- package/lib/commonjs/cursor/PointerHand.js +51 -0
- package/lib/commonjs/cursor/PointerHand.js.map +1 -0
- package/lib/commonjs/cursor/controller.js +91 -0
- package/lib/commonjs/cursor/controller.js.map +1 -0
- package/lib/commonjs/cursor/pointer.js +49 -0
- package/lib/commonjs/cursor/pointer.js.map +1 -0
- package/lib/commonjs/debug/KokoRemoteSmoke.js +611 -0
- package/lib/commonjs/debug/KokoRemoteSmoke.js.map +1 -0
- package/lib/commonjs/explore/ExplorationGraph.js +418 -0
- package/lib/commonjs/explore/ExplorationGraph.js.map +1 -0
- package/lib/commonjs/explore/bootstrapExplore.js +59 -0
- package/lib/commonjs/explore/bootstrapExplore.js.map +1 -0
- package/lib/commonjs/host/HostActions.js +266 -0
- package/lib/commonjs/host/HostActions.js.map +1 -0
- package/lib/commonjs/i18n/index.js +169 -0
- package/lib/commonjs/i18n/index.js.map +1 -0
- package/lib/commonjs/i18n/runtimeMessages.js +184 -0
- package/lib/commonjs/i18n/runtimeMessages.js.map +1 -0
- package/lib/commonjs/index.js +640 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/native/NativeBridge.js +132 -0
- package/lib/commonjs/native/NativeBridge.js.map +1 -0
- package/lib/commonjs/native/navigationLabel.js +16 -0
- package/lib/commonjs/native/navigationLabel.js.map +1 -0
- package/lib/commonjs/native/normalizeViewTree.js +28 -0
- package/lib/commonjs/native/normalizeViewTree.js.map +1 -0
- package/lib/commonjs/native/pruneOffscreen.js +76 -0
- package/lib/commonjs/native/pruneOffscreen.js.map +1 -0
- package/lib/commonjs/native/scrollViewport.js +69 -0
- package/lib/commonjs/native/scrollViewport.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/privacy/redact.js +108 -0
- package/lib/commonjs/privacy/redact.js.map +1 -0
- package/lib/commonjs/privacy/screenEvidence.js +59 -0
- package/lib/commonjs/privacy/screenEvidence.js.map +1 -0
- package/lib/commonjs/privacy/screenModel.js +404 -0
- package/lib/commonjs/privacy/screenModel.js.map +1 -0
- package/lib/commonjs/privacy/sensitiveScreen.js +58 -0
- package/lib/commonjs/privacy/sensitiveScreen.js.map +1 -0
- package/lib/commonjs/privacy/userGate.js +213 -0
- package/lib/commonjs/privacy/userGate.js.map +1 -0
- package/lib/commonjs/protocol/actions.js +112 -0
- package/lib/commonjs/protocol/actions.js.map +1 -0
- package/lib/commonjs/provider/HostAppearanceStore.js +111 -0
- package/lib/commonjs/provider/HostAppearanceStore.js.map +1 -0
- package/lib/commonjs/provider/KokoProvider.js +81 -0
- package/lib/commonjs/provider/KokoProvider.js.map +1 -0
- package/lib/commonjs/provider/KokoUiContext.js +102 -0
- package/lib/commonjs/provider/KokoUiContext.js.map +1 -0
- package/lib/commonjs/selector/match.js +378 -0
- package/lib/commonjs/selector/match.js.map +1 -0
- package/lib/commonjs/task/TaskStore.js +361 -0
- package/lib/commonjs/task/TaskStore.js.map +1 -0
- package/lib/commonjs/task/types.js +2 -0
- package/lib/commonjs/task/types.js.map +1 -0
- package/lib/commonjs/task/useTaskStore.js +14 -0
- package/lib/commonjs/task/useTaskStore.js.map +1 -0
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/ui/KokoChatSheet.js +885 -0
- package/lib/commonjs/ui/KokoChatSheet.js.map +1 -0
- package/lib/commonjs/ui/KokoComposer.js +161 -0
- package/lib/commonjs/ui/KokoComposer.js.map +1 -0
- package/lib/commonjs/ui/KokoDialogHost.js +254 -0
- package/lib/commonjs/ui/KokoDialogHost.js.map +1 -0
- package/lib/commonjs/ui/KokoEntryButton.js +81 -0
- package/lib/commonjs/ui/KokoEntryButton.js.map +1 -0
- package/lib/commonjs/ui/KokoObserver.js +522 -0
- package/lib/commonjs/ui/KokoObserver.js.map +1 -0
- package/lib/commonjs/ui/KokoOverlayLayer.js +45 -0
- package/lib/commonjs/ui/KokoOverlayLayer.js.map +1 -0
- package/lib/commonjs/ui/KokoSubtitle.js +95 -0
- package/lib/commonjs/ui/KokoSubtitle.js.map +1 -0
- package/lib/commonjs/ui/KokoTaskPanel.js +322 -0
- package/lib/commonjs/ui/KokoTaskPanel.js.map +1 -0
- package/lib/commonjs/ui/hostOverlay.js +126 -0
- package/lib/commonjs/ui/hostOverlay.js.map +1 -0
- package/lib/commonjs/ui/icons.js +132 -0
- package/lib/commonjs/ui/icons.js.map +1 -0
- package/lib/commonjs/ui/progressChrome.js +66 -0
- package/lib/commonjs/ui/progressChrome.js.map +1 -0
- package/lib/commonjs/ui/safeArea.js +96 -0
- package/lib/commonjs/ui/safeArea.js.map +1 -0
- package/lib/commonjs/ui/useOverlayOrigin.js +40 -0
- package/lib/commonjs/ui/useOverlayOrigin.js.map +1 -0
- package/lib/module/KokoAgent.js +1418 -0
- package/lib/module/KokoAgent.js.map +1 -0
- package/lib/module/assist/OnDeviceAssist.js +89 -0
- package/lib/module/assist/OnDeviceAssist.js.map +1 -0
- package/lib/module/assist/intentClassify.js +95 -0
- package/lib/module/assist/intentClassify.js.map +1 -0
- package/lib/module/assist/nodeRank.js +115 -0
- package/lib/module/assist/nodeRank.js.map +1 -0
- package/lib/module/assist/ocrTarget.js +123 -0
- package/lib/module/assist/ocrTarget.js.map +1 -0
- package/lib/module/assist/webVisualChange.js +24 -0
- package/lib/module/assist/webVisualChange.js.map +1 -0
- package/lib/module/client/ActionOutcomeUnknownError.js +23 -0
- package/lib/module/client/ActionOutcomeUnknownError.js.map +1 -0
- package/lib/module/client/AgentSession.js +854 -0
- package/lib/module/client/AgentSession.js.map +1 -0
- package/lib/module/client/GatewayClient.js +293 -0
- package/lib/module/client/GatewayClient.js.map +1 -0
- package/lib/module/client/OperationReplayGuard.js +58 -0
- package/lib/module/client/OperationReplayGuard.js.map +1 -0
- package/lib/module/client/RunCheckpoint.js +135 -0
- package/lib/module/client/RunCheckpoint.js.map +1 -0
- package/lib/module/client/loopDetect.js +177 -0
- package/lib/module/client/loopDetect.js.map +1 -0
- package/lib/module/client/recentSearch.js +46 -0
- package/lib/module/client/recentSearch.js.map +1 -0
- package/lib/module/client/walletChoiceGuard.js +14 -0
- package/lib/module/client/walletChoiceGuard.js.map +1 -0
- package/lib/module/client/webResultCategory.js +34 -0
- package/lib/module/client/webResultCategory.js.map +1 -0
- package/lib/module/commercial/AccountStore.js +75 -0
- package/lib/module/commercial/AccountStore.js.map +1 -0
- package/lib/module/commercial/AgentDebug.js +99 -0
- package/lib/module/commercial/AgentDebug.js.map +1 -0
- package/lib/module/commercial/ExecutionGuard.js +49 -0
- package/lib/module/commercial/ExecutionGuard.js.map +1 -0
- package/lib/module/commercial/UsageBus.js +38 -0
- package/lib/module/commercial/UsageBus.js.map +1 -0
- package/lib/module/commercial/branding.js +63 -0
- package/lib/module/commercial/branding.js.map +1 -0
- package/lib/module/commercial/devMode.js +45 -0
- package/lib/module/commercial/devMode.js.map +1 -0
- package/lib/module/commercial/trust.js +62 -0
- package/lib/module/commercial/trust.js.map +1 -0
- package/lib/module/confirmation/gate.js +54 -0
- package/lib/module/confirmation/gate.js.map +1 -0
- package/lib/module/cursor/CursorOverlay.js +136 -0
- package/lib/module/cursor/CursorOverlay.js.map +1 -0
- package/lib/module/cursor/PointerHand.js +47 -0
- package/lib/module/cursor/PointerHand.js.map +1 -0
- package/lib/module/cursor/controller.js +87 -0
- package/lib/module/cursor/controller.js.map +1 -0
- package/lib/module/cursor/pointer.js +45 -0
- package/lib/module/cursor/pointer.js.map +1 -0
- package/lib/module/debug/KokoRemoteSmoke.js +608 -0
- package/lib/module/debug/KokoRemoteSmoke.js.map +1 -0
- package/lib/module/explore/ExplorationGraph.js +406 -0
- package/lib/module/explore/ExplorationGraph.js.map +1 -0
- package/lib/module/explore/bootstrapExplore.js +55 -0
- package/lib/module/explore/bootstrapExplore.js.map +1 -0
- package/lib/module/host/HostActions.js +255 -0
- package/lib/module/host/HostActions.js.map +1 -0
- package/lib/module/i18n/index.js +159 -0
- package/lib/module/i18n/index.js.map +1 -0
- package/lib/module/i18n/runtimeMessages.js +180 -0
- package/lib/module/i18n/runtimeMessages.js.map +1 -0
- package/lib/module/index.js +44 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native/NativeBridge.js +128 -0
- package/lib/module/native/NativeBridge.js.map +1 -0
- package/lib/module/native/navigationLabel.js +12 -0
- package/lib/module/native/navigationLabel.js.map +1 -0
- package/lib/module/native/normalizeViewTree.js +25 -0
- package/lib/module/native/normalizeViewTree.js.map +1 -0
- package/lib/module/native/pruneOffscreen.js +72 -0
- package/lib/module/native/pruneOffscreen.js.map +1 -0
- package/lib/module/native/scrollViewport.js +63 -0
- package/lib/module/native/scrollViewport.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/privacy/redact.js +103 -0
- package/lib/module/privacy/redact.js.map +1 -0
- package/lib/module/privacy/screenEvidence.js +50 -0
- package/lib/module/privacy/screenEvidence.js.map +1 -0
- package/lib/module/privacy/screenModel.js +397 -0
- package/lib/module/privacy/screenModel.js.map +1 -0
- package/lib/module/privacy/sensitiveScreen.js +52 -0
- package/lib/module/privacy/sensitiveScreen.js.map +1 -0
- package/lib/module/privacy/userGate.js +202 -0
- package/lib/module/privacy/userGate.js.map +1 -0
- package/lib/module/protocol/actions.js +108 -0
- package/lib/module/protocol/actions.js.map +1 -0
- package/lib/module/provider/HostAppearanceStore.js +101 -0
- package/lib/module/provider/HostAppearanceStore.js.map +1 -0
- package/lib/module/provider/KokoProvider.js +74 -0
- package/lib/module/provider/KokoProvider.js.map +1 -0
- package/lib/module/provider/KokoUiContext.js +96 -0
- package/lib/module/provider/KokoUiContext.js.map +1 -0
- package/lib/module/selector/match.js +366 -0
- package/lib/module/selector/match.js.map +1 -0
- package/lib/module/task/TaskStore.js +356 -0
- package/lib/module/task/TaskStore.js.map +1 -0
- package/lib/module/task/types.js +2 -0
- package/lib/module/task/types.js.map +1 -0
- package/lib/module/task/useTaskStore.js +10 -0
- package/lib/module/task/useTaskStore.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/ui/KokoChatSheet.js +879 -0
- package/lib/module/ui/KokoChatSheet.js.map +1 -0
- package/lib/module/ui/KokoComposer.js +155 -0
- package/lib/module/ui/KokoComposer.js.map +1 -0
- package/lib/module/ui/KokoDialogHost.js +247 -0
- package/lib/module/ui/KokoDialogHost.js.map +1 -0
- package/lib/module/ui/KokoEntryButton.js +74 -0
- package/lib/module/ui/KokoEntryButton.js.map +1 -0
- package/lib/module/ui/KokoObserver.js +516 -0
- package/lib/module/ui/KokoObserver.js.map +1 -0
- package/lib/module/ui/KokoOverlayLayer.js +39 -0
- package/lib/module/ui/KokoOverlayLayer.js.map +1 -0
- package/lib/module/ui/KokoSubtitle.js +90 -0
- package/lib/module/ui/KokoSubtitle.js.map +1 -0
- package/lib/module/ui/KokoTaskPanel.js +316 -0
- package/lib/module/ui/KokoTaskPanel.js.map +1 -0
- package/lib/module/ui/hostOverlay.js +120 -0
- package/lib/module/ui/hostOverlay.js.map +1 -0
- package/lib/module/ui/icons.js +124 -0
- package/lib/module/ui/icons.js.map +1 -0
- package/lib/module/ui/progressChrome.js +58 -0
- package/lib/module/ui/progressChrome.js.map +1 -0
- package/lib/module/ui/safeArea.js +92 -0
- package/lib/module/ui/safeArea.js.map +1 -0
- package/lib/module/ui/useOverlayOrigin.js +36 -0
- package/lib/module/ui/useOverlayOrigin.js.map +1 -0
- package/lib/typescript/commonjs/KokoAgent.d.ts +167 -0
- package/lib/typescript/commonjs/KokoAgent.d.ts.map +1 -0
- package/lib/typescript/commonjs/assist/OnDeviceAssist.d.ts +31 -0
- package/lib/typescript/commonjs/assist/OnDeviceAssist.d.ts.map +1 -0
- package/lib/typescript/commonjs/assist/intentClassify.d.ts +18 -0
- package/lib/typescript/commonjs/assist/intentClassify.d.ts.map +1 -0
- package/lib/typescript/commonjs/assist/nodeRank.d.ts +32 -0
- package/lib/typescript/commonjs/assist/nodeRank.d.ts.map +1 -0
- package/lib/typescript/commonjs/assist/ocrTarget.d.ts +25 -0
- package/lib/typescript/commonjs/assist/ocrTarget.d.ts.map +1 -0
- package/lib/typescript/commonjs/assist/webVisualChange.d.ts +6 -0
- package/lib/typescript/commonjs/assist/webVisualChange.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/ActionOutcomeUnknownError.d.ts +13 -0
- package/lib/typescript/commonjs/client/ActionOutcomeUnknownError.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/AgentSession.d.ts +56 -0
- package/lib/typescript/commonjs/client/AgentSession.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/GatewayClient.d.ts +149 -0
- package/lib/typescript/commonjs/client/GatewayClient.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/OperationReplayGuard.d.ts +13 -0
- package/lib/typescript/commonjs/client/OperationReplayGuard.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/RunCheckpoint.d.ts +57 -0
- package/lib/typescript/commonjs/client/RunCheckpoint.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/loopDetect.d.ts +15 -0
- package/lib/typescript/commonjs/client/loopDetect.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/recentSearch.d.ts +5 -0
- package/lib/typescript/commonjs/client/recentSearch.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/walletChoiceGuard.d.ts +4 -0
- package/lib/typescript/commonjs/client/walletChoiceGuard.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/webResultCategory.d.ts +5 -0
- package/lib/typescript/commonjs/client/webResultCategory.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/AccountStore.d.ts +17 -0
- package/lib/typescript/commonjs/commercial/AccountStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/AgentDebug.d.ts +25 -0
- package/lib/typescript/commonjs/commercial/AgentDebug.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/ExecutionGuard.d.ts +18 -0
- package/lib/typescript/commonjs/commercial/ExecutionGuard.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/UsageBus.d.ts +18 -0
- package/lib/typescript/commonjs/commercial/UsageBus.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/branding.d.ts +25 -0
- package/lib/typescript/commonjs/commercial/branding.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/devMode.d.ts +26 -0
- package/lib/typescript/commonjs/commercial/devMode.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/trust.d.ts +21 -0
- package/lib/typescript/commonjs/commercial/trust.d.ts.map +1 -0
- package/lib/typescript/commonjs/confirmation/gate.d.ts +18 -0
- package/lib/typescript/commonjs/confirmation/gate.d.ts.map +1 -0
- package/lib/typescript/commonjs/cursor/CursorOverlay.d.ts +13 -0
- package/lib/typescript/commonjs/cursor/CursorOverlay.d.ts.map +1 -0
- package/lib/typescript/commonjs/cursor/PointerHand.d.ts +16 -0
- package/lib/typescript/commonjs/cursor/PointerHand.d.ts.map +1 -0
- package/lib/typescript/commonjs/cursor/controller.d.ts +30 -0
- package/lib/typescript/commonjs/cursor/controller.d.ts.map +1 -0
- package/lib/typescript/commonjs/cursor/pointer.d.ts +23 -0
- package/lib/typescript/commonjs/cursor/pointer.d.ts.map +1 -0
- package/lib/typescript/commonjs/debug/KokoRemoteSmoke.d.ts +96 -0
- package/lib/typescript/commonjs/debug/KokoRemoteSmoke.d.ts.map +1 -0
- package/lib/typescript/commonjs/explore/ExplorationGraph.d.ts +96 -0
- package/lib/typescript/commonjs/explore/ExplorationGraph.d.ts.map +1 -0
- package/lib/typescript/commonjs/explore/bootstrapExplore.d.ts +40 -0
- package/lib/typescript/commonjs/explore/bootstrapExplore.d.ts.map +1 -0
- package/lib/typescript/commonjs/host/HostActions.d.ts +101 -0
- package/lib/typescript/commonjs/host/HostActions.d.ts.map +1 -0
- package/lib/typescript/commonjs/i18n/index.d.ts +20 -0
- package/lib/typescript/commonjs/i18n/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/i18n/runtimeMessages.d.ts +178 -0
- package/lib/typescript/commonjs/i18n/runtimeMessages.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +66 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/native/NativeBridge.d.ts +70 -0
- package/lib/typescript/commonjs/native/NativeBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/native/navigationLabel.d.ts +4 -0
- package/lib/typescript/commonjs/native/navigationLabel.d.ts.map +1 -0
- package/lib/typescript/commonjs/native/normalizeViewTree.d.ts +4 -0
- package/lib/typescript/commonjs/native/normalizeViewTree.d.ts.map +1 -0
- package/lib/typescript/commonjs/native/pruneOffscreen.d.ts +3 -0
- package/lib/typescript/commonjs/native/pruneOffscreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/native/scrollViewport.d.ts +13 -0
- package/lib/typescript/commonjs/native/scrollViewport.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/privacy/redact.d.ts +9 -0
- package/lib/typescript/commonjs/privacy/redact.d.ts.map +1 -0
- package/lib/typescript/commonjs/privacy/screenEvidence.d.ts +14 -0
- package/lib/typescript/commonjs/privacy/screenEvidence.d.ts.map +1 -0
- package/lib/typescript/commonjs/privacy/screenModel.d.ts +26 -0
- package/lib/typescript/commonjs/privacy/screenModel.d.ts.map +1 -0
- package/lib/typescript/commonjs/privacy/sensitiveScreen.d.ts +8 -0
- package/lib/typescript/commonjs/privacy/sensitiveScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/privacy/userGate.d.ts +58 -0
- package/lib/typescript/commonjs/privacy/userGate.d.ts.map +1 -0
- package/lib/typescript/commonjs/protocol/actions.d.ts +7 -0
- package/lib/typescript/commonjs/protocol/actions.d.ts.map +1 -0
- package/lib/typescript/commonjs/provider/HostAppearanceStore.d.ts +64 -0
- package/lib/typescript/commonjs/provider/HostAppearanceStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/provider/KokoProvider.d.ts +39 -0
- package/lib/typescript/commonjs/provider/KokoProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/provider/KokoUiContext.d.ts +22 -0
- package/lib/typescript/commonjs/provider/KokoUiContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/selector/match.d.ts +27 -0
- package/lib/typescript/commonjs/selector/match.d.ts.map +1 -0
- package/lib/typescript/commonjs/task/TaskStore.d.ts +65 -0
- package/lib/typescript/commonjs/task/TaskStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/task/types.d.ts +66 -0
- package/lib/typescript/commonjs/task/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/task/useTaskStore.d.ts +3 -0
- package/lib/typescript/commonjs/task/useTaskStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/types.d.ts +372 -0
- package/lib/typescript/commonjs/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoChatSheet.d.ts +8 -0
- package/lib/typescript/commonjs/ui/KokoChatSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoComposer.d.ts +13 -0
- package/lib/typescript/commonjs/ui/KokoComposer.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoDialogHost.d.ts +32 -0
- package/lib/typescript/commonjs/ui/KokoDialogHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoEntryButton.d.ts +18 -0
- package/lib/typescript/commonjs/ui/KokoEntryButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoObserver.d.ts +13 -0
- package/lib/typescript/commonjs/ui/KokoObserver.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoOverlayLayer.d.ts +35 -0
- package/lib/typescript/commonjs/ui/KokoOverlayLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoSubtitle.d.ts +7 -0
- package/lib/typescript/commonjs/ui/KokoSubtitle.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoTaskPanel.d.ts +7 -0
- package/lib/typescript/commonjs/ui/KokoTaskPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hostOverlay.d.ts +28 -0
- package/lib/typescript/commonjs/ui/hostOverlay.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/icons.d.ts +26 -0
- package/lib/typescript/commonjs/ui/icons.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/progressChrome.d.ts +21 -0
- package/lib/typescript/commonjs/ui/progressChrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/safeArea.d.ts +12 -0
- package/lib/typescript/commonjs/ui/safeArea.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/useOverlayOrigin.d.ts +22 -0
- package/lib/typescript/commonjs/ui/useOverlayOrigin.d.ts.map +1 -0
- package/lib/typescript/module/KokoAgent.d.ts +167 -0
- package/lib/typescript/module/KokoAgent.d.ts.map +1 -0
- package/lib/typescript/module/assist/OnDeviceAssist.d.ts +31 -0
- package/lib/typescript/module/assist/OnDeviceAssist.d.ts.map +1 -0
- package/lib/typescript/module/assist/intentClassify.d.ts +18 -0
- package/lib/typescript/module/assist/intentClassify.d.ts.map +1 -0
- package/lib/typescript/module/assist/nodeRank.d.ts +32 -0
- package/lib/typescript/module/assist/nodeRank.d.ts.map +1 -0
- package/lib/typescript/module/assist/ocrTarget.d.ts +25 -0
- package/lib/typescript/module/assist/ocrTarget.d.ts.map +1 -0
- package/lib/typescript/module/assist/webVisualChange.d.ts +6 -0
- package/lib/typescript/module/assist/webVisualChange.d.ts.map +1 -0
- package/lib/typescript/module/client/ActionOutcomeUnknownError.d.ts +13 -0
- package/lib/typescript/module/client/ActionOutcomeUnknownError.d.ts.map +1 -0
- package/lib/typescript/module/client/AgentSession.d.ts +56 -0
- package/lib/typescript/module/client/AgentSession.d.ts.map +1 -0
- package/lib/typescript/module/client/GatewayClient.d.ts +149 -0
- package/lib/typescript/module/client/GatewayClient.d.ts.map +1 -0
- package/lib/typescript/module/client/OperationReplayGuard.d.ts +13 -0
- package/lib/typescript/module/client/OperationReplayGuard.d.ts.map +1 -0
- package/lib/typescript/module/client/RunCheckpoint.d.ts +57 -0
- package/lib/typescript/module/client/RunCheckpoint.d.ts.map +1 -0
- package/lib/typescript/module/client/loopDetect.d.ts +15 -0
- package/lib/typescript/module/client/loopDetect.d.ts.map +1 -0
- package/lib/typescript/module/client/recentSearch.d.ts +5 -0
- package/lib/typescript/module/client/recentSearch.d.ts.map +1 -0
- package/lib/typescript/module/client/walletChoiceGuard.d.ts +4 -0
- package/lib/typescript/module/client/walletChoiceGuard.d.ts.map +1 -0
- package/lib/typescript/module/client/webResultCategory.d.ts +5 -0
- package/lib/typescript/module/client/webResultCategory.d.ts.map +1 -0
- package/lib/typescript/module/commercial/AccountStore.d.ts +17 -0
- package/lib/typescript/module/commercial/AccountStore.d.ts.map +1 -0
- package/lib/typescript/module/commercial/AgentDebug.d.ts +25 -0
- package/lib/typescript/module/commercial/AgentDebug.d.ts.map +1 -0
- package/lib/typescript/module/commercial/ExecutionGuard.d.ts +18 -0
- package/lib/typescript/module/commercial/ExecutionGuard.d.ts.map +1 -0
- package/lib/typescript/module/commercial/UsageBus.d.ts +18 -0
- package/lib/typescript/module/commercial/UsageBus.d.ts.map +1 -0
- package/lib/typescript/module/commercial/branding.d.ts +25 -0
- package/lib/typescript/module/commercial/branding.d.ts.map +1 -0
- package/lib/typescript/module/commercial/devMode.d.ts +26 -0
- package/lib/typescript/module/commercial/devMode.d.ts.map +1 -0
- package/lib/typescript/module/commercial/trust.d.ts +21 -0
- package/lib/typescript/module/commercial/trust.d.ts.map +1 -0
- package/lib/typescript/module/confirmation/gate.d.ts +18 -0
- package/lib/typescript/module/confirmation/gate.d.ts.map +1 -0
- package/lib/typescript/module/cursor/CursorOverlay.d.ts +13 -0
- package/lib/typescript/module/cursor/CursorOverlay.d.ts.map +1 -0
- package/lib/typescript/module/cursor/PointerHand.d.ts +16 -0
- package/lib/typescript/module/cursor/PointerHand.d.ts.map +1 -0
- package/lib/typescript/module/cursor/controller.d.ts +30 -0
- package/lib/typescript/module/cursor/controller.d.ts.map +1 -0
- package/lib/typescript/module/cursor/pointer.d.ts +23 -0
- package/lib/typescript/module/cursor/pointer.d.ts.map +1 -0
- package/lib/typescript/module/debug/KokoRemoteSmoke.d.ts +96 -0
- package/lib/typescript/module/debug/KokoRemoteSmoke.d.ts.map +1 -0
- package/lib/typescript/module/explore/ExplorationGraph.d.ts +96 -0
- package/lib/typescript/module/explore/ExplorationGraph.d.ts.map +1 -0
- package/lib/typescript/module/explore/bootstrapExplore.d.ts +40 -0
- package/lib/typescript/module/explore/bootstrapExplore.d.ts.map +1 -0
- package/lib/typescript/module/host/HostActions.d.ts +101 -0
- package/lib/typescript/module/host/HostActions.d.ts.map +1 -0
- package/lib/typescript/module/i18n/index.d.ts +20 -0
- package/lib/typescript/module/i18n/index.d.ts.map +1 -0
- package/lib/typescript/module/i18n/runtimeMessages.d.ts +178 -0
- package/lib/typescript/module/i18n/runtimeMessages.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +66 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/native/NativeBridge.d.ts +70 -0
- package/lib/typescript/module/native/NativeBridge.d.ts.map +1 -0
- package/lib/typescript/module/native/navigationLabel.d.ts +4 -0
- package/lib/typescript/module/native/navigationLabel.d.ts.map +1 -0
- package/lib/typescript/module/native/normalizeViewTree.d.ts +4 -0
- package/lib/typescript/module/native/normalizeViewTree.d.ts.map +1 -0
- package/lib/typescript/module/native/pruneOffscreen.d.ts +3 -0
- package/lib/typescript/module/native/pruneOffscreen.d.ts.map +1 -0
- package/lib/typescript/module/native/scrollViewport.d.ts +13 -0
- package/lib/typescript/module/native/scrollViewport.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/privacy/redact.d.ts +9 -0
- package/lib/typescript/module/privacy/redact.d.ts.map +1 -0
- package/lib/typescript/module/privacy/screenEvidence.d.ts +14 -0
- package/lib/typescript/module/privacy/screenEvidence.d.ts.map +1 -0
- package/lib/typescript/module/privacy/screenModel.d.ts +26 -0
- package/lib/typescript/module/privacy/screenModel.d.ts.map +1 -0
- package/lib/typescript/module/privacy/sensitiveScreen.d.ts +8 -0
- package/lib/typescript/module/privacy/sensitiveScreen.d.ts.map +1 -0
- package/lib/typescript/module/privacy/userGate.d.ts +58 -0
- package/lib/typescript/module/privacy/userGate.d.ts.map +1 -0
- package/lib/typescript/module/protocol/actions.d.ts +7 -0
- package/lib/typescript/module/protocol/actions.d.ts.map +1 -0
- package/lib/typescript/module/provider/HostAppearanceStore.d.ts +64 -0
- package/lib/typescript/module/provider/HostAppearanceStore.d.ts.map +1 -0
- package/lib/typescript/module/provider/KokoProvider.d.ts +39 -0
- package/lib/typescript/module/provider/KokoProvider.d.ts.map +1 -0
- package/lib/typescript/module/provider/KokoUiContext.d.ts +22 -0
- package/lib/typescript/module/provider/KokoUiContext.d.ts.map +1 -0
- package/lib/typescript/module/selector/match.d.ts +27 -0
- package/lib/typescript/module/selector/match.d.ts.map +1 -0
- package/lib/typescript/module/task/TaskStore.d.ts +65 -0
- package/lib/typescript/module/task/TaskStore.d.ts.map +1 -0
- package/lib/typescript/module/task/types.d.ts +66 -0
- package/lib/typescript/module/task/types.d.ts.map +1 -0
- package/lib/typescript/module/task/useTaskStore.d.ts +3 -0
- package/lib/typescript/module/task/useTaskStore.d.ts.map +1 -0
- package/lib/typescript/module/types.d.ts +372 -0
- package/lib/typescript/module/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoChatSheet.d.ts +8 -0
- package/lib/typescript/module/ui/KokoChatSheet.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoComposer.d.ts +13 -0
- package/lib/typescript/module/ui/KokoComposer.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoDialogHost.d.ts +32 -0
- package/lib/typescript/module/ui/KokoDialogHost.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoEntryButton.d.ts +18 -0
- package/lib/typescript/module/ui/KokoEntryButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoObserver.d.ts +13 -0
- package/lib/typescript/module/ui/KokoObserver.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoOverlayLayer.d.ts +35 -0
- package/lib/typescript/module/ui/KokoOverlayLayer.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoSubtitle.d.ts +7 -0
- package/lib/typescript/module/ui/KokoSubtitle.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoTaskPanel.d.ts +7 -0
- package/lib/typescript/module/ui/KokoTaskPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/hostOverlay.d.ts +28 -0
- package/lib/typescript/module/ui/hostOverlay.d.ts.map +1 -0
- package/lib/typescript/module/ui/icons.d.ts +26 -0
- package/lib/typescript/module/ui/icons.d.ts.map +1 -0
- package/lib/typescript/module/ui/progressChrome.d.ts +21 -0
- package/lib/typescript/module/ui/progressChrome.d.ts.map +1 -0
- package/lib/typescript/module/ui/safeArea.d.ts +12 -0
- package/lib/typescript/module/ui/safeArea.d.ts.map +1 -0
- package/lib/typescript/module/ui/useOverlayOrigin.d.ts +22 -0
- package/lib/typescript/module/ui/useOverlayOrigin.d.ts.map +1 -0
- package/package.json +153 -0
- package/react-native.config.js +12 -0
- package/src/KokoAgent.ts +1415 -0
- package/src/assist/OnDeviceAssist.ts +133 -0
- package/src/assist/intentClassify.ts +122 -0
- package/src/assist/nodeRank.ts +167 -0
- package/src/assist/ocrTarget.ts +146 -0
- package/src/assist/webVisualChange.ts +24 -0
- package/src/client/ActionOutcomeUnknownError.ts +18 -0
- package/src/client/AgentSession.ts +952 -0
- package/src/client/GatewayClient.ts +439 -0
- package/src/client/OperationReplayGuard.ts +61 -0
- package/src/client/RunCheckpoint.ts +154 -0
- package/src/client/loopDetect.ts +213 -0
- package/src/client/recentSearch.ts +47 -0
- package/src/client/walletChoiceGuard.ts +15 -0
- package/src/client/webResultCategory.ts +28 -0
- package/src/commercial/AccountStore.ts +85 -0
- package/src/commercial/AgentDebug.ts +142 -0
- package/src/commercial/ExecutionGuard.ts +67 -0
- package/src/commercial/UsageBus.ts +44 -0
- package/src/commercial/branding.ts +97 -0
- package/src/commercial/devMode.ts +48 -0
- package/src/commercial/trust.ts +67 -0
- package/src/confirmation/gate.ts +82 -0
- package/src/cursor/CursorOverlay.tsx +138 -0
- package/src/cursor/PointerHand.tsx +49 -0
- package/src/cursor/controller.ts +98 -0
- package/src/cursor/pointer.ts +40 -0
- package/src/debug/KokoRemoteSmoke.tsx +561 -0
- package/src/explore/ExplorationGraph.ts +518 -0
- package/src/explore/bootstrapExplore.ts +89 -0
- package/src/host/HostActions.ts +349 -0
- package/src/i18n/index.ts +229 -0
- package/src/i18n/runtimeMessages.ts +180 -0
- package/src/index.ts +203 -0
- package/src/native/NativeBridge.ts +207 -0
- package/src/native/navigationLabel.ts +11 -0
- package/src/native/normalizeViewTree.ts +16 -0
- package/src/native/pruneOffscreen.ts +72 -0
- package/src/native/scrollViewport.ts +51 -0
- package/src/privacy/redact.ts +115 -0
- package/src/privacy/screenEvidence.ts +55 -0
- package/src/privacy/screenModel.ts +504 -0
- package/src/privacy/sensitiveScreen.ts +55 -0
- package/src/privacy/userGate.ts +233 -0
- package/src/protocol/actions.ts +66 -0
- package/src/provider/HostAppearanceStore.ts +148 -0
- package/src/provider/KokoProvider.tsx +118 -0
- package/src/provider/KokoUiContext.tsx +162 -0
- package/src/selector/match.ts +417 -0
- package/src/task/TaskStore.ts +387 -0
- package/src/task/types.ts +82 -0
- package/src/task/useTaskStore.ts +9 -0
- package/src/types.ts +318 -0
- package/src/ui/KokoChatSheet.tsx +930 -0
- package/src/ui/KokoComposer.tsx +174 -0
- package/src/ui/KokoDialogHost.tsx +249 -0
- package/src/ui/KokoEntryButton.tsx +74 -0
- package/src/ui/KokoObserver.tsx +587 -0
- package/src/ui/KokoOverlayLayer.tsx +53 -0
- package/src/ui/KokoSubtitle.tsx +80 -0
- package/src/ui/KokoTaskPanel.tsx +299 -0
- package/src/ui/hostOverlay.tsx +148 -0
- package/src/ui/icons.tsx +145 -0
- package/src/ui/progressChrome.ts +73 -0
- package/src/ui/safeArea.ts +95 -0
- package/src/ui/useOverlayOrigin.ts +29 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { Animated, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
import { useTaskStore } from '../task/useTaskStore';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Karaoke-style subtitle for the current task action.
|
|
7
|
+
* Prefer KokoObserver progress pill in the default UX; kept for custom layouts.
|
|
8
|
+
*/
|
|
9
|
+
export function KokoSubtitle() {
|
|
10
|
+
const { subtitle, tasks, activeTaskId } = useTaskStore();
|
|
11
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
12
|
+
const lastText = useRef<string | null>(null);
|
|
13
|
+
const active = tasks.find((t) => t.id === activeTaskId);
|
|
14
|
+
const show = !!subtitle && active?.status === 'running';
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!show) {
|
|
18
|
+
Animated.timing(opacity, {
|
|
19
|
+
toValue: 0,
|
|
20
|
+
duration: 160,
|
|
21
|
+
useNativeDriver: true,
|
|
22
|
+
}).start();
|
|
23
|
+
lastText.current = null;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (lastText.current === subtitle) return;
|
|
27
|
+
lastText.current = subtitle;
|
|
28
|
+
opacity.setValue(0.35);
|
|
29
|
+
Animated.timing(opacity, {
|
|
30
|
+
toValue: 1,
|
|
31
|
+
duration: 160,
|
|
32
|
+
useNativeDriver: true,
|
|
33
|
+
}).start();
|
|
34
|
+
}, [show, subtitle, opacity]);
|
|
35
|
+
|
|
36
|
+
if (!subtitle || !show) return null;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Animated.View style={[styles.wrap, { opacity }]} pointerEvents="none">
|
|
40
|
+
<View style={styles.pill}>
|
|
41
|
+
<View style={styles.dot} />
|
|
42
|
+
<Text style={styles.text} numberOfLines={2}>
|
|
43
|
+
{subtitle}
|
|
44
|
+
</Text>
|
|
45
|
+
</View>
|
|
46
|
+
</Animated.View>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const styles = StyleSheet.create({
|
|
51
|
+
wrap: {
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
paddingHorizontal: 20,
|
|
54
|
+
marginBottom: 8,
|
|
55
|
+
},
|
|
56
|
+
pill: {
|
|
57
|
+
flexDirection: 'row',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
maxWidth: '100%',
|
|
60
|
+
paddingHorizontal: 14,
|
|
61
|
+
paddingVertical: 10,
|
|
62
|
+
borderRadius: 14,
|
|
63
|
+
backgroundColor: 'rgba(20,20,22,0.88)',
|
|
64
|
+
},
|
|
65
|
+
dot: {
|
|
66
|
+
width: 7,
|
|
67
|
+
height: 7,
|
|
68
|
+
borderRadius: 4,
|
|
69
|
+
backgroundColor: '#7CFFB2',
|
|
70
|
+
marginRight: 10,
|
|
71
|
+
},
|
|
72
|
+
text: {
|
|
73
|
+
flexShrink: 1,
|
|
74
|
+
color: '#F5F5F7',
|
|
75
|
+
fontSize: 14,
|
|
76
|
+
lineHeight: 19,
|
|
77
|
+
fontWeight: '500',
|
|
78
|
+
letterSpacing: 0.1,
|
|
79
|
+
},
|
|
80
|
+
});
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
ScrollView,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
Text,
|
|
7
|
+
View,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { TaskStore } from '../task/TaskStore';
|
|
10
|
+
import type { Task, TaskNode, TaskStatus } from '../task/types';
|
|
11
|
+
import { useTaskStore } from '../task/useTaskStore';
|
|
12
|
+
import { useKokoUi } from '../provider/KokoUiContext';
|
|
13
|
+
|
|
14
|
+
function statusColor(status: TaskStatus): string {
|
|
15
|
+
switch (status) {
|
|
16
|
+
case 'running':
|
|
17
|
+
return '#7CFFB2';
|
|
18
|
+
case 'success':
|
|
19
|
+
return '#6EC8FF';
|
|
20
|
+
case 'failed':
|
|
21
|
+
return '#FF7A7A';
|
|
22
|
+
case 'cancelled':
|
|
23
|
+
return '#A0A0A5';
|
|
24
|
+
default:
|
|
25
|
+
return '#A0A0A5';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function formatTime(ts: number): string {
|
|
30
|
+
const d = new Date(ts);
|
|
31
|
+
const hh = String(d.getHours()).padStart(2, '0');
|
|
32
|
+
const mm = String(d.getMinutes()).padStart(2, '0');
|
|
33
|
+
const ss = String(d.getSeconds()).padStart(2, '0');
|
|
34
|
+
return `${hh}:${mm}:${ss}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function TaskRow({
|
|
38
|
+
task,
|
|
39
|
+
selected,
|
|
40
|
+
onPress,
|
|
41
|
+
}: {
|
|
42
|
+
task: Task;
|
|
43
|
+
selected: boolean;
|
|
44
|
+
onPress: () => void;
|
|
45
|
+
}) {
|
|
46
|
+
const { t } = useKokoUi();
|
|
47
|
+
return (
|
|
48
|
+
<Pressable
|
|
49
|
+
onPress={onPress}
|
|
50
|
+
style={[styles.taskRow, selected && styles.taskRowSelected]}
|
|
51
|
+
>
|
|
52
|
+
<View style={[styles.statusDot, { backgroundColor: statusColor(task.status) }]} />
|
|
53
|
+
<View style={styles.taskMeta}>
|
|
54
|
+
<Text style={styles.taskTitle} numberOfLines={1}>
|
|
55
|
+
{task.title}
|
|
56
|
+
</Text>
|
|
57
|
+
<Text style={styles.taskSub}>
|
|
58
|
+
{t(`status.${task.status}`)} · {t(task.nodes.length === 1 ? 'panel.stepOne' : 'panel.stepMany', { count: task.nodes.length })} · {formatTime(task.createdAt)}
|
|
59
|
+
</Text>
|
|
60
|
+
</View>
|
|
61
|
+
<Text style={styles.chevron}>{selected ? '▾' : '›'}</Text>
|
|
62
|
+
</Pressable>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function NodeRow({ node }: { node: TaskNode }) {
|
|
67
|
+
const { t } = useKokoUi();
|
|
68
|
+
return (
|
|
69
|
+
<View style={styles.nodeRow}>
|
|
70
|
+
<Text style={styles.nodeTime}>{formatTime(node.createdAt)}</Text>
|
|
71
|
+
<View style={styles.nodeBody}>
|
|
72
|
+
<Text style={styles.nodeKind}>{t(`kind.${node.kind}`)}</Text>
|
|
73
|
+
<Text style={styles.nodeTitle}>{node.title}</Text>
|
|
74
|
+
{node.detail ? (
|
|
75
|
+
<Text style={styles.nodeDetail} numberOfLines={3}>
|
|
76
|
+
{node.detail}
|
|
77
|
+
</Text>
|
|
78
|
+
) : null}
|
|
79
|
+
</View>
|
|
80
|
+
</View>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated Prefer KokoChatSheet via KokoObserver / KokoEntryButton.
|
|
86
|
+
* Legacy inline task list; maps to sheetOpen for expand/collapse.
|
|
87
|
+
*/
|
|
88
|
+
export function KokoTaskPanel() {
|
|
89
|
+
const { branding, t } = useKokoUi();
|
|
90
|
+
const { tasks, ui } = useTaskStore();
|
|
91
|
+
const selected = useMemo(
|
|
92
|
+
() => tasks.find((t) => t.id === ui.selectedTaskId) ?? null,
|
|
93
|
+
[tasks, ui.selectedTaskId],
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
if (!ui.sheetOpen) return null;
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<View style={styles.shell} pointerEvents="box-none">
|
|
100
|
+
<View style={styles.handleBar}>
|
|
101
|
+
<Pressable
|
|
102
|
+
style={styles.handleMain}
|
|
103
|
+
onPress={() => TaskStore.toggleSheet()}
|
|
104
|
+
accessibilityRole="button"
|
|
105
|
+
accessibilityLabel={t('panel.collapseA11y', { name: branding.name })}
|
|
106
|
+
>
|
|
107
|
+
<View style={styles.handleGrip} />
|
|
108
|
+
<Text style={styles.handleTitle}>
|
|
109
|
+
{branding.name}{tasks.length ? ` · ${tasks.length}` : ''}
|
|
110
|
+
</Text>
|
|
111
|
+
</Pressable>
|
|
112
|
+
<Pressable
|
|
113
|
+
hitSlop={12}
|
|
114
|
+
onPress={() => TaskStore.closeSheet()}
|
|
115
|
+
style={styles.hideBtn}
|
|
116
|
+
accessibilityLabel={t('panel.closeA11y', { name: branding.name })}
|
|
117
|
+
>
|
|
118
|
+
<Text style={styles.hideText}>{t('panel.close')}</Text>
|
|
119
|
+
</Pressable>
|
|
120
|
+
</View>
|
|
121
|
+
|
|
122
|
+
<View style={styles.panel}>
|
|
123
|
+
<Text style={styles.sectionLabel}>{t('panel.tasks')}</Text>
|
|
124
|
+
<ScrollView style={styles.taskList} nestedScrollEnabled>
|
|
125
|
+
{tasks.length === 0 ? (
|
|
126
|
+
<Text style={styles.empty}>{t('panel.emptyTasks')}</Text>
|
|
127
|
+
) : (
|
|
128
|
+
tasks.map((task) => (
|
|
129
|
+
<TaskRow
|
|
130
|
+
key={task.id}
|
|
131
|
+
task={task}
|
|
132
|
+
selected={task.id === ui.selectedTaskId}
|
|
133
|
+
onPress={() => TaskStore.selectTask(task.id)}
|
|
134
|
+
/>
|
|
135
|
+
))
|
|
136
|
+
)}
|
|
137
|
+
</ScrollView>
|
|
138
|
+
|
|
139
|
+
{selected ? (
|
|
140
|
+
<>
|
|
141
|
+
<View style={styles.divider} />
|
|
142
|
+
<Text style={styles.sectionLabel}>{t('panel.session', { title: selected.title })}</Text>
|
|
143
|
+
<ScrollView style={styles.nodeList} nestedScrollEnabled>
|
|
144
|
+
{selected.nodes.map((node) => (
|
|
145
|
+
<NodeRow key={node.id} node={node} />
|
|
146
|
+
))}
|
|
147
|
+
</ScrollView>
|
|
148
|
+
</>
|
|
149
|
+
) : null}
|
|
150
|
+
</View>
|
|
151
|
+
</View>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const styles = StyleSheet.create({
|
|
156
|
+
shell: {
|
|
157
|
+
width: '100%',
|
|
158
|
+
},
|
|
159
|
+
handleBar: {
|
|
160
|
+
flexDirection: 'row',
|
|
161
|
+
alignItems: 'center',
|
|
162
|
+
alignSelf: 'center',
|
|
163
|
+
minWidth: 180,
|
|
164
|
+
paddingLeft: 14,
|
|
165
|
+
paddingRight: 10,
|
|
166
|
+
paddingVertical: 6,
|
|
167
|
+
borderRadius: 18,
|
|
168
|
+
backgroundColor: 'rgba(28,28,30,0.92)',
|
|
169
|
+
},
|
|
170
|
+
handleMain: {
|
|
171
|
+
flex: 1,
|
|
172
|
+
paddingTop: 8,
|
|
173
|
+
paddingBottom: 4,
|
|
174
|
+
},
|
|
175
|
+
handleGrip: {
|
|
176
|
+
width: 28,
|
|
177
|
+
height: 4,
|
|
178
|
+
borderRadius: 2,
|
|
179
|
+
backgroundColor: 'rgba(255,255,255,0.28)',
|
|
180
|
+
alignSelf: 'center',
|
|
181
|
+
marginBottom: 6,
|
|
182
|
+
},
|
|
183
|
+
handleTitle: {
|
|
184
|
+
color: '#F2F2F7',
|
|
185
|
+
fontSize: 13,
|
|
186
|
+
fontWeight: '600',
|
|
187
|
+
textAlign: 'center',
|
|
188
|
+
},
|
|
189
|
+
hideBtn: {
|
|
190
|
+
paddingLeft: 8,
|
|
191
|
+
paddingVertical: 8,
|
|
192
|
+
},
|
|
193
|
+
hideText: {
|
|
194
|
+
color: 'rgba(255,255,255,0.55)',
|
|
195
|
+
fontSize: 12,
|
|
196
|
+
},
|
|
197
|
+
panel: {
|
|
198
|
+
marginTop: 8,
|
|
199
|
+
maxHeight: 360,
|
|
200
|
+
borderRadius: 16,
|
|
201
|
+
backgroundColor: 'rgba(22,22,24,0.96)',
|
|
202
|
+
paddingHorizontal: 12,
|
|
203
|
+
paddingTop: 12,
|
|
204
|
+
paddingBottom: 8,
|
|
205
|
+
},
|
|
206
|
+
sectionLabel: {
|
|
207
|
+
color: 'rgba(255,255,255,0.45)',
|
|
208
|
+
fontSize: 11,
|
|
209
|
+
fontWeight: '600',
|
|
210
|
+
letterSpacing: 0.6,
|
|
211
|
+
textTransform: 'uppercase',
|
|
212
|
+
marginBottom: 8,
|
|
213
|
+
marginTop: 4,
|
|
214
|
+
},
|
|
215
|
+
taskList: {
|
|
216
|
+
maxHeight: 140,
|
|
217
|
+
},
|
|
218
|
+
nodeList: {
|
|
219
|
+
maxHeight: 180,
|
|
220
|
+
},
|
|
221
|
+
empty: {
|
|
222
|
+
color: 'rgba(255,255,255,0.4)',
|
|
223
|
+
fontSize: 13,
|
|
224
|
+
paddingVertical: 12,
|
|
225
|
+
},
|
|
226
|
+
taskRow: {
|
|
227
|
+
flexDirection: 'row',
|
|
228
|
+
alignItems: 'center',
|
|
229
|
+
paddingVertical: 10,
|
|
230
|
+
paddingHorizontal: 8,
|
|
231
|
+
borderRadius: 10,
|
|
232
|
+
marginBottom: 4,
|
|
233
|
+
},
|
|
234
|
+
taskRowSelected: {
|
|
235
|
+
backgroundColor: 'rgba(255,255,255,0.08)',
|
|
236
|
+
},
|
|
237
|
+
statusDot: {
|
|
238
|
+
width: 8,
|
|
239
|
+
height: 8,
|
|
240
|
+
borderRadius: 4,
|
|
241
|
+
marginRight: 10,
|
|
242
|
+
},
|
|
243
|
+
taskMeta: {
|
|
244
|
+
flex: 1,
|
|
245
|
+
},
|
|
246
|
+
taskTitle: {
|
|
247
|
+
color: '#F5F5F7',
|
|
248
|
+
fontSize: 14,
|
|
249
|
+
fontWeight: '600',
|
|
250
|
+
},
|
|
251
|
+
taskSub: {
|
|
252
|
+
color: 'rgba(255,255,255,0.45)',
|
|
253
|
+
fontSize: 11,
|
|
254
|
+
marginTop: 2,
|
|
255
|
+
},
|
|
256
|
+
chevron: {
|
|
257
|
+
color: 'rgba(255,255,255,0.4)',
|
|
258
|
+
fontSize: 16,
|
|
259
|
+
marginLeft: 6,
|
|
260
|
+
},
|
|
261
|
+
divider: {
|
|
262
|
+
height: StyleSheet.hairlineWidth,
|
|
263
|
+
backgroundColor: 'rgba(255,255,255,0.12)',
|
|
264
|
+
marginVertical: 8,
|
|
265
|
+
},
|
|
266
|
+
nodeRow: {
|
|
267
|
+
flexDirection: 'row',
|
|
268
|
+
paddingVertical: 8,
|
|
269
|
+
paddingHorizontal: 4,
|
|
270
|
+
},
|
|
271
|
+
nodeTime: {
|
|
272
|
+
width: 58,
|
|
273
|
+
color: 'rgba(255,255,255,0.35)',
|
|
274
|
+
fontSize: 11,
|
|
275
|
+
fontVariant: ['tabular-nums'],
|
|
276
|
+
marginTop: 2,
|
|
277
|
+
},
|
|
278
|
+
nodeBody: {
|
|
279
|
+
flex: 1,
|
|
280
|
+
},
|
|
281
|
+
nodeKind: {
|
|
282
|
+
color: '#8AE0FF',
|
|
283
|
+
fontSize: 10,
|
|
284
|
+
fontWeight: '700',
|
|
285
|
+
letterSpacing: 0.4,
|
|
286
|
+
marginBottom: 2,
|
|
287
|
+
},
|
|
288
|
+
nodeTitle: {
|
|
289
|
+
color: '#F5F5F7',
|
|
290
|
+
fontSize: 13,
|
|
291
|
+
lineHeight: 18,
|
|
292
|
+
},
|
|
293
|
+
nodeDetail: {
|
|
294
|
+
color: 'rgba(255,255,255,0.45)',
|
|
295
|
+
fontSize: 11,
|
|
296
|
+
marginTop: 2,
|
|
297
|
+
lineHeight: 15,
|
|
298
|
+
},
|
|
299
|
+
});
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import React, { type ComponentType, type ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Modal,
|
|
4
|
+
Platform,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
useWindowDimensions,
|
|
7
|
+
type ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { KokoOverlayLayer } from './KokoOverlayLayer';
|
|
10
|
+
|
|
11
|
+
type OverlayProps = {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** Remount / bring-to-front token (host FullWindowOverlay). */
|
|
14
|
+
liftToken?: number;
|
|
15
|
+
style?: ViewStyle;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type FullWindowOverlayProps = {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
bringToFrontToken?: number;
|
|
21
|
+
unstable_accessibilityContainerViewIsModal?: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
function tryFullWindowOverlay(): ComponentType<FullWindowOverlayProps> | null {
|
|
25
|
+
if (Platform.OS !== 'ios') return null;
|
|
26
|
+
try {
|
|
27
|
+
// Optional peer — OneKey (and most RN hosts) already ship react-native-screens.
|
|
28
|
+
// FullWindowOverlay sits above native-stack modals; RN Modal often cannot.
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
30
|
+
const mod = require('react-native-screens');
|
|
31
|
+
const Comp = mod.FullWindowOverlay as
|
|
32
|
+
| ComponentType<FullWindowOverlayProps>
|
|
33
|
+
| undefined;
|
|
34
|
+
return Comp ?? null;
|
|
35
|
+
} catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const HostFullWindowOverlay = tryFullWindowOverlay();
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Host chrome above native Settings / stack modals.
|
|
44
|
+
*
|
|
45
|
+
* Prefer FullWindowOverlay: it adds a view to the window rather than presenting
|
|
46
|
+
* a view controller, so `pointerEvents="box-none"` lets the user keep using the
|
|
47
|
+
* App underneath while a task runs. An RN Modal is its own iOS window and
|
|
48
|
+
* swallows every touch that is not aimed at the chrome itself — the agent does
|
|
49
|
+
* not notice, because the native tap skips Koko chrome windows, but the user
|
|
50
|
+
* cannot tap anything until the task ends.
|
|
51
|
+
*
|
|
52
|
+
* Modal stays as the fallback for hosts without react-native-screens, and
|
|
53
|
+
* `forceModalOverlay` keeps it reachable if a host needs it.
|
|
54
|
+
*/
|
|
55
|
+
export function KokoHostOverlay({
|
|
56
|
+
children,
|
|
57
|
+
liftToken = 0,
|
|
58
|
+
style,
|
|
59
|
+
forceModalOverlay = false,
|
|
60
|
+
}: OverlayProps & { forceModalOverlay?: boolean }) {
|
|
61
|
+
const { width, height } = useWindowDimensions();
|
|
62
|
+
|
|
63
|
+
if (HostFullWindowOverlay && !forceModalOverlay) {
|
|
64
|
+
return (
|
|
65
|
+
// `bringToFrontToken` re-raises in place. Do not key off liftToken here:
|
|
66
|
+
// liftChrome fires about once per step, and remounting a native overlay
|
|
67
|
+
// that often leaves the progress pill mid-presentation and never visible.
|
|
68
|
+
<HostFullWindowOverlay
|
|
69
|
+
bringToFrontToken={liftToken}
|
|
70
|
+
unstable_accessibilityContainerViewIsModal={false}
|
|
71
|
+
>
|
|
72
|
+
{/*
|
|
73
|
+
FullWindowOverlay sets the frame on its native container rather than
|
|
74
|
+
on itself, so its Yoga node measures 0x0 and `absoluteFillObject`
|
|
75
|
+
(top/left/right/bottom: 0) collapses with it. Anything anchored with
|
|
76
|
+
`bottom` then resolves against a zero-height box and lands above the
|
|
77
|
+
top edge of the screen — the progress pill measured at y=-96. Size
|
|
78
|
+
the layer explicitly so bottom-anchored chrome has a box to sit in.
|
|
79
|
+
*/}
|
|
80
|
+
<KokoOverlayLayer
|
|
81
|
+
pointerEvents="box-none"
|
|
82
|
+
style={[{ width, height }, style]}
|
|
83
|
+
>
|
|
84
|
+
{children}
|
|
85
|
+
</KokoOverlayLayer>
|
|
86
|
+
</HostFullWindowOverlay>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (Platform.OS === 'android' && !forceModalOverlay) {
|
|
91
|
+
// An RN Modal is its own window here too, which costs more than it buys:
|
|
92
|
+
// it swallows the user's touches, and it becomes the front-most window, so
|
|
93
|
+
// the SDK's own dump / tap would aim at the chrome instead of the host.
|
|
94
|
+
// The provider renders this as the last sibling of the host tree, so a
|
|
95
|
+
// plain absolute layer already paints over everything in the window.
|
|
96
|
+
//
|
|
97
|
+
// Size it explicitly for the same reason as the iOS branch: measured inside
|
|
98
|
+
// a full-screen host root, `absoluteFillObject` still collapsed to height 0,
|
|
99
|
+
// so bottom-anchored chrome sat below the screen and top-anchored chrome
|
|
100
|
+
// (the cursor) landed a full screen height too low.
|
|
101
|
+
return (
|
|
102
|
+
<KokoOverlayLayer
|
|
103
|
+
pointerEvents="box-none"
|
|
104
|
+
style={[styles.androidLayer, { width, height }, style]}
|
|
105
|
+
>
|
|
106
|
+
{children}
|
|
107
|
+
</KokoOverlayLayer>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<Modal
|
|
113
|
+
key={`koko-host-overlay-${liftToken}`}
|
|
114
|
+
visible
|
|
115
|
+
transparent
|
|
116
|
+
animationType="none"
|
|
117
|
+
statusBarTranslucent
|
|
118
|
+
presentationStyle={Platform.OS === 'ios' ? 'overFullScreen' : undefined}
|
|
119
|
+
supportedOrientations={['portrait', 'landscape']}
|
|
120
|
+
>
|
|
121
|
+
<KokoOverlayLayer pointerEvents="box-none" style={[styles.fill, style]}>
|
|
122
|
+
{children}
|
|
123
|
+
</KokoOverlayLayer>
|
|
124
|
+
</Modal>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Whether this build can pierce native-stack modals via screens overlay. */
|
|
129
|
+
export function kokoHostOverlayUsesScreens(): boolean {
|
|
130
|
+
return HostFullWindowOverlay != null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const styles = StyleSheet.create({
|
|
134
|
+
fill: {
|
|
135
|
+
...StyleSheet.absoluteFillObject,
|
|
136
|
+
backgroundColor: 'transparent',
|
|
137
|
+
},
|
|
138
|
+
// Anchor top-left and take the size from props: `right`/`bottom` and `zIndex`
|
|
139
|
+
// both have to stay off. zIndex on a child of the host root stops the host's
|
|
140
|
+
// own siblings from drawing at all on Android, and the layer is already the
|
|
141
|
+
// last sibling, so it paints last without one.
|
|
142
|
+
androidLayer: {
|
|
143
|
+
position: 'absolute',
|
|
144
|
+
left: 0,
|
|
145
|
+
top: 0,
|
|
146
|
+
backgroundColor: 'transparent',
|
|
147
|
+
},
|
|
148
|
+
});
|
package/src/ui/icons.tsx
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
/** Minimal vector-less icons for SDK UI (no icon font dependency). */
|
|
5
|
+
|
|
6
|
+
export function IconClose({
|
|
7
|
+
color = 'rgba(255,255,255,0.72)',
|
|
8
|
+
size = 14,
|
|
9
|
+
style,
|
|
10
|
+
}: {
|
|
11
|
+
color?: string;
|
|
12
|
+
size?: number;
|
|
13
|
+
style?: StyleProp<ViewStyle>;
|
|
14
|
+
}) {
|
|
15
|
+
const t = Math.max(1.5, size * 0.12);
|
|
16
|
+
return (
|
|
17
|
+
<View style={[{ width: size, height: size }, style]}>
|
|
18
|
+
<View
|
|
19
|
+
style={[
|
|
20
|
+
styles.bar,
|
|
21
|
+
{
|
|
22
|
+
backgroundColor: color,
|
|
23
|
+
width: size,
|
|
24
|
+
height: t,
|
|
25
|
+
top: (size - t) / 2,
|
|
26
|
+
transform: [{ rotate: '45deg' }],
|
|
27
|
+
},
|
|
28
|
+
]}
|
|
29
|
+
/>
|
|
30
|
+
<View
|
|
31
|
+
style={[
|
|
32
|
+
styles.bar,
|
|
33
|
+
{
|
|
34
|
+
backgroundColor: color,
|
|
35
|
+
width: size,
|
|
36
|
+
height: t,
|
|
37
|
+
top: (size - t) / 2,
|
|
38
|
+
transform: [{ rotate: '-45deg' }],
|
|
39
|
+
},
|
|
40
|
+
]}
|
|
41
|
+
/>
|
|
42
|
+
</View>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function IconStop({
|
|
47
|
+
color = '#fff',
|
|
48
|
+
size = 12,
|
|
49
|
+
style,
|
|
50
|
+
}: {
|
|
51
|
+
color?: string;
|
|
52
|
+
size?: number;
|
|
53
|
+
style?: StyleProp<ViewStyle>;
|
|
54
|
+
}) {
|
|
55
|
+
const r = Math.max(2, size * 0.18);
|
|
56
|
+
return (
|
|
57
|
+
<View
|
|
58
|
+
style={[
|
|
59
|
+
{
|
|
60
|
+
width: size,
|
|
61
|
+
height: size,
|
|
62
|
+
borderRadius: r,
|
|
63
|
+
backgroundColor: color,
|
|
64
|
+
},
|
|
65
|
+
style,
|
|
66
|
+
]}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Checkmark (two bars) for success result. */
|
|
72
|
+
export function IconCheck({
|
|
73
|
+
color = '#fff',
|
|
74
|
+
size = 16,
|
|
75
|
+
style,
|
|
76
|
+
}: {
|
|
77
|
+
color?: string;
|
|
78
|
+
size?: number;
|
|
79
|
+
style?: StyleProp<ViewStyle>;
|
|
80
|
+
}) {
|
|
81
|
+
const t = Math.max(2, size * 0.14);
|
|
82
|
+
return (
|
|
83
|
+
<View style={[{ width: size, height: size }, style]}>
|
|
84
|
+
<View
|
|
85
|
+
style={{
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
backgroundColor: color,
|
|
88
|
+
width: size * 0.38,
|
|
89
|
+
height: t,
|
|
90
|
+
borderRadius: t,
|
|
91
|
+
left: size * 0.08,
|
|
92
|
+
top: size * 0.52,
|
|
93
|
+
transform: [{ rotate: '45deg' }],
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
<View
|
|
97
|
+
style={{
|
|
98
|
+
position: 'absolute',
|
|
99
|
+
backgroundColor: color,
|
|
100
|
+
width: size * 0.62,
|
|
101
|
+
height: t,
|
|
102
|
+
borderRadius: t,
|
|
103
|
+
left: size * 0.28,
|
|
104
|
+
top: size * 0.42,
|
|
105
|
+
transform: [{ rotate: '-48deg' }],
|
|
106
|
+
}}
|
|
107
|
+
/>
|
|
108
|
+
</View>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Horizontal dash for cancelled. */
|
|
113
|
+
export function IconDash({
|
|
114
|
+
color = '#fff',
|
|
115
|
+
size = 14,
|
|
116
|
+
style,
|
|
117
|
+
}: {
|
|
118
|
+
color?: string;
|
|
119
|
+
size?: number;
|
|
120
|
+
style?: StyleProp<ViewStyle>;
|
|
121
|
+
}) {
|
|
122
|
+
const t = Math.max(2, size * 0.16);
|
|
123
|
+
return (
|
|
124
|
+
<View
|
|
125
|
+
style={[
|
|
126
|
+
{
|
|
127
|
+
width: size * 0.7,
|
|
128
|
+
height: t,
|
|
129
|
+
borderRadius: t,
|
|
130
|
+
backgroundColor: color,
|
|
131
|
+
alignSelf: 'center',
|
|
132
|
+
},
|
|
133
|
+
style,
|
|
134
|
+
]}
|
|
135
|
+
/>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const styles = StyleSheet.create({
|
|
140
|
+
bar: {
|
|
141
|
+
position: 'absolute',
|
|
142
|
+
left: 0,
|
|
143
|
+
borderRadius: 1,
|
|
144
|
+
},
|
|
145
|
+
});
|