File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/json-crdt-peritext-ui/dom Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 7373 },
7474 "files" : [
7575 " LICENSE" ,
76- " lib/"
76+ " bin/" ,
77+ " lib/" ,
78+ " esm/"
7779 ],
7880 "scripts" : {
7981 "format" : " biome format ./src" ,
8284 "lint:fix" : " biome lint --apply ./src" ,
8385 "clean" : " npx rimraf@5.0.5 lib es6 es2019 es2020 esm typedocs coverage gh-pages yarn-error.log src/**/__bench__/node_modules src/**/__bench__/yarn-error.log" ,
8486 "build:es2020" : " tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib" ,
85- "build:all" : " npx concurrently@8.2.2 \" yarn build:es2020\" " ,
87+ "build:esm" : " tsc --project tsconfig.build.json --module ESNext --target ESNEXT --outDir esm" ,
88+ "build:all" : " npx concurrently@8.2.2 \" yarn build:es2020\" \" yarn build:esm\" " ,
8689 "build" : " yarn build:es2020" ,
8790 "jest" : " jest" ,
8891 "test" : " jest --maxWorkers 7" ,
Original file line number Diff line number Diff line change @@ -27,14 +27,16 @@ export interface CursorControllerOpts {
2727export class CursorController implements UiLifeCycles , Printable {
2828 public readonly caretId : string ;
2929
30+ private readonly _cursor : [ fn : PeritextEventTarget [ 'cursor' ] , stop : ( ) => void ] ;
31+
3032 public constructor ( public readonly opts : CursorControllerOpts ) {
3133 this . caretId = 'jsonjoy.com-peritext-caret-' + opts . et . id ;
34+ this . _cursor = throttle ( opts . et . cursor . bind ( opts . et ) , 25 )
3235 }
3336
3437 /** The position where user started to scrub the text. */
3538 protected selAnchor : number = - 1 ;
3639
37- private readonly _cursor = throttle ( this . opts . et . cursor . bind ( this . opts . et ) , 25 ) ;
3840
3941 /**
4042 * String position at coordinate, or -1, if unknown.
You can’t perform that action at this time.
0 commit comments