@lexical/react 0.3.2 → 0.3.3
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/LexicalCollaborationPlugin.d.ts +2 -2
- package/LexicalComposer.d.ts +1 -0
- package/LexicalComposer.dev.js +2 -0
- package/LexicalComposer.js.flow +1 -1
- package/LexicalComposer.prod.js +1 -1
- package/LexicalContentEditable.js.flow +1 -1
- package/LexicalNestedComposer.dev.js +1 -0
- package/LexicalNestedComposer.prod.js +2 -2
- package/LexicalPlainTextPlugin.d.ts +2 -2
- package/LexicalPlainTextPlugin.js.flow +6 -2
- package/LexicalRichTextPlugin.d.ts +2 -2
- package/LexicalRichTextPlugin.js.flow +6 -2
- package/README.md +1 -2
- package/package.json +22 -19
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import type {Provider} from '@lexical/yjs';
|
|
10
10
|
import type {Doc, RelativePosition} from 'yjs';
|
|
11
11
|
|
|
12
12
|
export type UserState = {
|
|
@@ -31,7 +31,7 @@ type CollaborationContextType = {
|
|
|
31
31
|
};
|
|
32
32
|
export function CollaborationPlugin(arg0: {
|
|
33
33
|
id: string;
|
|
34
|
-
providerFactory(id: string, yjsDocMap: Map<string, Doc>):
|
|
34
|
+
providerFactory(id: string, yjsDocMap: Map<string, Doc>): Provider;
|
|
35
35
|
shouldBootstrap: boolean;
|
|
36
36
|
username?: string;
|
|
37
37
|
}): JSX.Element | null;
|
package/LexicalComposer.d.ts
CHANGED
package/LexicalComposer.dev.js
CHANGED
|
@@ -43,6 +43,7 @@ function LexicalComposer({
|
|
|
43
43
|
const composerContext = React.useMemo(() => {
|
|
44
44
|
const {
|
|
45
45
|
theme,
|
|
46
|
+
namespace,
|
|
46
47
|
editor__DEPRECATED: initialEditor,
|
|
47
48
|
nodes,
|
|
48
49
|
onError
|
|
@@ -52,6 +53,7 @@ function LexicalComposer({
|
|
|
52
53
|
|
|
53
54
|
if (editor === null) {
|
|
54
55
|
const newEditor = lexical.createEditor({
|
|
56
|
+
namespace,
|
|
55
57
|
nodes,
|
|
56
58
|
onError: error => onError(error, newEditor),
|
|
57
59
|
readOnly: true,
|
package/LexicalComposer.js.flow
CHANGED
|
@@ -13,7 +13,7 @@ type Props = {
|
|
|
13
13
|
initialConfig: $ReadOnly<{
|
|
14
14
|
editor__DEPRECATED?: LexicalEditor | null,
|
|
15
15
|
readOnly?: boolean,
|
|
16
|
-
namespace
|
|
16
|
+
namespace: string,
|
|
17
17
|
nodes?: $ReadOnlyArray<Class<LexicalNode>>,
|
|
18
18
|
theme?: EditorThemeClasses,
|
|
19
19
|
onError: (error: Error, editor: LexicalEditor) => void,
|
package/LexicalComposer.prod.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
'use strict';var a=require("@lexical/react/LexicalComposerContext"),e=require("lexical"),k=require("react"),l="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?k.useLayoutEffect:k.useEffect;
|
|
8
|
-
exports.LexicalComposer=function({initialConfig:f,children:m}){let h=k.useMemo(()=>{const {theme:b,
|
|
8
|
+
exports.LexicalComposer=function({initialConfig:f,children:m}){let h=k.useMemo(()=>{const {theme:b,namespace:c,editor__DEPRECATED:n,nodes:p,onError:q}=f,r=a.createLexicalComposerContext(null,b);let d=n||null;if(null===d){const g=e.createEditor({namespace:c,nodes:p,onError:t=>q(t,g),readOnly:!0,theme:b});d=g}return[d,r]},[]);l(()=>{let b=f.readOnly,[c]=h;c.setReadOnly(b||!1)},[]);return k.createElement(a.LexicalComposerContext.Provider,{value:h},m)}
|
|
@@ -41,6 +41,7 @@ function LexicalNestedComposer({
|
|
|
41
41
|
|
|
42
42
|
initialEditor._parentEditor = parentEditor;
|
|
43
43
|
initialEditor._nodes = parentEditor._nodes;
|
|
44
|
+
initialEditor._config.namespace = parentEditor._config.namespace;
|
|
44
45
|
return [initialEditor, context];
|
|
45
46
|
}, // We only do this for init
|
|
46
47
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
'use strict';var c=require("@lexical/react/LexicalCollaborationPlugin"),d=require("@lexical/react/LexicalComposerContext"),h=require("react");
|
|
8
|
-
exports.LexicalNestedComposer=function({initialEditor:a,children:k,initialTheme:l}){let e=h.useContext(d.LexicalComposerContext);if(null==e)throw Error("Minified Lexical error #9; see codes.json for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");let p=h.useMemo(()=>{const [
|
|
9
|
-
c.useCollaborationContext();let q=void 0!==b.get("main");b=b.has(a.getKey());return h.createElement(d.LexicalComposerContext.Provider,{value:p},!q||b?k:null)}
|
|
8
|
+
exports.LexicalNestedComposer=function({initialEditor:a,children:k,initialTheme:l}){let e=h.useContext(d.LexicalComposerContext);if(null==e)throw Error("Minified Lexical error #9; see codes.json for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");let p=h.useMemo(()=>{const [f,m]=e,g=l||m.getTheme()||void 0,n=d.createLexicalComposerContext(e,g);void 0!==g&&(a._config.theme=g);a._parentEditor=f;a._nodes=f._nodes;a._config.namespace=f._config.namespace;
|
|
9
|
+
return[a,n]},[]);var {yjsDocMap:b}=c.useCollaborationContext();let q=void 0!==b.get("main");b=b.has(a.getKey());return h.createElement(d.LexicalComposerContext.Provider,{value:p},!q||b?k:null)}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import {InitialEditorStateType} from '@lexical/plain-text';
|
|
10
|
+
import type {EditorState, LexicalEditor} from 'lexical';
|
|
10
11
|
|
|
11
|
-
type InitialEditorStateType = null | string | EditorState | (() => void);
|
|
12
12
|
export function PlainTextPlugin(arg0: {
|
|
13
13
|
contentEditable: JSX.Element | null;
|
|
14
14
|
initialEditorState?: InitialEditorStateType;
|
|
@@ -7,9 +7,13 @@
|
|
|
7
7
|
* @flow strict
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type {EditorState} from 'lexical';
|
|
10
|
+
import type {EditorState, LexicalEditor} from 'lexical';
|
|
11
11
|
|
|
12
|
-
type InitialEditorStateType =
|
|
12
|
+
type InitialEditorStateType =
|
|
13
|
+
| null
|
|
14
|
+
| string
|
|
15
|
+
| EditorState
|
|
16
|
+
| ((editor: LexicalEditor) => void);
|
|
13
17
|
|
|
14
18
|
declare export function PlainTextPlugin({
|
|
15
19
|
contentEditable: React$Node,
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import {InitialEditorStateType} from '@lexical/rich-text';
|
|
10
|
+
import type {EditorState, LexicalEditor} from 'lexical';
|
|
10
11
|
|
|
11
|
-
type InitialEditorStateType = null | string | EditorState | (() => void);
|
|
12
12
|
export function RichTextPlugin(arg0: {
|
|
13
13
|
contentEditable: JSX.Element | null;
|
|
14
14
|
initialEditorState?: InitialEditorStateType;
|
|
@@ -7,9 +7,13 @@
|
|
|
7
7
|
* @flow strict
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type {EditorState} from 'lexical';
|
|
10
|
+
import type {EditorState, LexicalEditor} from 'lexical';
|
|
11
11
|
|
|
12
|
-
type InitialEditorStateType =
|
|
12
|
+
type InitialEditorStateType =
|
|
13
|
+
| null
|
|
14
|
+
| string
|
|
15
|
+
| EditorState
|
|
16
|
+
| ((editor: LexicalEditor) => void);
|
|
13
17
|
|
|
14
18
|
declare export function RichTextPlugin({
|
|
15
19
|
contentEditable: React$Node,
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -8,28 +8,28 @@
|
|
|
8
8
|
"rich-text"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.3.
|
|
11
|
+
"version": "0.3.3",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@lexical/clipboard": "0.3.
|
|
14
|
-
"@lexical/
|
|
15
|
-
"@lexical/
|
|
16
|
-
"@lexical/
|
|
17
|
-
"@lexical/
|
|
18
|
-
"@lexical/
|
|
19
|
-
"@lexical/
|
|
20
|
-
"@lexical/
|
|
21
|
-
"@lexical/
|
|
22
|
-
"@lexical/
|
|
23
|
-
"@lexical/
|
|
24
|
-
"@lexical/text": "0.3.
|
|
25
|
-
"@lexical/
|
|
26
|
-
"@lexical/
|
|
27
|
-
"@lexical/
|
|
28
|
-
"@lexical/
|
|
29
|
-
"@lexical/
|
|
13
|
+
"@lexical/clipboard": "0.3.3",
|
|
14
|
+
"@lexical/code": "0.3.3",
|
|
15
|
+
"@lexical/dragon": "0.3.3",
|
|
16
|
+
"@lexical/hashtag": "0.3.3",
|
|
17
|
+
"@lexical/history": "0.3.3",
|
|
18
|
+
"@lexical/link": "0.3.3",
|
|
19
|
+
"@lexical/list": "0.3.3",
|
|
20
|
+
"@lexical/mark": "0.3.3",
|
|
21
|
+
"@lexical/markdown": "0.3.3",
|
|
22
|
+
"@lexical/overflow": "0.3.3",
|
|
23
|
+
"@lexical/plain-text": "0.3.3",
|
|
24
|
+
"@lexical/rich-text": "0.3.3",
|
|
25
|
+
"@lexical/selection": "0.3.3",
|
|
26
|
+
"@lexical/table": "0.3.3",
|
|
27
|
+
"@lexical/text": "0.3.3",
|
|
28
|
+
"@lexical/utils": "0.3.3",
|
|
29
|
+
"@lexical/yjs": "0.3.3"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"lexical": "0.3.
|
|
32
|
+
"lexical": "0.3.3",
|
|
33
33
|
"react": ">=17.x",
|
|
34
34
|
"react-dom": ">=17.x"
|
|
35
35
|
},
|
|
@@ -37,5 +37,8 @@
|
|
|
37
37
|
"type": "git",
|
|
38
38
|
"url": "https://github.com/facebook/lexical",
|
|
39
39
|
"directory": "packages/lexical-react"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"utility-types": "^3.10.0"
|
|
40
43
|
}
|
|
41
44
|
}
|