@milkdown/preset-gfm 6.1.3 → 6.2.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/lib/auto-link.d.ts.map +1 -1
- package/lib/footnote/definition.d.ts +1 -5
- package/lib/footnote/definition.d.ts.map +1 -1
- package/lib/footnote/reference.d.ts +1 -5
- package/lib/footnote/reference.d.ts.map +1 -1
- package/lib/index.d.ts +1 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.es.js +1671 -16
- package/lib/index.es.js.map +1 -1
- package/lib/strike-through.d.ts +1 -5
- package/lib/strike-through.d.ts.map +1 -1
- package/lib/table/command.d.ts +1 -1
- package/lib/table/command.d.ts.map +1 -1
- package/lib/table/nodes/cell-selection.d.ts +38 -0
- package/lib/table/nodes/cell-selection.d.ts.map +1 -0
- package/lib/table/nodes/column-resizing.d.ts +10 -0
- package/lib/table/nodes/column-resizing.d.ts.map +1 -0
- package/lib/table/nodes/commands.d.ts +30 -0
- package/lib/table/nodes/commands.d.ts.map +1 -0
- package/lib/table/nodes/copy-paste.d.ts +13 -0
- package/lib/table/nodes/copy-paste.d.ts.map +1 -0
- package/lib/table/nodes/fix-tables.d.ts +6 -0
- package/lib/table/nodes/fix-tables.d.ts.map +1 -0
- package/lib/table/nodes/index.d.ts +5 -23
- package/lib/table/nodes/index.d.ts.map +1 -1
- package/lib/table/nodes/schema.d.ts +3 -1
- package/lib/table/nodes/schema.d.ts.map +1 -1
- package/lib/table/nodes/table-editing.d.ts +9 -0
- package/lib/table/nodes/table-editing.d.ts.map +1 -0
- package/lib/table/nodes/table-map.d.ts +44 -0
- package/lib/table/nodes/table-map.d.ts.map +1 -0
- package/lib/table/nodes/table-view.d.ts +15 -0
- package/lib/table/nodes/table-view.d.ts.map +1 -0
- package/lib/table/nodes/types.d.ts +15 -0
- package/lib/table/nodes/types.d.ts.map +1 -0
- package/lib/table/nodes/util.d.ts +16 -0
- package/lib/table/nodes/util.d.ts.map +1 -0
- package/lib/table/operator-plugin/actions.d.ts +1 -1
- package/lib/table/operator-plugin/actions.d.ts.map +1 -1
- package/lib/table/operator-plugin/calc-pos.d.ts.map +1 -1
- package/lib/table/operator-plugin/helper.d.ts +1 -1
- package/lib/table/operator-plugin/helper.d.ts.map +1 -1
- package/lib/table/operator-plugin/index.d.ts +1 -1
- package/lib/table/operator-plugin/index.d.ts.map +1 -1
- package/lib/table/operator-plugin/widget.d.ts +4 -4
- package/lib/table/operator-plugin/widget.d.ts.map +1 -1
- package/lib/table/utils.d.ts +4 -4
- package/lib/table/utils.d.ts.map +1 -1
- package/lib/task-list-item.d.ts +1 -5
- package/lib/task-list-item.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/auto-link.ts +4 -3
- package/src/table/command.ts +3 -3
- package/src/table/nodes/cell-selection.ts +352 -0
- package/src/table/nodes/column-resizing.ts +260 -0
- package/src/table/nodes/commands.ts +551 -0
- package/src/table/nodes/copy-paste.ts +306 -0
- package/src/table/nodes/fix-tables.ts +117 -0
- package/src/table/nodes/index.ts +7 -1
- package/src/table/nodes/schema.ts +100 -2
- package/src/table/nodes/table-editing.ts +275 -0
- package/src/table/nodes/table-map.ts +280 -0
- package/src/table/nodes/table-view.ts +76 -0
- package/src/table/nodes/types.ts +16 -0
- package/src/table/nodes/util.ts +107 -0
- package/src/table/operator-plugin/actions.ts +4 -4
- package/src/table/operator-plugin/calc-pos.ts +2 -1
- package/src/table/operator-plugin/helper.ts +2 -1
- package/src/table/operator-plugin/index.ts +1 -1
- package/src/table/operator-plugin/widget.ts +4 -14
- package/src/table/utils.ts +5 -2
- package/src/task-list-item.ts +2 -1
package/lib/strike-through.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
export declare const ToggleStrikeThrough: import("@milkdown/core").CmdKey<undefined>;
|
|
2
|
-
export declare const strikeThrough: import("@milkdown/utils
|
|
3
|
-
id: string;
|
|
4
|
-
schema: (ctx: import("@milkdown/core").Ctx) => import("@milkdown/core").MarkSchema;
|
|
5
|
-
view?: ((ctx: import("@milkdown/core").Ctx) => import("@milkdown/prose").MarkViewFactory) | undefined;
|
|
6
|
-
}>;
|
|
2
|
+
export declare const strikeThrough: import("@milkdown/utils").MarkCreator<string, import("@milkdown/utils").UnknownRecord>;
|
|
7
3
|
//# sourceMappingURL=strike-through.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strike-through.d.ts","sourceRoot":"","sources":["../src/strike-through.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB,4CAAsC,CAAC;AAGvE,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"strike-through.d.ts","sourceRoot":"","sources":["../src/strike-through.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB,4CAAsC,CAAC;AAGvE,eAAO,MAAM,aAAa,wFAiCxB,CAAC"}
|
package/lib/table/command.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/table/command.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/table/command.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAa,MAAM,uBAAuB,CAAC;AAI3D,eAAO,MAAM,SAAS,SACX,QAAQ,KAAG,OAWjB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Node, ResolvedPos, Slice } from '@milkdown/prose/model';
|
|
2
|
+
import { EditorState, Selection, Transaction } from '@milkdown/prose/state';
|
|
3
|
+
import { Mappable } from '@milkdown/prose/transform';
|
|
4
|
+
import { DecorationSet } from '@milkdown/prose/view';
|
|
5
|
+
export declare class CellSelection extends Selection {
|
|
6
|
+
$anchorCell: ResolvedPos;
|
|
7
|
+
$headCell: ResolvedPos;
|
|
8
|
+
constructor($anchorCell: ResolvedPos, $headCell?: ResolvedPos);
|
|
9
|
+
map(doc: Node, mapping: Mappable): Selection;
|
|
10
|
+
content(): Slice;
|
|
11
|
+
replace(tr: Transaction, content?: Slice): void;
|
|
12
|
+
replaceWith(tr: Transaction, node: Node): void;
|
|
13
|
+
forEachCell(f: (node: Node, index: number) => void): void;
|
|
14
|
+
isColSelection(): boolean;
|
|
15
|
+
static colSelection($anchorCell: ResolvedPos, $headCell?: ResolvedPos): CellSelection;
|
|
16
|
+
isRowSelection(): boolean;
|
|
17
|
+
eq(other: Selection): boolean;
|
|
18
|
+
static rowSelection($anchorCell: ResolvedPos, $headCell?: ResolvedPos): CellSelection;
|
|
19
|
+
toJSON(): {
|
|
20
|
+
type: string;
|
|
21
|
+
anchor: number;
|
|
22
|
+
head: number;
|
|
23
|
+
};
|
|
24
|
+
static fromJSON(doc: Node, json: any): CellSelection;
|
|
25
|
+
static create(doc: Node, anchorCell: number, headCell?: number): CellSelection;
|
|
26
|
+
getBookmark(): CellBookmark;
|
|
27
|
+
}
|
|
28
|
+
declare class CellBookmark {
|
|
29
|
+
anchor: number;
|
|
30
|
+
head: number;
|
|
31
|
+
constructor(anchor: number, head: number);
|
|
32
|
+
map(mapping: Mappable): CellBookmark;
|
|
33
|
+
resolve(doc: Node): Selection;
|
|
34
|
+
}
|
|
35
|
+
export declare function drawCellSelection(state: EditorState): DecorationSet | null;
|
|
36
|
+
export declare function normalizeSelection(state: EditorState, tr: Transaction | undefined, allowTableNodeSelection: boolean): Transaction | undefined;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=cell-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-selection.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/cell-selection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACH,WAAW,EAEX,SAAS,EAGT,WAAW,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAc,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAUjE,qBAAa,aAAc,SAAQ,SAAS;IAMrB,WAAW,EAAE,WAAW;IAAS,SAAS;gBAA1C,WAAW,EAAE,WAAW,EAAS,SAAS,cAAc;IA2B3E,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,GAAG,SAAS;IAenC,OAAO,IAAI,KAAK;IA2ChB,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,QAAc;IAY9C,WAAW,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI;IAIhD,WAAW,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI;IAYlD,cAAc;IAYd,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,cAAc;IA+BrE,cAAc;IAWd,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO;IAW7B,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,cAAc;IA6BrE,MAAM;;;;;WASU,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG;IAK7C,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,SAAa;IAIzD,WAAW;CAGvB;AAMD,cAAM,YAAY;IACK,MAAM,EAAE,MAAM;IAAS,IAAI,EAAE,MAAM;gBAAnC,MAAM,EAAE,MAAM,EAAS,IAAI,EAAE,MAAM;IAItD,GAAG,CAAC,OAAO,EAAE,QAAQ;IAGrB,OAAO,CAAC,GAAG,EAAE,IAAI,GAAG,SAAS;CAahC;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,wBAOnD;AAmCD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,GAAG,SAAS,EAAE,uBAAuB,EAAE,OAAO,2BAwBnH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Plugin, PluginKey } from '@milkdown/prose/state';
|
|
2
|
+
import { TableView } from './table-view';
|
|
3
|
+
export declare const key: PluginKey<any>;
|
|
4
|
+
export declare function columnResizing({ handleWidth, cellMinWidth, View, lastColumnResizable, }?: {
|
|
5
|
+
handleWidth?: number | undefined;
|
|
6
|
+
cellMinWidth?: number | undefined;
|
|
7
|
+
View?: typeof TableView | undefined;
|
|
8
|
+
lastColumnResizable?: boolean | undefined;
|
|
9
|
+
}): Plugin<any>;
|
|
10
|
+
//# sourceMappingURL=column-resizing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-resizing.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/column-resizing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,MAAM,EAAE,SAAS,EAAe,MAAM,uBAAuB,CAAC;AAKpF,OAAO,EAAE,SAAS,EAAiB,MAAM,cAAc,CAAC;AAGxD,eAAO,MAAM,GAAG,gBAAuC,CAAC;AAExD,wBAAgB,cAAc,CAAC,EAC3B,WAAe,EACf,YAAiB,EACjB,IAAgB,EAChB,mBAA0B,GAC7B;;;;;CAAK,eA2CL"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Node, NodeType } from '@milkdown/prose/model';
|
|
2
|
+
import { Command, EditorState, Transaction } from '@milkdown/prose/state';
|
|
3
|
+
import { Rect, TableMap } from './table-map';
|
|
4
|
+
export declare function selectedRect(state: EditorState): Required<Rect>;
|
|
5
|
+
export declare function addColumn(tr: Transaction, { map, tableStart, table }: Rect, col: number): Transaction;
|
|
6
|
+
export declare const addColumnBefore: Command;
|
|
7
|
+
export declare const addColumnAfter: Command;
|
|
8
|
+
export declare function removeColumn(tr: Transaction, { map, table, tableStart }: Rect, col: number): void;
|
|
9
|
+
export declare const deleteColumn: Command;
|
|
10
|
+
export declare function rowIsHeader(map: TableMap, table: Node, row: number): boolean;
|
|
11
|
+
export declare function addRow(tr: Transaction, { map, tableStart, table }: Rect, row: number): Transaction;
|
|
12
|
+
export declare function addRowBefore(state: EditorState, dispatch?: (tr: Transaction) => boolean): boolean;
|
|
13
|
+
export declare function addRowAfter(state: EditorState, dispatch?: (tr: Transaction) => boolean): boolean;
|
|
14
|
+
export declare function removeRow(tr: Transaction, { map, tableStart, table }: Rect, row: number): void;
|
|
15
|
+
export declare const deleteRow: Command;
|
|
16
|
+
export declare function mergeCells(state: EditorState, dispatch?: (tr: Transaction) => boolean): boolean;
|
|
17
|
+
export declare function splitCell(state: EditorState, dispatch?: (tr: Transaction) => boolean): boolean;
|
|
18
|
+
export declare function splitCellWithType(getCellType: (pos: {
|
|
19
|
+
row: number;
|
|
20
|
+
col: number;
|
|
21
|
+
node: Node;
|
|
22
|
+
}) => NodeType): (state: EditorState, dispatch?: ((tr: Transaction) => boolean) | undefined) => boolean;
|
|
23
|
+
export declare function setCellAttr<T>(name: string, value: T): Command;
|
|
24
|
+
export declare function toggleHeader(type: string): (state: EditorState, dispatch?: ((tr: Transaction) => boolean) | undefined) => boolean;
|
|
25
|
+
export declare const toggleHeaderRow: (state: EditorState, dispatch?: ((tr: Transaction) => boolean) | undefined) => boolean;
|
|
26
|
+
export declare const toggleHeaderColumn: (state: EditorState, dispatch?: ((tr: Transaction) => boolean) | undefined) => boolean;
|
|
27
|
+
export declare const toggleHeaderCell: (state: EditorState, dispatch?: ((tr: Transaction) => boolean) | undefined) => boolean;
|
|
28
|
+
export declare function goToNextCell(direction: number): Command;
|
|
29
|
+
export declare const deleteTable: Command;
|
|
30
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,IAAI,EAAY,QAAQ,EAAe,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAiB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAgB7C,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,CAc/D;AAGD,wBAAgB,SAAS,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,eAyBvF;AAID,eAAO,MAAM,eAAe,EAAE,OAO7B,CAAC;AAIF,eAAO,MAAM,cAAc,EAAE,OAO5B,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,QAsB1F;AAID,eAAO,MAAM,YAAY,EAAE,OAe1B,CAAC;AAEF,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAOlE;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,eA0BpF;AAID,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,WAOvF;AAID,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,WAOtF;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,QA+BvF;AAID,eAAO,MAAM,SAAS,EAAE,OAevB,CAAC;AAoCF,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,WAoDrF;AAID,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,WAKpF;AAKD,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,KAAK,QAAQ,WACvF,WAAW,mBAAkB,WAAW,KAAK,OAAO,0BAqDtE;AAMD,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAgB9D;AAuBD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,WACb,WAAW,mBAAkB,WAAW,KAAK,OAAO,0BA8C/E;AAID,eAAO,MAAM,eAAe,UAlDA,WAAW,mBAAkB,WAAW,KAAK,OAAO,yBAkD9B,CAAC;AAInD,eAAO,MAAM,kBAAkB,UAtDH,WAAW,mBAAkB,WAAW,KAAK,OAAO,yBAsDxB,CAAC;AAIzD,eAAO,MAAM,gBAAgB,UA1DD,WAAW,mBAAkB,WAAW,KAAK,OAAO,yBA0D5B,CAAC;AAyBrD,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAWvD;AAGD,eAAO,MAAM,WAAW,EAAE,OAUzB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Fragment, Node, NodeType, Slice } from '@milkdown/prose/model';
|
|
2
|
+
import { EditorState, Transaction } from '@milkdown/prose/state';
|
|
3
|
+
import { Rect } from './table-map';
|
|
4
|
+
export declare function pastedCells(slice: Slice): R | null;
|
|
5
|
+
export declare type R = {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
rows: Fragment[];
|
|
9
|
+
};
|
|
10
|
+
export declare function fitSlice(nodeType: NodeType, slice: Slice): Node;
|
|
11
|
+
export declare function clipCells({ width, height, rows }: R, newWidth: number, newHeight: number): R;
|
|
12
|
+
export declare function insertCells(state: EditorState, dispatch: (tr: Transaction) => void, tableStart: number, rect: Rect, cells: R): void;
|
|
13
|
+
//# sourceMappingURL=copy-paste.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-paste.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/copy-paste.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAU,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKjE,OAAO,EAAE,IAAI,EAAY,MAAM,aAAa,CAAC;AAQ7C,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,YAiCvC;AAKD,oBAAY,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC;AAwBpE,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,QAIxD;AAKD,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC,CA8C5F;AA8HD,wBAAgB,WAAW,CACvB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,EACnC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,QAyCX"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Node } from '@milkdown/prose/model';
|
|
2
|
+
import { EditorState, PluginKey, Transaction } from '@milkdown/prose/state';
|
|
3
|
+
export declare const fixTablesKey: PluginKey<any>;
|
|
4
|
+
export declare function fixTables(state: EditorState, oldState: EditorState): Transaction | undefined;
|
|
5
|
+
export declare function fixTable(state: EditorState, table: Node, tablePos: number, tr?: Transaction): Transaction | undefined;
|
|
6
|
+
//# sourceMappingURL=fix-tables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-tables.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/fix-tables.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAM5E,eAAO,MAAM,YAAY,gBAA8B,CAAC;AA8BxD,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,2BAQlE;AAKD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,WAAW,2BAgE3F"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { NodeType } from '@milkdown/prose/model';
|
|
2
1
|
import { PluginKey } from '@milkdown/prose/state';
|
|
3
2
|
export declare const SupportedKeys: {
|
|
4
3
|
readonly NextCell: "NextCell";
|
|
@@ -10,26 +9,9 @@ export declare const PrevCell: import("@milkdown/core").CmdKey<undefined>;
|
|
|
10
9
|
export declare const NextCell: import("@milkdown/core").CmdKey<undefined>;
|
|
11
10
|
export declare const BreakTable: import("@milkdown/core").CmdKey<undefined>;
|
|
12
11
|
export declare const InsertTable: import("@milkdown/core").CmdKey<undefined>;
|
|
13
|
-
export declare const TableContentFilterPluginKey: PluginKey<any
|
|
14
|
-
export declare const table: import("@milkdown/utils
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
table_cell: NodeType<any>;
|
|
19
|
-
} & {
|
|
20
|
-
[x: string]: import("@milkdown/prose/model").MarkType<any>;
|
|
21
|
-
}, {
|
|
22
|
-
schema?: ((ctx: import("@milkdown/core").Ctx) => {
|
|
23
|
-
node?: Record<keyof import("@milkdown/prose/tables").TableNodes, import("@milkdown/core").NodeSchema> | undefined;
|
|
24
|
-
mark?: Record<string, import("@milkdown/core").MarkSchema> | undefined;
|
|
25
|
-
}) | undefined;
|
|
26
|
-
view?: ((ctx: import("@milkdown/core").Ctx) => Partial<{
|
|
27
|
-
table: import("@milkdown/prose").NodeViewFactory;
|
|
28
|
-
table_header: import("@milkdown/prose").NodeViewFactory;
|
|
29
|
-
table_row: import("@milkdown/prose").NodeViewFactory;
|
|
30
|
-
table_cell: import("@milkdown/prose").NodeViewFactory;
|
|
31
|
-
} & {
|
|
32
|
-
[x: string]: import("@milkdown/prose").MarkViewFactory;
|
|
33
|
-
}>) | undefined;
|
|
34
|
-
}>;
|
|
12
|
+
export declare const TableContentFilterPluginKey: PluginKey<any>;
|
|
13
|
+
export declare const table: import("@milkdown/utils").WithExtend<"NextCell" | "PrevCell" | "ExitTable", Record<string, unknown>, import("@milkdown/utils").TypeMapping<"table" | "table_row" | "table_cell" | "table_header", string>, import("@milkdown/utils").PluginRest<"table" | "table_row" | "table_cell" | "table_header", string>>;
|
|
14
|
+
export * from './cell-selection';
|
|
15
|
+
export * from './commands';
|
|
16
|
+
export * from './util';
|
|
35
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,SAAS,EAA4B,MAAM,uBAAuB,CAAC;AAWpF,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AACX,oBAAY,aAAa,GAAG,OAAO,aAAa,CAAC;AAIjD,eAAO,MAAM,QAAQ,4CAA2B,CAAC;AACjD,eAAO,MAAM,QAAQ,4CAA2B,CAAC;AACjD,eAAO,MAAM,UAAU,4CAA6B,CAAC;AACrD,eAAO,MAAM,WAAW,4CAA8B,CAAC;AAEvD,eAAO,MAAM,2BAA2B,gBAAiD,CAAC;AAE1F,eAAO,MAAM,KAAK,iTAuKhB,CAAC;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { NodeSpec, Schema } from '@milkdown/prose/model';
|
|
2
|
+
export declare function tableNodeTypes(schema: Schema): any;
|
|
3
|
+
export declare const schema: Record<"table" | "table_row" | "table_cell" | "table_header", NodeSpec>;
|
|
2
4
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,QAAQ,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAuFtE,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,OAW5C;AAED,eAAO,MAAM,MAAM,yEAYjB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Slice } from '@milkdown/prose/model';
|
|
2
|
+
import { Plugin, PluginKey } from '@milkdown/prose/state';
|
|
3
|
+
import { EditorView } from '@milkdown/prose/view';
|
|
4
|
+
export declare const tableEditingKey: PluginKey<any>;
|
|
5
|
+
export declare function handlePaste(view: EditorView, _: Event, slice: Slice): boolean;
|
|
6
|
+
export declare function tableEditing({ allowTableNodeSelection }?: {
|
|
7
|
+
allowTableNodeSelection?: boolean | undefined;
|
|
8
|
+
}): Plugin<any>;
|
|
9
|
+
//# sourceMappingURL=table-editing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-editing.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/table-editing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyB,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAwB,MAAM,EAAE,SAAS,EAAyC,MAAM,uBAAuB,CAAC;AACvH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AASlD,eAAO,MAAM,eAAe,gBAAkC,CAAC;AA8L/D,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,WAyBnE;AAED,wBAAgB,YAAY,CAAC,EAAE,uBAA+B,EAAE;;CAAK,eA4CpE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Node } from '@milkdown/prose/model';
|
|
2
|
+
export declare class Rect {
|
|
3
|
+
left: number;
|
|
4
|
+
top: number;
|
|
5
|
+
right: number;
|
|
6
|
+
bottom: number;
|
|
7
|
+
tableStart?: number;
|
|
8
|
+
map?: TableMap;
|
|
9
|
+
table?: Node;
|
|
10
|
+
constructor(left: number, top: number, right: number, bottom: number);
|
|
11
|
+
}
|
|
12
|
+
export declare class TableMap {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
map: number[];
|
|
16
|
+
problems?: Problem[] | undefined;
|
|
17
|
+
constructor(width: number, height: number, map: number[], problems?: Problem[] | undefined);
|
|
18
|
+
findCell(pos: number): Rect;
|
|
19
|
+
colCount(pos: number): number;
|
|
20
|
+
nextCell(pos: number, axis: string, dir: number): number | undefined;
|
|
21
|
+
rectBetween(a: number, b: number): Rect;
|
|
22
|
+
cellsInRect(rect: Rect): number[];
|
|
23
|
+
positionAt(row: number, col: number, table: Node): number;
|
|
24
|
+
static get(table: Node): TableMap;
|
|
25
|
+
}
|
|
26
|
+
export declare type Problem = {
|
|
27
|
+
type: 'missing';
|
|
28
|
+
row: number;
|
|
29
|
+
n: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: 'overlong_rowspan';
|
|
32
|
+
pos: number;
|
|
33
|
+
n: number;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'collision';
|
|
36
|
+
row: number;
|
|
37
|
+
pos: number;
|
|
38
|
+
n: number;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'colwidth mismatch';
|
|
41
|
+
pos: number;
|
|
42
|
+
colwidth: boolean;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=table-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-map.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/table-map.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,IAAI,EAAE,MAAM,uBAAuB,CAAC;AASpD,qBAAa,IAAI;IAIM,IAAI,EAAE,MAAM;IAAS,GAAG,EAAE,MAAM;IAAS,KAAK,EAAE,MAAM;IAAS,MAAM,EAAE,MAAM;IAHzF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,CAAC;gBACD,IAAI,EAAE,MAAM,EAAS,GAAG,EAAE,MAAM,EAAS,KAAK,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM;CACnG;AAMD,qBAAa,QAAQ;IACE,KAAK,EAAE,MAAM;IAAS,MAAM,EAAE,MAAM;IAAS,GAAG,EAAE,MAAM,EAAE;IAAS,QAAQ,CAAC;gBAA5E,KAAK,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,EAAS,GAAG,EAAE,MAAM,EAAE,EAAS,QAAQ,CAAC,uBAAW;IAc1G,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAe3B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAQ7B,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAapE,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAcvC,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE;IAsBjC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,MAAM;IAezD,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,GAAG,QAAQ;CAGpC;AAED,oBAAY,OAAO,GACb;IACI,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;CACb,GACD;IACI,IAAI,EAAE,kBAAkB,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;CACb,GACD;IACI,IAAI,EAAE,WAAW,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;CACb,GACD;IACI,IAAI,EAAE,mBAAmB,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Node } from '@milkdown/prose/model';
|
|
2
|
+
import { NodeView } from '@milkdown/prose/view';
|
|
3
|
+
export declare class TableView implements NodeView {
|
|
4
|
+
node: Node;
|
|
5
|
+
cellMinWidth: number;
|
|
6
|
+
dom: HTMLElement;
|
|
7
|
+
contentDOM: HTMLElement;
|
|
8
|
+
table: HTMLTableElement;
|
|
9
|
+
colgroup: HTMLTableColElement;
|
|
10
|
+
constructor(node: Node, cellMinWidth: number);
|
|
11
|
+
update(node: Node): boolean;
|
|
12
|
+
ignoreMutation(record: MutationRecord): boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function updateColumns(node: Node, colgroup: HTMLTableColElement, table: HTMLTableElement, cellMinWidth: number, overrideCol?: number, overrideValue?: number): void;
|
|
15
|
+
//# sourceMappingURL=table-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-view.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/table-view.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD,qBAAa,SAAU,YAAW,QAAQ;IAMnB,IAAI,EAAE,IAAI;IAAS,YAAY,EAAE,MAAM;IALnD,GAAG,EAAE,WAAW,CAAC;IACjB,UAAU,EAAE,WAAW,CAAC;IACxB,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,mBAAmB,CAAC;gBAElB,IAAI,EAAE,IAAI,EAAS,YAAY,EAAE,MAAM;IAW1D,MAAM,CAAC,IAAI,EAAE,IAAI;IAOjB,cAAc,CAAC,MAAM,EAAE,cAAc;CAGxC;AAED,wBAAgB,aAAa,CACzB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,gBAAgB,EACvB,YAAY,EAAE,MAAM,EACpB,WAAW,CAAC,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE,MAAM,QAmCzB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare type getFromDOM<T> = (dom: Element) => T;
|
|
2
|
+
export declare type setDOMAttr = <Value>(value: Value, attrs: Record<string, unknown>) => void;
|
|
3
|
+
export interface CellAttributes<T = unknown> {
|
|
4
|
+
default: T;
|
|
5
|
+
getFromDOM?: getFromDOM<T>;
|
|
6
|
+
setDOMAttr?: setDOMAttr;
|
|
7
|
+
}
|
|
8
|
+
export interface TableNodesOptions {
|
|
9
|
+
tableGroup?: string;
|
|
10
|
+
cellContent: string;
|
|
11
|
+
cellAttributes: {
|
|
12
|
+
[key: string]: CellAttributes;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/types.ts"],"names":[],"mappings":"AAEA,oBAAY,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC;AAChD,oBAAY,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;AAEvF,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACvC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAC;CACrD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Attrs, Node, ResolvedPos } from '@milkdown/prose/model';
|
|
2
|
+
import { EditorState } from '@milkdown/prose/state';
|
|
3
|
+
import { TableMap } from './table-map';
|
|
4
|
+
export declare function cellAround($pos: ResolvedPos): ResolvedPos | undefined;
|
|
5
|
+
export declare function cellWrapping($pos: ResolvedPos): Node | null;
|
|
6
|
+
export declare function pointsAtCell($pos: ResolvedPos): Node | null;
|
|
7
|
+
export declare function moveCellForward($pos: ResolvedPos): ResolvedPos;
|
|
8
|
+
export declare function inSameTable($a: ResolvedPos, $b: ResolvedPos): boolean;
|
|
9
|
+
export declare function nextCell($pos: ResolvedPos, axis: string, dir: number): ResolvedPos | null;
|
|
10
|
+
export declare function setAttr<T>(attrs: Attrs, name: string, value: T): Attrs;
|
|
11
|
+
export declare function removeColSpan(attrs: Attrs, pos: number, n?: number): Record<string, unknown>;
|
|
12
|
+
export declare function isInTable(state: EditorState): boolean;
|
|
13
|
+
export declare function selectionCell(state: EditorState): ResolvedPos | undefined;
|
|
14
|
+
export declare function addColSpan(attrs: Attrs, pos: number, n?: number): Attrs;
|
|
15
|
+
export declare function columnIsHeader(map: TableMap, table: Node, col: number): boolean;
|
|
16
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/table/nodes/util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAiB,MAAM,uBAAuB,CAAC;AAInE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,2BAI3C;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,eAO7C;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAG3D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,eAEhD;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,WAE3D;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,sBAKpE;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,SAK9D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,SAAI,2BAS7D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,WAI3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,2BAQ/C;AAcD,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,SAAI,SAQ1D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAOrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAA8B,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAA8B,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAelD,oBAAY,IAAI,GAAG;IACf,CAAC,EAAE,WAAW,CAAC;IACf,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC;CAC3C,CAAC;AAEF,oBAAY,MAAM;IACd,UAAU,IAAA;IACV,WAAW,IAAA;IACX,SAAS,IAAA;IACT,YAAY,IAAA;IACZ,SAAS,IAAA;IACT,WAAW,IAAA;IACX,UAAU,IAAA;IACV,MAAM,IAAA;CACT;AAED,eAAO,MAAM,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC,MAAM,EAAE,IAAI,CA+E3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calc-pos.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/calc-pos.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calc-pos.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/calc-pos.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIlD,eAAO,MAAM,iBAAiB,SAAU,UAAU,OAAO,WAAW,SAoBnE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CellSelection } from '@milkdown/prose/tables';
|
|
2
1
|
import { EditorView } from '@milkdown/prose/view';
|
|
2
|
+
import { CellSelection } from '../nodes/cell-selection';
|
|
3
3
|
import { Item } from './actions';
|
|
4
4
|
export declare const getCellSelection: (view: EditorView) => CellSelection;
|
|
5
5
|
export declare const isFirstRowSelected: (selection: CellSelection) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,eAAO,MAAM,gBAAgB,SAAU,UAAU,KAAG,aAAiE,CAAC;AAEtH,eAAO,MAAM,kBAAkB,cAAe,aAAa,YAmB1D,CAAC;AAEF,eAAO,MAAM,aAAa,YAAa,OAAO,MAAM,EAAE,IAAI,CAAC,QAAQ,UAAU,SAS5E,CAAC"}
|
|
@@ -2,5 +2,5 @@ import { Ctx } from '@milkdown/core';
|
|
|
2
2
|
import { Plugin } from '@milkdown/prose/state';
|
|
3
3
|
import { Utils } from '@milkdown/utils';
|
|
4
4
|
export declare const key = "MILKDOWN_TABLE";
|
|
5
|
-
export declare const operatorPlugin: (ctx: Ctx, utils: Utils) => Plugin<any
|
|
5
|
+
export declare const operatorPlugin: (ctx: Ctx, utils: Utils) => Plugin<any>;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAa,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAa,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAWxC,eAAO,MAAM,GAAG,mBAAmB,CAAC;AAEpC,eAAO,MAAM,cAAc,QAAS,GAAG,SAAS,KAAK,gBAkFpD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Ctx } from '@milkdown/core';
|
|
2
|
-
import { Decoration
|
|
2
|
+
import { Decoration } from '@milkdown/prose/view';
|
|
3
3
|
import { CellPos } from '../utils';
|
|
4
4
|
import { ToolTipPos } from './constant';
|
|
5
|
-
export declare function createWidget(ctx: Ctx, cell: CellPos, pos: ToolTipPos.Point): Decoration
|
|
6
|
-
export declare function createWidget(ctx: Ctx, cell: CellPos, pos: ToolTipPos.Left, index: number): Decoration
|
|
7
|
-
export declare function createWidget(ctx: Ctx, cell: CellPos, pos: ToolTipPos.Top, index: number): Decoration
|
|
5
|
+
export declare function createWidget(ctx: Ctx, cell: CellPos, pos: ToolTipPos.Point): Decoration;
|
|
6
|
+
export declare function createWidget(ctx: Ctx, cell: CellPos, pos: ToolTipPos.Left, index: number): Decoration;
|
|
7
|
+
export declare function createWidget(ctx: Ctx, cell: CellPos, pos: ToolTipPos.Top, index: number): Decoration;
|
|
8
8
|
//# sourceMappingURL=widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/widget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAA8B,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/widget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAA8B,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,OAAO,EAA2B,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAiBxC,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC;AACzF,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;AACvG,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC"}
|
package/lib/table/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Node as ProsemirrorNode, Schema } from '@milkdown/prose/model';
|
|
2
2
|
import { Selection, Transaction } from '@milkdown/prose/state';
|
|
3
|
-
import {
|
|
3
|
+
import { Rect } from './nodes/table-map';
|
|
4
4
|
export declare type CellPos = {
|
|
5
5
|
pos: number;
|
|
6
6
|
start: number;
|
|
@@ -9,13 +9,13 @@ export declare type CellPos = {
|
|
|
9
9
|
export declare const findTable: (selection: Selection) => import("@milkdown/prose").ContentNodeWithPos | undefined;
|
|
10
10
|
export declare const getCellsInColumn: (columnIndex: number) => (selection: Selection) => CellPos[] | undefined;
|
|
11
11
|
export declare const getCellsInRow: (rowIndex: number) => (selection: Selection) => CellPos[] | undefined;
|
|
12
|
-
export declare const createTable: (schema: Schema, rowsCount?: number, colsCount?: number) =>
|
|
12
|
+
export declare const createTable: (schema: Schema, rowsCount?: number, colsCount?: number) => any;
|
|
13
13
|
export declare const selectLine: (type: 'row' | 'col') => (index: number) => (tr: Transaction) => any;
|
|
14
14
|
export declare const getCellsInTable: (selection: Selection) => {
|
|
15
15
|
pos: number;
|
|
16
16
|
start: number;
|
|
17
|
-
node: ProsemirrorNode
|
|
17
|
+
node: ProsemirrorNode | null;
|
|
18
18
|
}[] | undefined;
|
|
19
19
|
export declare const selectTable: (tr: Transaction) => any;
|
|
20
|
-
export declare function addRowWithAlignment(tr: Transaction, { map, tableStart, table }:
|
|
20
|
+
export declare function addRowWithAlignment(tr: Transaction, { map, tableStart, table }: Required<Rect>, row: number): Transaction;
|
|
21
21
|
//# sourceMappingURL=utils.d.ts.map
|
package/lib/table/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/table/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/table/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAI/D,OAAO,EAAE,IAAI,EAAY,MAAM,mBAAmB,CAAC;AAEnD,oBAAY,OAAO,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,SAAS,cAAe,SAAS,6DACkC,CAAC;AAEjF,eAAO,MAAM,gBAAgB,gBACX,MAAM,iBACR,SAAS,KAAG,OAAO,EAAE,GAAG,SAkBnC,CAAC;AAEN,eAAO,MAAM,aAAa,aACX,MAAM,iBACL,SAAS,KAAG,OAAO,EAAE,GAAG,SAkBnC,CAAC;AAEN,eAAO,MAAM,WAAW,WAAY,MAAM,gDAgBzC,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,KAAK,GAAG,KAAK,aAAa,MAAM,UAAU,WAAW,QAuBrF,CAAC;AAEF,eAAO,MAAM,eAAe,cAAe,SAAS;;;;eAiBnD,CAAC;AAEF,eAAO,MAAM,WAAW,OAAQ,WAAW,QAW1C,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,eAkB3G"}
|
package/lib/task-list-item.d.ts
CHANGED
|
@@ -4,10 +4,6 @@ export declare const SplitTaskListItem: import("@milkdown/core").CmdKey<undefine
|
|
|
4
4
|
export declare const SinkTaskListItem: import("@milkdown/core").CmdKey<undefined>;
|
|
5
5
|
export declare const LiftTaskListItem: import("@milkdown/core").CmdKey<undefined>;
|
|
6
6
|
export declare const TurnIntoTaskList: import("@milkdown/core").CmdKey<undefined>;
|
|
7
|
-
export declare const taskListItem: import("@milkdown/utils
|
|
8
|
-
id: string;
|
|
9
|
-
schema: (ctx: import("@milkdown/core").Ctx) => import("@milkdown/core").NodeSchema;
|
|
10
|
-
view?: ((ctx: import("@milkdown/core").Ctx) => import("@milkdown/prose").NodeViewFactory) | undefined;
|
|
11
|
-
}>;
|
|
7
|
+
export declare const taskListItem: import("@milkdown/utils").NodeCreator<Keys, import("@milkdown/utils").UnknownRecord>;
|
|
12
8
|
export {};
|
|
13
9
|
//# sourceMappingURL=task-list-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-list-item.d.ts","sourceRoot":"","sources":["../src/task-list-item.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"task-list-item.d.ts","sourceRoot":"","sources":["../src/task-list-item.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,aAAK,IAAI,GAAG,OAAO,CAAC,MAAM,aAAa,EAAE,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,UAAU,CAAC,CAAC;AAExG,eAAO,MAAM,iBAAiB,4CAAoC,CAAC;AACnE,eAAO,MAAM,gBAAgB,4CAAmC,CAAC;AACjE,eAAO,MAAM,gBAAgB,4CAAmC,CAAC;AACjE,eAAO,MAAM,gBAAgB,4CAAmC,CAAC;AAEjE,eAAO,MAAM,YAAY,sFAuIvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milkdown/preset-gfm",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.es.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"gfm"
|
|
18
18
|
],
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@milkdown/core": "6.
|
|
21
|
-
"@milkdown/design-system": "6.
|
|
22
|
-
"@milkdown/preset-commonmark": "6.
|
|
23
|
-
"@milkdown/prose": "6.
|
|
20
|
+
"@milkdown/core": "6.2.0",
|
|
21
|
+
"@milkdown/design-system": "6.2.0",
|
|
22
|
+
"@milkdown/preset-commonmark": "6.2.0",
|
|
23
|
+
"@milkdown/prose": "6.2.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@milkdown/core": "^6.0.1",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@milkdown/prose": "^6.0.1"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@milkdown/utils": "6.
|
|
31
|
+
"@milkdown/utils": "6.2.0",
|
|
32
32
|
"remark-gfm": "^3.0.0",
|
|
33
33
|
"tslib": "^2.3.1"
|
|
34
34
|
},
|
package/src/auto-link.ts
CHANGED
|
@@ -12,9 +12,10 @@ const proseUrlPlugin = () =>
|
|
|
12
12
|
const [text] = match;
|
|
13
13
|
if (!text) return null;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const link = schema.marks['link']?.create({ href: text });
|
|
16
|
+
if (!link) return null;
|
|
17
|
+
|
|
18
|
+
return state.tr.replaceWith(start, end, schema.text(text)).addMark(start, text.length + start, link);
|
|
18
19
|
}),
|
|
19
20
|
],
|
|
20
21
|
});
|
package/src/table/command.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
|
-
import { Command } from '@milkdown/prose/commands';
|
|
3
2
|
import { Node, NodeType } from '@milkdown/prose/model';
|
|
4
|
-
import { Selection } from '@milkdown/prose/state';
|
|
5
|
-
|
|
3
|
+
import { Command, Selection } from '@milkdown/prose/state';
|
|
4
|
+
|
|
5
|
+
import { isInTable } from './nodes/util';
|
|
6
6
|
|
|
7
7
|
export const exitTable =
|
|
8
8
|
(node: NodeType): Command =>
|