@wangeditor-next/yjs 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/{applyToSlate → yjs/src/applyToSlate}/index.d.ts +19 -19
- package/dist/{applyToSlate → yjs/src/applyToSlate}/textEvent.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/index.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/node/index.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/node/insertNode.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/node/mergeNode.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/node/moveNode.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/node/removeNode.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/node/setNode.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/node/splitNode.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/text/index.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/text/insertText.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/text/removeText.d.ts +3 -3
- package/dist/{applyToYjs → yjs/src/applyToYjs}/types.d.ts +8 -8
- package/dist/{index.d.ts → yjs/src/index.d.ts} +5 -5
- package/dist/{module → yjs/src/module}/custom-types.d.ts +41 -41
- package/dist/{plugins → yjs/src/plugins}/index.d.ts +3 -3
- package/dist/yjs/src/plugins/withCursors.d.ts +38 -0
- package/dist/{plugins → yjs/src/plugins}/withYHistory.d.ts +19 -34
- package/dist/{plugins → yjs/src/plugins}/withYjs.d.ts +42 -52
- package/dist/{utils → yjs/src/utils}/clone.d.ts +4 -4
- package/dist/{utils → yjs/src/utils}/convert.d.ts +7 -7
- package/dist/{utils → yjs/src/utils}/delta.d.ts +7 -7
- package/dist/{utils → yjs/src/utils}/location.d.ts +11 -11
- package/dist/{utils → yjs/src/utils}/object.d.ts +9 -9
- package/dist/{utils → yjs/src/utils}/position.d.ts +19 -19
- package/dist/{utils → yjs/src/utils}/slate.d.ts +2 -2
- package/dist/{utils → yjs/src/utils}/yjs.d.ts +4 -4
- package/package.json +11 -12
- package/dist/index.esm.js +0 -2
- package/dist/index.esm.js.map +0 -1
- package/dist/plugins/withCursors.d.ts +0 -55
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Range } from 'slate';
|
|
2
|
-
import { Awareness } from 'y-protocols/awareness';
|
|
3
|
-
import * as Y from 'yjs';
|
|
4
|
-
import { RelativeRange } from '../module/custom-types';
|
|
5
|
-
import { YjsEditor } from './withYjs';
|
|
6
|
-
export type CursorStateChangeEvent = {
|
|
7
|
-
added: number[];
|
|
8
|
-
updated: number[];
|
|
9
|
-
removed: number[];
|
|
10
|
-
};
|
|
11
|
-
export type RemoteCursorChangeEventListener = (event: CursorStateChangeEvent) => void;
|
|
12
|
-
export type CursorState<TCursorData extends Record<string, unknown> = Record<string, unknown>> = {
|
|
13
|
-
relativeSelection: RelativeRange | null;
|
|
14
|
-
data?: TCursorData;
|
|
15
|
-
clientId: number;
|
|
16
|
-
};
|
|
17
|
-
export type CursorEditor<TCursorData extends Record<string, unknown> = Record<string, unknown>> = YjsEditor & {
|
|
18
|
-
awareness: Awareness;
|
|
19
|
-
cursorDataField: string;
|
|
20
|
-
selectionStateField: string;
|
|
21
|
-
sendCursorPosition: (range: Range | null) => void;
|
|
22
|
-
sendCursorData: (data: TCursorData) => void;
|
|
23
|
-
};
|
|
24
|
-
export declare const CursorEditor: {
|
|
25
|
-
isCursorEditor(value: unknown): value is CursorEditor<Record<string, unknown>>;
|
|
26
|
-
sendCursorPosition<TCursorData extends Record<string, unknown>>(editor: CursorEditor<TCursorData>, range?: Range | null): void;
|
|
27
|
-
sendCursorData<TCursorData_1 extends Record<string, unknown>>(editor: CursorEditor<TCursorData_1>, data: TCursorData_1): void;
|
|
28
|
-
on<TCursorData_2 extends Record<string, unknown>>(editor: CursorEditor<TCursorData_2>, event: 'change', handler: RemoteCursorChangeEventListener): void;
|
|
29
|
-
off<TCursorData_3 extends Record<string, unknown>>(editor: CursorEditor<TCursorData_3>, event: 'change', listener: RemoteCursorChangeEventListener): void;
|
|
30
|
-
cursorState<TCursorData_4 extends Record<string, unknown>>(editor: CursorEditor<TCursorData_4>, clientId: number): CursorState<TCursorData_4> | null;
|
|
31
|
-
cursorStates<TCursorData_5 extends Record<string, unknown>>(editor: CursorEditor<TCursorData_5>): Record<string, CursorState<TCursorData_5>>;
|
|
32
|
-
};
|
|
33
|
-
export type WithCursorsOptions<TCursorData extends Record<string, unknown> = Record<string, unknown>> = {
|
|
34
|
-
cursorStateField?: string;
|
|
35
|
-
cursorDataField?: string;
|
|
36
|
-
data?: TCursorData;
|
|
37
|
-
autoSend?: boolean;
|
|
38
|
-
};
|
|
39
|
-
export declare function withCursors<TCursorData extends Record<string, unknown>>(awareness: Awareness, options?: WithCursorsOptions<TCursorData>): <T extends YjsEditor>(editor: T) => T & import("slate").BaseEditor & {
|
|
40
|
-
sharedRoot: Y.XmlText;
|
|
41
|
-
localOrigin: unknown;
|
|
42
|
-
positionStorageOrigin: unknown;
|
|
43
|
-
applyRemoteEvents: (events: Y.YEvent<Y.XmlText>[], origin: unknown) => void;
|
|
44
|
-
storeLocalChange: (op: import("slate").BaseOperation) => void;
|
|
45
|
-
flushLocalChanges: () => void;
|
|
46
|
-
isLocalOrigin: (origin: unknown) => boolean;
|
|
47
|
-
connect: () => void;
|
|
48
|
-
disconnect: () => void;
|
|
49
|
-
} & {
|
|
50
|
-
awareness: Awareness;
|
|
51
|
-
cursorDataField: string;
|
|
52
|
-
selectionStateField: string;
|
|
53
|
-
sendCursorPosition: (range: import("slate").BaseRange | null) => void;
|
|
54
|
-
sendCursorData: (data: TCursorData) => void;
|
|
55
|
-
};
|