@lexical/react 0.3.1 → 0.3.4

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.
Files changed (75) hide show
  1. package/DEPRECATED_useLexical.d.ts +19 -0
  2. package/DEPRECATED_useLexical.js.flow +4 -1
  3. package/DEPRECATED_useLexicalAutoFormatter.d.ts +9 -0
  4. package/DEPRECATED_useLexicalAutoFormatter.js.flow +4 -1
  5. package/DEPRECATED_useLexicalCanShowPlaceholder.d.ts +9 -0
  6. package/DEPRECATED_useLexicalCanShowPlaceholder.js.flow +4 -1
  7. package/DEPRECATED_useLexicalCharacterLimit.d.ts +8 -0
  8. package/DEPRECATED_useLexicalCharacterLimit.js.flow +4 -1
  9. package/DEPRECATED_useLexicalDecorators.d.ts +9 -0
  10. package/DEPRECATED_useLexicalDecorators.js.flow +4 -1
  11. package/DEPRECATED_useLexicalEditor.d.ts +9 -0
  12. package/DEPRECATED_useLexicalEditorEvents.d.ts +10 -0
  13. package/DEPRECATED_useLexicalEditorEvents.js.flow +4 -1
  14. package/DEPRECATED_useLexicalHistory.d.ts +12 -0
  15. package/DEPRECATED_useLexicalHistory.js.flow +4 -1
  16. package/DEPRECATED_useLexicalList.d.ts +9 -0
  17. package/DEPRECATED_useLexicalList.js.flow +4 -1
  18. package/DEPRECATED_useLexicalPlainText.d.ts +10 -0
  19. package/DEPRECATED_useLexicalPlainText.js.flow +4 -1
  20. package/DEPRECATED_useLexicalRichText.d.ts +10 -0
  21. package/DEPRECATED_useLexicalRichText.js.flow +4 -1
  22. package/LexicalAutoFocusPlugin.d.ts +1 -2
  23. package/LexicalAutoLinkPlugin.d.ts +12 -12
  24. package/LexicalAutoScrollPlugin.d.ts +6 -4
  25. package/LexicalBlockWithAlignableContents.d.ts +11 -8
  26. package/LexicalBlockWithAlignableContents.dev.js +3 -2
  27. package/LexicalBlockWithAlignableContents.js.flow +4 -0
  28. package/LexicalBlockWithAlignableContents.prod.js +4 -4
  29. package/LexicalCharacterLimitPlugin.d.ts +3 -4
  30. package/LexicalCheckListPlugin.d.ts +1 -2
  31. package/LexicalClearEditorPlugin.d.ts +4 -4
  32. package/LexicalCollaborationPlugin.d.ts +17 -31
  33. package/LexicalComposer.d.ts +16 -14
  34. package/LexicalComposer.dev.js +41 -1
  35. package/LexicalComposer.js.flow +1 -1
  36. package/LexicalComposer.prod.js +3 -2
  37. package/LexicalComposerContext.d.ts +10 -15
  38. package/LexicalContentEditable.d.ts +24 -23
  39. package/LexicalContentEditable.js.flow +1 -1
  40. package/LexicalDecoratorBlockNode.d.ts +13 -24
  41. package/LexicalHashtagPlugin.d.ts +1 -2
  42. package/LexicalHistoryPlugin.d.ts +6 -23
  43. package/LexicalHorizontalRuleNode.d.ts +19 -17
  44. package/LexicalLinkPlugin.d.ts +1 -2
  45. package/LexicalLinkPlugin.dev.js +1 -0
  46. package/LexicalListPlugin.d.ts +1 -2
  47. package/LexicalMarkdownShortcutPlugin.d.ts +4 -6
  48. package/LexicalNestedComposer.d.ts +6 -8
  49. package/LexicalNestedComposer.dev.js +1 -0
  50. package/LexicalNestedComposer.prod.js +2 -2
  51. package/LexicalOnChangePlugin.d.ts +5 -7
  52. package/LexicalPlainTextPlugin.d.ts +6 -9
  53. package/LexicalPlainTextPlugin.dev.js +25 -1
  54. package/LexicalPlainTextPlugin.js.flow +6 -2
  55. package/LexicalPlainTextPlugin.prod.js +3 -3
  56. package/LexicalRichTextPlugin.d.ts +6 -9
  57. package/LexicalRichTextPlugin.dev.js +25 -1
  58. package/LexicalRichTextPlugin.js.flow +6 -2
  59. package/LexicalRichTextPlugin.prod.js +3 -3
  60. package/LexicalTablePlugin.d.ts +1 -2
  61. package/LexicalTreeView.d.ts +9 -11
  62. package/README.md +1 -2
  63. package/package.json +22 -19
  64. package/shared/useCanShowPlaceholder.d.ts +9 -0
  65. package/shared/useCharacterLimit.d.ts +16 -0
  66. package/shared/useDecorators.d.ts +9 -0
  67. package/shared/useEditorEvents.d.ts +10 -0
  68. package/shared/useHistory.d.ts +10 -0
  69. package/shared/useList.d.ts +9 -0
  70. package/shared/usePlainTextSetup.d.ts +10 -0
  71. package/shared/useRichTextSetup.d.ts +10 -0
  72. package/shared/useYjsCollaboration.d.ts +14 -0
  73. package/useLexicalIsTextContentEmpty.d.ts +2 -7
  74. package/useLexicalNodeSelection.d.ts +2 -6
  75. package/useLexicalTextEntity.d.ts +4 -13
@@ -0,0 +1,10 @@
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 type { HistoryState } from '@lexical/history';
9
+ import type { LexicalEditor } from 'lexical';
10
+ export declare function useHistory(editor: LexicalEditor, externalHistoryState?: HistoryState, delay?: number): void;
@@ -0,0 +1,9 @@
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 type { LexicalEditor } from 'lexical';
9
+ export declare function useList(editor: LexicalEditor): void;
@@ -0,0 +1,10 @@
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 type { LexicalEditor } from 'lexical';
9
+ import { InitialEditorStateType } from '@lexical/plain-text';
10
+ export declare function usePlainTextSetup(editor: LexicalEditor, initialEditorState?: InitialEditorStateType): void;
@@ -0,0 +1,10 @@
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 type { InitialEditorStateType } from '@lexical/rich-text';
9
+ import type { LexicalEditor } from 'lexical';
10
+ export declare function useRichTextSetup(editor: LexicalEditor, initialEditorState?: InitialEditorStateType): void;
@@ -0,0 +1,14 @@
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 type { Binding } from '@lexical/yjs';
9
+ import type { LexicalEditor } from 'lexical';
10
+ import type { Doc } from 'yjs';
11
+ import { WebsocketProvider } from 'y-websocket';
12
+ export declare function useYjsCollaboration(editor: LexicalEditor, id: string, provider: WebsocketProvider, docMap: Map<string, Doc>, name: string, color: string, shouldBootstrap: boolean): [JSX.Element, Binding];
13
+ export declare function useYjsFocusTracking(editor: LexicalEditor, provider: WebsocketProvider, name: string, color: string): void;
14
+ export declare function useYjsHistory(editor: LexicalEditor, binding: Binding): () => void;
@@ -5,10 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
-
9
- import type {LexicalEditor} from 'lexical';
10
-
11
- export function useLexicalIsTextContentEmpty(
12
- editor: LexicalEditor,
13
- trim?: boolean,
14
- ): boolean;
8
+ import type { LexicalEditor } from 'lexical';
9
+ export declare function useLexicalIsTextContentEmpty(editor: LexicalEditor, trim?: boolean): boolean;
@@ -5,9 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
-
9
- import type {NodeKey} from 'lexical';
10
-
11
- export function useLexicalNodeSelection(
12
- key: NodeKey,
13
- ): [boolean, (arg0: boolean) => void, () => void];
8
+ import type { NodeKey } from 'lexical';
9
+ export declare function useLexicalNodeSelection(key: NodeKey): [boolean, (arg0: boolean) => void, () => void];
@@ -5,16 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
-
9
- import {Class} from 'utility-types';
10
- import type {TextNode} from 'lexical';
11
-
12
- export type EntityMatch = {
13
- end: number;
14
- start: number;
15
- };
16
- export function useLexicalTextEntity<N extends TextNode>(
17
- getMatch: (text: string) => null | EntityMatch,
18
- targetNode: Class<N>,
19
- createNode: (textNode: TextNode) => N,
20
- ): void;
8
+ import type { EntityMatch } from '@lexical/text';
9
+ import type { TextNode } from 'lexical';
10
+ import type { Klass } from 'shared/types';
11
+ export declare function useLexicalTextEntity<N extends TextNode>(getMatch: (text: string) => null | EntityMatch, targetNode: Klass<N>, createNode: (textNode: TextNode) => N): void;