lexical 0.2.5 → 0.2.6
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/Lexical.d.ts +25 -16
- package/Lexical.dev.js +265 -340
- package/Lexical.js.flow +19 -12
- package/Lexical.prod.js +158 -160
- package/package.json +1 -1
package/Lexical.js.flow
CHANGED
|
@@ -31,6 +31,7 @@ declare export var KEY_ARROW_LEFT_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
|
31
31
|
declare export var KEY_ARROW_UP_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
32
32
|
declare export var KEY_ARROW_DOWN_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
33
33
|
declare export var KEY_ENTER_COMMAND: LexicalCommand<KeyboardEvent | null>;
|
|
34
|
+
declare export var KEY_SPACE_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
34
35
|
declare export var KEY_BACKSPACE_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
35
36
|
declare export var KEY_ESCAPE_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
36
37
|
declare export var KEY_DELETE_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
@@ -131,6 +132,7 @@ declare export class LexicalEditor {
|
|
|
131
132
|
_observer: null | MutationObserver;
|
|
132
133
|
_key: string;
|
|
133
134
|
_readOnly: boolean;
|
|
135
|
+
_headless: boolean;
|
|
134
136
|
isComposing(): boolean;
|
|
135
137
|
registerUpdateListener(listener: UpdateListener): () => void;
|
|
136
138
|
registerRootListener(listener: RootListener): () => void;
|
|
@@ -150,7 +152,7 @@ declare export class LexicalEditor {
|
|
|
150
152
|
klass: Class<T>,
|
|
151
153
|
listener: Transform<T>,
|
|
152
154
|
): () => void;
|
|
153
|
-
dispatchCommand<P>(command: LexicalCommand<P>, payload
|
|
155
|
+
dispatchCommand<P>(command: LexicalCommand<P>, payload: P): boolean;
|
|
154
156
|
hasNodes(nodes: Array<Class<LexicalNode>>): boolean;
|
|
155
157
|
getKey(): string;
|
|
156
158
|
getDecorators<X>(): {
|
|
@@ -161,7 +163,9 @@ declare export class LexicalEditor {
|
|
|
161
163
|
getElementByKey(key: NodeKey): null | HTMLElement;
|
|
162
164
|
getEditorState(): EditorState;
|
|
163
165
|
setEditorState(editorState: EditorState, options?: EditorSetOptions): void;
|
|
164
|
-
parseEditorState(
|
|
166
|
+
parseEditorState(
|
|
167
|
+
maybeStringifiedEditorState: string | ParsedEditorState,
|
|
168
|
+
): EditorState;
|
|
165
169
|
update(updateFn: () => void, options?: EditorUpdateOptions): boolean;
|
|
166
170
|
focus(callbackFn?: () => void): void;
|
|
167
171
|
blur(): void;
|
|
@@ -185,11 +189,12 @@ type TextNodeThemeClasses = {
|
|
|
185
189
|
underlineStrikethrough?: EditorThemeClassName,
|
|
186
190
|
italic?: EditorThemeClassName,
|
|
187
191
|
code?: EditorThemeClassName,
|
|
192
|
+
subscript?: EditorThemeClassName,
|
|
193
|
+
superscript?: EditorThemeClassName,
|
|
188
194
|
};
|
|
189
195
|
export type EditorThemeClasses = {
|
|
190
196
|
ltr?: EditorThemeClassName,
|
|
191
197
|
rtl?: EditorThemeClassName,
|
|
192
|
-
root?: EditorThemeClassName,
|
|
193
198
|
text?: TextNodeThemeClasses,
|
|
194
199
|
paragraph?: EditorThemeClassName,
|
|
195
200
|
image?: EditorThemeClassName,
|
|
@@ -199,6 +204,8 @@ export type EditorThemeClasses = {
|
|
|
199
204
|
ol?: EditorThemeClassName,
|
|
200
205
|
olDepth?: Array<EditorThemeClassName>,
|
|
201
206
|
listitem?: EditorThemeClassName,
|
|
207
|
+
listitemChecked?: EditorThemeClassName,
|
|
208
|
+
listitemUnchecked?: EditorThemeClassName,
|
|
202
209
|
nested?: {
|
|
203
210
|
list?: EditorThemeClassName,
|
|
204
211
|
listitem?: EditorThemeClassName,
|
|
@@ -208,6 +215,8 @@ export type EditorThemeClasses = {
|
|
|
208
215
|
tableRow?: EditorThemeClassName,
|
|
209
216
|
tableCell?: EditorThemeClassName,
|
|
210
217
|
tableCellHeader?: EditorThemeClassName,
|
|
218
|
+
mark?: EditorThemeClassName,
|
|
219
|
+
markOverlap?: EditorThemeClassName,
|
|
211
220
|
link?: EditorThemeClassName,
|
|
212
221
|
quote?: EditorThemeClassName,
|
|
213
222
|
code?: EditorThemeClassName,
|
|
@@ -347,7 +356,6 @@ declare export class LexicalNode {
|
|
|
347
356
|
isParentOf(targetNode: LexicalNode): boolean;
|
|
348
357
|
getNodesBetween(targetNode: LexicalNode): Array<LexicalNode>;
|
|
349
358
|
isDirty(): boolean;
|
|
350
|
-
isComposing(): boolean;
|
|
351
359
|
// $FlowFixMe
|
|
352
360
|
getLatest<T: LexicalNode>(this: T): T;
|
|
353
361
|
// $FlowFixMe
|
|
@@ -584,9 +592,6 @@ export type TextFormatType =
|
|
|
584
592
|
| 'subscript'
|
|
585
593
|
| 'superscript';
|
|
586
594
|
type TextModeType = 'normal' | 'token' | 'segmented' | 'inert';
|
|
587
|
-
export type TextMark = {end: null | number, id: string, start: null | number};
|
|
588
|
-
|
|
589
|
-
export type TextMarks = Array<TextMark>;
|
|
590
595
|
|
|
591
596
|
declare export class TextNode extends LexicalNode {
|
|
592
597
|
__text: string;
|
|
@@ -594,15 +599,12 @@ declare export class TextNode extends LexicalNode {
|
|
|
594
599
|
__style: string;
|
|
595
600
|
__mode: 0 | 1 | 2 | 3;
|
|
596
601
|
__detail: number;
|
|
597
|
-
__marks: null | TextMarks;
|
|
598
602
|
static getType(): string;
|
|
599
603
|
static clone(node: $FlowFixMe): TextNode;
|
|
600
604
|
constructor(text: string, key?: NodeKey): void;
|
|
601
605
|
getFormat(): number;
|
|
602
|
-
getMark(id: string): null | TextMark;
|
|
603
|
-
setMark(id: string, start: null | number, end: null | number): void;
|
|
604
|
-
deleteMark(id: string): void;
|
|
605
606
|
getStyle(): string;
|
|
607
|
+
isComposing(): boolean;
|
|
606
608
|
isToken(): boolean;
|
|
607
609
|
isSegmented(): boolean;
|
|
608
610
|
isInert(): boolean;
|
|
@@ -727,10 +729,15 @@ declare export class ElementNode extends LexicalNode {
|
|
|
727
729
|
canInsertTab(): boolean;
|
|
728
730
|
canIndent(): boolean;
|
|
729
731
|
collapseAtStart(selection: RangeSelection): boolean;
|
|
730
|
-
excludeFromCopy(): boolean;
|
|
732
|
+
excludeFromCopy(destination: 'clone' | 'html'): boolean;
|
|
731
733
|
canExtractContents(): boolean;
|
|
732
734
|
canReplaceWith(replacement: LexicalNode): boolean;
|
|
733
735
|
canInsertAfter(node: LexicalNode): boolean;
|
|
736
|
+
extractWithChild(
|
|
737
|
+
child: LexicalNode,
|
|
738
|
+
selection: RangeSelection | NodeSelection | GridSelection,
|
|
739
|
+
destination: 'clone' | 'html',
|
|
740
|
+
): boolean;
|
|
734
741
|
canBeEmpty(): boolean;
|
|
735
742
|
canInsertTextBefore(): boolean;
|
|
736
743
|
canInsertTextAfter(): boolean;
|