tiptap-markdown-react 0.17.1 → 0.18.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.
@@ -14,11 +14,6 @@ export interface TableSelectionInfo {
14
14
  export declare function getTableSelectionInfo(state: EditorState): TableSelectionInfo | null;
15
15
  /** 文档坐标是否落在 CellSelection 覆盖的某个单元格内(含单元格节点本身)。 */
16
16
  export declare function isPosInCellSelection(selection: CellSelection, pos: number): boolean;
17
- /**
18
- * 表内右键:若点击落在已有多格选区内则保留选区;
19
- * 否则把光标落到点击位置(单格操作)。
20
- */
21
- export declare function preserveTableSelectionOnContextMenu(editor: Editor, pos: number): void;
22
17
  export declare function addRowsBefore(editor: Editor, count: number): boolean;
23
18
  export declare function addRowsAfter(editor: Editor, count: number): boolean;
24
19
  export declare function addColumnsBefore(editor: Editor, count: number): boolean;
@@ -27,3 +22,28 @@ export declare function addColumnsAfter(editor: Editor, count: number): boolean;
27
22
  export declare function deleteSelectedRows(editor: Editor): boolean;
28
23
  /** 删列:选区覆盖全部列且同时覆盖全部行时删整表;仅覆盖全部列时失败(由 UI 禁用)。 */
29
24
  export declare function deleteSelectedColumns(editor: Editor): boolean;
25
+ /**
26
+ * 清空选中单元格的**内容**,保留单元格本身与它的属性(表头行因此不会被降级)。
27
+ *
28
+ * 单元格必须至少留一个块,所以内容替换成一个空段落。已经空的单元格跳过——不改动、
29
+ * 也不产生多余的撤销步。返回是否真的改了文档。
30
+ */
31
+ export declare function clearSelectedCellContents(editor: Editor): boolean;
32
+ /**
33
+ * 把选中单元格的**样式属性**复位(列宽、对齐等,按各属性的 schema 默认值)。
34
+ *
35
+ * 不动 `colspan` / `rowspan`:那是结构,复位它们会让表格形状不合法(缺格)。
36
+ * (扩展有 `mergeCells` / `splitCell`,但本库不暴露入口——GFM 没有 colspan,合并导出成
37
+ * `| 1<br>2 | |` 且回不去,见 README。)
38
+ */
39
+ export declare function resetSelectedCellStyles(editor: Editor): boolean;
40
+ /**
41
+ * 在表格末尾追加一行(表底那个 `+`)。
42
+ * 先把最后一行选成 CellSelection——扩展的 `addRowAfter` 是按选区办事的。
43
+ */
44
+ export declare function appendRowToTable(editor: Editor): boolean;
45
+ /**
46
+ * 在表格末尾追加一列(表格右侧那个 `+`)。
47
+ * 同理先把最后一列选成 CellSelection。
48
+ */
49
+ export declare function appendColumnToTable(editor: Editor): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiptap-markdown-react",
3
- "version": "0.17.1",
3
+ "version": "0.18.0",
4
4
  "description": "A batteries-included, self-styled Markdown WYSIWYG editor and reader suite built on Tiptap v3. Markdown in/out, SSR/static rendering, table of contents, themeable via CSS variables, zero Ant Design.",
5
5
  "type": "module",
6
6
  "license": "MIT",