@userflow-tech/react-native 0.1.1 → 0.2.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/README.md +97 -61
- package/app.plugin.js +11 -1
- package/babel-plugin/index.d.ts +8 -8
- package/babel-plugin/index.d.ts.map +1 -1
- package/babel-plugin/index.js +17 -9
- package/babel-plugin/index.js.map +1 -1
- package/babel-plugin.js +13 -0
- package/docs/anchoring.md +141 -13
- package/docs/deep-linking.md +18 -15
- package/docs/theme-mapping.md +44 -15
- package/docs/troubleshooting.md +36 -29
- package/expo-plugin/withUserflow.js +1 -1
- package/expo-plugin/withUserflow.js.map +1 -1
- package/lib/commonjs/anchors/AutoAnchorRegistry.js +124 -2
- package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/commonjs/anchors/anchorChangeTicker.js +10 -0
- package/lib/commonjs/anchors/anchorChangeTicker.js.map +1 -1
- package/lib/commonjs/anchors/elementConditionEvaluator.js +25 -12
- package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
- package/lib/commonjs/anchors/fiber/FiberScanRoot.js +11 -47
- package/lib/commonjs/anchors/fiber/FiberScanRoot.js.map +1 -1
- package/lib/commonjs/anchors/fiber/FiberScanRootStore.js +50 -0
- package/lib/commonjs/anchors/fiber/FiberScanRootStore.js.map +1 -0
- package/lib/commonjs/anchors/fiber/fiberInternals.js +145 -3
- package/lib/commonjs/anchors/fiber/fiberInternals.js.map +1 -1
- package/lib/commonjs/anchors/fiber/indexHostFibers.js +129 -0
- package/lib/commonjs/anchors/fiber/indexHostFibers.js.map +1 -0
- package/lib/commonjs/anchors/fiber/readHostContent.js +131 -0
- package/lib/commonjs/anchors/fiber/readHostContent.js.map +1 -0
- package/lib/commonjs/anchors/fiberAnchorCache.js +50 -0
- package/lib/commonjs/anchors/fiberAnchorCache.js.map +1 -0
- package/lib/commonjs/anchors/resolveAnchorHost.js +15 -21
- package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js +171 -0
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -0
- package/lib/commonjs/anchors/semanticMatcher.js +285 -0
- package/lib/commonjs/anchors/semanticMatcher.js.map +1 -0
- package/lib/commonjs/authoring/ElementPickerOverlay.js +490 -0
- package/lib/commonjs/authoring/ElementPickerOverlay.js.map +1 -0
- package/lib/commonjs/authoring/capturePickerScreenshot.js +73 -0
- package/lib/commonjs/authoring/capturePickerScreenshot.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeBarTransition.js +94 -0
- package/lib/commonjs/authoring/chrome/ChromeBarTransition.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js +64 -0
- package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeButton.js +94 -0
- package/lib/commonjs/authoring/chrome/ChromeButton.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeDialog.js +131 -0
- package/lib/commonjs/authoring/chrome/ChromeDialog.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeIcon.js +39 -0
- package/lib/commonjs/authoring/chrome/ChromeIcon.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeTooltip.js +88 -0
- package/lib/commonjs/authoring/chrome/ChromeTooltip.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeTopBar.js +110 -0
- package/lib/commonjs/authoring/chrome/ChromeTopBar.js.map +1 -0
- package/lib/commonjs/authoring/chrome/DoubleTapBridge.js +57 -0
- package/lib/commonjs/authoring/chrome/DoubleTapBridge.js.map +1 -0
- package/lib/commonjs/authoring/chrome/doubleTapMonitor.js +80 -0
- package/lib/commonjs/authoring/chrome/doubleTapMonitor.js.map +1 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/userflow-logomark.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/xmark.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/xmark@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/xmark@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/tokens.js +150 -0
- package/lib/commonjs/authoring/chrome/tokens.js.map +1 -0
- package/lib/commonjs/authoring/doubleTap.js +23 -0
- package/lib/commonjs/authoring/doubleTap.js.map +1 -0
- package/lib/commonjs/authoring/elementPickerController.js +102 -0
- package/lib/commonjs/authoring/elementPickerController.js.map +1 -0
- package/lib/commonjs/authoring/fingerprintFromInstance.js +195 -0
- package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -0
- package/lib/commonjs/authoring/hitTest.js +106 -0
- package/lib/commonjs/authoring/hitTest.js.map +1 -0
- package/lib/commonjs/content/RichContentRenderer.js +12 -2
- package/lib/commonjs/content/RichContentRenderer.js.map +1 -1
- package/lib/commonjs/content/StepButton.js +19 -4
- package/lib/commonjs/content/StepButton.js.map +1 -1
- package/lib/commonjs/content/resolveStepButtonChrome.js +8 -6
- package/lib/commonjs/content/resolveStepButtonChrome.js.map +1 -1
- package/lib/commonjs/content/themeColor.js +11 -0
- package/lib/commonjs/content/themeColor.js.map +1 -1
- package/lib/commonjs/deviceContext.js +158 -0
- package/lib/commonjs/deviceContext.js.map +1 -0
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js +40 -4
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -1
- package/lib/commonjs/hostAppVersion.js +242 -0
- package/lib/commonjs/hostAppVersion.js.map +1 -0
- package/lib/commonjs/index.js +118 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lifecycle.js +2 -0
- package/lib/commonjs/lifecycle.js.map +1 -1
- package/lib/commonjs/navigation/WithUserflowReactNavigation.js +17 -8
- package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -1
- package/lib/commonjs/navigation/isOverlayPresentation.js +64 -0
- package/lib/commonjs/navigation/isOverlayPresentation.js.map +1 -0
- package/lib/commonjs/pairing/PairingController.js +29 -2
- package/lib/commonjs/pairing/PairingController.js.map +1 -1
- package/lib/commonjs/pairing/PreviewModeBanner.js +211 -84
- package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -1
- package/lib/commonjs/pairing/diagnostics.js +9 -0
- package/lib/commonjs/pairing/diagnostics.js.map +1 -1
- package/lib/commonjs/pairing/elementPickerRelay.js +91 -0
- package/lib/commonjs/pairing/elementPickerRelay.js.map +1 -0
- package/lib/commonjs/pairing/resolvePreviewChrome.js +52 -0
- package/lib/commonjs/pairing/resolvePreviewChrome.js.map +1 -0
- package/lib/commonjs/pairing/tokenStorage.js +25 -2
- package/lib/commonjs/pairing/tokenStorage.js.map +1 -1
- package/lib/commonjs/pairing/usePairingState.js +3 -1
- package/lib/commonjs/pairing/usePairingState.js.map +1 -1
- package/lib/commonjs/runtime/FlowRenderer.js +45 -21
- package/lib/commonjs/runtime/FlowRenderer.js.map +1 -1
- package/lib/commonjs/runtime/FlowSurfaceFade.js +47 -24
- package/lib/commonjs/runtime/FlowSurfaceFade.js.map +1 -1
- package/lib/commonjs/runtime/TargetPressBridge.js +13 -44
- package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
- package/lib/commonjs/runtime/UserflowProvider.js +74 -20
- package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
- package/lib/commonjs/runtime/changedTouchPoints.js +48 -0
- package/lib/commonjs/runtime/changedTouchPoints.js.map +1 -0
- package/lib/commonjs/runtime/flowEngine.js +3 -1
- package/lib/commonjs/runtime/flowEngine.js.map +1 -1
- package/lib/commonjs/runtime/flowSessionViewState.js +32 -7
- package/lib/commonjs/runtime/flowSessionViewState.js.map +1 -1
- package/lib/commonjs/runtime/useFlowSessionState.js +2 -1
- package/lib/commonjs/runtime/useFlowSessionState.js.map +1 -1
- package/lib/commonjs/screenTracker.js +46 -4
- package/lib/commonjs/screenTracker.js.map +1 -1
- package/lib/commonjs/surfaces/CardFade.js +31 -0
- package/lib/commonjs/surfaces/CardFade.js.map +1 -0
- package/lib/commonjs/surfaces/CloseButton.js +11 -6
- package/lib/commonjs/surfaces/CloseButton.js.map +1 -1
- package/lib/commonjs/surfaces/ModalSurface.js +50 -34
- package/lib/commonjs/surfaces/ModalSurface.js.map +1 -1
- package/lib/commonjs/surfaces/TooltipSurface.js +366 -87
- package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
- package/lib/commonjs/surfaces/cardTransition.js +70 -0
- package/lib/commonjs/surfaces/cardTransition.js.map +1 -0
- package/lib/commonjs/surfaces/resolveHighlightChrome.js +109 -0
- package/lib/commonjs/surfaces/resolveHighlightChrome.js.map +1 -0
- package/lib/commonjs/surfaces/resolveModalLayout.js +7 -3
- package/lib/commonjs/surfaces/resolveModalLayout.js.map +1 -1
- package/lib/commonjs/surfaces/resolveTooltipLayout.js +0 -4
- package/lib/commonjs/surfaces/resolveTooltipLayout.js.map +1 -1
- package/lib/commonjs/surfaces/surfaceInteractionConfig.js +33 -0
- package/lib/commonjs/surfaces/surfaceInteractionConfig.js.map +1 -0
- package/lib/commonjs/surfaces/surfaceLayoutInsets.js +128 -0
- package/lib/commonjs/surfaces/surfaceLayoutInsets.js.map +1 -0
- package/lib/commonjs/surfaces/themeChrome.js +4 -1
- package/lib/commonjs/surfaces/themeChrome.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +142 -21
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/TooltipCutout.js +100 -47
- package/lib/commonjs/surfaces/tooltip/TooltipCutout.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js +124 -0
- package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js +67 -13
- package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js +88 -19
- package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js +52 -0
- package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/rect.js +12 -0
- package/lib/commonjs/surfaces/tooltip/rect.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js +103 -0
- package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/anchors/AutoAnchorRegistry.js +125 -2
- package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/module/anchors/anchorChangeTicker.js +10 -0
- package/lib/module/anchors/anchorChangeTicker.js.map +1 -1
- package/lib/module/anchors/elementConditionEvaluator.js +25 -12
- package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
- package/lib/module/anchors/fiber/FiberScanRoot.js +2 -43
- package/lib/module/anchors/fiber/FiberScanRoot.js.map +1 -1
- package/lib/module/anchors/fiber/FiberScanRootStore.js +46 -0
- package/lib/module/anchors/fiber/FiberScanRootStore.js.map +1 -0
- package/lib/module/anchors/fiber/fiberInternals.js +139 -3
- package/lib/module/anchors/fiber/fiberInternals.js.map +1 -1
- package/lib/module/anchors/fiber/indexHostFibers.js +122 -0
- package/lib/module/anchors/fiber/indexHostFibers.js.map +1 -0
- package/lib/module/anchors/fiber/readHostContent.js +127 -0
- package/lib/module/anchors/fiber/readHostContent.js.map +1 -0
- package/lib/module/anchors/fiberAnchorCache.js +40 -0
- package/lib/module/anchors/fiberAnchorCache.js.map +1 -0
- package/lib/module/anchors/resolveAnchorHost.js +15 -21
- package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
- package/lib/module/anchors/resolveAutoAnchorHost.js +167 -0
- package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -0
- package/lib/module/anchors/semanticMatcher.js +280 -0
- package/lib/module/anchors/semanticMatcher.js.map +1 -0
- package/lib/module/authoring/ElementPickerOverlay.js +485 -0
- package/lib/module/authoring/ElementPickerOverlay.js.map +1 -0
- package/lib/module/authoring/capturePickerScreenshot.js +68 -0
- package/lib/module/authoring/capturePickerScreenshot.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeBarTransition.js +88 -0
- package/lib/module/authoring/chrome/ChromeBarTransition.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeBottomSheet.js +59 -0
- package/lib/module/authoring/chrome/ChromeBottomSheet.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeButton.js +89 -0
- package/lib/module/authoring/chrome/ChromeButton.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeDialog.js +126 -0
- package/lib/module/authoring/chrome/ChromeDialog.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeIcon.js +33 -0
- package/lib/module/authoring/chrome/ChromeIcon.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeTooltip.js +82 -0
- package/lib/module/authoring/chrome/ChromeTooltip.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeTopBar.js +104 -0
- package/lib/module/authoring/chrome/ChromeTopBar.js.map +1 -0
- package/lib/module/authoring/chrome/DoubleTapBridge.js +52 -0
- package/lib/module/authoring/chrome/DoubleTapBridge.js.map +1 -0
- package/lib/module/authoring/chrome/doubleTapMonitor.js +75 -0
- package/lib/module/authoring/chrome/doubleTapMonitor.js.map +1 -0
- package/lib/module/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-rotate-left.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
- package/lib/module/authoring/chrome/icons/userflow-logomark.png +0 -0
- package/lib/module/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
- package/lib/module/authoring/chrome/icons/xmark.png +0 -0
- package/lib/module/authoring/chrome/icons/xmark@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/xmark@3x.png +0 -0
- package/lib/module/authoring/chrome/tokens.js +146 -0
- package/lib/module/authoring/chrome/tokens.js.map +1 -0
- package/lib/module/authoring/doubleTap.js +18 -0
- package/lib/module/authoring/doubleTap.js.map +1 -0
- package/lib/module/authoring/elementPickerController.js +97 -0
- package/lib/module/authoring/elementPickerController.js.map +1 -0
- package/lib/module/authoring/fingerprintFromInstance.js +187 -0
- package/lib/module/authoring/fingerprintFromInstance.js.map +1 -0
- package/lib/module/authoring/hitTest.js +100 -0
- package/lib/module/authoring/hitTest.js.map +1 -0
- package/lib/module/content/RichContentRenderer.js +12 -2
- package/lib/module/content/RichContentRenderer.js.map +1 -1
- package/lib/module/content/StepButton.js +19 -4
- package/lib/module/content/StepButton.js.map +1 -1
- package/lib/module/content/resolveStepButtonChrome.js +8 -6
- package/lib/module/content/resolveStepButtonChrome.js.map +1 -1
- package/lib/module/content/themeColor.js +10 -0
- package/lib/module/content/themeColor.js.map +1 -1
- package/lib/module/deviceContext.js +142 -0
- package/lib/module/deviceContext.js.map +1 -0
- package/lib/module/expo-router/useUserflowExpoRouter.js +42 -6
- package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -1
- package/lib/module/hostAppVersion.js +225 -0
- package/lib/module/hostAppVersion.js.map +1 -0
- package/lib/module/index.js +119 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/lifecycle.js +2 -0
- package/lib/module/lifecycle.js.map +1 -1
- package/lib/module/navigation/WithUserflowReactNavigation.js +18 -9
- package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -1
- package/lib/module/navigation/isOverlayPresentation.js +58 -0
- package/lib/module/navigation/isOverlayPresentation.js.map +1 -0
- package/lib/module/pairing/PairingController.js +30 -3
- package/lib/module/pairing/PairingController.js.map +1 -1
- package/lib/module/pairing/PreviewModeBanner.js +212 -85
- package/lib/module/pairing/PreviewModeBanner.js.map +1 -1
- package/lib/module/pairing/diagnostics.js +8 -0
- package/lib/module/pairing/diagnostics.js.map +1 -1
- package/lib/module/pairing/elementPickerRelay.js +87 -0
- package/lib/module/pairing/elementPickerRelay.js.map +1 -0
- package/lib/module/pairing/resolvePreviewChrome.js +48 -0
- package/lib/module/pairing/resolvePreviewChrome.js.map +1 -0
- package/lib/module/pairing/tokenStorage.js +24 -2
- package/lib/module/pairing/tokenStorage.js.map +1 -1
- package/lib/module/pairing/usePairingState.js +3 -1
- package/lib/module/pairing/usePairingState.js.map +1 -1
- package/lib/module/runtime/FlowRenderer.js +45 -21
- package/lib/module/runtime/FlowRenderer.js.map +1 -1
- package/lib/module/runtime/FlowSurfaceFade.js +49 -26
- package/lib/module/runtime/FlowSurfaceFade.js.map +1 -1
- package/lib/module/runtime/TargetPressBridge.js +12 -43
- package/lib/module/runtime/TargetPressBridge.js.map +1 -1
- package/lib/module/runtime/UserflowProvider.js +74 -20
- package/lib/module/runtime/UserflowProvider.js.map +1 -1
- package/lib/module/runtime/changedTouchPoints.js +43 -0
- package/lib/module/runtime/changedTouchPoints.js.map +1 -0
- package/lib/module/runtime/flowEngine.js +3 -1
- package/lib/module/runtime/flowEngine.js.map +1 -1
- package/lib/module/runtime/flowSessionViewState.js +32 -7
- package/lib/module/runtime/flowSessionViewState.js.map +1 -1
- package/lib/module/runtime/useFlowSessionState.js +2 -1
- package/lib/module/runtime/useFlowSessionState.js.map +1 -1
- package/lib/module/screenTracker.js +42 -4
- package/lib/module/screenTracker.js.map +1 -1
- package/lib/module/surfaces/CardFade.js +26 -0
- package/lib/module/surfaces/CardFade.js.map +1 -0
- package/lib/module/surfaces/CloseButton.js +10 -6
- package/lib/module/surfaces/CloseButton.js.map +1 -1
- package/lib/module/surfaces/ModalSurface.js +52 -36
- package/lib/module/surfaces/ModalSurface.js.map +1 -1
- package/lib/module/surfaces/TooltipSurface.js +368 -90
- package/lib/module/surfaces/TooltipSurface.js.map +1 -1
- package/lib/module/surfaces/cardTransition.js +64 -0
- package/lib/module/surfaces/cardTransition.js.map +1 -0
- package/lib/module/surfaces/resolveHighlightChrome.js +102 -0
- package/lib/module/surfaces/resolveHighlightChrome.js.map +1 -0
- package/lib/module/surfaces/resolveModalLayout.js +7 -3
- package/lib/module/surfaces/resolveModalLayout.js.map +1 -1
- package/lib/module/surfaces/resolveTooltipLayout.js +1 -4
- package/lib/module/surfaces/resolveTooltipLayout.js.map +1 -1
- package/lib/module/surfaces/surfaceInteractionConfig.js +27 -0
- package/lib/module/surfaces/surfaceInteractionConfig.js.map +1 -0
- package/lib/module/surfaces/surfaceLayoutInsets.js +119 -0
- package/lib/module/surfaces/surfaceLayoutInsets.js.map +1 -0
- package/lib/module/surfaces/themeChrome.js +3 -1
- package/lib/module/surfaces/themeChrome.js.map +1 -1
- package/lib/module/surfaces/tooltip/TooltipBubble.js +143 -22
- package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -1
- package/lib/module/surfaces/tooltip/TooltipCutout.js +100 -47
- package/lib/module/surfaces/tooltip/TooltipCutout.js.map +1 -1
- package/lib/module/surfaces/tooltip/TooltipHighlight.js +118 -0
- package/lib/module/surfaces/tooltip/TooltipHighlight.js.map +1 -0
- package/lib/module/surfaces/tooltip/computeTooltipPosition.js +67 -13
- package/lib/module/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
- package/lib/module/surfaces/tooltip/inferTooltipPlacement.js +87 -19
- package/lib/module/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
- package/lib/module/surfaces/tooltip/placementDiagnostics.js +43 -0
- package/lib/module/surfaces/tooltip/placementDiagnostics.js.map +1 -0
- package/lib/module/surfaces/tooltip/rect.js +11 -0
- package/lib/module/surfaces/tooltip/rect.js.map +1 -1
- package/lib/module/surfaces/tooltip/resolveSideCardWidth.js +96 -0
- package/lib/module/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +26 -0
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts +2 -0
- package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts +14 -10
- package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +42 -1
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts +42 -0
- package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts +17 -0
- package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts +20 -0
- package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +5 -5
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
- package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +48 -0
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts +7 -0
- package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts +11 -0
- package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts +20 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts +14 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts +13 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
- package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
- package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts +141 -0
- package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts +14 -0
- package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts +59 -0
- package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts +26 -0
- package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/hitTest.d.ts +31 -0
- package/lib/typescript/commonjs/src/authoring/hitTest.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts +6 -1
- package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/StepButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/resolveStepButtonChrome.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/themeColor.d.ts +5 -0
- package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/deviceContext.d.ts +66 -0
- package/lib/typescript/commonjs/src/deviceContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hostAppVersion.d.ts +69 -0
- package/lib/typescript/commonjs/src/hostAppVersion.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +53 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/lifecycle.d.ts +6 -0
- package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts +14 -0
- package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +7 -0
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +6 -1
- package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +5 -0
- package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts +11 -0
- package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts +16 -0
- package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +2 -0
- package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts +6 -3
- package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts +20 -7
- package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +5 -1
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +6 -4
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts +10 -0
- package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts +12 -3
- package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts +1 -0
- package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/screenTracker.d.ts +21 -3
- package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts +12 -0
- package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts +8 -2
- package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +1 -1
- package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts +1 -1
- package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +12 -1
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts +31 -0
- package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts +44 -0
- package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts +1 -1
- package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts +0 -7
- package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
- package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
- package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts +3 -1
- package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts +2 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/version.d.ts +1 -1
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +26 -0
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts +2 -0
- package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts +14 -10
- package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
- package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
- package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +42 -1
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts +42 -0
- package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts +17 -0
- package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts +20 -0
- package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +5 -5
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
- package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +48 -0
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts +7 -0
- package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts +11 -0
- package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts +20 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts +14 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts +13 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
- package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
- package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/tokens.d.ts +141 -0
- package/lib/typescript/module/src/authoring/chrome/tokens.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/doubleTap.d.ts +14 -0
- package/lib/typescript/module/src/authoring/doubleTap.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/elementPickerController.d.ts +59 -0
- package/lib/typescript/module/src/authoring/elementPickerController.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts +26 -0
- package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/hitTest.d.ts +31 -0
- package/lib/typescript/module/src/authoring/hitTest.d.ts.map +1 -0
- package/lib/typescript/module/src/content/RichContentRenderer.d.ts +6 -1
- package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -1
- package/lib/typescript/module/src/content/StepButton.d.ts.map +1 -1
- package/lib/typescript/module/src/content/resolveStepButtonChrome.d.ts.map +1 -1
- package/lib/typescript/module/src/content/themeColor.d.ts +5 -0
- package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -1
- package/lib/typescript/module/src/deviceContext.d.ts +66 -0
- package/lib/typescript/module/src/deviceContext.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
- package/lib/typescript/module/src/hostAppVersion.d.ts +69 -0
- package/lib/typescript/module/src/hostAppVersion.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +53 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/lifecycle.d.ts +6 -0
- package/lib/typescript/module/src/lifecycle.d.ts.map +1 -1
- package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
- package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts +14 -0
- package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/PairingController.d.ts +7 -0
- package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +6 -1
- package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/diagnostics.d.ts +5 -0
- package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts +11 -0
- package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts +16 -0
- package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/tokenStorage.d.ts +2 -0
- package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/FlowRenderer.d.ts +6 -3
- package/lib/typescript/module/src/runtime/FlowRenderer.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts +20 -7
- package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +5 -1
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +6 -4
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts +10 -0
- package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts +12 -3
- package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts +1 -0
- package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts.map +1 -1
- package/lib/typescript/module/src/screenTracker.d.ts +21 -3
- package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/CardFade.d.ts +12 -0
- package/lib/typescript/module/src/surfaces/CardFade.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/CloseButton.d.ts +8 -2
- package/lib/typescript/module/src/surfaces/CloseButton.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +1 -1
- package/lib/typescript/module/src/surfaces/ModalSurface.d.ts +1 -1
- package/lib/typescript/module/src/surfaces/ModalSurface.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +12 -1
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/cardTransition.d.ts +31 -0
- package/lib/typescript/module/src/surfaces/cardTransition.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts +44 -0
- package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts +1 -1
- package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts +0 -7
- package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
- package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
- package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/themeChrome.d.ts +3 -1
- package/lib/typescript/module/src/surfaces/themeChrome.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
- package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
- package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
- package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
- package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
- package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts +2 -0
- package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
- package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
- package/lib/typescript/module/src/version.d.ts +1 -1
- package/package.json +22 -16
- package/src/anchors/AutoAnchorRegistry.ts +139 -2
- package/src/anchors/anchorChangeTicker.ts +10 -0
- package/src/anchors/elementConditionEvaluator.ts +29 -16
- package/src/anchors/fiber/FiberScanRoot.tsx +2 -50
- package/src/anchors/fiber/FiberScanRootStore.ts +51 -0
- package/src/anchors/fiber/fiberInternals.ts +166 -3
- package/src/anchors/fiber/indexHostFibers.ts +136 -0
- package/src/anchors/fiber/readHostContent.ts +146 -0
- package/src/anchors/fiberAnchorCache.ts +45 -0
- package/src/anchors/resolveAnchorHost.ts +23 -23
- package/src/anchors/resolveAutoAnchorHost.ts +180 -0
- package/src/anchors/semanticMatcher.ts +361 -0
- package/src/authoring/ElementPickerOverlay.tsx +553 -0
- package/src/authoring/capturePickerScreenshot.ts +90 -0
- package/src/authoring/chrome/ChromeBarTransition.tsx +106 -0
- package/src/authoring/chrome/ChromeBottomSheet.tsx +69 -0
- package/src/authoring/chrome/ChromeButton.tsx +103 -0
- package/src/authoring/chrome/ChromeDialog.tsx +121 -0
- package/src/authoring/chrome/ChromeIcon.tsx +40 -0
- package/src/authoring/chrome/ChromeTooltip.tsx +89 -0
- package/src/authoring/chrome/ChromeTopBar.tsx +126 -0
- package/src/authoring/chrome/DoubleTapBridge.tsx +60 -0
- package/src/authoring/chrome/doubleTapMonitor.ts +80 -0
- package/src/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
- package/src/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
- package/src/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
- package/src/authoring/chrome/icons/arrow-rotate-left.png +0 -0
- package/src/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
- package/src/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
- package/src/authoring/chrome/icons/userflow-logomark.png +0 -0
- package/src/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
- package/src/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
- package/src/authoring/chrome/icons/xmark.png +0 -0
- package/src/authoring/chrome/icons/xmark@2x.png +0 -0
- package/src/authoring/chrome/icons/xmark@3x.png +0 -0
- package/src/authoring/chrome/tokens.ts +106 -0
- package/src/authoring/doubleTap.ts +27 -0
- package/src/authoring/elementPickerController.ts +135 -0
- package/src/authoring/fingerprintFromInstance.ts +152 -0
- package/src/authoring/hitTest.ts +133 -0
- package/src/content/RichContentRenderer.tsx +22 -1
- package/src/content/StepButton.tsx +17 -2
- package/src/content/resolveStepButtonChrome.ts +12 -6
- package/src/content/themeColor.ts +10 -0
- package/src/deviceContext.ts +168 -0
- package/src/expo-router/useUserflowExpoRouter.ts +47 -4
- package/src/hostAppVersion.ts +258 -0
- package/src/index.ts +148 -4
- package/src/lifecycle.ts +8 -0
- package/src/navigation/WithUserflowReactNavigation.tsx +23 -7
- package/src/navigation/isOverlayPresentation.ts +76 -0
- package/src/pairing/PairingController.ts +32 -3
- package/src/pairing/PreviewModeBanner.tsx +250 -94
- package/src/pairing/diagnostics.ts +8 -0
- package/src/pairing/elementPickerRelay.ts +100 -0
- package/src/pairing/resolvePreviewChrome.ts +57 -0
- package/src/pairing/tokenStorage.ts +31 -2
- package/src/pairing/usePairingState.ts +2 -0
- package/src/runtime/FlowRenderer.tsx +55 -27
- package/src/runtime/FlowSurfaceFade.tsx +51 -30
- package/src/runtime/TargetPressBridge.tsx +14 -32
- package/src/runtime/UserflowProvider.tsx +76 -13
- package/src/runtime/changedTouchPoints.ts +34 -0
- package/src/runtime/flowEngine.ts +2 -0
- package/src/runtime/flowSessionViewState.ts +42 -4
- package/src/runtime/useFlowSessionState.ts +2 -0
- package/src/screenTracker.ts +46 -4
- package/src/surfaces/CardFade.tsx +18 -0
- package/src/surfaces/CloseButton.tsx +17 -7
- package/src/surfaces/MadeWithUserflow.tsx +1 -1
- package/src/surfaces/ModalSurface.tsx +48 -35
- package/src/surfaces/TooltipSurface.tsx +406 -86
- package/src/surfaces/cardTransition.ts +67 -0
- package/src/surfaces/resolveHighlightChrome.ts +139 -0
- package/src/surfaces/resolveModalLayout.ts +16 -8
- package/src/surfaces/resolveTooltipLayout.ts +1 -14
- package/src/surfaces/surfaceInteractionConfig.ts +25 -0
- package/src/surfaces/surfaceLayoutInsets.tsx +135 -0
- package/src/surfaces/themeChrome.ts +5 -3
- package/src/surfaces/tooltip/TooltipBubble.tsx +154 -19
- package/src/surfaces/tooltip/TooltipCutout.tsx +106 -49
- package/src/surfaces/tooltip/TooltipHighlight.tsx +144 -0
- package/src/surfaces/tooltip/computeTooltipPosition.ts +98 -12
- package/src/surfaces/tooltip/inferTooltipPlacement.ts +107 -18
- package/src/surfaces/tooltip/placementDiagnostics.ts +70 -0
- package/src/surfaces/tooltip/rect.ts +11 -0
- package/src/surfaces/tooltip/resolveSideCardWidth.ts +121 -0
- package/src/version.ts +1 -1
- package/vendor/core/dist/attributes.d.ts +1 -2
- package/vendor/core/dist/attributes.d.ts.map +1 -1
- package/vendor/core/dist/attributes.js.map +1 -1
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts +69 -1
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/FlowSessionEngine.js +268 -7
- package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.d.ts +44 -1
- package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.js +103 -9
- package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
- package/vendor/core/dist/engine/UserflowCore.d.ts +23 -4
- package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -1
- package/vendor/core/dist/engine/UserflowCore.js +64 -1
- package/vendor/core/dist/engine/UserflowCore.js.map +1 -1
- package/vendor/core/dist/engine/conditionOperators.d.ts +16 -0
- package/vendor/core/dist/engine/conditionOperators.d.ts.map +1 -0
- package/vendor/core/dist/engine/conditionOperators.js +168 -0
- package/vendor/core/dist/engine/conditionOperators.js.map +1 -0
- package/vendor/core/dist/engine/handleActions.d.ts +27 -4
- package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
- package/vendor/core/dist/engine/handleActions.js +140 -13
- package/vendor/core/dist/engine/handleActions.js.map +1 -1
- package/vendor/core/dist/engine/simpleObservable.d.ts +13 -0
- package/vendor/core/dist/engine/simpleObservable.d.ts.map +1 -0
- package/vendor/core/dist/engine/simpleObservable.js +29 -0
- package/vendor/core/dist/engine/simpleObservable.js.map +1 -0
- package/vendor/core/dist/engine/trackCondition.d.ts +25 -0
- package/vendor/core/dist/engine/trackCondition.d.ts.map +1 -0
- package/vendor/core/dist/engine/trackCondition.js +177 -0
- package/vendor/core/dist/engine/trackCondition.js.map +1 -0
- package/vendor/core/dist/engine/trackStepTriggers.d.ts +21 -0
- package/vendor/core/dist/engine/trackStepTriggers.d.ts.map +1 -0
- package/vendor/core/dist/engine/trackStepTriggers.js +49 -0
- package/vendor/core/dist/engine/trackStepTriggers.js.map +1 -0
- package/vendor/core/dist/index.d.ts +4 -3
- package/vendor/core/dist/index.d.ts.map +1 -1
- package/vendor/core/dist/index.js +2 -1
- package/vendor/core/dist/index.js.map +1 -1
- package/vendor/core/dist/normalizeAttributes.d.ts +8 -0
- package/vendor/core/dist/normalizeAttributes.d.ts.map +1 -0
- package/vendor/core/dist/normalizeAttributes.js +127 -0
- package/vendor/core/dist/normalizeAttributes.js.map +1 -0
- package/vendor/core/dist/transport/phoenix.d.ts +11 -6
- package/vendor/core/dist/transport/phoenix.d.ts.map +1 -1
- package/vendor/core/dist/transport/phoenix.js +59 -5
- package/vendor/core/dist/transport/phoenix.js.map +1 -1
- package/vendor/core/dist/types.d.ts +26 -1
- package/vendor/core/dist/types.d.ts.map +1 -1
- package/vendor/core/dist/version.d.ts +1 -1
- package/vendor/core/dist/version.js +1 -1
- package/vendor/core/package.json +1 -1
- package/vendor/protocol/dist/attributes.d.ts +43 -0
- package/vendor/protocol/dist/attributes.d.ts.map +1 -0
- package/vendor/protocol/dist/attributes.js +15 -0
- package/vendor/protocol/dist/attributes.js.map +1 -0
- package/vendor/protocol/dist/autoData.d.ts +2 -2
- package/vendor/protocol/dist/autoData.js +2 -2
- package/vendor/protocol/dist/events.d.ts +8 -0
- package/vendor/protocol/dist/events.d.ts.map +1 -1
- package/vendor/protocol/dist/flows.d.ts +66 -4
- package/vendor/protocol/dist/flows.d.ts.map +1 -1
- package/vendor/protocol/dist/flows.js +50 -3
- package/vendor/protocol/dist/flows.js.map +1 -1
- package/vendor/protocol/dist/index.d.ts +1 -0
- package/vendor/protocol/dist/index.d.ts.map +1 -1
- package/vendor/protocol/dist/index.js +1 -0
- package/vendor/protocol/dist/index.js.map +1 -1
- package/vendor/protocol/dist/messages.d.ts +25 -4
- package/vendor/protocol/dist/messages.d.ts.map +1 -1
- package/vendor/protocol/dist/messages.js +4 -0
- package/vendor/protocol/dist/messages.js.map +1 -1
- package/vendor/protocol/dist/pairing.d.ts +26 -0
- package/vendor/protocol/dist/pairing.d.ts.map +1 -1
- package/vendor/protocol/dist/pairing.js.map +1 -1
- package/vendor/protocol/package.json +1 -1
|
@@ -7,7 +7,18 @@ const IDLE_STATE = {
|
|
|
7
7
|
lastError: null,
|
|
8
8
|
needsRescan: false,
|
|
9
9
|
awaitingStartCondition: false,
|
|
10
|
+
canRestartPreview: false,
|
|
11
|
+
previewRestartGeneration: 0,
|
|
10
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* True when a pairing `push` reached the socket but the server ack timed out.
|
|
15
|
+
* Relayed events are delivered via broadcast; a missing ack is not a lost send.
|
|
16
|
+
* {@link PairingEngine.sendRelay} rejects with this for `UserflowAuthError`
|
|
17
|
+
* messages containing `reply timed out`. Connection failures do not match.
|
|
18
|
+
*/
|
|
19
|
+
export function isPairingPushAckTimeout(error) {
|
|
20
|
+
return error instanceof Error && error.message.includes('reply timed out');
|
|
21
|
+
}
|
|
11
22
|
/**
|
|
12
23
|
* Orchestrates a pairing session: connect/join the pairing socket, bridge
|
|
13
24
|
* `startFlowWithToken` onto the end-user channel, and expose preview-mode state.
|
|
@@ -18,7 +29,10 @@ export class PairingEngine {
|
|
|
18
29
|
this.unsubscribe = null;
|
|
19
30
|
this.state = { ...IDLE_STATE };
|
|
20
31
|
this.listeners = new Set();
|
|
32
|
+
this.relayListeners = new Set();
|
|
21
33
|
this.pendingStartTokens = [];
|
|
34
|
+
/** Last successfully delivered preview start; replayed by {@link restartPreview}. */
|
|
35
|
+
this.lastStartPayload = null;
|
|
22
36
|
/** True while the server is waiting on a start condition (see TestStartCondition). */
|
|
23
37
|
this.testingStartCondition = false;
|
|
24
38
|
this.startConditionUnsub = null;
|
|
@@ -36,13 +50,36 @@ export class PairingEngine {
|
|
|
36
50
|
this.listeners.delete(listener);
|
|
37
51
|
};
|
|
38
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Subscribe to inbound pairing-channel relay events (`selectElement`,
|
|
55
|
+
* `screenshot`, …). `startFlowWithToken` is still handled internally; it is
|
|
56
|
+
* also forwarded here so consumers can ignore it.
|
|
57
|
+
*/
|
|
58
|
+
onRelay(handler) {
|
|
59
|
+
this.relayListeners.add(handler);
|
|
60
|
+
return () => {
|
|
61
|
+
this.relayListeners.delete(handler);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Push a relay event to the builder (e.g. `selectElementResult`).
|
|
66
|
+
* Rejects when there is no connection (`Not connected to a pairing channel`)
|
|
67
|
+
* or the websocket is closed. A `reply timed out` rejection means the frame
|
|
68
|
+
* was sent; use {@link isPairingPushAckTimeout} to ignore those acks.
|
|
69
|
+
*/
|
|
70
|
+
sendRelay(event, payload) {
|
|
71
|
+
if (!this.connection) {
|
|
72
|
+
return Promise.reject(new Error('Not connected to a pairing channel'));
|
|
73
|
+
}
|
|
74
|
+
return this.connection.push(event, payload);
|
|
75
|
+
}
|
|
39
76
|
/**
|
|
40
77
|
* Begin (or replace) a pairing session with a JWT from a deep link.
|
|
41
78
|
* Closes any existing pairing websocket first (warm re-scan).
|
|
42
79
|
*/
|
|
43
80
|
async start(pairingToken) {
|
|
44
81
|
this.teardownConnection();
|
|
45
|
-
this.
|
|
82
|
+
this.clearStartCache();
|
|
46
83
|
// A re-scan is a new session: stop tracking the previous one's condition.
|
|
47
84
|
this.testingStartCondition = false;
|
|
48
85
|
this.unwatchStartCondition();
|
|
@@ -54,6 +91,7 @@ export class PairingEngine {
|
|
|
54
91
|
lastError: null,
|
|
55
92
|
needsRescan: false,
|
|
56
93
|
awaitingStartCondition: false,
|
|
94
|
+
previewRestartGeneration: 0,
|
|
57
95
|
});
|
|
58
96
|
const options = this.deps.pairingOptions ?? {};
|
|
59
97
|
const connection = (this.deps.createConnection ?? ((opts) => new PairingConnection(opts)))(options);
|
|
@@ -78,9 +116,37 @@ export class PairingEngine {
|
|
|
78
116
|
throw error;
|
|
79
117
|
}
|
|
80
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Re-deliver the last successful `startFlowWithToken` payload on the end-user
|
|
121
|
+
* channel. Does not ack the builder — that listener is keyed to the original
|
|
122
|
+
* Preview-dialog `idempotency_key`.
|
|
123
|
+
*/
|
|
124
|
+
async restartPreview() {
|
|
125
|
+
const payload = this.lastStartPayload;
|
|
126
|
+
if (!payload || !this.connection || this.state.status !== 'connected')
|
|
127
|
+
return false;
|
|
128
|
+
if (!this.deps.isIdentified())
|
|
129
|
+
return false;
|
|
130
|
+
// Bump before the send so RN can disarm tooltip resolve while the Restart
|
|
131
|
+
// dialog tears down. Roll back if the send fails so a dead channel does not
|
|
132
|
+
// leave targeting in a reset that never gets a new start.
|
|
133
|
+
const nextGeneration = this.state.previewRestartGeneration + 1;
|
|
134
|
+
this.setState({
|
|
135
|
+
...this.state,
|
|
136
|
+
previewRestartGeneration: nextGeneration,
|
|
137
|
+
});
|
|
138
|
+
const delivered = await this.deliverStartFlowWithToken(payload, { ackBuilder: false });
|
|
139
|
+
if (!delivered && this.state.previewRestartGeneration === nextGeneration) {
|
|
140
|
+
this.setState({
|
|
141
|
+
...this.state,
|
|
142
|
+
previewRestartGeneration: nextGeneration - 1,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return delivered;
|
|
146
|
+
}
|
|
81
147
|
/** Exit preview: disconnect pairing and clear queued preview tokens. */
|
|
82
148
|
stop() {
|
|
83
|
-
this.
|
|
149
|
+
this.clearStartCache();
|
|
84
150
|
// Web sends TestStartConditionCancel when leaving start-condition testing so
|
|
85
151
|
// the server stops waiting on the draft flow. Best-effort: the channel may
|
|
86
152
|
// already be gone, and teardown must not reject.
|
|
@@ -168,7 +234,7 @@ export class PairingEngine {
|
|
|
168
234
|
});
|
|
169
235
|
break;
|
|
170
236
|
case 'token_expired':
|
|
171
|
-
this.
|
|
237
|
+
this.clearStartCache();
|
|
172
238
|
this.setState({
|
|
173
239
|
...this.state,
|
|
174
240
|
status: 'token_expired',
|
|
@@ -179,6 +245,7 @@ export class PairingEngine {
|
|
|
179
245
|
this.teardownConnection();
|
|
180
246
|
break;
|
|
181
247
|
case 'device_already_paired':
|
|
248
|
+
this.clearStartCache();
|
|
182
249
|
this.setState({
|
|
183
250
|
...this.state,
|
|
184
251
|
status: 'device_already_paired',
|
|
@@ -189,6 +256,7 @@ export class PairingEngine {
|
|
|
189
256
|
this.teardownConnection();
|
|
190
257
|
break;
|
|
191
258
|
case 'join_error':
|
|
259
|
+
this.clearStartCache();
|
|
192
260
|
this.setState({
|
|
193
261
|
...this.state,
|
|
194
262
|
status: 'error',
|
|
@@ -201,7 +269,7 @@ export class PairingEngine {
|
|
|
201
269
|
void this.handleStartFlowWithToken(event.payload);
|
|
202
270
|
break;
|
|
203
271
|
case 'relay':
|
|
204
|
-
|
|
272
|
+
this.emitRelay(event.event, event.payload);
|
|
205
273
|
break;
|
|
206
274
|
default:
|
|
207
275
|
break;
|
|
@@ -236,12 +304,13 @@ export class PairingEngine {
|
|
|
236
304
|
await this.deliverStartFlowWithToken(payload);
|
|
237
305
|
}
|
|
238
306
|
}
|
|
239
|
-
async deliverStartFlowWithToken(payload) {
|
|
307
|
+
async deliverStartFlowWithToken(payload, options = {}) {
|
|
240
308
|
// Mirrors web `userflow-client.ts`: testing a start condition is handled
|
|
241
309
|
// differently from starting the draft flow immediately. `StartFlowWithToken`
|
|
242
310
|
// force-starts server-side (no condition check), so honoring this flag is
|
|
243
311
|
// what makes "when auto start conditions are triggered" actually wait.
|
|
244
312
|
const testStartCondition = payload.testStartCondition === true;
|
|
313
|
+
const ackBuilder = options.ackBuilder !== false;
|
|
245
314
|
try {
|
|
246
315
|
await this.deps.sendClientMessage(testStartCondition
|
|
247
316
|
? { kind: 'TestStartCondition', token: payload.token }
|
|
@@ -251,22 +320,33 @@ export class PairingEngine {
|
|
|
251
320
|
this.watchStartCondition();
|
|
252
321
|
else
|
|
253
322
|
this.unwatchStartCondition();
|
|
323
|
+
this.lastStartPayload = payload;
|
|
254
324
|
// Preview is live either way, but a tested condition has not fired yet.
|
|
255
325
|
this.setState({
|
|
256
326
|
...this.state,
|
|
257
327
|
previewActive: true,
|
|
258
328
|
awaitingStartCondition: testStartCondition,
|
|
259
329
|
});
|
|
260
|
-
|
|
330
|
+
if (ackBuilder) {
|
|
331
|
+
await this.pushStartResult(true, undefined, payload.idempotency_key);
|
|
332
|
+
}
|
|
333
|
+
return true;
|
|
261
334
|
}
|
|
262
335
|
catch (error) {
|
|
263
336
|
const fallback = testStartCondition
|
|
264
337
|
? 'TestStartCondition failed'
|
|
265
338
|
: 'StartFlowWithToken failed';
|
|
266
339
|
const message = error instanceof Error ? error.message : fallback;
|
|
267
|
-
|
|
340
|
+
if (ackBuilder) {
|
|
341
|
+
await this.pushStartResult(false, message, payload.idempotency_key);
|
|
342
|
+
}
|
|
343
|
+
return false;
|
|
268
344
|
}
|
|
269
345
|
}
|
|
346
|
+
clearStartCache() {
|
|
347
|
+
this.lastStartPayload = null;
|
|
348
|
+
this.pendingStartTokens = [];
|
|
349
|
+
}
|
|
270
350
|
async pushStartResult(ok, error, idempotencyKey) {
|
|
271
351
|
if (!this.connection)
|
|
272
352
|
return;
|
|
@@ -287,11 +367,25 @@ export class PairingEngine {
|
|
|
287
367
|
this.connection?.disconnect({ emitState: false });
|
|
288
368
|
this.connection = null;
|
|
289
369
|
}
|
|
370
|
+
emitRelay(event, payload) {
|
|
371
|
+
for (const handler of this.relayListeners) {
|
|
372
|
+
try {
|
|
373
|
+
handler(event, payload);
|
|
374
|
+
}
|
|
375
|
+
catch {
|
|
376
|
+
// ignore
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
290
380
|
setState(next) {
|
|
291
|
-
this.state =
|
|
381
|
+
this.state = {
|
|
382
|
+
...next,
|
|
383
|
+
previewRestartGeneration: next.previewRestartGeneration ?? this.state.previewRestartGeneration,
|
|
384
|
+
canRestartPreview: this.lastStartPayload != null && next.status === 'connected',
|
|
385
|
+
};
|
|
292
386
|
for (const listener of this.listeners) {
|
|
293
387
|
try {
|
|
294
|
-
listener({ ...
|
|
388
|
+
listener({ ...this.state });
|
|
295
389
|
}
|
|
296
390
|
catch {
|
|
297
391
|
// ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PairingEngine.js","sourceRoot":"","sources":["../../src/engine/PairingEngine.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,iBAAiB,GAGlB,MAAM,yBAAyB,CAAC;AAgDjC,MAAM,UAAU,GAAuB;IACrC,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,KAAK;IAClB,sBAAsB,EAAE,KAAK;CAC9B,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,aAAa;IAWxB,YAAY,IAAuB;QAV3B,eAAU,GAA6B,IAAI,CAAC;QAC5C,gBAAW,GAAwB,IAAI,CAAC;QACxC,UAAK,GAAuB,EAAE,GAAG,UAAU,EAAE,CAAC;QACrC,cAAS,GAAG,IAAI,GAAG,EAAyB,CAAC;QACtD,uBAAkB,GAAqC,EAAE,CAAC;QAClE,sFAAsF;QAC9E,0BAAqB,GAAG,KAAK,CAAC;QAC9B,wBAAmB,GAAwB,IAAI,CAAC;QAItD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;IAClC,CAAC;IAED,aAAa,CAAC,QAA+B;QAC3C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,SAAS,CAAC,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cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC7E,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACP,8BAA8B;QAChC,CAAC;IACH,CAAC;IAEO,kBAAkB;QACxB,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAEO,SAAS,CAAC,KAAwB,EAAE,OAAgB;QAC1D,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YAC1C,IAAI,CAAC;gBACH,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC1B,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC;IACH,CAAC;IAEO,QAAQ,CACd,IAEC;QAED,IAAI,CAAC,KAAK,GAAG;YACX,GAAG,IAAI;YACP,wBAAwB,EACtB,IAAI,CAAC,wBAAwB,IAAI,IAAI,CAAC,KAAK,CAAC,wBAAwB;YACtE,iBAAiB,EAAE,IAAI,CAAC,gBAAgB,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,WAAW;SAChF,CAAC;QACF,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,IAAI,CAAC;gBACH,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;YAC9B,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ClientContext, ClientLocationUpdate, ClientMessage, JoinPayloadClientCondition, ServerMessage, UserflowAttributes } from '@userflow-tech/protocol';
|
|
1
|
+
import type { Attributes, ClientContext, ClientLocationUpdate, ClientMessage, JoinPayloadClientCondition, ServerMessage, UserflowAttributes } from '@userflow-tech/protocol';
|
|
2
2
|
import type { ServerMessageHandler } from '../transport/phoenix.js';
|
|
3
|
-
import type { UserflowConfig, UserflowGroupOptions, UserflowIdentifyOptions, UserflowInitOptions, UserflowEventAttributes, UserflowTrackOptions } from '../types.js';
|
|
3
|
+
import type { PublicAttributes, UserflowConfig, UserflowGroupOptions, UserflowIdentifyOptions, UserflowInitOptions, UserflowEventAttributes, UserflowTrackOptions, UserflowUpdateGroupOptions } from '../types.js';
|
|
4
4
|
/** Overridable engine dependencies; production defaults use the Phoenix transport. */
|
|
5
5
|
export interface UserflowCoreDeps {
|
|
6
6
|
validate?: ValidateCredentialsFn;
|
|
@@ -9,14 +9,16 @@ export interface UserflowCoreDeps {
|
|
|
9
9
|
export interface UpsertGroupPayload {
|
|
10
10
|
groupExternalId: string;
|
|
11
11
|
groupSignature: string | null;
|
|
12
|
-
groupAttributes:
|
|
13
|
-
membershipAttributes:
|
|
12
|
+
groupAttributes: Attributes;
|
|
13
|
+
membershipAttributes: Attributes;
|
|
14
14
|
}
|
|
15
15
|
/** The subset of the transport the engine depends on (injectable for tests). */
|
|
16
16
|
export interface UserflowConnection {
|
|
17
17
|
identify(userId: string, attributes: UserflowAttributes, signature?: string | null): Promise<void>;
|
|
18
18
|
ensureEndUserChannel(userId: string, signature?: string | null): Promise<void>;
|
|
19
19
|
group(payload: UpsertGroupPayload): Promise<void>;
|
|
20
|
+
/** Push `UpsertUser` on an already-joined channel (no re-identify). */
|
|
21
|
+
updateUser(attributes: Attributes): Promise<void>;
|
|
20
22
|
send(message: ClientMessage): Promise<void>;
|
|
21
23
|
updateClientContext(clientContext: ClientContext): Promise<void>;
|
|
22
24
|
setClientContext(clientContext: ClientContext): void;
|
|
@@ -44,6 +46,8 @@ export declare class UserflowCore {
|
|
|
44
46
|
private connection;
|
|
45
47
|
private userId;
|
|
46
48
|
private identitySignature;
|
|
49
|
+
private groupId;
|
|
50
|
+
private groupSignature;
|
|
47
51
|
private attributes;
|
|
48
52
|
private clientContext;
|
|
49
53
|
private initPromise;
|
|
@@ -53,6 +57,17 @@ export declare class UserflowCore {
|
|
|
53
57
|
init(options: UserflowInitOptions): Promise<UserflowConfig>;
|
|
54
58
|
identify(userId: string, attributes?: UserflowAttributes, options?: UserflowIdentifyOptions): Promise<void>;
|
|
55
59
|
group(groupId: string | number, attributes?: UserflowAttributes, options?: UserflowGroupOptions): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Upsert attributes for the current user without re-identifying.
|
|
62
|
+
* Requires a prior {@link identify}. Used by flow `SET_ATTRIBUTE` actions.
|
|
63
|
+
*/
|
|
64
|
+
updateUser(attributes?: PublicAttributes): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Upsert attributes for the current group / membership without re-grouping.
|
|
67
|
+
* Requires a prior {@link group}. Used by flow `SET_ATTRIBUTE` actions
|
|
68
|
+
* whose FQN is `group/…` or `group_membership/…`.
|
|
69
|
+
*/
|
|
70
|
+
updateGroup(attributes?: PublicAttributes, options?: UserflowUpdateGroupOptions): Promise<void>;
|
|
56
71
|
track(name: string, attributes?: UserflowEventAttributes, options?: UserflowTrackOptions): Promise<void>;
|
|
57
72
|
getUserId(): string | null;
|
|
58
73
|
getAttributes(): UserflowAttributes;
|
|
@@ -121,6 +136,10 @@ export declare class UserflowCore {
|
|
|
121
136
|
private requireIdentified;
|
|
122
137
|
private doIdentify;
|
|
123
138
|
private doGroup;
|
|
139
|
+
private requireIdentifiedFor;
|
|
140
|
+
private requireGroup;
|
|
141
|
+
private doUpdateUser;
|
|
142
|
+
private doUpdateGroup;
|
|
124
143
|
private doTrack;
|
|
125
144
|
}
|
|
126
145
|
//# sourceMappingURL=UserflowCore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserflowCore.d.ts","sourceRoot":"","sources":["../../src/engine/UserflowCore.ts"],"names":[],"mappings":"AAAA,OA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,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,GAAG,MAAM,IAAI;IAOtE;;;OAGG;IACH,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIpD;;;OAGG;IACH,mBAAmB,CAAC,gBAAgB,EAAE,0BAA0B,EAAE,GAAG,IAAI;IAIzE;;;;;;;;OAQG;IACG,YAAY,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BjE,sEAAsE;IACtE,KAAK,IAAI,IAAI;IAWb,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,mBAAmB;YAOb,MAAM;IAiBpB,OAAO,CAAC,iBAAiB;YAMX,UAAU;YA4BV,OAAO;IA6BrB,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,YAAY;YAQN,YAAY;YAaZ,aAAa;YAuBb,OAAO;CAsBtB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { assertValidAttributeNames, assertValidEventName } from '../attributes.js';
|
|
2
2
|
import { DEFAULT_SERVER_ENDPOINT } from '../constants.js';
|
|
3
|
-
import { normalizeTrackEventAttributes } from '../eventAttributes.js';
|
|
4
3
|
import { UserflowAuthError } from '../errors.js';
|
|
4
|
+
import { normalizeTrackEventAttributes } from '../eventAttributes.js';
|
|
5
|
+
import { normalizeAttributes } from '../normalizeAttributes.js';
|
|
5
6
|
import { PhoenixConnection, validateCredentials } from '../transport/phoenix.js';
|
|
6
7
|
const DEFAULT_CLIENT_CONTEXT = {
|
|
7
8
|
pageUrl: '',
|
|
@@ -24,6 +25,8 @@ export class UserflowCore {
|
|
|
24
25
|
this.connection = null;
|
|
25
26
|
this.userId = null;
|
|
26
27
|
this.identitySignature = null;
|
|
28
|
+
this.groupId = null;
|
|
29
|
+
this.groupSignature = null;
|
|
27
30
|
this.attributes = {};
|
|
28
31
|
this.clientContext = { ...DEFAULT_CLIENT_CONTEXT };
|
|
29
32
|
this.initPromise = null;
|
|
@@ -49,6 +52,21 @@ export class UserflowCore {
|
|
|
49
52
|
group(groupId, attributes = {}, options = {}) {
|
|
50
53
|
return this.doGroup(groupId, attributes, options);
|
|
51
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Upsert attributes for the current user without re-identifying.
|
|
57
|
+
* Requires a prior {@link identify}. Used by flow `SET_ATTRIBUTE` actions.
|
|
58
|
+
*/
|
|
59
|
+
updateUser(attributes = {}) {
|
|
60
|
+
return this.doUpdateUser(attributes);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Upsert attributes for the current group / membership without re-grouping.
|
|
64
|
+
* Requires a prior {@link group}. Used by flow `SET_ATTRIBUTE` actions
|
|
65
|
+
* whose FQN is `group/…` or `group_membership/…`.
|
|
66
|
+
*/
|
|
67
|
+
updateGroup(attributes = {}, options = {}) {
|
|
68
|
+
return this.doUpdateGroup(attributes, options);
|
|
69
|
+
}
|
|
52
70
|
track(name, attributes = {}, options = {}) {
|
|
53
71
|
return this.doTrack(name, attributes, options);
|
|
54
72
|
}
|
|
@@ -178,6 +196,8 @@ export class UserflowCore {
|
|
|
178
196
|
reset() {
|
|
179
197
|
this.userId = null;
|
|
180
198
|
this.identitySignature = null;
|
|
199
|
+
this.groupId = null;
|
|
200
|
+
this.groupSignature = null;
|
|
181
201
|
this.attributes = {};
|
|
182
202
|
this.clientContext = { ...DEFAULT_CLIENT_CONTEXT };
|
|
183
203
|
this.connection?.disconnect();
|
|
@@ -204,6 +224,8 @@ export class UserflowCore {
|
|
|
204
224
|
this.config = { clientToken, serverEndpoint };
|
|
205
225
|
this.userId = null;
|
|
206
226
|
this.identitySignature = null;
|
|
227
|
+
this.groupId = null;
|
|
228
|
+
this.groupSignature = null;
|
|
207
229
|
this.attributes = {};
|
|
208
230
|
return this.config;
|
|
209
231
|
}
|
|
@@ -245,6 +267,47 @@ export class UserflowCore {
|
|
|
245
267
|
groupAttributes: attributes ?? {},
|
|
246
268
|
membershipAttributes: options.membership ?? {},
|
|
247
269
|
});
|
|
270
|
+
this.groupId = externalId;
|
|
271
|
+
this.groupSignature = signature;
|
|
272
|
+
}
|
|
273
|
+
requireIdentifiedFor(method) {
|
|
274
|
+
if (!this.userId) {
|
|
275
|
+
throw new UserflowAuthError(`Call Userflow.identify() before ${method}()`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
requireGroup() {
|
|
279
|
+
this.requireIdentifiedFor('updateGroup');
|
|
280
|
+
if (!this.groupId) {
|
|
281
|
+
throw new UserflowAuthError('Call Userflow.group() before updateGroup()');
|
|
282
|
+
}
|
|
283
|
+
return this.groupId;
|
|
284
|
+
}
|
|
285
|
+
async doUpdateUser(attributes) {
|
|
286
|
+
if (!this.config) {
|
|
287
|
+
throw new UserflowAuthError('Call Userflow.init() before updateUser()');
|
|
288
|
+
}
|
|
289
|
+
this.requireIdentifiedFor('updateUser');
|
|
290
|
+
const normalized = normalizeAttributes(attributes);
|
|
291
|
+
assertValidAttributeNames('user', normalized);
|
|
292
|
+
await this.ensureConnected();
|
|
293
|
+
await this.connection.updateUser(normalized);
|
|
294
|
+
}
|
|
295
|
+
async doUpdateGroup(attributes, options) {
|
|
296
|
+
if (!this.config) {
|
|
297
|
+
throw new UserflowAuthError('Call Userflow.init() before updateGroup()');
|
|
298
|
+
}
|
|
299
|
+
const groupId = this.requireGroup();
|
|
300
|
+
const groupAttributes = normalizeAttributes(attributes);
|
|
301
|
+
const membershipAttributes = normalizeAttributes(options.membership);
|
|
302
|
+
assertValidAttributeNames('group', groupAttributes);
|
|
303
|
+
assertValidAttributeNames('group_membership', membershipAttributes);
|
|
304
|
+
await this.ensureConnected();
|
|
305
|
+
await this.connection.group({
|
|
306
|
+
groupExternalId: groupId,
|
|
307
|
+
groupSignature: this.groupSignature,
|
|
308
|
+
groupAttributes,
|
|
309
|
+
membershipAttributes,
|
|
310
|
+
});
|
|
248
311
|
}
|
|
249
312
|
async doTrack(name, attributes, options) {
|
|
250
313
|
if (!this.config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserflowCore.js","sourceRoot":"","sources":["../../src/engine/UserflowCore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserflowCore.js","sourceRoot":"","sources":["../../src/engine/UserflowCore.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAajF,MAAM,sBAAsB,GAAkB;IAC5C,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,GAAG;IAClB,cAAc,EAAE,GAAG;CACpB,CAAC;AAkDF,SAAS,YAAY,CAAC,KAAyB,EAAE,IAAY;IAC3D,MAAM,OAAO,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,iBAAiB,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;IAC7D,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,YAAY;IAavB,YAAY,OAAyB,EAAE;QAZ/B,WAAM,GAA0B,IAAI,CAAC;QACrC,eAAU,GAA8B,IAAI,CAAC;QAC7C,WAAM,GAAkB,IAAI,CAAC;QAC7B,sBAAiB,GAAkB,IAAI,CAAC;QACxC,YAAO,GAAkB,IAAI,CAAC;QAC9B,mBAAc,GAAkB,IAAI,CAAC;QACrC,eAAU,GAAuB,EAAE,CAAC;QACpC,kBAAa,GAAkB,EAAE,GAAG,sBAAsB,EAAE,CAAC;QAC7D,gBAAW,GAAmC,IA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U,EAAE,6BAA6B,CAAC,UAAU,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FlowConditionFragment, SessionDataFragment } from '@userflow-tech/protocol';
|
|
2
|
+
import { FlowConditionOperator } from '@userflow-tech/protocol';
|
|
3
|
+
export interface CompareOpts {
|
|
4
|
+
sessionData: SessionDataFragment[];
|
|
5
|
+
condition: FlowConditionFragment;
|
|
6
|
+
value: string | string[] | null;
|
|
7
|
+
now?: () => number;
|
|
8
|
+
}
|
|
9
|
+
type CompareFn = (opts: CompareOpts) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* ATTRIBUTE comparison operators, ported from web
|
|
12
|
+
* `userflowjs/util/flow-condition-operators.ts` without date-fns.
|
|
13
|
+
*/
|
|
14
|
+
export declare const conditionOperators: Record<FlowConditionOperator, CompareFn>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=conditionOperators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionOperators.d.ts","sourceRoot":"","sources":["../../src/engine/conditionOperators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,SAAS,EAAE,qBAAqB,CAAC;IACjC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,KAAK,SAAS,GAAG,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,qBAAqB,EAAE,SAAS,CA6IvE,CAAC"}
|