@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.
Files changed (100) hide show
  1. package/dist/commit/style.css +2 -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 +8 -5
  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 +21 -17
  10. package/dist/loro/style.js +0 -0
  11. package/dist/mark-rule-wEOcDt6i.js +160 -0
  12. package/dist/placeholder/style.css +5 -5
  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 +122 -174
  16. package/dist/prosekit-extensions-blockquote.d.ts +51 -8
  17. package/dist/prosekit-extensions-blockquote.js +64 -78
  18. package/dist/prosekit-extensions-bold.d.ts +61 -8
  19. package/dist/prosekit-extensions-bold.js +61 -73
  20. package/dist/prosekit-extensions-code-block.d.ts +172 -20
  21. package/dist/prosekit-extensions-code-block.js +201 -184
  22. package/dist/prosekit-extensions-code.d.ts +61 -8
  23. package/dist/prosekit-extensions-code.js +44 -55
  24. package/dist/prosekit-extensions-commit.d.ts +53 -4
  25. package/dist/prosekit-extensions-commit.js +142 -183
  26. package/dist/prosekit-extensions-doc.d.ts +22 -0
  27. package/dist/prosekit-extensions-doc.js +16 -0
  28. package/dist/prosekit-extensions-drop-cursor.d.ts +34 -3
  29. package/dist/prosekit-extensions-drop-cursor.js +14 -8
  30. package/dist/prosekit-extensions-enter-rule.d.ts +106 -5
  31. package/dist/prosekit-extensions-enter-rule.js +3 -8
  32. package/dist/prosekit-extensions-file.d.ts +126 -8
  33. package/dist/prosekit-extensions-file.js +111 -132
  34. package/dist/prosekit-extensions-gap-cursor.d.ts +29 -2
  35. package/dist/prosekit-extensions-gap-cursor.js +21 -9
  36. package/dist/prosekit-extensions-hard-break.d.ts +58 -0
  37. package/dist/prosekit-extensions-hard-break.js +58 -0
  38. package/dist/prosekit-extensions-heading.d.ts +69 -9
  39. package/dist/prosekit-extensions-heading.js +121 -95
  40. package/dist/prosekit-extensions-horizontal-rule.d.ts +41 -8
  41. package/dist/prosekit-extensions-horizontal-rule.js +53 -71
  42. package/dist/prosekit-extensions-image.d.ts +53 -7
  43. package/dist/prosekit-extensions-image.js +71 -62
  44. package/dist/prosekit-extensions-input-rule.d.ts +134 -6
  45. package/dist/prosekit-extensions-input-rule.js +3 -14
  46. package/dist/prosekit-extensions-italic.d.ts +61 -8
  47. package/dist/prosekit-extensions-italic.js +51 -63
  48. package/dist/prosekit-extensions-link.d.ts +65 -10
  49. package/dist/prosekit-extensions-link.js +95 -100
  50. package/dist/prosekit-extensions-list.d.ts +114 -17
  51. package/dist/prosekit-extensions-list.js +115 -158
  52. package/dist/prosekit-extensions-loro.d.ts +78 -11
  53. package/dist/prosekit-extensions-loro.js +49 -77
  54. package/dist/prosekit-extensions-mark-rule.d.ts +41 -2
  55. package/dist/prosekit-extensions-mark-rule.js +3 -6
  56. package/dist/prosekit-extensions-mention.d.ts +40 -4
  57. package/dist/prosekit-extensions-mention.js +52 -50
  58. package/dist/prosekit-extensions-mod-click-prevention.d.ts +20 -2
  59. package/dist/prosekit-extensions-mod-click-prevention.js +20 -16
  60. package/dist/prosekit-extensions-paragraph.d.ts +65 -0
  61. package/dist/prosekit-extensions-paragraph.js +60 -0
  62. package/dist/prosekit-extensions-placeholder.d.ts +32 -2
  63. package/dist/prosekit-extensions-placeholder.js +39 -56
  64. package/dist/prosekit-extensions-readonly.d.ts +13 -1
  65. package/dist/prosekit-extensions-readonly.js +13 -14
  66. package/dist/prosekit-extensions-search.d.ts +77 -3
  67. package/dist/prosekit-extensions-search.js +48 -47
  68. package/dist/prosekit-extensions-strike.d.ts +50 -8
  69. package/dist/prosekit-extensions-strike.js +44 -49
  70. package/dist/prosekit-extensions-table.d.ts +237 -26
  71. package/dist/prosekit-extensions-table.js +3 -34
  72. package/dist/prosekit-extensions-text-align.d.ts +72 -8
  73. package/dist/prosekit-extensions-text-align.js +63 -44
  74. package/dist/prosekit-extensions-text.d.ts +22 -0
  75. package/dist/prosekit-extensions-text.js +15 -0
  76. package/dist/prosekit-extensions-underline.d.ts +46 -7
  77. package/dist/prosekit-extensions-underline.js +33 -37
  78. package/dist/prosekit-extensions-virtual-selection.d.ts +24 -2
  79. package/dist/prosekit-extensions-virtual-selection.js +49 -52
  80. package/dist/prosekit-extensions-yjs.d.ts +99 -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 +5 -5
  84. package/dist/search/style.js +0 -0
  85. package/dist/shiki-highlighter-chunk-Cd3WeOKL.d.ts +19 -0
  86. package/dist/shiki-highlighter-chunk.d.ts +2 -0
  87. package/dist/shiki-highlighter-chunk.js +34 -43
  88. package/dist/table/style.css +18 -17
  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 +15 -17
  94. package/dist/yjs/style.js +0 -0
  95. package/package.json +103 -52
  96. package/dist/_tsup-dts-rollup.d.ts +0 -2500
  97. package/dist/chunk-6UYLCVBX.js +0 -185
  98. package/dist/chunk-BV3SHIMW.js +0 -98
  99. package/dist/chunk-D54VSLLS.js +0 -105
  100. package/dist/chunk-HFAZX2J3.js +0 -306
@@ -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,50 @@
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
+ * @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
- defineMarkInputRule
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
- // 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,237 @@
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
+ /**
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
- 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-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
- export { setTextAlign } from './_tsup-dts-rollup.js';
2
- export { defineTextAlignCommands } from './_tsup-dts-rollup.js';
3
- export { defineTextAlignKeymap } from './_tsup-dts-rollup.js';
4
- export { defineTextAlign } from './_tsup-dts-rollup.js';
5
- export { TextAlignOptions } from './_tsup-dts-rollup.js';
6
- export { TextAlignAttrsExtension } from './_tsup-dts-rollup.js';
7
- export { TextAlignCommandsExtension } from './_tsup-dts-rollup.js';
8
- export { TextAlignExtension } from './_tsup-dts-rollup.js';
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 };