Improve docs

This commit is contained in:
Andras Schmelczer 2025-07-12 21:58:05 +01:00
parent f9217286e7
commit 55b37039ef
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
5 changed files with 225 additions and 105 deletions

View file

@ -1,4 +1,4 @@
import { reconcileWithHistory } from 'reconcile-text';
import { reconcile, reconcileWithHistory } from 'reconcile-text';
import type { BuiltinTokenizer } from 'reconcile-text';
import './style.scss';
@ -22,6 +22,20 @@ async function main(): Promise<void> {
leftTextArea.addEventListener('select', updateMergedText);
rightTextArea.addEventListener('select', updateMergedText);
console.info(
reconcile(
'Hello world',
{
text: 'Hello beautiful world',
cursors: [{ id: 1, position: 6 }], // After "Hello "
},
{
text: 'Hi world',
cursors: [{ id: 2, position: 0 }], // At the beginning
}
)
);
window.addEventListener('resize', resizeTextAreas);
tokenizerRadios.forEach((radio) => {