Improve docs
This commit is contained in:
parent
f9217286e7
commit
55b37039ef
5 changed files with 225 additions and 105 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue