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.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<SerializedNode>(
168
- maybeStringifiedEditorState: string | SerializedEditorState<SerializedNode>,
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<SerializedNode>(): SerializedEditorState<SerializedNode>;
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: Node) => DOMConversion | null,
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<SerializedNode> {
881
- root: SerializedRootNode<SerializedNode>;
885
+ export interface SerializedEditorState {
886
+ root: SerializedRootNode;
882
887
  }
883
888
 
884
- export type SerializedEditor<SerializedNode> = {
885
- editorState: SerializedEditorState<SerializedNode>,
889
+ export type SerializedEditor = {
890
+ editorState: SerializedEditorState,
886
891
  };