@prosekit/extensions 0.8.0 → 0.9.1
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 +1 -1
- package/dist/commit/style.js +0 -0
- package/dist/enter-rule-RdhEA900.js +96 -0
- package/dist/gap-cursor/style.css +6 -3
- 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 +13 -9
- package/dist/loro/style.js +0 -0
- package/dist/mark-rule-wEOcDt6i.js +160 -0
- package/dist/placeholder/style.css +3 -3
- package/dist/placeholder/style.js +0 -0
- package/dist/prosekit-extensions-autocomplete.d.ts +33 -3
- package/dist/prosekit-extensions-autocomplete.js +126 -174
- package/dist/prosekit-extensions-blockquote.d.ts +48 -8
- package/dist/prosekit-extensions-blockquote.js +64 -78
- package/dist/prosekit-extensions-bold.d.ts +54 -8
- package/dist/prosekit-extensions-bold.js +61 -73
- package/dist/prosekit-extensions-code-block.d.ts +159 -20
- package/dist/prosekit-extensions-code-block.js +201 -184
- package/dist/prosekit-extensions-code.d.ts +54 -8
- package/dist/prosekit-extensions-code.js +44 -56
- package/dist/prosekit-extensions-commit.d.ts +52 -4
- package/dist/prosekit-extensions-commit.js +140 -183
- package/dist/prosekit-extensions-doc.d.ts +19 -2
- package/dist/prosekit-extensions-doc.js +14 -12
- package/dist/prosekit-extensions-drop-cursor.d.ts +35 -3
- package/dist/prosekit-extensions-drop-cursor.js +14 -8
- package/dist/prosekit-extensions-enter-rule.d.ts +105 -5
- package/dist/prosekit-extensions-enter-rule.js +3 -8
- package/dist/prosekit-extensions-file.d.ts +129 -8
- package/dist/prosekit-extensions-file.js +124 -132
- package/dist/prosekit-extensions-gap-cursor.d.ts +26 -2
- package/dist/prosekit-extensions-gap-cursor.js +21 -9
- package/dist/prosekit-extensions-hard-break.d.ts +53 -0
- package/dist/prosekit-extensions-hard-break.js +58 -0
- package/dist/prosekit-extensions-heading.d.ts +63 -9
- package/dist/prosekit-extensions-heading.js +121 -95
- package/dist/prosekit-extensions-horizontal-rule.d.ts +38 -8
- package/dist/prosekit-extensions-horizontal-rule.js +53 -71
- package/dist/prosekit-extensions-image.d.ts +50 -7
- package/dist/prosekit-extensions-image.js +71 -62
- package/dist/prosekit-extensions-input-rule.d.ts +129 -6
- package/dist/prosekit-extensions-input-rule.js +3 -14
- package/dist/prosekit-extensions-italic.d.ts +54 -8
- package/dist/prosekit-extensions-italic.js +51 -63
- package/dist/prosekit-extensions-link.d.ts +62 -10
- package/dist/prosekit-extensions-link.js +95 -100
- package/dist/prosekit-extensions-list.d.ts +104 -17
- package/dist/prosekit-extensions-list.js +115 -158
- package/dist/prosekit-extensions-loro.d.ts +69 -11
- package/dist/prosekit-extensions-loro.js +49 -77
- package/dist/prosekit-extensions-mark-rule.d.ts +37 -2
- package/dist/prosekit-extensions-mark-rule.js +3 -6
- package/dist/prosekit-extensions-mention.d.ts +39 -4
- package/dist/prosekit-extensions-mention.js +52 -50
- package/dist/prosekit-extensions-mod-click-prevention.d.ts +17 -2
- package/dist/prosekit-extensions-mod-click-prevention.js +20 -16
- package/dist/prosekit-extensions-paragraph.d.ts +60 -7
- package/dist/prosekit-extensions-paragraph.js +46 -45
- package/dist/prosekit-extensions-placeholder.d.ts +33 -2
- package/dist/prosekit-extensions-placeholder.js +39 -56
- package/dist/prosekit-extensions-readonly.d.ts +10 -1
- package/dist/prosekit-extensions-readonly.js +13 -14
- package/dist/prosekit-extensions-search.d.ts +74 -3
- package/dist/prosekit-extensions-search.js +48 -47
- package/dist/prosekit-extensions-strike.d.ts +47 -8
- package/dist/prosekit-extensions-strike.js +44 -49
- package/dist/prosekit-extensions-table.d.ts +231 -26
- package/dist/prosekit-extensions-table.js +3 -34
- package/dist/prosekit-extensions-text-align.d.ts +71 -8
- package/dist/prosekit-extensions-text-align.js +63 -44
- package/dist/prosekit-extensions-text.d.ts +19 -2
- package/dist/prosekit-extensions-text.js +13 -11
- package/dist/prosekit-extensions-underline.d.ts +43 -7
- package/dist/prosekit-extensions-underline.js +33 -37
- package/dist/prosekit-extensions-virtual-selection.d.ts +21 -2
- package/dist/prosekit-extensions-virtual-selection.js +49 -52
- package/dist/prosekit-extensions-yjs.d.ts +90 -14
- package/dist/prosekit-extensions-yjs.js +88 -131
- package/dist/prosekit-extensions.d.ts +1 -1
- package/dist/search/style.css +4 -3
- package/dist/search/style.js +0 -0
- package/dist/shiki-highlighter-chunk-CZGvZlhf.d.ts +18 -0
- package/dist/shiki-highlighter-chunk.d.ts +2 -0
- package/dist/shiki-highlighter-chunk.js +32 -39
- package/dist/table/style.css +10 -13
- 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 +9 -8
- package/dist/yjs/style.js +0 -0
- package/package.json +81 -54
- package/dist/_tsup-dts-rollup.d.ts +0 -2459
- package/dist/chunk-6UYLCVBX.js +0 -185
- package/dist/chunk-D54VSLLS.js +0 -105
- package/dist/chunk-I2UMHK3L.js +0 -99
- package/dist/chunk-QVFEYPQ6.js +0 -306
@@ -1,3 +1,74 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import { Extension, PlainExtension } from "@prosekit/core";
|
2
|
+
|
3
|
+
//#region src/search/index.d.ts
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Options for {@link defineSearchQuery}
|
7
|
+
*
|
8
|
+
* @public
|
9
|
+
*/
|
10
|
+
interface SearchQueryOptions {
|
11
|
+
/**
|
12
|
+
* The search string (or regular expression).
|
13
|
+
*/
|
14
|
+
search: string;
|
15
|
+
/**
|
16
|
+
* The replace text.
|
17
|
+
*/
|
18
|
+
replace?: string;
|
19
|
+
/**
|
20
|
+
* Indicates whether the search is case-sensitive
|
21
|
+
*
|
22
|
+
* @default false
|
23
|
+
*/
|
24
|
+
caseSensitive?: boolean;
|
25
|
+
/**
|
26
|
+
* By default, string search will replace `\n`, `\r`, and `\t` in the query
|
27
|
+
* with newline, return, and tab characters. When this is set to true, that
|
28
|
+
* behavior is disabled.
|
29
|
+
*
|
30
|
+
* @default false
|
31
|
+
*/
|
32
|
+
literal?: boolean;
|
33
|
+
/**
|
34
|
+
* When true, the search string is interpreted as a regular expression.
|
35
|
+
*
|
36
|
+
* @default false
|
37
|
+
*/
|
38
|
+
regexp?: boolean;
|
39
|
+
/**
|
40
|
+
* Enable whole-word matching.
|
41
|
+
*
|
42
|
+
* @default false
|
43
|
+
*/
|
44
|
+
wholeWord?: boolean;
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* Defines an extension that stores a current search query and replace string.
|
48
|
+
*
|
49
|
+
* @public
|
50
|
+
*/
|
51
|
+
declare function defineSearchQuery(options: SearchQueryOptions): PlainExtension;
|
52
|
+
/**
|
53
|
+
* @internal
|
54
|
+
*/
|
55
|
+
type SearchCommandsExtension = Extension<{
|
56
|
+
Commands: {
|
57
|
+
findNext: [];
|
58
|
+
findPrev: [];
|
59
|
+
findNextNoWrap: [];
|
60
|
+
findPrevNoWrap: [];
|
61
|
+
replaceNext: [];
|
62
|
+
replaceNextNoWrap: [];
|
63
|
+
replaceCurrent: [];
|
64
|
+
replaceAll: [];
|
65
|
+
};
|
66
|
+
}>;
|
67
|
+
/**
|
68
|
+
* Defines commands for search and replace.
|
69
|
+
*
|
70
|
+
* @public
|
71
|
+
*/
|
72
|
+
declare function defineSearchCommands(): SearchCommandsExtension;
|
73
|
+
//#endregion
|
74
|
+
export { SearchCommandsExtension, SearchQueryOptions, defineSearchCommands, defineSearchQuery };
|
@@ -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,47 @@
|
|
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
|
+
/**
|
7
|
+
* @internal
|
8
|
+
*/
|
9
|
+
type StrikeSpecExtension = Extension<{
|
10
|
+
Marks: {
|
11
|
+
strike: Attrs;
|
12
|
+
};
|
13
|
+
}>;
|
14
|
+
/**
|
15
|
+
* @internal
|
16
|
+
*/
|
17
|
+
declare function defineStrikeSpec(): StrikeSpecExtension;
|
18
|
+
/**
|
19
|
+
* @internal
|
20
|
+
*/
|
21
|
+
type StrikeCommandsExtension = Extension<{
|
22
|
+
Commands: {
|
23
|
+
toggleStrike: [];
|
24
|
+
};
|
25
|
+
}>;
|
26
|
+
/**
|
27
|
+
* @internal
|
28
|
+
*/
|
29
|
+
declare function defineStrikeCommands(): StrikeCommandsExtension;
|
30
|
+
/**
|
31
|
+
* @internal
|
32
|
+
*/
|
33
|
+
declare function defineStrikeKeymap(): PlainExtension;
|
34
|
+
/**
|
35
|
+
* @internal
|
36
|
+
*/
|
37
|
+
declare function defineStrikeInputRule(): PlainExtension;
|
38
|
+
/**
|
39
|
+
* @internal
|
40
|
+
*/
|
41
|
+
type StrikeExtension = Union<[StrikeSpecExtension, StrikeCommandsExtension]>;
|
42
|
+
/**
|
43
|
+
* @public
|
44
|
+
*/
|
45
|
+
declare function defineStrike(): StrikeExtension;
|
46
|
+
//#endregion
|
47
|
+
export { StrikeCommandsExtension, StrikeExtension, StrikeSpecExtension, defineStrike, defineStrikeCommands, defineStrikeInputRule, defineStrikeKeymap, defineStrikeSpec };
|
@@ -1,60 +1,55 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
} from "./chunk-I2UMHK3L.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,231 @@
|
|
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
|
+
interface InsertTableOptions {
|
11
|
+
/**
|
12
|
+
* The number of rows in the table.
|
13
|
+
*/
|
14
|
+
row: number;
|
15
|
+
/**
|
16
|
+
* The number of columns in the table.
|
17
|
+
*/
|
18
|
+
col: number;
|
19
|
+
/**
|
20
|
+
* Whether the table has a header row.
|
21
|
+
*
|
22
|
+
* @default false
|
23
|
+
*/
|
24
|
+
header?: boolean;
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Insert a table node with the given number of rows and columns, and optionally
|
28
|
+
* a header row.
|
29
|
+
*
|
30
|
+
* @param options
|
31
|
+
*
|
32
|
+
* @public
|
33
|
+
*/
|
34
|
+
declare function insertTable(options: InsertTableOptions): Command;
|
35
|
+
/**
|
36
|
+
* When the selection is in a table node, create a default block after the table
|
37
|
+
* table, and move the cursor there.
|
38
|
+
*
|
39
|
+
* @public
|
40
|
+
*/
|
41
|
+
declare const exitTable: Command;
|
42
|
+
/**
|
43
|
+
* @public
|
44
|
+
*/
|
45
|
+
interface SelectTableColumnOptions {
|
46
|
+
/**
|
47
|
+
* A hit position of the table cell to select from. By default, the selection
|
48
|
+
* anchor will be used.
|
49
|
+
*/
|
50
|
+
anchor?: number;
|
51
|
+
/**
|
52
|
+
* A hit position of the table cell to select to. By default, the selection
|
53
|
+
* head will be used.
|
54
|
+
*/
|
55
|
+
head?: number;
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* @public
|
59
|
+
*/
|
60
|
+
declare function selectTableColumn(options?: SelectTableColumnOptions): Command;
|
61
|
+
/**
|
62
|
+
* @public
|
63
|
+
*/
|
64
|
+
interface SelectTableRowOptions {
|
65
|
+
/**
|
66
|
+
* A hit position of the table cell to select from. By default, the selection
|
67
|
+
* anchor will be used.
|
68
|
+
*/
|
69
|
+
anchor?: number;
|
70
|
+
/**
|
71
|
+
* A hit position of the table cell to select to. By default, the selection
|
72
|
+
* head will be used.
|
73
|
+
*/
|
74
|
+
head?: number;
|
75
|
+
}
|
76
|
+
/**
|
77
|
+
* @public
|
78
|
+
*/
|
79
|
+
declare function selectTableRow(options?: SelectTableRowOptions): Command;
|
80
|
+
/**
|
81
|
+
* @public
|
82
|
+
*/
|
83
|
+
interface SelectTableCellOptions {
|
84
|
+
/**
|
85
|
+
* A hit position of the table cell to select from. By default, the selection
|
86
|
+
* anchor will be used.
|
87
|
+
*/
|
88
|
+
pos?: number;
|
89
|
+
}
|
90
|
+
/**
|
91
|
+
* @public
|
92
|
+
*/
|
93
|
+
declare function selectTableCell(options?: SelectTableCellOptions): Command;
|
94
|
+
/**
|
95
|
+
* @public
|
96
|
+
*/
|
97
|
+
interface SelectTableOptions {
|
98
|
+
/**
|
99
|
+
* A hit position of the table to select from. By default, the selection
|
100
|
+
* anchor will be used.
|
101
|
+
*/
|
102
|
+
pos?: number;
|
103
|
+
}
|
104
|
+
/**
|
105
|
+
* @public
|
106
|
+
*/
|
107
|
+
declare function selectTable(options?: SelectTableOptions): Command;
|
108
|
+
/**
|
109
|
+
* @internal
|
110
|
+
*/
|
111
|
+
type TableCommandsExtension = Extension<{
|
112
|
+
Commands: {
|
113
|
+
insertTable: [options: InsertTableOptions];
|
114
|
+
exitTable: [];
|
115
|
+
selectTable: [options?: SelectTableOptions];
|
116
|
+
selectTableCell: [options?: SelectTableCellOptions];
|
117
|
+
selectTableColumn: [options?: SelectTableColumnOptions];
|
118
|
+
selectTableRow: [options?: SelectTableRowOptions];
|
119
|
+
addTableColumnBefore: [];
|
120
|
+
addTableColumnAfter: [];
|
121
|
+
addTableRowAbove: [];
|
122
|
+
addTableRowBelow: [];
|
123
|
+
deleteTable: [];
|
124
|
+
deleteTableColumn: [];
|
125
|
+
deleteTableRow: [];
|
126
|
+
deleteCellSelection: [];
|
127
|
+
mergeTableCells: [];
|
128
|
+
splitTableCell: [];
|
129
|
+
};
|
130
|
+
}>;
|
131
|
+
/**
|
132
|
+
* Adds commands for working with `table` nodes.
|
133
|
+
*
|
134
|
+
* @public
|
135
|
+
*/
|
136
|
+
declare function defineTableCommands(): TableCommandsExtension;
|
137
|
+
//#endregion
|
138
|
+
//#region src/table/table-spec.d.ts
|
139
|
+
/**
|
140
|
+
* @public
|
141
|
+
*/
|
142
|
+
interface CellAttrs {
|
143
|
+
colspan: number;
|
144
|
+
rowspan: number;
|
145
|
+
colwidth: number[] | null;
|
146
|
+
}
|
147
|
+
/**
|
148
|
+
* @internal
|
149
|
+
*/
|
150
|
+
type TableSpecExtension = Extension<{
|
151
|
+
Nodes: {
|
152
|
+
table: Attrs;
|
153
|
+
};
|
154
|
+
}>;
|
155
|
+
/**
|
156
|
+
* @internal
|
157
|
+
*/
|
158
|
+
declare function defineTableSpec(): TableSpecExtension;
|
159
|
+
/**
|
160
|
+
* @internal
|
161
|
+
*/
|
162
|
+
type TableRowSpecExtension = Extension<{
|
163
|
+
Nodes: {
|
164
|
+
tableRow: Attrs;
|
165
|
+
};
|
166
|
+
}>;
|
167
|
+
/**
|
168
|
+
* @internal
|
169
|
+
*/
|
170
|
+
declare function defineTableRowSpec(): TableRowSpecExtension;
|
171
|
+
/**
|
172
|
+
* @internal
|
173
|
+
*/
|
174
|
+
type TableCellSpecExtension = Extension<{
|
175
|
+
Nodes: {
|
176
|
+
tableCell: CellAttrs;
|
177
|
+
};
|
178
|
+
}>;
|
179
|
+
/**
|
180
|
+
* @internal
|
181
|
+
*/
|
182
|
+
declare function defineTableCellSpec(): TableCellSpecExtension;
|
183
|
+
/**
|
184
|
+
* @internal
|
185
|
+
*/
|
186
|
+
type TableHeaderCellSpecExtension = Extension<{
|
187
|
+
Nodes: {
|
188
|
+
tableHeaderCell: CellAttrs;
|
189
|
+
};
|
190
|
+
}>;
|
191
|
+
declare function defineTableHeaderCellSpec(): TableHeaderCellSpecExtension;
|
192
|
+
//#endregion
|
193
|
+
//#region src/table/table.d.ts
|
194
|
+
/**
|
195
|
+
* @internal
|
196
|
+
*/
|
197
|
+
type TableExtension = Union<[TableSpecExtension, TableRowSpecExtension, TableCellSpecExtension, TableHeaderCellSpecExtension, TableCommandsExtension]>;
|
198
|
+
/**
|
199
|
+
* @public
|
200
|
+
*/
|
201
|
+
declare function defineTable(): TableExtension;
|
202
|
+
//#endregion
|
203
|
+
//#region src/table/table-plugins.d.ts
|
204
|
+
/**
|
205
|
+
* @public
|
206
|
+
*/
|
207
|
+
declare function defineTablePlugins(): PlainExtension;
|
208
|
+
//#endregion
|
209
|
+
//#region src/table/table-utils.d.ts
|
210
|
+
/**
|
211
|
+
* Checks if the given object is a `CellSelection` instance.
|
212
|
+
*
|
213
|
+
* @public
|
214
|
+
*/
|
215
|
+
declare function isCellSelection(value: unknown): value is CellSelection;
|
216
|
+
/**
|
217
|
+
* Find the closest table node.
|
218
|
+
*
|
219
|
+
* @internal
|
220
|
+
*/
|
221
|
+
declare function findTable($pos: ResolvedPos): FindParentNodeResult | undefined;
|
222
|
+
/**
|
223
|
+
* Try to find the anchor and head cell in the same table by using the given
|
224
|
+
* anchor and head as hit points, or fallback to the selection's anchor and
|
225
|
+
* head.
|
226
|
+
*
|
227
|
+
* @internal
|
228
|
+
*/
|
229
|
+
|
230
|
+
//#endregion
|
231
|
+
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-QVFEYPQ6.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 };
|