@prosekit/extensions 0.7.23 → 0.8.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 +125 -143
- package/dist/{chunk-TWEOBBYZ.js → chunk-D54VSLLS.js} +1 -1
- package/dist/{chunk-LAQZC3ZM.js → chunk-I2UMHK3L.js} +4 -4
- package/dist/{chunk-KNFGQ3MV.js → chunk-QVFEYPQ6.js} +9 -11
- package/dist/prosekit-extensions-autocomplete.js +6 -9
- package/dist/prosekit-extensions-blockquote.js +2 -2
- package/dist/prosekit-extensions-bold.js +1 -1
- package/dist/prosekit-extensions-code-block.js +2 -2
- package/dist/prosekit-extensions-code.js +2 -1
- package/dist/prosekit-extensions-doc.d.ts +2 -0
- package/dist/prosekit-extensions-doc.js +14 -0
- package/dist/prosekit-extensions-enter-rule.js +1 -1
- package/dist/prosekit-extensions-file.js +2 -4
- package/dist/prosekit-extensions-heading.js +9 -10
- package/dist/prosekit-extensions-horizontal-rule.js +1 -1
- package/dist/prosekit-extensions-input-rule.js +1 -1
- package/dist/prosekit-extensions-italic.js +1 -1
- package/dist/prosekit-extensions-link.js +2 -2
- package/dist/prosekit-extensions-list.d.ts +1 -0
- package/dist/prosekit-extensions-list.js +62 -4
- package/dist/prosekit-extensions-paragraph.d.ts +7 -0
- package/dist/prosekit-extensions-paragraph.js +59 -0
- package/dist/prosekit-extensions-placeholder.js +2 -3
- package/dist/prosekit-extensions-search.js +1 -1
- package/dist/prosekit-extensions-strike.js +1 -1
- package/dist/prosekit-extensions-table.js +1 -1
- package/dist/prosekit-extensions-text.d.ts +2 -0
- package/dist/prosekit-extensions-text.js +13 -0
- package/dist/prosekit-extensions-virtual-selection.js +1 -2
- package/dist/prosekit-extensions-yjs.js +2 -3
- package/dist/shiki-highlighter-chunk.js +3 -5
- package/package.json +41 -16
@@ -1,7 +1,5 @@
|
|
1
1
|
import { Attrs } from '@prosekit/pm/model';
|
2
|
-
import { Attrs as Attrs_2 } from 'prosemirror-model';
|
3
2
|
import type { Awareness } from 'y-protocols/awareness';
|
4
|
-
import { BaseCommandsExtension } from '@prosekit/core';
|
5
3
|
import type { BundledHighlighterOptions } from 'shiki';
|
6
4
|
import { BundledLanguage } from 'shiki';
|
7
5
|
import { BundledLanguageInfo } from 'shiki';
|
@@ -14,18 +12,13 @@ import { Command } from '@prosekit/pm/state';
|
|
14
12
|
import { CursorAwareness } from 'loro-prosemirror';
|
15
13
|
import type { DecorationAttrs } from '@prosekit/pm/view';
|
16
14
|
import { DedentListOptions } from 'prosemirror-flat-list';
|
17
|
-
import { config as default_alias_1 } from '@prosekit/dev/config-vitest';
|
18
|
-
import { DocExtension } from '@prosekit/core';
|
19
15
|
import { EditorState } from '@prosekit/pm/state';
|
20
16
|
import type { EditorView } from '@prosekit/pm/view';
|
21
17
|
import { Extension } from '@prosekit/core';
|
22
18
|
import { ExtensionTyping } from '@prosekit/core';
|
23
|
-
import { ExtractMarkActions } from '@prosekit/core';
|
24
|
-
import { ExtractNodeActions } from '@prosekit/core';
|
25
19
|
import { FindParentNodeResult } from '@prosekit/core';
|
26
20
|
import { GapCursor } from 'prosemirror-gapcursor';
|
27
21
|
import type { Highlighter } from 'shiki';
|
28
|
-
import { HistoryExtension } from '@prosekit/core';
|
29
22
|
import { IndentListOptions } from 'prosemirror-flat-list';
|
30
23
|
import { InputRule } from '@prosekit/pm/inputrules';
|
31
24
|
import type { IsEqual } from 'type-fest';
|
@@ -35,12 +28,8 @@ import type { LoroDocType } from 'loro-prosemirror';
|
|
35
28
|
import { LoroSyncPluginProps } from 'loro-prosemirror';
|
36
29
|
import { LoroUndoPluginProps } from 'loro-prosemirror';
|
37
30
|
import { MarkType } from '@prosekit/pm/model';
|
38
|
-
import { Node as Node_2 } from 'prosemirror-model';
|
39
|
-
import { NodeAction } from '@prosekit/core';
|
40
|
-
import { NodeChild } from '@prosekit/core';
|
41
31
|
import { NodeJSON } from '@prosekit/core';
|
42
32
|
import type { NodeType } from '@prosekit/pm/model';
|
43
|
-
import { Options } from 'tsup';
|
44
33
|
import { Parser } from 'prosemirror-highlight';
|
45
34
|
import type { PeerID } from 'loro-crdt';
|
46
35
|
import { PlainExtension } from '@prosekit/core';
|
@@ -49,13 +38,9 @@ import { PluginKey } from '@prosekit/pm/state';
|
|
49
38
|
import { ProseMirrorNode } from '@prosekit/pm/model';
|
50
39
|
import type { ResolvedPos } from '@prosekit/pm/model';
|
51
40
|
import type { Selection as Selection_2 } from '@prosekit/pm/state';
|
52
|
-
import { SimplifyDeeper } from '@prosekit/core';
|
53
41
|
import type { SpecialLanguage } from 'shiki';
|
54
42
|
import { StepJSON } from '@prosekit/core';
|
55
|
-
import { TestEditor } from '@prosekit/core/test';
|
56
|
-
import { TextExtension } from '@prosekit/core';
|
57
43
|
import { ToggleCollapsedOptions } from 'prosemirror-flat-list';
|
58
|
-
import { ToMarkAction } from '@prosekit/core';
|
59
44
|
import { Transaction } from '@prosekit/pm/state';
|
60
45
|
import { Union } from '@prosekit/core';
|
61
46
|
import { UnwrapListOptions } from 'prosemirror-flat-list';
|
@@ -334,7 +319,7 @@ export declare function createLazyParser(highlighterOptions: HighlighterOptions)
|
|
334
319
|
/**
|
335
320
|
* @internal
|
336
321
|
*/
|
337
|
-
export declare function createMarkInputRule({ regex, type, attrs, }: MarkInputRuleOptions): InputRule;
|
322
|
+
export declare function createMarkInputRule({ regex, type, attrs, inCodeMark, }: MarkInputRuleOptions): InputRule;
|
338
323
|
|
339
324
|
export declare function createOrGetHighlighter(options: HighlighterOptions): HighlighterResult;
|
340
325
|
|
@@ -343,10 +328,6 @@ export declare function createOrGetHighlighter_alias_1(options: HighlighterOptio
|
|
343
328
|
export { DedentListOptions }
|
344
329
|
export { DedentListOptions as DedentListOptions_alias_1 }
|
345
330
|
|
346
|
-
export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
347
|
-
|
348
|
-
export { default_alias_1 }
|
349
|
-
|
350
331
|
export declare function defaultCanMatch({ state }: {
|
351
332
|
state: EditorState;
|
352
333
|
}): boolean;
|
@@ -496,6 +477,11 @@ export { defineCodeBlockKeymap as defineCodeBlockKeymap_alias_1 }
|
|
496
477
|
/**
|
497
478
|
* Adds syntax highlighting to code blocks using the [Shiki](https://github.com/shikijs/shiki) package.
|
498
479
|
*
|
480
|
+
* It will set two CSS variables on the code block elements:
|
481
|
+
*
|
482
|
+
* - `--prosemirror-highlight`: sets text color
|
483
|
+
* - `--prosemirror-highlight-bg`: sets background color
|
484
|
+
*
|
499
485
|
* @param options - The options to configure the Shiki highlighter.
|
500
486
|
*
|
501
487
|
* @public
|
@@ -551,6 +537,11 @@ export declare function defineCommitRecorder(commitRecorder: CommitRecorder): Pl
|
|
551
537
|
*/
|
552
538
|
export declare function defineCommitViewer(commit: Commit): PlainExtension;
|
553
539
|
|
540
|
+
/**
|
541
|
+
* @public
|
542
|
+
*/
|
543
|
+
export declare function defineDoc(): DocExtension;
|
544
|
+
|
554
545
|
/**
|
555
546
|
* Show up a decoration at the drop position when something is dragged over the editor.
|
556
547
|
*
|
@@ -800,6 +791,13 @@ export { defineListPlugins }
|
|
800
791
|
export { defineListPlugins as defineListPlugins_alias_1 }
|
801
792
|
export { defineListPlugins as defineListPlugins_alias_2 }
|
802
793
|
|
794
|
+
/**
|
795
|
+
* @internal
|
796
|
+
*/
|
797
|
+
declare function defineListSerializer(): Extension<ExtensionTyping<any, any, any>>;
|
798
|
+
export { defineListSerializer }
|
799
|
+
export { defineListSerializer as defineListSerializer_alias_1 }
|
800
|
+
|
803
801
|
/**
|
804
802
|
* @internal
|
805
803
|
*/
|
@@ -892,6 +890,41 @@ mention: MentionAttrs;
|
|
892
890
|
*/
|
893
891
|
export declare function defineModClickPrevention(): ModClickPreventionExtension;
|
894
892
|
|
893
|
+
/**
|
894
|
+
* @public
|
895
|
+
*
|
896
|
+
* Defines a paragraph node.
|
897
|
+
*
|
898
|
+
* The paragraph node spec has the highest priority, because it should be the
|
899
|
+
* default block node for most cases.
|
900
|
+
*/
|
901
|
+
declare function defineParagraph(): ParagraphExtension;
|
902
|
+
export { defineParagraph }
|
903
|
+
export { defineParagraph as defineParagraph_alias_1 }
|
904
|
+
|
905
|
+
/**
|
906
|
+
* @internal
|
907
|
+
*/
|
908
|
+
declare function defineParagraphCommands(): ParagraphCommandsExtension;
|
909
|
+
export { defineParagraphCommands }
|
910
|
+
export { defineParagraphCommands as defineParagraphCommands_alias_1 }
|
911
|
+
|
912
|
+
/**
|
913
|
+
* @internal
|
914
|
+
*/
|
915
|
+
declare function defineParagraphKeymap(): PlainExtension;
|
916
|
+
export { defineParagraphKeymap }
|
917
|
+
export { defineParagraphKeymap as defineParagraphKeymap_alias_1 }
|
918
|
+
|
919
|
+
/**
|
920
|
+
* @internal
|
921
|
+
*
|
922
|
+
* Defines a paragraph node spec.
|
923
|
+
*/
|
924
|
+
declare function defineParagraphSpec(): ParagraphSpecExtension;
|
925
|
+
export { defineParagraphSpec }
|
926
|
+
export { defineParagraphSpec as defineParagraphSpec_alias_1 }
|
927
|
+
|
895
928
|
/**
|
896
929
|
* Add a placeholder text to the editor when the current block or document is
|
897
930
|
* empty.
|
@@ -1002,13 +1035,9 @@ export { defineTableSpec }
|
|
1002
1035
|
export { defineTableSpec as defineTableSpec_alias_1 }
|
1003
1036
|
|
1004
1037
|
/**
|
1005
|
-
* @
|
1038
|
+
* @public
|
1006
1039
|
*/
|
1007
|
-
export declare function
|
1008
|
-
Nodes: {
|
1009
|
-
paragraph: Attrs_2;
|
1010
|
-
};
|
1011
|
-
}>, TableExtension, HorizontalRuleExtension]>;
|
1040
|
+
export declare function defineText(): TextExtension;
|
1012
1041
|
|
1013
1042
|
/**
|
1014
1043
|
* Adds a `textAlign` attribute to the specified nodes. This will be rendered as
|
@@ -1161,6 +1190,15 @@ declare function defineYjsUndoPlugin(options: YjsUndoOptions): PlainExtension;
|
|
1161
1190
|
export { defineYjsUndoPlugin }
|
1162
1191
|
export { defineYjsUndoPlugin as defineYjsUndoPlugin_alias_1 }
|
1163
1192
|
|
1193
|
+
/**
|
1194
|
+
* @internal
|
1195
|
+
*/
|
1196
|
+
export declare type DocExtension = Extension<{
|
1197
|
+
Nodes: {
|
1198
|
+
doc: Attrs;
|
1199
|
+
};
|
1200
|
+
}>;
|
1201
|
+
|
1164
1202
|
/**
|
1165
1203
|
* @internal
|
1166
1204
|
*/
|
@@ -1475,8 +1513,6 @@ export { ImageSpecExtension as ImageSpecExtension_alias_1 }
|
|
1475
1513
|
export { IndentListOptions }
|
1476
1514
|
export { IndentListOptions as IndentListOptions_alias_1 }
|
1477
1515
|
|
1478
|
-
export declare function inputText(input: string): Promise<void>;
|
1479
|
-
|
1480
1516
|
/**
|
1481
1517
|
* Returns a command that inserts a horizontal rule at the current selection.
|
1482
1518
|
*/
|
@@ -1500,9 +1536,20 @@ export { insertTable as insertTable_alias_1 }
|
|
1500
1536
|
* @public
|
1501
1537
|
*/
|
1502
1538
|
declare interface InsertTableOptions {
|
1539
|
+
/**
|
1540
|
+
* The number of rows in the table.
|
1541
|
+
*/
|
1503
1542
|
row: number;
|
1543
|
+
/**
|
1544
|
+
* The number of columns in the table.
|
1545
|
+
*/
|
1504
1546
|
col: number;
|
1505
|
-
|
1547
|
+
/**
|
1548
|
+
* Whether the table has a header row.
|
1549
|
+
*
|
1550
|
+
* @default false
|
1551
|
+
*/
|
1552
|
+
header?: boolean;
|
1506
1553
|
}
|
1507
1554
|
export { InsertTableOptions }
|
1508
1555
|
export { InsertTableOptions as InsertTableOptions_alias_1 }
|
@@ -1734,6 +1781,12 @@ export declare interface MarkInputRuleOptions {
|
|
1734
1781
|
* Attributes to set on the mark.
|
1735
1782
|
*/
|
1736
1783
|
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
|
1784
|
+
/**
|
1785
|
+
* Whether this rule should fire inside marks marked as [code](https://prosemirror.net/docs/ref/#model.MarkSpec.code).
|
1786
|
+
*
|
1787
|
+
* @default `false`
|
1788
|
+
*/
|
1789
|
+
inCodeMark?: boolean;
|
1737
1790
|
}
|
1738
1791
|
|
1739
1792
|
/**
|
@@ -1784,6 +1837,35 @@ export declare interface MentionAttrs {
|
|
1784
1837
|
*/
|
1785
1838
|
export declare type ModClickPreventionExtension = PlainExtension;
|
1786
1839
|
|
1840
|
+
/**
|
1841
|
+
* @internal
|
1842
|
+
*/
|
1843
|
+
declare type ParagraphCommandsExtension = Extension<{
|
1844
|
+
Commands: {
|
1845
|
+
setParagraph: [];
|
1846
|
+
};
|
1847
|
+
}>;
|
1848
|
+
export { ParagraphCommandsExtension }
|
1849
|
+
export { ParagraphCommandsExtension as ParagraphCommandsExtension_alias_1 }
|
1850
|
+
|
1851
|
+
/**
|
1852
|
+
* @internal
|
1853
|
+
*/
|
1854
|
+
declare type ParagraphExtension = Union<[ParagraphSpecExtension, ParagraphCommandsExtension]>;
|
1855
|
+
export { ParagraphExtension }
|
1856
|
+
export { ParagraphExtension as ParagraphExtension_alias_1 }
|
1857
|
+
|
1858
|
+
/**
|
1859
|
+
* @internal
|
1860
|
+
*/
|
1861
|
+
declare type ParagraphSpecExtension = Extension<{
|
1862
|
+
Nodes: {
|
1863
|
+
paragraph: Attrs;
|
1864
|
+
};
|
1865
|
+
}>;
|
1866
|
+
export { ParagraphSpecExtension }
|
1867
|
+
export { ParagraphSpecExtension as ParagraphSpecExtension_alias_1 }
|
1868
|
+
|
1787
1869
|
export declare interface PlaceholderOptions {
|
1788
1870
|
/**
|
1789
1871
|
* The placeholder to use. It can be a static string or a function that
|
@@ -1820,18 +1902,6 @@ export declare interface PredictionPluginState {
|
|
1820
1902
|
} | null;
|
1821
1903
|
}
|
1822
1904
|
|
1823
|
-
/**
|
1824
|
-
* @example
|
1825
|
-
*
|
1826
|
-
* ```ts
|
1827
|
-
* await pressKey('mod-1')
|
1828
|
-
* await pressKey('Backspace')
|
1829
|
-
* ```
|
1830
|
-
*
|
1831
|
-
* @internal
|
1832
|
-
*/
|
1833
|
-
export declare function pressKey(input: string): Promise<void>;
|
1834
|
-
|
1835
1905
|
/**
|
1836
1906
|
* @internal
|
1837
1907
|
*/
|
@@ -1969,6 +2039,11 @@ declare interface SelectTableRowOptions {
|
|
1969
2039
|
export { SelectTableRowOptions }
|
1970
2040
|
export { SelectTableRowOptions as SelectTableRowOptions_alias_1 }
|
1971
2041
|
|
2042
|
+
/**
|
2043
|
+
* @internal
|
2044
|
+
*/
|
2045
|
+
export declare function setParagraph(): Command;
|
2046
|
+
|
1972
2047
|
/**
|
1973
2048
|
* @internal
|
1974
2049
|
*/
|
@@ -1979,108 +2054,6 @@ export declare function setTextAlign({ types, value, }: {
|
|
1979
2054
|
|
1980
2055
|
export declare function setTrMeta(tr: Transaction, meta: PredictionPluginState): Transaction;
|
1981
2056
|
|
1982
|
-
/**
|
1983
|
-
* @internal
|
1984
|
-
*/
|
1985
|
-
export declare function setupTest(): {
|
1986
|
-
editor: TestEditor<Union<readonly [DocExtension, TextExtension, HeadingExtension, HistoryExtension, ListExtension, BlockquoteExtension, PlainExtension, BaseCommandsExtension, ItalicExtension, BoldExtension, UnderlineExtension, StrikeExtension, CodeExtension, LinkExtension, ImageExtension, Extension<{
|
1987
|
-
Nodes: {
|
1988
|
-
paragraph: Attrs_2;
|
1989
|
-
};
|
1990
|
-
}>, TableExtension, HorizontalRuleExtension]>>;
|
1991
|
-
m: ToMarkAction<SimplifyDeeper< {
|
1992
|
-
bold: {
|
1993
|
-
readonly [x: string]: any;
|
1994
|
-
};
|
1995
|
-
code: {
|
1996
|
-
readonly [x: string]: any;
|
1997
|
-
};
|
1998
|
-
italic: {
|
1999
|
-
readonly [x: string]: any;
|
2000
|
-
};
|
2001
|
-
link: {
|
2002
|
-
href: string;
|
2003
|
-
};
|
2004
|
-
strike: {
|
2005
|
-
readonly [x: string]: any;
|
2006
|
-
};
|
2007
|
-
underline: {
|
2008
|
-
readonly [x: string]: any;
|
2009
|
-
};
|
2010
|
-
}>>;
|
2011
|
-
n: {
|
2012
|
-
p: NodeAction< {
|
2013
|
-
readonly [x: string]: any;
|
2014
|
-
}>;
|
2015
|
-
h1: (...children: NodeChild[]) => Node_2;
|
2016
|
-
h2: (...children: NodeChild[]) => Node_2;
|
2017
|
-
h3: (...children: NodeChild[]) => Node_2;
|
2018
|
-
h4: (...children: NodeChild[]) => Node_2;
|
2019
|
-
h5: (...children: NodeChild[]) => Node_2;
|
2020
|
-
h6: (...children: NodeChild[]) => Node_2;
|
2021
|
-
bullet: (...children: NodeChild[]) => Node_2;
|
2022
|
-
ordered: (...children: NodeChild[]) => Node_2;
|
2023
|
-
checked: (...children: NodeChild[]) => Node_2;
|
2024
|
-
unchecked: (...children: NodeChild[]) => Node_2;
|
2025
|
-
collapsed: (...children: NodeChild[]) => Node_2;
|
2026
|
-
expanded: (...children: NodeChild[]) => Node_2;
|
2027
|
-
doc: NodeAction< {
|
2028
|
-
readonly [x: string]: any;
|
2029
|
-
}>;
|
2030
|
-
paragraph: NodeAction< {
|
2031
|
-
readonly [x: string]: any;
|
2032
|
-
}>;
|
2033
|
-
text: NodeAction< {
|
2034
|
-
readonly [x: string]: any;
|
2035
|
-
}>;
|
2036
|
-
blockquote: NodeAction< {
|
2037
|
-
readonly [x: string]: any;
|
2038
|
-
}>;
|
2039
|
-
heading: NodeAction< {
|
2040
|
-
level: number;
|
2041
|
-
}>;
|
2042
|
-
horizontalRule: NodeAction< {
|
2043
|
-
readonly [x: string]: any;
|
2044
|
-
}>;
|
2045
|
-
image: NodeAction< {
|
2046
|
-
src?: (string | null) | undefined;
|
2047
|
-
width?: (number | null) | undefined;
|
2048
|
-
height?: (number | null) | undefined;
|
2049
|
-
}>;
|
2050
|
-
list: NodeAction< {
|
2051
|
-
kind?: ("bullet" | "ordered" | "task" | "toggle") | undefined;
|
2052
|
-
order?: (number | null) | undefined;
|
2053
|
-
checked?: boolean | undefined;
|
2054
|
-
collapsed?: boolean | undefined;
|
2055
|
-
}>;
|
2056
|
-
table: NodeAction< {
|
2057
|
-
readonly [x: string]: any;
|
2058
|
-
}>;
|
2059
|
-
tableRow: NodeAction< {
|
2060
|
-
readonly [x: string]: any;
|
2061
|
-
}>;
|
2062
|
-
tableCell: NodeAction< {
|
2063
|
-
colspan: number;
|
2064
|
-
rowspan: number;
|
2065
|
-
colwidth: number[] | null;
|
2066
|
-
}>;
|
2067
|
-
tableHeaderCell: NodeAction< {
|
2068
|
-
colspan: number;
|
2069
|
-
rowspan: number;
|
2070
|
-
colwidth: number[] | null;
|
2071
|
-
}>;
|
2072
|
-
};
|
2073
|
-
};
|
2074
|
-
|
2075
|
-
/**
|
2076
|
-
* @internal
|
2077
|
-
*/
|
2078
|
-
export declare function setupTestFromExtension<E extends Extension>(extension: E): {
|
2079
|
-
editor: TestEditor<E>;
|
2080
|
-
n: ExtractNodeActions<E>;
|
2081
|
-
m: ExtractMarkActions<E>;
|
2082
|
-
};
|
2083
|
-
|
2084
2057
|
export declare interface ShikiHighlighterOptions extends BundledHighlighterOptions<BundledLanguage, BundledTheme> {
|
2085
2058
|
}
|
2086
2059
|
|
@@ -2268,6 +2241,15 @@ export declare type TextBlockEnterRuleOptions = {
|
|
2268
2241
|
stop?: boolean;
|
2269
2242
|
};
|
2270
2243
|
|
2244
|
+
/**
|
2245
|
+
* @internal
|
2246
|
+
*/
|
2247
|
+
export declare type TextExtension = Extension<{
|
2248
|
+
Nodes: {
|
2249
|
+
text: Attrs;
|
2250
|
+
};
|
2251
|
+
}>;
|
2252
|
+
|
2271
2253
|
export { ToggleCollapsedOptions }
|
2272
2254
|
export { ToggleCollapsedOptions as ToggleCollapsedOptions_alias_1 }
|
2273
2255
|
|
@@ -21,10 +21,10 @@ function defineInputRule(rule) {
|
|
21
21
|
function createMarkInputRule({
|
22
22
|
regex,
|
23
23
|
type,
|
24
|
-
attrs = null
|
24
|
+
attrs = null,
|
25
|
+
inCodeMark = false
|
25
26
|
}) {
|
26
27
|
const rule = new InputRule(regex, (state, match, start, end) => {
|
27
|
-
var _a;
|
28
28
|
const { tr, schema } = state;
|
29
29
|
const [fullText, markText] = match;
|
30
30
|
if (!markText) {
|
@@ -40,7 +40,7 @@ function createMarkInputRule({
|
|
40
40
|
if (!isMarkAbsent(tr.doc, markStart, markEnd, markType, attrs)) {
|
41
41
|
return null;
|
42
42
|
}
|
43
|
-
const initialStoredMarks =
|
43
|
+
const initialStoredMarks = tr.storedMarks ?? [];
|
44
44
|
tr.addMark(markStart, markEnd, mark);
|
45
45
|
if (markEnd < end) {
|
46
46
|
tr.delete(markEnd, end);
|
@@ -50,7 +50,7 @@ function createMarkInputRule({
|
|
50
50
|
}
|
51
51
|
tr.setStoredMarks(initialStoredMarks);
|
52
52
|
return tr;
|
53
|
-
});
|
53
|
+
}, { inCodeMark });
|
54
54
|
return rule;
|
55
55
|
}
|
56
56
|
function defineMarkInputRule(options) {
|
@@ -45,12 +45,11 @@ function findTable($pos) {
|
|
45
45
|
return findParentNode((node) => node.type.spec.tableRole === "table", $pos);
|
46
46
|
}
|
47
47
|
function findCellRange(selection, anchorHit, headHit) {
|
48
|
-
var _a, _b;
|
49
48
|
if (anchorHit == null && headHit == null && isCellSelection(selection)) {
|
50
49
|
return [selection.$anchorCell, selection.$headCell];
|
51
50
|
}
|
52
|
-
const anchor =
|
53
|
-
const head =
|
51
|
+
const anchor = anchorHit ?? headHit ?? selection.anchor;
|
52
|
+
const head = headHit ?? anchorHit ?? selection.head;
|
54
53
|
const doc = selection.$head.doc;
|
55
54
|
const $anchorCell = findCellPos(doc, anchor);
|
56
55
|
const $headCell = findCellPos(doc, head);
|
@@ -91,7 +90,7 @@ function repeat(node, length) {
|
|
91
90
|
}
|
92
91
|
function insertTable(options) {
|
93
92
|
return (state, dispatch, view) => {
|
94
|
-
const { row, col, header } = options;
|
93
|
+
const { row, col, header = false } = options;
|
95
94
|
const table = createEmptyTable(state.schema, row, col, header);
|
96
95
|
return insertNode({ node: table })(state, dispatch, view);
|
97
96
|
};
|
@@ -116,7 +115,7 @@ var exitTable = (state, dispatch) => {
|
|
116
115
|
const above = $head.node(tableDepth - 1);
|
117
116
|
const after = $head.indexAfter(tableDepth - 1);
|
118
117
|
const type = defaultBlockAt(above.contentMatchAt(after));
|
119
|
-
const node = type
|
118
|
+
const node = type?.createAndFill();
|
120
119
|
if (!type || !node || !above.canReplaceWith(after, after, type)) {
|
121
120
|
return false;
|
122
121
|
}
|
@@ -130,7 +129,7 @@ var exitTable = (state, dispatch) => {
|
|
130
129
|
};
|
131
130
|
function selectTableColumn(options) {
|
132
131
|
return (state, dispatch) => {
|
133
|
-
const range = findCellRange(state.selection, options
|
132
|
+
const range = findCellRange(state.selection, options?.anchor, options?.head);
|
134
133
|
if (!range) {
|
135
134
|
return false;
|
136
135
|
}
|
@@ -144,7 +143,7 @@ function selectTableColumn(options) {
|
|
144
143
|
}
|
145
144
|
function selectTableRow(options) {
|
146
145
|
return (state, dispatch) => {
|
147
|
-
const range = findCellRange(state.selection, options
|
146
|
+
const range = findCellRange(state.selection, options?.anchor, options?.head);
|
148
147
|
if (!range) {
|
149
148
|
return false;
|
150
149
|
}
|
@@ -158,10 +157,9 @@ function selectTableRow(options) {
|
|
158
157
|
}
|
159
158
|
function selectTableCell(options) {
|
160
159
|
return (state, dispatch) => {
|
161
|
-
var _a;
|
162
160
|
const $cellPos = findCellPos(
|
163
161
|
state.doc,
|
164
|
-
|
162
|
+
options?.pos ?? state.selection.anchor
|
165
163
|
);
|
166
164
|
if (!$cellPos) {
|
167
165
|
return false;
|
@@ -175,7 +173,7 @@ function selectTableCell(options) {
|
|
175
173
|
}
|
176
174
|
function selectTable(options) {
|
177
175
|
return (state, dispatch) => {
|
178
|
-
const $pos =
|
176
|
+
const $pos = options?.pos ? state.doc.resolve(options.pos) : state.selection.$anchor;
|
179
177
|
const table = findTable($pos);
|
180
178
|
if (!table) {
|
181
179
|
return false;
|
@@ -194,7 +192,7 @@ function selectTable(options) {
|
|
194
192
|
const $lastCellPos = tr.doc.resolve(lastCellPos);
|
195
193
|
const selection = new CellSelection2($firstCellPos, $lastCellPos);
|
196
194
|
tr = tr.setSelection(selection);
|
197
|
-
dispatch
|
195
|
+
dispatch?.(tr);
|
198
196
|
}
|
199
197
|
return true;
|
200
198
|
};
|
@@ -54,7 +54,6 @@ function createAutocompletePlugin({
|
|
54
54
|
return { active: false, ignore: null, matching: null };
|
55
55
|
},
|
56
56
|
apply: (tr, prevValue, oldState, newState) => {
|
57
|
-
var _a;
|
58
57
|
const meta = getTrMeta(tr);
|
59
58
|
if (!tr.docChanged && oldState.selection.eq(newState.selection) && !meta) {
|
60
59
|
return prevValue;
|
@@ -63,7 +62,7 @@ function createAutocompletePlugin({
|
|
63
62
|
return meta;
|
64
63
|
}
|
65
64
|
const nextValue = calcPluginState(newState, getRules());
|
66
|
-
if (nextValue.active && prevValue.ignore != null &&
|
65
|
+
if (nextValue.active && prevValue.ignore != null && nextValue.matching?.from === prevValue.ignore) {
|
67
66
|
return prevValue;
|
68
67
|
}
|
69
68
|
return nextValue;
|
@@ -71,13 +70,12 @@ function createAutocompletePlugin({
|
|
71
70
|
},
|
72
71
|
view: () => ({
|
73
72
|
update: (view, prevState) => {
|
74
|
-
var _a, _b, _c;
|
75
73
|
const prevValue = getPluginState(prevState);
|
76
74
|
const currValue = getPluginState(view.state);
|
77
|
-
if (
|
78
|
-
|
75
|
+
if (prevValue?.active && prevValue.matching && prevValue.matching.rule !== currValue?.matching?.rule) {
|
76
|
+
prevValue.matching.rule.onLeave?.();
|
79
77
|
}
|
80
|
-
if (
|
78
|
+
if (currValue?.active && currValue.matching && currValue.matching.from !== currValue.ignore) {
|
81
79
|
const { from, to, match, rule } = currValue.matching;
|
82
80
|
const textContent = view.state.doc.textBetween(
|
83
81
|
from,
|
@@ -118,7 +116,7 @@ function createAutocompletePlugin({
|
|
118
116
|
props: {
|
119
117
|
decorations: (state) => {
|
120
118
|
const pluginState = getPluginState(state);
|
121
|
-
if (
|
119
|
+
if (pluginState?.active && pluginState.matching) {
|
122
120
|
const { from, to } = pluginState.matching;
|
123
121
|
const deco = Decoration.inline(from, to, {
|
124
122
|
class: "prosemirror-prediction-match"
|
@@ -185,11 +183,10 @@ var autocompleteFacet = defineFacet({
|
|
185
183
|
// src/autocomplete/autocomplete-rule.ts
|
186
184
|
var AutocompleteRule = class {
|
187
185
|
constructor(options) {
|
188
|
-
var _a;
|
189
186
|
this.regex = options.regex;
|
190
187
|
this.onMatch = options.onEnter;
|
191
188
|
this.onLeave = options.onLeave;
|
192
|
-
this.canMatch =
|
189
|
+
this.canMatch = options.canMatch ?? defaultCanMatch;
|
193
190
|
}
|
194
191
|
};
|
195
192
|
export {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
defineWrappingInputRule
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-I2UMHK3L.js";
|
4
4
|
|
5
5
|
// src/blockquote/blockquote.ts
|
6
6
|
import {
|
@@ -49,7 +49,7 @@ function toggleBlockquoteKeybinding() {
|
|
49
49
|
function backspaceUnsetBlockquote() {
|
50
50
|
return (state, dispatch, view) => {
|
51
51
|
const $pos = isAtBlockStart(state, view);
|
52
|
-
if (
|
52
|
+
if ($pos?.node(-1).type.name === "blockquote") {
|
53
53
|
return joinBackward(state, dispatch, view);
|
54
54
|
}
|
55
55
|
return false;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
defineMarkInputRule
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-I2UMHK3L.js";
|
4
4
|
|
5
5
|
// src/code/code.ts
|
6
6
|
import {
|
@@ -46,6 +46,7 @@ function defineCodeSpec() {
|
|
46
46
|
return defineMarkSpec({
|
47
47
|
name: "code",
|
48
48
|
parseDOM: [{ tag: "code" }],
|
49
|
+
code: true,
|
49
50
|
toDOM() {
|
50
51
|
return ["code", 0];
|
51
52
|
}
|
@@ -31,8 +31,7 @@ function defineFileDropHandler(handler) {
|
|
31
31
|
return defineFacetPayload(facet, [handler]);
|
32
32
|
}
|
33
33
|
function getFiles(event) {
|
34
|
-
|
35
|
-
return Array.from((_b = (_a = event.dataTransfer) == null ? void 0 : _a.files) != null ? _b : []);
|
34
|
+
return Array.from(event.dataTransfer?.files ?? []);
|
36
35
|
}
|
37
36
|
var facet = defineFacet({
|
38
37
|
parent: editorEventFacet,
|
@@ -65,8 +64,7 @@ function defineFilePasteHandler(handler) {
|
|
65
64
|
return defineFacetPayload2(facet2, [handler]);
|
66
65
|
}
|
67
66
|
function getFiles2(event) {
|
68
|
-
|
69
|
-
return Array.from((_b = (_a = event.clipboardData) == null ? void 0 : _a.files) != null ? _b : []);
|
67
|
+
return Array.from(event.clipboardData?.files ?? []);
|
70
68
|
}
|
71
69
|
var facet2 = defineFacet2({
|
72
70
|
parent: editorEventFacet2,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
defineTextBlockInputRule
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-I2UMHK3L.js";
|
4
4
|
|
5
5
|
// src/heading/heading.ts
|
6
6
|
import {
|
@@ -34,8 +34,7 @@ function defineHeadingInputRule() {
|
|
34
34
|
regex: /^(#{1,6})\s$/,
|
35
35
|
type: "heading",
|
36
36
|
attrs: (match) => {
|
37
|
-
|
38
|
-
const level = (_b = (_a = match[1]) == null ? void 0 : _a.length) != null ? _b : 1;
|
37
|
+
const level = match[1]?.length ?? 1;
|
39
38
|
return { level };
|
40
39
|
}
|
41
40
|
});
|
@@ -54,19 +53,19 @@ function toggleHeadingKeybinding(level) {
|
|
54
53
|
}
|
55
54
|
var backspaceUnsetHeading = (state, dispatch, view) => {
|
56
55
|
const $pos = isAtBlockStart(state, view);
|
57
|
-
if (
|
56
|
+
if ($pos?.parent.type.name === "heading") {
|
58
57
|
return unsetBlockType()(state, dispatch, view);
|
59
58
|
}
|
60
59
|
return false;
|
61
60
|
};
|
62
61
|
function defineHeadingKeymap() {
|
63
62
|
return defineKeymap({
|
64
|
-
"mod-1": toggleHeadingKeybinding(1),
|
65
|
-
"mod-2": toggleHeadingKeybinding(2),
|
66
|
-
"mod-3": toggleHeadingKeybinding(3),
|
67
|
-
"mod-4": toggleHeadingKeybinding(4),
|
68
|
-
"mod-5": toggleHeadingKeybinding(5),
|
69
|
-
"mod-6": toggleHeadingKeybinding(6),
|
63
|
+
"mod-alt-1": toggleHeadingKeybinding(1),
|
64
|
+
"mod-alt-2": toggleHeadingKeybinding(2),
|
65
|
+
"mod-alt-3": toggleHeadingKeybinding(3),
|
66
|
+
"mod-alt-4": toggleHeadingKeybinding(4),
|
67
|
+
"mod-alt-5": toggleHeadingKeybinding(5),
|
68
|
+
"mod-alt-6": toggleHeadingKeybinding(6),
|
70
69
|
"Backspace": backspaceUnsetHeading
|
71
70
|
});
|
72
71
|
}
|
@@ -3,10 +3,10 @@ import {
|
|
3
3
|
} from "./chunk-6UYLCVBX.js";
|
4
4
|
import {
|
5
5
|
defineEnterRule
|
6
|
-
} from "./chunk-
|
6
|
+
} from "./chunk-D54VSLLS.js";
|
7
7
|
import {
|
8
8
|
defineInputRule
|
9
|
-
} from "./chunk-
|
9
|
+
} from "./chunk-I2UMHK3L.js";
|
10
10
|
|
11
11
|
// src/link/index.ts
|
12
12
|
import {
|
@@ -11,6 +11,7 @@ export { ListCommandsExtension } from './_tsup-dts-rollup.js';
|
|
11
11
|
export { defineListInputRules } from './_tsup-dts-rollup.js';
|
12
12
|
export { defineListKeymap } from './_tsup-dts-rollup.js';
|
13
13
|
export { defineListPlugins } from './_tsup-dts-rollup.js';
|
14
|
+
export { defineListSerializer } from './_tsup-dts-rollup.js';
|
14
15
|
export { defineListSpec } from './_tsup-dts-rollup.js';
|
15
16
|
export { ListSpecExtension } from './_tsup-dts-rollup.js';
|
16
17
|
export { ListAttrs } from './_tsup-dts-rollup.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
defineInputRule
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-I2UMHK3L.js";
|
4
4
|
|
5
5
|
// src/list/index.ts
|
6
6
|
import { ListDOMSerializer as ListDOMSerializer2 } from "prosemirror-flat-list";
|
@@ -89,9 +89,65 @@ function defineListKeymap() {
|
|
89
89
|
|
90
90
|
// src/list/list-plugins.ts
|
91
91
|
import { definePlugin } from "@prosekit/core";
|
92
|
-
import {
|
92
|
+
import { Plugin } from "@prosekit/pm/state";
|
93
|
+
import {
|
94
|
+
createListEventPlugin,
|
95
|
+
createListRenderingPlugin,
|
96
|
+
createSafariInputMethodWorkaroundPlugin,
|
97
|
+
unwrapListSlice
|
98
|
+
} from "prosemirror-flat-list";
|
99
|
+
function createListClipboardPlugin() {
|
100
|
+
return new Plugin({
|
101
|
+
props: {
|
102
|
+
transformCopied: unwrapListSlice
|
103
|
+
}
|
104
|
+
});
|
105
|
+
}
|
106
|
+
function createListPlugins() {
|
107
|
+
return [
|
108
|
+
createListEventPlugin(),
|
109
|
+
createListRenderingPlugin(),
|
110
|
+
createListClipboardPlugin(),
|
111
|
+
createSafariInputMethodWorkaroundPlugin()
|
112
|
+
];
|
113
|
+
}
|
93
114
|
function defineListPlugins() {
|
94
|
-
return definePlugin(
|
115
|
+
return definePlugin(createListPlugins);
|
116
|
+
}
|
117
|
+
|
118
|
+
// src/list/list-serializer.ts
|
119
|
+
import {
|
120
|
+
defineClipboardSerializer,
|
121
|
+
isElement
|
122
|
+
} from "@prosekit/core";
|
123
|
+
import {
|
124
|
+
joinListElements,
|
125
|
+
listToDOM
|
126
|
+
} from "prosemirror-flat-list";
|
127
|
+
function defineListSerializer() {
|
128
|
+
return defineClipboardSerializer({
|
129
|
+
serializeFragmentWrapper: (fn) => {
|
130
|
+
return (...args) => {
|
131
|
+
const dom = fn(...args);
|
132
|
+
return joinListElements(dom);
|
133
|
+
};
|
134
|
+
},
|
135
|
+
serializeNodeWrapper: (fn) => {
|
136
|
+
return (...args) => {
|
137
|
+
const dom = fn(...args);
|
138
|
+
return isElement(dom) ? joinListElements(dom) : dom;
|
139
|
+
};
|
140
|
+
},
|
141
|
+
nodesFromSchemaWrapper: (fn) => {
|
142
|
+
return (...args) => {
|
143
|
+
const nodes = fn(...args);
|
144
|
+
return {
|
145
|
+
...nodes,
|
146
|
+
list: (node) => listToDOM({ node, nativeList: true, getMarkers: () => null })
|
147
|
+
};
|
148
|
+
};
|
149
|
+
}
|
150
|
+
});
|
95
151
|
}
|
96
152
|
|
97
153
|
// src/list/list-spec.ts
|
@@ -114,7 +170,8 @@ function defineList() {
|
|
114
170
|
defineListPlugins(),
|
115
171
|
defineListKeymap(),
|
116
172
|
defineListInputRules(),
|
117
|
-
defineListCommands()
|
173
|
+
defineListCommands(),
|
174
|
+
defineListSerializer()
|
118
175
|
);
|
119
176
|
}
|
120
177
|
export {
|
@@ -124,5 +181,6 @@ export {
|
|
124
181
|
defineListInputRules,
|
125
182
|
defineListKeymap,
|
126
183
|
defineListPlugins,
|
184
|
+
defineListSerializer,
|
127
185
|
defineListSpec
|
128
186
|
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export { defineParagraph } from './_tsup-dts-rollup.js';
|
2
|
+
export { ParagraphExtension } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineParagraphCommands } from './_tsup-dts-rollup.js';
|
4
|
+
export { ParagraphCommandsExtension } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineParagraphKeymap } from './_tsup-dts-rollup.js';
|
6
|
+
export { defineParagraphSpec } from './_tsup-dts-rollup.js';
|
7
|
+
export { ParagraphSpecExtension } from './_tsup-dts-rollup.js';
|
@@ -0,0 +1,59 @@
|
|
1
|
+
// src/paragraph/paragraph.ts
|
2
|
+
import {
|
3
|
+
Priority,
|
4
|
+
union,
|
5
|
+
withPriority
|
6
|
+
} from "@prosekit/core";
|
7
|
+
|
8
|
+
// src/paragraph/paragraph-commands.ts
|
9
|
+
import {
|
10
|
+
defineCommands,
|
11
|
+
setBlockType
|
12
|
+
} from "@prosekit/core";
|
13
|
+
function setParagraph() {
|
14
|
+
return setBlockType({ type: "paragraph" });
|
15
|
+
}
|
16
|
+
function defineParagraphCommands() {
|
17
|
+
return defineCommands({ setParagraph });
|
18
|
+
}
|
19
|
+
|
20
|
+
// src/paragraph/paragraph-keymap.ts
|
21
|
+
import {
|
22
|
+
defineKeymap
|
23
|
+
} from "@prosekit/core";
|
24
|
+
function defineParagraphKeymap() {
|
25
|
+
return defineKeymap({
|
26
|
+
"mod-alt-0": setParagraph()
|
27
|
+
});
|
28
|
+
}
|
29
|
+
|
30
|
+
// src/paragraph/paragraph-spec.ts
|
31
|
+
import {
|
32
|
+
defineNodeSpec
|
33
|
+
} from "@prosekit/core";
|
34
|
+
function defineParagraphSpec() {
|
35
|
+
return defineNodeSpec({
|
36
|
+
name: "paragraph",
|
37
|
+
content: "inline*",
|
38
|
+
group: "block",
|
39
|
+
parseDOM: [{ tag: "p" }],
|
40
|
+
toDOM() {
|
41
|
+
return ["p", 0];
|
42
|
+
}
|
43
|
+
});
|
44
|
+
}
|
45
|
+
|
46
|
+
// src/paragraph/paragraph.ts
|
47
|
+
function defineParagraph() {
|
48
|
+
return union(
|
49
|
+
withPriority(defineParagraphSpec(), Priority.highest),
|
50
|
+
defineParagraphCommands(),
|
51
|
+
defineParagraphKeymap()
|
52
|
+
);
|
53
|
+
}
|
54
|
+
export {
|
55
|
+
defineParagraph,
|
56
|
+
defineParagraphCommands,
|
57
|
+
defineParagraphKeymap,
|
58
|
+
defineParagraphSpec
|
59
|
+
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
findTable
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-QVFEYPQ6.js";
|
4
4
|
|
5
5
|
// src/placeholder/index.ts
|
6
6
|
import {
|
@@ -48,8 +48,7 @@ function docStrategy(state) {
|
|
48
48
|
return isDocEmpty(state.doc) && defaultStrategy(state);
|
49
49
|
}
|
50
50
|
function isDocEmpty(doc) {
|
51
|
-
|
52
|
-
return doc.childCount <= 1 && !((_a = doc.firstChild) == null ? void 0 : _a.content.size);
|
51
|
+
return doc.childCount <= 1 && !doc.firstChild?.content.size;
|
53
52
|
}
|
54
53
|
function createPlaceholderDecoration(state, placeholderText) {
|
55
54
|
if (!placeholderText) return null;
|
@@ -22,7 +22,7 @@ function defineSearchQuery(options) {
|
|
22
22
|
function scrollActiveIntoView(view) {
|
23
23
|
if (view.isDestroyed) return;
|
24
24
|
const active = view.dom.querySelector(".ProseMirror-active-search-match");
|
25
|
-
active
|
25
|
+
active?.scrollIntoView({
|
26
26
|
block: "nearest",
|
27
27
|
inline: "nearest",
|
28
28
|
behavior: "smooth"
|
@@ -42,7 +42,7 @@ function fixYUndoPlugin(yUndoPluginInstance) {
|
|
42
42
|
);
|
43
43
|
undoManager._observers = observers;
|
44
44
|
};
|
45
|
-
if (viewRet
|
45
|
+
if (viewRet?.destroy) {
|
46
46
|
viewRet.destroy();
|
47
47
|
}
|
48
48
|
}
|
@@ -125,9 +125,8 @@ function defineYjsSyncPlugin(options) {
|
|
125
125
|
|
126
126
|
// src/yjs/yjs.ts
|
127
127
|
function defineYjs(options) {
|
128
|
-
var _a;
|
129
128
|
const { doc, awareness, sync, undo: undo2, cursor } = options;
|
130
|
-
const fragment =
|
129
|
+
const fragment = options.fragment ?? doc.getXmlFragment("prosemirror");
|
131
130
|
return withPriority(
|
132
131
|
union([
|
133
132
|
defineYjsKeymap(),
|
@@ -1,8 +1,6 @@
|
|
1
1
|
// src/code-block/shiki-highlighter-chunk.ts
|
2
|
-
import {
|
3
|
-
|
4
|
-
createJavaScriptRegexEngine
|
5
|
-
} from "shiki/bundle/full";
|
2
|
+
import { createHighlighter } from "shiki/bundle/full";
|
3
|
+
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
6
4
|
var highlighter;
|
7
5
|
var loadedLangs = /* @__PURE__ */ new Set();
|
8
6
|
var loadedThemes = /* @__PURE__ */ new Set();
|
@@ -11,7 +9,7 @@ async function createAndCacheHighlighter({
|
|
11
9
|
}) {
|
12
10
|
if (!highlighter) {
|
13
11
|
if (!options.engine) {
|
14
|
-
const engine = createJavaScriptRegexEngine();
|
12
|
+
const engine = createJavaScriptRegexEngine({ forgiving: true });
|
15
13
|
options.engine = engine;
|
16
14
|
}
|
17
15
|
highlighter = await createHighlighter(options);
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/extensions",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.
|
4
|
+
"version": "0.8.0",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -63,6 +63,11 @@
|
|
63
63
|
"./commit/style.css": {
|
64
64
|
"default": "./dist/commit/style.css"
|
65
65
|
},
|
66
|
+
"./doc": {
|
67
|
+
"types": "./dist/prosekit-extensions-doc.d.ts",
|
68
|
+
"import": "./dist/prosekit-extensions-doc.js",
|
69
|
+
"default": "./dist/prosekit-extensions-doc.js"
|
70
|
+
},
|
66
71
|
"./drop-cursor": {
|
67
72
|
"types": "./dist/prosekit-extensions-drop-cursor.d.ts",
|
68
73
|
"import": "./dist/prosekit-extensions-drop-cursor.js",
|
@@ -147,6 +152,11 @@
|
|
147
152
|
"import": "./dist/prosekit-extensions-mod-click-prevention.js",
|
148
153
|
"default": "./dist/prosekit-extensions-mod-click-prevention.js"
|
149
154
|
},
|
155
|
+
"./paragraph": {
|
156
|
+
"types": "./dist/prosekit-extensions-paragraph.d.ts",
|
157
|
+
"import": "./dist/prosekit-extensions-paragraph.js",
|
158
|
+
"default": "./dist/prosekit-extensions-paragraph.js"
|
159
|
+
},
|
150
160
|
"./placeholder": {
|
151
161
|
"types": "./dist/prosekit-extensions-placeholder.d.ts",
|
152
162
|
"import": "./dist/prosekit-extensions-placeholder.js",
|
@@ -181,6 +191,11 @@
|
|
181
191
|
"./table/style.css": {
|
182
192
|
"default": "./dist/table/style.css"
|
183
193
|
},
|
194
|
+
"./text": {
|
195
|
+
"types": "./dist/prosekit-extensions-text.d.ts",
|
196
|
+
"import": "./dist/prosekit-extensions-text.js",
|
197
|
+
"default": "./dist/prosekit-extensions-text.js"
|
198
|
+
},
|
184
199
|
"./text-align": {
|
185
200
|
"types": "./dist/prosekit-extensions-text-align.d.ts",
|
186
201
|
"import": "./dist/prosekit-extensions-text-align.js",
|
@@ -216,11 +231,11 @@
|
|
216
231
|
"prosemirror-dropcursor": "^1.8.1",
|
217
232
|
"prosemirror-flat-list": "^0.5.4",
|
218
233
|
"prosemirror-gapcursor": "^1.3.2",
|
219
|
-
"prosemirror-highlight": "^0.
|
234
|
+
"prosemirror-highlight": "^0.13.0",
|
220
235
|
"prosemirror-search": "^1.0.0",
|
221
|
-
"prosemirror-tables": "^1.6.
|
222
|
-
"shiki": "^
|
223
|
-
"@prosekit/core": "^0.
|
236
|
+
"prosemirror-tables": "^1.6.4",
|
237
|
+
"shiki": "^3.2.1",
|
238
|
+
"@prosekit/core": "^0.8.0",
|
224
239
|
"@prosekit/pm": "^0.1.9"
|
225
240
|
},
|
226
241
|
"peerDependencies": {
|
@@ -244,22 +259,23 @@
|
|
244
259
|
}
|
245
260
|
},
|
246
261
|
"devDependencies": {
|
247
|
-
"@vitest/browser": "^
|
262
|
+
"@vitest/browser": "^3.0.9",
|
248
263
|
"just-pick": "^4.2.0",
|
249
|
-
"loro-crdt": "^1.
|
250
|
-
"loro-prosemirror": "^0.2.
|
251
|
-
"
|
252
|
-
"
|
253
|
-
"
|
254
|
-
"
|
255
|
-
"
|
264
|
+
"loro-crdt": "^1.4.6",
|
265
|
+
"loro-prosemirror": "^0.2.1",
|
266
|
+
"prettier": "^3.5.3",
|
267
|
+
"tsup": "^8.4.0",
|
268
|
+
"type-fest": "^4.37.0",
|
269
|
+
"typescript": "~5.7.3",
|
270
|
+
"vitest": "^3.0.9",
|
271
|
+
"y-prosemirror": "^1.2.17",
|
256
272
|
"y-protocols": "^1.0.6",
|
257
|
-
"yjs": "^13.6.
|
273
|
+
"yjs": "^13.6.24",
|
258
274
|
"@prosekit/dev": "0.0.0"
|
259
275
|
},
|
260
276
|
"scripts": {
|
261
|
-
"build:
|
262
|
-
"build:
|
277
|
+
"build:tsc": "tsc -b tsconfig.json",
|
278
|
+
"build:tsup": "tsup"
|
263
279
|
},
|
264
280
|
"types": "./dist/prosekit-extensions.d.ts",
|
265
281
|
"typesVersions": {
|
@@ -285,6 +301,9 @@
|
|
285
301
|
"commit": [
|
286
302
|
"./dist/prosekit-extensions-commit.d.ts"
|
287
303
|
],
|
304
|
+
"doc": [
|
305
|
+
"./dist/prosekit-extensions-doc.d.ts"
|
306
|
+
],
|
288
307
|
"drop-cursor": [
|
289
308
|
"./dist/prosekit-extensions-drop-cursor.d.ts"
|
290
309
|
],
|
@@ -330,6 +349,9 @@
|
|
330
349
|
"mod-click-prevention": [
|
331
350
|
"./dist/prosekit-extensions-mod-click-prevention.d.ts"
|
332
351
|
],
|
352
|
+
"paragraph": [
|
353
|
+
"./dist/prosekit-extensions-paragraph.d.ts"
|
354
|
+
],
|
333
355
|
"placeholder": [
|
334
356
|
"./dist/prosekit-extensions-placeholder.d.ts"
|
335
357
|
],
|
@@ -345,6 +367,9 @@
|
|
345
367
|
"table": [
|
346
368
|
"./dist/prosekit-extensions-table.d.ts"
|
347
369
|
],
|
370
|
+
"text": [
|
371
|
+
"./dist/prosekit-extensions-text.d.ts"
|
372
|
+
],
|
348
373
|
"text-align": [
|
349
374
|
"./dist/prosekit-extensions-text-align.d.ts"
|
350
375
|
],
|