mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
* feat: changing chat to use cm6 editor instead to allow for mentions display and autocomplete * feat: changing review panel comment, edit, and reply to also use cm6 editor to enable mentions * feat: updating tests, and moving from jsdom to cypress tests as jsdom cant handle cm6 * feat: centralizing mentions component and applying to both chat and review-panel * feat: centralizing mentions input, and using changesUsers in chat mentions * fixing dark mode styles of chat * feat: updating mentions dropdown style and adding custom icon generation for mentions cm6 autocomplete tooltip * feat: making mentions look like links, and fixing border radius on tooltip * fix: naming and using correct color util * feat: fixing hover on highlight * update scroll bar dance in review panel when a system had persistent scroll bars, we would run into issues calculating the height of the review panel Co-authored-by: Kristina <7614497+khjrtbrg@users.noreply.github.com> --------- Co-authored-by: Kristina <7614497+khjrtbrg@users.noreply.github.com> GitOrigin-RevId: 96441ad55f9614427506edfecf3d87bae82d1607
29 lines
678 B
TypeScript
29 lines
678 B
TypeScript
import { StateEffect, StateField } from '@codemirror/state'
|
|
|
|
export type MemberInfo = {
|
|
name: string
|
|
email: string
|
|
}
|
|
|
|
export const projectMembersInfo = StateField.define<Map<string, MemberInfo>>({
|
|
create: () => {
|
|
return new Map()
|
|
},
|
|
update(value, transaction) {
|
|
for (const effect of transaction.effects) {
|
|
if (effect.is(updateCollaboratorsEffect)) {
|
|
value = effect.value
|
|
}
|
|
}
|
|
return value
|
|
},
|
|
})
|
|
|
|
const updateCollaboratorsEffect = StateEffect.define<Map<string, MemberInfo>>()
|
|
|
|
export const setProjectMembersInfo = (idToNameMap: Map<string, MemberInfo>) => {
|
|
return {
|
|
effects: updateCollaboratorsEffect.of(idToNameMap),
|
|
}
|
|
}
|