@lexical/react 0.5.0 → 0.5.1-next.0
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/DEPRECATED_useLexicalDecorators.d.ts +2 -1
- package/DEPRECATED_useLexicalDecorators.dev.js +125 -10
- package/DEPRECATED_useLexicalDecorators.js.flow +8 -0
- package/DEPRECATED_useLexicalDecorators.prod.js +6 -2
- package/LexicalAutoEmbedPlugin.d.ts +3 -11
- package/LexicalAutoEmbedPlugin.dev.js +3 -18
- package/LexicalAutoEmbedPlugin.js.flow +3 -11
- package/LexicalAutoEmbedPlugin.prod.js +4 -5
- package/LexicalAutoLinkPlugin.dev.js +49 -46
- package/LexicalAutoLinkPlugin.prod.js +6 -6
- package/LexicalHorizontalRuleNode.dev.js +1 -1
- package/LexicalHorizontalRuleNode.prod.js +1 -1
- package/LexicalPlainTextPlugin.d.ts +3 -1
- package/LexicalPlainTextPlugin.dev.js +121 -5
- package/LexicalPlainTextPlugin.js.flow +3 -0
- package/LexicalPlainTextPlugin.prod.js +6 -4
- package/LexicalRichTextPlugin.d.ts +3 -1
- package/LexicalRichTextPlugin.dev.js +121 -5
- package/LexicalRichTextPlugin.js.flow +3 -0
- package/LexicalRichTextPlugin.prod.js +6 -4
- package/LexicalTreeView.dev.js +24 -9
- package/LexicalTreeView.prod.js +14 -13
- package/LexicalTypeaheadMenuPlugin.d.ts +20 -11
- package/LexicalTypeaheadMenuPlugin.dev.js +199 -59
- package/LexicalTypeaheadMenuPlugin.js.flow +19 -21
- package/LexicalTypeaheadMenuPlugin.prod.js +20 -16
- package/package.json +19 -19
- package/shared/ReactErrorBoundary.d.ts +63 -0
- package/shared/useDecorators.d.ts +8 -1
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
interface FallbackProps {
|
|
10
|
+
error: Error;
|
|
11
|
+
resetErrorBoundary: (...args: Array<unknown>) => void;
|
|
12
|
+
}
|
|
13
|
+
interface ErrorBoundaryPropsWithComponent {
|
|
14
|
+
onResetKeysChange?: (prevResetKeys: Array<unknown> | undefined, resetKeys: Array<unknown> | undefined) => void;
|
|
15
|
+
onReset?: (...args: Array<unknown>) => void;
|
|
16
|
+
onError?: (error: Error, info: {
|
|
17
|
+
componentStack: string;
|
|
18
|
+
}) => void;
|
|
19
|
+
resetKeys?: Array<unknown>;
|
|
20
|
+
fallback?: never;
|
|
21
|
+
FallbackComponent: React.ComponentType<FallbackProps>;
|
|
22
|
+
fallbackRender?: never;
|
|
23
|
+
}
|
|
24
|
+
declare function FallbackRender(props: FallbackProps): React.ReactElement<unknown, string | React.FunctionComponent | typeof React.Component> | null;
|
|
25
|
+
interface ErrorBoundaryPropsWithRender {
|
|
26
|
+
onResetKeysChange?: (prevResetKeys: Array<unknown> | undefined, resetKeys: Array<unknown> | undefined) => void;
|
|
27
|
+
onReset?: (...args: Array<unknown>) => void;
|
|
28
|
+
onError?: (error: Error, info: {
|
|
29
|
+
componentStack: string;
|
|
30
|
+
}) => void;
|
|
31
|
+
resetKeys?: Array<unknown>;
|
|
32
|
+
fallback?: never;
|
|
33
|
+
FallbackComponent?: never;
|
|
34
|
+
fallbackRender: typeof FallbackRender;
|
|
35
|
+
}
|
|
36
|
+
interface ErrorBoundaryPropsWithFallback {
|
|
37
|
+
onResetKeysChange?: (prevResetKeys: Array<unknown> | undefined, resetKeys: Array<unknown> | undefined) => void;
|
|
38
|
+
onReset?: (...args: Array<unknown>) => void;
|
|
39
|
+
onError?: (error: Error, info: {
|
|
40
|
+
componentStack: string;
|
|
41
|
+
}) => void;
|
|
42
|
+
resetKeys?: Array<unknown>;
|
|
43
|
+
fallback: React.ReactElement<unknown, string | React.FunctionComponent | typeof React.Component> | null;
|
|
44
|
+
FallbackComponent?: never;
|
|
45
|
+
fallbackRender?: never;
|
|
46
|
+
}
|
|
47
|
+
declare type ErrorBoundaryProps = ErrorBoundaryPropsWithFallback | ErrorBoundaryPropsWithComponent | ErrorBoundaryPropsWithRender;
|
|
48
|
+
declare type ErrorBoundaryState = {
|
|
49
|
+
error: Error | null;
|
|
50
|
+
};
|
|
51
|
+
declare class ErrorBoundary extends React.Component<React.PropsWithRef<React.PropsWithChildren<ErrorBoundaryProps>>, ErrorBoundaryState> {
|
|
52
|
+
state: ErrorBoundaryState;
|
|
53
|
+
constructor(props: ErrorBoundaryProps);
|
|
54
|
+
static getDerivedStateFromError(error: Error): {
|
|
55
|
+
error: Error;
|
|
56
|
+
};
|
|
57
|
+
resetErrorBoundary(...args: Array<unknown>): void;
|
|
58
|
+
reset(): void;
|
|
59
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
60
|
+
componentDidUpdate(prevProps: ErrorBoundaryProps, prevState: ErrorBoundaryState): void;
|
|
61
|
+
render(): string | number | boolean | JSX.Element | React.ReactFragment | null | undefined;
|
|
62
|
+
}
|
|
63
|
+
export { ErrorBoundary };
|
|
@@ -6,4 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import type { LexicalEditor } from 'lexical';
|
|
9
|
-
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
declare type ErrorBoundaryProps = {
|
|
11
|
+
children: JSX.Element;
|
|
12
|
+
onError: (error: Error) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare type ErrorBoundaryType = React.ComponentClass<ErrorBoundaryProps> | React.FC<ErrorBoundaryProps>;
|
|
15
|
+
export declare function useDecorators(editor: LexicalEditor, ErrorBoundary?: ErrorBoundaryType): Array<JSX.Element>;
|
|
16
|
+
export {};
|