slate 0.94.1 → 0.100.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/dist/core/apply.d.ts +3 -3
- package/dist/core/apply.d.ts.map +1 -1
- package/dist/core/get-dirty-paths.d.ts +6 -6
- package/dist/core/get-dirty-paths.d.ts.map +1 -1
- package/dist/core/get-fragment.d.ts +3 -3
- package/dist/core/get-fragment.d.ts.map +1 -1
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/normalize-node.d.ts +3 -3
- package/dist/core/normalize-node.d.ts.map +1 -1
- package/dist/core/should-normalize.d.ts +3 -3
- package/dist/core/should-normalize.d.ts.map +1 -1
- package/dist/create-editor.d.ts +5 -5
- package/dist/create-editor.d.ts.map +1 -1
- package/dist/editor/above.d.ts +2 -2
- package/dist/editor/above.d.ts.map +1 -1
- package/dist/editor/add-mark.d.ts +2 -2
- package/dist/editor/add-mark.d.ts.map +1 -1
- package/dist/editor/after.d.ts +2 -2
- package/dist/editor/after.d.ts.map +1 -1
- package/dist/editor/before.d.ts +2 -2
- package/dist/editor/before.d.ts.map +1 -1
- package/dist/editor/delete-backward.d.ts +3 -3
- package/dist/editor/delete-backward.d.ts.map +1 -1
- package/dist/editor/delete-forward.d.ts +3 -3
- package/dist/editor/delete-forward.d.ts.map +1 -1
- package/dist/editor/delete-fragment.d.ts +2 -2
- package/dist/editor/delete-fragment.d.ts.map +1 -1
- package/dist/editor/edges.d.ts +2 -2
- package/dist/editor/edges.d.ts.map +1 -1
- package/dist/editor/element-read-only.d.ts +2 -2
- package/dist/editor/element-read-only.d.ts.map +1 -1
- package/dist/editor/end.d.ts +2 -2
- package/dist/editor/end.d.ts.map +1 -1
- package/dist/editor/first.d.ts +2 -2
- package/dist/editor/first.d.ts.map +1 -1
- package/dist/editor/fragment.d.ts +2 -2
- package/dist/editor/fragment.d.ts.map +1 -1
- package/dist/editor/get-void.d.ts +2 -2
- package/dist/editor/get-void.d.ts.map +1 -1
- package/dist/editor/has-blocks.d.ts +2 -2
- package/dist/editor/has-blocks.d.ts.map +1 -1
- package/dist/editor/has-inlines.d.ts +2 -2
- package/dist/editor/has-inlines.d.ts.map +1 -1
- package/dist/editor/has-path.d.ts +2 -2
- package/dist/editor/has-path.d.ts.map +1 -1
- package/dist/editor/has-texts.d.ts +2 -2
- package/dist/editor/has-texts.d.ts.map +1 -1
- package/dist/editor/index.d.ts +54 -54
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/insert-break.d.ts +2 -2
- package/dist/editor/insert-break.d.ts.map +1 -1
- package/dist/editor/insert-node.d.ts +2 -2
- package/dist/editor/insert-node.d.ts.map +1 -1
- package/dist/editor/insert-soft-break.d.ts +2 -2
- package/dist/editor/insert-soft-break.d.ts.map +1 -1
- package/dist/editor/insert-text.d.ts +2 -2
- package/dist/editor/insert-text.d.ts.map +1 -1
- package/dist/editor/is-block.d.ts +2 -2
- package/dist/editor/is-block.d.ts.map +1 -1
- package/dist/editor/is-edge.d.ts +2 -2
- package/dist/editor/is-edge.d.ts.map +1 -1
- package/dist/editor/is-editor.d.ts +2 -2
- package/dist/editor/is-editor.d.ts.map +1 -1
- package/dist/editor/is-empty.d.ts +2 -2
- package/dist/editor/is-empty.d.ts.map +1 -1
- package/dist/editor/is-end.d.ts +2 -2
- package/dist/editor/is-end.d.ts.map +1 -1
- package/dist/editor/is-normalizing.d.ts +2 -2
- package/dist/editor/is-normalizing.d.ts.map +1 -1
- package/dist/editor/is-start.d.ts +2 -2
- package/dist/editor/is-start.d.ts.map +1 -1
- package/dist/editor/last.d.ts +2 -2
- package/dist/editor/last.d.ts.map +1 -1
- package/dist/editor/leaf.d.ts +2 -2
- package/dist/editor/leaf.d.ts.map +1 -1
- package/dist/editor/levels.d.ts +3 -3
- package/dist/editor/levels.d.ts.map +1 -1
- package/dist/editor/marks.d.ts +2 -2
- package/dist/editor/marks.d.ts.map +1 -1
- package/dist/editor/next.d.ts +2 -2
- package/dist/editor/next.d.ts.map +1 -1
- package/dist/editor/node.d.ts +2 -2
- package/dist/editor/node.d.ts.map +1 -1
- package/dist/editor/nodes.d.ts +3 -3
- package/dist/editor/nodes.d.ts.map +1 -1
- package/dist/editor/normalize.d.ts +2 -2
- package/dist/editor/normalize.d.ts.map +1 -1
- package/dist/editor/parent.d.ts +2 -2
- package/dist/editor/parent.d.ts.map +1 -1
- package/dist/editor/path-ref.d.ts +2 -2
- package/dist/editor/path-ref.d.ts.map +1 -1
- package/dist/editor/path-refs.d.ts +2 -2
- package/dist/editor/path-refs.d.ts.map +1 -1
- package/dist/editor/path.d.ts +2 -2
- package/dist/editor/path.d.ts.map +1 -1
- package/dist/editor/point-ref.d.ts +2 -2
- package/dist/editor/point-ref.d.ts.map +1 -1
- package/dist/editor/point-refs.d.ts +2 -2
- package/dist/editor/point-refs.d.ts.map +1 -1
- package/dist/editor/point.d.ts +2 -2
- package/dist/editor/point.d.ts.map +1 -1
- package/dist/editor/positions.d.ts +3 -3
- package/dist/editor/positions.d.ts.map +1 -1
- package/dist/editor/previous.d.ts +2 -2
- package/dist/editor/previous.d.ts.map +1 -1
- package/dist/editor/range-ref.d.ts +2 -2
- package/dist/editor/range-ref.d.ts.map +1 -1
- package/dist/editor/range-refs.d.ts +2 -2
- package/dist/editor/range-refs.d.ts.map +1 -1
- package/dist/editor/range.d.ts +2 -2
- package/dist/editor/range.d.ts.map +1 -1
- package/dist/editor/remove-mark.d.ts +2 -2
- package/dist/editor/remove-mark.d.ts.map +1 -1
- package/dist/editor/set-normalizing.d.ts +2 -2
- package/dist/editor/set-normalizing.d.ts.map +1 -1
- package/dist/editor/start.d.ts +2 -2
- package/dist/editor/start.d.ts.map +1 -1
- package/dist/editor/string.d.ts +2 -2
- package/dist/editor/string.d.ts.map +1 -1
- package/dist/editor/unhang-range.d.ts +2 -2
- package/dist/editor/unhang-range.d.ts.map +1 -1
- package/dist/editor/without-normalizing.d.ts +2 -2
- package/dist/editor/without-normalizing.d.ts.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +641 -1551
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1227 -2191
- package/dist/index.js.map +1 -1
- package/dist/interfaces/editor.d.ts +497 -497
- package/dist/interfaces/editor.d.ts.map +1 -1
- package/dist/interfaces/element.d.ts +46 -46
- package/dist/interfaces/element.d.ts.map +1 -1
- package/dist/interfaces/index.d.ts +14 -14
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/location.d.ts +29 -29
- package/dist/interfaces/location.d.ts.map +1 -1
- package/dist/interfaces/node.d.ts +173 -173
- package/dist/interfaces/node.d.ts.map +1 -1
- package/dist/interfaces/operation.d.ts +107 -107
- package/dist/interfaces/operation.d.ts.map +1 -1
- package/dist/interfaces/path-ref.d.ts +18 -18
- package/dist/interfaces/path-ref.d.ts.map +1 -1
- package/dist/interfaces/path.d.ts +132 -132
- package/dist/interfaces/path.d.ts.map +1 -1
- package/dist/interfaces/point-ref.d.ts +19 -19
- package/dist/interfaces/point-ref.d.ts.map +1 -1
- package/dist/interfaces/point.d.ts +49 -49
- package/dist/interfaces/point.d.ts.map +1 -1
- package/dist/interfaces/range-ref.d.ts +18 -18
- package/dist/interfaces/range-ref.d.ts.map +1 -1
- package/dist/interfaces/range.d.ts +80 -80
- package/dist/interfaces/range.d.ts.map +1 -1
- package/dist/interfaces/scrubber.d.ts +21 -21
- package/dist/interfaces/scrubber.d.ts.map +1 -1
- package/dist/interfaces/text.d.ts +47 -47
- package/dist/interfaces/text.d.ts.map +1 -1
- package/dist/interfaces/transforms/general.d.ts +8 -8
- package/dist/interfaces/transforms/general.d.ts.map +1 -1
- package/dist/interfaces/transforms/index.d.ts +5 -5
- package/dist/interfaces/transforms/index.d.ts.map +1 -1
- package/dist/interfaces/transforms/node.d.ts +117 -117
- package/dist/interfaces/transforms/node.d.ts.map +1 -1
- package/dist/interfaces/transforms/selection.d.ts +41 -41
- package/dist/interfaces/transforms/selection.d.ts.map +1 -1
- package/dist/interfaces/transforms/text.d.ts +36 -36
- package/dist/interfaces/transforms/text.d.ts.map +1 -1
- package/dist/slate.js +2152 -3123
- package/dist/slate.min.js +2 -2
- package/dist/transforms-node/index.d.ts +10 -10
- package/dist/transforms-node/index.d.ts.map +1 -1
- package/dist/transforms-node/insert-nodes.d.ts +2 -2
- package/dist/transforms-node/insert-nodes.d.ts.map +1 -1
- package/dist/transforms-node/lift-nodes.d.ts +2 -2
- package/dist/transforms-node/lift-nodes.d.ts.map +1 -1
- package/dist/transforms-node/merge-nodes.d.ts +2 -2
- package/dist/transforms-node/merge-nodes.d.ts.map +1 -1
- package/dist/transforms-node/move-nodes.d.ts +2 -2
- package/dist/transforms-node/move-nodes.d.ts.map +1 -1
- package/dist/transforms-node/remove-nodes.d.ts +2 -2
- package/dist/transforms-node/remove-nodes.d.ts.map +1 -1
- package/dist/transforms-node/set-nodes.d.ts +2 -2
- package/dist/transforms-node/set-nodes.d.ts.map +1 -1
- package/dist/transforms-node/split-nodes.d.ts +2 -2
- package/dist/transforms-node/split-nodes.d.ts.map +1 -1
- package/dist/transforms-node/unset-nodes.d.ts +2 -2
- package/dist/transforms-node/unset-nodes.d.ts.map +1 -1
- package/dist/transforms-node/unwrap-nodes.d.ts +2 -2
- package/dist/transforms-node/unwrap-nodes.d.ts.map +1 -1
- package/dist/transforms-node/wrap-nodes.d.ts +2 -2
- package/dist/transforms-node/wrap-nodes.d.ts.map +1 -1
- package/dist/transforms-selection/collapse.d.ts +2 -2
- package/dist/transforms-selection/collapse.d.ts.map +1 -1
- package/dist/transforms-selection/deselect.d.ts +2 -2
- package/dist/transforms-selection/deselect.d.ts.map +1 -1
- package/dist/transforms-selection/index.d.ts +6 -6
- package/dist/transforms-selection/index.d.ts.map +1 -1
- package/dist/transforms-selection/move.d.ts +2 -2
- package/dist/transforms-selection/move.d.ts.map +1 -1
- package/dist/transforms-selection/select.d.ts +2 -2
- package/dist/transforms-selection/select.d.ts.map +1 -1
- package/dist/transforms-selection/set-point.d.ts +2 -2
- package/dist/transforms-selection/set-point.d.ts.map +1 -1
- package/dist/transforms-selection/set-selection.d.ts +2 -2
- package/dist/transforms-selection/set-selection.d.ts.map +1 -1
- package/dist/transforms-text/delete-text.d.ts +2 -2
- package/dist/transforms-text/delete-text.d.ts.map +1 -1
- package/dist/transforms-text/index.d.ts +2 -2
- package/dist/transforms-text/index.d.ts.map +1 -1
- package/dist/transforms-text/insert-fragment.d.ts +2 -2
- package/dist/transforms-text/insert-fragment.d.ts.map +1 -1
- package/dist/types/custom-types.d.ts +9 -9
- package/dist/types/custom-types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +10 -10
- package/dist/types/types.d.ts.map +1 -1
- package/dist/utils/deep-equal.d.ts +1 -1
- package/dist/utils/deep-equal.d.ts.map +1 -1
- package/dist/utils/get-default-insert-location.d.ts +8 -8
- package/dist/utils/get-default-insert-location.d.ts.map +1 -1
- package/dist/utils/index.d.ts +6 -6
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/match-path.d.ts +4 -4
- package/dist/utils/match-path.d.ts.map +1 -1
- package/dist/utils/string.d.ts +17 -17
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/types.d.ts +4 -4
- package/dist/utils/types.d.ts.map +1 -1
- package/dist/utils/weak-maps.d.ts +8 -8
- package/dist/utils/weak-maps.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../packages/slate/src/interfaces/node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAY,IAAI,EAAE,MAAM,IAAI,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;A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;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAA;IAE9B;;OAEG;IACH,KAAK,EAAE,CACL,IAAI,EAAE,IAAI,EACV,OAAO,CAAC,EAAE,gBAAgB,KACvB,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;CACjD;AAKD,eAAO,MAAM,IAAI,EAAE,aAmYlB,CAAA;AAED;;;;GAIG;AAEH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,IAAI,CAAA;AAEvC;;;;GAIG;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAEvC;;;;GAIG;AAEH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AAExD;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,GACxB,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,GACzB,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA"}
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
import { ExtendedType, Node, Path, Range } from '..';
|
|
2
|
-
export
|
|
3
|
-
type: 'insert_node';
|
|
4
|
-
path: Path;
|
|
5
|
-
node: Node;
|
|
6
|
-
};
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
type: 'insert_text';
|
|
10
|
-
path: Path;
|
|
11
|
-
offset: number;
|
|
12
|
-
text: string;
|
|
13
|
-
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
type: 'merge_node';
|
|
17
|
-
path: Path;
|
|
18
|
-
position: number;
|
|
19
|
-
properties: Partial<Node>;
|
|
20
|
-
};
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
type: 'move_node';
|
|
24
|
-
path: Path;
|
|
25
|
-
newPath: Path;
|
|
26
|
-
};
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
type: 'remove_node';
|
|
30
|
-
path: Path;
|
|
31
|
-
node: Node;
|
|
32
|
-
};
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
type: 'remove_text';
|
|
36
|
-
path: Path;
|
|
37
|
-
offset: number;
|
|
38
|
-
text: string;
|
|
39
|
-
};
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
type: 'set_node';
|
|
43
|
-
path: Path;
|
|
44
|
-
properties: Partial<Node>;
|
|
45
|
-
newProperties: Partial<Node>;
|
|
46
|
-
};
|
|
47
|
-
export
|
|
48
|
-
export
|
|
49
|
-
type: 'set_selection';
|
|
50
|
-
properties: null;
|
|
51
|
-
newProperties: Range;
|
|
52
|
-
} | {
|
|
53
|
-
type: 'set_selection';
|
|
54
|
-
properties: Partial<Range>;
|
|
55
|
-
newProperties: Partial<Range>;
|
|
56
|
-
} | {
|
|
57
|
-
type: 'set_selection';
|
|
58
|
-
properties: Range;
|
|
59
|
-
newProperties: null;
|
|
60
|
-
};
|
|
61
|
-
export
|
|
62
|
-
export
|
|
63
|
-
type: 'split_node';
|
|
64
|
-
path: Path;
|
|
65
|
-
position: number;
|
|
66
|
-
properties: Partial<Node>;
|
|
67
|
-
};
|
|
68
|
-
export
|
|
69
|
-
export
|
|
70
|
-
export
|
|
71
|
-
export
|
|
72
|
-
/**
|
|
73
|
-
* `Operation` objects define the low-level instructions that Slate editors use
|
|
74
|
-
* to apply changes to their internal state. Representing all changes as
|
|
75
|
-
* operations is what allows Slate editors to easily implement history,
|
|
76
|
-
* collaboration, and other features.
|
|
77
|
-
*/
|
|
78
|
-
export
|
|
79
|
-
export
|
|
80
|
-
export interface OperationInterface {
|
|
81
|
-
/**
|
|
82
|
-
* Check if a value is a `NodeOperation` object.
|
|
83
|
-
*/
|
|
84
|
-
isNodeOperation: (value: any) => value is NodeOperation;
|
|
85
|
-
/**
|
|
86
|
-
* Check if a value is an `Operation` object.
|
|
87
|
-
*/
|
|
88
|
-
isOperation: (value: any) => value is Operation;
|
|
89
|
-
/**
|
|
90
|
-
* Check if a value is a list of `Operation` objects.
|
|
91
|
-
*/
|
|
92
|
-
isOperationList: (value: any) => value is Operation[];
|
|
93
|
-
/**
|
|
94
|
-
* Check if a value is a `SelectionOperation` object.
|
|
95
|
-
*/
|
|
96
|
-
isSelectionOperation: (value: any) => value is SelectionOperation;
|
|
97
|
-
/**
|
|
98
|
-
* Check if a value is a `TextOperation` object.
|
|
99
|
-
*/
|
|
100
|
-
isTextOperation: (value: any) => value is TextOperation;
|
|
101
|
-
/**
|
|
102
|
-
* Invert an operation, returning a new operation that will exactly undo the
|
|
103
|
-
* original when applied.
|
|
104
|
-
*/
|
|
105
|
-
inverse: (op: Operation) => Operation;
|
|
106
|
-
}
|
|
107
|
-
export declare const Operation: OperationInterface;
|
|
1
|
+
import { ExtendedType, Node, Path, Range } from '..';
|
|
2
|
+
export type BaseInsertNodeOperation = {
|
|
3
|
+
type: 'insert_node';
|
|
4
|
+
path: Path;
|
|
5
|
+
node: Node;
|
|
6
|
+
};
|
|
7
|
+
export type InsertNodeOperation = ExtendedType<'InsertNodeOperation', BaseInsertNodeOperation>;
|
|
8
|
+
export type BaseInsertTextOperation = {
|
|
9
|
+
type: 'insert_text';
|
|
10
|
+
path: Path;
|
|
11
|
+
offset: number;
|
|
12
|
+
text: string;
|
|
13
|
+
};
|
|
14
|
+
export type InsertTextOperation = ExtendedType<'InsertTextOperation', BaseInsertTextOperation>;
|
|
15
|
+
export type BaseMergeNodeOperation = {
|
|
16
|
+
type: 'merge_node';
|
|
17
|
+
path: Path;
|
|
18
|
+
position: number;
|
|
19
|
+
properties: Partial<Node>;
|
|
20
|
+
};
|
|
21
|
+
export type MergeNodeOperation = ExtendedType<'MergeNodeOperation', BaseMergeNodeOperation>;
|
|
22
|
+
export type BaseMoveNodeOperation = {
|
|
23
|
+
type: 'move_node';
|
|
24
|
+
path: Path;
|
|
25
|
+
newPath: Path;
|
|
26
|
+
};
|
|
27
|
+
export type MoveNodeOperation = ExtendedType<'MoveNodeOperation', BaseMoveNodeOperation>;
|
|
28
|
+
export type BaseRemoveNodeOperation = {
|
|
29
|
+
type: 'remove_node';
|
|
30
|
+
path: Path;
|
|
31
|
+
node: Node;
|
|
32
|
+
};
|
|
33
|
+
export type RemoveNodeOperation = ExtendedType<'RemoveNodeOperation', BaseRemoveNodeOperation>;
|
|
34
|
+
export type BaseRemoveTextOperation = {
|
|
35
|
+
type: 'remove_text';
|
|
36
|
+
path: Path;
|
|
37
|
+
offset: number;
|
|
38
|
+
text: string;
|
|
39
|
+
};
|
|
40
|
+
export type RemoveTextOperation = ExtendedType<'RemoveTextOperation', BaseRemoveTextOperation>;
|
|
41
|
+
export type BaseSetNodeOperation = {
|
|
42
|
+
type: 'set_node';
|
|
43
|
+
path: Path;
|
|
44
|
+
properties: Partial<Node>;
|
|
45
|
+
newProperties: Partial<Node>;
|
|
46
|
+
};
|
|
47
|
+
export type SetNodeOperation = ExtendedType<'SetNodeOperation', BaseSetNodeOperation>;
|
|
48
|
+
export type BaseSetSelectionOperation = {
|
|
49
|
+
type: 'set_selection';
|
|
50
|
+
properties: null;
|
|
51
|
+
newProperties: Range;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'set_selection';
|
|
54
|
+
properties: Partial<Range>;
|
|
55
|
+
newProperties: Partial<Range>;
|
|
56
|
+
} | {
|
|
57
|
+
type: 'set_selection';
|
|
58
|
+
properties: Range;
|
|
59
|
+
newProperties: null;
|
|
60
|
+
};
|
|
61
|
+
export type SetSelectionOperation = ExtendedType<'SetSelectionOperation', BaseSetSelectionOperation>;
|
|
62
|
+
export type BaseSplitNodeOperation = {
|
|
63
|
+
type: 'split_node';
|
|
64
|
+
path: Path;
|
|
65
|
+
position: number;
|
|
66
|
+
properties: Partial<Node>;
|
|
67
|
+
};
|
|
68
|
+
export type SplitNodeOperation = ExtendedType<'SplitNodeOperation', BaseSplitNodeOperation>;
|
|
69
|
+
export type NodeOperation = InsertNodeOperation | MergeNodeOperation | MoveNodeOperation | RemoveNodeOperation | SetNodeOperation | SplitNodeOperation;
|
|
70
|
+
export type SelectionOperation = SetSelectionOperation;
|
|
71
|
+
export type TextOperation = InsertTextOperation | RemoveTextOperation;
|
|
72
|
+
/**
|
|
73
|
+
* `Operation` objects define the low-level instructions that Slate editors use
|
|
74
|
+
* to apply changes to their internal state. Representing all changes as
|
|
75
|
+
* operations is what allows Slate editors to easily implement history,
|
|
76
|
+
* collaboration, and other features.
|
|
77
|
+
*/
|
|
78
|
+
export type BaseOperation = NodeOperation | SelectionOperation | TextOperation;
|
|
79
|
+
export type Operation = ExtendedType<'Operation', BaseOperation>;
|
|
80
|
+
export interface OperationInterface {
|
|
81
|
+
/**
|
|
82
|
+
* Check if a value is a `NodeOperation` object.
|
|
83
|
+
*/
|
|
84
|
+
isNodeOperation: (value: any) => value is NodeOperation;
|
|
85
|
+
/**
|
|
86
|
+
* Check if a value is an `Operation` object.
|
|
87
|
+
*/
|
|
88
|
+
isOperation: (value: any) => value is Operation;
|
|
89
|
+
/**
|
|
90
|
+
* Check if a value is a list of `Operation` objects.
|
|
91
|
+
*/
|
|
92
|
+
isOperationList: (value: any) => value is Operation[];
|
|
93
|
+
/**
|
|
94
|
+
* Check if a value is a `SelectionOperation` object.
|
|
95
|
+
*/
|
|
96
|
+
isSelectionOperation: (value: any) => value is SelectionOperation;
|
|
97
|
+
/**
|
|
98
|
+
* Check if a value is a `TextOperation` object.
|
|
99
|
+
*/
|
|
100
|
+
isTextOperation: (value: any) => value is TextOperation;
|
|
101
|
+
/**
|
|
102
|
+
* Invert an operation, returning a new operation that will exactly undo the
|
|
103
|
+
* original when applied.
|
|
104
|
+
*/
|
|
105
|
+
inverse: (op: Operation) => Operation;
|
|
106
|
+
}
|
|
107
|
+
export declare const Operation: OperationInterface;
|
|
108
108
|
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../packages/slate/src/interfaces/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AAGpD,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAC5C,qBAAqB,EACrB,uBAAuB,CACxB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAC5C,qBAAqB,EACrB,uBAAuB,CACxB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,YAAY,CAAA;IAClB,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAC3C,oBAAoB,EACpB,sBAAsB,CACvB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,WAAW,CAAA;IACjB,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,IAAI,CAAA;CACd,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAC1C,mBAAmB,EACnB,qBAAqB,CACtB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,IAAI,CAAA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AC1B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAC3C,oBAAoB,EACpB,sBAAsB,CACvB,CAAA;AAED,MAAM,MAAM,aAAa,GACrB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,mBAAmB,GACnB,gBAAgB,GAChB,kBAAkB,CAAA;AAEtB,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAA;AAEtD,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,mBAAmB,CAAA;AAErE;;;;;GAKG;AAEH,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,kBAAkB,GAAG,aAAa,CAAA;AAC9E,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;AAEhE,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,eAAe,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,aAAa,CAAA;IAEvD;;OAEG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,SAAS,CAAA;IAE/C;;OAEG;IACH,eAAe,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,SAAS,EAAE,CAAA;IAErD;;OAEG;IACH,oBAAoB,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,kBAAkB,CAAA;IAEjE;;OAEG;IACH,eAAe,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,aAAa,CAAA;IAEvD;;;OAGG;IACH,OAAO,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,SAAS,CAAA;CACtC;AAGD,eAAO,MAAM,SAAS,EAAE,kBAsJvB,CAAA"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Operation, Path } from '..';
|
|
2
|
-
/**
|
|
3
|
-
* `PathRef` objects keep a specific path in a document synced over time as new
|
|
4
|
-
* operations are applied to the editor. You can access their `current` property
|
|
5
|
-
* at any time for the up-to-date path value.
|
|
6
|
-
*/
|
|
7
|
-
export interface PathRef {
|
|
8
|
-
current: Path | null;
|
|
9
|
-
affinity: 'forward' | 'backward' | null;
|
|
10
|
-
unref(): Path | null;
|
|
11
|
-
}
|
|
12
|
-
export interface PathRefInterface {
|
|
13
|
-
/**
|
|
14
|
-
* Transform the path ref's current value by an operation.
|
|
15
|
-
*/
|
|
16
|
-
transform: (ref: PathRef, op: Operation) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare const PathRef: PathRefInterface;
|
|
1
|
+
import { Operation, Path } from '..';
|
|
2
|
+
/**
|
|
3
|
+
* `PathRef` objects keep a specific path in a document synced over time as new
|
|
4
|
+
* operations are applied to the editor. You can access their `current` property
|
|
5
|
+
* at any time for the up-to-date path value.
|
|
6
|
+
*/
|
|
7
|
+
export interface PathRef {
|
|
8
|
+
current: Path | null;
|
|
9
|
+
affinity: 'forward' | 'backward' | null;
|
|
10
|
+
unref(): Path | null;
|
|
11
|
+
}
|
|
12
|
+
export interface PathRefInterface {
|
|
13
|
+
/**
|
|
14
|
+
* Transform the path ref's current value by an operation.
|
|
15
|
+
*/
|
|
16
|
+
transform: (ref: PathRef, op: Operation) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const PathRef: PathRefInterface;
|
|
19
19
|
//# sourceMappingURL=path-ref.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-ref.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"path-ref.d.ts","sourceRoot":"","sources":["../../../../packages/slate/src/interfaces/path-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAEpC;;;;GAIG;AAEH,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI,CAAA;IACvC,KAAK,IAAI,IAAI,GAAG,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,KAAK,IAAI,CAAA;CACjD;AAGD,eAAO,MAAM,OAAO,EAAE,gBAerB,CAAA"}
|
|
@@ -1,133 +1,133 @@
|
|
|
1
|
-
import { InsertNodeOperation, MergeNodeOperation, MoveNodeOperation, Operation, RemoveNodeOperation, SplitNodeOperation } from '..';
|
|
2
|
-
import { TextDirection } from '../types/types';
|
|
3
|
-
/**
|
|
4
|
-
* `Path` arrays are a list of indexes that describe a node's exact position in
|
|
5
|
-
* a Slate node tree. Although they are usually relative to the root `Editor`
|
|
6
|
-
* object, they can be relative to any `Node` object.
|
|
7
|
-
*/
|
|
8
|
-
export
|
|
9
|
-
export interface PathAncestorsOptions {
|
|
10
|
-
reverse?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface PathLevelsOptions {
|
|
13
|
-
reverse?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface PathTransformOptions {
|
|
16
|
-
affinity?: TextDirection | null;
|
|
17
|
-
}
|
|
18
|
-
export interface PathInterface {
|
|
19
|
-
/**
|
|
20
|
-
* Get a list of ancestor paths for a given path.
|
|
21
|
-
*
|
|
22
|
-
* The paths are sorted from shallowest to deepest ancestor. However, if the
|
|
23
|
-
* `reverse: true` option is passed, they are reversed.
|
|
24
|
-
*/
|
|
25
|
-
ancestors: (path: Path, options?: PathAncestorsOptions) => Path[];
|
|
26
|
-
/**
|
|
27
|
-
* Get the common ancestor path of two paths.
|
|
28
|
-
*/
|
|
29
|
-
common: (path: Path, another: Path) => Path;
|
|
30
|
-
/**
|
|
31
|
-
* Compare a path to another, returning an integer indicating whether the path
|
|
32
|
-
* was before, at, or after the other.
|
|
33
|
-
*
|
|
34
|
-
* Note: Two paths of unequal length can still receive a `0` result if one is
|
|
35
|
-
* directly above or below the other. If you want exact matching, use
|
|
36
|
-
* [[Path.equals]] instead.
|
|
37
|
-
*/
|
|
38
|
-
compare: (path: Path, another: Path) => -1 | 0 | 1;
|
|
39
|
-
/**
|
|
40
|
-
* Check if a path ends after one of the indexes in another.
|
|
41
|
-
*/
|
|
42
|
-
endsAfter: (path: Path, another: Path) => boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Check if a path ends at one of the indexes in another.
|
|
45
|
-
*/
|
|
46
|
-
endsAt: (path: Path, another: Path) => boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Check if a path ends before one of the indexes in another.
|
|
49
|
-
*/
|
|
50
|
-
endsBefore: (path: Path, another: Path) => boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Check if a path is exactly equal to another.
|
|
53
|
-
*/
|
|
54
|
-
equals: (path: Path, another: Path) => boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Check if the path of previous sibling node exists
|
|
57
|
-
*/
|
|
58
|
-
hasPrevious: (path: Path) => boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Check if a path is after another.
|
|
61
|
-
*/
|
|
62
|
-
isAfter: (path: Path, another: Path) => boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Check if a path is an ancestor of another.
|
|
65
|
-
*/
|
|
66
|
-
isAncestor: (path: Path, another: Path) => boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Check if a path is before another.
|
|
69
|
-
*/
|
|
70
|
-
isBefore: (path: Path, another: Path) => boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Check if a path is a child of another.
|
|
73
|
-
*/
|
|
74
|
-
isChild: (path: Path, another: Path) => boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Check if a path is equal to or an ancestor of another.
|
|
77
|
-
*/
|
|
78
|
-
isCommon: (path: Path, another: Path) => boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Check if a path is a descendant of another.
|
|
81
|
-
*/
|
|
82
|
-
isDescendant: (path: Path, another: Path) => boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Check if a path is the parent of another.
|
|
85
|
-
*/
|
|
86
|
-
isParent: (path: Path, another: Path) => boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Check is a value implements the `Path` interface.
|
|
89
|
-
*/
|
|
90
|
-
isPath: (value: any) => value is Path;
|
|
91
|
-
/**
|
|
92
|
-
* Check if a path is a sibling of another.
|
|
93
|
-
*/
|
|
94
|
-
isSibling: (path: Path, another: Path) => boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Get a list of paths at every level down to a path. Note: this is the same
|
|
97
|
-
* as `Path.ancestors`, but including the path itself.
|
|
98
|
-
*
|
|
99
|
-
* The paths are sorted from shallowest to deepest. However, if the `reverse:
|
|
100
|
-
* true` option is passed, they are reversed.
|
|
101
|
-
*/
|
|
102
|
-
levels: (path: Path, options?: PathLevelsOptions) => Path[];
|
|
103
|
-
/**
|
|
104
|
-
* Given a path, get the path to the next sibling node.
|
|
105
|
-
*/
|
|
106
|
-
next: (path: Path) => Path;
|
|
107
|
-
/**
|
|
108
|
-
* Returns whether this operation can affect paths or not. Used as an
|
|
109
|
-
* optimization when updating dirty paths during normalization
|
|
110
|
-
*
|
|
111
|
-
* NOTE: This *must* be kept in sync with the implementation of 'transform'
|
|
112
|
-
* below
|
|
113
|
-
*/
|
|
114
|
-
operationCanTransformPath: (operation: Operation) => operation is InsertNodeOperation | RemoveNodeOperation | MergeNodeOperation | SplitNodeOperation | MoveNodeOperation;
|
|
115
|
-
/**
|
|
116
|
-
* Given a path, return a new path referring to the parent node above it.
|
|
117
|
-
*/
|
|
118
|
-
parent: (path: Path) => Path;
|
|
119
|
-
/**
|
|
120
|
-
* Given a path, get the path to the previous sibling node.
|
|
121
|
-
*/
|
|
122
|
-
previous: (path: Path) => Path;
|
|
123
|
-
/**
|
|
124
|
-
* Get a path relative to an ancestor.
|
|
125
|
-
*/
|
|
126
|
-
relative: (path: Path, ancestor: Path) => Path;
|
|
127
|
-
/**
|
|
128
|
-
* Transform a path by an operation.
|
|
129
|
-
*/
|
|
130
|
-
transform: (path: Path, operation: Operation, options?: PathTransformOptions) => Path | null;
|
|
131
|
-
}
|
|
132
|
-
export declare const Path: PathInterface;
|
|
1
|
+
import { InsertNodeOperation, MergeNodeOperation, MoveNodeOperation, Operation, RemoveNodeOperation, SplitNodeOperation } from '..';
|
|
2
|
+
import { TextDirection } from '../types/types';
|
|
3
|
+
/**
|
|
4
|
+
* `Path` arrays are a list of indexes that describe a node's exact position in
|
|
5
|
+
* a Slate node tree. Although they are usually relative to the root `Editor`
|
|
6
|
+
* object, they can be relative to any `Node` object.
|
|
7
|
+
*/
|
|
8
|
+
export type Path = number[];
|
|
9
|
+
export interface PathAncestorsOptions {
|
|
10
|
+
reverse?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface PathLevelsOptions {
|
|
13
|
+
reverse?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface PathTransformOptions {
|
|
16
|
+
affinity?: TextDirection | null;
|
|
17
|
+
}
|
|
18
|
+
export interface PathInterface {
|
|
19
|
+
/**
|
|
20
|
+
* Get a list of ancestor paths for a given path.
|
|
21
|
+
*
|
|
22
|
+
* The paths are sorted from shallowest to deepest ancestor. However, if the
|
|
23
|
+
* `reverse: true` option is passed, they are reversed.
|
|
24
|
+
*/
|
|
25
|
+
ancestors: (path: Path, options?: PathAncestorsOptions) => Path[];
|
|
26
|
+
/**
|
|
27
|
+
* Get the common ancestor path of two paths.
|
|
28
|
+
*/
|
|
29
|
+
common: (path: Path, another: Path) => Path;
|
|
30
|
+
/**
|
|
31
|
+
* Compare a path to another, returning an integer indicating whether the path
|
|
32
|
+
* was before, at, or after the other.
|
|
33
|
+
*
|
|
34
|
+
* Note: Two paths of unequal length can still receive a `0` result if one is
|
|
35
|
+
* directly above or below the other. If you want exact matching, use
|
|
36
|
+
* [[Path.equals]] instead.
|
|
37
|
+
*/
|
|
38
|
+
compare: (path: Path, another: Path) => -1 | 0 | 1;
|
|
39
|
+
/**
|
|
40
|
+
* Check if a path ends after one of the indexes in another.
|
|
41
|
+
*/
|
|
42
|
+
endsAfter: (path: Path, another: Path) => boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Check if a path ends at one of the indexes in another.
|
|
45
|
+
*/
|
|
46
|
+
endsAt: (path: Path, another: Path) => boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Check if a path ends before one of the indexes in another.
|
|
49
|
+
*/
|
|
50
|
+
endsBefore: (path: Path, another: Path) => boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Check if a path is exactly equal to another.
|
|
53
|
+
*/
|
|
54
|
+
equals: (path: Path, another: Path) => boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Check if the path of previous sibling node exists
|
|
57
|
+
*/
|
|
58
|
+
hasPrevious: (path: Path) => boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Check if a path is after another.
|
|
61
|
+
*/
|
|
62
|
+
isAfter: (path: Path, another: Path) => boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Check if a path is an ancestor of another.
|
|
65
|
+
*/
|
|
66
|
+
isAncestor: (path: Path, another: Path) => boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Check if a path is before another.
|
|
69
|
+
*/
|
|
70
|
+
isBefore: (path: Path, another: Path) => boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Check if a path is a child of another.
|
|
73
|
+
*/
|
|
74
|
+
isChild: (path: Path, another: Path) => boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Check if a path is equal to or an ancestor of another.
|
|
77
|
+
*/
|
|
78
|
+
isCommon: (path: Path, another: Path) => boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Check if a path is a descendant of another.
|
|
81
|
+
*/
|
|
82
|
+
isDescendant: (path: Path, another: Path) => boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Check if a path is the parent of another.
|
|
85
|
+
*/
|
|
86
|
+
isParent: (path: Path, another: Path) => boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Check is a value implements the `Path` interface.
|
|
89
|
+
*/
|
|
90
|
+
isPath: (value: any) => value is Path;
|
|
91
|
+
/**
|
|
92
|
+
* Check if a path is a sibling of another.
|
|
93
|
+
*/
|
|
94
|
+
isSibling: (path: Path, another: Path) => boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Get a list of paths at every level down to a path. Note: this is the same
|
|
97
|
+
* as `Path.ancestors`, but including the path itself.
|
|
98
|
+
*
|
|
99
|
+
* The paths are sorted from shallowest to deepest. However, if the `reverse:
|
|
100
|
+
* true` option is passed, they are reversed.
|
|
101
|
+
*/
|
|
102
|
+
levels: (path: Path, options?: PathLevelsOptions) => Path[];
|
|
103
|
+
/**
|
|
104
|
+
* Given a path, get the path to the next sibling node.
|
|
105
|
+
*/
|
|
106
|
+
next: (path: Path) => Path;
|
|
107
|
+
/**
|
|
108
|
+
* Returns whether this operation can affect paths or not. Used as an
|
|
109
|
+
* optimization when updating dirty paths during normalization
|
|
110
|
+
*
|
|
111
|
+
* NOTE: This *must* be kept in sync with the implementation of 'transform'
|
|
112
|
+
* below
|
|
113
|
+
*/
|
|
114
|
+
operationCanTransformPath: (operation: Operation) => operation is InsertNodeOperation | RemoveNodeOperation | MergeNodeOperation | SplitNodeOperation | MoveNodeOperation;
|
|
115
|
+
/**
|
|
116
|
+
* Given a path, return a new path referring to the parent node above it.
|
|
117
|
+
*/
|
|
118
|
+
parent: (path: Path) => Path;
|
|
119
|
+
/**
|
|
120
|
+
* Given a path, get the path to the previous sibling node.
|
|
121
|
+
*/
|
|
122
|
+
previous: (path: Path) => Path;
|
|
123
|
+
/**
|
|
124
|
+
* Get a path relative to an ancestor.
|
|
125
|
+
*/
|
|
126
|
+
relative: (path: Path, ancestor: Path) => Path;
|
|
127
|
+
/**
|
|
128
|
+
* Transform a path by an operation.
|
|
129
|
+
*/
|
|
130
|
+
transform: (path: Path, operation: Operation, options?: PathTransformOptions) => Path | null;
|
|
131
|
+
}
|
|
132
|
+
export declare const Path: PathInterface;
|
|
133
133
|
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../packages/slate/src/interfaces/path.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,IAAI,CAAA;AACX,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE9C;;;;GAIG;AAEH,MAAM,MAAM,IAAI,GAAG,MAAM,EAAE,CAAA;AAE3B,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,oBAAoB,KAAK,IAAI,EAAE,CAAA;IAEjE;;OAEG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,IAAI,CAAA;IAE3C;;;;;;;OAOG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAElD;;OAEG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,OAAO,CAAA;IAEjD;;OAEG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,OAAO,CAAA;IAE9C;;OAEG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,OAAO,CAAA;IAElD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;;OAMG;IACH,yBAAyB,EAAE,CACzB,SAAS,EAAE,SAAS,KACjB,SAAS,IACV,mBAAmB,GACnB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,CAAA;IAErB;;OAEG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAE5B;;OAEG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAE9B;;OAEG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,KAAK,IAAI,CAAA;IAE9C;;OAEG;IACH,SAAS,EAAE,CACT,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,oBAAoB,KAC3B,IAAI,GAAG,IAAI,CAAA;CACjB;AAGD,eAAO,MAAM,IAAI,EAAE,aAgVlB,CAAA"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Operation, Point } from '..';
|
|
2
|
-
import { TextDirection } from '../types/types';
|
|
3
|
-
/**
|
|
4
|
-
* `PointRef` objects keep a specific point in a document synced over time as new
|
|
5
|
-
* operations are applied to the editor. You can access their `current` property
|
|
6
|
-
* at any time for the up-to-date point value.
|
|
7
|
-
*/
|
|
8
|
-
export interface PointRef {
|
|
9
|
-
current: Point | null;
|
|
10
|
-
affinity: TextDirection | null;
|
|
11
|
-
unref(): Point | null;
|
|
12
|
-
}
|
|
13
|
-
export interface PointRefInterface {
|
|
14
|
-
/**
|
|
15
|
-
* Transform the point ref's current value by an operation.
|
|
16
|
-
*/
|
|
17
|
-
transform: (ref: PointRef, op: Operation) => void;
|
|
18
|
-
}
|
|
19
|
-
export declare const PointRef: PointRefInterface;
|
|
1
|
+
import { Operation, Point } from '..';
|
|
2
|
+
import { TextDirection } from '../types/types';
|
|
3
|
+
/**
|
|
4
|
+
* `PointRef` objects keep a specific point in a document synced over time as new
|
|
5
|
+
* operations are applied to the editor. You can access their `current` property
|
|
6
|
+
* at any time for the up-to-date point value.
|
|
7
|
+
*/
|
|
8
|
+
export interface PointRef {
|
|
9
|
+
current: Point | null;
|
|
10
|
+
affinity: TextDirection | null;
|
|
11
|
+
unref(): Point | null;
|
|
12
|
+
}
|
|
13
|
+
export interface PointRefInterface {
|
|
14
|
+
/**
|
|
15
|
+
* Transform the point ref's current value by an operation.
|
|
16
|
+
*/
|
|
17
|
+
transform: (ref: PointRef, op: Operation) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const PointRef: PointRefInterface;
|
|
20
20
|
//# sourceMappingURL=point-ref.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point-ref.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"point-ref.d.ts","sourceRoot":"","sources":["../../../../packages/slate/src/interfaces/point-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE9C;;;;GAIG;AAEH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,KAAK,GAAG,IAAI,CAAA;IACrB,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;IAC9B,KAAK,IAAI,KAAK,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,KAAK,IAAI,CAAA;CAClD;AAGD,eAAO,MAAM,QAAQ,EAAE,iBAetB,CAAA"}
|