lexical 0.3.3 → 0.3.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.dev.js +378 -293
- package/Lexical.js.flow +15 -10
- package/Lexical.prod.js +174 -171
- package/LexicalCommands.d.ts +50 -0
- package/LexicalConstants.d.ts +43 -0
- package/LexicalEditor.d.ts +199 -0
- package/LexicalEditorState.d.ts +28 -0
- package/LexicalEvents.d.ts +14 -0
- package/LexicalGC.d.ts +12 -0
- package/LexicalMutations.d.ts +12 -0
- package/LexicalNode.d.ts +82 -0
- package/LexicalNormalization.d.ts +9 -0
- package/LexicalReconciler.d.ts +12 -0
- package/LexicalSelection.d.ts +147 -0
- package/LexicalUpdates.d.ts +25 -0
- package/LexicalUtils.d.ts +94 -0
- package/LexicalVersion.d.ts +8 -0
- package/index.d.ts +31 -0
- package/nodes/LexicalDecoratorNode.d.ts +18 -0
- package/nodes/LexicalElementNode.d.ts +71 -0
- package/nodes/LexicalGridCellNode.d.ts +18 -0
- package/nodes/LexicalGridNode.d.ts +12 -0
- package/nodes/LexicalGridRowNode.d.ts +12 -0
- package/nodes/LexicalLineBreakNode.d.ts +26 -0
- package/nodes/LexicalParagraphNode.d.ts +30 -0
- package/nodes/LexicalRootNode.d.ts +29 -0
- package/nodes/LexicalTextNode.d.ts +75 -0
- package/package.json +1 -5
- package/Lexical.d.ts +0 -853
package/Lexical.js.flow
CHANGED
|
@@ -164,8 +164,8 @@ declare export class LexicalEditor {
|
|
|
164
164
|
getElementByKey(key: NodeKey): null | HTMLElement;
|
|
165
165
|
getEditorState(): EditorState;
|
|
166
166
|
setEditorState(editorState: EditorState, options?: EditorSetOptions): void;
|
|
167
|
-
parseEditorState
|
|
168
|
-
maybeStringifiedEditorState: string | SerializedEditorState
|
|
167
|
+
parseEditorState(
|
|
168
|
+
maybeStringifiedEditorState: string | SerializedEditorState,
|
|
169
169
|
updateFn?: () => void,
|
|
170
170
|
): EditorState;
|
|
171
171
|
update(updateFn: () => void, options?: EditorUpdateOptions): boolean;
|
|
@@ -173,7 +173,7 @@ declare export class LexicalEditor {
|
|
|
173
173
|
blur(): void;
|
|
174
174
|
isReadOnly(): boolean;
|
|
175
175
|
setReadOnly(readOnly: boolean): void;
|
|
176
|
-
toJSON(): SerializedEditor
|
|
176
|
+
toJSON(): SerializedEditor;
|
|
177
177
|
}
|
|
178
178
|
type EditorUpdateOptions = {
|
|
179
179
|
onUpdate?: () => void,
|
|
@@ -196,6 +196,7 @@ type TextNodeThemeClasses = {
|
|
|
196
196
|
superscript?: EditorThemeClassName,
|
|
197
197
|
};
|
|
198
198
|
export type EditorThemeClasses = {
|
|
199
|
+
characterLimit?: EditorThemeClassName,
|
|
199
200
|
ltr?: EditorThemeClassName,
|
|
200
201
|
rtl?: EditorThemeClassName,
|
|
201
202
|
text?: TextNodeThemeClasses,
|
|
@@ -233,6 +234,10 @@ export type EditorThemeClasses = {
|
|
|
233
234
|
h5?: EditorThemeClassName,
|
|
234
235
|
h6?: EditorThemeClassName,
|
|
235
236
|
},
|
|
237
|
+
embedBlock?: {
|
|
238
|
+
base?: EditorThemeClassName,
|
|
239
|
+
focus?: EditorThemeClassName,
|
|
240
|
+
},
|
|
236
241
|
// Handle other generic values
|
|
237
242
|
[string]: EditorThemeClassName | {[string]: EditorThemeClassName},
|
|
238
243
|
};
|
|
@@ -275,7 +280,7 @@ export interface EditorState {
|
|
|
275
280
|
): void;
|
|
276
281
|
isEmpty(): boolean;
|
|
277
282
|
read<V>(callbackFn: () => V): V;
|
|
278
|
-
toJSON
|
|
283
|
+
toJSON(): SerializedEditorState;
|
|
279
284
|
clone(
|
|
280
285
|
selection?: RangeSelection | NodeSelection | GridSelection | null,
|
|
281
286
|
): EditorState;
|
|
@@ -298,7 +303,7 @@ export type DOMChildConversion = (
|
|
|
298
303
|
parentLexicalNode: ?LexicalNode | null,
|
|
299
304
|
) => LexicalNode | null | void;
|
|
300
305
|
export type DOMConversionMap = {
|
|
301
|
-
[NodeName]: (node:
|
|
306
|
+
[NodeName]: <T: HTMLElement>(node: T) => DOMConversion | null,
|
|
302
307
|
};
|
|
303
308
|
type NodeName = string;
|
|
304
309
|
export type DOMConversionOutput = {
|
|
@@ -729,7 +734,7 @@ declare export function $isElementNode(
|
|
|
729
734
|
|
|
730
735
|
declare export class DecoratorNode<X> extends LexicalNode {
|
|
731
736
|
constructor(key?: NodeKey): void;
|
|
732
|
-
decorate(editor: LexicalEditor): X;
|
|
737
|
+
decorate(editor: LexicalEditor, config: EditorConfig): X;
|
|
733
738
|
isIsolated(): boolean;
|
|
734
739
|
isTopLevel(): boolean;
|
|
735
740
|
}
|
|
@@ -877,10 +882,10 @@ export type SerializedGridCellNode = {
|
|
|
877
882
|
...
|
|
878
883
|
};
|
|
879
884
|
|
|
880
|
-
export interface SerializedEditorState
|
|
881
|
-
root: SerializedRootNode
|
|
885
|
+
export interface SerializedEditorState {
|
|
886
|
+
root: SerializedRootNode;
|
|
882
887
|
}
|
|
883
888
|
|
|
884
|
-
export type SerializedEditor
|
|
885
|
-
editorState: SerializedEditorState
|
|
889
|
+
export type SerializedEditor = {
|
|
890
|
+
editorState: SerializedEditorState,
|
|
886
891
|
};
|