lexical 0.3.9 → 0.4.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/Lexical.js.flow CHANGED
@@ -82,7 +82,7 @@ export type MutationListener = (
82
82
  nodes: Map<NodeKey, NodeMutation>,
83
83
  {updateTags: Set<string>, dirtyLeaves: Set<string>},
84
84
  ) => void;
85
- export type ReadOnlyListener = (readOnly: boolean) => void;
85
+ export type EditableListener = (editable: boolean) => void;
86
86
  type Listeners = {
87
87
  decorator: Set<DecoratorListener>,
88
88
  mutation: MutationListeners,
@@ -135,7 +135,7 @@ declare export class LexicalEditor {
135
135
  _updateTags: Set<string>;
136
136
  _observer: null | MutationObserver;
137
137
  _key: string;
138
- _readOnly: boolean;
138
+ _editable: boolean;
139
139
  _headless: boolean;
140
140
  isComposing(): boolean;
141
141
  registerUpdateListener(listener: UpdateListener): () => void;
@@ -147,7 +147,7 @@ declare export class LexicalEditor {
147
147
  listener: CommandListener<P>,
148
148
  priority: CommandListenerPriority,
149
149
  ): () => void;
150
- registerReadOnlyListener(listener: ReadOnlyListener): () => void;
150
+ registerEditableListener(listener: EditableListener): () => void;
151
151
  registerMutationListener(
152
152
  klass: Class<LexicalNode>,
153
153
  listener: MutationListener,
@@ -174,8 +174,8 @@ declare export class LexicalEditor {
174
174
  update(updateFn: () => void, options?: EditorUpdateOptions): boolean;
175
175
  focus(callbackFn?: () => void, options?: EditorFocusOptions): void;
176
176
  blur(): void;
177
- isReadOnly(): boolean;
178
- setReadOnly(readOnly: boolean): void;
177
+ isEditable(): boolean;
178
+ setEditable(editable: boolean): void;
179
179
  toJSON(): SerializedEditor;
180
180
  }
181
181
  type EditorUpdateOptions = {
@@ -268,7 +268,7 @@ declare export function createEditor(editorConfig?: {
268
268
  nodes?: $ReadOnlyArray<Class<LexicalNode>>,
269
269
  onError: (error: Error) => void,
270
270
  disableEvents?: boolean,
271
- readOnly?: boolean,
271
+ editable?: boolean,
272
272
  }): LexicalEditor;
273
273
 
274
274
  /**