V3.3.0 js.foresight
This version introduces first-party touch device support for mobile and pen interactions. While desktop systems use multiple concurrent prediction strategies (mouse trajectory, keyboard navigation, scroll detection), touch devices operate with a single configurable strategy:
onTouchStart(default) - Fires callbacks immediately when users begin touching an element, providing instant feedback before the touch interaction completes. (Conservative while saving bandwidth)Viewport- Triggers callbacks when elements enter the user's viewport. (Aggressive but offers a snappier experience)
The strategy can be configured while initializing the ForesightManager as seen below:
ForesightManager.initialize({
touchDeviceStrategy: "viewport" // viewport, onTouchStart, none
})Foresight also automatically switches between pen, mouse, and touch mode. Even mid-session.
Features
- Added first-party touch device support (see above)
- Added
currentDeviceStrategyandactiveElementCountto ForesightManager.instance.getManagerData - Added new
deviceStrategyChangedevent. - Added
wasLastActiveElementtocallbackCompletedevent. - Added
wasLastRegisteredElementtoelementUnregisteredevent
Changes
- Now removes all handlers when there are no active elements anymore.
- Removed
trajectoryHitDatafromForesightElementDatasince it is not needed anymore for calculations.
Others
- upped
position-observerto version 1.0.1
V1.3.1 js.foresight-devtools
Changes
- Elements in the element tab will turn purple while in touch device mode.
- Log tab now supports the new
deviceStrategyChangedevent. - Settings tab allows for real-time altering of the
touchDeviceStrategy
Docs:
- Added search to docs!
- Added page on how to give your llm context about Foresight. Read more.
- Added your first element page.
- Split the Global Settings and Element Settings in two seperate pages.
- Made the events page more readable