overleaf/libraries/overleaf-editor-core/test
Domagoj Kriskovic b87dad77d9 Added applyInsert/applyDelete methods to comments (#16572)
* Add CommentList to StringFileData

* added more types

* use toRaw

* using Map rather than array for comments

* using Range class

* Comment with ranges:Range[]

* Revert "Comment with ranges:Range[]"

This reverts commit 0783b1837562600637db03cc70c620129061c797.

* Comment with ranges:Range[]

* remove isDeleted

* commentList.toRaw()

* using toRaw

* commentId to id

* Revert "using toRaw"

This reverts commit 0c04ca5836f3befd5ec027bad5bf722e8b27f36c.

* fix merge

* make comment map internal to CommentList

* remove unused type

* fix parameter name in StringFileData

* import types more consistently

* more consistent type def

* Added moveOnInsert/moveOnDelete methods to comments

* use range helper methods

* mergeRanges function

* rename isAfter to startsAfter

* added @ts-checks

* using comment.isEmpty

* rename overlaps to covers

* remove ops in applyDelete

* mege, substract, isInRange

* ranges fixes, added tests

* rename to includes

* using pos,length in applyInsert

* simplify

* extendComment option

* check comment edges

* added inclusive option

* more specific touches()

* refactor mergeRanges()

* comment.addRange()

* remove inclusive option

* refactor using more helper methods

* fix typo

* inserting a comment between ranges tests

* test description fixes

* support only range

* more edge case testing

* added more range tests

* renamed to containsExcludingEdges

* endsAt check edge

* using firstIndex, lastIndex

* contains, containsIndex

* raturn -1 for lastIndex for empty ranges

* rename ranges in tests

* indexStartsAfter

* sort comment ranges

* rename to indexIsAfter, fix Range type

* add range if expandComment is true

* split the range when expandComment is false

* added moveBy and extendBy

* added more tests

* added comments

* prettier

* small fixes/typos

* rename indexIsAfter

* merge when deleting with overlaps

* added overlap test

* same range touches test

* test with overlapping comments

* delete duplicate test

* throw on empty range

GitOrigin-RevId: 1252e3d01f2f5dc1d00ce681c579506038e4d121
2024-02-02 09:03:28 +00:00
..
support [overleaf-editor-core] Restructure TextOperation hierachy (#16582) 2024-01-24 09:04:18 +00:00
change.test.js Avoid duplicating a math-closing dollar sign (#11227) 2023-01-16 08:41:42 +00:00
comment.test.js Added applyInsert/applyDelete methods to comments (#16572) 2024-02-02 09:03:28 +00:00
comments_list.test.js Added applyInsert/applyDelete methods to comments (#16572) 2024-02-02 09:03:28 +00:00
edit_file_operation.test.js [overleaf-editor-core] Restructure TextOperation hierachy (#16582) 2024-01-24 09:04:18 +00:00
edit_operation.test.js [overleaf-editor-core] Restructure TextOperation hierachy (#16582) 2024-01-24 09:04:18 +00:00
file.test.js Add CommentList to StringFileData (#16568) 2024-01-24 09:04:15 +00:00
file_map.test.js Merge pull request #14419 from overleaf/em-history-lib-async-await 2023-08-23 08:05:38 +00:00
history.test.js Avoid duplicating a math-closing dollar sign (#11227) 2023-01-16 08:41:42 +00:00
hollow_string_file_data.test.js Avoid duplicating a math-closing dollar sign (#11227) 2023-01-16 08:41:42 +00:00
label.test.js Avoid duplicating a math-closing dollar sign (#11227) 2023-01-16 08:41:42 +00:00
lazy_string_file_data.test.js [overleaf-editor-core] Restructure TextOperation hierachy (#16582) 2024-01-24 09:04:18 +00:00
move_file_operation.test.js Avoid duplicating a math-closing dollar sign (#11227) 2023-01-16 08:41:42 +00:00
operation.test.js [overleaf-editor-core] Restructure TextOperation hierachy (#16582) 2024-01-24 09:04:18 +00:00
range.test.js Added applyInsert/applyDelete methods to comments (#16572) 2024-02-02 09:03:28 +00:00
safe_pathname.test.js Avoid duplicating a math-closing dollar sign (#11227) 2023-01-16 08:41:42 +00:00
snapshot.test.js Avoid duplicating a math-closing dollar sign (#11227) 2023-01-16 08:41:42 +00:00
string_file_data.test.js Added applyInsert/applyDelete methods to comments (#16572) 2024-02-02 09:03:28 +00:00
text_operation.test.js Merge pull request #16660 from overleaf/mj-edit-operation-fix 2024-01-24 09:04:37 +00:00