@prosekit/core 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.ts +212 -81
- package/dist/prosekit-core.d.ts +8 -1
- package/dist/prosekit-core.js +766 -506
- package/package.json +4 -4
@@ -30,7 +30,7 @@ import { Plugin as Plugin_2 } from '@prosekit/pm/state';
|
|
30
30
|
import { ProseMirrorFragment } from '@prosekit/pm/model';
|
31
31
|
import { ProseMirrorNode } from '@prosekit/pm/model';
|
32
32
|
import { Schema } from '@prosekit/pm/model';
|
33
|
-
import
|
33
|
+
import { SchemaSpec } from '@prosekit/pm/model';
|
34
34
|
import { Selection as Selection_2 } from '@prosekit/pm/state';
|
35
35
|
import { Selection as Selection_3 } from 'prosemirror-state';
|
36
36
|
import type { Simplify } from 'type-fest';
|
@@ -72,6 +72,23 @@ export { addMark as addMark_alias_1 }
|
|
72
72
|
|
73
73
|
export declare function applyAction(operator: Action): Command;
|
74
74
|
|
75
|
+
/**
|
76
|
+
* @internal
|
77
|
+
*/
|
78
|
+
export declare function arrayRemove<T>(array: T[], item: T): void;
|
79
|
+
|
80
|
+
/**
|
81
|
+
* @internal
|
82
|
+
*/
|
83
|
+
export declare function arraySubstract<T>(a: T[], b: T[]): T[];
|
84
|
+
|
85
|
+
/**
|
86
|
+
* @internal
|
87
|
+
*/
|
88
|
+
declare function assert(condition: unknown, message?: string): asserts condition;
|
89
|
+
export { assert }
|
90
|
+
export { assert as assert_alias_1 }
|
91
|
+
|
75
92
|
/**
|
76
93
|
* Utility function assert that two types are equal in tests.
|
77
94
|
*/
|
@@ -79,26 +96,27 @@ export declare function assertTypeEqual<T, U>(_val: IsEqual<T, U>): void;
|
|
79
96
|
|
80
97
|
export declare function attrsMatch(nodeOrMark: ProseMirrorNode | Mark, attrs: Attrs): boolean;
|
81
98
|
|
99
|
+
/**
|
100
|
+
* @internal
|
101
|
+
*/
|
82
102
|
export declare abstract class BaseExtension<T extends ExtensionTyping = ExtensionTyping> implements Extension<T> {
|
83
103
|
extension: Extension | Extension[];
|
84
104
|
priority?: Priority;
|
85
105
|
_type?: T;
|
106
|
+
private trees;
|
86
107
|
/**
|
87
108
|
* @internal
|
88
|
-
*
|
89
|
-
* Whether this extension has payload that can be converted to a schema.
|
90
|
-
*
|
91
|
-
* Notice that this does not mean that the extension has a schema. For
|
92
|
-
* example, a `FacetExtension` with a `schemaFacet` will return `true` for
|
93
|
-
* this property, but will return `null` for `schema`.
|
94
109
|
*/
|
95
|
-
abstract
|
110
|
+
abstract createTree(priority: Priority): FacetNode;
|
111
|
+
/**
|
112
|
+
* @internal
|
113
|
+
*/
|
114
|
+
getTree(priority?: Priority): FacetNode;
|
96
115
|
/**
|
97
116
|
* @internal
|
98
|
-
*
|
99
|
-
* The schema that this extension represents.
|
100
117
|
*/
|
101
|
-
|
118
|
+
findFacetOutput<I, O>(facet: Facet<I, O>): Tuple5<O | null> | null;
|
119
|
+
get schema(): Schema | null;
|
102
120
|
}
|
103
121
|
|
104
122
|
/**
|
@@ -127,6 +145,16 @@ declare interface BaseNodeViewOptions {
|
|
127
145
|
export { BaseNodeViewOptions }
|
128
146
|
export { BaseNodeViewOptions as BaseNodeViewOptions_alias_1 }
|
129
147
|
|
148
|
+
export declare function baseToggleMark(markType: MarkType, attrs?: Attrs | null, options?: {
|
149
|
+
removeWhenPresent: boolean;
|
150
|
+
}): Command;
|
151
|
+
|
152
|
+
export declare function cache<T>(fn: () => T): () => T;
|
153
|
+
|
154
|
+
declare const canUseRegexLookbehind: () => boolean;
|
155
|
+
export { canUseRegexLookbehind }
|
156
|
+
export { canUseRegexLookbehind as canUseRegexLookbehind_alias_1 }
|
157
|
+
|
130
158
|
declare type ClickHandler = (view: EditorView, pos: number, event: MouseEvent) => boolean | void;
|
131
159
|
export { ClickHandler }
|
132
160
|
export { ClickHandler as ClickHandler_alias_1 }
|
@@ -170,14 +198,10 @@ export declare interface CommandCreators {
|
|
170
198
|
[name: string]: CommandCreator;
|
171
199
|
}
|
172
200
|
|
173
|
-
export declare const commandFacet: Facet<CommandCreators,
|
201
|
+
export declare const commandFacet: Facet<CommandCreators, RootPayload>;
|
174
202
|
|
175
203
|
export declare type CommandPayload = CommandCreators;
|
176
204
|
|
177
|
-
export declare type Converters = ConverterTuple[];
|
178
|
-
|
179
|
-
declare type ConverterTuple = Tuple5<FacetConverter | undefined>;
|
180
|
-
|
181
205
|
/**
|
182
206
|
* @public
|
183
207
|
*/
|
@@ -189,6 +213,8 @@ export declare function createMarkBuilder(getState: () => EditorState | null | u
|
|
189
213
|
|
190
214
|
export declare function createNodeBuilder(getState: () => EditorState | null | undefined, type: NodeType): NodeBuilder;
|
191
215
|
|
216
|
+
export declare function deepEquals<T>(a: T, b: T): boolean;
|
217
|
+
|
192
218
|
export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
193
219
|
|
194
220
|
export declare const default_alias_1: {
|
@@ -258,7 +284,7 @@ declare function defineBaseCommands(): Extension<{
|
|
258
284
|
to?: number | undefined;
|
259
285
|
}];
|
260
286
|
setNodeAttrs: [options: {
|
261
|
-
type: string | NodeType_2;
|
287
|
+
type: string | NodeType_2 | string[] | NodeType_2[];
|
262
288
|
attrs: Attrs_2;
|
263
289
|
pos?: number | undefined;
|
264
290
|
}];
|
@@ -380,6 +406,40 @@ declare function defineDropHandler(handler: DropHandler): Extension<ExtensionTyp
|
|
380
406
|
export { defineDropHandler }
|
381
407
|
export { defineDropHandler as defineDropHandler_alias_1 }
|
382
408
|
|
409
|
+
/**
|
410
|
+
* @internal
|
411
|
+
*/
|
412
|
+
declare function defineFacet<Input, Output>(options: {
|
413
|
+
/**
|
414
|
+
* The parent facet in the tree.
|
415
|
+
*/
|
416
|
+
parent: Facet<Output, any>;
|
417
|
+
/**
|
418
|
+
* Set this to true if you only want to keep one facet payload. For example,
|
419
|
+
* this facet corresponds to a ProseMirror plugin with a key.
|
420
|
+
*/
|
421
|
+
singleton?: boolean;
|
422
|
+
/**
|
423
|
+
* A reducer is a function that accepts an array of input and produce a single
|
424
|
+
* output.
|
425
|
+
*/
|
426
|
+
reducer?: FacetReducer<Input, Output>;
|
427
|
+
/**
|
428
|
+
* A callback function that returns a reducer. This is useful if you want to
|
429
|
+
* store something in the closure.
|
430
|
+
*/
|
431
|
+
reduce?: () => FacetReducer<Input, Output>;
|
432
|
+
}): Facet<Input, Output>;
|
433
|
+
export { defineFacet }
|
434
|
+
export { defineFacet as defineFacet_alias_1 }
|
435
|
+
|
436
|
+
/**
|
437
|
+
* @internal
|
438
|
+
*/
|
439
|
+
declare function defineFacetPayload<Input>(facet: Facet<Input, any>, payloads: Input[]): Extension;
|
440
|
+
export { defineFacetPayload }
|
441
|
+
export { defineFacetPayload as defineFacetPayload_alias_1 }
|
442
|
+
|
383
443
|
/**
|
384
444
|
* Registers a event handler that is called when the editor gains or loses focus.
|
385
445
|
*
|
@@ -874,9 +934,11 @@ export declare type ExtractNodesFromTyping<T extends ExtensionTyping> = ExtractK
|
|
874
934
|
export declare type ExtractTyping<E extends Extension> = E extends Extension<infer T> ? T : never;
|
875
935
|
|
876
936
|
/**
|
877
|
-
* @
|
937
|
+
* @internal
|
878
938
|
*/
|
879
939
|
declare class Facet<Input, Output> {
|
940
|
+
private _reducer?;
|
941
|
+
private _reduce?;
|
880
942
|
/**
|
881
943
|
* @internal
|
882
944
|
*/
|
@@ -884,61 +946,61 @@ declare class Facet<Input, Output> {
|
|
884
946
|
/**
|
885
947
|
* @internal
|
886
948
|
*/
|
887
|
-
readonly
|
888
|
-
/**
|
889
|
-
* @internal
|
890
|
-
*/
|
891
|
-
readonly next: Facet<Output, any> | null;
|
949
|
+
readonly parent: Facet<Output, any> | null;
|
892
950
|
/**
|
893
951
|
* @internal
|
894
952
|
*/
|
895
953
|
readonly singleton: boolean;
|
896
954
|
/**
|
955
|
+
* A index path to retrieve the current facet in a tree from the root.
|
956
|
+
*
|
897
957
|
* @internal
|
898
958
|
*/
|
899
|
-
|
900
|
-
private constructor();
|
901
|
-
static define<Input, Output>({ converter, convert, next, singleton, }: FacetOptions<Input, Output>): Facet<Input, Output>;
|
959
|
+
readonly path: number[];
|
902
960
|
/**
|
903
961
|
* @internal
|
904
962
|
*/
|
905
|
-
|
906
|
-
|
963
|
+
constructor(parent: Facet<Output, any> | null, singleton: boolean, _reducer?: FacetReducer<Input, Output> | undefined, _reduce?: (() => FacetReducer<Input, Output>) | undefined);
|
964
|
+
get reducer(): FacetReducer<Input, Output>;
|
907
965
|
}
|
908
966
|
export { Facet }
|
909
967
|
export { Facet as Facet_alias_1 }
|
910
968
|
|
911
969
|
/**
|
912
|
-
* @
|
913
|
-
*/
|
914
|
-
export declare interface FacetConverter<Input = any, Output = any> {
|
915
|
-
create: (inputs: Input[]) => Output;
|
916
|
-
update: (inputs: Input[]) => Output | null;
|
917
|
-
}
|
918
|
-
|
919
|
-
/**
|
920
|
-
* @public
|
970
|
+
* @internal
|
921
971
|
*/
|
922
972
|
export declare class FacetExtensionImpl<Input, Output> extends BaseExtension {
|
923
973
|
readonly facet: Facet<Input, Output>;
|
924
974
|
readonly payloads: Input[];
|
925
975
|
extension: Extension;
|
926
|
-
|
927
|
-
|
976
|
+
/**
|
977
|
+
* @internal
|
978
|
+
*/
|
928
979
|
constructor(facet: Facet<Input, Output>, payloads: Input[]);
|
980
|
+
/**
|
981
|
+
* @internal
|
982
|
+
*/
|
983
|
+
createTree(priority: Priority): FacetNode<any, any>;
|
984
|
+
}
|
985
|
+
|
986
|
+
export declare class FacetNode<I = any, O = any> {
|
987
|
+
readonly facet: Facet<I, O>;
|
988
|
+
readonly inputs: Tuple5<I[] | null>;
|
989
|
+
readonly children: Map<number, FacetNode>;
|
990
|
+
reducers: Tuple5<FacetReducer<I, O> | null>;
|
991
|
+
output: Tuple5<O | null> | null;
|
992
|
+
constructor(facet: Facet<I, O>, inputs?: Tuple5<I[] | null>, children?: Map<number, FacetNode>);
|
993
|
+
private calcOutput;
|
994
|
+
getOutput(): Tuple5<O | null>;
|
995
|
+
getSingletonOutput(): O | null;
|
996
|
+
getRootOutput(): RootOutput;
|
997
|
+
isRoot(): boolean;
|
929
998
|
}
|
930
999
|
|
931
1000
|
/**
|
932
|
-
* @
|
1001
|
+
* @internal
|
933
1002
|
*/
|
934
|
-
declare
|
935
|
-
convert?: (payloads: Input[]) => Output;
|
936
|
-
converter?: () => FacetConverter<Input, Output>;
|
937
|
-
next: Facet<Output, any>;
|
938
|
-
singleton?: boolean;
|
939
|
-
}
|
940
|
-
export { FacetOptions }
|
941
|
-
export { FacetOptions as FacetOptions_alias_1 }
|
1003
|
+
export declare type FacetReducer<Input, Output> = (input: Input[]) => Output;
|
942
1004
|
|
943
1005
|
export declare function findBrowserDocument(options?: {
|
944
1006
|
document?: Document;
|
@@ -969,8 +1031,6 @@ export declare function getBrowserWindow(options?: {
|
|
969
1031
|
|
970
1032
|
export declare function getCustomSelection(state: EditorState, from?: number | null, to?: number | null): Selection_3;
|
971
1033
|
|
972
|
-
export declare function getFacetCount(): number;
|
973
|
-
|
974
1034
|
/**
|
975
1035
|
* Returns a unique id in the current process that can be used in various places.
|
976
1036
|
*
|
@@ -994,6 +1054,11 @@ declare function getNodeType(schema: Schema, type: string | NodeType): NodeType;
|
|
994
1054
|
export { getNodeType }
|
995
1055
|
export { getNodeType as getNodeType_alias_1 }
|
996
1056
|
|
1057
|
+
/**
|
1058
|
+
* @internal
|
1059
|
+
*/
|
1060
|
+
export declare function getNodeTypes(schema: Schema, types: string | NodeType | string[] | NodeType[]): NodeType[];
|
1061
|
+
|
997
1062
|
export declare type GroupedEntries<T extends Record<string, any>> = {
|
998
1063
|
[K in keyof T]?: T[K][];
|
999
1064
|
};
|
@@ -1066,6 +1131,13 @@ declare function isAllSelection(sel: Selection_2): sel is AllSelection;
|
|
1066
1131
|
export { isAllSelection }
|
1067
1132
|
export { isAllSelection as isAllSelection_alias_1 }
|
1068
1133
|
|
1134
|
+
/**
|
1135
|
+
* @private
|
1136
|
+
*/
|
1137
|
+
declare const isApple: boolean;
|
1138
|
+
export { isApple }
|
1139
|
+
export { isApple as isApple_alias_1 }
|
1140
|
+
|
1069
1141
|
export declare function isElement(value: unknown): value is Element;
|
1070
1142
|
|
1071
1143
|
/**
|
@@ -1077,8 +1149,6 @@ declare function isInCodeBlock(selection: Selection_2): boolean | undefined;
|
|
1077
1149
|
export { isInCodeBlock }
|
1078
1150
|
export { isInCodeBlock as isInCodeBlock_alias_1 }
|
1079
1151
|
|
1080
|
-
export declare const isMac: boolean;
|
1081
|
-
|
1082
1152
|
/**
|
1083
1153
|
* @internal
|
1084
1154
|
*/
|
@@ -1086,10 +1156,22 @@ declare function isMark(mark: unknown): mark is Mark;
|
|
1086
1156
|
export { isMark }
|
1087
1157
|
export { isMark as isMark_alias_1 }
|
1088
1158
|
|
1159
|
+
/**
|
1160
|
+
* Returns true if the given mark is missing in some part of the range.
|
1161
|
+
* Returns false if the entire range has the given mark.
|
1162
|
+
*
|
1163
|
+
* @internal
|
1164
|
+
*/
|
1165
|
+
declare function isMarkAbsent(node: ProseMirrorNode, from: number, to: number, markType: MarkType, attrs?: Attrs | null): boolean;
|
1166
|
+
export { isMarkAbsent }
|
1167
|
+
export { isMarkAbsent as isMarkAbsent_alias_1 }
|
1168
|
+
|
1089
1169
|
/**
|
1090
1170
|
* @internal
|
1091
1171
|
*/
|
1092
|
-
|
1172
|
+
declare function isMarkActive(state: EditorState, type: string | MarkType, attrs?: Attrs | null): boolean;
|
1173
|
+
export { isMarkActive }
|
1174
|
+
export { isMarkActive as isMarkActive_alias_1 }
|
1093
1175
|
|
1094
1176
|
export declare function isNodeActive(state: EditorState, type: string | NodeType, attrs?: Attrs | null): boolean;
|
1095
1177
|
|
@@ -1233,6 +1315,13 @@ declare interface MarkSpecOptions<MarkName extends string = string> extends Mark
|
|
1233
1315
|
export { MarkSpecOptions }
|
1234
1316
|
export { MarkSpecOptions as MarkSpecOptions_alias_1 }
|
1235
1317
|
|
1318
|
+
/**
|
1319
|
+
* @internal
|
1320
|
+
*/
|
1321
|
+
declare function maybeRun<T, R = T extends (...args: any[]) => void ? ReturnType<T> : T>(value: T, ...args: T extends (...args: any[]) => void ? Parameters<T> : never): R;
|
1322
|
+
export { maybeRun }
|
1323
|
+
export { maybeRun as maybeRun_alias_1 }
|
1324
|
+
|
1236
1325
|
/**
|
1237
1326
|
* A function that is called when the editor view is mounted.
|
1238
1327
|
*
|
@@ -1262,8 +1351,19 @@ declare interface NodeAttrOptions {
|
|
1262
1351
|
* of a type that has them is created.
|
1263
1352
|
*/
|
1264
1353
|
default?: any;
|
1354
|
+
/**
|
1355
|
+
* Whether the attribute should be kept when the node is split. Set it to
|
1356
|
+
* `true` if you want to inherit the attribute from the previous node when
|
1357
|
+
* splitting the node by pressing `Enter`.
|
1358
|
+
*
|
1359
|
+
* @default undefined
|
1360
|
+
*/
|
1361
|
+
splittable?: boolean;
|
1265
1362
|
/**
|
1266
1363
|
* Returns the attribute key and value to be set on the DOM node.
|
1364
|
+
*
|
1365
|
+
* If the `key` is `"style"`, the value is a string of CSS properties and will
|
1366
|
+
* be prepended to the existing `style` attribute on the DOM node.
|
1267
1367
|
*/
|
1268
1368
|
toDOM?: (value: any) => [key: string, value: string] | null | void;
|
1269
1369
|
/**
|
@@ -1386,11 +1486,10 @@ declare type PasteHandler = (view: EditorView, event: ClipboardEvent, slice: Sli
|
|
1386
1486
|
export { PasteHandler }
|
1387
1487
|
export { PasteHandler as PasteHandler_alias_1 }
|
1388
1488
|
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
declare type PayloadTuple = Tuple5<Payload[]>;
|
1489
|
+
/**
|
1490
|
+
* @internal
|
1491
|
+
*/
|
1492
|
+
export declare type Payloads<T> = Tuple5<T[]>;
|
1394
1493
|
|
1395
1494
|
/**
|
1396
1495
|
* @internal
|
@@ -1402,9 +1501,9 @@ export { pluginFacet as pluginFacet_alias_1 }
|
|
1402
1501
|
/**
|
1403
1502
|
* @internal
|
1404
1503
|
*/
|
1405
|
-
declare type PluginPayload = (context: {
|
1504
|
+
declare type PluginPayload = Plugin_2 | Plugin_2[] | ((context: {
|
1406
1505
|
schema: Schema;
|
1407
|
-
}) => Plugin_2 | Plugin_2[];
|
1506
|
+
}) => Plugin_2 | Plugin_2[]);
|
1408
1507
|
export { PluginPayload }
|
1409
1508
|
export { PluginPayload as PluginPayload_alias_1 }
|
1410
1509
|
|
@@ -1414,11 +1513,11 @@ export { PluginPayload as PluginPayload_alias_1 }
|
|
1414
1513
|
* @public
|
1415
1514
|
*/
|
1416
1515
|
declare enum Priority {
|
1417
|
-
lowest =
|
1418
|
-
low =
|
1516
|
+
lowest = 0,
|
1517
|
+
low = 1,
|
1419
1518
|
default = 2,
|
1420
|
-
high =
|
1421
|
-
highest =
|
1519
|
+
high = 3,
|
1520
|
+
highest = 4
|
1422
1521
|
}
|
1423
1522
|
export { Priority }
|
1424
1523
|
export { Priority as Priority_alias_1 }
|
@@ -1459,9 +1558,27 @@ declare function removeMark(options: {
|
|
1459
1558
|
export { removeMark }
|
1460
1559
|
export { removeMark as removeMark_alias_1 }
|
1461
1560
|
|
1462
|
-
export declare const
|
1561
|
+
export declare const rootFacet: Facet<RootPayload, RootOutput>;
|
1562
|
+
|
1563
|
+
export declare type RootOutput = {
|
1564
|
+
schema?: Schema | null;
|
1565
|
+
commands?: CommandCreators;
|
1566
|
+
state?: EditorStateConfig;
|
1567
|
+
view?: Omit<DirectEditorProps, 'state'>;
|
1568
|
+
};
|
1569
|
+
|
1570
|
+
export declare type RootPayload = {
|
1571
|
+
schema?: Schema | null;
|
1572
|
+
commands?: CommandCreators;
|
1573
|
+
state?: (ctx: {
|
1574
|
+
schema: Schema;
|
1575
|
+
}) => EditorStateConfig;
|
1576
|
+
view?: Omit<DirectEditorProps, 'state'>;
|
1577
|
+
};
|
1578
|
+
|
1579
|
+
export declare const schemaFacet: Facet<SchemaSpec<any, any>, RootPayload>;
|
1463
1580
|
|
1464
|
-
export declare
|
1581
|
+
export declare const schemaSpecFacet: Facet<SchemaSpec<any, any>, SchemaSpec<any, any>>;
|
1465
1582
|
|
1466
1583
|
declare type ScrollToSelectionHandler = (view: EditorView) => boolean;
|
1467
1584
|
export { ScrollToSelectionHandler }
|
@@ -1513,7 +1630,7 @@ declare function setNodeAttrs(options: {
|
|
1513
1630
|
*
|
1514
1631
|
* If current node is not of this type, the command will do nothing.
|
1515
1632
|
*/
|
1516
|
-
type: string | NodeType;
|
1633
|
+
type: string | NodeType | string[] | NodeType[];
|
1517
1634
|
/**
|
1518
1635
|
* The attributes to set.
|
1519
1636
|
*/
|
@@ -1552,7 +1669,14 @@ declare type SimplifyUnion<T> = Simplify<UnionToIntersection<T>>;
|
|
1552
1669
|
export { SimplifyUnion }
|
1553
1670
|
export { SimplifyUnion as SimplifyUnion_alias_1 }
|
1554
1671
|
|
1555
|
-
export declare
|
1672
|
+
export declare function splitBlockAs(splitNode?: (node: ProseMirrorNode, deflt: NodeType | null, atEnd: boolean) => {
|
1673
|
+
type: NodeType;
|
1674
|
+
attrs?: Attrs;
|
1675
|
+
} | null): Command;
|
1676
|
+
|
1677
|
+
export declare const splitBlockEnter: Command;
|
1678
|
+
|
1679
|
+
export declare const stateFacet: Facet<StatePayload, RootPayload>;
|
1556
1680
|
|
1557
1681
|
/**
|
1558
1682
|
* Parse a JSON object to a ProseMirror state.
|
@@ -1585,6 +1709,8 @@ export declare type StatePayload = (ctx: {
|
|
1585
1709
|
schema: Schema;
|
1586
1710
|
}) => EditorStateConfig;
|
1587
1711
|
|
1712
|
+
export declare function subtractFacetNode<I, O>(a: FacetNode<I, O>, b: FacetNode<I, O>): FacetNode<I, O>;
|
1713
|
+
|
1588
1714
|
declare type TextInputHandler = (view: EditorView, from: number, to: number, text: string) => boolean | void;
|
1589
1715
|
export { TextInputHandler }
|
1590
1716
|
export { TextInputHandler as TextInputHandler_alias_1 }
|
@@ -1626,6 +1752,8 @@ declare function toggleNode({ type, attrs, }: {
|
|
1626
1752
|
export { toggleNode }
|
1627
1753
|
export { toggleNode as toggleNode_alias_1 }
|
1628
1754
|
|
1755
|
+
export declare function toReversed<T>(arr: T[]): T[];
|
1756
|
+
|
1629
1757
|
declare type TripleClickHandler = (view: EditorView, pos: number, event: MouseEvent) => boolean | void;
|
1630
1758
|
export { TripleClickHandler }
|
1631
1759
|
export { TripleClickHandler as TripleClickHandler_alias_1 }
|
@@ -1634,7 +1762,10 @@ declare type TripleClickOnHandler = (view: EditorView, pos: number, node: Node_3
|
|
1634
1762
|
export { TripleClickOnHandler }
|
1635
1763
|
export { TripleClickOnHandler as TripleClickOnHandler_alias_1 }
|
1636
1764
|
|
1637
|
-
|
1765
|
+
/**
|
1766
|
+
* @internal
|
1767
|
+
*/
|
1768
|
+
export declare type Tuple5<T> = [T, T, T, T, T];
|
1638
1769
|
|
1639
1770
|
/**
|
1640
1771
|
* Merge multiple extensions into one.
|
@@ -1647,13 +1778,18 @@ export { union as union_alias_1 }
|
|
1647
1778
|
|
1648
1779
|
export declare class UnionExtensionImpl<T extends ExtensionTyping = ExtensionTyping> extends BaseExtension<T> implements Extension<T> {
|
1649
1780
|
extension: BaseExtension[];
|
1650
|
-
|
1651
|
-
|
1781
|
+
/**
|
1782
|
+
* @internal
|
1783
|
+
*/
|
1652
1784
|
constructor(extension?: BaseExtension[]);
|
1653
|
-
|
1654
|
-
|
1785
|
+
/**
|
1786
|
+
* @internal
|
1787
|
+
*/
|
1788
|
+
createTree(priority: Priority): FacetNode;
|
1655
1789
|
}
|
1656
1790
|
|
1791
|
+
export declare function unionFacetNode<I, O>(a: FacetNode<I, O>, b: FacetNode<I, O>): FacetNode<I, O>;
|
1792
|
+
|
1657
1793
|
export declare function uniqPush<T>(prev: readonly T[], next: readonly T[]): T[];
|
1658
1794
|
|
1659
1795
|
export declare function uniqRemove<T>(prev: T[], next: T[]): T[];
|
@@ -1667,13 +1803,6 @@ declare type UnmountHandler = () => void;
|
|
1667
1803
|
export { UnmountHandler }
|
1668
1804
|
export { UnmountHandler as UnmountHandler_alias_1 }
|
1669
1805
|
|
1670
|
-
export declare function updateExtension(prevInputs: Payloads, prevConverters: Converters, extension: Extension, mode: 'add' | 'remove'): {
|
1671
|
-
schemaInput: SchemaPayload | null;
|
1672
|
-
stateInput: StatePayload | null;
|
1673
|
-
viewInput: ViewPayload | null;
|
1674
|
-
commandInput: CommandCreators | null;
|
1675
|
-
};
|
1676
|
-
|
1677
1806
|
/**
|
1678
1807
|
* A function that is called when the editor state is updated.
|
1679
1808
|
*
|
@@ -1686,7 +1815,7 @@ declare type UpdateHandler = (view: EditorView, prevState: EditorState) => void;
|
|
1686
1815
|
export { UpdateHandler }
|
1687
1816
|
export { UpdateHandler as UpdateHandler_alias_1 }
|
1688
1817
|
|
1689
|
-
export declare const viewFacet: Facet<ViewPayload,
|
1818
|
+
export declare const viewFacet: Facet<ViewPayload, RootPayload>;
|
1690
1819
|
|
1691
1820
|
export declare type ViewPayload = Omit<DirectEditorProps, 'state'>;
|
1692
1821
|
|
@@ -1717,4 +1846,6 @@ export declare function wrap({ nodeType, attrs, }: {
|
|
1717
1846
|
attrs?: Attrs | null;
|
1718
1847
|
}): Command;
|
1719
1848
|
|
1849
|
+
export declare function zip<T, P>(a: T[], b: P[]): [T, P][];
|
1850
|
+
|
1720
1851
|
export { }
|
package/dist/prosekit-core.d.ts
CHANGED
@@ -77,8 +77,9 @@ export { definePlugin } from './_tsup-dts-rollup';
|
|
77
77
|
export { pluginFacet } from './_tsup-dts-rollup';
|
78
78
|
export { PluginPayload } from './_tsup-dts-rollup';
|
79
79
|
export { defineText } from './_tsup-dts-rollup';
|
80
|
+
export { defineFacet } from './_tsup-dts-rollup';
|
80
81
|
export { Facet } from './_tsup-dts-rollup';
|
81
|
-
export {
|
82
|
+
export { defineFacetPayload } from './_tsup-dts-rollup';
|
82
83
|
export { BaseNodeViewOptions } from './_tsup-dts-rollup';
|
83
84
|
export { CommandArgs } from './_tsup-dts-rollup';
|
84
85
|
export { Extension } from './_tsup-dts-rollup';
|
@@ -93,12 +94,18 @@ export { SelectionJSON } from './_tsup-dts-rollup';
|
|
93
94
|
export { StateJSON } from './_tsup-dts-rollup';
|
94
95
|
export { Priority } from './_tsup-dts-rollup';
|
95
96
|
export { SimplifyUnion } from './_tsup-dts-rollup';
|
97
|
+
export { assert } from './_tsup-dts-rollup';
|
98
|
+
export { canUseRegexLookbehind } from './_tsup-dts-rollup';
|
96
99
|
export { clsx } from './_tsup-dts-rollup';
|
97
100
|
export { defaultBlockAt } from './_tsup-dts-rollup';
|
101
|
+
export { isApple } from './_tsup-dts-rollup';
|
98
102
|
export { _getId } from './_tsup-dts-rollup';
|
99
103
|
export { getMarkType } from './_tsup-dts-rollup';
|
100
104
|
export { getNodeType } from './_tsup-dts-rollup';
|
101
105
|
export { isInCodeBlock } from './_tsup-dts-rollup';
|
106
|
+
export { isMarkAbsent } from './_tsup-dts-rollup';
|
107
|
+
export { isMarkActive } from './_tsup-dts-rollup';
|
108
|
+
export { maybeRun } from './_tsup-dts-rollup';
|
102
109
|
export { elementFromJSON } from './_tsup-dts-rollup';
|
103
110
|
export { elementFromNode } from './_tsup-dts-rollup';
|
104
111
|
export { htmlFromJSON } from './_tsup-dts-rollup';
|