@lexical/react 0.2.7 → 0.2.8
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/LexicalAutoScrollPlugin.d.ts +1 -2
- package/LexicalBlockWithAlignableContents.d.ts +18 -0
- package/LexicalCheckListPlugin.d.ts +9 -0
- package/LexicalCollaborationPlugin.d.ts +2 -20
- package/LexicalDecoratorBlockNode.d.ts +23 -0
- package/LexicalMarkdownShortcutPlugin.d.ts +2 -0
- package/LexicalNestedComposer.d.ts +1 -1
- package/package.json +19 -19
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type {ElementFormatType, NodeKey} from 'lexical';
|
|
11
|
+
|
|
12
|
+
type Props = Readonly<{
|
|
13
|
+
children: JSX.Element | string | (JSX.Element | string)[];
|
|
14
|
+
format: ElementFormatType | null;
|
|
15
|
+
nodeKey: NodeKey;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
declare function BlockWithAlignableContents(Props): JSX.Element;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import {WebsocketProvider} from 'y-websocket';
|
|
9
10
|
import type {Doc, RelativePosition} from 'yjs';
|
|
10
11
|
export type UserState = {
|
|
11
12
|
anchorPos: null | RelativePosition;
|
|
@@ -21,34 +22,15 @@ export type ProviderAwareness = {
|
|
|
21
22
|
on: (type: 'update', cb: () => void) => void;
|
|
22
23
|
off: (type: 'update', cb: () => void) => void;
|
|
23
24
|
};
|
|
24
|
-
export interface Provider {
|
|
25
|
-
connect(): void | Promise<void>;
|
|
26
|
-
disconnect(): void;
|
|
27
|
-
awareness: ProviderAwareness;
|
|
28
|
-
on(type: 'sync', cb: (isSynced: boolean) => void): void;
|
|
29
|
-
on(type: 'status', cb: (arg0: {status: string}) => void): void;
|
|
30
|
-
// $FlowFixMe: temp
|
|
31
|
-
on(type: 'update', cb: (arg0: any) => void): void;
|
|
32
|
-
on(type: 'reload', cb: (doc: Doc) => boolean): void;
|
|
33
|
-
off(type: 'sync', cb: (isSynced: boolean) => void): void;
|
|
34
|
-
// $FlowFixMe: temp
|
|
35
|
-
off(type: 'update', cb: (arg0: any) => void): void;
|
|
36
|
-
off(type: 'status', cb: (arg0: {status: string}) => void): void;
|
|
37
|
-
off(type: 'reload', cb: (doc: Doc) => boolean): void;
|
|
38
|
-
}
|
|
39
25
|
type CollaborationContextType = {
|
|
40
26
|
clientID: number;
|
|
41
27
|
color: string;
|
|
42
28
|
name: string;
|
|
43
29
|
yjsDocMap: Map<string, Doc>;
|
|
44
30
|
};
|
|
45
|
-
export type ProviderFactory = (
|
|
46
|
-
id: string,
|
|
47
|
-
yjsDocMap: Map<string, Doc>,
|
|
48
|
-
) => Provider;
|
|
49
31
|
export function CollaborationPlugin(arg0: {
|
|
50
32
|
id: string;
|
|
51
|
-
providerFactory:
|
|
33
|
+
providerFactory(id: string, yjsDocMap: Map<string, Doc>): WebsocketProvider;
|
|
52
34
|
shouldBootstrap: boolean;
|
|
53
35
|
username?: string;
|
|
54
36
|
}): JSX.Element | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type {ElementFormatType, LexicalNode, NodeKey} from 'lexical';
|
|
11
|
+
|
|
12
|
+
import {DecoratorNode} from 'lexical';
|
|
13
|
+
|
|
14
|
+
declare class DecoratorBlockNode<T> extends DecoratorNode<T> {
|
|
15
|
+
__format: ElementFormatType;
|
|
16
|
+
constructor(format?: ElementFormatType | null, key?: NodeKey);
|
|
17
|
+
createDOM(): HTMLElement;
|
|
18
|
+
setFormat(format: ElementFormatType): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare function $isDecoratorBlockNode<T>(
|
|
22
|
+
node: LexicalNode,
|
|
23
|
+
): node is DecoratorBlockNode<T>;
|
|
@@ -11,5 +11,5 @@ import type {LexicalEditor, EditorThemeClasses} from 'lexical';
|
|
|
11
11
|
export default function LexicalNestedComposer(arg0: {
|
|
12
12
|
initialEditor: LexicalEditor;
|
|
13
13
|
initialTheme?: EditorThemeClasses;
|
|
14
|
-
children: JSX.Element | JSX.Element[] | null;
|
|
14
|
+
children: JSX.Element | (JSX.Element | string | null)[] | null;
|
|
15
15
|
}): JSX.Element | null;
|
package/package.json
CHANGED
|
@@ -8,28 +8,28 @@
|
|
|
8
8
|
"rich-text"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.2.
|
|
11
|
+
"version": "0.2.8",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@lexical/clipboard": "0.2.
|
|
14
|
-
"@lexical/list": "0.2.
|
|
15
|
-
"@lexical/table": "0.2.
|
|
16
|
-
"@lexical/yjs": "0.2.
|
|
17
|
-
"@lexical/hashtag": "0.2.
|
|
18
|
-
"@lexical/selection": "0.2.
|
|
19
|
-
"@lexical/utils": "0.2.
|
|
20
|
-
"@lexical/dragon": "0.2.
|
|
21
|
-
"@lexical/plain-text": "0.2.
|
|
22
|
-
"@lexical/rich-text": "0.2.
|
|
23
|
-
"@lexical/code": "0.2.
|
|
24
|
-
"@lexical/text": "0.2.
|
|
25
|
-
"@lexical/link": "0.2.
|
|
26
|
-
"@lexical/overflow": "0.2.
|
|
27
|
-
"@lexical/history": "0.2.
|
|
28
|
-
"@lexical/markdown": "0.2.
|
|
29
|
-
"@lexical/mark": "0.2.
|
|
13
|
+
"@lexical/clipboard": "0.2.8",
|
|
14
|
+
"@lexical/list": "0.2.8",
|
|
15
|
+
"@lexical/table": "0.2.8",
|
|
16
|
+
"@lexical/yjs": "0.2.8",
|
|
17
|
+
"@lexical/hashtag": "0.2.8",
|
|
18
|
+
"@lexical/selection": "0.2.8",
|
|
19
|
+
"@lexical/utils": "0.2.8",
|
|
20
|
+
"@lexical/dragon": "0.2.8",
|
|
21
|
+
"@lexical/plain-text": "0.2.8",
|
|
22
|
+
"@lexical/rich-text": "0.2.8",
|
|
23
|
+
"@lexical/code": "0.2.8",
|
|
24
|
+
"@lexical/text": "0.2.8",
|
|
25
|
+
"@lexical/link": "0.2.8",
|
|
26
|
+
"@lexical/overflow": "0.2.8",
|
|
27
|
+
"@lexical/history": "0.2.8",
|
|
28
|
+
"@lexical/markdown": "0.2.8",
|
|
29
|
+
"@lexical/mark": "0.2.8"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"lexical": "0.2.
|
|
32
|
+
"lexical": "0.2.8",
|
|
33
33
|
"react": ">=17.x",
|
|
34
34
|
"react-dom": ">=17.x"
|
|
35
35
|
},
|