@prosekit/extensions 0.7.24 → 0.9.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/commit/style.css +2 -1
- package/dist/commit/style.js +0 -0
- package/dist/enter-rule-RdhEA900.js +96 -0
- package/dist/gap-cursor/style.css +8 -5
- package/dist/gap-cursor/style.js +0 -0
- package/dist/input-rule-Gji4N7Oe.js +93 -0
- package/dist/list/style.css +7 -7
- package/dist/list/style.js +0 -0
- package/dist/loro/style.css +21 -17
- package/dist/loro/style.js +0 -0
- package/dist/mark-rule-wEOcDt6i.js +160 -0
- package/dist/placeholder/style.css +5 -5
- package/dist/placeholder/style.js +0 -0
- package/dist/prosekit-extensions-autocomplete.d.ts +33 -3
- package/dist/prosekit-extensions-autocomplete.js +122 -174
- package/dist/prosekit-extensions-blockquote.d.ts +51 -8
- package/dist/prosekit-extensions-blockquote.js +64 -78
- package/dist/prosekit-extensions-bold.d.ts +61 -8
- package/dist/prosekit-extensions-bold.js +61 -73
- package/dist/prosekit-extensions-code-block.d.ts +172 -20
- package/dist/prosekit-extensions-code-block.js +201 -184
- package/dist/prosekit-extensions-code.d.ts +61 -8
- package/dist/prosekit-extensions-code.js +44 -55
- package/dist/prosekit-extensions-commit.d.ts +53 -4
- package/dist/prosekit-extensions-commit.js +142 -183
- package/dist/prosekit-extensions-doc.d.ts +22 -0
- package/dist/prosekit-extensions-doc.js +16 -0
- package/dist/prosekit-extensions-drop-cursor.d.ts +34 -3
- package/dist/prosekit-extensions-drop-cursor.js +14 -8
- package/dist/prosekit-extensions-enter-rule.d.ts +106 -5
- package/dist/prosekit-extensions-enter-rule.js +3 -8
- package/dist/prosekit-extensions-file.d.ts +126 -8
- package/dist/prosekit-extensions-file.js +111 -132
- package/dist/prosekit-extensions-gap-cursor.d.ts +29 -2
- package/dist/prosekit-extensions-gap-cursor.js +21 -9
- package/dist/prosekit-extensions-hard-break.d.ts +58 -0
- package/dist/prosekit-extensions-hard-break.js +58 -0
- package/dist/prosekit-extensions-heading.d.ts +69 -9
- package/dist/prosekit-extensions-heading.js +121 -95
- package/dist/prosekit-extensions-horizontal-rule.d.ts +41 -8
- package/dist/prosekit-extensions-horizontal-rule.js +53 -71
- package/dist/prosekit-extensions-image.d.ts +53 -7
- package/dist/prosekit-extensions-image.js +71 -62
- package/dist/prosekit-extensions-input-rule.d.ts +134 -6
- package/dist/prosekit-extensions-input-rule.js +3 -14
- package/dist/prosekit-extensions-italic.d.ts +61 -8
- package/dist/prosekit-extensions-italic.js +51 -63
- package/dist/prosekit-extensions-link.d.ts +65 -10
- package/dist/prosekit-extensions-link.js +95 -100
- package/dist/prosekit-extensions-list.d.ts +114 -17
- package/dist/prosekit-extensions-list.js +115 -158
- package/dist/prosekit-extensions-loro.d.ts +78 -11
- package/dist/prosekit-extensions-loro.js +49 -77
- package/dist/prosekit-extensions-mark-rule.d.ts +41 -2
- package/dist/prosekit-extensions-mark-rule.js +3 -6
- package/dist/prosekit-extensions-mention.d.ts +40 -4
- package/dist/prosekit-extensions-mention.js +52 -50
- package/dist/prosekit-extensions-mod-click-prevention.d.ts +20 -2
- package/dist/prosekit-extensions-mod-click-prevention.js +20 -16
- package/dist/prosekit-extensions-paragraph.d.ts +65 -0
- package/dist/prosekit-extensions-paragraph.js +60 -0
- package/dist/prosekit-extensions-placeholder.d.ts +32 -2
- package/dist/prosekit-extensions-placeholder.js +39 -56
- package/dist/prosekit-extensions-readonly.d.ts +13 -1
- package/dist/prosekit-extensions-readonly.js +13 -14
- package/dist/prosekit-extensions-search.d.ts +77 -3
- package/dist/prosekit-extensions-search.js +48 -47
- package/dist/prosekit-extensions-strike.d.ts +50 -8
- package/dist/prosekit-extensions-strike.js +44 -49
- package/dist/prosekit-extensions-table.d.ts +237 -26
- package/dist/prosekit-extensions-table.js +3 -34
- package/dist/prosekit-extensions-text-align.d.ts +72 -8
- package/dist/prosekit-extensions-text-align.js +63 -44
- package/dist/prosekit-extensions-text.d.ts +22 -0
- package/dist/prosekit-extensions-text.js +15 -0
- package/dist/prosekit-extensions-underline.d.ts +46 -7
- package/dist/prosekit-extensions-underline.js +33 -37
- package/dist/prosekit-extensions-virtual-selection.d.ts +24 -2
- package/dist/prosekit-extensions-virtual-selection.js +49 -52
- package/dist/prosekit-extensions-yjs.d.ts +99 -14
- package/dist/prosekit-extensions-yjs.js +88 -131
- package/dist/prosekit-extensions.d.ts +1 -1
- package/dist/search/style.css +5 -5
- package/dist/search/style.js +0 -0
- package/dist/shiki-highlighter-chunk-Cd3WeOKL.d.ts +19 -0
- package/dist/shiki-highlighter-chunk.d.ts +2 -0
- package/dist/shiki-highlighter-chunk.js +34 -43
- package/dist/table/style.css +18 -17
- package/dist/table/style.js +0 -0
- package/dist/table-DnVliJ6E.js +287 -0
- package/dist/virtual-selection/style.css +2 -2
- package/dist/virtual-selection/style.js +0 -0
- package/dist/yjs/style.css +15 -17
- package/dist/yjs/style.js +0 -0
- package/package.json +103 -52
- package/dist/_tsup-dts-rollup.d.ts +0 -2500
- package/dist/chunk-6UYLCVBX.js +0 -185
- package/dist/chunk-BV3SHIMW.js +0 -98
- package/dist/chunk-D54VSLLS.js +0 -105
- package/dist/chunk-HFAZX2J3.js +0 -306
@@ -1,55 +1,56 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
findPrevNoWrap,
|
11
|
-
replaceAll,
|
12
|
-
replaceCurrent,
|
13
|
-
replaceNext,
|
14
|
-
replaceNextNoWrap,
|
15
|
-
search,
|
16
|
-
SearchQuery
|
17
|
-
} from "prosemirror-search";
|
1
|
+
import { defineCommands, definePlugin } from "@prosekit/core";
|
2
|
+
import { SearchQuery, findNext, findNextNoWrap, findPrev, findPrevNoWrap, replaceAll, replaceCurrent, replaceNext, replaceNextNoWrap, search } from "prosemirror-search";
|
3
|
+
|
4
|
+
//#region src/search/index.ts
|
5
|
+
/**
|
6
|
+
* Defines an extension that stores a current search query and replace string.
|
7
|
+
*
|
8
|
+
* @public
|
9
|
+
*/
|
18
10
|
function defineSearchQuery(options) {
|
19
|
-
|
20
|
-
|
11
|
+
const query = new SearchQuery(options);
|
12
|
+
return definePlugin(search({ initialQuery: query }));
|
21
13
|
}
|
14
|
+
/**
|
15
|
+
* Scrolls the active search match into view.
|
16
|
+
*/
|
22
17
|
function scrollActiveIntoView(view) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
18
|
+
if (view.isDestroyed) return;
|
19
|
+
const active = view.dom.querySelector(".ProseMirror-active-search-match");
|
20
|
+
active?.scrollIntoView({
|
21
|
+
block: "nearest",
|
22
|
+
inline: "nearest",
|
23
|
+
behavior: "smooth"
|
24
|
+
});
|
30
25
|
}
|
26
|
+
/**
|
27
|
+
* Wraps a command and scrolls the active search match into view when the command
|
28
|
+
* is applied.
|
29
|
+
*/
|
31
30
|
function withScrollActiveIntoView(command) {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
return result;
|
38
|
-
};
|
31
|
+
return (state, dispatch, view) => {
|
32
|
+
const result = command(state, dispatch, view);
|
33
|
+
if (result && dispatch && view) setTimeout(() => scrollActiveIntoView(view), 50);
|
34
|
+
return result;
|
35
|
+
};
|
39
36
|
}
|
37
|
+
/**
|
38
|
+
* Defines commands for search and replace.
|
39
|
+
*
|
40
|
+
* @public
|
41
|
+
*/
|
40
42
|
function defineSearchCommands() {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
43
|
+
return defineCommands({
|
44
|
+
findNext: () => withScrollActiveIntoView(findNext),
|
45
|
+
findPrev: () => withScrollActiveIntoView(findPrev),
|
46
|
+
findNextNoWrap: () => withScrollActiveIntoView(findNextNoWrap),
|
47
|
+
findPrevNoWrap: () => withScrollActiveIntoView(findPrevNoWrap),
|
48
|
+
replaceNext: () => withScrollActiveIntoView(replaceNext),
|
49
|
+
replaceNextNoWrap: () => withScrollActiveIntoView(replaceNextNoWrap),
|
50
|
+
replaceCurrent: () => withScrollActiveIntoView(replaceCurrent),
|
51
|
+
replaceAll: () => withScrollActiveIntoView(replaceAll)
|
52
|
+
});
|
51
53
|
}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
};
|
54
|
+
|
55
|
+
//#endregion
|
56
|
+
export { defineSearchCommands, defineSearchQuery };
|
@@ -1,8 +1,50 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
import { Extension, PlainExtension, Union } from "@prosekit/core";
|
2
|
+
import { Attrs } from "@prosekit/pm/model";
|
3
|
+
|
4
|
+
//#region src/strike/index.d.ts
|
5
|
+
/**
|
6
|
+
* @internal
|
7
|
+
*/
|
8
|
+
/**
|
9
|
+
* @internal
|
10
|
+
*/
|
11
|
+
type StrikeSpecExtension = Extension<{
|
12
|
+
Marks: {
|
13
|
+
strike: Attrs;
|
14
|
+
};
|
15
|
+
}>;
|
16
|
+
/**
|
17
|
+
* @internal
|
18
|
+
*/
|
19
|
+
declare function defineStrikeSpec(): StrikeSpecExtension;
|
20
|
+
/**
|
21
|
+
* @internal
|
22
|
+
*/
|
23
|
+
type StrikeCommandsExtension = Extension<{
|
24
|
+
Commands: {
|
25
|
+
toggleStrike: [];
|
26
|
+
};
|
27
|
+
}>;
|
28
|
+
/**
|
29
|
+
* @internal
|
30
|
+
*/
|
31
|
+
declare function defineStrikeCommands(): StrikeCommandsExtension;
|
32
|
+
/**
|
33
|
+
* @internal
|
34
|
+
*/
|
35
|
+
declare function defineStrikeKeymap(): PlainExtension;
|
36
|
+
/**
|
37
|
+
* @internal
|
38
|
+
*/
|
39
|
+
declare function defineStrikeInputRule(): PlainExtension;
|
40
|
+
/**
|
41
|
+
* @internal
|
42
|
+
*/
|
43
|
+
type StrikeExtension = Union<[StrikeSpecExtension, StrikeCommandsExtension]>;
|
44
|
+
/**
|
45
|
+
* @public
|
46
|
+
*/
|
47
|
+
declare function defineStrike(): StrikeExtension;
|
48
|
+
|
49
|
+
//#endregion
|
50
|
+
export { StrikeCommandsExtension, StrikeExtension, StrikeSpecExtension, defineStrike, defineStrikeCommands, defineStrikeInputRule, defineStrikeKeymap, defineStrikeSpec };
|
@@ -1,60 +1,55 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
} from "./chunk-BV3SHIMW.js";
|
1
|
+
import { defineMarkInputRule } from "./input-rule-Gji4N7Oe.js";
|
2
|
+
import { canUseRegexLookbehind, defineCommands, defineKeymap, defineMarkSpec, toggleMark, union } from "@prosekit/core";
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
defineKeymap,
|
10
|
-
defineMarkSpec,
|
11
|
-
toggleMark,
|
12
|
-
union
|
13
|
-
} from "@prosekit/core";
|
4
|
+
//#region src/strike/index.ts
|
5
|
+
/**
|
6
|
+
* @internal
|
7
|
+
*/
|
14
8
|
function defineStrikeSpec() {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
9
|
+
return defineMarkSpec({
|
10
|
+
name: "strike",
|
11
|
+
parseDOM: [
|
12
|
+
{ tag: "s" },
|
13
|
+
{ tag: "strike" },
|
14
|
+
{ tag: "del" },
|
15
|
+
{ style: "text-decoration=line-through" },
|
16
|
+
{ style: "text-decoration-line=line-through" }
|
17
|
+
],
|
18
|
+
toDOM() {
|
19
|
+
return ["s", 0];
|
20
|
+
}
|
21
|
+
});
|
28
22
|
}
|
23
|
+
/**
|
24
|
+
* @internal
|
25
|
+
*/
|
29
26
|
function defineStrikeCommands() {
|
30
|
-
|
31
|
-
toggleStrike: () => toggleMark({ type: "strike" })
|
32
|
-
});
|
27
|
+
return defineCommands({ toggleStrike: () => toggleMark({ type: "strike" }) });
|
33
28
|
}
|
29
|
+
/**
|
30
|
+
* @internal
|
31
|
+
*/
|
34
32
|
function defineStrikeKeymap() {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
return defineKeymap({
|
34
|
+
"Mod-shift-s": toggleMark({ type: "strike" }),
|
35
|
+
"Mod-shift-x": toggleMark({ type: "strike" })
|
36
|
+
});
|
39
37
|
}
|
38
|
+
/**
|
39
|
+
* @internal
|
40
|
+
*/
|
40
41
|
function defineStrikeInputRule() {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
return defineMarkInputRule({
|
43
|
+
regex: canUseRegexLookbehind() ? /(?<=\s|^)~~([^\s~]|[^\s~][^~]*[^\s~])~~$/ : /~~([^\s~]|[^\s~][^~]*[^\s~])~~$/,
|
44
|
+
type: "strike"
|
45
|
+
});
|
45
46
|
}
|
47
|
+
/**
|
48
|
+
* @public
|
49
|
+
*/
|
46
50
|
function defineStrike() {
|
47
|
-
|
48
|
-
defineStrikeSpec(),
|
49
|
-
defineStrikeCommands(),
|
50
|
-
defineStrikeKeymap(),
|
51
|
-
defineStrikeInputRule()
|
52
|
-
);
|
51
|
+
return union(defineStrikeSpec(), defineStrikeCommands(), defineStrikeKeymap(), defineStrikeInputRule());
|
53
52
|
}
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
defineStrikeInputRule,
|
58
|
-
defineStrikeKeymap,
|
59
|
-
defineStrikeSpec
|
60
|
-
};
|
53
|
+
|
54
|
+
//#endregion
|
55
|
+
export { defineStrike, defineStrikeCommands, defineStrikeInputRule, defineStrikeKeymap, defineStrikeSpec };
|
@@ -1,26 +1,237 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
1
|
+
import { Extension, FindParentNodeResult, PlainExtension, Union } from "@prosekit/core";
|
2
|
+
import { Command, Selection } from "@prosekit/pm/state";
|
3
|
+
import { Attrs, ProseMirrorNode, ResolvedPos } from "@prosekit/pm/model";
|
4
|
+
import { CellSelection } from "prosemirror-tables";
|
5
|
+
|
6
|
+
//#region src/table/table-commands.d.ts
|
7
|
+
/**
|
8
|
+
* @public
|
9
|
+
*/
|
10
|
+
/**
|
11
|
+
* @public
|
12
|
+
*/
|
13
|
+
interface InsertTableOptions {
|
14
|
+
/**
|
15
|
+
* The number of rows in the table.
|
16
|
+
*/
|
17
|
+
row: number;
|
18
|
+
/**
|
19
|
+
* The number of columns in the table.
|
20
|
+
*/
|
21
|
+
col: number;
|
22
|
+
/**
|
23
|
+
* Whether the table has a header row.
|
24
|
+
*
|
25
|
+
* @default false
|
26
|
+
*/
|
27
|
+
header?: boolean;
|
28
|
+
}
|
29
|
+
/**
|
30
|
+
* Insert a table node with the given number of rows and columns, and optionally
|
31
|
+
* a header row.
|
32
|
+
*
|
33
|
+
* @param options
|
34
|
+
*
|
35
|
+
* @public
|
36
|
+
*/
|
37
|
+
declare function insertTable(options: InsertTableOptions): Command;
|
38
|
+
/**
|
39
|
+
* When the selection is in a table node, create a default block after the table
|
40
|
+
* table, and move the cursor there.
|
41
|
+
*
|
42
|
+
* @public
|
43
|
+
*/
|
44
|
+
declare const exitTable: Command;
|
45
|
+
/**
|
46
|
+
* @public
|
47
|
+
*/
|
48
|
+
interface SelectTableColumnOptions {
|
49
|
+
/**
|
50
|
+
* A hit position of the table cell to select from. By default, the selection
|
51
|
+
* anchor will be used.
|
52
|
+
*/
|
53
|
+
anchor?: number;
|
54
|
+
/**
|
55
|
+
* A hit position of the table cell to select to. By default, the selection
|
56
|
+
* head will be used.
|
57
|
+
*/
|
58
|
+
head?: number;
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* @public
|
62
|
+
*/
|
63
|
+
declare function selectTableColumn(options?: SelectTableColumnOptions): Command;
|
64
|
+
/**
|
65
|
+
* @public
|
66
|
+
*/
|
67
|
+
interface SelectTableRowOptions {
|
68
|
+
/**
|
69
|
+
* A hit position of the table cell to select from. By default, the selection
|
70
|
+
* anchor will be used.
|
71
|
+
*/
|
72
|
+
anchor?: number;
|
73
|
+
/**
|
74
|
+
* A hit position of the table cell to select to. By default, the selection
|
75
|
+
* head will be used.
|
76
|
+
*/
|
77
|
+
head?: number;
|
78
|
+
}
|
79
|
+
/**
|
80
|
+
* @public
|
81
|
+
*/
|
82
|
+
declare function selectTableRow(options?: SelectTableRowOptions): Command;
|
83
|
+
/**
|
84
|
+
* @public
|
85
|
+
*/
|
86
|
+
interface SelectTableCellOptions {
|
87
|
+
/**
|
88
|
+
* A hit position of the table cell to select from. By default, the selection
|
89
|
+
* anchor will be used.
|
90
|
+
*/
|
91
|
+
pos?: number;
|
92
|
+
}
|
93
|
+
/**
|
94
|
+
* @public
|
95
|
+
*/
|
96
|
+
declare function selectTableCell(options?: SelectTableCellOptions): Command;
|
97
|
+
/**
|
98
|
+
* @public
|
99
|
+
*/
|
100
|
+
interface SelectTableOptions {
|
101
|
+
/**
|
102
|
+
* A hit position of the table to select from. By default, the selection
|
103
|
+
* anchor will be used.
|
104
|
+
*/
|
105
|
+
pos?: number;
|
106
|
+
}
|
107
|
+
/**
|
108
|
+
* @public
|
109
|
+
*/
|
110
|
+
declare function selectTable(options?: SelectTableOptions): Command;
|
111
|
+
/**
|
112
|
+
* @internal
|
113
|
+
*/
|
114
|
+
type TableCommandsExtension = Extension<{
|
115
|
+
Commands: {
|
116
|
+
insertTable: [options: InsertTableOptions];
|
117
|
+
exitTable: [];
|
118
|
+
selectTable: [options?: SelectTableOptions];
|
119
|
+
selectTableCell: [options?: SelectTableCellOptions];
|
120
|
+
selectTableColumn: [options?: SelectTableColumnOptions];
|
121
|
+
selectTableRow: [options?: SelectTableRowOptions];
|
122
|
+
addTableColumnBefore: [];
|
123
|
+
addTableColumnAfter: [];
|
124
|
+
addTableRowAbove: [];
|
125
|
+
addTableRowBelow: [];
|
126
|
+
deleteTable: [];
|
127
|
+
deleteTableColumn: [];
|
128
|
+
deleteTableRow: [];
|
129
|
+
deleteCellSelection: [];
|
130
|
+
mergeTableCells: [];
|
131
|
+
splitTableCell: [];
|
132
|
+
};
|
133
|
+
}>;
|
134
|
+
/**
|
135
|
+
* Adds commands for working with `table` nodes.
|
136
|
+
*
|
137
|
+
* @public
|
138
|
+
*/
|
139
|
+
declare function defineTableCommands(): TableCommandsExtension; //#endregion
|
140
|
+
//#region src/table/table-spec.d.ts
|
141
|
+
/**
|
142
|
+
* @public
|
143
|
+
*/
|
144
|
+
interface CellAttrs {
|
145
|
+
colspan: number;
|
146
|
+
rowspan: number;
|
147
|
+
colwidth: number[] | null;
|
148
|
+
}
|
149
|
+
/**
|
150
|
+
* @internal
|
151
|
+
*/
|
152
|
+
type TableSpecExtension = Extension<{
|
153
|
+
Nodes: {
|
154
|
+
table: Attrs;
|
155
|
+
};
|
156
|
+
}>;
|
157
|
+
/**
|
158
|
+
* @internal
|
159
|
+
*/
|
160
|
+
declare function defineTableSpec(): TableSpecExtension;
|
161
|
+
/**
|
162
|
+
* @internal
|
163
|
+
*/
|
164
|
+
type TableRowSpecExtension = Extension<{
|
165
|
+
Nodes: {
|
166
|
+
tableRow: Attrs;
|
167
|
+
};
|
168
|
+
}>;
|
169
|
+
/**
|
170
|
+
* @internal
|
171
|
+
*/
|
172
|
+
declare function defineTableRowSpec(): TableRowSpecExtension;
|
173
|
+
/**
|
174
|
+
* @internal
|
175
|
+
*/
|
176
|
+
type TableCellSpecExtension = Extension<{
|
177
|
+
Nodes: {
|
178
|
+
tableCell: CellAttrs;
|
179
|
+
};
|
180
|
+
}>;
|
181
|
+
/**
|
182
|
+
* @internal
|
183
|
+
*/
|
184
|
+
declare function defineTableCellSpec(): TableCellSpecExtension;
|
185
|
+
/**
|
186
|
+
* @internal
|
187
|
+
*/
|
188
|
+
type TableHeaderCellSpecExtension = Extension<{
|
189
|
+
Nodes: {
|
190
|
+
tableHeaderCell: CellAttrs;
|
191
|
+
};
|
192
|
+
}>;
|
193
|
+
declare function defineTableHeaderCellSpec(): TableHeaderCellSpecExtension;
|
194
|
+
|
195
|
+
//#endregion
|
196
|
+
//#region src/table/table.d.ts
|
197
|
+
/**
|
198
|
+
* @internal
|
199
|
+
*/
|
200
|
+
type TableExtension = Union<[TableSpecExtension, TableRowSpecExtension, TableCellSpecExtension, TableHeaderCellSpecExtension, TableCommandsExtension]>;
|
201
|
+
/**
|
202
|
+
* @public
|
203
|
+
*/
|
204
|
+
declare function defineTable(): TableExtension;
|
205
|
+
|
206
|
+
//#endregion
|
207
|
+
//#region src/table/table-plugins.d.ts
|
208
|
+
/**
|
209
|
+
* @public
|
210
|
+
*/
|
211
|
+
declare function defineTablePlugins(): PlainExtension;
|
212
|
+
|
213
|
+
//#endregion
|
214
|
+
//#region src/table/table-utils.d.ts
|
215
|
+
/**
|
216
|
+
* Checks if the given object is a `CellSelection` instance.
|
217
|
+
*
|
218
|
+
* @public
|
219
|
+
*/
|
220
|
+
declare function isCellSelection(value: unknown): value is CellSelection;
|
221
|
+
/**
|
222
|
+
* Find the closest table node.
|
223
|
+
*
|
224
|
+
* @internal
|
225
|
+
*/
|
226
|
+
declare function findTable($pos: ResolvedPos): FindParentNodeResult | undefined;
|
227
|
+
|
228
|
+
//#endregion
|
229
|
+
/**
|
230
|
+
* Try to find the anchor and head cell in the same table by using the given
|
231
|
+
* anchor and head as hit points, or fallback to the selection's anchor and
|
232
|
+
* head.
|
233
|
+
*
|
234
|
+
* @internal
|
235
|
+
*/
|
236
|
+
|
237
|
+
export { InsertTableOptions, SelectTableCellOptions, SelectTableColumnOptions, SelectTableOptions, SelectTableRowOptions, TableCellSpecExtension, TableCommandsExtension, TableExtension, TableHeaderCellSpecExtension, TableRowSpecExtension, TableSpecExtension, defineTable, defineTableCellSpec, defineTableCommands, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, selectTable, selectTableCell, selectTableColumn, selectTableRow };
|
@@ -1,34 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
defineTableCommands,
|
5
|
-
defineTableHeaderCellSpec,
|
6
|
-
defineTablePlugins,
|
7
|
-
defineTableRowSpec,
|
8
|
-
defineTableSpec,
|
9
|
-
exitTable,
|
10
|
-
findTable,
|
11
|
-
insertTable,
|
12
|
-
isCellSelection,
|
13
|
-
selectTable,
|
14
|
-
selectTableCell,
|
15
|
-
selectTableColumn,
|
16
|
-
selectTableRow
|
17
|
-
} from "./chunk-HFAZX2J3.js";
|
18
|
-
export {
|
19
|
-
defineTable,
|
20
|
-
defineTableCellSpec,
|
21
|
-
defineTableCommands,
|
22
|
-
defineTableHeaderCellSpec,
|
23
|
-
defineTablePlugins,
|
24
|
-
defineTableRowSpec,
|
25
|
-
defineTableSpec,
|
26
|
-
exitTable,
|
27
|
-
findTable,
|
28
|
-
insertTable,
|
29
|
-
isCellSelection,
|
30
|
-
selectTable,
|
31
|
-
selectTableCell,
|
32
|
-
selectTableColumn,
|
33
|
-
selectTableRow
|
34
|
-
};
|
1
|
+
import { defineTable, defineTableCellSpec, defineTableCommands, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, selectTable, selectTableCell, selectTableColumn, selectTableRow } from "./table-DnVliJ6E.js";
|
2
|
+
|
3
|
+
export { defineTable, defineTableCellSpec, defineTableCommands, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, selectTable, selectTableCell, selectTableColumn, selectTableRow };
|
@@ -1,8 +1,72 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
import { Extension, PlainExtension, Union } from "@prosekit/core";
|
2
|
+
import { Command } from "@prosekit/pm/state";
|
3
|
+
|
4
|
+
//#region src/text-align/index.d.ts
|
5
|
+
/**
|
6
|
+
* @public
|
7
|
+
*/
|
8
|
+
/**
|
9
|
+
* @public
|
10
|
+
*/
|
11
|
+
interface TextAlignOptions<NodeName extends string = string> {
|
12
|
+
/**
|
13
|
+
* The names of node to add the attribute to.
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
*
|
17
|
+
* ["paragraph", "heading"]
|
18
|
+
*/
|
19
|
+
types: NodeName[];
|
20
|
+
/**
|
21
|
+
* The default value for the attribute.
|
22
|
+
*
|
23
|
+
* @default "left"
|
24
|
+
*/
|
25
|
+
default?: string;
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* @internal
|
29
|
+
*/
|
30
|
+
type TextAlignAttrsExtension<NodeName extends string> = Extension<{
|
31
|
+
Nodes: { [K in NodeName]: {
|
32
|
+
textAlign: string | null;
|
33
|
+
} };
|
34
|
+
}>;
|
35
|
+
/**
|
36
|
+
* @internal
|
37
|
+
*/
|
38
|
+
declare function setTextAlign({
|
39
|
+
types,
|
40
|
+
value
|
41
|
+
}: {
|
42
|
+
types: string[];
|
43
|
+
value: string | null;
|
44
|
+
}): Command;
|
45
|
+
/**
|
46
|
+
* @internal
|
47
|
+
*/
|
48
|
+
type TextAlignCommandsExtension = Extension<{
|
49
|
+
Commands: {
|
50
|
+
setTextAlign: [value: string | null];
|
51
|
+
};
|
52
|
+
}>;
|
53
|
+
/**
|
54
|
+
* @internal
|
55
|
+
*/
|
56
|
+
declare function defineTextAlignCommands(types: string[]): TextAlignCommandsExtension;
|
57
|
+
/**
|
58
|
+
* @internal
|
59
|
+
*/
|
60
|
+
declare function defineTextAlignKeymap(types: string[]): PlainExtension;
|
61
|
+
/**
|
62
|
+
* @internal
|
63
|
+
*/
|
64
|
+
type TextAlignExtension<NodeName extends string> = Union<[TextAlignAttrsExtension<NodeName>, TextAlignCommandsExtension]>;
|
65
|
+
/**
|
66
|
+
* Adds a `textAlign` attribute to the specified nodes. This will be rendered as
|
67
|
+
* a CSS `text-align` style.
|
68
|
+
*
|
69
|
+
* @public
|
70
|
+
*/
|
71
|
+
declare function defineTextAlign<NodeName extends string = string>(options: TextAlignOptions<NodeName>): TextAlignExtension<NodeName>; //#endregion
|
72
|
+
export { TextAlignAttrsExtension, TextAlignCommandsExtension, TextAlignExtension, TextAlignOptions, defineTextAlign, defineTextAlignCommands, defineTextAlignKeymap, setTextAlign };
|