@prosekit/core 0.8.3 → 0.8.5
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/editor-KZlceNQ1.d.ts +722 -0
- package/dist/editor-KZlceNQ1.d.ts.map +1 -0
- package/dist/{editor-DlGlYOp-.js → editor-TvRTsFdO.js} +102 -196
- package/dist/editor-TvRTsFdO.js.map +1 -0
- package/dist/prosekit-core-test.d.ts +20 -19
- package/dist/prosekit-core-test.d.ts.map +1 -0
- package/dist/prosekit-core-test.js +5 -8
- package/dist/prosekit-core-test.js.map +1 -0
- package/dist/prosekit-core.d.ts +797 -792
- package/dist/prosekit-core.d.ts.map +1 -0
- package/dist/prosekit-core.js +42 -79
- package/dist/prosekit-core.js.map +1 -0
- package/package.json +14 -12
- package/src/commands/add-mark.ts +53 -0
- package/src/commands/expand-mark.ts +96 -0
- package/src/commands/insert-default-block.spec.ts +102 -0
- package/src/commands/insert-default-block.ts +49 -0
- package/src/commands/insert-node.ts +71 -0
- package/src/commands/insert-text.ts +24 -0
- package/src/commands/remove-mark.ts +54 -0
- package/src/commands/remove-node.ts +43 -0
- package/src/commands/select-all.ts +16 -0
- package/src/commands/set-block-type.ts +64 -0
- package/src/commands/set-node-attrs.ts +68 -0
- package/src/commands/toggle-mark.ts +65 -0
- package/src/commands/toggle-node.ts +47 -0
- package/src/commands/toggle-wrap.spec.ts +35 -0
- package/src/commands/toggle-wrap.ts +42 -0
- package/src/commands/unset-block-type.spec.ts +49 -0
- package/src/commands/unset-block-type.ts +84 -0
- package/src/commands/unset-mark.spec.ts +35 -0
- package/src/commands/unset-mark.ts +38 -0
- package/src/commands/wrap.ts +50 -0
- package/src/editor/action.spec.ts +143 -0
- package/src/editor/action.ts +248 -0
- package/src/editor/editor.spec.ts +186 -0
- package/src/editor/editor.ts +563 -0
- package/src/editor/union.spec.ts +108 -0
- package/src/editor/union.ts +47 -0
- package/src/editor/with-priority.ts +25 -0
- package/src/error.ts +28 -0
- package/src/extensions/clipboard-serializer.ts +107 -0
- package/src/extensions/command.ts +121 -0
- package/src/extensions/default-state.spec.ts +60 -0
- package/src/extensions/default-state.ts +76 -0
- package/src/extensions/doc.ts +31 -0
- package/src/extensions/events/doc-change.ts +34 -0
- package/src/extensions/events/dom-event.spec.ts +70 -0
- package/src/extensions/events/dom-event.ts +117 -0
- package/src/extensions/events/editor-event.ts +293 -0
- package/src/extensions/events/focus.spec.ts +50 -0
- package/src/extensions/events/focus.ts +28 -0
- package/src/extensions/events/plugin-view.ts +132 -0
- package/src/extensions/history.ts +81 -0
- package/src/extensions/keymap-base.ts +60 -0
- package/src/extensions/keymap.spec.ts +125 -0
- package/src/extensions/keymap.ts +96 -0
- package/src/extensions/mark-spec.spec.ts +177 -0
- package/src/extensions/mark-spec.ts +181 -0
- package/src/extensions/mark-view-effect.ts +85 -0
- package/src/extensions/mark-view.ts +43 -0
- package/src/extensions/node-spec.spec.ts +224 -0
- package/src/extensions/node-spec.ts +199 -0
- package/src/extensions/node-view-effect.ts +85 -0
- package/src/extensions/node-view.ts +43 -0
- package/src/extensions/paragraph.ts +61 -0
- package/src/extensions/plugin.spec.ts +153 -0
- package/src/extensions/plugin.ts +81 -0
- package/src/extensions/text.ts +34 -0
- package/src/facets/base-extension.ts +54 -0
- package/src/facets/command.ts +21 -0
- package/src/facets/facet-extension.spec.ts +173 -0
- package/src/facets/facet-extension.ts +53 -0
- package/src/facets/facet-node.spec.ts +265 -0
- package/src/facets/facet-node.ts +185 -0
- package/src/facets/facet-types.ts +9 -0
- package/src/facets/facet.spec.ts +76 -0
- package/src/facets/facet.ts +84 -0
- package/src/facets/root.ts +44 -0
- package/src/facets/schema-spec.ts +30 -0
- package/src/facets/schema.ts +26 -0
- package/src/facets/state.spec.ts +53 -0
- package/src/facets/state.ts +85 -0
- package/src/facets/union-extension.ts +41 -0
- package/src/index.ts +302 -0
- package/src/test/index.ts +4 -0
- package/src/test/test-builder.ts +68 -0
- package/src/test/test-editor.spec.ts +104 -0
- package/src/test/test-editor.ts +113 -0
- package/src/testing/index.ts +283 -0
- package/src/testing/keyboard.ts +5 -0
- package/src/types/any-function.ts +4 -0
- package/src/types/assert-type-equal.ts +8 -0
- package/src/types/attrs.ts +32 -0
- package/src/types/base-node-view-options.ts +33 -0
- package/src/types/dom-node.ts +1 -0
- package/src/types/extension-command.ts +52 -0
- package/src/types/extension-mark.ts +15 -0
- package/src/types/extension-node.ts +15 -0
- package/src/types/extension.spec.ts +56 -0
- package/src/types/extension.ts +168 -0
- package/src/types/model.ts +54 -0
- package/src/types/object-entries.ts +13 -0
- package/src/types/pick-string-literal.spec.ts +10 -0
- package/src/types/pick-string-literal.ts +6 -0
- package/src/types/pick-sub-type.spec.ts +20 -0
- package/src/types/pick-sub-type.ts +6 -0
- package/src/types/priority.ts +12 -0
- package/src/types/setter.ts +4 -0
- package/src/types/simplify-deeper.spec.ts +40 -0
- package/src/types/simplify-deeper.ts +6 -0
- package/src/types/simplify-union.spec.ts +21 -0
- package/src/types/simplify-union.ts +11 -0
- package/src/utils/array-grouping.spec.ts +29 -0
- package/src/utils/array-grouping.ts +25 -0
- package/src/utils/array.ts +21 -0
- package/src/utils/assert.ts +13 -0
- package/src/utils/attrs-match.ts +20 -0
- package/src/utils/can-use-regex-lookbehind.ts +12 -0
- package/src/utils/clsx.spec.ts +14 -0
- package/src/utils/clsx.ts +14 -0
- package/src/utils/collect-children.ts +21 -0
- package/src/utils/collect-nodes.ts +37 -0
- package/src/utils/combine-event-handlers.spec.ts +27 -0
- package/src/utils/combine-event-handlers.ts +27 -0
- package/src/utils/contains-inline-node.ts +17 -0
- package/src/utils/deep-equals.spec.ts +26 -0
- package/src/utils/deep-equals.ts +29 -0
- package/src/utils/default-block-at.ts +15 -0
- package/src/utils/editor-content.spec.ts +47 -0
- package/src/utils/editor-content.ts +77 -0
- package/src/utils/env.ts +6 -0
- package/src/utils/find-parent-node-of-type.ts +29 -0
- package/src/utils/find-parent-node.spec.ts +68 -0
- package/src/utils/find-parent-node.ts +55 -0
- package/src/utils/get-custom-selection.ts +19 -0
- package/src/utils/get-dom-api.ts +56 -0
- package/src/utils/get-id.spec.ts +14 -0
- package/src/utils/get-id.ts +13 -0
- package/src/utils/get-mark-type.ts +20 -0
- package/src/utils/get-node-type.ts +20 -0
- package/src/utils/get-node-types.ts +19 -0
- package/src/utils/includes-mark.ts +18 -0
- package/src/utils/is-at-block-start.ts +26 -0
- package/src/utils/is-in-code-block.ts +18 -0
- package/src/utils/is-mark-absent.spec.ts +53 -0
- package/src/utils/is-mark-absent.ts +42 -0
- package/src/utils/is-mark-active.ts +27 -0
- package/src/utils/is-node-active.ts +25 -0
- package/src/utils/is-subset.spec.ts +12 -0
- package/src/utils/is-subset.ts +11 -0
- package/src/utils/maybe-run.spec.ts +39 -0
- package/src/utils/maybe-run.ts +11 -0
- package/src/utils/merge-objects.spec.ts +30 -0
- package/src/utils/merge-objects.ts +11 -0
- package/src/utils/merge-specs.ts +35 -0
- package/src/utils/object-equal.spec.ts +26 -0
- package/src/utils/object-equal.ts +28 -0
- package/src/utils/output-spec.test.ts +95 -0
- package/src/utils/output-spec.ts +130 -0
- package/src/utils/parse.spec.ts +46 -0
- package/src/utils/parse.ts +321 -0
- package/src/utils/remove-undefined-values.spec.ts +15 -0
- package/src/utils/remove-undefined-values.ts +9 -0
- package/src/utils/set-selection-around.ts +11 -0
- package/src/utils/type-assertion.ts +91 -0
- package/src/utils/unicode.spec.ts +10 -0
- package/src/utils/unicode.ts +4 -0
- package/src/utils/with-skip-code-block.ts +15 -0
- package/dist/editor-OUH5V8BA.d.ts +0 -754
package/dist/prosekit-core.d.ts
CHANGED
|
@@ -1,238 +1,238 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as NodeChild, A as ExtractMarkActions, B as Priority, C as StepJSON, D as ExtractCommandAppliers, E as ExtractCommandActions, F as PlainExtension, G as ToMarkAction, H as NodeTyping, I as Union, J as CommandTyping, K as CommandAction, L as UnionExtension, M as ExtractNodeActions, N as ExtractNodes, O as ExtractCommandCreators, P as ExtractTyping, Q as NodeBuilder, R as SimplifyUnion, S as StateJSON, T as ExtensionTyping, U as ToNodeAction, V as PickSubType, W as MarkTyping, X as MarkBuilder, Y as MarkAction, Z as NodeAction, _ as nodeFromHTML, a as DOMDocumentOptions, b as NodeJSON, c as JSONParserOptions, d as htmlFromJSON, et as AnyAttrs, f as htmlFromNode, g as nodeFromElement, h as jsonFromState, i as createEditor, j as ExtractMarks, k as ExtractCommands, l as elementFromJSON, m as jsonFromNode, o as DOMParserOptions, p as jsonFromHTML, q as CommandCreator, r as EditorOptions, s as DOMSerializerOptions, t as Editor, tt as AttrSpec, u as elementFromNode, v as nodeFromJSON, w as Extension, x as SelectionJSON, y as stateFromJSON, z as SimplifyDeeper } from "./editor-KZlceNQ1.js";
|
|
2
2
|
import { AllSelection, Command, EditorState, EditorStateConfig, NodeSelection, Plugin, Selection, TextSelection, Transaction } from "@prosekit/pm/state";
|
|
3
|
-
import { Attrs
|
|
3
|
+
import { Attrs, ContentMatch, DOMSerializer, Fragment, Mark, MarkSpec, MarkType, Node, NodeSpec, NodeType, ProseMirrorFragment, ProseMirrorNode, ResolvedPos, Schema, Slice } from "@prosekit/pm/model";
|
|
4
4
|
import { DOMEventMap, EditorView, MarkViewConstructor, NodeView, NodeViewConstructor } from "@prosekit/pm/view";
|
|
5
5
|
|
|
6
6
|
//#region src/commands/add-mark.d.ts
|
|
7
7
|
/**
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
10
|
interface AddMarkOptions {
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
type: string | MarkType
|
|
12
|
+
* The type of the mark to add.
|
|
13
|
+
*/
|
|
14
|
+
type: string | MarkType;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
attrs?: Attrs
|
|
16
|
+
* The attributes of the mark to add.
|
|
17
|
+
*/
|
|
18
|
+
attrs?: Attrs | null;
|
|
19
19
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
* The start position of the document. By default it will be the start position of current selection.
|
|
21
|
+
*/
|
|
22
22
|
from?: number;
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
* The end position of the document. By default it will be the end position of current selection.
|
|
25
|
+
*/
|
|
26
26
|
to?: number;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* Returns a command that adds the given mark with the given attributes.
|
|
30
|
-
*
|
|
31
|
-
* @public
|
|
32
|
-
*/
|
|
29
|
+
* Returns a command that adds the given mark with the given attributes.
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
33
|
declare function addMark(options: AddMarkOptions): Command;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/commands/expand-mark.d.ts
|
|
36
36
|
/**
|
|
37
|
-
* @public
|
|
38
|
-
*/
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
39
|
interface ExpandMarkOptions {
|
|
40
40
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
type: string | MarkType
|
|
41
|
+
* The type of the mark to expand.
|
|
42
|
+
*/
|
|
43
|
+
type: string | MarkType;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* Expands the selection to include the entire mark at the current position.
|
|
47
|
-
*
|
|
48
|
-
* @public
|
|
49
|
-
*/
|
|
46
|
+
* Expands the selection to include the entire mark at the current position.
|
|
47
|
+
*
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
50
|
declare function expandMark(options: ExpandMarkOptions): Command;
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/commands/insert-default-block.d.ts
|
|
53
53
|
/**
|
|
54
|
-
* @public
|
|
55
|
-
*/
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
56
|
interface InsertDefaultBlockOptions {
|
|
57
57
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
* The position to insert the node at. By default it will insert after the
|
|
59
|
+
* current selection.
|
|
60
|
+
*/
|
|
61
61
|
pos?: number;
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
* Returns a command that inserts a default block after current selection or at
|
|
65
|
-
* the given position.
|
|
66
|
-
*
|
|
67
|
-
* @public
|
|
68
|
-
*/
|
|
64
|
+
* Returns a command that inserts a default block after current selection or at
|
|
65
|
+
* the given position.
|
|
66
|
+
*
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
69
|
declare function insertDefaultBlock(options?: InsertDefaultBlockOptions): Command;
|
|
70
70
|
//#endregion
|
|
71
71
|
//#region src/commands/insert-node.d.ts
|
|
72
72
|
/**
|
|
73
|
-
* @public
|
|
74
|
-
*/
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
75
|
interface InsertNodeOptions {
|
|
76
76
|
/**
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
* The node to insert. Either this or `type` must be provided.
|
|
78
|
+
*/
|
|
79
79
|
node?: ProseMirrorNode;
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
type?: string | NodeType
|
|
81
|
+
* The type of the node to insert. Either this or `node` must be provided.
|
|
82
|
+
*/
|
|
83
|
+
type?: string | NodeType;
|
|
84
84
|
/**
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
attrs?: Attrs
|
|
85
|
+
* When `type` is provided, the attributes of the node to insert.
|
|
86
|
+
*/
|
|
87
|
+
attrs?: Attrs;
|
|
88
88
|
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
* The position to insert the node at. By default it will be the anchor
|
|
90
|
+
* position of current selection.
|
|
91
|
+
*/
|
|
92
92
|
pos?: number;
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
* Returns a command that inserts the given node at the current selection or at
|
|
96
|
-
* the given position.
|
|
97
|
-
*
|
|
98
|
-
* @public
|
|
99
|
-
*/
|
|
95
|
+
* Returns a command that inserts the given node at the current selection or at
|
|
96
|
+
* the given position.
|
|
97
|
+
*
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
100
|
declare function insertNode(options: InsertNodeOptions): Command;
|
|
101
101
|
//#endregion
|
|
102
102
|
//#region src/commands/remove-mark.d.ts
|
|
103
103
|
/**
|
|
104
|
-
* @public
|
|
105
|
-
*/
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
106
|
interface RemoveMarkOptions {
|
|
107
107
|
/**
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
type: string | MarkType
|
|
108
|
+
* The type of the mark to remove.
|
|
109
|
+
*/
|
|
110
|
+
type: string | MarkType;
|
|
111
111
|
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
attrs?: Attrs
|
|
112
|
+
* If attrs is given, remove precisely the mark with the given attrs. Otherwise, remove all marks of the given type.
|
|
113
|
+
*/
|
|
114
|
+
attrs?: Attrs | null;
|
|
115
115
|
/**
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
* The start position of the document. By default it will be the start position of current selection.
|
|
117
|
+
*/
|
|
118
118
|
from?: number;
|
|
119
119
|
/**
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
* The end position of the document. By default it will be the end position of current selection.
|
|
121
|
+
*/
|
|
122
122
|
to?: number;
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
|
-
* Returns a command that removes the given mark.
|
|
126
|
-
*
|
|
127
|
-
* @public
|
|
128
|
-
*/
|
|
125
|
+
* Returns a command that removes the given mark.
|
|
126
|
+
*
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
129
|
declare function removeMark(options: RemoveMarkOptions): Command;
|
|
130
130
|
//#endregion
|
|
131
131
|
//#region src/commands/remove-node.d.ts
|
|
132
132
|
/**
|
|
133
|
-
* @public
|
|
134
|
-
*/
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
135
|
interface RemoveNodeOptions {
|
|
136
136
|
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
type: string | NodeType
|
|
137
|
+
* The type of the node to remove.
|
|
138
|
+
*/
|
|
139
|
+
type: string | NodeType;
|
|
140
140
|
/**
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
* The document position to start searching node. By default it will be the
|
|
142
|
+
* anchor position of current selection.
|
|
143
|
+
*/
|
|
144
144
|
pos?: number;
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
|
-
* Returns a command to remove the nearest ancestor node of a specific type from the current position.
|
|
148
|
-
*
|
|
149
|
-
* @public
|
|
150
|
-
*/
|
|
147
|
+
* Returns a command to remove the nearest ancestor node of a specific type from the current position.
|
|
148
|
+
*
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
151
|
declare function removeNode(options: RemoveNodeOptions): Command;
|
|
152
152
|
//#endregion
|
|
153
153
|
//#region src/commands/set-block-type.d.ts
|
|
154
154
|
/**
|
|
155
|
-
* @public
|
|
156
|
-
*/
|
|
155
|
+
* @public
|
|
156
|
+
*/
|
|
157
157
|
interface SetBlockTypeOptions {
|
|
158
|
-
type: NodeType
|
|
159
|
-
attrs?: Attrs
|
|
158
|
+
type: NodeType | string;
|
|
159
|
+
attrs?: Attrs | null;
|
|
160
160
|
from?: number;
|
|
161
161
|
to?: number;
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
|
-
* Returns a command that tries to set the selected textblocks to the given node
|
|
165
|
-
* type with the given attributes.
|
|
166
|
-
*
|
|
167
|
-
* @public
|
|
168
|
-
*/
|
|
164
|
+
* Returns a command that tries to set the selected textblocks to the given node
|
|
165
|
+
* type with the given attributes.
|
|
166
|
+
*
|
|
167
|
+
* @public
|
|
168
|
+
*/
|
|
169
169
|
declare function setBlockType(options: SetBlockTypeOptions): Command;
|
|
170
170
|
//#endregion
|
|
171
171
|
//#region src/commands/set-node-attrs.d.ts
|
|
172
172
|
/**
|
|
173
|
-
* @public
|
|
174
|
-
*/
|
|
173
|
+
* @public
|
|
174
|
+
*/
|
|
175
175
|
interface SetNodeAttrsOptions {
|
|
176
176
|
/**
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
type: string | NodeType
|
|
177
|
+
* The type of node to set the attributes of.
|
|
178
|
+
*
|
|
179
|
+
* If current node is not of this type, the command will do nothing.
|
|
180
|
+
*/
|
|
181
|
+
type: string | NodeType | string[] | NodeType[];
|
|
182
182
|
/**
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
attrs: Attrs
|
|
183
|
+
* The attributes to set.
|
|
184
|
+
*/
|
|
185
|
+
attrs: Attrs;
|
|
186
186
|
/**
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
* The position of the node. Defaults to the position of the wrapping node
|
|
188
|
+
* containing the current selection.
|
|
189
|
+
*/
|
|
190
190
|
pos?: number;
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
|
-
* Returns a command that set the attributes of the current node.
|
|
194
|
-
*
|
|
195
|
-
* @public
|
|
196
|
-
*/
|
|
193
|
+
* Returns a command that set the attributes of the current node.
|
|
194
|
+
*
|
|
195
|
+
* @public
|
|
196
|
+
*/
|
|
197
197
|
declare function setNodeAttrs(options: SetNodeAttrsOptions): Command;
|
|
198
198
|
//#endregion
|
|
199
199
|
//#region src/commands/toggle-mark.d.ts
|
|
200
200
|
/**
|
|
201
|
-
* @public
|
|
202
|
-
*/
|
|
201
|
+
* @public
|
|
202
|
+
*/
|
|
203
203
|
interface ToggleMarkOptions {
|
|
204
204
|
/**
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
type: string | MarkType
|
|
205
|
+
* The mark type to toggle.
|
|
206
|
+
*/
|
|
207
|
+
type: string | MarkType;
|
|
208
208
|
/**
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
attrs?: Attrs
|
|
209
|
+
* The optional attributes to set on the mark.
|
|
210
|
+
*/
|
|
211
|
+
attrs?: Attrs | null;
|
|
212
212
|
/**
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
213
|
+
* Controls whether, when part of the selected range has the mark
|
|
214
|
+
* already and part doesn't, the mark is removed (`true`) or added
|
|
215
|
+
* (`false`).
|
|
216
|
+
*
|
|
217
|
+
* @default false
|
|
218
|
+
*/
|
|
219
219
|
removeWhenPresent?: boolean;
|
|
220
220
|
/**
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
221
|
+
* Whether the command should act on the content of inline nodes marked as
|
|
222
|
+
* [atoms](https://prosemirror.net/docs/ref/#model.NodeSpec.atom) that are
|
|
223
|
+
* completely covered by a selection range.
|
|
224
|
+
*
|
|
225
|
+
* @default true
|
|
226
|
+
*/
|
|
227
227
|
enterInlineAtoms?: boolean;
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
|
-
* Returns a command that toggles the given mark with the given attributes.
|
|
231
|
-
*
|
|
232
|
-
* @param options
|
|
233
|
-
*
|
|
234
|
-
* @public
|
|
235
|
-
*/
|
|
230
|
+
* Returns a command that toggles the given mark with the given attributes.
|
|
231
|
+
*
|
|
232
|
+
* @param options
|
|
233
|
+
*
|
|
234
|
+
* @public
|
|
235
|
+
*/
|
|
236
236
|
declare function toggleMark({
|
|
237
237
|
type,
|
|
238
238
|
attrs,
|
|
@@ -242,26 +242,26 @@ declare function toggleMark({
|
|
|
242
242
|
//#endregion
|
|
243
243
|
//#region src/commands/toggle-node.d.ts
|
|
244
244
|
/**
|
|
245
|
-
* @public
|
|
246
|
-
*/
|
|
245
|
+
* @public
|
|
246
|
+
*/
|
|
247
247
|
interface ToggleNodeOptions {
|
|
248
248
|
/**
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
type: string | NodeType
|
|
249
|
+
* The type of the node to toggle.
|
|
250
|
+
*/
|
|
251
|
+
type: string | NodeType;
|
|
252
252
|
/**
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
attrs?: Attrs
|
|
253
|
+
* The attributes of the node to toggle.
|
|
254
|
+
*/
|
|
255
|
+
attrs?: Attrs | null;
|
|
256
256
|
}
|
|
257
257
|
/**
|
|
258
|
-
* Returns a command that set the selected textblocks to the given node type
|
|
259
|
-
* with the given attributes.
|
|
260
|
-
*
|
|
261
|
-
* @param options
|
|
262
|
-
*
|
|
263
|
-
* @public
|
|
264
|
-
*/
|
|
258
|
+
* Returns a command that set the selected textblocks to the given node type
|
|
259
|
+
* with the given attributes.
|
|
260
|
+
*
|
|
261
|
+
* @param options
|
|
262
|
+
*
|
|
263
|
+
* @public
|
|
264
|
+
*/
|
|
265
265
|
declare function toggleNode({
|
|
266
266
|
type,
|
|
267
267
|
attrs
|
|
@@ -270,164 +270,163 @@ declare function toggleNode({
|
|
|
270
270
|
//#region src/commands/toggle-wrap.d.ts
|
|
271
271
|
interface ToggleWrapOptions {
|
|
272
272
|
/**
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
type: string | NodeType
|
|
273
|
+
* The type of the node to toggle.
|
|
274
|
+
*/
|
|
275
|
+
type: string | NodeType;
|
|
276
276
|
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
attrs?: Attrs
|
|
277
|
+
* The attributes of the node to toggle.
|
|
278
|
+
*/
|
|
279
|
+
attrs?: Attrs | null;
|
|
280
280
|
}
|
|
281
281
|
/**
|
|
282
|
-
* Toggle between wrapping an inactive node with the provided node type, and
|
|
283
|
-
* lifting it up into its parent.
|
|
284
|
-
*
|
|
285
|
-
* @param options
|
|
286
|
-
*
|
|
287
|
-
* @public
|
|
288
|
-
*/
|
|
282
|
+
* Toggle between wrapping an inactive node with the provided node type, and
|
|
283
|
+
* lifting it up into its parent.
|
|
284
|
+
*
|
|
285
|
+
* @param options
|
|
286
|
+
*
|
|
287
|
+
* @public
|
|
288
|
+
*/
|
|
289
289
|
declare function toggleWrap(options: ToggleWrapOptions): Command;
|
|
290
290
|
//#endregion
|
|
291
291
|
//#region src/commands/unset-block-type.d.ts
|
|
292
292
|
/**
|
|
293
|
-
* @public
|
|
294
|
-
*/
|
|
293
|
+
* @public
|
|
294
|
+
*/
|
|
295
295
|
interface UnsetBlockTypeOptions {
|
|
296
296
|
/**
|
|
297
|
-
|
|
298
|
-
|
|
297
|
+
* The start position of the document. By default it will be the start position of current selection.
|
|
298
|
+
*/
|
|
299
299
|
from?: number;
|
|
300
300
|
/**
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
* The end position of the document. By default it will be the end position of current selection.
|
|
302
|
+
*/
|
|
303
303
|
to?: number;
|
|
304
304
|
}
|
|
305
305
|
/**
|
|
306
|
-
* Returns a command that set the type of all textblocks between the given range
|
|
307
|
-
* to the default type (usually `paragraph`).
|
|
308
|
-
*
|
|
309
|
-
* @public
|
|
310
|
-
*/
|
|
306
|
+
* Returns a command that set the type of all textblocks between the given range
|
|
307
|
+
* to the default type (usually `paragraph`).
|
|
308
|
+
*
|
|
309
|
+
* @public
|
|
310
|
+
*/
|
|
311
311
|
declare function unsetBlockType(options?: UnsetBlockTypeOptions): Command;
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region src/commands/unset-mark.d.ts
|
|
314
314
|
/**
|
|
315
|
-
* @public
|
|
316
|
-
|
|
315
|
+
* @public
|
|
316
|
+
*
|
|
317
|
+
* Options for {@link unsetMark}.
|
|
318
|
+
*/
|
|
317
319
|
interface UnsetMarkOptions {
|
|
318
320
|
/**
|
|
319
|
-
|
|
320
|
-
|
|
321
|
+
* The start position of the document. By default it will be the start position of current selection.
|
|
322
|
+
*/
|
|
321
323
|
from?: number;
|
|
322
324
|
/**
|
|
323
|
-
|
|
324
|
-
|
|
325
|
+
* The end position of the document. By default it will be the end position of current selection.
|
|
326
|
+
*/
|
|
325
327
|
to?: number;
|
|
326
328
|
}
|
|
327
329
|
/**
|
|
328
|
-
* Returns a command that removes all marks.
|
|
329
|
-
*
|
|
330
|
-
* @public
|
|
331
|
-
*/
|
|
330
|
+
* Returns a command that removes all marks.
|
|
331
|
+
*
|
|
332
|
+
* @public
|
|
333
|
+
*/
|
|
332
334
|
declare function unsetMark(options?: UnsetMarkOptions): Command;
|
|
333
335
|
//#endregion
|
|
334
336
|
//#region src/commands/wrap.d.ts
|
|
335
337
|
/**
|
|
336
|
-
* @public
|
|
337
|
-
*/
|
|
338
|
+
* @public
|
|
339
|
+
*/
|
|
338
340
|
interface WrapOptions {
|
|
339
341
|
/**
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
type: NodeType
|
|
342
|
+
* The node type to wrap the selected textblock with.
|
|
343
|
+
*/
|
|
344
|
+
type: NodeType | string;
|
|
343
345
|
/**
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
nodeType?: NodeType
|
|
346
|
+
* @deprecated Use `nodeSpec` instead.
|
|
347
|
+
*/
|
|
348
|
+
nodeType?: NodeType;
|
|
347
349
|
/**
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
attrs?: Attrs
|
|
350
|
+
* Optional attributes to apply to the node.
|
|
351
|
+
*/
|
|
352
|
+
attrs?: Attrs | null;
|
|
351
353
|
}
|
|
352
354
|
/**
|
|
353
|
-
* Returns a command that wraps the selected textblock with the given node type.
|
|
354
|
-
*
|
|
355
|
-
* @param options
|
|
356
|
-
*
|
|
357
|
-
* @public
|
|
358
|
-
*/
|
|
355
|
+
* Returns a command that wraps the selected textblock with the given node type.
|
|
356
|
+
*
|
|
357
|
+
* @param options
|
|
358
|
+
*
|
|
359
|
+
* @public
|
|
360
|
+
*/
|
|
359
361
|
declare function wrap(options: WrapOptions): Command;
|
|
360
362
|
//#endregion
|
|
361
363
|
//#region src/editor/union.d.ts
|
|
362
364
|
/**
|
|
363
|
-
* Merges multiple extensions into one. You can pass multiple extensions as
|
|
364
|
-
* arguments or a single array containing multiple extensions.
|
|
365
|
-
*
|
|
366
|
-
* @throws If no extensions are provided.
|
|
367
|
-
*
|
|
368
|
-
* @example
|
|
369
|
-
*
|
|
370
|
-
* ```ts
|
|
371
|
-
* function defineFancyNodes() {
|
|
372
|
-
* return union(
|
|
373
|
-
* defineFancyParagraph(),
|
|
374
|
-
* defineFancyHeading(),
|
|
375
|
-
* )
|
|
376
|
-
* }
|
|
377
|
-
* ```
|
|
378
|
-
*
|
|
379
|
-
* @example
|
|
380
|
-
*
|
|
381
|
-
* ```ts
|
|
382
|
-
* function defineFancyNodes() {
|
|
383
|
-
* return union([
|
|
384
|
-
* defineFancyParagraph(),
|
|
385
|
-
* defineFancyHeading(),
|
|
386
|
-
* ])
|
|
387
|
-
* }
|
|
388
|
-
* ```
|
|
389
|
-
*
|
|
390
|
-
* @public
|
|
391
|
-
*/
|
|
365
|
+
* Merges multiple extensions into one. You can pass multiple extensions as
|
|
366
|
+
* arguments or a single array containing multiple extensions.
|
|
367
|
+
*
|
|
368
|
+
* @throws If no extensions are provided.
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
*
|
|
372
|
+
* ```ts
|
|
373
|
+
* function defineFancyNodes() {
|
|
374
|
+
* return union(
|
|
375
|
+
* defineFancyParagraph(),
|
|
376
|
+
* defineFancyHeading(),
|
|
377
|
+
* )
|
|
378
|
+
* }
|
|
379
|
+
* ```
|
|
380
|
+
*
|
|
381
|
+
* @example
|
|
382
|
+
*
|
|
383
|
+
* ```ts
|
|
384
|
+
* function defineFancyNodes() {
|
|
385
|
+
* return union([
|
|
386
|
+
* defineFancyParagraph(),
|
|
387
|
+
* defineFancyHeading(),
|
|
388
|
+
* ])
|
|
389
|
+
* }
|
|
390
|
+
* ```
|
|
391
|
+
*
|
|
392
|
+
* @public
|
|
393
|
+
*/
|
|
392
394
|
declare function union<const E extends readonly Extension[]>(...exts: E): Union<E>;
|
|
393
395
|
declare function union<const E extends readonly Extension[]>(exts: E): Union<E>;
|
|
394
396
|
//#endregion
|
|
395
397
|
//#region src/editor/with-priority.d.ts
|
|
396
398
|
/**
|
|
397
|
-
* Return an new extension with the given priority.
|
|
398
|
-
*
|
|
399
|
-
* @example
|
|
400
|
-
* ```ts
|
|
401
|
-
* import { Priority, withPriority } from 'prosekit/core'
|
|
402
|
-
*
|
|
403
|
-
* const extension = withPriority(defineMyExtension(), Priority.high)
|
|
404
|
-
* ```
|
|
405
|
-
*
|
|
406
|
-
* @public
|
|
407
|
-
*/
|
|
399
|
+
* Return an new extension with the given priority.
|
|
400
|
+
*
|
|
401
|
+
* @example
|
|
402
|
+
* ```ts
|
|
403
|
+
* import { Priority, withPriority } from 'prosekit/core'
|
|
404
|
+
*
|
|
405
|
+
* const extension = withPriority(defineMyExtension(), Priority.high)
|
|
406
|
+
* ```
|
|
407
|
+
*
|
|
408
|
+
* @public
|
|
409
|
+
*/
|
|
408
410
|
declare function withPriority<T extends Extension>(extension: T, priority: Priority): T;
|
|
409
411
|
//#endregion
|
|
410
412
|
//#region src/error.d.ts
|
|
411
413
|
/**
|
|
412
|
-
* Base class for all ProseKit errors.
|
|
413
|
-
*
|
|
414
|
-
* @internal
|
|
415
|
-
*/
|
|
414
|
+
* Base class for all ProseKit errors.
|
|
415
|
+
*
|
|
416
|
+
* @internal
|
|
417
|
+
*/
|
|
416
418
|
declare class ProseKitError extends Error {}
|
|
417
419
|
/**
|
|
418
|
-
* @internal
|
|
419
|
-
*/
|
|
420
|
+
* @internal
|
|
421
|
+
*/
|
|
420
422
|
declare class EditorNotFoundError extends ProseKitError {
|
|
421
423
|
constructor();
|
|
422
424
|
}
|
|
423
|
-
/**
|
|
424
|
-
* @internal
|
|
425
|
-
*/
|
|
426
425
|
//#endregion
|
|
427
426
|
//#region src/types/any-function.d.ts
|
|
428
427
|
/**
|
|
429
|
-
* @internal
|
|
430
|
-
*/
|
|
428
|
+
* @internal
|
|
429
|
+
*/
|
|
431
430
|
type AnyFunction = (...args: any[]) => any;
|
|
432
431
|
//#endregion
|
|
433
432
|
//#region src/extensions/clipboard-serializer.d.ts
|
|
@@ -437,8 +436,8 @@ type NodesFromSchemaFunction = typeof DOMSerializer.nodesFromSchema;
|
|
|
437
436
|
type MarksFromSchemaFunction = typeof DOMSerializer.marksFromSchema;
|
|
438
437
|
type FunctionWrapper<T extends AnyFunction> = (fn: T) => T;
|
|
439
438
|
/**
|
|
440
|
-
* @internal
|
|
441
|
-
*/
|
|
439
|
+
* @internal
|
|
440
|
+
*/
|
|
442
441
|
interface ClipboardSerializerOptions {
|
|
443
442
|
serializeFragmentWrapper?: FunctionWrapper<SerializeFragmentFunction>;
|
|
444
443
|
serializeNodeWrapper?: FunctionWrapper<SerializeNodeFunction>;
|
|
@@ -446,32 +445,27 @@ interface ClipboardSerializerOptions {
|
|
|
446
445
|
marksFromSchemaWrapper?: FunctionWrapper<MarksFromSchemaFunction>;
|
|
447
446
|
}
|
|
448
447
|
/**
|
|
449
|
-
* @internal
|
|
450
|
-
*/
|
|
448
|
+
* @internal
|
|
449
|
+
*/
|
|
451
450
|
declare function defineClipboardSerializer(options: ClipboardSerializerOptions): PlainExtension;
|
|
452
451
|
//#endregion
|
|
453
452
|
//#region src/commands/insert-text.d.ts
|
|
454
453
|
/**
|
|
455
|
-
* @public
|
|
456
|
-
*/
|
|
454
|
+
* @public
|
|
455
|
+
*/
|
|
457
456
|
type InsertTextOptions = {
|
|
458
457
|
text: string;
|
|
459
458
|
from?: number;
|
|
460
459
|
to?: number;
|
|
461
460
|
};
|
|
462
|
-
/**
|
|
463
|
-
* Returns a command that inserts the given text.
|
|
464
|
-
*
|
|
465
|
-
* @public
|
|
466
|
-
*/
|
|
467
461
|
//#endregion
|
|
468
462
|
//#region src/extensions/command.d.ts
|
|
469
463
|
declare function defineCommands<T extends Record<string, CommandCreator> = Record<string, CommandCreator>>(commands: T): Extension<{
|
|
470
464
|
Commands: { [K in keyof T]: Parameters<T[K]> };
|
|
471
465
|
}>;
|
|
472
466
|
/**
|
|
473
|
-
* @internal
|
|
474
|
-
*/
|
|
467
|
+
* @internal
|
|
468
|
+
*/
|
|
475
469
|
type BaseCommandsExtension = Extension<{
|
|
476
470
|
Commands: {
|
|
477
471
|
insertText: [options: InsertTextOptions];
|
|
@@ -490,49 +484,49 @@ type BaseCommandsExtension = Extension<{
|
|
|
490
484
|
};
|
|
491
485
|
}>;
|
|
492
486
|
/**
|
|
493
|
-
* Add some base commands
|
|
494
|
-
*
|
|
495
|
-
* @public
|
|
496
|
-
*/
|
|
487
|
+
* Add some base commands
|
|
488
|
+
*
|
|
489
|
+
* @public
|
|
490
|
+
*/
|
|
497
491
|
declare function defineBaseCommands(): BaseCommandsExtension;
|
|
498
492
|
//#endregion
|
|
499
493
|
//#region src/extensions/default-state.d.ts
|
|
500
494
|
/**
|
|
501
|
-
* @public
|
|
502
|
-
*/
|
|
495
|
+
* @public
|
|
496
|
+
*/
|
|
503
497
|
interface DefaultStateOptions {
|
|
504
498
|
/**
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
499
|
+
* The starting document to use when creating the editor. It can be a
|
|
500
|
+
* ProseMirror node JSON object, a HTML string, or a HTML element instance.
|
|
501
|
+
*/
|
|
508
502
|
defaultContent?: NodeJSON | string | HTMLElement;
|
|
509
503
|
/**
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
504
|
+
* A JSON object representing the starting document to use when creating the
|
|
505
|
+
* editor.
|
|
506
|
+
*
|
|
507
|
+
* @deprecated Use `defaultContent` instead.
|
|
508
|
+
*/
|
|
515
509
|
defaultDoc?: NodeJSON;
|
|
516
510
|
/**
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
511
|
+
* A HTML element or a HTML string representing the starting document to use
|
|
512
|
+
* when creating the editor.
|
|
513
|
+
*
|
|
514
|
+
* @deprecated Use `defaultContent` instead.
|
|
515
|
+
*/
|
|
522
516
|
defaultHTML?: string | HTMLElement;
|
|
523
517
|
/**
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
518
|
+
* A JSON object representing the starting selection to use when creating the
|
|
519
|
+
* editor. It's only used when `defaultContent` is also provided.
|
|
520
|
+
*/
|
|
527
521
|
defaultSelection?: SelectionJSON;
|
|
528
522
|
}
|
|
529
523
|
/**
|
|
530
|
-
* Define a default state for the editor.
|
|
531
|
-
*
|
|
532
|
-
* @param options
|
|
533
|
-
*
|
|
534
|
-
* @public
|
|
535
|
-
*/
|
|
524
|
+
* Define a default state for the editor.
|
|
525
|
+
*
|
|
526
|
+
* @param options
|
|
527
|
+
*
|
|
528
|
+
* @public
|
|
529
|
+
*/
|
|
536
530
|
declare function defineDefaultState({
|
|
537
531
|
defaultSelection,
|
|
538
532
|
defaultContent,
|
|
@@ -542,103 +536,133 @@ declare function defineDefaultState({
|
|
|
542
536
|
//#endregion
|
|
543
537
|
//#region src/extensions/doc.d.ts
|
|
544
538
|
/**
|
|
545
|
-
* @internal
|
|
546
|
-
*/
|
|
539
|
+
* @internal
|
|
540
|
+
*/
|
|
547
541
|
type DocExtension = Extension<{
|
|
548
542
|
Nodes: {
|
|
549
|
-
doc: Attrs
|
|
543
|
+
doc: Attrs;
|
|
550
544
|
};
|
|
551
545
|
}>;
|
|
552
546
|
/**
|
|
553
|
-
* @public
|
|
554
|
-
*
|
|
555
|
-
* @deprecated Use the following import instead:
|
|
556
|
-
*
|
|
557
|
-
* ```ts
|
|
558
|
-
* import { defineDoc } from 'prosekit/extensions/doc'
|
|
559
|
-
* ```
|
|
560
|
-
*/
|
|
547
|
+
* @public
|
|
548
|
+
*
|
|
549
|
+
* @deprecated Use the following import instead:
|
|
550
|
+
*
|
|
551
|
+
* ```ts
|
|
552
|
+
* import { defineDoc } from 'prosekit/extensions/doc'
|
|
553
|
+
* ```
|
|
554
|
+
*/
|
|
561
555
|
declare function defineDoc(): DocExtension;
|
|
562
556
|
//#endregion
|
|
563
557
|
//#region src/extensions/events/doc-change.d.ts
|
|
564
558
|
/**
|
|
565
|
-
* A function that is called when the editor document is changed.
|
|
566
|
-
*
|
|
567
|
-
* @param view - The editor view.
|
|
568
|
-
* @param prevState - The previous editor state.
|
|
569
|
-
*
|
|
570
|
-
* @public
|
|
571
|
-
*/
|
|
559
|
+
* A function that is called when the editor document is changed.
|
|
560
|
+
*
|
|
561
|
+
* @param view - The editor view.
|
|
562
|
+
* @param prevState - The previous editor state.
|
|
563
|
+
*
|
|
564
|
+
* @public
|
|
565
|
+
*/
|
|
572
566
|
type DocChangeHandler = (view: EditorView, prevState: EditorState) => void;
|
|
573
567
|
/**
|
|
574
|
-
* Registers a event handler that is called when the editor document is changed.
|
|
575
|
-
*
|
|
576
|
-
* @public
|
|
577
|
-
*/
|
|
568
|
+
* Registers a event handler that is called when the editor document is changed.
|
|
569
|
+
*
|
|
570
|
+
* @public
|
|
571
|
+
*/
|
|
578
572
|
declare function defineDocChangeHandler(handler: DocChangeHandler): PlainExtension;
|
|
579
573
|
//#endregion
|
|
574
|
+
//#region src/extensions/events/dom-event.d.ts
|
|
575
|
+
/**
|
|
576
|
+
* A function to handle the events fired on the editable DOM element. Returns
|
|
577
|
+
* `true` to indicate that it handled the given event. When returning `true`,
|
|
578
|
+
* you are responsible for calling `event.preventDefault()` yourself (or not, if
|
|
579
|
+
* you want to allow the default behavior).
|
|
580
|
+
*
|
|
581
|
+
* @public
|
|
582
|
+
*/
|
|
583
|
+
type DOMEventHandler<Event extends keyof DOMEventMap = string> = (view: EditorView, event: DOMEventMap[Event]) => boolean | void;
|
|
584
|
+
/**
|
|
585
|
+
* Register a new event handler for the given event type.
|
|
586
|
+
*
|
|
587
|
+
* @public
|
|
588
|
+
*/
|
|
589
|
+
declare function defineDOMEventHandler<Event extends keyof DOMEventMap = string>(event: Event, handler: DOMEventHandler<Event>): PlainExtension;
|
|
590
|
+
//#endregion
|
|
580
591
|
//#region src/facets/facet-types.d.ts
|
|
581
592
|
/**
|
|
582
|
-
* @internal
|
|
583
|
-
*/
|
|
593
|
+
* @internal
|
|
594
|
+
*/
|
|
584
595
|
type FacetReducer<Input, Output> = (input: Input[]) => Output;
|
|
585
596
|
//#endregion
|
|
586
597
|
//#region src/facets/facet.d.ts
|
|
587
598
|
/**
|
|
588
|
-
* @internal
|
|
589
|
-
*/
|
|
599
|
+
* @internal
|
|
600
|
+
*/
|
|
590
601
|
declare class Facet<Input, Output> {
|
|
591
602
|
private _reducer?;
|
|
592
603
|
private _reduce?;
|
|
593
604
|
/**
|
|
594
|
-
|
|
595
|
-
|
|
605
|
+
* @internal
|
|
606
|
+
*/
|
|
596
607
|
readonly index: number;
|
|
597
608
|
/**
|
|
598
|
-
|
|
599
|
-
|
|
609
|
+
* @internal
|
|
610
|
+
*/
|
|
600
611
|
readonly parent: Facet<Output, any> | null;
|
|
601
612
|
/**
|
|
602
|
-
|
|
603
|
-
|
|
613
|
+
* @internal
|
|
614
|
+
*/
|
|
604
615
|
readonly singleton: boolean;
|
|
605
616
|
/**
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
617
|
+
* A index path to retrieve the current facet in a tree from the root.
|
|
618
|
+
*
|
|
619
|
+
* @internal
|
|
620
|
+
*/
|
|
610
621
|
readonly path: number[];
|
|
611
622
|
/**
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
constructor(parent: Facet<Output, any> | null, singleton: boolean, _reducer?: FacetReducer<Input, Output> | undefined, _reduce?: () => FacetReducer<Input, Output>);
|
|
623
|
+
* @internal
|
|
624
|
+
*/
|
|
625
|
+
constructor(parent: Facet<Output, any> | null, singleton: boolean, _reducer?: FacetReducer<Input, Output> | undefined, _reduce?: (() => FacetReducer<Input, Output>) | undefined);
|
|
615
626
|
get reducer(): FacetReducer<Input, Output>;
|
|
616
627
|
}
|
|
617
628
|
/**
|
|
618
|
-
* @internal
|
|
619
|
-
*/
|
|
629
|
+
* @internal
|
|
630
|
+
*/
|
|
620
631
|
declare function defineFacet<Input, Output>(options: {
|
|
621
632
|
/**
|
|
622
|
-
|
|
623
|
-
|
|
633
|
+
* The parent facet in the tree.
|
|
634
|
+
*/
|
|
624
635
|
parent: Facet<Output, any>;
|
|
625
636
|
/**
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
637
|
+
* Set this to true if you only want to keep one facet payload. For example,
|
|
638
|
+
* this facet corresponds to a ProseMirror plugin with a key.
|
|
639
|
+
*/
|
|
629
640
|
singleton?: boolean;
|
|
630
641
|
/**
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
642
|
+
* A reducer is a function that accepts an array of input and produce a single
|
|
643
|
+
* output.
|
|
644
|
+
*/
|
|
634
645
|
reducer?: FacetReducer<Input, Output>;
|
|
635
646
|
/**
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
647
|
+
* A callback function that returns a reducer. This is useful if you want to
|
|
648
|
+
* store something in the closure.
|
|
649
|
+
*/
|
|
639
650
|
reduce?: () => FacetReducer<Input, Output>;
|
|
640
651
|
}): Facet<Input, Output>;
|
|
641
652
|
//#endregion
|
|
653
|
+
//#region src/types/object-entries.d.ts
|
|
654
|
+
/**
|
|
655
|
+
* @internal
|
|
656
|
+
*
|
|
657
|
+
* @example
|
|
658
|
+
*
|
|
659
|
+
* ```
|
|
660
|
+
* type MyObject = { a: 1; b: 'B' }
|
|
661
|
+
* type MyEntries = ObjectEntries<MyObject>
|
|
662
|
+
* // ^ ["a", 1] | ["b", "B"]
|
|
663
|
+
*/
|
|
664
|
+
type ObjectEntries<T extends Record<string, any>> = { [K in keyof T]: [K, T[K]] }[keyof T];
|
|
665
|
+
//#endregion
|
|
642
666
|
//#region src/facets/state.d.ts
|
|
643
667
|
type StatePayload = (ctx: {
|
|
644
668
|
schema: Schema;
|
|
@@ -646,148 +670,111 @@ type StatePayload = (ctx: {
|
|
|
646
670
|
//#endregion
|
|
647
671
|
//#region src/extensions/plugin.d.ts
|
|
648
672
|
/**
|
|
649
|
-
* Adds a ProseMirror plugin to the editor.
|
|
650
|
-
*
|
|
651
|
-
* @param plugin - The ProseMirror plugin to add, or an array of plugins, or a
|
|
652
|
-
* function that returns one or multiple plugins.
|
|
653
|
-
*
|
|
654
|
-
* @public
|
|
655
|
-
*/
|
|
673
|
+
* Adds a ProseMirror plugin to the editor.
|
|
674
|
+
*
|
|
675
|
+
* @param plugin - The ProseMirror plugin to add, or an array of plugins, or a
|
|
676
|
+
* function that returns one or multiple plugins.
|
|
677
|
+
*
|
|
678
|
+
* @public
|
|
679
|
+
*/
|
|
656
680
|
declare function definePlugin(plugin: Plugin | Plugin[] | ((context: {
|
|
657
681
|
schema: Schema;
|
|
658
682
|
}) => Plugin | Plugin[])): PlainExtension;
|
|
659
683
|
/**
|
|
660
|
-
* @internal
|
|
661
|
-
*/
|
|
684
|
+
* @internal
|
|
685
|
+
*/
|
|
662
686
|
type PluginPayload = Plugin | Plugin[] | ((context: {
|
|
663
687
|
schema: Schema;
|
|
664
688
|
}) => Plugin | Plugin[]);
|
|
665
689
|
/**
|
|
666
|
-
* @internal
|
|
667
|
-
*/
|
|
690
|
+
* @internal
|
|
691
|
+
*/
|
|
668
692
|
declare const pluginFacet: Facet<PluginPayload, StatePayload>;
|
|
669
693
|
//#endregion
|
|
670
|
-
//#region src/extensions/events/dom-event.d.ts
|
|
671
|
-
/**
|
|
672
|
-
* A function to handle the events fired on the editable DOM element. Returns
|
|
673
|
-
* `true` to indicate that it handled the given event. you are responsible for
|
|
674
|
-
* calling `preventDefault` yourself (or not, if you want to allow the default
|
|
675
|
-
* behavior).
|
|
676
|
-
*
|
|
677
|
-
* @public
|
|
678
|
-
*/
|
|
679
|
-
type DOMEventHandler<Event extends keyof DOMEventMap = string> = (view: EditorView, event: DOMEventMap[Event]) => boolean | void;
|
|
680
|
-
/**
|
|
681
|
-
* @internal
|
|
682
|
-
*/
|
|
683
|
-
|
|
684
|
-
/**
|
|
685
|
-
* Register a new event handler for the given event type.
|
|
686
|
-
*
|
|
687
|
-
* @public
|
|
688
|
-
*/
|
|
689
|
-
declare function defineDOMEventHandler<Event extends keyof DOMEventMap = string>(event: Event, handler: DOMEventHandler<Event>): PlainExtension;
|
|
690
|
-
/**
|
|
691
|
-
* @internal
|
|
692
|
-
*/
|
|
693
|
-
//#endregion
|
|
694
|
-
//#region src/types/object-entries.d.ts
|
|
695
|
-
/**
|
|
696
|
-
* @internal
|
|
697
|
-
*
|
|
698
|
-
* @example
|
|
699
|
-
*
|
|
700
|
-
* ```
|
|
701
|
-
* type MyObject = { a: 1; b: 'B' }
|
|
702
|
-
* type MyEntries = ObjectEntries<MyObject>
|
|
703
|
-
* // ^ ["a", 1] | ["b", "B"]
|
|
704
|
-
*/
|
|
705
|
-
type ObjectEntries<T extends Record<string, any>> = { [K in keyof T]: [K, T[K]] }[keyof T];
|
|
706
|
-
//#endregion
|
|
707
694
|
//#region src/extensions/events/editor-event.d.ts
|
|
708
695
|
type KeyDownHandler = (view: EditorView, event: KeyboardEvent) => boolean | void;
|
|
709
696
|
type KeyPressHandler = (view: EditorView, event: KeyboardEvent) => boolean | void;
|
|
710
697
|
type TextInputHandler = (view: EditorView, from: number, to: number, text: string) => boolean | void;
|
|
711
|
-
type ClickOnHandler = (view: EditorView, pos: number, node: Node
|
|
698
|
+
type ClickOnHandler = (view: EditorView, pos: number, node: Node, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
712
699
|
type ClickHandler = (view: EditorView, pos: number, event: MouseEvent) => boolean | void;
|
|
713
|
-
type DoubleClickOnHandler = (view: EditorView, pos: number, node: Node
|
|
700
|
+
type DoubleClickOnHandler = (view: EditorView, pos: number, node: Node, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
714
701
|
type DoubleClickHandler = (view: EditorView, pos: number, event: MouseEvent) => boolean | void;
|
|
715
|
-
type TripleClickOnHandler = (view: EditorView, pos: number, node: Node
|
|
702
|
+
type TripleClickOnHandler = (view: EditorView, pos: number, node: Node, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
716
703
|
type TripleClickHandler = (view: EditorView, pos: number, event: MouseEvent) => boolean | void;
|
|
717
704
|
type PasteHandler = (view: EditorView, event: ClipboardEvent, slice: Slice) => boolean | void;
|
|
718
705
|
type DropHandler = (view: EditorView, event: DragEvent, slice: Slice, moved: boolean) => boolean | void;
|
|
719
706
|
type ScrollToSelectionHandler = (view: EditorView) => boolean;
|
|
720
707
|
/**
|
|
721
|
-
* @public
|
|
722
|
-
*
|
|
723
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleKeyDown}
|
|
724
|
-
*/
|
|
708
|
+
* @public
|
|
709
|
+
*
|
|
710
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleKeyDown}
|
|
711
|
+
*/
|
|
725
712
|
declare function defineKeyDownHandler(handler: KeyDownHandler): PlainExtension;
|
|
726
713
|
/**
|
|
727
|
-
* @public
|
|
728
|
-
*
|
|
729
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleKeyPress}
|
|
730
|
-
*/
|
|
714
|
+
* @public
|
|
715
|
+
*
|
|
716
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleKeyPress}
|
|
717
|
+
*/
|
|
731
718
|
declare function defineKeyPressHandler(handler: KeyPressHandler): PlainExtension;
|
|
732
719
|
/**
|
|
733
|
-
* @public
|
|
734
|
-
*
|
|
735
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleTextInput}
|
|
736
|
-
*/
|
|
720
|
+
* @public
|
|
721
|
+
*
|
|
722
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleTextInput}
|
|
723
|
+
*/
|
|
737
724
|
declare function defineTextInputHandler(handler: TextInputHandler): PlainExtension;
|
|
738
725
|
/**
|
|
739
|
-
* @public
|
|
740
|
-
*
|
|
741
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleClickOn}
|
|
742
|
-
*/
|
|
726
|
+
* @public
|
|
727
|
+
*
|
|
728
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleClickOn}
|
|
729
|
+
*/
|
|
743
730
|
declare function defineClickOnHandler(handler: ClickOnHandler): PlainExtension;
|
|
744
731
|
/**
|
|
745
|
-
* @public
|
|
746
|
-
*
|
|
747
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleClick}
|
|
748
|
-
*/
|
|
732
|
+
* @public
|
|
733
|
+
*
|
|
734
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleClick}
|
|
735
|
+
*/
|
|
749
736
|
declare function defineClickHandler(handler: ClickHandler): PlainExtension;
|
|
750
737
|
/**
|
|
751
|
-
* @public
|
|
752
|
-
*
|
|
753
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleDoubleClickOn}
|
|
754
|
-
*/
|
|
738
|
+
* @public
|
|
739
|
+
*
|
|
740
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleDoubleClickOn}
|
|
741
|
+
*/
|
|
755
742
|
declare function defineDoubleClickOnHandler(handler: DoubleClickOnHandler): PlainExtension;
|
|
756
743
|
/**
|
|
757
|
-
* @public
|
|
758
|
-
*
|
|
759
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleDoubleClick}
|
|
760
|
-
*/
|
|
744
|
+
* @public
|
|
745
|
+
*
|
|
746
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleDoubleClick}
|
|
747
|
+
*/
|
|
761
748
|
declare function defineDoubleClickHandler(handler: DoubleClickHandler): PlainExtension;
|
|
762
749
|
/**
|
|
763
|
-
* @public
|
|
764
|
-
*
|
|
765
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleTripleClickOn}
|
|
766
|
-
*/
|
|
750
|
+
* @public
|
|
751
|
+
*
|
|
752
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleTripleClickOn}
|
|
753
|
+
*/
|
|
767
754
|
declare function defineTripleClickOnHandler(handler: TripleClickOnHandler): PlainExtension;
|
|
768
755
|
/**
|
|
769
|
-
* @public
|
|
770
|
-
*
|
|
771
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleTripleClick}
|
|
772
|
-
*/
|
|
756
|
+
* @public
|
|
757
|
+
*
|
|
758
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleTripleClick}
|
|
759
|
+
*/
|
|
773
760
|
declare function defineTripleClickHandler(handler: TripleClickHandler): PlainExtension;
|
|
774
761
|
/**
|
|
775
|
-
* @public
|
|
776
|
-
*
|
|
777
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste}
|
|
778
|
-
*/
|
|
762
|
+
* @public
|
|
763
|
+
*
|
|
764
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste}
|
|
765
|
+
*/
|
|
779
766
|
declare function definePasteHandler(handler: PasteHandler): PlainExtension;
|
|
780
767
|
/**
|
|
781
|
-
* @public
|
|
782
|
-
*
|
|
783
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleDrop}
|
|
784
|
-
*/
|
|
768
|
+
* @public
|
|
769
|
+
*
|
|
770
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleDrop}
|
|
771
|
+
*/
|
|
785
772
|
declare function defineDropHandler(handler: DropHandler): PlainExtension;
|
|
786
773
|
/**
|
|
787
|
-
* @public
|
|
788
|
-
*
|
|
789
|
-
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleScrollToSelection}
|
|
790
|
-
*/
|
|
774
|
+
* @public
|
|
775
|
+
*
|
|
776
|
+
* See {@link https://prosemirror.net/docs/ref/#view.EditorProps.handleScrollToSelection}
|
|
777
|
+
*/
|
|
791
778
|
declare function defineScrollToSelectionHandler(handler: ScrollToSelectionHandler): PlainExtension;
|
|
792
779
|
interface EditorEventMap {
|
|
793
780
|
keyDown: KeyDownHandler;
|
|
@@ -804,98 +791,98 @@ interface EditorEventMap {
|
|
|
804
791
|
scrollToSelection: ScrollToSelectionHandler;
|
|
805
792
|
}
|
|
806
793
|
/**
|
|
807
|
-
* @internal
|
|
808
|
-
*/
|
|
794
|
+
* @internal
|
|
795
|
+
*/
|
|
809
796
|
type EditorEventPayload = ObjectEntries<EditorEventMap>;
|
|
810
797
|
/**
|
|
811
|
-
* @internal
|
|
812
|
-
*/
|
|
798
|
+
* @internal
|
|
799
|
+
*/
|
|
813
800
|
declare const editorEventFacet: Facet<EditorEventPayload, PluginPayload>;
|
|
814
801
|
//#endregion
|
|
815
802
|
//#region src/extensions/events/focus.d.ts
|
|
816
803
|
/**
|
|
817
|
-
* A function that is called when the editor gains or loses focus.
|
|
818
|
-
*
|
|
819
|
-
* @param hasFocus - Whether the editor has focus.
|
|
820
|
-
*
|
|
821
|
-
* @public
|
|
822
|
-
*/
|
|
804
|
+
* A function that is called when the editor gains or loses focus.
|
|
805
|
+
*
|
|
806
|
+
* @param hasFocus - Whether the editor has focus.
|
|
807
|
+
*
|
|
808
|
+
* @public
|
|
809
|
+
*/
|
|
823
810
|
type FocusChangeHandler = (hasFocus: boolean) => void;
|
|
824
811
|
/**
|
|
825
|
-
* Registers a event handler that is called when the editor gains or loses focus.
|
|
826
|
-
*
|
|
827
|
-
* @public
|
|
828
|
-
*/
|
|
812
|
+
* Registers a event handler that is called when the editor gains or loses focus.
|
|
813
|
+
*
|
|
814
|
+
* @public
|
|
815
|
+
*/
|
|
829
816
|
declare function defineFocusChangeHandler(handler: FocusChangeHandler): PlainExtension;
|
|
830
817
|
//#endregion
|
|
831
818
|
//#region src/extensions/events/plugin-view.d.ts
|
|
832
819
|
/**
|
|
833
|
-
* A function that is called when the editor view is mounted.
|
|
834
|
-
*
|
|
835
|
-
* @param view - The editor view.
|
|
836
|
-
*
|
|
837
|
-
* @public
|
|
838
|
-
*/
|
|
820
|
+
* A function that is called when the editor view is mounted.
|
|
821
|
+
*
|
|
822
|
+
* @param view - The editor view.
|
|
823
|
+
*
|
|
824
|
+
* @public
|
|
825
|
+
*/
|
|
839
826
|
type MountHandler = (view: EditorView) => void;
|
|
840
827
|
/**
|
|
841
|
-
* A function that is called when the editor state is updated.
|
|
842
|
-
*
|
|
843
|
-
* @param view - The editor view.
|
|
844
|
-
* @param prevState - The previous editor state.
|
|
845
|
-
*
|
|
846
|
-
* @public
|
|
847
|
-
*/
|
|
828
|
+
* A function that is called when the editor state is updated.
|
|
829
|
+
*
|
|
830
|
+
* @param view - The editor view.
|
|
831
|
+
* @param prevState - The previous editor state.
|
|
832
|
+
*
|
|
833
|
+
* @public
|
|
834
|
+
*/
|
|
848
835
|
type UpdateHandler = (view: EditorView, prevState: EditorState) => void;
|
|
849
836
|
/**
|
|
850
|
-
* A function that is called when the editor view is unmounted.
|
|
851
|
-
*
|
|
852
|
-
* @public
|
|
853
|
-
*/
|
|
837
|
+
* A function that is called when the editor view is unmounted.
|
|
838
|
+
*
|
|
839
|
+
* @public
|
|
840
|
+
*/
|
|
854
841
|
type UnmountHandler = () => void;
|
|
855
842
|
/**
|
|
856
|
-
* Registers a event handler that is called when the editor view is mounted.
|
|
857
|
-
*
|
|
858
|
-
* @public
|
|
859
|
-
*/
|
|
843
|
+
* Registers a event handler that is called when the editor view is mounted.
|
|
844
|
+
*
|
|
845
|
+
* @public
|
|
846
|
+
*/
|
|
860
847
|
declare function defineMountHandler(handler: MountHandler): PlainExtension;
|
|
861
848
|
/**
|
|
862
|
-
* Registers a event handler that is called when the editor state is updated.
|
|
863
|
-
*
|
|
864
|
-
* @public
|
|
865
|
-
*/
|
|
849
|
+
* Registers a event handler that is called when the editor state is updated.
|
|
850
|
+
*
|
|
851
|
+
* @public
|
|
852
|
+
*/
|
|
866
853
|
declare function defineUpdateHandler(handler: UpdateHandler): PlainExtension;
|
|
867
854
|
/**
|
|
868
|
-
* Registers a event handler that is called when the editor view is unmounted.
|
|
869
|
-
*
|
|
870
|
-
* @public
|
|
871
|
-
*/
|
|
855
|
+
* Registers a event handler that is called when the editor view is unmounted.
|
|
856
|
+
*
|
|
857
|
+
* @public
|
|
858
|
+
*/
|
|
872
859
|
declare function defineUnmountHandler(handler: UnmountHandler): PlainExtension;
|
|
873
860
|
//#endregion
|
|
874
861
|
//#region src/extensions/history.d.ts
|
|
875
862
|
/**
|
|
876
|
-
* Options for {@link defineHistory}.
|
|
877
|
-
*
|
|
878
|
-
* @public
|
|
879
|
-
*/
|
|
863
|
+
* Options for {@link defineHistory}.
|
|
864
|
+
*
|
|
865
|
+
* @public
|
|
866
|
+
*/
|
|
880
867
|
interface HistoryOptions {
|
|
881
868
|
/**
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
869
|
+
* The amount of history events that are collected before the oldest events
|
|
870
|
+
* are discarded.
|
|
871
|
+
*
|
|
872
|
+
* @default 200
|
|
873
|
+
*/
|
|
887
874
|
depth?: number;
|
|
888
875
|
/**
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
876
|
+
* The delay in milliseconds between changes after which a new group should be
|
|
877
|
+
* started.
|
|
878
|
+
*
|
|
879
|
+
* @default 250
|
|
880
|
+
*/
|
|
894
881
|
newGroupDelay?: number;
|
|
895
882
|
}
|
|
896
883
|
/**
|
|
897
|
-
* @internal
|
|
898
|
-
*/
|
|
884
|
+
* @internal
|
|
885
|
+
*/
|
|
899
886
|
type HistoryExtension = Extension<{
|
|
900
887
|
Commands: {
|
|
901
888
|
undo: [];
|
|
@@ -903,12 +890,12 @@ type HistoryExtension = Extension<{
|
|
|
903
890
|
};
|
|
904
891
|
}>;
|
|
905
892
|
/**
|
|
906
|
-
* Add undo/redo history to the editor.
|
|
907
|
-
*
|
|
908
|
-
* @param options
|
|
909
|
-
*
|
|
910
|
-
* @public
|
|
911
|
-
*/
|
|
893
|
+
* Add undo/redo history to the editor.
|
|
894
|
+
*
|
|
895
|
+
* @param options
|
|
896
|
+
*
|
|
897
|
+
* @public
|
|
898
|
+
*/
|
|
912
899
|
declare function defineHistory({
|
|
913
900
|
depth,
|
|
914
901
|
newGroupDelay
|
|
@@ -916,94 +903,94 @@ declare function defineHistory({
|
|
|
916
903
|
//#endregion
|
|
917
904
|
//#region src/extensions/keymap.d.ts
|
|
918
905
|
/**
|
|
919
|
-
* @public
|
|
920
|
-
*/
|
|
906
|
+
* @public
|
|
907
|
+
*/
|
|
921
908
|
interface Keymap {
|
|
922
909
|
[key: string]: Command;
|
|
923
910
|
}
|
|
924
911
|
/**
|
|
925
|
-
* @public
|
|
926
|
-
*/
|
|
912
|
+
* @public
|
|
913
|
+
*/
|
|
927
914
|
declare function defineKeymap(keymap: Keymap): PlainExtension;
|
|
928
915
|
/**
|
|
929
|
-
* @internal
|
|
930
|
-
*/
|
|
916
|
+
* @internal
|
|
917
|
+
*/
|
|
931
918
|
type KeymapPayload = Keymap;
|
|
932
919
|
/**
|
|
933
|
-
* @internal
|
|
934
|
-
*/
|
|
920
|
+
* @internal
|
|
921
|
+
*/
|
|
935
922
|
declare const keymapFacet: Facet<KeymapPayload, PluginPayload>;
|
|
936
923
|
//#endregion
|
|
937
924
|
//#region src/extensions/keymap-base.d.ts
|
|
938
925
|
/**
|
|
939
|
-
* @internal
|
|
940
|
-
*/
|
|
926
|
+
* @internal
|
|
927
|
+
*/
|
|
941
928
|
type BaseKeymapExtension = PlainExtension;
|
|
942
929
|
/**
|
|
943
|
-
* Defines some basic key bindings.
|
|
944
|
-
*
|
|
945
|
-
* @public
|
|
946
|
-
*/
|
|
930
|
+
* Defines some basic key bindings.
|
|
931
|
+
*
|
|
932
|
+
* @public
|
|
933
|
+
*/
|
|
947
934
|
declare function defineBaseKeymap(options?: {
|
|
948
935
|
/**
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
936
|
+
* The priority of the keymap.
|
|
937
|
+
*
|
|
938
|
+
* @default Priority.low
|
|
939
|
+
*/
|
|
953
940
|
priority?: Priority;
|
|
954
941
|
}): BaseKeymapExtension;
|
|
955
942
|
//#endregion
|
|
956
943
|
//#region src/extensions/mark-spec.d.ts
|
|
957
944
|
/**
|
|
958
|
-
* @public
|
|
959
|
-
*/
|
|
960
|
-
interface MarkSpecOptions<MarkName extends string = string, Attrs extends AnyAttrs = AnyAttrs> extends MarkSpec {
|
|
945
|
+
* @public
|
|
946
|
+
*/
|
|
947
|
+
interface MarkSpecOptions<MarkName extends string = string, Attrs$1 extends AnyAttrs = AnyAttrs> extends MarkSpec {
|
|
961
948
|
/**
|
|
962
|
-
|
|
963
|
-
|
|
949
|
+
* The name of the mark type.
|
|
950
|
+
*/
|
|
964
951
|
name: MarkName;
|
|
965
952
|
/**
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
attrs?: { [K in keyof Attrs]: AttrSpec<Attrs[K]> };
|
|
953
|
+
* The attributes that marks of this type get.
|
|
954
|
+
*/
|
|
955
|
+
attrs?: { [K in keyof Attrs$1]: AttrSpec<Attrs$1[K]> };
|
|
969
956
|
}
|
|
970
957
|
/**
|
|
971
|
-
* @public
|
|
972
|
-
*/
|
|
958
|
+
* @public
|
|
959
|
+
*/
|
|
973
960
|
interface MarkAttrOptions<MarkName extends string = string, AttrName extends string = string, AttrType = any> extends AttrSpec<AttrType> {
|
|
974
961
|
/**
|
|
975
|
-
|
|
976
|
-
|
|
962
|
+
* The name of the mark type.
|
|
963
|
+
*/
|
|
977
964
|
type: MarkName;
|
|
978
965
|
/**
|
|
979
|
-
|
|
980
|
-
|
|
966
|
+
* The name of the attribute.
|
|
967
|
+
*/
|
|
981
968
|
attr: AttrName;
|
|
982
969
|
/**
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
970
|
+
* Returns the attribute key and value to be set on the HTML element.
|
|
971
|
+
*
|
|
972
|
+
* If the returned `key` is `"style"`, the value is a string of CSS properties and will
|
|
973
|
+
* be prepended to the existing `style` attribute on the DOM node.
|
|
974
|
+
*
|
|
975
|
+
* @param value - The value of the attribute of current ProseMirror node.
|
|
976
|
+
*/
|
|
990
977
|
toDOM?: (value: AttrType) => [key: string, value: string] | null | undefined;
|
|
991
978
|
/**
|
|
992
|
-
|
|
993
|
-
|
|
979
|
+
* Parses the attribute value from the DOM.
|
|
980
|
+
*/
|
|
994
981
|
parseDOM?: (node: HTMLElement) => AttrType;
|
|
995
982
|
}
|
|
996
983
|
/**
|
|
997
|
-
* @public
|
|
998
|
-
*/
|
|
999
|
-
declare function defineMarkSpec<Mark extends string, Attrs extends AnyAttrs = AnyAttrs>(options: MarkSpecOptions<Mark, Attrs>): Extension<{
|
|
1000
|
-
Marks: { [K in Mark]: Attrs };
|
|
984
|
+
* @public
|
|
985
|
+
*/
|
|
986
|
+
declare function defineMarkSpec<Mark$1 extends string, Attrs$1 extends AnyAttrs = AnyAttrs>(options: MarkSpecOptions<Mark$1, Attrs$1>): Extension<{
|
|
987
|
+
Marks: { [K in Mark$1]: Attrs$1 };
|
|
1001
988
|
}>;
|
|
1002
989
|
/**
|
|
1003
|
-
* @public
|
|
1004
|
-
*/
|
|
1005
|
-
declare function defineMarkAttr<MarkType extends string = string, AttrName extends string = string, AttrType = any>(options: MarkAttrOptions<MarkType, AttrName, AttrType>): Extension<{
|
|
1006
|
-
Marks: { [K in MarkType]: AttrType };
|
|
990
|
+
* @public
|
|
991
|
+
*/
|
|
992
|
+
declare function defineMarkAttr<MarkType$1 extends string = string, AttrName extends string = string, AttrType = any>(options: MarkAttrOptions<MarkType$1, AttrName, AttrType>): Extension<{
|
|
993
|
+
Marks: { [K in MarkType$1]: AttrType };
|
|
1007
994
|
}>;
|
|
1008
995
|
//#endregion
|
|
1009
996
|
//#region src/extensions/mark-view.d.ts
|
|
@@ -1015,97 +1002,97 @@ declare function defineMarkView(options: MarkViewOptions): Extension;
|
|
|
1015
1002
|
//#endregion
|
|
1016
1003
|
//#region src/extensions/mark-view-effect.d.ts
|
|
1017
1004
|
/**
|
|
1018
|
-
* @internal
|
|
1019
|
-
*/
|
|
1005
|
+
* @internal
|
|
1006
|
+
*/
|
|
1020
1007
|
type MarkViewFactoryOptions<T> = {
|
|
1021
1008
|
group: string;
|
|
1022
1009
|
factory: (args: T) => MarkViewConstructor;
|
|
1023
1010
|
};
|
|
1024
1011
|
/**
|
|
1025
|
-
* @internal
|
|
1026
|
-
*/
|
|
1012
|
+
* @internal
|
|
1013
|
+
*/
|
|
1027
1014
|
type MarkViewComponentOptions<T> = {
|
|
1028
1015
|
group: string;
|
|
1029
1016
|
name: string;
|
|
1030
1017
|
args: T;
|
|
1031
1018
|
};
|
|
1032
1019
|
/**
|
|
1033
|
-
* @internal
|
|
1034
|
-
*/
|
|
1020
|
+
* @internal
|
|
1021
|
+
*/
|
|
1035
1022
|
declare function defineMarkViewFactory<T>(options: MarkViewFactoryOptions<T>): Extension;
|
|
1036
1023
|
/**
|
|
1037
|
-
* @internal
|
|
1038
|
-
*/
|
|
1024
|
+
* @internal
|
|
1025
|
+
*/
|
|
1039
1026
|
declare function defineMarkViewComponent<T>(options: MarkViewComponentOptions<T>): Extension;
|
|
1040
1027
|
//#endregion
|
|
1041
1028
|
//#region src/extensions/node-spec.d.ts
|
|
1042
1029
|
/**
|
|
1043
|
-
* @public
|
|
1044
|
-
*/
|
|
1045
|
-
interface NodeSpecOptions<NodeName extends string = string, Attrs extends AnyAttrs = AnyAttrs> extends NodeSpec {
|
|
1030
|
+
* @public
|
|
1031
|
+
*/
|
|
1032
|
+
interface NodeSpecOptions<NodeName extends string = string, Attrs$1 extends AnyAttrs = AnyAttrs> extends NodeSpec {
|
|
1046
1033
|
/**
|
|
1047
|
-
|
|
1048
|
-
|
|
1034
|
+
* The name of the node type.
|
|
1035
|
+
*/
|
|
1049
1036
|
name: NodeName;
|
|
1050
1037
|
/**
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1038
|
+
* Whether this is the top-level node type. Only one node type can be the
|
|
1039
|
+
* top-level node type in a schema.
|
|
1040
|
+
*/
|
|
1054
1041
|
topNode?: boolean;
|
|
1055
1042
|
/**
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
attrs?: { [key in keyof Attrs]: AttrSpec<Attrs[key]> };
|
|
1043
|
+
* The attributes that nodes of this type get.
|
|
1044
|
+
*/
|
|
1045
|
+
attrs?: { [key in keyof Attrs$1]: AttrSpec<Attrs$1[key]> };
|
|
1059
1046
|
}
|
|
1060
1047
|
/**
|
|
1061
|
-
* @public
|
|
1062
|
-
*/
|
|
1048
|
+
* @public
|
|
1049
|
+
*/
|
|
1063
1050
|
interface NodeAttrOptions<NodeName extends string = string, AttrName extends string = string, AttrType = any> extends AttrSpec<AttrType> {
|
|
1064
1051
|
/**
|
|
1065
|
-
|
|
1066
|
-
|
|
1052
|
+
* The name of the node type.
|
|
1053
|
+
*/
|
|
1067
1054
|
type: NodeName;
|
|
1068
1055
|
/**
|
|
1069
|
-
|
|
1070
|
-
|
|
1056
|
+
* The name of the attribute.
|
|
1057
|
+
*/
|
|
1071
1058
|
attr: AttrName;
|
|
1072
1059
|
/**
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1060
|
+
* Whether the attribute should be kept when the node is split. Set it to
|
|
1061
|
+
* `true` if you want to inherit the attribute from the previous node when
|
|
1062
|
+
* splitting the node by pressing `Enter`.
|
|
1063
|
+
*
|
|
1064
|
+
* @default undefined
|
|
1065
|
+
*/
|
|
1079
1066
|
splittable?: boolean;
|
|
1080
1067
|
/**
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1068
|
+
* Returns the attribute key and value to be set on the HTML element.
|
|
1069
|
+
*
|
|
1070
|
+
* If the returned `key` is `"style"`, the value is a string of CSS properties and will
|
|
1071
|
+
* be prepended to the existing `style` attribute on the DOM node.
|
|
1072
|
+
*
|
|
1073
|
+
* @param value - The value of the attribute of current ProseMirror node.
|
|
1074
|
+
*/
|
|
1088
1075
|
toDOM?: (value: AttrType) => [key: string, value: string] | null | undefined;
|
|
1089
1076
|
/**
|
|
1090
|
-
|
|
1091
|
-
|
|
1077
|
+
* Parses the attribute value from the DOM.
|
|
1078
|
+
*/
|
|
1092
1079
|
parseDOM?: (node: HTMLElement) => AttrType;
|
|
1093
1080
|
}
|
|
1094
1081
|
/**
|
|
1095
|
-
* Defines a node type.
|
|
1096
|
-
*
|
|
1097
|
-
* @public
|
|
1098
|
-
*/
|
|
1099
|
-
declare function defineNodeSpec<Node extends string, Attrs extends AnyAttrs = AnyAttrs>(options: NodeSpecOptions<Node, Attrs>): Extension<{
|
|
1100
|
-
Nodes: { [K in Node]: Attrs };
|
|
1082
|
+
* Defines a node type.
|
|
1083
|
+
*
|
|
1084
|
+
* @public
|
|
1085
|
+
*/
|
|
1086
|
+
declare function defineNodeSpec<Node$1 extends string, Attrs$1 extends AnyAttrs = AnyAttrs>(options: NodeSpecOptions<Node$1, Attrs$1>): Extension<{
|
|
1087
|
+
Nodes: { [K in Node$1]: Attrs$1 };
|
|
1101
1088
|
}>;
|
|
1102
1089
|
/**
|
|
1103
|
-
* Defines an attribute for a node type.
|
|
1104
|
-
*
|
|
1105
|
-
* @public
|
|
1106
|
-
*/
|
|
1107
|
-
declare function defineNodeAttr<NodeType extends string = string, AttrName extends string = string, AttrType = any>(options: NodeAttrOptions<NodeType, AttrName, AttrType>): Extension<{
|
|
1108
|
-
Nodes: { [K in NodeType]: { [K in AttrName]: AttrType } };
|
|
1090
|
+
* Defines an attribute for a node type.
|
|
1091
|
+
*
|
|
1092
|
+
* @public
|
|
1093
|
+
*/
|
|
1094
|
+
declare function defineNodeAttr<NodeType$1 extends string = string, AttrName extends string = string, AttrType = any>(options: NodeAttrOptions<NodeType$1, AttrName, AttrType>): Extension<{
|
|
1095
|
+
Nodes: { [K in NodeType$1]: { [K in AttrName]: AttrType } };
|
|
1109
1096
|
}>;
|
|
1110
1097
|
//#endregion
|
|
1111
1098
|
//#region src/extensions/node-view.d.ts
|
|
@@ -1117,271 +1104,291 @@ declare function defineNodeView(options: NodeViewOptions): Extension;
|
|
|
1117
1104
|
//#endregion
|
|
1118
1105
|
//#region src/extensions/node-view-effect.d.ts
|
|
1119
1106
|
/**
|
|
1120
|
-
* @internal
|
|
1121
|
-
*/
|
|
1107
|
+
* @internal
|
|
1108
|
+
*/
|
|
1122
1109
|
type NodeViewFactoryOptions<T> = {
|
|
1123
1110
|
group: string;
|
|
1124
1111
|
factory: (args: T) => NodeViewConstructor;
|
|
1125
1112
|
};
|
|
1126
1113
|
/**
|
|
1127
|
-
* @internal
|
|
1128
|
-
*/
|
|
1114
|
+
* @internal
|
|
1115
|
+
*/
|
|
1129
1116
|
type NodeViewComponentOptions<T> = {
|
|
1130
1117
|
group: string;
|
|
1131
1118
|
name: string;
|
|
1132
1119
|
args: T;
|
|
1133
1120
|
};
|
|
1134
1121
|
/**
|
|
1135
|
-
* @internal
|
|
1136
|
-
*/
|
|
1122
|
+
* @internal
|
|
1123
|
+
*/
|
|
1137
1124
|
declare function defineNodeViewFactory<T>(options: NodeViewFactoryOptions<T>): Extension;
|
|
1138
1125
|
/**
|
|
1139
|
-
* @internal
|
|
1140
|
-
*/
|
|
1126
|
+
* @internal
|
|
1127
|
+
*/
|
|
1141
1128
|
declare function defineNodeViewComponent<T>(options: NodeViewComponentOptions<T>): Extension;
|
|
1142
1129
|
//#endregion
|
|
1143
1130
|
//#region src/extensions/paragraph.d.ts
|
|
1144
1131
|
/**
|
|
1145
|
-
* @internal
|
|
1146
|
-
*/
|
|
1132
|
+
* @internal
|
|
1133
|
+
*/
|
|
1147
1134
|
type ParagraphSpecExtension = Extension<{
|
|
1148
1135
|
Nodes: {
|
|
1149
|
-
paragraph: Attrs
|
|
1136
|
+
paragraph: Attrs;
|
|
1150
1137
|
};
|
|
1151
1138
|
}>;
|
|
1152
1139
|
/**
|
|
1153
|
-
* @internal
|
|
1154
|
-
*
|
|
1155
|
-
* @deprecated Use the following import instead:
|
|
1156
|
-
*
|
|
1157
|
-
* ```ts
|
|
1158
|
-
* import type { ParagraphExtension } from 'prosekit/extensions/paragraph'
|
|
1159
|
-
* ```
|
|
1160
|
-
*/
|
|
1140
|
+
* @internal
|
|
1141
|
+
*
|
|
1142
|
+
* @deprecated Use the following import instead:
|
|
1143
|
+
*
|
|
1144
|
+
* ```ts
|
|
1145
|
+
* import type { ParagraphExtension } from 'prosekit/extensions/paragraph'
|
|
1146
|
+
* ```
|
|
1147
|
+
*/
|
|
1161
1148
|
type ParagraphExtension = ParagraphSpecExtension;
|
|
1162
1149
|
/**
|
|
1163
|
-
* @public
|
|
1164
|
-
*
|
|
1165
|
-
* Defines a paragraph node spec as the highest priority, because it should be the default block node for most cases.
|
|
1166
|
-
*
|
|
1167
|
-
* @deprecated Use the following import instead:
|
|
1168
|
-
*
|
|
1169
|
-
* ```ts
|
|
1170
|
-
* import { defineParagraph } from 'prosekit/extensions/paragraph'
|
|
1171
|
-
* ```
|
|
1172
|
-
*/
|
|
1150
|
+
* @public
|
|
1151
|
+
*
|
|
1152
|
+
* Defines a paragraph node spec as the highest priority, because it should be the default block node for most cases.
|
|
1153
|
+
*
|
|
1154
|
+
* @deprecated Use the following import instead:
|
|
1155
|
+
*
|
|
1156
|
+
* ```ts
|
|
1157
|
+
* import { defineParagraph } from 'prosekit/extensions/paragraph'
|
|
1158
|
+
* ```
|
|
1159
|
+
*/
|
|
1173
1160
|
declare function defineParagraph(): ParagraphExtension;
|
|
1174
1161
|
//#endregion
|
|
1175
1162
|
//#region src/extensions/text.d.ts
|
|
1176
1163
|
/**
|
|
1177
|
-
* @internal
|
|
1178
|
-
*/
|
|
1164
|
+
* @internal
|
|
1165
|
+
*/
|
|
1179
1166
|
type TextExtension = Extension<{
|
|
1180
1167
|
Nodes: {
|
|
1181
|
-
text: Attrs
|
|
1168
|
+
text: Attrs;
|
|
1182
1169
|
};
|
|
1183
1170
|
}>;
|
|
1184
1171
|
/**
|
|
1185
|
-
* @public
|
|
1186
|
-
*
|
|
1187
|
-
* @deprecated Use the following import instead:
|
|
1188
|
-
*
|
|
1189
|
-
* ```ts
|
|
1190
|
-
* import { defineText } from 'prosekit/extensions/text'
|
|
1191
|
-
* ```
|
|
1192
|
-
*/
|
|
1172
|
+
* @public
|
|
1173
|
+
*
|
|
1174
|
+
* @deprecated Use the following import instead:
|
|
1175
|
+
*
|
|
1176
|
+
* ```ts
|
|
1177
|
+
* import { defineText } from 'prosekit/extensions/text'
|
|
1178
|
+
* ```
|
|
1179
|
+
*/
|
|
1193
1180
|
declare function defineText(): TextExtension;
|
|
1194
1181
|
//#endregion
|
|
1195
1182
|
//#region src/facets/facet-extension.d.ts
|
|
1196
1183
|
/**
|
|
1197
|
-
* @internal
|
|
1198
|
-
*/
|
|
1184
|
+
* @internal
|
|
1185
|
+
*/
|
|
1199
1186
|
declare function defineFacetPayload<Input>(facet: Facet<Input, any>, payloads: Input[]): Extension;
|
|
1200
1187
|
//#endregion
|
|
1201
1188
|
//#region src/types/base-node-view-options.d.ts
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
*
|
|
1205
|
-
*
|
|
1206
|
-
*
|
|
1207
|
-
*
|
|
1208
|
-
|
|
1209
|
-
*/
|
|
1189
|
+
/**
|
|
1190
|
+
* Some basic props for custom node views.
|
|
1191
|
+
*
|
|
1192
|
+
* @deprecated - This is no longer needed. Use `CoreNodeViewUserOptions` from `@prosemirror-adapter/core` instead.
|
|
1193
|
+
*
|
|
1194
|
+
* @hidden
|
|
1195
|
+
*/
|
|
1210
1196
|
interface BaseNodeViewOptions {
|
|
1211
1197
|
/**
|
|
1212
|
-
|
|
1213
|
-
|
|
1198
|
+
* The wrapping DOM element for the node view. Defaults to `div` for block nodes and `span` for inline nodes.
|
|
1199
|
+
*/
|
|
1214
1200
|
as?: string | HTMLElement | ((node: ProseMirrorNode) => HTMLElement);
|
|
1215
1201
|
/**
|
|
1216
|
-
|
|
1217
|
-
|
|
1202
|
+
* The wrapping DOM element for the node view's content. Defaults to `div` for block nodes and `span` for inline nodes.
|
|
1203
|
+
*/
|
|
1218
1204
|
contentAs?: string | HTMLElement | ((node: ProseMirrorNode) => HTMLElement);
|
|
1219
|
-
update?: NodeView[
|
|
1220
|
-
ignoreMutation?: NodeView[
|
|
1221
|
-
selectNode?: NodeView[
|
|
1222
|
-
deselectNode?: NodeView[
|
|
1223
|
-
setSelection?: NodeView[
|
|
1224
|
-
stopEvent?: NodeView[
|
|
1225
|
-
destroy?: NodeView[
|
|
1205
|
+
update?: NodeView['update'];
|
|
1206
|
+
ignoreMutation?: NodeView['ignoreMutation'];
|
|
1207
|
+
selectNode?: NodeView['selectNode'];
|
|
1208
|
+
deselectNode?: NodeView['deselectNode'];
|
|
1209
|
+
setSelection?: NodeView['setSelection'];
|
|
1210
|
+
stopEvent?: NodeView['stopEvent'];
|
|
1211
|
+
destroy?: NodeView['destroy'];
|
|
1226
1212
|
onUpdate?: () => void;
|
|
1227
1213
|
}
|
|
1228
1214
|
//#endregion
|
|
1229
1215
|
//#region src/utils/assert.d.ts
|
|
1230
1216
|
/**
|
|
1231
|
-
* @internal
|
|
1232
|
-
*/
|
|
1217
|
+
* @internal
|
|
1218
|
+
*/
|
|
1233
1219
|
declare function assert(condition: unknown, message?: string): asserts condition;
|
|
1234
1220
|
//#endregion
|
|
1235
1221
|
//#region src/utils/can-use-regex-lookbehind.d.ts
|
|
1222
|
+
/**
|
|
1223
|
+
* Checks if the browser supports [regex lookbehind assertion](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Lookbehind_assertion).
|
|
1224
|
+
*/
|
|
1236
1225
|
declare const canUseRegexLookbehind: () => boolean;
|
|
1237
1226
|
//#endregion
|
|
1238
1227
|
//#region src/utils/clsx.d.ts
|
|
1239
1228
|
/**
|
|
1240
|
-
* A utility for constructing `className` strings conditionally.
|
|
1241
|
-
*
|
|
1242
|
-
* It is a re-export of [clsx/lite](https://www.npmjs.com/package/clsx) with stricter types.
|
|
1243
|
-
*
|
|
1244
|
-
* @public
|
|
1245
|
-
*/
|
|
1229
|
+
* A utility for constructing `className` strings conditionally.
|
|
1230
|
+
*
|
|
1231
|
+
* It is a re-export of [clsx/lite](https://www.npmjs.com/package/clsx) with stricter types.
|
|
1232
|
+
*
|
|
1233
|
+
* @public
|
|
1234
|
+
*/
|
|
1246
1235
|
declare const clsx: (...args: Array<string | boolean | null | undefined>) => string;
|
|
1247
1236
|
//#endregion
|
|
1248
1237
|
//#region src/utils/collect-children.d.ts
|
|
1249
1238
|
/**
|
|
1250
|
-
* Collects all children of a node or a fragment, and returns them as an array.
|
|
1251
|
-
*
|
|
1252
|
-
* @deprecated Use `node.children` or `fragment.content` instead.
|
|
1253
|
-
*
|
|
1254
|
-
* @hidden
|
|
1255
|
-
*/
|
|
1239
|
+
* Collects all children of a node or a fragment, and returns them as an array.
|
|
1240
|
+
*
|
|
1241
|
+
* @deprecated Use `node.children` or `fragment.content` instead.
|
|
1242
|
+
*
|
|
1243
|
+
* @hidden
|
|
1244
|
+
*/
|
|
1256
1245
|
declare function collectChildren(parent: ProseMirrorNode | Fragment): ProseMirrorNode[];
|
|
1257
1246
|
//#endregion
|
|
1258
1247
|
//#region src/utils/collect-nodes.d.ts
|
|
1259
1248
|
/**
|
|
1260
|
-
* @hidden
|
|
1261
|
-
*
|
|
1262
|
-
* @deprecated
|
|
1263
|
-
*/
|
|
1249
|
+
* @hidden
|
|
1250
|
+
*
|
|
1251
|
+
* @deprecated
|
|
1252
|
+
*/
|
|
1264
1253
|
type NodeContent = ProseMirrorNode | ProseMirrorFragment | NodeContent[];
|
|
1265
1254
|
/**
|
|
1266
|
-
* Collects all nodes from a given content.
|
|
1267
|
-
*
|
|
1268
|
-
* @deprecated Use `collectChildren` instead.
|
|
1269
|
-
*
|
|
1270
|
-
* @hidden
|
|
1271
|
-
*/
|
|
1255
|
+
* Collects all nodes from a given content.
|
|
1256
|
+
*
|
|
1257
|
+
* @deprecated Use `collectChildren` instead.
|
|
1258
|
+
*
|
|
1259
|
+
* @hidden
|
|
1260
|
+
*/
|
|
1272
1261
|
declare function collectNodes(content: NodeContent): ProseMirrorNode[];
|
|
1273
1262
|
//#endregion
|
|
1274
1263
|
//#region src/utils/contains-inline-node.d.ts
|
|
1275
1264
|
/**
|
|
1276
|
-
* @internal
|
|
1277
|
-
*/
|
|
1265
|
+
* @internal
|
|
1266
|
+
*/
|
|
1278
1267
|
declare function containsInlineNode(doc: ProseMirrorNode, from: number, to: number): boolean;
|
|
1279
1268
|
//#endregion
|
|
1280
1269
|
//#region src/utils/default-block-at.d.ts
|
|
1281
1270
|
/**
|
|
1282
|
-
* @internal
|
|
1283
|
-
*/
|
|
1284
|
-
declare function defaultBlockAt(match: ContentMatch): NodeType
|
|
1271
|
+
* @internal
|
|
1272
|
+
*/
|
|
1273
|
+
declare function defaultBlockAt(match: ContentMatch): NodeType | null;
|
|
1285
1274
|
//#endregion
|
|
1286
1275
|
//#region src/utils/env.d.ts
|
|
1287
1276
|
/**
|
|
1288
|
-
* @
|
|
1289
|
-
*/
|
|
1277
|
+
* @internal
|
|
1278
|
+
*/
|
|
1290
1279
|
declare const isApple: boolean;
|
|
1291
1280
|
//#endregion
|
|
1292
1281
|
//#region src/utils/find-parent-node.d.ts
|
|
1293
1282
|
/**
|
|
1294
|
-
* @public
|
|
1295
|
-
*/
|
|
1283
|
+
* @public
|
|
1284
|
+
*/
|
|
1296
1285
|
interface FindParentNodeResult {
|
|
1297
1286
|
/**
|
|
1298
|
-
|
|
1299
|
-
|
|
1287
|
+
* The closest parent node that satisfies the predicate.
|
|
1288
|
+
*/
|
|
1300
1289
|
node: ProseMirrorNode;
|
|
1301
1290
|
/**
|
|
1302
|
-
|
|
1303
|
-
|
|
1291
|
+
* The position directly before the node.
|
|
1292
|
+
*/
|
|
1304
1293
|
pos: number;
|
|
1305
1294
|
/**
|
|
1306
|
-
|
|
1307
|
-
|
|
1295
|
+
* The position at the start of the node.
|
|
1296
|
+
*/
|
|
1308
1297
|
start: number;
|
|
1309
1298
|
/**
|
|
1310
|
-
|
|
1311
|
-
|
|
1299
|
+
* The depth of the node.
|
|
1300
|
+
*/
|
|
1312
1301
|
depth: number;
|
|
1313
1302
|
}
|
|
1314
1303
|
/**
|
|
1315
|
-
* Find the closest parent node that satisfies the predicate.
|
|
1316
|
-
*
|
|
1317
|
-
* @public
|
|
1318
|
-
*/
|
|
1319
|
-
declare function findParentNode(
|
|
1304
|
+
* Find the closest parent node that satisfies the predicate.
|
|
1305
|
+
*
|
|
1306
|
+
* @public
|
|
1307
|
+
*/
|
|
1308
|
+
declare function findParentNode(
|
|
1309
|
+
/**
|
|
1310
|
+
* The predicate to test the parent node.
|
|
1311
|
+
*/
|
|
1312
|
+
predicate: (node: ProseMirrorNode) => boolean,
|
|
1313
|
+
/**
|
|
1314
|
+
* The position to start searching from.
|
|
1315
|
+
*/
|
|
1316
|
+
$pos: ResolvedPos): FindParentNodeResult | undefined;
|
|
1320
1317
|
//#endregion
|
|
1321
1318
|
//#region src/utils/find-parent-node-of-type.d.ts
|
|
1322
1319
|
/**
|
|
1323
|
-
* Finds the closest parent node that matches the given node type.
|
|
1324
|
-
*
|
|
1325
|
-
* @public
|
|
1326
|
-
*/
|
|
1327
|
-
declare function findParentNodeOfType(
|
|
1320
|
+
* Finds the closest parent node that matches the given node type.
|
|
1321
|
+
*
|
|
1322
|
+
* @public
|
|
1323
|
+
*/
|
|
1324
|
+
declare function findParentNodeOfType(
|
|
1325
|
+
/**
|
|
1326
|
+
* The type of the node to find.
|
|
1327
|
+
*/
|
|
1328
|
+
type: NodeType | string,
|
|
1329
|
+
/**
|
|
1330
|
+
* The position to start searching from.
|
|
1331
|
+
*/
|
|
1332
|
+
$pos: ResolvedPos): FindParentNodeResult | undefined;
|
|
1328
1333
|
//#endregion
|
|
1329
1334
|
//#region src/utils/get-id.d.ts
|
|
1330
1335
|
/**
|
|
1331
|
-
* Returns a unique id in the current process that can be used in various places.
|
|
1332
|
-
*
|
|
1333
|
-
* @internal
|
|
1334
|
-
|
|
1336
|
+
* Returns a unique id in the current process that can be used in various places.
|
|
1337
|
+
*
|
|
1338
|
+
* @internal
|
|
1339
|
+
*
|
|
1340
|
+
* @deprecated Import `getId` from `@ocavue/utils` package instead. Remove it in a future version.
|
|
1341
|
+
*/
|
|
1335
1342
|
declare function getId(): string;
|
|
1336
1343
|
//#endregion
|
|
1337
1344
|
//#region src/utils/get-mark-type.d.ts
|
|
1338
1345
|
/**
|
|
1339
|
-
* @internal
|
|
1340
|
-
*/
|
|
1341
|
-
declare function getMarkType(schema: Schema, type: string | MarkType
|
|
1346
|
+
* @internal
|
|
1347
|
+
*/
|
|
1348
|
+
declare function getMarkType(schema: Schema, type: string | MarkType): MarkType;
|
|
1342
1349
|
//#endregion
|
|
1343
1350
|
//#region src/utils/get-node-type.d.ts
|
|
1344
1351
|
/**
|
|
1345
|
-
* @internal
|
|
1346
|
-
*/
|
|
1347
|
-
declare function getNodeType(schema: Schema, type: string | NodeType
|
|
1352
|
+
* @internal
|
|
1353
|
+
*/
|
|
1354
|
+
declare function getNodeType(schema: Schema, type: string | NodeType): NodeType;
|
|
1348
1355
|
//#endregion
|
|
1349
1356
|
//#region src/utils/is-at-block-start.d.ts
|
|
1350
1357
|
/**
|
|
1351
|
-
* Whether the selection is an empty text selection at the start of a block.
|
|
1352
|
-
*
|
|
1353
|
-
* @internal
|
|
1354
|
-
*/
|
|
1358
|
+
* Whether the selection is an empty text selection at the start of a block.
|
|
1359
|
+
*
|
|
1360
|
+
* @internal
|
|
1361
|
+
*/
|
|
1355
1362
|
declare function isAtBlockStart(state: EditorState, view?: EditorView): ResolvedPos | null;
|
|
1356
1363
|
//#endregion
|
|
1357
1364
|
//#region src/utils/is-in-code-block.d.ts
|
|
1358
1365
|
/**
|
|
1359
|
-
* Check if the selection is in a code block.
|
|
1360
|
-
*
|
|
1361
|
-
* @internal
|
|
1362
|
-
*/
|
|
1366
|
+
* Check if the selection is in a code block.
|
|
1367
|
+
*
|
|
1368
|
+
* @internal
|
|
1369
|
+
*/
|
|
1363
1370
|
declare function isInCodeBlock(selection: Selection): boolean;
|
|
1364
1371
|
//#endregion
|
|
1365
1372
|
//#region src/utils/is-mark-absent.d.ts
|
|
1366
1373
|
/**
|
|
1367
|
-
* Returns true if the given mark is missing in some part of the range.
|
|
1368
|
-
* Returns false if the entire range has the given mark.
|
|
1369
|
-
* Returns true if the mark is not allowed in the range.
|
|
1370
|
-
*
|
|
1371
|
-
* @internal
|
|
1372
|
-
*/
|
|
1373
|
-
declare function isMarkAbsent(node: ProseMirrorNode, from: number, to: number, markType: MarkType
|
|
1374
|
+
* Returns true if the given mark is missing in some part of the range.
|
|
1375
|
+
* Returns false if the entire range has the given mark.
|
|
1376
|
+
* Returns true if the mark is not allowed in the range.
|
|
1377
|
+
*
|
|
1378
|
+
* @internal
|
|
1379
|
+
*/
|
|
1380
|
+
declare function isMarkAbsent(node: ProseMirrorNode, from: number, to: number, markType: MarkType, attrs?: Attrs | null): boolean;
|
|
1374
1381
|
//#endregion
|
|
1375
1382
|
//#region src/utils/is-mark-active.d.ts
|
|
1376
1383
|
/**
|
|
1377
|
-
* @internal
|
|
1378
|
-
*/
|
|
1379
|
-
declare function isMarkActive(state: EditorState, type: string | MarkType
|
|
1384
|
+
* @internal
|
|
1385
|
+
*/
|
|
1386
|
+
declare function isMarkActive(state: EditorState, type: string | MarkType, attrs?: Attrs | null): boolean;
|
|
1380
1387
|
//#endregion
|
|
1381
1388
|
//#region src/utils/maybe-run.d.ts
|
|
1382
1389
|
/**
|
|
1383
|
-
* @internal
|
|
1384
|
-
*/
|
|
1390
|
+
* @internal
|
|
1391
|
+
*/
|
|
1385
1392
|
declare function maybeRun<Value, Args extends unknown[]>(value: Value | ((...args: Args) => Value), ...args: Args): Value;
|
|
1386
1393
|
//#endregion
|
|
1387
1394
|
//#region src/utils/set-selection-around.d.ts
|
|
@@ -1389,65 +1396,63 @@ declare function setSelectionAround(tr: Transaction, pos: number): void;
|
|
|
1389
1396
|
//#endregion
|
|
1390
1397
|
//#region src/utils/type-assertion.d.ts
|
|
1391
1398
|
/**
|
|
1392
|
-
* Checks if the given object is a {@link ProseMirrorNode} instance.
|
|
1393
|
-
*/
|
|
1399
|
+
* Checks if the given object is a {@link ProseMirrorNode} instance.
|
|
1400
|
+
*/
|
|
1394
1401
|
declare function isProseMirrorNode(value: unknown): value is ProseMirrorNode;
|
|
1395
1402
|
/**
|
|
1396
|
-
* Checks if the given object is a {@link Mark} instance.
|
|
1397
|
-
*
|
|
1398
|
-
* @public
|
|
1399
|
-
*/
|
|
1400
|
-
declare function isMark(value: unknown): value is Mark
|
|
1403
|
+
* Checks if the given object is a {@link Mark} instance.
|
|
1404
|
+
*
|
|
1405
|
+
* @public
|
|
1406
|
+
*/
|
|
1407
|
+
declare function isMark(value: unknown): value is Mark;
|
|
1401
1408
|
/**
|
|
1402
|
-
* Checks if the given object is a {@link Fragment} instance.
|
|
1403
|
-
*
|
|
1404
|
-
* @public
|
|
1405
|
-
*/
|
|
1409
|
+
* Checks if the given object is a {@link Fragment} instance.
|
|
1410
|
+
*
|
|
1411
|
+
* @public
|
|
1412
|
+
*/
|
|
1406
1413
|
declare function isFragment(value: unknown): value is Fragment;
|
|
1407
1414
|
/**
|
|
1408
|
-
* Checks if the given object is a {@link Slice} instance.
|
|
1409
|
-
*
|
|
1410
|
-
* @public
|
|
1411
|
-
*/
|
|
1415
|
+
* Checks if the given object is a {@link Slice} instance.
|
|
1416
|
+
*
|
|
1417
|
+
* @public
|
|
1418
|
+
*/
|
|
1412
1419
|
declare function isSlice(value: unknown): value is Slice;
|
|
1413
1420
|
/**
|
|
1414
|
-
* Checks if the given object is a {@link Selection} instance.
|
|
1415
|
-
*
|
|
1416
|
-
* @public
|
|
1417
|
-
*/
|
|
1421
|
+
* Checks if the given object is a {@link Selection} instance.
|
|
1422
|
+
*
|
|
1423
|
+
* @public
|
|
1424
|
+
*/
|
|
1418
1425
|
declare function isSelection(value: unknown): value is Selection;
|
|
1419
1426
|
/**
|
|
1420
|
-
* Checks if the given object is a {@link TextSelection} instance.
|
|
1421
|
-
*
|
|
1422
|
-
* @public
|
|
1423
|
-
*/
|
|
1427
|
+
* Checks if the given object is a {@link TextSelection} instance.
|
|
1428
|
+
*
|
|
1429
|
+
* @public
|
|
1430
|
+
*/
|
|
1424
1431
|
declare function isTextSelection(value: Selection): value is TextSelection;
|
|
1425
1432
|
/**
|
|
1426
|
-
* Checks if the given object is a {@link NodeSelection} instance.
|
|
1427
|
-
*
|
|
1428
|
-
* @public
|
|
1429
|
-
*/
|
|
1433
|
+
* Checks if the given object is a {@link NodeSelection} instance.
|
|
1434
|
+
*
|
|
1435
|
+
* @public
|
|
1436
|
+
*/
|
|
1430
1437
|
declare function isNodeSelection(value: Selection): value is NodeSelection;
|
|
1431
1438
|
/**
|
|
1432
|
-
* Checks if the given object is a {@link AllSelection} instance.
|
|
1433
|
-
*
|
|
1434
|
-
* @public
|
|
1435
|
-
*/
|
|
1439
|
+
* Checks if the given object is a {@link AllSelection} instance.
|
|
1440
|
+
*
|
|
1441
|
+
* @public
|
|
1442
|
+
*/
|
|
1436
1443
|
declare function isAllSelection(value: Selection): value is AllSelection;
|
|
1437
|
-
/**
|
|
1438
|
-
* @internal
|
|
1439
|
-
*/
|
|
1440
1444
|
//#endregion
|
|
1441
1445
|
//#region src/utils/unicode.d.ts
|
|
1442
1446
|
/**
|
|
1443
|
-
* @internal
|
|
1444
|
-
*/
|
|
1445
|
-
declare const OBJECT_REPLACEMENT_CHARACTER = "
|
|
1447
|
+
* @internal
|
|
1448
|
+
*/
|
|
1449
|
+
declare const OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
|
|
1446
1450
|
//#endregion
|
|
1447
1451
|
//#region src/utils/with-skip-code-block.d.ts
|
|
1448
1452
|
/**
|
|
1449
|
-
* @internal
|
|
1450
|
-
*/
|
|
1453
|
+
* @internal
|
|
1454
|
+
*/
|
|
1451
1455
|
declare function withSkipCodeBlock(command: Command): Command;
|
|
1452
1456
|
//#endregion
|
|
1453
|
-
export { AddMarkOptions, AnyAttrs, AnyFunction, AttrSpec, BaseCommandsExtension, BaseKeymapExtension, BaseNodeViewOptions, ClickHandler, ClickOnHandler, ClipboardSerializerOptions, CommandAction, CommandTyping, DOMDocumentOptions, DOMEventHandler, DOMParserOptions, DOMSerializerOptions, DefaultStateOptions, DocChangeHandler, DocExtension, DoubleClickHandler, DoubleClickOnHandler, DropHandler, Editor, EditorEventPayload, EditorNotFoundError, EditorOptions, ExpandMarkOptions, Extension, ExtensionTyping, ExtractCommandActions, ExtractCommandAppliers, ExtractCommandCreators, ExtractMarkActions, ExtractMarks, ExtractNodeActions, ExtractNodes, Facet, FindParentNodeResult, FocusChangeHandler, HistoryExtension, HistoryOptions, InsertDefaultBlockOptions, InsertNodeOptions, JSONParserOptions, KeyDownHandler, KeyPressHandler, Keymap, KeymapPayload, MarkAction, MarkAttrOptions, MarkBuilder, MarkSpecOptions, MarkTyping, MarkViewComponentOptions, MarkViewFactoryOptions, MarkViewOptions, MountHandler, NodeAction, NodeAttrOptions, NodeBuilder, NodeChild, NodeContent, NodeJSON, NodeSpecOptions, NodeTyping, NodeViewComponentOptions, NodeViewFactoryOptions, NodeViewOptions, OBJECT_REPLACEMENT_CHARACTER, ParagraphExtension, PasteHandler, PickSubType, PlainExtension, PluginPayload, Priority, ProseKitError, RemoveMarkOptions, RemoveNodeOptions, ScrollToSelectionHandler, SelectionJSON, SetBlockTypeOptions, SetNodeAttrsOptions, SimplifyDeeper, SimplifyUnion, StateJSON, StepJSON, TextExtension, TextInputHandler, ToMarkAction, ToNodeAction, ToggleMarkOptions, ToggleNodeOptions, ToggleWrapOptions, TripleClickHandler, TripleClickOnHandler, Union, UnionExtension, UnmountHandler, UnsetBlockTypeOptions, UnsetMarkOptions, UpdateHandler, WrapOptions, getId as _getId, addMark, assert, canUseRegexLookbehind, clsx, collectChildren, collectNodes, containsInlineNode, createEditor, defaultBlockAt, defineBaseCommands, defineBaseKeymap, defineClickHandler, defineClickOnHandler, defineClipboardSerializer, defineCommands, defineDOMEventHandler, defineDefaultState, defineDoc, defineDocChangeHandler, defineDoubleClickHandler, defineDoubleClickOnHandler, defineDropHandler, defineFacet, defineFacetPayload, defineFocusChangeHandler, defineHistory, defineKeyDownHandler, defineKeyPressHandler, defineKeymap, defineMarkAttr, defineMarkSpec, defineMarkView, defineMarkViewComponent, defineMarkViewFactory, defineMountHandler, defineNodeAttr, defineNodeSpec, defineNodeView, defineNodeViewComponent, defineNodeViewFactory, defineParagraph, definePasteHandler, definePlugin, defineScrollToSelectionHandler, defineText, defineTextInputHandler, defineTripleClickHandler, defineTripleClickOnHandler, defineUnmountHandler, defineUpdateHandler, editorEventFacet, elementFromJSON, elementFromNode, expandMark, findParentNode, findParentNodeOfType, getMarkType, getNodeType, htmlFromJSON, htmlFromNode, insertDefaultBlock, insertNode, isAllSelection, isApple, isAtBlockStart, isFragment, isInCodeBlock, isMark, isMarkAbsent, isMarkActive, isNodeSelection, isProseMirrorNode, isSelection, isSlice, isTextSelection, jsonFromHTML, jsonFromNode, jsonFromState, keymapFacet, maybeRun, nodeFromElement, nodeFromHTML, nodeFromJSON, pluginFacet, removeMark, removeNode, setBlockType, setNodeAttrs, setSelectionAround, stateFromJSON, toggleMark, toggleNode, toggleWrap, union, unsetBlockType, unsetMark, withPriority, withSkipCodeBlock, wrap };
|
|
1457
|
+
export { type AddMarkOptions, type AnyAttrs, type AnyFunction, type AttrSpec, type BaseCommandsExtension, type BaseKeymapExtension, type BaseNodeViewOptions, type ClickHandler, type ClickOnHandler, type ClipboardSerializerOptions, type CommandAction, type CommandTyping, type DOMDocumentOptions, type DOMEventHandler, type DOMParserOptions, type DOMSerializerOptions, type DefaultStateOptions, type DocChangeHandler, type DocExtension, type DoubleClickHandler, type DoubleClickOnHandler, type DropHandler, Editor, type EditorEventPayload, EditorNotFoundError, type EditorOptions, type ExpandMarkOptions, type Extension, type ExtensionTyping, type ExtractCommandActions, type ExtractCommandAppliers, type ExtractCommandCreators, type ExtractCommands, type ExtractMarkActions, type ExtractMarks, type ExtractNodeActions, type ExtractNodes, type ExtractTyping, type Facet, type FindParentNodeResult, type FocusChangeHandler, type HistoryExtension, type HistoryOptions, type InsertDefaultBlockOptions, type InsertNodeOptions, type JSONParserOptions, type KeyDownHandler, type KeyPressHandler, type Keymap, type KeymapPayload, type MarkAction, type MarkAttrOptions, type MarkBuilder, type MarkSpecOptions, type MarkTyping, type MarkViewComponentOptions, type MarkViewFactoryOptions, type MarkViewOptions, type MountHandler, type NodeAction, type NodeAttrOptions, type NodeBuilder, type NodeChild, type NodeContent, type NodeJSON, type NodeSpecOptions, type NodeTyping, type NodeViewComponentOptions, type NodeViewFactoryOptions, type NodeViewOptions, OBJECT_REPLACEMENT_CHARACTER, type ParagraphExtension, type PasteHandler, type PickSubType, type PlainExtension, type PluginPayload, Priority, ProseKitError, type RemoveMarkOptions, type RemoveNodeOptions, type ScrollToSelectionHandler, type SelectionJSON, type SetBlockTypeOptions, type SetNodeAttrsOptions, type SimplifyDeeper, type SimplifyUnion, type StateJSON, type StepJSON, type TextExtension, type TextInputHandler, type ToMarkAction, type ToNodeAction, type ToggleMarkOptions, type ToggleNodeOptions, type ToggleWrapOptions, type TripleClickHandler, type TripleClickOnHandler, type Union, type UnionExtension, type UnmountHandler, type UnsetBlockTypeOptions, type UnsetMarkOptions, type UpdateHandler, type WrapOptions, getId as _getId, addMark, assert, canUseRegexLookbehind, clsx, collectChildren, collectNodes, containsInlineNode, createEditor, defaultBlockAt, defineBaseCommands, defineBaseKeymap, defineClickHandler, defineClickOnHandler, defineClipboardSerializer, defineCommands, defineDOMEventHandler, defineDefaultState, defineDoc, defineDocChangeHandler, defineDoubleClickHandler, defineDoubleClickOnHandler, defineDropHandler, defineFacet, defineFacetPayload, defineFocusChangeHandler, defineHistory, defineKeyDownHandler, defineKeyPressHandler, defineKeymap, defineMarkAttr, defineMarkSpec, defineMarkView, defineMarkViewComponent, defineMarkViewFactory, defineMountHandler, defineNodeAttr, defineNodeSpec, defineNodeView, defineNodeViewComponent, defineNodeViewFactory, defineParagraph, definePasteHandler, definePlugin, defineScrollToSelectionHandler, defineText, defineTextInputHandler, defineTripleClickHandler, defineTripleClickOnHandler, defineUnmountHandler, defineUpdateHandler, editorEventFacet, elementFromJSON, elementFromNode, expandMark, findParentNode, findParentNodeOfType, getMarkType, getNodeType, htmlFromJSON, htmlFromNode, insertDefaultBlock, insertNode, isAllSelection, isApple, isAtBlockStart, isFragment, isInCodeBlock, isMark, isMarkAbsent, isMarkActive, isNodeSelection, isProseMirrorNode, isSelection, isSlice, isTextSelection, jsonFromHTML, jsonFromNode, jsonFromState, keymapFacet, maybeRun, nodeFromElement, nodeFromHTML, nodeFromJSON, pluginFacet, removeMark, removeNode, setBlockType, setNodeAttrs, setSelectionAround, stateFromJSON, toggleMark, toggleNode, toggleWrap, union, unsetBlockType, unsetMark, withPriority, withSkipCodeBlock, wrap };
|
|
1458
|
+
//# sourceMappingURL=prosekit-core.d.ts.map
|