@prosekit/core 0.0.0-next-20230709094459 → 0.0.0-next-20240421132240
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/_tsup-dts-rollup.d.ts +1720 -0
- package/dist/prosekit-core.d.ts +123 -283
- package/dist/prosekit-core.js +1737 -389
- package/package.json +7 -9
- package/dist/style.css +0 -52
- package/src/index.ts +0 -30
package/dist/prosekit-core.d.ts
CHANGED
@@ -1,283 +1,123 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
}
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}
|
19
|
-
|
20
|
-
|
21
|
-
};
|
22
|
-
|
23
|
-
|
24
|
-
};
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
}
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
}
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
}
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
}
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
}
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
}
|
125
|
-
/** @public */
|
126
|
-
declare class Facet<Input, Output> {
|
127
|
-
/** @internal */
|
128
|
-
readonly index: number;
|
129
|
-
/** @internal */
|
130
|
-
readonly combine: (inputs: Input[]) => Output;
|
131
|
-
/** @internal */
|
132
|
-
readonly next: Facet<Output, any> | null;
|
133
|
-
private constructor();
|
134
|
-
static define<Input, Output>({ combine, next }: FacetOptions<Input, Output>): Facet<Input, Output>;
|
135
|
-
/** @internal */
|
136
|
-
static defineSlot<Input>({ combine, }: Omit<FacetOptions<Input, Input>, 'next'>): Facet<Input, Input>;
|
137
|
-
extension(inputs: Input[]): FacetExtension<Input, Output>;
|
138
|
-
}
|
139
|
-
/** @public */
|
140
|
-
declare class FacetExtension<Input, Output> {
|
141
|
-
readonly facet: Facet<Input, Output>;
|
142
|
-
readonly inputs: Input[];
|
143
|
-
extension: Extension;
|
144
|
-
constructor(facet: Facet<Input, Output>, inputs: Input[]);
|
145
|
-
}
|
146
|
-
|
147
|
-
declare function defineExtension<E extends Extension | Extension[]>(extension: E): SimplifyExtension<E>;
|
148
|
-
|
149
|
-
/** @public */
|
150
|
-
declare function withPriority<T extends Extension>(extension: T, priority: Priority): T;
|
151
|
-
|
152
|
-
/**
|
153
|
-
* Base class for all ProseKit errors.
|
154
|
-
*/
|
155
|
-
declare class ProseKitError extends Error {
|
156
|
-
}
|
157
|
-
|
158
|
-
declare function addCommands<T extends Record<string, CommandCreator> = Record<string, CommandCreator>>(commands: T): Extension<{
|
159
|
-
COMMAND_ARGS: {
|
160
|
-
[K in keyof T]: Parameters<T[K]>;
|
161
|
-
};
|
162
|
-
}>;
|
163
|
-
/**
|
164
|
-
* Add some base commands
|
165
|
-
*
|
166
|
-
* @public
|
167
|
-
*/
|
168
|
-
declare function addBaseCommands(): Extension<{
|
169
|
-
COMMAND_ARGS: {
|
170
|
-
insertText: [{
|
171
|
-
text: string;
|
172
|
-
from?: number | undefined;
|
173
|
-
to?: number | undefined;
|
174
|
-
}];
|
175
|
-
insertNode: [{
|
176
|
-
node: ProseMirrorNode;
|
177
|
-
pos?: number | undefined;
|
178
|
-
}];
|
179
|
-
wrap: [{
|
180
|
-
nodeType: NodeType;
|
181
|
-
attrs?: Attrs | null | undefined;
|
182
|
-
}];
|
183
|
-
setBlockType: [{
|
184
|
-
nodeType: NodeType;
|
185
|
-
attrs?: Attrs | null | undefined;
|
186
|
-
from?: number | undefined;
|
187
|
-
to?: number | undefined;
|
188
|
-
}];
|
189
|
-
selectAll: [];
|
190
|
-
};
|
191
|
-
}>;
|
192
|
-
|
193
|
-
/** @public */
|
194
|
-
declare function addDoc(): Extension<{
|
195
|
-
NODES: "doc";
|
196
|
-
}>;
|
197
|
-
|
198
|
-
/** @public */
|
199
|
-
declare function addInputRule(rules: (context: {
|
200
|
-
schema: Schema;
|
201
|
-
}) => InputRule[]): Extension;
|
202
|
-
|
203
|
-
/** @public */
|
204
|
-
interface Keymap {
|
205
|
-
[key: string]: Command;
|
206
|
-
}
|
207
|
-
/** @public */
|
208
|
-
declare function addKeymap(keymap: Keymap): Extension;
|
209
|
-
/** @public */
|
210
|
-
declare function addBaseKeymap(): Extension<ExtensionTyping<string, string, CommandArgs>>;
|
211
|
-
|
212
|
-
/**
|
213
|
-
* @public
|
214
|
-
*/
|
215
|
-
interface MarkSpecOptions<M extends string = string> {
|
216
|
-
name: M;
|
217
|
-
spec: MarkSpec;
|
218
|
-
}
|
219
|
-
/**
|
220
|
-
* @public
|
221
|
-
*/
|
222
|
-
declare function addMarkSpec<Mark extends string>(options: MarkSpecOptions<Mark>): Extension<{
|
223
|
-
MARKS: Mark;
|
224
|
-
}>;
|
225
|
-
|
226
|
-
/**
|
227
|
-
* @public
|
228
|
-
*/
|
229
|
-
interface NodeSpecOptions<N extends string = string> {
|
230
|
-
name: N;
|
231
|
-
spec: NodeSpec;
|
232
|
-
topNode?: boolean;
|
233
|
-
}
|
234
|
-
/**
|
235
|
-
* @public
|
236
|
-
*/
|
237
|
-
declare function addNodeSpec<Node extends string>(options: NodeSpecOptions<Node>): Extension<{
|
238
|
-
NODES: Node;
|
239
|
-
}>;
|
240
|
-
|
241
|
-
interface NodeViewOptions {
|
242
|
-
name: string;
|
243
|
-
constructor: NodeViewConstructor;
|
244
|
-
}
|
245
|
-
declare function addNodeView(options: NodeViewOptions): Extension;
|
246
|
-
|
247
|
-
/** @public */
|
248
|
-
declare function addParagraph(): Extension<{
|
249
|
-
NODES: "paragraph";
|
250
|
-
}>;
|
251
|
-
|
252
|
-
interface StateConfigContext {
|
253
|
-
schema: Schema;
|
254
|
-
}
|
255
|
-
type StateConfigCallback = (ctx: StateConfigContext) => EditorStateConfig;
|
256
|
-
type ViewProps = Omit<DirectEditorProps, 'state'>;
|
257
|
-
|
258
|
-
/** @public */
|
259
|
-
interface PluginOptions {
|
260
|
-
plugins: Plugin[] | ((context: {
|
261
|
-
schema: Schema;
|
262
|
-
}) => Plugin[]);
|
263
|
-
}
|
264
|
-
/** @public */
|
265
|
-
declare function addPlugin({ plugins }: PluginOptions): Extension;
|
266
|
-
|
267
|
-
/** @public */
|
268
|
-
declare function addText(): Extension<{
|
269
|
-
NODES: "text";
|
270
|
-
}>;
|
271
|
-
|
272
|
-
/**
|
273
|
-
* @intneral
|
274
|
-
*/
|
275
|
-
type SimplifyUnion<T> = Simplify<UnionToIntersection<T>>;
|
276
|
-
|
277
|
-
/** @internal */
|
278
|
-
declare function getMarkType(schema: Schema, type: string | MarkType): MarkType;
|
279
|
-
|
280
|
-
/** @internal */
|
281
|
-
declare function getNodeType(schema: Schema, type: string | NodeType): NodeType;
|
282
|
-
|
283
|
-
export { CommandArgs, Editor, EditorOptions, Extension, ExtensionTyping, ExtractCommandCreators, ExtractCommandDispatchers, ExtractMarks, ExtractNodes, Facet, FacetExtension, FacetOptions, Keymap, MarkSpecOptions, NodeSpecOptions, NodeViewOptions, PluginOptions, Priority, ProseKitError, SimplifyUnion, StateConfigCallback, StateConfigContext, ViewProps, addBaseCommands, addBaseKeymap, addCommands, addDoc, addInputRule, addKeymap, addMarkSpec, addNodeSpec, addNodeView, addParagraph, addPlugin, addText, createEditor, defineExtension, getMarkType, getNodeType, toggleMark, withPriority };
|
1
|
+
export { addMark } from './_tsup-dts-rollup';
|
2
|
+
export { expandMark } from './_tsup-dts-rollup';
|
3
|
+
export { insertNode } from './_tsup-dts-rollup';
|
4
|
+
export { removeMark } from './_tsup-dts-rollup';
|
5
|
+
export { setBlockType } from './_tsup-dts-rollup';
|
6
|
+
export { setNodeAttrs } from './_tsup-dts-rollup';
|
7
|
+
export { toggleMark } from './_tsup-dts-rollup';
|
8
|
+
export { toggleNode } from './_tsup-dts-rollup';
|
9
|
+
export { Editor } from './_tsup-dts-rollup';
|
10
|
+
export { createEditor } from './_tsup-dts-rollup';
|
11
|
+
export { EditorOptions } from './_tsup-dts-rollup';
|
12
|
+
export { union } from './_tsup-dts-rollup';
|
13
|
+
export { withPriority } from './_tsup-dts-rollup';
|
14
|
+
export { EditorNotFoundError_alias_1 as EditorNotFoundError } from './_tsup-dts-rollup';
|
15
|
+
export { ProseKitError_alias_1 as ProseKitError } from './_tsup-dts-rollup';
|
16
|
+
export { defineBaseCommands } from './_tsup-dts-rollup';
|
17
|
+
export { defineCommands } from './_tsup-dts-rollup';
|
18
|
+
export { defineDefaultState } from './_tsup-dts-rollup';
|
19
|
+
export { DefaultStateOptions } from './_tsup-dts-rollup';
|
20
|
+
export { defineDoc } from './_tsup-dts-rollup';
|
21
|
+
export { defineDocChangeHandler } from './_tsup-dts-rollup';
|
22
|
+
export { DocChangeHandler } from './_tsup-dts-rollup';
|
23
|
+
export { defineDOMEventHandler } from './_tsup-dts-rollup';
|
24
|
+
export { DOMEventHandler } from './_tsup-dts-rollup';
|
25
|
+
export { defineClickHandler } from './_tsup-dts-rollup';
|
26
|
+
export { defineClickOnHandler } from './_tsup-dts-rollup';
|
27
|
+
export { defineDoubleClickHandler } from './_tsup-dts-rollup';
|
28
|
+
export { defineDoubleClickOnHandler } from './_tsup-dts-rollup';
|
29
|
+
export { defineDropHandler } from './_tsup-dts-rollup';
|
30
|
+
export { defineKeyDownHandler } from './_tsup-dts-rollup';
|
31
|
+
export { defineKeyPressHandler } from './_tsup-dts-rollup';
|
32
|
+
export { definePasteHandler } from './_tsup-dts-rollup';
|
33
|
+
export { defineScrollToSelectionHandler } from './_tsup-dts-rollup';
|
34
|
+
export { defineTextInputHandler } from './_tsup-dts-rollup';
|
35
|
+
export { defineTripleClickHandler } from './_tsup-dts-rollup';
|
36
|
+
export { defineTripleClickOnHandler } from './_tsup-dts-rollup';
|
37
|
+
export { ClickHandler } from './_tsup-dts-rollup';
|
38
|
+
export { ClickOnHandler } from './_tsup-dts-rollup';
|
39
|
+
export { DoubleClickHandler } from './_tsup-dts-rollup';
|
40
|
+
export { DoubleClickOnHandler } from './_tsup-dts-rollup';
|
41
|
+
export { DropHandler } from './_tsup-dts-rollup';
|
42
|
+
export { KeyDownHandler } from './_tsup-dts-rollup';
|
43
|
+
export { KeyPressHandler } from './_tsup-dts-rollup';
|
44
|
+
export { PasteHandler } from './_tsup-dts-rollup';
|
45
|
+
export { ScrollToSelectionHandler } from './_tsup-dts-rollup';
|
46
|
+
export { TextInputHandler } from './_tsup-dts-rollup';
|
47
|
+
export { TripleClickHandler } from './_tsup-dts-rollup';
|
48
|
+
export { TripleClickOnHandler } from './_tsup-dts-rollup';
|
49
|
+
export { defineFocusChangeHandler } from './_tsup-dts-rollup';
|
50
|
+
export { FocusChangeHandler } from './_tsup-dts-rollup';
|
51
|
+
export { defineMountHandler } from './_tsup-dts-rollup';
|
52
|
+
export { defineUnmountHandler } from './_tsup-dts-rollup';
|
53
|
+
export { defineUpdateHandler } from './_tsup-dts-rollup';
|
54
|
+
export { MountHandler } from './_tsup-dts-rollup';
|
55
|
+
export { UnmountHandler } from './_tsup-dts-rollup';
|
56
|
+
export { UpdateHandler } from './_tsup-dts-rollup';
|
57
|
+
export { defineHistory } from './_tsup-dts-rollup';
|
58
|
+
export { defineBaseKeymap } from './_tsup-dts-rollup';
|
59
|
+
export { defineKeymap } from './_tsup-dts-rollup';
|
60
|
+
export { keymapFacet } from './_tsup-dts-rollup';
|
61
|
+
export { Keymap } from './_tsup-dts-rollup';
|
62
|
+
export { KeymapPayload } from './_tsup-dts-rollup';
|
63
|
+
export { defineMarkAttr } from './_tsup-dts-rollup';
|
64
|
+
export { defineMarkSpec } from './_tsup-dts-rollup';
|
65
|
+
export { MarkAttrOptions } from './_tsup-dts-rollup';
|
66
|
+
export { MarkSpecOptions } from './_tsup-dts-rollup';
|
67
|
+
export { defineNodeAttr } from './_tsup-dts-rollup';
|
68
|
+
export { defineNodeSpec } from './_tsup-dts-rollup';
|
69
|
+
export { NodeAttrOptions } from './_tsup-dts-rollup';
|
70
|
+
export { NodeSpecOptions } from './_tsup-dts-rollup';
|
71
|
+
export { defineNodeView } from './_tsup-dts-rollup';
|
72
|
+
export { NodeViewOptions } from './_tsup-dts-rollup';
|
73
|
+
export { defineNodeViewFactory } from './_tsup-dts-rollup';
|
74
|
+
export { NodeViewFactoryOptions } from './_tsup-dts-rollup';
|
75
|
+
export { defineParagraph } from './_tsup-dts-rollup';
|
76
|
+
export { definePlugin } from './_tsup-dts-rollup';
|
77
|
+
export { pluginFacet } from './_tsup-dts-rollup';
|
78
|
+
export { PluginPayload } from './_tsup-dts-rollup';
|
79
|
+
export { defineText } from './_tsup-dts-rollup';
|
80
|
+
export { Facet } from './_tsup-dts-rollup';
|
81
|
+
export { FacetOptions } from './_tsup-dts-rollup';
|
82
|
+
export { BaseNodeViewOptions } from './_tsup-dts-rollup';
|
83
|
+
export { CommandArgs } from './_tsup-dts-rollup';
|
84
|
+
export { Extension } from './_tsup-dts-rollup';
|
85
|
+
export { ExtractCommandAppliers } from './_tsup-dts-rollup';
|
86
|
+
export { ExtractCommandCreators } from './_tsup-dts-rollup';
|
87
|
+
export { ExtractMarks } from './_tsup-dts-rollup';
|
88
|
+
export { ExtractNodes } from './_tsup-dts-rollup';
|
89
|
+
export { SimplifyExtension } from './_tsup-dts-rollup';
|
90
|
+
export { ExtensionTyping } from './_tsup-dts-rollup';
|
91
|
+
export { NodeJSON } from './_tsup-dts-rollup';
|
92
|
+
export { SelectionJSON } from './_tsup-dts-rollup';
|
93
|
+
export { StateJSON } from './_tsup-dts-rollup';
|
94
|
+
export { Priority } from './_tsup-dts-rollup';
|
95
|
+
export { SimplifyUnion } from './_tsup-dts-rollup';
|
96
|
+
export { clsx } from './_tsup-dts-rollup';
|
97
|
+
export { defaultBlockAt } from './_tsup-dts-rollup';
|
98
|
+
export { _getId } from './_tsup-dts-rollup';
|
99
|
+
export { getMarkType } from './_tsup-dts-rollup';
|
100
|
+
export { getNodeType } from './_tsup-dts-rollup';
|
101
|
+
export { isInCodeBlock } from './_tsup-dts-rollup';
|
102
|
+
export { elementFromJSON } from './_tsup-dts-rollup';
|
103
|
+
export { elementFromNode } from './_tsup-dts-rollup';
|
104
|
+
export { htmlFromJSON } from './_tsup-dts-rollup';
|
105
|
+
export { htmlFromNode } from './_tsup-dts-rollup';
|
106
|
+
export { jsonFromHTML } from './_tsup-dts-rollup';
|
107
|
+
export { jsonFromNode } from './_tsup-dts-rollup';
|
108
|
+
export { jsonFromState } from './_tsup-dts-rollup';
|
109
|
+
export { nodeFromElement } from './_tsup-dts-rollup';
|
110
|
+
export { nodeFromHTML } from './_tsup-dts-rollup';
|
111
|
+
export { nodeFromJSON } from './_tsup-dts-rollup';
|
112
|
+
export { stateFromJSON } from './_tsup-dts-rollup';
|
113
|
+
export { DOMDocumentOptions } from './_tsup-dts-rollup';
|
114
|
+
export { DOMParserOptions } from './_tsup-dts-rollup';
|
115
|
+
export { DOMSerializerOptions } from './_tsup-dts-rollup';
|
116
|
+
export { JSONParserOptions } from './_tsup-dts-rollup';
|
117
|
+
export { isAllSelection } from './_tsup-dts-rollup';
|
118
|
+
export { isMark } from './_tsup-dts-rollup';
|
119
|
+
export { isNodeSelection } from './_tsup-dts-rollup';
|
120
|
+
export { isProseMirrorNode } from './_tsup-dts-rollup';
|
121
|
+
export { isTextSelection } from './_tsup-dts-rollup';
|
122
|
+
export { withSkipCodeBlock } from './_tsup-dts-rollup';
|
123
|
+
export { OBJECT_REPLACEMENT_CHARACTER } from './_tsup-dts-rollup';
|