@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.
Files changed (100) hide show
  1. package/dist/commit/style.css +1 -1
  2. package/dist/commit/style.js +0 -0
  3. package/dist/enter-rule-RdhEA900.js +96 -0
  4. package/dist/gap-cursor/style.css +6 -3
  5. package/dist/gap-cursor/style.js +0 -0
  6. package/dist/input-rule-Gji4N7Oe.js +93 -0
  7. package/dist/list/style.css +7 -7
  8. package/dist/list/style.js +0 -0
  9. package/dist/loro/style.css +13 -9
  10. package/dist/loro/style.js +0 -0
  11. package/dist/mark-rule-wEOcDt6i.js +160 -0
  12. package/dist/placeholder/style.css +3 -3
  13. package/dist/placeholder/style.js +0 -0
  14. package/dist/prosekit-extensions-autocomplete.d.ts +33 -3
  15. package/dist/prosekit-extensions-autocomplete.js +126 -174
  16. package/dist/prosekit-extensions-blockquote.d.ts +48 -8
  17. package/dist/prosekit-extensions-blockquote.js +64 -78
  18. package/dist/prosekit-extensions-bold.d.ts +54 -8
  19. package/dist/prosekit-extensions-bold.js +61 -73
  20. package/dist/prosekit-extensions-code-block.d.ts +159 -20
  21. package/dist/prosekit-extensions-code-block.js +201 -184
  22. package/dist/prosekit-extensions-code.d.ts +54 -8
  23. package/dist/prosekit-extensions-code.js +44 -56
  24. package/dist/prosekit-extensions-commit.d.ts +52 -4
  25. package/dist/prosekit-extensions-commit.js +140 -183
  26. package/dist/prosekit-extensions-doc.d.ts +19 -2
  27. package/dist/prosekit-extensions-doc.js +14 -12
  28. package/dist/prosekit-extensions-drop-cursor.d.ts +35 -3
  29. package/dist/prosekit-extensions-drop-cursor.js +14 -8
  30. package/dist/prosekit-extensions-enter-rule.d.ts +105 -5
  31. package/dist/prosekit-extensions-enter-rule.js +3 -8
  32. package/dist/prosekit-extensions-file.d.ts +129 -8
  33. package/dist/prosekit-extensions-file.js +124 -132
  34. package/dist/prosekit-extensions-gap-cursor.d.ts +26 -2
  35. package/dist/prosekit-extensions-gap-cursor.js +21 -9
  36. package/dist/prosekit-extensions-hard-break.d.ts +53 -0
  37. package/dist/prosekit-extensions-hard-break.js +58 -0
  38. package/dist/prosekit-extensions-heading.d.ts +63 -9
  39. package/dist/prosekit-extensions-heading.js +121 -95
  40. package/dist/prosekit-extensions-horizontal-rule.d.ts +38 -8
  41. package/dist/prosekit-extensions-horizontal-rule.js +53 -71
  42. package/dist/prosekit-extensions-image.d.ts +50 -7
  43. package/dist/prosekit-extensions-image.js +71 -62
  44. package/dist/prosekit-extensions-input-rule.d.ts +129 -6
  45. package/dist/prosekit-extensions-input-rule.js +3 -14
  46. package/dist/prosekit-extensions-italic.d.ts +54 -8
  47. package/dist/prosekit-extensions-italic.js +51 -63
  48. package/dist/prosekit-extensions-link.d.ts +62 -10
  49. package/dist/prosekit-extensions-link.js +95 -100
  50. package/dist/prosekit-extensions-list.d.ts +104 -17
  51. package/dist/prosekit-extensions-list.js +115 -158
  52. package/dist/prosekit-extensions-loro.d.ts +69 -11
  53. package/dist/prosekit-extensions-loro.js +49 -77
  54. package/dist/prosekit-extensions-mark-rule.d.ts +37 -2
  55. package/dist/prosekit-extensions-mark-rule.js +3 -6
  56. package/dist/prosekit-extensions-mention.d.ts +39 -4
  57. package/dist/prosekit-extensions-mention.js +52 -50
  58. package/dist/prosekit-extensions-mod-click-prevention.d.ts +17 -2
  59. package/dist/prosekit-extensions-mod-click-prevention.js +20 -16
  60. package/dist/prosekit-extensions-paragraph.d.ts +60 -7
  61. package/dist/prosekit-extensions-paragraph.js +46 -45
  62. package/dist/prosekit-extensions-placeholder.d.ts +33 -2
  63. package/dist/prosekit-extensions-placeholder.js +39 -56
  64. package/dist/prosekit-extensions-readonly.d.ts +10 -1
  65. package/dist/prosekit-extensions-readonly.js +13 -14
  66. package/dist/prosekit-extensions-search.d.ts +74 -3
  67. package/dist/prosekit-extensions-search.js +48 -47
  68. package/dist/prosekit-extensions-strike.d.ts +47 -8
  69. package/dist/prosekit-extensions-strike.js +44 -49
  70. package/dist/prosekit-extensions-table.d.ts +231 -26
  71. package/dist/prosekit-extensions-table.js +3 -34
  72. package/dist/prosekit-extensions-text-align.d.ts +71 -8
  73. package/dist/prosekit-extensions-text-align.js +63 -44
  74. package/dist/prosekit-extensions-text.d.ts +19 -2
  75. package/dist/prosekit-extensions-text.js +13 -11
  76. package/dist/prosekit-extensions-underline.d.ts +43 -7
  77. package/dist/prosekit-extensions-underline.js +33 -37
  78. package/dist/prosekit-extensions-virtual-selection.d.ts +21 -2
  79. package/dist/prosekit-extensions-virtual-selection.js +49 -52
  80. package/dist/prosekit-extensions-yjs.d.ts +90 -14
  81. package/dist/prosekit-extensions-yjs.js +88 -131
  82. package/dist/prosekit-extensions.d.ts +1 -1
  83. package/dist/search/style.css +4 -3
  84. package/dist/search/style.js +0 -0
  85. package/dist/shiki-highlighter-chunk-CZGvZlhf.d.ts +18 -0
  86. package/dist/shiki-highlighter-chunk.d.ts +2 -0
  87. package/dist/shiki-highlighter-chunk.js +32 -39
  88. package/dist/table/style.css +10 -13
  89. package/dist/table/style.js +0 -0
  90. package/dist/table-DnVliJ6E.js +287 -0
  91. package/dist/virtual-selection/style.css +2 -2
  92. package/dist/virtual-selection/style.js +0 -0
  93. package/dist/yjs/style.css +9 -8
  94. package/dist/yjs/style.js +0 -0
  95. package/package.json +81 -54
  96. package/dist/_tsup-dts-rollup.d.ts +0 -2459
  97. package/dist/chunk-6UYLCVBX.js +0 -185
  98. package/dist/chunk-D54VSLLS.js +0 -105
  99. package/dist/chunk-I2UMHK3L.js +0 -99
  100. package/dist/chunk-QVFEYPQ6.js +0 -306
