[lib] Added getTextsOffsets function. Refactored mention-utils.js.
Summary:
I've done changes to mention/@-ing Regex.
Also added getTextsOffsets function. It is kinda hacky, but I couldn't find better way to do it.
It is used to measure cursor offset in pixels from textarea top-left corner, so we can position
@ing typeahead overlay correctly.
Currently it doesn't take into account that overlay may not fit into window, so it can overflow into the left side of window, but it will be fixed in next diffs.
I wanted to put it up, as I'm not at work on Mon/Tue, but may already get some review.
Test Plan:
Tested in next diffs.
Works correctly and displays overlay above currently typed "mention".
Reviewers: tomek, kamil, atul, ashoat
Reviewed By: tomek, ashoat
Subscribers: ashoat, atul, kamil, tomek
Differential Revision: https://phab.comm.dev/D5674