@lexical/yjs 0.8.1 → 0.9.1
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/Bindings.d.ts +2 -2
- package/LexicalYjs.dev.js +326 -50
- package/SyncCursors.d.ts +4 -4
- package/SyncEditorStates.d.ts +3 -4
- package/index.d.ts +2 -3
- package/package.json +3 -3
package/SyncCursors.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { Binding } from './Bindings';
|
|
9
9
|
import type { GridSelection, NodeKey, NodeSelection, RangeSelection } from 'lexical';
|
|
10
|
-
import {
|
|
10
|
+
import { Provider } from '.';
|
|
11
11
|
export declare type CursorSelection = {
|
|
12
12
|
anchor: {
|
|
13
13
|
key: NodeKey;
|
|
@@ -27,6 +27,6 @@ export declare type Cursor = {
|
|
|
27
27
|
name: string;
|
|
28
28
|
selection: null | CursorSelection;
|
|
29
29
|
};
|
|
30
|
-
export declare function syncLocalCursorPosition(binding: Binding, provider:
|
|
31
|
-
export declare function syncCursorPositions(binding: Binding, provider:
|
|
32
|
-
export declare function syncLexicalSelectionToYjs(binding: Binding, provider:
|
|
30
|
+
export declare function syncLocalCursorPosition(binding: Binding, provider: Provider): void;
|
|
31
|
+
export declare function syncCursorPositions(binding: Binding, provider: Provider): void;
|
|
32
|
+
export declare function syncLexicalSelectionToYjs(binding: Binding, provider: Provider, prevSelection: null | RangeSelection | NodeSelection | GridSelection, nextSelection: null | RangeSelection | NodeSelection | GridSelection): void;
|
package/SyncEditorStates.d.ts
CHANGED
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import type { EditorState, NodeKey } from 'lexical';
|
|
9
|
-
import { WebsocketProvider } from 'y-websocket';
|
|
10
9
|
import { Text as YText, YEvent } from 'yjs';
|
|
11
|
-
import { Binding } from '.';
|
|
12
|
-
export declare function syncYjsChangesToLexical(binding: Binding, provider:
|
|
10
|
+
import { Binding, Provider } from '.';
|
|
11
|
+
export declare function syncYjsChangesToLexical(binding: Binding, provider: Provider, events: Array<YEvent<YText>>, isFromUndoManger: boolean): void;
|
|
13
12
|
declare type IntentionallyMarkedAsDirtyElement = boolean;
|
|
14
|
-
export declare function syncLexicalUpdateToYjs(binding: Binding, provider:
|
|
13
|
+
export declare function syncLexicalUpdateToYjs(binding: Binding, provider: Provider, prevEditorState: EditorState, currEditorState: EditorState, dirtyElements: Map<NodeKey, IntentionallyMarkedAsDirtyElement>, dirtyLeaves: Set<NodeKey>, normalizedNodes: Set<NodeKey>, tags: Set<string>): void;
|
|
15
14
|
export {};
|
package/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { Binding } from './Bindings';
|
|
10
10
|
import type { LexicalCommand } from 'lexical';
|
|
11
|
-
import type { WebsocketProvider } from 'y-websocket';
|
|
12
11
|
import type { Doc, RelativePosition, UndoManager, XmlText } from 'yjs';
|
|
13
12
|
export declare type UserState = {
|
|
14
13
|
anchorPos: null | RelativePosition;
|
|
@@ -56,7 +55,7 @@ export type { Provider };
|
|
|
56
55
|
export type { Binding, ClientID } from './Bindings';
|
|
57
56
|
export { createBinding } from './Bindings';
|
|
58
57
|
export declare function createUndoManager(binding: Binding, root: XmlText): UndoManager;
|
|
59
|
-
export declare function initLocalState(provider:
|
|
60
|
-
export declare function setLocalStateFocus(provider:
|
|
58
|
+
export declare function initLocalState(provider: Provider, name: string, color: string, focusing: boolean): void;
|
|
59
|
+
export declare function setLocalStateFocus(provider: Provider, name: string, color: string, focusing: boolean): void;
|
|
61
60
|
export { syncCursorPositions } from './SyncCursors';
|
|
62
61
|
export { syncLexicalUpdateToYjs, syncYjsChangesToLexical, } from './SyncEditorStates';
|
package/package.json
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
"crdt"
|
|
12
12
|
],
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.9.1",
|
|
15
15
|
"main": "LexicalYjs.js",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@lexical/offset": "0.
|
|
17
|
+
"@lexical/offset": "0.9.1"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"lexical": "0.
|
|
20
|
+
"lexical": "0.9.1",
|
|
21
21
|
"yjs": ">=13.5.22"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|