@@ -1,3 +1,74 @@
1
- export { defineSearchQuery } from './_tsup-dts-rollup.js';
2
- export { defineSearchCommands } from './_tsup-dts-rollup.js';
3
- export { SearchQueryOptions } from './_tsup-dts-rollup.js';
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
- // src/search/index.ts
2
- import {
3
- defineCommands,
4
- definePlugin
5
- } from "@prosekit/core";
6
- import {
7
- findNext,
8
- findNextNoWrap,
9
- findPrev,
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
- const query = new SearchQuery(options);
20
- return definePlugin(search({ initialQuery: query }));
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
- if (view.isDestroyed) return;
24
- const active = view.dom.querySelector(".ProseMirror-active-search-match");
25
- active?.scrollIntoView({
26
- block: "nearest",
27
- inline: "nearest",
28
- behavior: "smooth"
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
- return (state, dispatch, view) => {
33
- const result = command(state, dispatch, view);
34
- if (result && dispatch && view) {
35
- setTimeout(() => scrollActiveIntoView(view), 50);
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
- return defineCommands({
42
- findNext: () => withScrollActiveIntoView(findNext),
43
- findPrev: () => withScrollActiveIntoView(findPrev),
44
- findNextNoWrap: () => withScrollActiveIntoView(findNextNoWrap),
45
- findPrevNoWrap: () => withScrollActiveIntoView(findPrevNoWrap),
46
- replaceNext: () => withScrollActiveIntoView(replaceNext),
47
- replaceNextNoWrap: () => withScrollActiveIntoView(replaceNextNoWrap),
48
- replaceCurrent: () => withScrollActiveIntoView(replaceCurrent),
49
- replaceAll: () => withScrollActiveIntoView(replaceAll)
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
- export {
53
- defineSearchCommands,
54
- defineSearchQuery
55
- };
54
+
55
+ //#endregion
56
+ export { defineSearchCommands, defineSearchQuery };
@@ -1,8 +1,47 @@
1
- export { defineStrikeSpec } from './_tsup-dts-rollup.js';
2
- export { defineStrikeCommands } from './_tsup-dts-rollup.js';
3
- export { defineStrikeKeymap } from './_tsup-dts-rollup.js';
4
- export { defineStrikeInputRule } from './_tsup-dts-rollup.js';
5
- export { defineStrike } from './_tsup-dts-rollup.js';
6
- export { StrikeSpecExtension } from './_tsup-dts-rollup.js';
7
- export { StrikeCommandsExtension } from './_tsup-dts-rollup.js';
8
- export { StrikeExtension } from './_tsup-dts-rollup.js';
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
- defineMarkInputRule
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
- // src/strike/index.ts
6
- import {
7
- canUseRegexLookbehind,
8
- defineCommands,
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
- return defineMarkSpec({
16
- name: "strike",
17
- parseDOM: [
18
- { tag: "s" },
19
- { tag: "strike" },
20
- { tag: "del" },
21
- { style: "text-decoration=line-through" },
22
- { style: "text-decoration-line=line-through" }
23
- ],
24
- toDOM() {
25
- return ["s", 0];
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
- return defineCommands({
31
- toggleStrike: () => toggleMark({ type: "strike" })
32
- });
27
+ return defineCommands({ toggleStrike: () => toggleMark({ type: "strike" }) });
33
28
  }
29
+ /**
30
+ * @internal
31
+ */
34
32
  function defineStrikeKeymap() {
35
- return defineKeymap({
36
- "Mod-shift-s": toggleMark({ type: "strike" }),
37
- "Mod-shift-x": toggleMark({ type: "strike" })
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
- return defineMarkInputRule({
42
- regex: canUseRegexLookbehind() ? /(?<=\s|^)~~([^\s~]|[^\s~][^~]*[^\s~])~~$/ : /~~([^\s~]|[^\s~][^~]*[^\s~])~~$/,
43
- type: "strike"
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
- return union(
48
- defineStrikeSpec(),
49
- defineStrikeCommands(),
50
- defineStrikeKeymap(),
51
- defineStrikeInputRule()
52
- );
51
+ return union(defineStrikeSpec(), defineStrikeCommands(), defineStrikeKeymap(), defineStrikeInputRule());
53
52
  }
54
- export {
55
- defineStrike,
56
- defineStrikeCommands,
57
- defineStrikeInputRule,
58
- defineStrikeKeymap,
59
- defineStrikeSpec
60
- };
53
+
54
+ //#endregion
55
+ export { defineStrike, defineStrikeCommands, defineStrikeInputRule, defineStrikeKeymap, defineStrikeSpec };
@@ -1,26 +1,231 @@
1
- export { defineTable } from './_tsup-dts-rollup.js';
2
- export { TableExtension } from './_tsup-dts-rollup.js';
3
- export { defineTableCommands } from './_tsup-dts-rollup.js';
4
- export { exitTable } from './_tsup-dts-rollup.js';
5
- export { insertTable } from './_tsup-dts-rollup.js';
6
- export { selectTable } from './_tsup-dts-rollup.js';
7
- export { selectTableCell } from './_tsup-dts-rollup.js';
8
- export { selectTableColumn } from './_tsup-dts-rollup.js';
9
- export { selectTableRow } from './_tsup-dts-rollup.js';
10
- export { InsertTableOptions } from './_tsup-dts-rollup.js';
11
- export { SelectTableCellOptions } from './_tsup-dts-rollup.js';
12
- export { SelectTableColumnOptions } from './_tsup-dts-rollup.js';
13
- export { SelectTableOptions } from './_tsup-dts-rollup.js';
14
- export { SelectTableRowOptions } from './_tsup-dts-rollup.js';
15
- export { TableCommandsExtension } from './_tsup-dts-rollup.js';
16
- export { defineTablePlugins } from './_tsup-dts-rollup.js';
17
- export { defineTableCellSpec } from './_tsup-dts-rollup.js';
18
- export { defineTableHeaderCellSpec } from './_tsup-dts-rollup.js';
19
- export { defineTableRowSpec } from './_tsup-dts-rollup.js';
20
- export { defineTableSpec } from './_tsup-dts-rollup.js';
21
- export { TableCellSpecExtension } from './_tsup-dts-rollup.js';
22
- export { TableHeaderCellSpecExtension } from './_tsup-dts-rollup.js';
23
- export { TableRowSpecExtension } from './_tsup-dts-rollup.js';
24
- export { TableSpecExtension } from './_tsup-dts-rollup.js';
25
- export { findTable } from './_tsup-dts-rollup.js';
26
- export { isCellSelection } from './_tsup-dts-rollup.js';
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
- defineTable,
3
- defineTableCellSpec,
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 };