@prosekit/core 0.0.11 → 0.0.13
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 +189 -190
- package/dist/prosekit-core.d.ts +19 -20
- package/dist/prosekit-core.js +205 -220
- package/dist/style.css +4 -1
- package/package.json +3 -3
- package/src/index.ts +24 -17
@@ -30,12 +30,92 @@ declare type Action = (options: {
|
|
30
30
|
view?: EditorView;
|
31
31
|
}) => boolean;
|
32
32
|
|
33
|
+
declare function addMark(options: AddMarkOptions): Command;
|
34
|
+
export { addMark }
|
35
|
+
export { addMark as addMark_alias_1 }
|
36
|
+
|
37
|
+
declare interface AddMarkOptions {
|
38
|
+
type: string | MarkType;
|
39
|
+
attrs?: Attrs | null;
|
40
|
+
/**
|
41
|
+
* The start position of the mark. By default it will be the start position of current selection.
|
42
|
+
*/
|
43
|
+
from?: number;
|
44
|
+
/**
|
45
|
+
* The end position of the mark. By default it will be the end position of current selection.
|
46
|
+
*/
|
47
|
+
to?: number;
|
48
|
+
}
|
49
|
+
export { AddMarkOptions }
|
50
|
+
export { AddMarkOptions as AddMarkOptions_alias_1 }
|
51
|
+
|
52
|
+
export declare function applyAction(operator: Action): Command;
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Utility function assert that two types are equal in tests.
|
56
|
+
*/
|
57
|
+
export declare function assertTypeEqual<T, U>(_val: IsEqual<T, U>): void;
|
58
|
+
|
59
|
+
export declare function collectNodes(content: NodeContent): ProseMirrorNode[];
|
60
|
+
|
61
|
+
export declare interface CommandApplier<Args extends any[] = any[]> {
|
62
|
+
(...args: Args): boolean;
|
63
|
+
canApply(...args: Args): boolean;
|
64
|
+
}
|
65
|
+
|
66
|
+
/** @internal */
|
67
|
+
declare interface CommandArgs {
|
68
|
+
[name: string]: any[];
|
69
|
+
}
|
70
|
+
export { CommandArgs }
|
71
|
+
export { CommandArgs as CommandArgs_alias_1 }
|
72
|
+
|
73
|
+
export declare type CommandCreator<Args extends any[] = any[]> = (...arg: Args) => Command;
|
74
|
+
|
75
|
+
export declare interface CommandCreators {
|
76
|
+
[name: string]: CommandCreator;
|
77
|
+
}
|
78
|
+
|
79
|
+
export declare const commandFacet: Facet<CommandCreators, CommandCreators>;
|
80
|
+
|
81
|
+
export declare type CommandPayload = CommandCreators;
|
82
|
+
|
83
|
+
export declare type Converters = ConverterTuple[];
|
84
|
+
|
85
|
+
declare type ConverterTuple = Tuple5<FacetConverter | undefined>;
|
86
|
+
|
87
|
+
/** @public */
|
88
|
+
declare function createEditor<E extends Extension>({ extension, defaultDoc, defaultSelection, }: EditorOptions<E>): Editor<E>;
|
89
|
+
export { createEditor }
|
90
|
+
export { createEditor as createEditor_alias_1 }
|
91
|
+
|
92
|
+
export declare function createMarkBuilder(getState: () => EditorState | null | undefined, type: MarkType): MarkBuilder;
|
93
|
+
|
94
|
+
export declare function createNodeBuilder(getState: () => EditorState | null | undefined, type: NodeType): NodeBuilder;
|
95
|
+
|
96
|
+
export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
97
|
+
|
98
|
+
export declare const default_alias_1: UserProjectConfigExport;
|
99
|
+
|
100
|
+
declare interface DefaultStateOptions {
|
101
|
+
/**
|
102
|
+
* A JSON representation of a ProseMirror document.
|
103
|
+
*/
|
104
|
+
doc?: NodeJson;
|
105
|
+
/**
|
106
|
+
* A JSON representation of a ProseMirror selection.
|
107
|
+
*/
|
108
|
+
selection?: SelectionJson;
|
109
|
+
}
|
110
|
+
export { DefaultStateOptions }
|
111
|
+
export { DefaultStateOptions as DefaultStateOptions_alias_1 }
|
112
|
+
|
33
113
|
/**
|
34
114
|
* Add some base commands
|
35
115
|
*
|
36
116
|
* @public
|
37
117
|
*/
|
38
|
-
declare function
|
118
|
+
declare function defineBaseCommands(): Extension<{
|
39
119
|
COMMAND_ARGS: {
|
40
120
|
insertText: [{
|
41
121
|
text: string;
|
@@ -59,115 +139,100 @@ declare function addBaseCommands(): Extension<{
|
|
59
139
|
selectAll: [];
|
60
140
|
};
|
61
141
|
}>;
|
62
|
-
export {
|
63
|
-
export {
|
142
|
+
export { defineBaseCommands }
|
143
|
+
export { defineBaseCommands as defineBaseCommands_alias_1 }
|
64
144
|
|
65
145
|
/** @public */
|
66
|
-
declare function
|
67
|
-
export {
|
68
|
-
export {
|
146
|
+
declare function defineBaseKeymap(): Extension<ExtensionTyping<string, string, CommandArgs>>;
|
147
|
+
export { defineBaseKeymap }
|
148
|
+
export { defineBaseKeymap as defineBaseKeymap_alias_1 }
|
69
149
|
|
70
|
-
declare function
|
150
|
+
declare function defineCommands<T extends Record<string, CommandCreator> = Record<string, CommandCreator>>(commands: T): Extension<{
|
71
151
|
COMMAND_ARGS: {
|
72
152
|
[K in keyof T]: Parameters<T[K]>;
|
73
153
|
};
|
74
154
|
}>;
|
75
|
-
export {
|
76
|
-
export {
|
155
|
+
export { defineCommands }
|
156
|
+
export { defineCommands as defineCommands_alias_1 }
|
77
157
|
|
78
|
-
declare function
|
79
|
-
export {
|
80
|
-
export {
|
158
|
+
declare function defineDefaultState(options: DefaultStateOptions): Extension;
|
159
|
+
export { defineDefaultState }
|
160
|
+
export { defineDefaultState as defineDefaultState_alias_1 }
|
81
161
|
|
82
162
|
/** @public */
|
83
|
-
declare function
|
163
|
+
declare function defineDoc(): Extension< {
|
84
164
|
NODES: "doc";
|
85
165
|
}>;
|
86
|
-
export {
|
87
|
-
export {
|
166
|
+
export { defineDoc }
|
167
|
+
export { defineDoc as defineDoc_alias_1 }
|
88
168
|
|
89
169
|
/**
|
90
170
|
* @internal
|
91
171
|
*/
|
92
|
-
declare function
|
172
|
+
declare function defineEventHandler(options: {
|
93
173
|
update?: VoidFunction;
|
94
|
-
}): FacetExtension<VoidFunction,
|
95
|
-
export {
|
96
|
-
export {
|
174
|
+
}): FacetExtension<VoidFunction, PluginPayload>;
|
175
|
+
export { defineEventHandler }
|
176
|
+
export { defineEventHandler as defineEventHandler_alias_1 }
|
97
177
|
|
98
178
|
/**
|
99
179
|
* Add undo/redo history to the editor.
|
100
180
|
*/
|
101
|
-
declare function
|
181
|
+
declare function defineHistory(): Extension< {
|
102
182
|
COMMAND_ARGS: {
|
103
183
|
undo: [];
|
104
184
|
redo: [];
|
105
185
|
};
|
106
186
|
}>;
|
107
|
-
export {
|
108
|
-
export {
|
187
|
+
export { defineHistory }
|
188
|
+
export { defineHistory as defineHistory_alias_1 }
|
109
189
|
|
110
190
|
/**
|
111
191
|
* @public
|
112
192
|
*/
|
113
|
-
declare function
|
193
|
+
declare function defineInputRule(rules: (context: {
|
114
194
|
schema: Schema;
|
115
195
|
}) => InputRule[]): Extension;
|
116
|
-
export {
|
117
|
-
export {
|
196
|
+
export { defineInputRule }
|
197
|
+
export { defineInputRule as defineInputRule_alias_1 }
|
118
198
|
|
119
199
|
/** @public */
|
120
|
-
declare function
|
121
|
-
export {
|
122
|
-
export {
|
123
|
-
|
124
|
-
declare function addMark(options: AddMarkOptions): Command;
|
125
|
-
export { addMark }
|
126
|
-
export { addMark as addMark_alias_1 }
|
127
|
-
|
128
|
-
declare interface AddMarkOptions {
|
129
|
-
type: string | MarkType;
|
130
|
-
attrs?: Attrs | null;
|
131
|
-
/**
|
132
|
-
* The start position of the mark. By default it will be the start position of current selection.
|
133
|
-
*/
|
134
|
-
from?: number;
|
135
|
-
/**
|
136
|
-
* The end position of the mark. By default it will be the end position of current selection.
|
137
|
-
*/
|
138
|
-
to?: number;
|
139
|
-
}
|
140
|
-
export { AddMarkOptions }
|
141
|
-
export { AddMarkOptions as AddMarkOptions_alias_1 }
|
200
|
+
declare function defineKeymap(keymap: Keymap): Extension;
|
201
|
+
export { defineKeymap }
|
202
|
+
export { defineKeymap as defineKeymap_alias_1 }
|
142
203
|
|
143
204
|
/**
|
144
205
|
* @public
|
145
206
|
*/
|
146
|
-
declare function
|
207
|
+
declare function defineMarkSpec<Mark extends string>(options: MarkSpecOptions<Mark>): Extension<{
|
147
208
|
MARKS: Mark;
|
148
209
|
}>;
|
149
|
-
export {
|
150
|
-
export {
|
210
|
+
export { defineMarkSpec }
|
211
|
+
export { defineMarkSpec as defineMarkSpec_alias_1 }
|
151
212
|
|
152
213
|
/**
|
153
214
|
* @public
|
154
215
|
*/
|
155
|
-
declare function
|
216
|
+
declare function defineNodeSpec<NodeName extends string>(options: NodeSpecOptions<NodeName>): Extension<{
|
156
217
|
NODES: NodeName;
|
157
218
|
}>;
|
158
|
-
export {
|
159
|
-
export {
|
219
|
+
export { defineNodeSpec }
|
220
|
+
export { defineNodeSpec as defineNodeSpec_alias_1 }
|
221
|
+
|
222
|
+
declare function defineNodeView(options: NodeViewOptions): Extension;
|
223
|
+
export { defineNodeView }
|
224
|
+
export { defineNodeView as defineNodeView_alias_1 }
|
160
225
|
|
161
|
-
declare function
|
162
|
-
export {
|
163
|
-
export {
|
226
|
+
declare function defineNodeViewEffect(options: NodeViewEffectOptions): Extension;
|
227
|
+
export { defineNodeViewEffect }
|
228
|
+
export { defineNodeViewEffect as defineNodeViewEffect_alias_1 }
|
164
229
|
|
165
230
|
/** @public */
|
166
|
-
declare function
|
231
|
+
declare function defineParagraph(): Extension< {
|
167
232
|
NODES: "paragraph";
|
168
233
|
}>;
|
169
|
-
export {
|
170
|
-
export {
|
234
|
+
export { defineParagraph }
|
235
|
+
export { defineParagraph as defineParagraph_alias_1 }
|
171
236
|
|
172
237
|
/**
|
173
238
|
* Adds a ProseMirror plugin to the editor.
|
@@ -177,81 +242,18 @@ export { addParagraph as addParagraph_alias_1 }
|
|
177
242
|
*
|
178
243
|
* @public
|
179
244
|
*/
|
180
|
-
declare function
|
245
|
+
declare function definePlugin(plugin: Plugin_2 | Plugin_2[] | ((context: {
|
181
246
|
schema: Schema;
|
182
247
|
}) => Plugin_2[])): Extension;
|
183
|
-
export {
|
184
|
-
export {
|
248
|
+
export { definePlugin }
|
249
|
+
export { definePlugin as definePlugin_alias_1 }
|
185
250
|
|
186
251
|
/** @public */
|
187
|
-
declare function
|
252
|
+
declare function defineText(): Extension< {
|
188
253
|
NODES: "text";
|
189
254
|
}>;
|
190
|
-
export {
|
191
|
-
export {
|
192
|
-
|
193
|
-
export declare type AnySlot = Slot<any, any>;
|
194
|
-
|
195
|
-
export declare function applyAction(operator: Action): Command;
|
196
|
-
|
197
|
-
/**
|
198
|
-
* Utility function assert that two types are equal in tests.
|
199
|
-
*/
|
200
|
-
export declare function assertTypeEqual<T, U>(_val: IsEqual<T, U>): void;
|
201
|
-
|
202
|
-
export declare function collectNodes(content: NodeContent): ProseMirrorNode[];
|
203
|
-
|
204
|
-
export declare interface CommandApplier<Args extends any[] = any[]> {
|
205
|
-
(...args: Args): boolean;
|
206
|
-
canApply(...args: Args): boolean;
|
207
|
-
}
|
208
|
-
|
209
|
-
/** @internal */
|
210
|
-
declare interface CommandArgs {
|
211
|
-
[name: string]: any[];
|
212
|
-
}
|
213
|
-
export { CommandArgs }
|
214
|
-
export { CommandArgs as CommandArgs_alias_1 }
|
215
|
-
|
216
|
-
export declare type CommandCreator<Args extends any[] = any[]> = (...arg: Args) => Command;
|
217
|
-
|
218
|
-
export declare interface CommandCreators {
|
219
|
-
[name: string]: CommandCreator;
|
220
|
-
}
|
221
|
-
|
222
|
-
export declare const commandSlot: Facet<CommandSlotInput, CommandSlotInput>;
|
223
|
-
|
224
|
-
export declare type CommandSlotInput = Record<string, CommandCreator<any>>;
|
225
|
-
|
226
|
-
/** @public */
|
227
|
-
declare function createEditor<E extends Extension>({ extension, defaultDoc, defaultSelection, }: EditorOptions<E>): Editor<E>;
|
228
|
-
export { createEditor }
|
229
|
-
export { createEditor as createEditor_alias_1 }
|
230
|
-
|
231
|
-
export declare function createMarkBuilder(getState: () => EditorState | null | undefined, type: MarkType): MarkBuilder;
|
232
|
-
|
233
|
-
export declare function createNodeBuilder(getState: () => EditorState | null | undefined, type: NodeType): NodeBuilder;
|
234
|
-
|
235
|
-
export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
236
|
-
|
237
|
-
export declare const default_alias_1: UserProjectConfigExport;
|
238
|
-
|
239
|
-
declare interface DefaultStateOptions {
|
240
|
-
/**
|
241
|
-
* A JSON representation of a ProseMirror document.
|
242
|
-
*/
|
243
|
-
doc?: NodeJson;
|
244
|
-
/**
|
245
|
-
* A JSON representation of a ProseMirror selection.
|
246
|
-
*/
|
247
|
-
selection?: SelectionJson;
|
248
|
-
}
|
249
|
-
export { DefaultStateOptions }
|
250
|
-
export { DefaultStateOptions as DefaultStateOptions_alias_1 }
|
251
|
-
|
252
|
-
declare function defineExtension<E extends Extension | Extension[]>(extension: E): SimplifyExtension<E>;
|
253
|
-
export { defineExtension }
|
254
|
-
export { defineExtension as defineExtension_alias_1 }
|
255
|
+
export { defineText }
|
256
|
+
export { defineText as defineText_alias_1 }
|
255
257
|
|
256
258
|
/** @public */
|
257
259
|
declare class Editor<E extends Extension = any> {
|
@@ -301,7 +303,7 @@ declare interface EditorOptions<E extends Extension> {
|
|
301
303
|
export { EditorOptions }
|
302
304
|
export { EditorOptions as EditorOptions_alias_1 }
|
303
305
|
|
304
|
-
declare type EmptyValue =
|
306
|
+
declare type EmptyValue = undefined | null | EmptyObject;
|
305
307
|
|
306
308
|
export declare type ExceptEmptyValue<T> = ConditionalExcept<T, EmptyValue>;
|
307
309
|
|
@@ -381,40 +383,45 @@ declare class Facet<Input, Output> {
|
|
381
383
|
/** @internal */
|
382
384
|
readonly index: number;
|
383
385
|
/** @internal */
|
384
|
-
readonly
|
386
|
+
readonly converter: () => FacetConverter<Input, Output>;
|
385
387
|
/** @internal */
|
386
388
|
readonly next: Facet<Output, any> | null;
|
387
|
-
/** @internal */
|
388
|
-
readonly single: boolean;
|
389
389
|
private constructor();
|
390
|
-
static define<Input, Output>({
|
390
|
+
static define<Input, Output>({ converter: converter, convert: convert, next, }: FacetOptions<Input, Output>): Facet<Input, Output>;
|
391
391
|
/** @internal */
|
392
|
-
static
|
393
|
-
extension(
|
392
|
+
static defineRootFacet<Input>(options: Omit<FacetOptions<Input, Input>, 'next'>): Facet<Input, Input>;
|
393
|
+
extension(payloads: Input[]): FacetExtension<Input, Output>;
|
394
394
|
}
|
395
395
|
export { Facet }
|
396
396
|
export { Facet as Facet_alias_1 }
|
397
397
|
|
398
|
+
/** @public */
|
399
|
+
export declare interface FacetConverter<Input = any, Output = any> {
|
400
|
+
create: (inputs: Input[]) => Output;
|
401
|
+
update: (inputs: Input[]) => Output | null;
|
402
|
+
}
|
403
|
+
|
398
404
|
/** @public */
|
399
405
|
declare class FacetExtension<Input, Output> {
|
400
406
|
readonly facet: Facet<Input, Output>;
|
401
|
-
readonly
|
407
|
+
readonly payloads: Input[];
|
402
408
|
extension: Extension;
|
403
|
-
constructor(facet: Facet<Input, Output>,
|
409
|
+
constructor(facet: Facet<Input, Output>, payloads: Input[]);
|
404
410
|
}
|
405
411
|
export { FacetExtension }
|
406
412
|
export { FacetExtension as FacetExtension_alias_1 }
|
407
413
|
|
408
414
|
/** @public */
|
409
415
|
declare interface FacetOptions<Input, Output> {
|
410
|
-
|
411
|
-
|
416
|
+
convert?: (payloads: Input[]) => Output;
|
417
|
+
converter?: () => FacetConverter<Input, Output>;
|
412
418
|
next: Facet<Output, any>;
|
413
|
-
single?: boolean;
|
414
419
|
}
|
415
420
|
export { FacetOptions }
|
416
421
|
export { FacetOptions as FacetOptions_alias_1 }
|
417
422
|
|
423
|
+
export declare function getFacetCount(): number;
|
424
|
+
|
418
425
|
/** @internal */
|
419
426
|
declare function getMarkType(schema: Schema, type: string | MarkType): MarkType;
|
420
427
|
export { getMarkType }
|
@@ -425,12 +432,6 @@ declare function getNodeType(schema: Schema, type: string | NodeType): NodeType;
|
|
425
432
|
export { getNodeType }
|
426
433
|
export { getNodeType as getNodeType_alias_1 }
|
427
434
|
|
428
|
-
declare type Input = unknown;
|
429
|
-
|
430
|
-
export declare type Inputs = InputTuple[];
|
431
|
-
|
432
|
-
declare type InputTuple = [Input[], Input[], Input[], Input[], Input[]];
|
433
|
-
|
434
435
|
export declare function insertNode({ node, pos, }: {
|
435
436
|
node: ProseMirrorNode;
|
436
437
|
pos?: number;
|
@@ -503,6 +504,18 @@ declare interface NodeSpecOptions<NodeName extends string = string> extends Node
|
|
503
504
|
export { NodeSpecOptions }
|
504
505
|
export { NodeSpecOptions as NodeSpecOptions_alias_1 }
|
505
506
|
|
507
|
+
declare type NodeViewEffectOptions = {
|
508
|
+
group: string;
|
509
|
+
name: string;
|
510
|
+
args: unknown;
|
511
|
+
} | {
|
512
|
+
group: string;
|
513
|
+
name?: undefined;
|
514
|
+
factory: (args: unknown) => NodeViewConstructor;
|
515
|
+
};
|
516
|
+
export { NodeViewEffectOptions }
|
517
|
+
export { NodeViewEffectOptions as NodeViewEffectOptions_alias_1 }
|
518
|
+
|
506
519
|
declare interface NodeViewOptions {
|
507
520
|
name: string;
|
508
521
|
constructor: NodeViewConstructor;
|
@@ -512,17 +525,23 @@ export { NodeViewOptions as NodeViewOptions_alias_1 }
|
|
512
525
|
|
513
526
|
export declare function objectEqual<T>(a: T, b: T): boolean;
|
514
527
|
|
528
|
+
declare type Payload = unknown;
|
529
|
+
|
530
|
+
export declare type Payloads = PayloadTuple[];
|
531
|
+
|
532
|
+
declare type PayloadTuple = Tuple5<Payload[]>;
|
533
|
+
|
515
534
|
/** @internal */
|
516
|
-
declare const pluginFacet: Facet<
|
535
|
+
declare const pluginFacet: Facet<PluginPayload, StatePayload>;
|
517
536
|
export { pluginFacet }
|
518
537
|
export { pluginFacet as pluginFacet_alias_1 }
|
519
538
|
|
520
539
|
/** @internal */
|
521
|
-
declare type
|
540
|
+
declare type PluginPayload = (context: {
|
522
541
|
schema: Schema;
|
523
542
|
}) => Plugin_2[];
|
524
|
-
export {
|
525
|
-
export {
|
543
|
+
export { PluginPayload }
|
544
|
+
export { PluginPayload as PluginPayload_alias_1 }
|
526
545
|
|
527
546
|
/**
|
528
547
|
* @public
|
@@ -545,7 +564,9 @@ declare class ProseKitError extends Error {
|
|
545
564
|
export { ProseKitError }
|
546
565
|
export { ProseKitError as ProseKitError_alias_1 }
|
547
566
|
|
548
|
-
export declare const
|
567
|
+
export declare const schemaFacet: Facet<SchemaPayload, SchemaPayload>;
|
568
|
+
|
569
|
+
export declare type SchemaPayload = SchemaSpec;
|
549
570
|
|
550
571
|
/**
|
551
572
|
* A JSON representation of the prosemirror selection.
|
@@ -578,35 +599,7 @@ declare type SimplifyUnion<T> = Simplify<UnionToIntersection<T>>;
|
|
578
599
|
export { SimplifyUnion }
|
579
600
|
export { SimplifyUnion as SimplifyUnion_alias_1 }
|
580
601
|
|
581
|
-
export declare
|
582
|
-
create: (inputs: Input[]) => Output;
|
583
|
-
update: (inputs: Input[]) => Output | null;
|
584
|
-
}
|
585
|
-
|
586
|
-
export declare type Slots = SlotTuple[];
|
587
|
-
|
588
|
-
declare type SlotTuple = [
|
589
|
-
AnySlot | undefined,
|
590
|
-
AnySlot | undefined,
|
591
|
-
AnySlot | undefined,
|
592
|
-
AnySlot | undefined,
|
593
|
-
AnySlot | undefined
|
594
|
-
];
|
595
|
-
|
596
|
-
/**
|
597
|
-
* Use topological sort algorithm to sort facets.
|
598
|
-
*/
|
599
|
-
export declare function sortFacets(unsorted: readonly Facet<any, any>[]): Facet<any, any>[];
|
600
|
-
|
601
|
-
declare type StateConfigCallback = (ctx: StateConfigContext) => EditorStateConfig;
|
602
|
-
export { StateConfigCallback }
|
603
|
-
export { StateConfigCallback as StateConfigCallback_alias_1 }
|
604
|
-
|
605
|
-
declare interface StateConfigContext {
|
606
|
-
schema: Schema;
|
607
|
-
}
|
608
|
-
export { StateConfigContext }
|
609
|
-
export { StateConfigContext as StateConfigContext_alias_1 }
|
602
|
+
export declare const stateFacet: Facet<StatePayload, StatePayload>;
|
610
603
|
|
611
604
|
/**
|
612
605
|
* A JSON representation of the prosemirror state.
|
@@ -626,7 +619,9 @@ declare interface StateJson {
|
|
626
619
|
export { StateJson }
|
627
620
|
export { StateJson as StateJson_alias_1 }
|
628
621
|
|
629
|
-
export declare
|
622
|
+
export declare type StatePayload = (ctx: {
|
623
|
+
schema: Schema;
|
624
|
+
}) => EditorStateConfig;
|
630
625
|
|
631
626
|
export declare type ToCommandApplier<T extends CommandArgs> = {
|
632
627
|
[K in keyof T]: CommandApplier<T[K]>;
|
@@ -662,22 +657,26 @@ declare interface ToggleNodeOptions {
|
|
662
657
|
export { ToggleNodeOptions }
|
663
658
|
export { ToggleNodeOptions as ToggleNodeOptions_alias_1 }
|
664
659
|
|
660
|
+
declare type Tuple5<T> = [T, T, T, T, T];
|
661
|
+
|
662
|
+
declare function union<E extends Extension | Extension[]>(extension: E): SimplifyExtension<E>;
|
663
|
+
export { union }
|
664
|
+
export { union as union_alias_1 }
|
665
|
+
|
665
666
|
export declare function uniqPush<T>(prev: readonly T[], next: readonly T[]): T[];
|
666
667
|
|
667
668
|
export declare function uniqRemove<T>(prev: T[], next: T[]): T[];
|
668
669
|
|
669
|
-
export declare function updateExtension(prevInputs:
|
670
|
-
schemaInput:
|
671
|
-
stateInput:
|
672
|
-
viewInput:
|
673
|
-
commandInput:
|
670
|
+
export declare function updateExtension(prevInputs: Payloads, prevConverters: Converters, extension: Extension, mode: 'add' | 'remove'): {
|
671
|
+
schemaInput: SchemaPayload | null;
|
672
|
+
stateInput: StatePayload | null;
|
673
|
+
viewInput: ViewPayload | null;
|
674
|
+
commandInput: CommandCreators | null;
|
674
675
|
};
|
675
676
|
|
676
|
-
declare
|
677
|
-
export { ViewProps }
|
678
|
-
export { ViewProps as ViewProps_alias_1 }
|
677
|
+
export declare const viewFacet: Facet<ViewPayload, ViewPayload>;
|
679
678
|
|
680
|
-
export declare
|
679
|
+
export declare type ViewPayload = Omit<DirectEditorProps, 'state'>;
|
681
680
|
|
682
681
|
export declare function voidFunction(): void;
|
683
682
|
|
package/dist/prosekit-core.d.ts
CHANGED
@@ -10,31 +10,33 @@ export { EditorOptions } from './_tsup-dts-rollup';
|
|
10
10
|
export { Facet } from './_tsup-dts-rollup';
|
11
11
|
export { FacetExtension } from './_tsup-dts-rollup';
|
12
12
|
export { FacetOptions } from './_tsup-dts-rollup';
|
13
|
-
export {
|
13
|
+
export { union } from './_tsup-dts-rollup';
|
14
14
|
export { withPriority } from './_tsup-dts-rollup';
|
15
15
|
export { ProseKitError_alias_1 as ProseKitError } from './_tsup-dts-rollup';
|
16
|
-
export {
|
17
|
-
export {
|
18
|
-
export {
|
16
|
+
export { defineBaseCommands } from './_tsup-dts-rollup';
|
17
|
+
export { defineCommands } from './_tsup-dts-rollup';
|
18
|
+
export { defineDefaultState } from './_tsup-dts-rollup';
|
19
19
|
export { DefaultStateOptions } from './_tsup-dts-rollup';
|
20
|
-
export {
|
21
|
-
export {
|
22
|
-
export {
|
23
|
-
export {
|
24
|
-
export {
|
25
|
-
export {
|
20
|
+
export { defineDoc } from './_tsup-dts-rollup';
|
21
|
+
export { defineEventHandler } from './_tsup-dts-rollup';
|
22
|
+
export { defineHistory } from './_tsup-dts-rollup';
|
23
|
+
export { defineInputRule } from './_tsup-dts-rollup';
|
24
|
+
export { defineBaseKeymap } from './_tsup-dts-rollup';
|
25
|
+
export { defineKeymap } from './_tsup-dts-rollup';
|
26
26
|
export { Keymap } from './_tsup-dts-rollup';
|
27
|
-
export {
|
27
|
+
export { defineMarkSpec } from './_tsup-dts-rollup';
|
28
28
|
export { MarkSpecOptions } from './_tsup-dts-rollup';
|
29
|
-
export {
|
29
|
+
export { defineNodeSpec } from './_tsup-dts-rollup';
|
30
30
|
export { NodeSpecOptions } from './_tsup-dts-rollup';
|
31
|
-
export {
|
31
|
+
export { defineNodeView } from './_tsup-dts-rollup';
|
32
32
|
export { NodeViewOptions } from './_tsup-dts-rollup';
|
33
|
-
export {
|
34
|
-
export {
|
33
|
+
export { defineNodeViewEffect } from './_tsup-dts-rollup';
|
34
|
+
export { NodeViewEffectOptions } from './_tsup-dts-rollup';
|
35
|
+
export { defineParagraph } from './_tsup-dts-rollup';
|
36
|
+
export { definePlugin } from './_tsup-dts-rollup';
|
35
37
|
export { pluginFacet } from './_tsup-dts-rollup';
|
36
|
-
export {
|
37
|
-
export {
|
38
|
+
export { PluginPayload } from './_tsup-dts-rollup';
|
39
|
+
export { defineText } from './_tsup-dts-rollup';
|
38
40
|
export { CommandArgs } from './_tsup-dts-rollup';
|
39
41
|
export { Extension } from './_tsup-dts-rollup';
|
40
42
|
export { ExtractCommandAppliers } from './_tsup-dts-rollup';
|
@@ -50,6 +52,3 @@ export { Priority } from './_tsup-dts-rollup';
|
|
50
52
|
export { SimplifyUnion } from './_tsup-dts-rollup';
|
51
53
|
export { getMarkType } from './_tsup-dts-rollup';
|
52
54
|
export { getNodeType } from './_tsup-dts-rollup';
|
53
|
-
export { StateConfigContext } from './_tsup-dts-rollup';
|
54
|
-
export { StateConfigCallback } from './_tsup-dts-rollup';
|
55
|
-
export { ViewProps } from './_tsup-dts-rollup';
|