slate 0.56.1 → 0.57.3
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/dist/create-editor.d.ts +1 -1
- package/dist/create-editor.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +4435 -6433
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4435 -6434
- package/dist/index.js.map +1 -1
- package/dist/interfaces/editor.d.ts +344 -0
- package/dist/interfaces/editor.d.ts.map +1 -0
- package/dist/interfaces/text.d.ts +5 -0
- package/dist/interfaces/text.d.ts.map +1 -1
- package/dist/slate.js +8269 -7673
- package/dist/slate.min.js +3 -3
- package/dist/transforms/general.d.ts +8 -0
- package/dist/transforms/general.d.ts.map +1 -0
- package/dist/transforms/index.d.ts +108 -0
- package/dist/transforms/index.d.ts.map +1 -0
- package/dist/{interfaces/editor/transforms → transforms}/node.d.ts +1 -1
- package/dist/transforms/node.d.ts.map +1 -0
- package/dist/{interfaces/editor/transforms → transforms}/selection.d.ts +1 -1
- package/dist/transforms/selection.d.ts.map +1 -0
- package/dist/{interfaces/editor/transforms → transforms}/text.d.ts +1 -1
- package/dist/transforms/text.d.ts.map +1 -0
- package/dist/utils/string.d.ts +12 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/weak-maps.d.ts +8 -0
- package/dist/utils/weak-maps.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/interfaces/command.d.ts +0 -91
- package/dist/interfaces/command.d.ts.map +0 -1
- package/dist/interfaces/editor/index.d.ts +0 -235
- package/dist/interfaces/editor/index.d.ts.map +0 -1
- package/dist/interfaces/editor/queries/element.d.ts +0 -20
- package/dist/interfaces/editor/queries/element.d.ts.map +0 -1
- package/dist/interfaces/editor/queries/general.d.ts +0 -69
- package/dist/interfaces/editor/queries/general.d.ts.map +0 -1
- package/dist/interfaces/editor/queries/location.d.ts +0 -170
- package/dist/interfaces/editor/queries/location.d.ts.map +0 -1
- package/dist/interfaces/editor/queries/range.d.ts +0 -10
- package/dist/interfaces/editor/queries/range.d.ts.map +0 -1
- package/dist/interfaces/editor/transforms/general.d.ts +0 -15
- package/dist/interfaces/editor/transforms/general.d.ts.map +0 -1
- package/dist/interfaces/editor/transforms/node.d.ts.map +0 -1
- package/dist/interfaces/editor/transforms/selection.d.ts.map +0 -1
- package/dist/interfaces/editor/transforms/text.d.ts.map +0 -1
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { Ancestor, Descendant, Editor, Element, Location, Node, NodeEntry, Path, Point, Range, Span, Text } from '../../..';
|
|
2
|
-
export declare const LocationQueries: {
|
|
3
|
-
/**
|
|
4
|
-
* Get the ancestor above a location in the document.
|
|
5
|
-
*/
|
|
6
|
-
above<T extends Ancestor>(editor: Editor, options?: {
|
|
7
|
-
at?: Path | Point | Range | undefined;
|
|
8
|
-
match?: ((node: Node) => boolean) | ((node: Node) => node is T) | undefined;
|
|
9
|
-
mode?: "highest" | "lowest" | undefined;
|
|
10
|
-
voids?: boolean | undefined;
|
|
11
|
-
}): NodeEntry<T> | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Get the point after a location.
|
|
14
|
-
*/
|
|
15
|
-
after(editor: Editor, at: Location, options?: {
|
|
16
|
-
distance?: number | undefined;
|
|
17
|
-
unit?: "offset" | "character" | "word" | "line" | "block" | undefined;
|
|
18
|
-
}): Point | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Get the point before a location.
|
|
21
|
-
*/
|
|
22
|
-
before(editor: Editor, at: Location, options?: {
|
|
23
|
-
distance?: number | undefined;
|
|
24
|
-
unit?: "offset" | "character" | "word" | "line" | "block" | undefined;
|
|
25
|
-
}): Point | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Get the start and end points of a location.
|
|
28
|
-
*/
|
|
29
|
-
edges(editor: Editor, at: Location): [Point, Point];
|
|
30
|
-
/**
|
|
31
|
-
* Get the end point of a location.
|
|
32
|
-
*/
|
|
33
|
-
end(editor: Editor, at: Location): Point;
|
|
34
|
-
/**
|
|
35
|
-
* Get the first node at a location.
|
|
36
|
-
*/
|
|
37
|
-
first(editor: Editor, at: Location): NodeEntry<Node>;
|
|
38
|
-
/**
|
|
39
|
-
* Get the fragment at a location.
|
|
40
|
-
*/
|
|
41
|
-
fragment(editor: Editor, at: Location): Descendant[];
|
|
42
|
-
/**
|
|
43
|
-
* Check if a point is the end point of a location.
|
|
44
|
-
*/
|
|
45
|
-
isEnd(editor: Editor, point: Point, at: Location): boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Check if a point is an edge of a location.
|
|
48
|
-
*/
|
|
49
|
-
isEdge(editor: Editor, point: Point, at: Location): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Check if a point is the start point of a location.
|
|
52
|
-
*/
|
|
53
|
-
isStart(editor: Editor, point: Point, at: Location): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Get the last node at a location.
|
|
56
|
-
*/
|
|
57
|
-
last(editor: Editor, at: Location): NodeEntry<Node>;
|
|
58
|
-
/**
|
|
59
|
-
* Get the leaf text node at a location.
|
|
60
|
-
*/
|
|
61
|
-
leaf(editor: Editor, at: Location, options?: {
|
|
62
|
-
depth?: number | undefined;
|
|
63
|
-
edge?: "start" | "end" | undefined;
|
|
64
|
-
}): NodeEntry<Text>;
|
|
65
|
-
/**
|
|
66
|
-
* Iterate through all of the levels at a location.
|
|
67
|
-
*/
|
|
68
|
-
levels<T_1 extends Node>(editor: Editor, options?: {
|
|
69
|
-
at?: Path | Point | Range | undefined;
|
|
70
|
-
match?: ((node: Node) => boolean) | ((node: Node) => node is T_1) | undefined;
|
|
71
|
-
reverse?: boolean | undefined;
|
|
72
|
-
voids?: boolean | undefined;
|
|
73
|
-
}): Iterable<NodeEntry<T_1>>;
|
|
74
|
-
/**
|
|
75
|
-
* Get the matching node in the branch of the document after a location.
|
|
76
|
-
*/
|
|
77
|
-
next<T_2 extends Node>(editor: Editor, options?: {
|
|
78
|
-
at?: Path | Point | Range | undefined;
|
|
79
|
-
match?: ((node: Node) => boolean) | ((node: Node) => node is T_2) | undefined;
|
|
80
|
-
mode?: "highest" | "lowest" | "all" | undefined;
|
|
81
|
-
voids?: boolean | undefined;
|
|
82
|
-
}): NodeEntry<T_2> | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* Get the node at a location.
|
|
85
|
-
*/
|
|
86
|
-
node(editor: Editor, at: Location, options?: {
|
|
87
|
-
depth?: number | undefined;
|
|
88
|
-
edge?: "start" | "end" | undefined;
|
|
89
|
-
}): NodeEntry<Node>;
|
|
90
|
-
/**
|
|
91
|
-
* Iterate through all of the nodes in the Editor.
|
|
92
|
-
*/
|
|
93
|
-
nodes<T_3 extends Node>(editor: Editor, options?: {
|
|
94
|
-
at?: Path | Point | Range | Span | undefined;
|
|
95
|
-
match?: ((node: Node) => boolean) | ((node: Node) => node is T_3) | undefined;
|
|
96
|
-
mode?: "highest" | "lowest" | "all" | undefined;
|
|
97
|
-
universal?: boolean | undefined;
|
|
98
|
-
reverse?: boolean | undefined;
|
|
99
|
-
voids?: boolean | undefined;
|
|
100
|
-
}): Iterable<NodeEntry<T_3>>;
|
|
101
|
-
/**
|
|
102
|
-
* Get the parent node of a location.
|
|
103
|
-
*/
|
|
104
|
-
parent(editor: Editor, at: Location, options?: {
|
|
105
|
-
depth?: number | undefined;
|
|
106
|
-
edge?: "start" | "end" | undefined;
|
|
107
|
-
}): NodeEntry<Ancestor>;
|
|
108
|
-
/**
|
|
109
|
-
* Get the path of a location.
|
|
110
|
-
*/
|
|
111
|
-
path(editor: Editor, at: Location, options?: {
|
|
112
|
-
depth?: number | undefined;
|
|
113
|
-
edge?: "start" | "end" | undefined;
|
|
114
|
-
}): Path;
|
|
115
|
-
/**
|
|
116
|
-
* Get the start or end point of a location.
|
|
117
|
-
*/
|
|
118
|
-
point(editor: Editor, at: Location, options?: {
|
|
119
|
-
edge?: "start" | "end" | undefined;
|
|
120
|
-
}): Point;
|
|
121
|
-
/**
|
|
122
|
-
* Iterate through all of the positions in the document where a `Point` can be
|
|
123
|
-
* placed.
|
|
124
|
-
*
|
|
125
|
-
* By default it will move forward by individual offsets at a time, but you
|
|
126
|
-
* can pass the `unit: 'character'` option to moved forward one character, word,
|
|
127
|
-
* or line at at time.
|
|
128
|
-
*
|
|
129
|
-
* Note: void nodes are treated as a single point, and iteration will not
|
|
130
|
-
* happen inside their content.
|
|
131
|
-
*/
|
|
132
|
-
positions(editor: Editor, options?: {
|
|
133
|
-
at?: Path | Point | Range | undefined;
|
|
134
|
-
unit?: "offset" | "character" | "word" | "line" | "block" | undefined;
|
|
135
|
-
reverse?: boolean | undefined;
|
|
136
|
-
}): Iterable<Point>;
|
|
137
|
-
/**
|
|
138
|
-
* Get the matching node in the branch of the document before a location.
|
|
139
|
-
*/
|
|
140
|
-
previous<T_4 extends Node>(editor: Editor, options?: {
|
|
141
|
-
at?: Path | Point | Range | undefined;
|
|
142
|
-
match?: ((node: Node) => boolean) | ((node: Node) => node is T_4) | undefined;
|
|
143
|
-
mode?: "highest" | "lowest" | "all" | undefined;
|
|
144
|
-
voids?: boolean | undefined;
|
|
145
|
-
}): NodeEntry<T_4> | undefined;
|
|
146
|
-
/**
|
|
147
|
-
* Get a range of a location.
|
|
148
|
-
*/
|
|
149
|
-
range(editor: Editor, at: Location, to?: Path | Point | Range | undefined): Range;
|
|
150
|
-
/**
|
|
151
|
-
* Get the start point of a location.
|
|
152
|
-
*/
|
|
153
|
-
start(editor: Editor, at: Location): Point;
|
|
154
|
-
/**
|
|
155
|
-
* Get the text string content of a location.
|
|
156
|
-
*
|
|
157
|
-
* Note: the text of void nodes is presumed to be an empty string, regardless
|
|
158
|
-
* of what their actual content is.
|
|
159
|
-
*/
|
|
160
|
-
string(editor: Editor, at: Location): string;
|
|
161
|
-
/**
|
|
162
|
-
* Match a void node in the current branch of the editor.
|
|
163
|
-
*/
|
|
164
|
-
void(editor: Editor, options?: {
|
|
165
|
-
at?: Path | Point | Range | undefined;
|
|
166
|
-
mode?: "highest" | "lowest" | undefined;
|
|
167
|
-
voids?: boolean | undefined;
|
|
168
|
-
}): NodeEntry<Element> | undefined;
|
|
169
|
-
};
|
|
170
|
-
//# sourceMappingURL=location.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../packages/slate/src/interfaces/editor/queries/location.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,UAAU,EACV,MAAM,EACN,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,EACJ,IAAI,EACL,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,eAAe;IAC1B;;OAEG;;;;;;;IAqCH;;OAEG;;;;;IAgCH;;OAEG;;;;;IAoCH;;OAEG;;IAMH;;OAEG;;IAMH;;OAEG;;IAOH;;OAEG;;IAQH;;OAEG;;IAOH;;OAEG;;IAMH;;OAEG;;IAYH;;OAEG;;IAOH;;OAEG;;;;;IAeH;;OAEG;;;;;;;IA4CH;;OAEG;;;;;;;IAuCH;;OAEG;;;;;IAeH;;OAEG;;;;;;;;;IA6GH;;OAEG;;;;;IAgBH;;OAEG;;;;;IA2CH;;OAEG;;;;IAyCH;;;;;;;;;;OAUG;;;;;;IAgHH;;OAEG;;;;;;;IA8CH;;OAEG;;IAYH;;OAEG;;IAMH;;;;;OAKG;;IA2BH;;OAEG;;;;;;CAeJ,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Editor, Range } from '../../..';
|
|
2
|
-
export declare const RangeQueries: {
|
|
3
|
-
/**
|
|
4
|
-
* Convert a range into a non-hanging one.
|
|
5
|
-
*/
|
|
6
|
-
unhangRange(editor: Editor, range: Range, options?: {
|
|
7
|
-
voids?: boolean | undefined;
|
|
8
|
-
}): Range;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=range.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../packages/slate/src/interfaces/editor/queries/range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,KAAK,EAAE,MAAM,UAAU,CAAA;AAEpD,eAAO,MAAM,YAAY;IACvB;;OAEG;;;;CA6CJ,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Editor, Operation, Path } from '../../..';
|
|
2
|
-
export declare const DIRTY_PATHS: WeakMap<Editor, Path[]>;
|
|
3
|
-
export declare const GeneralTransforms: {
|
|
4
|
-
/**
|
|
5
|
-
* Normalize any dirty objects in the editor.
|
|
6
|
-
*/
|
|
7
|
-
normalize(editor: Editor, options?: {
|
|
8
|
-
force?: boolean | undefined;
|
|
9
|
-
}): void;
|
|
10
|
-
/**
|
|
11
|
-
* Transform the editor by an operation.
|
|
12
|
-
*/
|
|
13
|
-
transform(editor: Editor, op: Operation): void;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=general.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../packages/slate/src/interfaces/editor/transforms/general.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,MAAM,EAKN,SAAS,EAGT,IAAI,EACL,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,CAAiB,CAAA;AAEjE,eAAO,MAAM,iBAAiB;IAC5B;;OAEG;;;;IA0CH;;OAEG;;CA0QJ,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../packages/slate/src/interfaces/editor/transforms/node.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,OAAO,EAEP,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,EACL,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,cAAc;IACzB;;OAEG;;;;;;;;;IAmHH;;;OAGG;;;;;;;IA4DH;;;OAGG;;;;;;;;IAyIH;;OAEG;;;;;;;;IAgDH;;OAEG;;;;;;;;IA4CH;;OAEG;;;;;;;;;IAuFH;;OAEG;;;;;;;;;IA8HH;;OAEG;;;;;;;;IA0BH;;;OAGG;;;;;;;;IAwDH;;;OAGG;;;;;;;;CA+FJ,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../packages/slate/src/interfaces/editor/transforms/selection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEzD,eAAO,MAAM,mBAAmB;IAC9B;;OAEG;;;;IA0BH;;OAEG;;IAcH;;OAEG;;;;;;;IAsDH;;OAEG;;IA0BH;;OAEG;;;;IAmCH;;OAEG;;CAkCJ,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../packages/slate/src/interfaces/editor/transforms/text.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAGN,IAAI,EAEJ,IAAI,EAEJ,KAAK,EACL,KAAK,EACN,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,cAAc;IACzB;;OAEG;;;;;;;;;IA0KH;;OAEG;;;;;;IAqNH;;OAEG;;;;;CA+CJ,CAAA"}
|