Files
AppFlowy-Web/src/slate-editor.d.ts
Bartosz Sypytkowski 947740b683 feat: integrate new realtime sync protocol (#19)
* new sync protocolt

* refresh outline when folder change was detected

* add 250ms debounce for yjs doc update emits

* fix refresh outline on folder change

* remove existing SyncManager

* added update timestamp to lastUpdatedCollab info

* turn off http fetch in get doc page

* fix empty state vector binary parsing

* return existing sync context if possible

* update

* chore: load workspace database data before loadview

* chore: fixed the issue of database rows can not update

* add awareness to RegisterSyncContext type def

* chore: remove redundant logs

* chore: add display of collaborative users

* chore: display cursors

* chore: setup web socket reconnect options

* chore: init sync context only once

* revert reconnect

* chore: add blur

* chore: cache device id

* revert storage device id

* chore: refactor remote selection rendering and add cursor animation

* chore: refactor remote selection rendering

* chore: add blur

* chore: update cursor display logic, add device ID, optimize Yjs event handling

* chore: add cross-tab sync via broadcast channel

* chore: add text application logic, optimize selection transform handling, update ESLint rules

* chore: fix lint

* chore: others

* add heartbeat and ready state logging

* chore: add reconnect and listen connecting

* chore: fix conneting banner

* chore: modified the logic of adding recent

* echo-based heartbeat

* chore: remove condition of render cursors

* chore: modified generate cursor color

* chore: fix some test issues

* chore: use jest mock timers in sync tests

* chore: fix jest issue

* chore: fix the lint issue

---------

Co-authored-by: Kilu <lu@appflowy.io>
2025-08-07 11:43:56 +08:00

53 lines
1.0 KiB
TypeScript

import { ReactEditor } from 'slate-react';
interface EditorInlineAttributes {
bold?: boolean;
italic?: boolean;
underline?: boolean;
strikethrough?: boolean;
font_color?: string;
bg_color?: string;
href?: string;
code?: boolean;
font_family?: string;
formula?: string;
prism_token?: string;
class_name?: string;
mention?: {
type: string;
// inline page ref id
page_id?: string;
block_id?: string;
// reminder date ref id
date?: string;
reminder_id?: string;
reminder_option?: string;
};
af_text_color?: string;
af_background_color?: string;
}
type CustomElement = {
children: (CustomText | CustomElement)[];
type?: string;
data?: unknown;
blockId?: string;
textId?: string;
relationId?: string;
};
type CustomText = { text: string } & EditorInlineAttributes;
declare module 'slate' {
interface CustomTypes {
Editor: BaseEditor & ReactEditor;
Element: CustomElement;
Text: CustomText;
}
interface BaseEditor {
isEmbed: (element: CustomElement) => boolean;
}
}