@prosekit/core 0.0.0-next-20240724155246 → 0.0.0-next-20240724173606
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 +140 -189
- package/dist/prosekit-core.d.ts +8 -0
- package/dist/prosekit-core.js +5 -6
- package/package.json +2 -2
@@ -148,6 +148,27 @@ declare type AttrSpec<AttrType = any> = {
|
|
148
148
|
export { AttrSpec }
|
149
149
|
export { AttrSpec as AttrSpec_alias_1 }
|
150
150
|
|
151
|
+
/**
|
152
|
+
* @internal
|
153
|
+
*/
|
154
|
+
declare type BaseCommandsExtension = Extension<{
|
155
|
+
Commands: {
|
156
|
+
insertText: [options: InsertTextOptions];
|
157
|
+
insertNode: [options: InsertNodeOptions];
|
158
|
+
removeNode: [options: RemoveNodeOptions];
|
159
|
+
wrap: [options: WrapOptions];
|
160
|
+
setBlockType: [options: SetBlockTypeOptions];
|
161
|
+
setNodeAttrs: [options: SetNodeAttrsOptions];
|
162
|
+
selectAll: [];
|
163
|
+
addMark: [options: AddMarkOptions];
|
164
|
+
removeMark: [options: RemoveMarkOptions];
|
165
|
+
unsetBlockType: [options?: UnsetBlockTypeOptions];
|
166
|
+
unsetMark: [options?: UnsetMarkOptions];
|
167
|
+
};
|
168
|
+
}>;
|
169
|
+
export { BaseCommandsExtension }
|
170
|
+
export { BaseCommandsExtension as BaseCommandsExtension_alias_1 }
|
171
|
+
|
151
172
|
/**
|
152
173
|
* @internal
|
153
174
|
*/
|
@@ -171,6 +192,17 @@ export declare abstract class BaseExtension<T extends ExtensionTyping = Extensio
|
|
171
192
|
get schema(): Schema | null;
|
172
193
|
}
|
173
194
|
|
195
|
+
/**
|
196
|
+
* @internal
|
197
|
+
*/
|
198
|
+
declare type BaseKeymapExtension = Extension<{
|
199
|
+
Nodes: never;
|
200
|
+
Commands: never;
|
201
|
+
Keymap: never;
|
202
|
+
}>;
|
203
|
+
export { BaseKeymapExtension }
|
204
|
+
export { BaseKeymapExtension as BaseKeymapExtension_alias_1 }
|
205
|
+
|
174
206
|
/**
|
175
207
|
* Some basic props for custom node views.
|
176
208
|
*
|
@@ -348,27 +380,7 @@ export { DefaultStateOptions as DefaultStateOptions_alias_1 }
|
|
348
380
|
*
|
349
381
|
* @public
|
350
382
|
*/
|
351
|
-
declare function defineBaseCommands():
|
352
|
-
Commands: {
|
353
|
-
insertText: [{
|
354
|
-
text: string;
|
355
|
-
from?: number;
|
356
|
-
to?: number;
|
357
|
-
}];
|
358
|
-
insertNode: [options: InsertNodeOptions];
|
359
|
-
removeNode: [options: RemoveNodeOptions];
|
360
|
-
wrap: [WrapOptions];
|
361
|
-
setBlockType: [options: SetBlockTypeOptions];
|
362
|
-
setNodeAttrs: [options: SetNodeAttrsOptions];
|
363
|
-
selectAll: [];
|
364
|
-
addMark: [options: AddMarkOptions];
|
365
|
-
removeMark: [options: RemoveMarkOptions];
|
366
|
-
unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
|
367
|
-
unsetMark: [options?: UnsetMarkOptions | undefined];
|
368
|
-
};
|
369
|
-
Nodes: never;
|
370
|
-
Marks: never;
|
371
|
-
}>;
|
383
|
+
declare function defineBaseCommands(): BaseCommandsExtension;
|
372
384
|
export { defineBaseCommands }
|
373
385
|
export { defineBaseCommands as defineBaseCommands_alias_1 }
|
374
386
|
|
@@ -384,7 +396,7 @@ declare function defineBaseKeymap(options?: {
|
|
384
396
|
* @default Priority.low
|
385
397
|
*/
|
386
398
|
priority?: Priority;
|
387
|
-
}):
|
399
|
+
}): BaseKeymapExtension;
|
388
400
|
export { defineBaseKeymap }
|
389
401
|
export { defineBaseKeymap as defineBaseKeymap_alias_1 }
|
390
402
|
|
@@ -410,8 +422,6 @@ declare function defineCommands<T extends Record<string, CommandCreator> = Recor
|
|
410
422
|
Commands: {
|
411
423
|
[K in keyof T]: Parameters<T[K]>;
|
412
424
|
};
|
413
|
-
Nodes: never;
|
414
|
-
Marks: never;
|
415
425
|
}>;
|
416
426
|
export { defineCommands }
|
417
427
|
export { defineCommands as defineCommands_alias_1 }
|
@@ -423,13 +433,7 @@ export { defineDefaultState as defineDefaultState_alias_1 }
|
|
423
433
|
/**
|
424
434
|
* @public
|
425
435
|
*/
|
426
|
-
declare function defineDoc():
|
427
|
-
Nodes: {
|
428
|
-
doc: Attrs_2;
|
429
|
-
};
|
430
|
-
Marks: never;
|
431
|
-
Commands: never;
|
432
|
-
}>;
|
436
|
+
declare function defineDoc(): DocExtension;
|
433
437
|
export { defineDoc }
|
434
438
|
export { defineDoc as defineDoc_alias_1 }
|
435
439
|
|
@@ -526,14 +530,7 @@ export { defineFocusChangeHandler as defineFocusChangeHandler_alias_1 }
|
|
526
530
|
*
|
527
531
|
* @public
|
528
532
|
*/
|
529
|
-
declare function defineHistory({ depth, newGroupDelay, }?: HistoryOptions):
|
530
|
-
Commands: {
|
531
|
-
readonly undo: [];
|
532
|
-
readonly redo: [];
|
533
|
-
};
|
534
|
-
Nodes: never;
|
535
|
-
Marks: never;
|
536
|
-
}>]>;
|
533
|
+
declare function defineHistory({ depth, newGroupDelay, }?: HistoryOptions): HistoryExtension;
|
537
534
|
export { defineHistory }
|
538
535
|
export { defineHistory as defineHistory_alias_1 }
|
539
536
|
|
@@ -566,11 +563,9 @@ export { defineKeyPressHandler as defineKeyPressHandler_alias_1 }
|
|
566
563
|
* @public
|
567
564
|
*/
|
568
565
|
declare function defineMarkAttr<MarkType extends string = string, AttrName extends string = string, AttrType = any>(options: MarkAttrOptions<MarkType, AttrName, AttrType>): Extension<{
|
569
|
-
Nodes: never;
|
570
566
|
Marks: {
|
571
567
|
[K in MarkType]: AttrType;
|
572
568
|
};
|
573
|
-
Commands: never;
|
574
569
|
}>;
|
575
570
|
export { defineMarkAttr }
|
576
571
|
export { defineMarkAttr as defineMarkAttr_alias_1 }
|
@@ -582,8 +577,6 @@ declare function defineMarkSpec<Mark extends string, Attrs extends AnyAttrs = An
|
|
582
577
|
Marks: {
|
583
578
|
[K in Mark]: Attrs;
|
584
579
|
};
|
585
|
-
Nodes: never;
|
586
|
-
Commands: never;
|
587
580
|
}>;
|
588
581
|
export { defineMarkSpec }
|
589
582
|
export { defineMarkSpec as defineMarkSpec_alias_1 }
|
@@ -608,8 +601,6 @@ declare function defineNodeAttr<NodeType extends string = string, AttrName exten
|
|
608
601
|
[K in AttrName]: AttrType;
|
609
602
|
};
|
610
603
|
};
|
611
|
-
Marks: never;
|
612
|
-
Commands: never;
|
613
604
|
}>;
|
614
605
|
export { defineNodeAttr }
|
615
606
|
export { defineNodeAttr as defineNodeAttr_alias_1 }
|
@@ -623,8 +614,6 @@ declare function defineNodeSpec<Node extends string, Attrs extends AnyAttrs = An
|
|
623
614
|
Nodes: {
|
624
615
|
[K in Node]: Attrs;
|
625
616
|
};
|
626
|
-
Marks: never;
|
627
|
-
Commands: never;
|
628
617
|
}>;
|
629
618
|
export { defineNodeSpec }
|
630
619
|
export { defineNodeSpec as defineNodeSpec_alias_1 }
|
@@ -652,13 +641,7 @@ export { defineNodeViewFactory as defineNodeViewFactory_alias_1 }
|
|
652
641
|
*
|
653
642
|
* Defines a paragraph node spec as the highest priority, because it should be the default block node for most cases.
|
654
643
|
*/
|
655
|
-
declare function defineParagraph():
|
656
|
-
Nodes: {
|
657
|
-
paragraph: Attrs_2;
|
658
|
-
};
|
659
|
-
Marks: never;
|
660
|
-
Commands: never;
|
661
|
-
}>;
|
644
|
+
declare function defineParagraph(): ParagraphExtension;
|
662
645
|
export { defineParagraph }
|
663
646
|
export { defineParagraph as defineParagraph_alias_1 }
|
664
647
|
|
@@ -667,13 +650,7 @@ export { defineParagraph as defineParagraph_alias_1 }
|
|
667
650
|
*
|
668
651
|
* Defines a paragraph node spec.
|
669
652
|
*/
|
670
|
-
export declare function defineParagraphSpec():
|
671
|
-
Nodes: {
|
672
|
-
paragraph: Attrs_2;
|
673
|
-
};
|
674
|
-
Marks: never;
|
675
|
-
Commands: never;
|
676
|
-
}>;
|
653
|
+
export declare function defineParagraphSpec(): ParagraphSpecExtension;
|
677
654
|
|
678
655
|
/**
|
679
656
|
* @public
|
@@ -694,7 +671,7 @@ export { definePasteHandler as definePasteHandler_alias_1 }
|
|
694
671
|
*/
|
695
672
|
declare function definePlugin(plugin: Plugin_2 | Plugin_2[] | ((context: {
|
696
673
|
schema: Schema;
|
697
|
-
}) => Plugin_2 | Plugin_2[])):
|
674
|
+
}) => Plugin_2 | Plugin_2[])): PluginExtension;
|
698
675
|
export { definePlugin }
|
699
676
|
export { definePlugin as definePlugin_alias_1 }
|
700
677
|
|
@@ -710,89 +687,34 @@ export { defineScrollToSelectionHandler as defineScrollToSelectionHandler_alias_
|
|
710
687
|
/**
|
711
688
|
* @internal
|
712
689
|
*/
|
713
|
-
export declare function defineTestExtension():
|
714
|
-
Commands: {
|
715
|
-
insertText: [{
|
716
|
-
text: string;
|
717
|
-
from?: number;
|
718
|
-
to?: number;
|
719
|
-
}];
|
720
|
-
insertNode: [options: InsertNodeOptions];
|
721
|
-
removeNode: [options: RemoveNodeOptions];
|
722
|
-
wrap: [WrapOptions];
|
723
|
-
setBlockType: [options: SetBlockTypeOptions];
|
724
|
-
setNodeAttrs: [options: SetNodeAttrsOptions];
|
725
|
-
selectAll: [];
|
726
|
-
addMark: [options: AddMarkOptions];
|
727
|
-
removeMark: [options: RemoveMarkOptions];
|
728
|
-
unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
|
729
|
-
unsetMark: [options?: UnsetMarkOptions | undefined];
|
730
|
-
};
|
731
|
-
Nodes: never;
|
732
|
-
Marks: never;
|
733
|
-
}>, Extension<ExtensionTyping<any, any, any>>, Extension<{
|
734
|
-
Nodes: {
|
735
|
-
doc: Attrs_2;
|
736
|
-
};
|
737
|
-
Marks: never;
|
738
|
-
Commands: never;
|
739
|
-
}>, UnionExtension<readonly [Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
|
740
|
-
Commands: {
|
741
|
-
readonly undo: [];
|
742
|
-
readonly redo: [];
|
743
|
-
};
|
744
|
-
Nodes: never;
|
745
|
-
Marks: never;
|
746
|
-
}>]>, Extension<{
|
690
|
+
export declare function defineTestExtension(): Union<readonly [BaseCommandsExtension, BaseKeymapExtension, DocExtension, HistoryExtension, Extension<{
|
747
691
|
Nodes: {
|
748
692
|
paragraph: Attrs_2;
|
749
693
|
};
|
750
|
-
|
751
|
-
Commands: never;
|
752
|
-
}>, Extension<{
|
753
|
-
Nodes: {
|
754
|
-
text: Attrs_2;
|
755
|
-
};
|
756
|
-
Marks: never;
|
757
|
-
Commands: never;
|
758
|
-
}>, Extension<{
|
694
|
+
}>, TextExtension, Extension<{
|
759
695
|
Marks: {
|
760
696
|
bold: Attrs_2;
|
761
697
|
};
|
762
|
-
Nodes: never;
|
763
|
-
Commands: never;
|
764
698
|
}>, Extension<{
|
765
699
|
Marks: {
|
766
700
|
italic: Attrs_2;
|
767
701
|
};
|
768
|
-
Nodes: never;
|
769
|
-
Commands: never;
|
770
702
|
}>, Extension<{
|
771
703
|
Nodes: {
|
772
704
|
heading: Attrs_2;
|
773
705
|
};
|
774
|
-
Marks: never;
|
775
|
-
Commands: never;
|
776
706
|
}>, Extension<{
|
777
707
|
Nodes: {
|
778
708
|
codeBlock: {
|
779
709
|
language: string;
|
780
710
|
};
|
781
711
|
};
|
782
|
-
Marks: never;
|
783
|
-
Commands: never;
|
784
712
|
}>]>;
|
785
713
|
|
786
714
|
/**
|
787
715
|
* @public
|
788
716
|
*/
|
789
|
-
declare function defineText():
|
790
|
-
Nodes: {
|
791
|
-
text: Attrs_2;
|
792
|
-
};
|
793
|
-
Marks: never;
|
794
|
-
Commands: never;
|
795
|
-
}>;
|
717
|
+
declare function defineText(): TextExtension;
|
796
718
|
export { defineText }
|
797
719
|
export { defineText as defineText_alias_1 }
|
798
720
|
|
@@ -853,6 +775,17 @@ declare type DocChangeHandler = (view: EditorView, prevState: EditorState) => vo
|
|
853
775
|
export { DocChangeHandler }
|
854
776
|
export { DocChangeHandler as DocChangeHandler_alias_1 }
|
855
777
|
|
778
|
+
/**
|
779
|
+
* @internal
|
780
|
+
*/
|
781
|
+
declare type DocExtension = Extension<{
|
782
|
+
Nodes: {
|
783
|
+
doc: Attrs;
|
784
|
+
};
|
785
|
+
}>;
|
786
|
+
export { DocExtension }
|
787
|
+
export { DocExtension as DocExtension_alias_1 }
|
788
|
+
|
856
789
|
/**
|
857
790
|
* @internal
|
858
791
|
*/
|
@@ -1126,9 +1059,9 @@ export { Extension as Extension_alias_1 }
|
|
1126
1059
|
* @internal
|
1127
1060
|
*/
|
1128
1061
|
declare interface ExtensionTyping<N extends NodeTyping | never = never, M extends MarkTyping | never = never, C extends CommandTyping | never = never> {
|
1129
|
-
Nodes
|
1130
|
-
Marks
|
1131
|
-
Commands
|
1062
|
+
Nodes?: N;
|
1063
|
+
Marks?: M;
|
1064
|
+
Commands?: C;
|
1132
1065
|
}
|
1133
1066
|
export { ExtensionTyping }
|
1134
1067
|
export { ExtensionTyping as ExtensionTyping_alias_1 }
|
@@ -1347,6 +1280,18 @@ export declare type GroupedEntries<T extends Record<string, any>> = {
|
|
1347
1280
|
|
1348
1281
|
export declare function groupEntries<T extends Record<string, any>>(entries: ObjectEntries<T>[]): GroupedEntries<T>;
|
1349
1282
|
|
1283
|
+
/**
|
1284
|
+
* @internal
|
1285
|
+
*/
|
1286
|
+
declare type HistoryExtension = Extension<{
|
1287
|
+
Commands: {
|
1288
|
+
undo: [];
|
1289
|
+
redo: [];
|
1290
|
+
};
|
1291
|
+
}>;
|
1292
|
+
export { HistoryExtension }
|
1293
|
+
export { HistoryExtension as HistoryExtension_alias_1 }
|
1294
|
+
|
1350
1295
|
/**
|
1351
1296
|
* Options for {@link defineHistory}.
|
1352
1297
|
*
|
@@ -1441,11 +1386,16 @@ export { InsertNodeOptions as InsertNodeOptions_alias_1 }
|
|
1441
1386
|
*
|
1442
1387
|
* @public
|
1443
1388
|
*/
|
1444
|
-
export declare function insertText({ text, from, to
|
1389
|
+
export declare function insertText({ text, from, to }: InsertTextOptions): Command;
|
1390
|
+
|
1391
|
+
/**
|
1392
|
+
* @public
|
1393
|
+
*/
|
1394
|
+
export declare type InsertTextOptions = {
|
1445
1395
|
text: string;
|
1446
1396
|
from?: number;
|
1447
1397
|
to?: number;
|
1448
|
-
}
|
1398
|
+
};
|
1449
1399
|
|
1450
1400
|
/**
|
1451
1401
|
* @internal
|
@@ -1914,6 +1864,22 @@ export declare type ObjectEntries<T extends Record<string, any>> = {
|
|
1914
1864
|
|
1915
1865
|
export declare function objectEqual<T>(a: T, b: T): boolean;
|
1916
1866
|
|
1867
|
+
/**
|
1868
|
+
* @internal
|
1869
|
+
*/
|
1870
|
+
declare type ParagraphExtension = ParagraphSpecExtension;
|
1871
|
+
export { ParagraphExtension }
|
1872
|
+
export { ParagraphExtension as ParagraphExtension_alias_1 }
|
1873
|
+
|
1874
|
+
/**
|
1875
|
+
* @internal
|
1876
|
+
*/
|
1877
|
+
declare type ParagraphSpecExtension = Extension<{
|
1878
|
+
Nodes: {
|
1879
|
+
paragraph: Attrs;
|
1880
|
+
};
|
1881
|
+
}>;
|
1882
|
+
|
1917
1883
|
declare type PasteHandler = (view: EditorView, event: ClipboardEvent, slice: Slice) => boolean | void;
|
1918
1884
|
export { PasteHandler }
|
1919
1885
|
export { PasteHandler as PasteHandler_alias_1 }
|
@@ -1935,6 +1901,17 @@ declare type PickSubType<Type, ParentType> = Type extends ParentType ? [ParentTy
|
|
1935
1901
|
export { PickSubType }
|
1936
1902
|
export { PickSubType as PickSubType_alias_1 }
|
1937
1903
|
|
1904
|
+
/**
|
1905
|
+
* @internal
|
1906
|
+
*/
|
1907
|
+
declare type PluginExtension = Extension<{
|
1908
|
+
Nodes: never;
|
1909
|
+
Marks: never;
|
1910
|
+
Commands: never;
|
1911
|
+
}>;
|
1912
|
+
export { PluginExtension }
|
1913
|
+
export { PluginExtension as PluginExtension_alias_1 }
|
1914
|
+
|
1938
1915
|
/**
|
1939
1916
|
* @internal
|
1940
1917
|
*/
|
@@ -2150,83 +2127,34 @@ export declare function setupEditorExtension<E extends Extension>(options: Edito
|
|
2150
2127
|
* @internal
|
2151
2128
|
*/
|
2152
2129
|
export declare function setupTest(): {
|
2153
|
-
editor: TestEditor<
|
2154
|
-
Commands: {
|
2155
|
-
insertText: [{
|
2156
|
-
text: string;
|
2157
|
-
from?: number;
|
2158
|
-
to?: number;
|
2159
|
-
}];
|
2160
|
-
insertNode: [options: InsertNodeOptions];
|
2161
|
-
removeNode: [options: RemoveNodeOptions];
|
2162
|
-
wrap: [WrapOptions];
|
2163
|
-
setBlockType: [options: SetBlockTypeOptions];
|
2164
|
-
setNodeAttrs: [options: SetNodeAttrsOptions];
|
2165
|
-
selectAll: [];
|
2166
|
-
addMark: [options: AddMarkOptions];
|
2167
|
-
removeMark: [options: RemoveMarkOptions];
|
2168
|
-
unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
|
2169
|
-
unsetMark: [options?: UnsetMarkOptions | undefined];
|
2170
|
-
};
|
2171
|
-
Nodes: never;
|
2172
|
-
Marks: never;
|
2173
|
-
}>, Extension<ExtensionTyping<any, any, any>>, Extension<{
|
2174
|
-
Nodes: {
|
2175
|
-
doc: Attrs_2;
|
2176
|
-
};
|
2177
|
-
Marks: never;
|
2178
|
-
Commands: never;
|
2179
|
-
}>, UnionExtension<readonly [Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
|
2180
|
-
Commands: {
|
2181
|
-
readonly undo: [];
|
2182
|
-
readonly redo: [];
|
2183
|
-
};
|
2184
|
-
Nodes: never;
|
2185
|
-
Marks: never;
|
2186
|
-
}>]>, Extension<{
|
2130
|
+
editor: TestEditor<Union<readonly [BaseCommandsExtension, BaseKeymapExtension, DocExtension, HistoryExtension, Extension<{
|
2187
2131
|
Nodes: {
|
2188
2132
|
paragraph: Attrs_2;
|
2189
2133
|
};
|
2190
|
-
|
2191
|
-
Commands: never;
|
2192
|
-
}>, Extension<{
|
2193
|
-
Nodes: {
|
2194
|
-
text: Attrs_2;
|
2195
|
-
};
|
2196
|
-
Marks: never;
|
2197
|
-
Commands: never;
|
2198
|
-
}>, Extension<{
|
2134
|
+
}>, TextExtension, Extension<{
|
2199
2135
|
Marks: {
|
2200
2136
|
bold: Attrs_2;
|
2201
2137
|
};
|
2202
|
-
Nodes: never;
|
2203
|
-
Commands: never;
|
2204
2138
|
}>, Extension<{
|
2205
2139
|
Marks: {
|
2206
2140
|
italic: Attrs_2;
|
2207
2141
|
};
|
2208
|
-
Nodes: never;
|
2209
|
-
Commands: never;
|
2210
2142
|
}>, Extension<{
|
2211
2143
|
Nodes: {
|
2212
2144
|
heading: Attrs_2;
|
2213
2145
|
};
|
2214
|
-
Marks: never;
|
2215
|
-
Commands: never;
|
2216
2146
|
}>, Extension<{
|
2217
2147
|
Nodes: {
|
2218
2148
|
codeBlock: {
|
2219
2149
|
language: string;
|
2220
2150
|
};
|
2221
2151
|
};
|
2222
|
-
Marks: never;
|
2223
|
-
Commands: never;
|
2224
2152
|
}>]>>;
|
2225
2153
|
m: ToMarkAction<SimplifyDeeper< {
|
2226
|
-
|
2154
|
+
bold: {
|
2227
2155
|
readonly [x: string]: any;
|
2228
2156
|
};
|
2229
|
-
|
2157
|
+
italic: {
|
2230
2158
|
readonly [x: string]: any;
|
2231
2159
|
};
|
2232
2160
|
}>>;
|
@@ -2234,19 +2162,19 @@ export declare function setupTest(): {
|
|
2234
2162
|
p: NodeAction< {
|
2235
2163
|
readonly [x: string]: any;
|
2236
2164
|
}>;
|
2237
|
-
|
2165
|
+
doc: NodeAction< {
|
2238
2166
|
readonly [x: string]: any;
|
2239
2167
|
}>;
|
2240
|
-
|
2241
|
-
language: string;
|
2242
|
-
}>;
|
2243
|
-
heading: NodeAction< {
|
2168
|
+
paragraph: NodeAction< {
|
2244
2169
|
readonly [x: string]: any;
|
2245
2170
|
}>;
|
2246
2171
|
text: NodeAction< {
|
2247
2172
|
readonly [x: string]: any;
|
2248
2173
|
}>;
|
2249
|
-
|
2174
|
+
codeBlock: NodeAction< {
|
2175
|
+
language: string;
|
2176
|
+
}>;
|
2177
|
+
heading: NodeAction< {
|
2250
2178
|
readonly [x: string]: any;
|
2251
2179
|
}>;
|
2252
2180
|
};
|
@@ -2273,7 +2201,7 @@ export { SimplifyDeeper as SimplifyDeeper_alias_1 }
|
|
2273
2201
|
/**
|
2274
2202
|
* @internal
|
2275
2203
|
*/
|
2276
|
-
declare type SimplifyUnion<T> = Simplify<UnionToIntersection<T>>;
|
2204
|
+
declare type SimplifyUnion<T> = Simplify<UnionToIntersection<T extends undefined ? never : T>>;
|
2277
2205
|
export { SimplifyUnion }
|
2278
2206
|
export { SimplifyUnion as SimplifyUnion_alias_1 }
|
2279
2207
|
|
@@ -2366,6 +2294,17 @@ declare class TestEditor<E extends Extension = Extension> extends Editor<E> {
|
|
2366
2294
|
export { TestEditor }
|
2367
2295
|
export { TestEditor as TestEditor_alias_1 }
|
2368
2296
|
|
2297
|
+
/**
|
2298
|
+
* @internal
|
2299
|
+
*/
|
2300
|
+
declare type TextExtension = Extension<{
|
2301
|
+
Nodes: {
|
2302
|
+
text: Attrs;
|
2303
|
+
};
|
2304
|
+
}>;
|
2305
|
+
export { TextExtension }
|
2306
|
+
export { TextExtension as TextExtension_alias_1 }
|
2307
|
+
|
2369
2308
|
declare type TextInputHandler = (view: EditorView, from: number, to: number, text: string) => boolean | void;
|
2370
2309
|
export { TextInputHandler }
|
2371
2310
|
export { TextInputHandler as TextInputHandler_alias_1 }
|
@@ -2456,6 +2395,17 @@ export { TripleClickOnHandler as TripleClickOnHandler_alias_1 }
|
|
2456
2395
|
*/
|
2457
2396
|
export declare type Tuple5<T> = [T, T, T, T, T];
|
2458
2397
|
|
2398
|
+
/**
|
2399
|
+
* @internal
|
2400
|
+
*/
|
2401
|
+
declare type Union<E extends readonly Extension[]> = Extension<{
|
2402
|
+
Nodes: ExtractNodes<E[number]>;
|
2403
|
+
Marks: ExtractMarks<E[number]>;
|
2404
|
+
Commands: ExtractCommands<E[number]>;
|
2405
|
+
}>;
|
2406
|
+
export { Union }
|
2407
|
+
export { Union as Union_alias_1 }
|
2408
|
+
|
2459
2409
|
/**
|
2460
2410
|
* Merge multiple extensions into one.
|
2461
2411
|
*
|
@@ -2474,20 +2424,21 @@ export declare type Tuple5<T> = [T, T, T, T, T];
|
|
2474
2424
|
*
|
2475
2425
|
* @public
|
2476
2426
|
*/
|
2477
|
-
declare function union<const
|
2427
|
+
declare function union<const E extends readonly Extension[]>(...exts: E): Union<E>;
|
2478
2428
|
|
2479
|
-
declare function union<const
|
2429
|
+
declare function union<const E extends readonly Extension[]>(exts: E): Union<E>;
|
2480
2430
|
export { union }
|
2481
2431
|
export { union as union_alias_1 }
|
2482
2432
|
|
2483
2433
|
/**
|
2434
|
+
* @deprecated Use `Union` instead.
|
2484
2435
|
* @internal
|
2485
2436
|
*/
|
2486
|
-
declare type UnionExtension<E extends readonly Extension[]> = Extension<{
|
2437
|
+
declare type UnionExtension<E extends Extension | readonly Extension[]> = E extends readonly Extension[] ? Extension<{
|
2487
2438
|
Nodes: ExtractNodes<E[number]>;
|
2488
2439
|
Marks: ExtractMarks<E[number]>;
|
2489
2440
|
Commands: ExtractCommands<E[number]>;
|
2490
|
-
}
|
2441
|
+
}> : E;
|
2491
2442
|
export { UnionExtension }
|
2492
2443
|
export { UnionExtension as UnionExtension_alias_1 }
|
2493
2444
|
|
package/dist/prosekit-core.d.ts
CHANGED
@@ -36,9 +36,11 @@ export { EditorNotFoundError_alias_1 as EditorNotFoundError } from './_tsup-dts-
|
|
36
36
|
export { ProseKitError_alias_1 as ProseKitError } from './_tsup-dts-rollup';
|
37
37
|
export { defineBaseCommands } from './_tsup-dts-rollup';
|
38
38
|
export { defineCommands } from './_tsup-dts-rollup';
|
39
|
+
export { BaseCommandsExtension } from './_tsup-dts-rollup';
|
39
40
|
export { defineDefaultState } from './_tsup-dts-rollup';
|
40
41
|
export { DefaultStateOptions } from './_tsup-dts-rollup';
|
41
42
|
export { defineDoc } from './_tsup-dts-rollup';
|
43
|
+
export { DocExtension } from './_tsup-dts-rollup';
|
42
44
|
export { defineDocChangeHandler } from './_tsup-dts-rollup';
|
43
45
|
export { DocChangeHandler } from './_tsup-dts-rollup';
|
44
46
|
export { defineDOMEventHandler } from './_tsup-dts-rollup';
|
@@ -76,12 +78,14 @@ export { MountHandler } from './_tsup-dts-rollup';
|
|
76
78
|
export { UnmountHandler } from './_tsup-dts-rollup';
|
77
79
|
export { UpdateHandler } from './_tsup-dts-rollup';
|
78
80
|
export { defineHistory } from './_tsup-dts-rollup';
|
81
|
+
export { HistoryExtension } from './_tsup-dts-rollup';
|
79
82
|
export { HistoryOptions } from './_tsup-dts-rollup';
|
80
83
|
export { defineKeymap } from './_tsup-dts-rollup';
|
81
84
|
export { keymapFacet } from './_tsup-dts-rollup';
|
82
85
|
export { Keymap } from './_tsup-dts-rollup';
|
83
86
|
export { KeymapPayload } from './_tsup-dts-rollup';
|
84
87
|
export { defineBaseKeymap } from './_tsup-dts-rollup';
|
88
|
+
export { BaseKeymapExtension } from './_tsup-dts-rollup';
|
85
89
|
export { defineMarkAttr } from './_tsup-dts-rollup';
|
86
90
|
export { defineMarkSpec } from './_tsup-dts-rollup';
|
87
91
|
export { MarkAttrOptions } from './_tsup-dts-rollup';
|
@@ -97,10 +101,13 @@ export { defineNodeViewFactory } from './_tsup-dts-rollup';
|
|
97
101
|
export { NodeViewComponentOptions } from './_tsup-dts-rollup';
|
98
102
|
export { NodeViewFactoryOptions } from './_tsup-dts-rollup';
|
99
103
|
export { defineParagraph } from './_tsup-dts-rollup';
|
104
|
+
export { ParagraphExtension } from './_tsup-dts-rollup';
|
100
105
|
export { definePlugin } from './_tsup-dts-rollup';
|
101
106
|
export { pluginFacet } from './_tsup-dts-rollup';
|
107
|
+
export { PluginExtension } from './_tsup-dts-rollup';
|
102
108
|
export { PluginPayload } from './_tsup-dts-rollup';
|
103
109
|
export { defineText } from './_tsup-dts-rollup';
|
110
|
+
export { TextExtension } from './_tsup-dts-rollup';
|
104
111
|
export { defineFacet } from './_tsup-dts-rollup';
|
105
112
|
export { Facet } from './_tsup-dts-rollup';
|
106
113
|
export { defineFacetPayload } from './_tsup-dts-rollup';
|
@@ -116,6 +123,7 @@ export { ExtractMarkActions } from './_tsup-dts-rollup';
|
|
116
123
|
export { ExtractMarks } from './_tsup-dts-rollup';
|
117
124
|
export { ExtractNodeActions } from './_tsup-dts-rollup';
|
118
125
|
export { ExtractNodes } from './_tsup-dts-rollup';
|
126
|
+
export { Union } from './_tsup-dts-rollup';
|
119
127
|
export { UnionExtension } from './_tsup-dts-rollup';
|
120
128
|
export { CommandAction } from './_tsup-dts-rollup';
|
121
129
|
export { CommandTyping } from './_tsup-dts-rollup';
|
package/dist/prosekit-core.js
CHANGED
@@ -453,11 +453,7 @@ function withPriority(extension, priority) {
|
|
453
453
|
}
|
454
454
|
|
455
455
|
// src/commands/insert-text.ts
|
456
|
-
function insertText({
|
457
|
-
text,
|
458
|
-
from,
|
459
|
-
to
|
460
|
-
}) {
|
456
|
+
function insertText({ text, from, to }) {
|
461
457
|
return (state, dispatch) => {
|
462
458
|
if (text) {
|
463
459
|
dispatch == null ? void 0 : dispatch(state.tr.insertText(text, from, to));
|
@@ -1058,7 +1054,10 @@ var customBaseKeymap = {
|
|
1058
1054
|
function defineBaseKeymap(options) {
|
1059
1055
|
var _a;
|
1060
1056
|
const priority = (_a = options == null ? void 0 : options.priority) != null ? _a : 1 /* low */;
|
1061
|
-
return withPriority(
|
1057
|
+
return withPriority(
|
1058
|
+
defineKeymap(customBaseKeymap),
|
1059
|
+
priority
|
1060
|
+
);
|
1062
1061
|
}
|
1063
1062
|
|
1064
1063
|
// src/extensions/mark-spec.ts
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/core",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.0-next-
|
4
|
+
"version": "0.0.0-next-20240724173606",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -44,7 +44,7 @@
|
|
44
44
|
"orderedmap": "^2.1.1",
|
45
45
|
"prosemirror-splittable": "^0.1.1",
|
46
46
|
"type-fest": "^4.23.0",
|
47
|
-
"@prosekit/pm": "^0.0.0-next-
|
47
|
+
"@prosekit/pm": "^0.0.0-next-20240724173606"
|
48
48
|
},
|
49
49
|
"devDependencies": {
|
50
50
|
"tsup": "^8.2.2",
|