Comparing version 0.94.0 to 0.94.1-202346224910
import { Ancestor, Descendant, Element, ExtendedType, Location, Node, NodeEntry, Operation, Path, PathRef, Point, PointRef, Range, RangeRef, Span, Text, Transforms } from '..'; | ||
import { LeafEdge, MaximizeMode, RangeDirection, SelectionMode, TextDirection, TextUnit, TextUnitAdjustment } from '../types/types'; | ||
import { OmitFirstArg } from '../utils/types'; | ||
import { TextInsertTextOptions } from './transforms/text'; | ||
import { TextInsertFragmentOptions, TextInsertTextOptions } from './transforms/text'; | ||
import { NodeInsertNodesOptions } from './transforms/node'; | ||
/** | ||
@@ -295,13 +296,11 @@ * The `Editor` interface stores all the state of a Slate editor. It is extended | ||
/** | ||
* Insert a fragment at the current selection. | ||
* | ||
* If the selection is currently expanded, it will be deleted first. | ||
* Inserts a fragment | ||
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document. | ||
*/ | ||
insertFragment: (editor: Editor, fragment: Node[]) => void; | ||
insertFragment: (editor: Editor, fragment: Node[], options?: TextInsertFragmentOptions) => void; | ||
/** | ||
* Insert a node at the current selection. | ||
* | ||
* If the selection is currently expanded, it will be deleted first. | ||
* Atomically inserts `nodes` | ||
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document. | ||
*/ | ||
insertNode: (editor: Editor, node: Node) => void; | ||
insertNode: <T extends Node>(editor: Editor, node: Node, options?: NodeInsertNodesOptions<T>) => void; | ||
/** | ||
@@ -314,5 +313,4 @@ * Insert a soft break at the current selection. | ||
/** | ||
* Insert text at the current selection. | ||
* | ||
* If the selection is currently expanded, it will be deleted first. | ||
* Insert a string of text | ||
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document. | ||
*/ | ||
@@ -319,0 +317,0 @@ insertText: (editor: Editor, text: string, options?: TextInsertTextOptions) => void; |
import { Editor, Element, Location, Node, Path } from '../../index'; | ||
import { NodeMatch, PropsCompare, PropsMerge } from '../editor'; | ||
import { MaximizeMode, RangeMode } from '../../types/types'; | ||
export interface NodeInsertNodesOptions<T extends Node> { | ||
at?: Location; | ||
match?: NodeMatch<T>; | ||
mode?: RangeMode; | ||
hanging?: boolean; | ||
select?: boolean; | ||
voids?: boolean; | ||
} | ||
export interface NodeTransforms { | ||
/** | ||
* Insert nodes at a specific location in the Editor. | ||
* Insert nodes in the editor | ||
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document. | ||
*/ | ||
insertNodes: <T extends Node>(editor: Editor, nodes: Node | Node[], options?: { | ||
at?: Location; | ||
match?: NodeMatch<T>; | ||
mode?: RangeMode; | ||
hanging?: boolean; | ||
select?: boolean; | ||
voids?: boolean; | ||
}) => void; | ||
insertNodes: <T extends Node>(editor: Editor, nodes: Node | Node[], options?: NodeInsertNodesOptions<T>) => void; | ||
/** | ||
@@ -17,0 +19,0 @@ * Lift nodes at a specific location upwards in the document tree, splitting |
@@ -26,7 +26,9 @@ import { Editor, Location, Node } from '../../index'; | ||
/** | ||
* Insert a fragment at a specific location in the editor. | ||
* Insert a fragment in the editor | ||
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document. | ||
*/ | ||
insertFragment: (editor: Editor, fragment: Node[], options?: TextInsertFragmentOptions) => void; | ||
/** | ||
* Insert a string of text in the Editor. | ||
* Insert a string of text in the editor | ||
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document. | ||
*/ | ||
@@ -33,0 +35,0 @@ insertText: (editor: Editor, text: string, options?: TextInsertTextOptions) => void; |
export * from './deep-equal'; | ||
export * from './get-default-insert-location'; | ||
export * from './match-path'; | ||
@@ -3,0 +4,0 @@ export * from './string'; |
{ | ||
"name": "slate", | ||
"description": "A completely customizable framework for building rich text editors.", | ||
"version": "0.94.0", | ||
"version": "0.94.1-202346224910", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/ianstormtaylor/slate.git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1938767
234
21340