@milkdown/preset-gfm 7.21.2 → 7.22.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/__test__/keep-table-align.spec.d.ts +2 -0
- package/lib/__test__/keep-table-align.spec.d.ts.map +1 -0
- package/lib/__test__/paste-special-char.spec.d.ts +2 -0
- package/lib/__test__/paste-special-char.spec.d.ts.map +1 -0
- package/lib/__test__/task-list-spread-roundtrip.spec.d.ts +2 -0
- package/lib/__test__/task-list-spread-roundtrip.spec.d.ts.map +1 -0
- package/lib/composed/commands.d.ts +1 -1
- package/lib/index.js +23 -6
- package/lib/index.js.map +1 -1
- package/lib/node/table/command.d.ts +1 -1
- package/lib/node/table/utils/select-line.d.ts.map +1 -1
- package/lib/plugin/keep-table-align-plugin.d.ts.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/__test__/keep-table-align.spec.ts +131 -0
- package/src/__test__/paste-special-char.spec.ts +121 -0
- package/src/__test__/task-list-spread-roundtrip.spec.ts +70 -0
- package/src/mark/strike-through.ts +1 -1
- package/src/node/task-list-item.ts +3 -3
- package/src/plugin/keep-table-align-plugin.ts +33 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keep-table-align.spec.d.ts","sourceRoot":"","sources":["../../src/__test__/keep-table-align.spec.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paste-special-char.spec.d.ts","sourceRoot":"","sources":["../../src/__test__/paste-special-char.spec.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-list-spread-roundtrip.spec.d.ts","sourceRoot":"","sources":["../../src/__test__/task-list-spread-roundtrip.spec.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAA"}
|
|
@@ -8,5 +8,5 @@ export declare const commands: (import("@milkdown/utils").$Command<unknown> | im
|
|
|
8
8
|
}> | import("@milkdown/utils").$Command<{
|
|
9
9
|
index: number;
|
|
10
10
|
pos?: number;
|
|
11
|
-
}> | import("@milkdown/utils").$Command<"
|
|
11
|
+
}> | import("@milkdown/utils").$Command<"center" | "left" | "right">)[];
|
|
12
12
|
//# sourceMappingURL=commands.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -62,7 +62,7 @@ withMeta(toggleStrikethroughCommand, {
|
|
|
62
62
|
group: "Strikethrough"
|
|
63
63
|
});
|
|
64
64
|
var strikethroughInputRule = $inputRule((ctx) => {
|
|
65
|
-
return markRule(/(?<![\w:/])(~{1,2})(.+?)\1(?!\w|\/)
|
|
65
|
+
return markRule(/(?<![\w:/])(~{1,2})(.+?)\1(?!\w|\/)$/, strikethroughSchema.type(ctx));
|
|
66
66
|
});
|
|
67
67
|
withMeta(strikethroughInputRule, {
|
|
68
68
|
displayName: "InputRule<strikethrough>",
|
|
@@ -811,7 +811,7 @@ var extendListItemSchemaForTask = listItemSchema.extendSchema((prev) => {
|
|
|
811
811
|
return {
|
|
812
812
|
label: dom.dataset.label,
|
|
813
813
|
listType: dom.dataset.listType,
|
|
814
|
-
spread: dom.dataset.spread,
|
|
814
|
+
spread: dom.dataset.spread === "true",
|
|
815
815
|
checked: dom.dataset.checked ? dom.dataset.checked === "true" : null
|
|
816
816
|
};
|
|
817
817
|
}
|
|
@@ -840,7 +840,7 @@ var extendListItemSchemaForTask = listItemSchema.extendSchema((prev) => {
|
|
|
840
840
|
const label = node.label != null ? `${node.label}.` : "•";
|
|
841
841
|
const checked = node.checked != null ? Boolean(node.checked) : null;
|
|
842
842
|
const listType = node.label != null ? "ordered" : "bullet";
|
|
843
|
-
const spread = node.spread
|
|
843
|
+
const spread = node.spread ?? true;
|
|
844
844
|
state.openNode(type, {
|
|
845
845
|
label,
|
|
846
846
|
listType,
|
|
@@ -860,7 +860,7 @@ var extendListItemSchemaForTask = listItemSchema.extendSchema((prev) => {
|
|
|
860
860
|
}
|
|
861
861
|
const label = node.attrs.label;
|
|
862
862
|
const listType = node.attrs.listType;
|
|
863
|
-
const spread = node.attrs.spread
|
|
863
|
+
const spread = node.attrs.spread;
|
|
864
864
|
const checked = node.attrs.checked;
|
|
865
865
|
state.openNode("listItem", void 0, {
|
|
866
866
|
label,
|
|
@@ -959,13 +959,25 @@ function getChildIndex(node, parent) {
|
|
|
959
959
|
});
|
|
960
960
|
return index;
|
|
961
961
|
}
|
|
962
|
+
function changedRange(prev, next) {
|
|
963
|
+
const from = prev.content.findDiffStart(next.content);
|
|
964
|
+
if (from == null) return null;
|
|
965
|
+
const diff = prev.content.findDiffEnd(next.content);
|
|
966
|
+
if (!diff) return null;
|
|
967
|
+
return {
|
|
968
|
+
from,
|
|
969
|
+
to: Math.max(diff.b, from)
|
|
970
|
+
};
|
|
971
|
+
}
|
|
962
972
|
var keepTableAlignPlugin = $prose(() => {
|
|
963
973
|
return new Plugin({
|
|
964
974
|
key: pluginKey,
|
|
965
975
|
appendTransaction: (_tr, oldState, state) => {
|
|
976
|
+
if (oldState.doc === state.doc) return;
|
|
977
|
+
const range = changedRange(oldState.doc, state.doc);
|
|
978
|
+
if (!range) return;
|
|
966
979
|
let tr;
|
|
967
980
|
const check = (node, pos) => {
|
|
968
|
-
if (!tr) tr = state.tr;
|
|
969
981
|
if (node.type.name !== "table_cell") return;
|
|
970
982
|
const $pos = state.doc.resolve(pos);
|
|
971
983
|
const tableRow = $pos.node($pos.depth);
|
|
@@ -976,12 +988,17 @@ var keepTableAlignPlugin = $prose(() => {
|
|
|
976
988
|
if (!headerCell) return;
|
|
977
989
|
const align = headerCell.attrs.alignment;
|
|
978
990
|
if (align === node.attrs.alignment) return;
|
|
991
|
+
if (!tr) tr = state.tr;
|
|
979
992
|
tr.setNodeMarkup(pos, void 0, {
|
|
980
993
|
...node.attrs,
|
|
981
994
|
alignment: align
|
|
982
995
|
});
|
|
983
996
|
};
|
|
984
|
-
|
|
997
|
+
state.doc.nodesBetween(range.from, range.to, (node, pos) => {
|
|
998
|
+
if (node.type.name !== "table") return true;
|
|
999
|
+
state.doc.nodesBetween(pos, pos + node.nodeSize, check);
|
|
1000
|
+
return false;
|
|
1001
|
+
});
|
|
985
1002
|
return tr;
|
|
986
1003
|
}
|
|
987
1004
|
});
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/__internal__/with-meta.ts","../src/mark/strike-through.ts","../src/node/table/schema.ts","../src/node/table/utils/create-table.ts","../src/node/table/utils/get-cells-in-col.ts","../src/node/table/utils/get-cells-in-row.ts","../src/node/table/utils/select-line.ts","../src/node/table/utils/add-row-with-alignment.ts","../src/node/table/utils/get-all-cells-in-table.ts","../src/node/table/utils/select-table.ts","../src/node/table/command.ts","../src/node/table/input.ts","../src/node/footnote/definition.ts","../src/node/footnote/reference.ts","../src/node/task-list-item.ts","../src/composed/keymap.ts","../src/composed/inputrules.ts","../src/composed/pasterules.ts","../src/plugin/auto-insert-span-plugin.ts","../src/plugin/column-resizing-plugin.ts","../src/plugin/table-editing-plugin.ts","../src/plugin/remark-gfm-plugin.ts","../src/plugin/keep-table-align-plugin.ts","../src/composed/plugins.ts","../src/composed/schema.ts","../src/composed/commands.ts","../src/index.ts"],"sourcesContent":["import type { Meta, MilkdownPlugin } from '@milkdown/ctx'\n\nexport function withMeta<T extends MilkdownPlugin>(\n plugin: T,\n meta: Partial<Meta> & Pick<Meta, 'displayName'>\n): T {\n Object.assign(plugin, {\n meta: {\n package: '@milkdown/preset-gfm',\n ...meta,\n },\n })\n\n return plugin\n}\n","import { commandsCtx } from '@milkdown/core'\nimport { markRule } from '@milkdown/prose'\nimport { toggleMark } from '@milkdown/prose/commands'\nimport {\n $command,\n $inputRule,\n $markAttr,\n $markSchema,\n $useKeymap,\n} from '@milkdown/utils'\n\nimport { withMeta } from '../__internal__'\n\n/// HTML attributes for the strikethrough mark.\nexport const strikethroughAttr = $markAttr('strike_through')\n\nwithMeta(strikethroughAttr, {\n displayName: 'Attr<strikethrough>',\n group: 'Strikethrough',\n})\n\n/// Strikethrough mark schema.\nexport const strikethroughSchema = $markSchema('strike_through', (ctx) => ({\n parseDOM: [\n { tag: 'del' },\n {\n style: 'text-decoration',\n getAttrs: (value) => (value === 'line-through') as false,\n },\n ],\n toDOM: (mark) => ['del', ctx.get(strikethroughAttr.key)(mark)],\n parseMarkdown: {\n match: (node) => node.type === 'delete',\n runner: (state, node, markType) => {\n state.openMark(markType)\n state.next(node.children)\n state.closeMark(markType)\n },\n },\n toMarkdown: {\n match: (mark) => mark.type.name === 'strike_through',\n runner: (state, mark) => {\n state.withMark(mark, 'delete')\n },\n },\n}))\n\nwithMeta(strikethroughSchema.mark, {\n displayName: 'MarkSchema<strikethrough>',\n group: 'Strikethrough',\n})\n\nwithMeta(strikethroughSchema.ctx, {\n displayName: 'MarkSchemaCtx<strikethrough>',\n group: 'Strikethrough',\n})\n\n/// A command to toggle the strikethrough mark.\nexport const toggleStrikethroughCommand = $command(\n 'ToggleStrikeThrough',\n (ctx) => () => {\n return toggleMark(strikethroughSchema.type(ctx))\n }\n)\n\nwithMeta(toggleStrikethroughCommand, {\n displayName: 'Command<ToggleStrikethrough>',\n group: 'Strikethrough',\n})\n\n/// Input rule to create the strikethrough mark.\nexport const strikethroughInputRule = $inputRule((ctx) => {\n return markRule(\n /(?<![\\w:/])(~{1,2})(.+?)\\1(?!\\w|\\/)/,\n strikethroughSchema.type(ctx)\n )\n})\n\nwithMeta(strikethroughInputRule, {\n displayName: 'InputRule<strikethrough>',\n group: 'Strikethrough',\n})\n\n/// Keymap for the strikethrough mark.\n/// - `Mod-Alt-x` - Toggle the strikethrough mark.\nexport const strikethroughKeymap = $useKeymap('strikeThroughKeymap', {\n ToggleStrikethrough: {\n shortcuts: 'Mod-Alt-x',\n command: (ctx) => {\n const commands = ctx.get(commandsCtx)\n return () => commands.call(toggleStrikethroughCommand.key)\n },\n },\n})\n\nwithMeta(strikethroughKeymap.ctx, {\n displayName: 'KeymapCtx<strikethrough>',\n group: 'Strikethrough',\n})\n\nwithMeta(strikethroughKeymap.shortcuts, {\n displayName: 'Keymap<strikethrough>',\n group: 'Strikethrough',\n})\n","import type { NodeType } from '@milkdown/prose/model'\nimport type { MarkdownNode } from '@milkdown/transformer'\n\nimport { tableNodes } from '@milkdown/prose/tables'\nimport { $nodeSchema } from '@milkdown/utils'\n\nimport { withMeta } from '../../__internal__'\n\nconst originalSchema = tableNodes({\n tableGroup: 'block',\n cellContent: 'paragraph',\n cellAttributes: {\n alignment: {\n default: 'left',\n getFromDOM: (dom) => dom.style.textAlign || 'left',\n setDOMAttr: (value, attrs) => {\n attrs.style = `text-align: ${value || 'left'}`\n },\n },\n },\n})\n\n/// Schema for table node.\nexport const tableSchema = $nodeSchema('table', () => ({\n ...originalSchema.table,\n content: 'table_header_row table_row+',\n disableDropCursor: true,\n parseMarkdown: {\n match: (node) => node.type === 'table',\n runner: (state, node, type) => {\n const align = node.align as (string | null)[]\n const children = (node.children as MarkdownNode[]).map((x, i) => ({\n ...x,\n align,\n isHeader: i === 0,\n }))\n state.openNode(type)\n state.next(children)\n state.closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'table',\n runner: (state, node) => {\n const firstLine = node.content.firstChild?.content\n if (!firstLine) return\n\n const align: (string | null)[] = []\n firstLine.forEach((cell) => {\n align.push(cell.attrs.alignment)\n })\n state.openNode('table', undefined, { align })\n state.next(node.content)\n state.closeNode()\n },\n },\n}))\n\nwithMeta(tableSchema.node, {\n displayName: 'NodeSchema<table>',\n group: 'Table',\n})\n\nwithMeta(tableSchema.ctx, {\n displayName: 'NodeSchemaCtx<table>',\n group: 'Table',\n})\n\n/// Schema for table header row node.\nexport const tableHeaderRowSchema = $nodeSchema('table_header_row', () => ({\n ...originalSchema.table_row,\n disableDropCursor: true,\n content: '(table_header)*',\n parseDOM: [\n { tag: 'tr[data-is-header]' },\n {\n tag: 'tr',\n getAttrs: (dom: HTMLElement) => {\n if (dom instanceof HTMLElement) {\n const hasHeader = dom.querySelector('th')\n return hasHeader ? {} : false\n }\n return false\n },\n },\n ],\n toDOM() {\n return ['tr', { 'data-is-header': true }, 0]\n },\n parseMarkdown: {\n match: (node) => Boolean(node.type === 'tableRow' && node.isHeader),\n runner: (state, node, type) => {\n const align = node.align as (string | null)[]\n const children = (node.children as MarkdownNode[]).map((x, i) => ({\n ...x,\n align: align[i],\n isHeader: node.isHeader,\n }))\n state.openNode(type)\n state.next(children)\n state.closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'table_header_row',\n runner: (state, node) => {\n // if the row is empty, we don't need to create a table row\n // prevent remark from crashing\n if (node.content.size === 0) {\n return\n }\n state.openNode('tableRow', undefined, { isHeader: true })\n state.next(node.content)\n state.closeNode()\n },\n },\n}))\n\nwithMeta(tableHeaderRowSchema.node, {\n displayName: 'NodeSchema<tableHeaderRow>',\n group: 'Table',\n})\n\nwithMeta(tableHeaderRowSchema.ctx, {\n displayName: 'NodeSchemaCtx<tableHeaderRow>',\n group: 'Table',\n})\n\n/// Schema for table row node.\nexport const tableRowSchema = $nodeSchema('table_row', () => ({\n ...originalSchema.table_row,\n disableDropCursor: true,\n content: '(table_cell)*',\n parseMarkdown: {\n match: (node) => node.type === 'tableRow',\n runner: (state, node, type) => {\n const align = node.align as (string | null)[]\n const children = (node.children as MarkdownNode[]).map((x, i) => ({\n ...x,\n align: align[i],\n }))\n state.openNode(type)\n state.next(children)\n state.closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'table_row',\n runner: (state, node) => {\n // if the row is empty, we don't need to create a table row\n // prevent remark from crashing\n if (node.content.size === 0) {\n return\n }\n state.openNode('tableRow')\n state.next(node.content)\n state.closeNode()\n },\n },\n}))\n\nwithMeta(tableRowSchema.node, {\n displayName: 'NodeSchema<tableRow>',\n group: 'Table',\n})\n\nwithMeta(tableRowSchema.ctx, {\n displayName: 'NodeSchemaCtx<tableRow>',\n group: 'Table',\n})\n\n/// Schema for table cell node.\nexport const tableCellSchema = $nodeSchema('table_cell', () => ({\n ...originalSchema.table_cell,\n disableDropCursor: true,\n parseMarkdown: {\n match: (node) => node.type === 'tableCell' && !node.isHeader,\n runner: (state, node, type) => {\n const align = node.align as string\n state\n .openNode(type, { alignment: align })\n .openNode(state.schema.nodes.paragraph as NodeType)\n .next(node.children)\n .closeNode()\n .closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'table_cell',\n runner: (state, node) => {\n state.openNode('tableCell').next(node.content).closeNode()\n },\n },\n}))\n\nwithMeta(tableCellSchema.node, {\n displayName: 'NodeSchema<tableCell>',\n group: 'Table',\n})\n\nwithMeta(tableCellSchema.ctx, {\n displayName: 'NodeSchemaCtx<tableCell>',\n group: 'Table',\n})\n\n/// Schema for table header node.\nexport const tableHeaderSchema = $nodeSchema('table_header', () => ({\n ...originalSchema.table_header,\n disableDropCursor: true,\n parseMarkdown: {\n match: (node) => node.type === 'tableCell' && !!node.isHeader,\n runner: (state, node, type) => {\n const align = node.align as string\n state.openNode(type, { alignment: align })\n state.openNode(state.schema.nodes.paragraph as NodeType)\n state.next(node.children)\n state.closeNode()\n state.closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'table_header',\n runner: (state, node) => {\n state.openNode('tableCell')\n state.next(node.content)\n state.closeNode()\n },\n },\n}))\n\nwithMeta(tableHeaderSchema.node, {\n displayName: 'NodeSchema<tableHeader>',\n group: 'Table',\n})\n\nwithMeta(tableHeaderSchema.ctx, {\n displayName: 'NodeSchemaCtx<tableHeader>',\n group: 'Table',\n})\n","import type { Ctx } from '@milkdown/ctx'\nimport type { Node } from '@milkdown/prose/model'\n\nimport {\n tableCellSchema,\n tableHeaderRowSchema,\n tableHeaderSchema,\n tableRowSchema,\n tableSchema,\n} from '../schema'\n\n/// @internal\nexport function createTable(ctx: Ctx, rowsCount = 3, colsCount = 3): Node {\n const cells = Array(colsCount)\n .fill(0)\n .map(() => tableCellSchema.type(ctx).createAndFill()!)\n\n const headerCells = Array(colsCount)\n .fill(0)\n .map(() => tableHeaderSchema.type(ctx).createAndFill()!)\n\n const rows = Array(rowsCount)\n .fill(0)\n .map((_, i) =>\n i === 0\n ? tableHeaderRowSchema.type(ctx).create(null, headerCells)\n : tableRowSchema.type(ctx).create(null, cells)\n )\n\n return tableSchema.type(ctx).create(null, rows)\n}\n","import type { Selection } from '@milkdown/prose/state'\n\nimport { findTable, TableMap } from '@milkdown/prose/tables'\n\nimport type { CellPos } from './types'\n\n/// Get cells in a column of a table.\nexport function getCellsInCol(\n columnIndexes: number | number[],\n selection: Selection\n): CellPos[] | undefined {\n const table = findTable(selection.$from)\n if (!table) return undefined\n\n const map = TableMap.get(table.node)\n const indexes = Array.isArray(columnIndexes) ? columnIndexes : [columnIndexes]\n\n return indexes\n .filter((index) => index >= 0 && index <= map.width - 1)\n .flatMap((index) => {\n const cells = map.cellsInRect({\n left: index,\n right: index + 1,\n top: 0,\n bottom: map.height,\n })\n return cells.map((nodePos) => {\n const node = table.node.nodeAt(nodePos)!\n const pos = nodePos + table.start\n return { pos, start: pos + 1, node, depth: table.depth + 2 }\n })\n })\n}\n","import type { Selection } from '@milkdown/prose/state'\n\nimport { findTable, TableMap } from '@milkdown/prose/tables'\n\nimport type { CellPos } from './types'\n\n/// Get cells in a row of a table.\nexport function getCellsInRow(\n rowIndex: number | number[],\n selection: Selection\n): CellPos[] | undefined {\n const table = findTable(selection.$from)\n if (!table) {\n return\n }\n\n const map = TableMap.get(table.node)\n const indexes = Array.isArray(rowIndex) ? rowIndex : [rowIndex]\n\n return indexes\n .filter((index) => index >= 0 && index <= map.height - 1)\n .flatMap((index) => {\n const cells = map.cellsInRect({\n left: 0,\n right: map.width,\n top: index,\n bottom: index + 1,\n })\n return cells.map((nodePos) => {\n const node = table.node.nodeAt(nodePos)!\n const pos = nodePos + table.start\n return { pos, start: pos + 1, node, depth: table.depth + 2 }\n })\n })\n}\n","import type { Selection, Transaction } from '@milkdown/prose/state'\n\nimport { cloneTr, findParentNodeClosestToPos } from '@milkdown/prose'\nimport { CellSelection, TableMap } from '@milkdown/prose/tables'\n\n/// @internal\nexport function selectLine(type: 'row' | 'col') {\n return (index: number, pos?: number) => (tr: Transaction) => {\n pos = pos ?? tr.selection.from\n const $pos = tr.doc.resolve(pos)\n const $node = findParentNodeClosestToPos(\n (node) => node.type.name === 'table'\n )($pos)\n const table = $node\n ? {\n node: $node.node,\n from: $node.start,\n }\n : undefined\n\n const isRowSelection = type === 'row'\n if (table) {\n const map = TableMap.get(table.node)\n\n // Check if the index is valid\n if (index >= 0 && index < (isRowSelection ? map.height : map.width)) {\n const lastCell = map.positionAt(\n isRowSelection ? index : map.height - 1,\n isRowSelection ? map.width - 1 : index,\n table.node\n )\n const $lastCell = tr.doc.resolve(table.from + lastCell)\n\n const createCellSelection = isRowSelection\n ? // oxlint-disable-next-line typescript/unbound-method\n CellSelection.rowSelection\n : // oxlint-disable-next-line typescript/unbound-method\n CellSelection.colSelection\n\n const firstCell = map.positionAt(\n isRowSelection ? index : 0,\n isRowSelection ? 0 : index,\n table.node\n )\n const $firstCell = tr.doc.resolve(table.from + firstCell)\n return cloneTr(\n tr.setSelection(\n createCellSelection($lastCell, $firstCell) as unknown as Selection\n )\n )\n }\n }\n return tr\n }\n}\n\n/// If the selection is in a table,\n/// select the {index} row.\nexport const selectRow = selectLine('row')\n\n/// If the selection is in a table,\n/// select the {index} column.\nexport const selectCol = selectLine('col')\n","import type { Ctx } from '@milkdown/ctx'\nimport type { Node } from '@milkdown/prose/model'\nimport type { Transaction } from '@milkdown/prose/state'\nimport type { TableRect } from '@milkdown/prose/tables'\n\nimport { tableCellSchema, tableRowSchema } from '../schema'\n\n/// @internal\nexport function addRowWithAlignment(\n ctx: Ctx,\n tr: Transaction,\n { map, tableStart, table }: TableRect,\n row: number\n) {\n const rowPos = Array(row)\n .fill(0)\n .reduce((acc, _, i) => {\n return acc + table.child(i).nodeSize\n }, tableStart)\n\n const cells = Array(map.width)\n .fill(0)\n .map((_, col) => {\n const headerCol = table.nodeAt(map.map[col] as number)\n return tableCellSchema\n .type(ctx)\n .createAndFill({ alignment: headerCol?.attrs.alignment }) as Node\n })\n\n tr.insert(rowPos, tableRowSchema.type(ctx).create(null, cells))\n return tr\n}\n","import type { Selection } from '@milkdown/prose/state'\n\nimport { findTable, TableMap } from '@milkdown/prose/tables'\n\n/// Get all cells in a table.\nexport function getAllCellsInTable(selection: Selection) {\n const table = findTable(selection.$from)\n if (!table) return\n\n const map = TableMap.get(table.node)\n const cells = map.cellsInRect({\n left: 0,\n right: map.width,\n top: 0,\n bottom: map.height,\n })\n return cells.map((nodePos) => {\n const node = table.node.nodeAt(nodePos)\n const pos = nodePos + table.start\n return { pos, start: pos + 1, node }\n })\n}\n","import type { Transaction } from '@milkdown/prose/state'\n\nimport { cloneTr } from '@milkdown/prose'\nimport { CellSelection } from '@milkdown/prose/tables'\n\nimport { getAllCellsInTable } from './get-all-cells-in-table'\n\n/// Select a possible table in current selection.\nexport function selectTable(tr: Transaction) {\n const cells = getAllCellsInTable(tr.selection)\n if (cells && cells[0]) {\n const $firstCell = tr.doc.resolve(cells[0].pos)\n const last = cells[cells.length - 1]\n if (last) {\n const $lastCell = tr.doc.resolve(last.pos)\n return cloneTr(tr.setSelection(new CellSelection($lastCell, $firstCell)))\n }\n }\n return tr\n}\n","import { paragraphSchema } from '@milkdown/preset-commonmark'\nimport { findParentNodeType } from '@milkdown/prose'\nimport { Selection } from '@milkdown/prose/state'\nimport {\n CellSelection,\n addColumnAfter,\n addColumnBefore,\n deleteColumn,\n deleteRow,\n deleteTable,\n goToNextCell,\n isInTable,\n selectedRect,\n setCellAttr,\n moveTableRow,\n moveTableColumn,\n} from '@milkdown/prose/tables'\nimport { $command } from '@milkdown/utils'\n\nimport { withMeta } from '../../__internal__'\nimport { tableSchema } from './schema'\nimport {\n addRowWithAlignment,\n createTable,\n selectCol,\n selectRow,\n selectTable,\n} from './utils'\n\n/// A command for moving cursor to previous cell.\nexport const goToPrevTableCellCommand = $command(\n 'GoToPrevTableCell',\n () => () => goToNextCell(-1)\n)\n\nwithMeta(goToPrevTableCellCommand, {\n displayName: 'Command<goToPrevTableCellCommand>',\n group: 'Table',\n})\n\n/// A command for moving cursor to next cell.\nexport const goToNextTableCellCommand = $command(\n 'GoToNextTableCell',\n () => () => goToNextCell(1)\n)\n\nwithMeta(goToNextTableCellCommand, {\n displayName: 'Command<goToNextTableCellCommand>',\n group: 'Table',\n})\n\n/// A command for quitting current table and insert a new paragraph node.\nexport const exitTable = $command(\n 'ExitTable',\n (ctx) => () => (state, dispatch) => {\n if (!isInTable(state)) return false\n\n const { $head } = state.selection\n const table = findParentNodeType($head, tableSchema.type(ctx))\n if (!table) return false\n\n const { to } = table\n\n const tr = state.tr.replaceWith(\n to,\n to,\n paragraphSchema.type(ctx).createAndFill()!\n )\n\n tr.setSelection(Selection.near(tr.doc.resolve(to), 1)).scrollIntoView()\n dispatch?.(tr)\n return true\n }\n)\n\nwithMeta(exitTable, {\n displayName: 'Command<breakTableCommand>',\n group: 'Table',\n})\n\n/// A command for inserting a table.\n/// You can specify the number of rows and columns.\n/// By default, it will insert a 3x3 table.\nexport const insertTableCommand = $command(\n 'InsertTable',\n (ctx) =>\n ({ row, col }: { row?: number; col?: number } = {}) =>\n (state, dispatch) => {\n const { selection, tr } = state\n const { from } = selection\n const table = createTable(ctx, row, col)\n const _tr = tr.replaceSelectionWith(table)\n const sel = Selection.findFrom(_tr.doc.resolve(from), 1, true)\n if (sel) _tr.setSelection(sel)\n\n dispatch?.(_tr)\n\n return true\n }\n)\n\nwithMeta(insertTableCommand, {\n displayName: 'Command<insertTableCommand>',\n group: 'Table',\n})\n\n/// A command for moving a row in a table.\n/// You should specify the `from` and `to` index.\nexport const moveRowCommand = $command(\n 'MoveRow',\n () =>\n ({ from, to, pos }: { from?: number; to?: number; pos?: number } = {}) =>\n moveTableRow({\n from: from ?? 0,\n to: to ?? 0,\n pos,\n })\n)\n\nwithMeta(moveRowCommand, {\n displayName: 'Command<moveRowCommand>',\n group: 'Table',\n})\n\n/// A command for moving a column in a table.\n/// You should specify the `from` and `to` index.\nexport const moveColCommand = $command(\n 'MoveCol',\n () =>\n ({ from, to, pos }: { from?: number; to?: number; pos?: number } = {}) =>\n moveTableColumn({\n from: from ?? 0,\n to: to ?? 0,\n pos,\n })\n)\n\nwithMeta(moveColCommand, {\n displayName: 'Command<moveColCommand>',\n group: 'Table',\n})\n\n/// A command for selecting a row.\nexport const selectRowCommand = $command<\n { index: number; pos?: number },\n 'SelectRow'\n>(\n 'SelectRow',\n () =>\n (payload: { index: number; pos?: number } = { index: 0 }) =>\n (state, dispatch) => {\n const { tr } = state\n const result = dispatch?.(selectRow(payload.index, payload.pos)(tr))\n\n return Boolean(result)\n }\n)\n\nwithMeta(selectRowCommand, {\n displayName: 'Command<selectRowCommand>',\n group: 'Table',\n})\n\n/// A command for selecting a column.\nexport const selectColCommand = $command<\n { index: number; pos?: number },\n 'SelectCol'\n>(\n 'SelectCol',\n () =>\n (payload: { index: number; pos?: number } = { index: 0 }) =>\n (state, dispatch) => {\n const { tr } = state\n const result = dispatch?.(selectCol(payload.index, payload.pos)(tr))\n\n return Boolean(result)\n }\n)\n\nwithMeta(selectColCommand, {\n displayName: 'Command<selectColCommand>',\n group: 'Table',\n})\n\n/// A command for selecting a table.\nexport const selectTableCommand = $command(\n 'SelectTable',\n () => () => (state, dispatch) => {\n const { tr } = state\n const result = dispatch?.(selectTable(tr))\n\n return Boolean(result)\n }\n)\n\nwithMeta(selectTableCommand, {\n displayName: 'Command<selectTableCommand>',\n group: 'Table',\n})\n\n/// A command for deleting selected cells.\n/// If the selection is a row or column, the row or column will be deleted.\n/// If all cells are selected, the table will be deleted.\nexport const deleteSelectedCellsCommand = $command(\n 'DeleteSelectedCells',\n () => () => (state, dispatch) => {\n const { selection } = state\n if (!(selection instanceof CellSelection)) return false\n\n const isRow = selection.isRowSelection()\n const isCol = selection.isColSelection()\n\n if (isRow && isCol) return deleteTable(state, dispatch)\n\n if (isCol) return deleteColumn(state, dispatch)\n else return deleteRow(state, dispatch)\n }\n)\n\nwithMeta(deleteSelectedCellsCommand, {\n displayName: 'Command<deleteSelectedCellsCommand>',\n group: 'Table',\n})\n\n/// A command for adding a column before the current column.\nexport const addColBeforeCommand = $command(\n 'AddColBefore',\n () => () => addColumnBefore\n)\n\nwithMeta(addColBeforeCommand, {\n displayName: 'Command<addColBeforeCommand>',\n group: 'Table',\n})\n\n/// A command for adding a column after the current column.\nexport const addColAfterCommand = $command(\n 'AddColAfter',\n () => () => addColumnAfter\n)\n\nwithMeta(addColAfterCommand, {\n displayName: 'Command<addColAfterCommand>',\n group: 'Table',\n})\n\n/// A command for adding a row before the current row.\nexport const addRowBeforeCommand = $command(\n 'AddRowBefore',\n (ctx) => () => (state, dispatch) => {\n if (!isInTable(state)) return false\n if (dispatch) {\n const rect = selectedRect(state)\n dispatch(addRowWithAlignment(ctx, state.tr, rect, rect.top))\n }\n return true\n }\n)\n\nwithMeta(addRowBeforeCommand, {\n displayName: 'Command<addRowBeforeCommand>',\n group: 'Table',\n})\n\n/// A command for adding a row after the current row.\nexport const addRowAfterCommand = $command(\n 'AddRowAfter',\n (ctx) => () => (state, dispatch) => {\n if (!isInTable(state)) return false\n if (dispatch) {\n const rect = selectedRect(state)\n dispatch(addRowWithAlignment(ctx, state.tr, rect, rect.bottom))\n }\n return true\n }\n)\n\nwithMeta(addRowAfterCommand, {\n displayName: 'Command<addRowAfterCommand>',\n group: 'Table',\n})\n\n/// A command for setting alignment property for selected cells.\n/// You can specify the alignment as `left`, `center`, or `right`.\n/// It's `left` by default.\nexport const setAlignCommand = $command<\n 'left' | 'center' | 'right',\n 'SetAlign'\n>(\n 'SetAlign',\n () =>\n (alignment = 'left') =>\n setCellAttr('alignment', alignment)\n)\n\nwithMeta(setAlignCommand, {\n displayName: 'Command<setAlignCommand>',\n group: 'Table',\n})\n","import { commandsCtx } from '@milkdown/core'\nimport { paragraphSchema } from '@milkdown/preset-commonmark'\nimport { InputRule } from '@milkdown/prose/inputrules'\nimport {\n type Fragment as FragmentType,\n Fragment,\n type Node as ProsemirrorNode,\n Slice,\n} from '@milkdown/prose/model'\nimport { TextSelection } from '@milkdown/prose/state'\nimport { $inputRule, $pasteRule, $useKeymap } from '@milkdown/utils'\n\nimport { withMeta } from '../../__internal__'\nimport {\n exitTable,\n goToNextTableCellCommand,\n goToPrevTableCellCommand,\n} from './command'\nimport {\n tableHeaderRowSchema,\n tableHeaderSchema,\n tableRowSchema,\n tableSchema,\n} from './schema'\nimport { createTable } from './utils'\n\n/// A input rule for creating table.\n/// For example, `|2x2|` will create a 2x2 table.\nexport const insertTableInputRule = $inputRule(\n (ctx) =>\n new InputRule(\n /^\\|(?<col>\\d+)[xX](?<row>\\d+)\\|\\s$/,\n (state, match, start, end) => {\n const $start = state.doc.resolve(start)\n if (\n !$start\n .node(-1)\n .canReplaceWith(\n $start.index(-1),\n $start.indexAfter(-1),\n tableSchema.type(ctx)\n )\n )\n return null\n\n const row = Math.max(Number(match.groups?.row ?? 0), 2)\n\n const tableNode = createTable(ctx, row, Number(match.groups?.col))\n const tr = state.tr.replaceRangeWith(start, end, tableNode)\n return tr\n .setSelection(TextSelection.create(tr.doc, start + 3))\n .scrollIntoView()\n }\n )\n)\n\nwithMeta(insertTableInputRule, {\n displayName: 'InputRule<insertTableInputRule>',\n group: 'Table',\n})\n\n/// A paste rule for fixing tables without header cells.\n/// This is a workaround for some editors (e.g. Google Docs) which allow creating tables without header cells,\n/// which is not supported by Markdown schema.\n/// This paste rule will promote the first data row to header, or add empty header cells as a fallback.\nexport const tablePasteRule = $pasteRule((ctx) => ({\n run: (slice, _view, isPlainText) => {\n if (isPlainText) {\n return slice\n }\n\n function fixTable(node: ProsemirrorNode): ProsemirrorNode {\n const rowsCount = node.childCount\n const colsCount = node.lastChild?.childCount ?? 0\n if (rowsCount === 0 || colsCount === 0) {\n return paragraphSchema.type(ctx).create()\n }\n\n const headerRow = node.firstChild\n const needToFixHeaderRow =\n colsCount > 0 && headerRow && headerRow.childCount === 0\n if (!needToFixHeaderRow) {\n return node\n }\n\n // If there are 2+ data rows (3+ total: empty header + 2+ data rows),\n // promote the first data row to header\n if (rowsCount >= 3) {\n const firstDataRow = node.child(1)\n const headerCells: ProsemirrorNode[] = []\n for (let i = 0; i < firstDataRow.childCount; i++) {\n const cell = firstDataRow.child(i)\n headerCells.push(\n tableHeaderSchema\n .type(ctx)\n .create(cell.attrs, cell.content, cell.marks)\n )\n }\n const newHeaderRow = headerRow.type.create(headerRow.attrs, headerCells)\n\n // Collect remaining data rows (skip promoted row at index 1)\n const remainingRows: ProsemirrorNode[] = []\n for (let i = 2; i < rowsCount; i++) {\n remainingRows.push(node.child(i))\n }\n\n return node.type.create(node.attrs, [newHeaderRow, ...remainingRows])\n }\n\n // Fallback: only 1 data row, can't promote (would leave 0 data rows).\n // Fill the empty header with blank cells.\n const headerCells = Array(colsCount)\n .fill(0)\n .map(() => tableHeaderSchema.type(ctx).createAndFill()!)\n\n const tableCells = new Slice(Fragment.from(headerCells), 0, 0)\n\n const newHeaderRow = headerRow.replace(0, 0, tableCells)\n const newTable = node.replace(\n 0,\n headerRow.nodeSize,\n new Slice(Fragment.from(newHeaderRow), 0, 0)\n )\n return newTable\n }\n\n // Wrap consecutive orphaned table_row nodes (at the top level of a fragment)\n // into a proper table. This happens when ProseMirror's parseSlice breaks\n // a table apart (e.g. when pasting multiple tables from Google Docs).\n function wrapOrphanedRows(fragment: FragmentType): FragmentType {\n const rowType = tableRowSchema.type(ctx)\n const nodes: ProsemirrorNode[] = []\n let pendingRows: ProsemirrorNode[] = []\n let hasOrphans = false\n\n function flushPendingRows() {\n if (pendingRows.length === 0) return\n\n // Create an empty table_header_row, then fixTable will promote the first data row\n const emptyHeaderRow = tableHeaderRowSchema.type(ctx).createAndFill()!\n const table = tableSchema\n .type(ctx)\n .create(null, [emptyHeaderRow, ...pendingRows])\n nodes.push(fixTable(table))\n pendingRows = []\n }\n\n fragment.forEach((node) => {\n if (node.type === rowType) {\n hasOrphans = true\n pendingRows.push(node)\n } else {\n flushPendingRows()\n nodes.push(node)\n }\n })\n flushPendingRows()\n\n return hasOrphans ? Fragment.from(nodes) : fragment\n }\n\n function fixFragment(fragment: FragmentType): FragmentType {\n // First, wrap any orphaned table_row nodes into tables\n let result = wrapOrphanedRows(fragment)\n\n // Then fix existing tables and recurse into children\n let changed = result !== fragment\n const fixed: ProsemirrorNode[] = []\n result.forEach((node) => {\n if (node.type === tableSchema.type(ctx)) {\n const fixedNode = fixTable(node)\n if (fixedNode !== node) changed = true\n fixed.push(fixedNode)\n } else if (node.childCount > 0) {\n const fixedContent = fixFragment(node.content)\n if (fixedContent !== node.content) {\n changed = true\n fixed.push(node.copy(fixedContent))\n } else {\n fixed.push(node)\n }\n } else {\n fixed.push(node)\n }\n })\n return changed ? Fragment.from(fixed) : fragment\n }\n\n // Remove empty paragraphs that directly precede a table\n // (artifacts of broken table parsing from Google Docs)\n function cleanEmptyParagraphs(fragment: FragmentType): FragmentType {\n const nodes: ProsemirrorNode[] = []\n const allNodes: ProsemirrorNode[] = []\n fragment.forEach((node) => allNodes.push(node))\n\n for (let i = 0; i < allNodes.length; i++) {\n const node = allNodes[i]!\n const next = allNodes[i + 1]\n if (\n node.type === paragraphSchema.type(ctx) &&\n node.content.size === 0 &&\n next &&\n next.type === tableSchema.type(ctx)\n ) {\n continue // skip empty paragraph before table\n }\n nodes.push(node)\n }\n\n return nodes.length < allNodes.length ? Fragment.from(nodes) : fragment\n }\n\n let fragment = fixFragment(slice.content)\n fragment = cleanEmptyParagraphs(fragment)\n return new Slice(Fragment.from(fragment), slice.openStart, slice.openEnd)\n },\n}))\n\nwithMeta(tablePasteRule, {\n displayName: 'PasteRule<table>',\n group: 'Table',\n})\n\n/// Keymap for table commands.\n/// - `<Mod-]>`/`<Tab>`: Move to the next cell.\n/// - `<Mod-[>`/`<Shift-Tab>`: Move to the previous cell.\n/// - `<Mod-Enter>`: Exit the table, and break it if possible.\nexport const tableKeymap = $useKeymap('tableKeymap', {\n NextCell: {\n priority: 100,\n shortcuts: ['Mod-]', 'Tab'],\n command: (ctx) => {\n const commands = ctx.get(commandsCtx)\n\n return () => commands.call(goToNextTableCellCommand.key)\n },\n },\n PrevCell: {\n shortcuts: ['Mod-[', 'Shift-Tab'],\n command: (ctx) => {\n const commands = ctx.get(commandsCtx)\n\n return () => commands.call(goToPrevTableCellCommand.key)\n },\n },\n ExitTable: {\n shortcuts: ['Mod-Enter', 'Enter'],\n command: (ctx) => {\n const commands = ctx.get(commandsCtx)\n\n return () => commands.call(exitTable.key)\n },\n },\n})\n\nwithMeta(tableKeymap.ctx, {\n displayName: 'KeymapCtx<table>',\n group: 'Table',\n})\n\nwithMeta(tableKeymap.shortcuts, {\n displayName: 'Keymap<table>',\n group: 'Table',\n})\n","import { expectDomTypeError } from '@milkdown/exception'\nimport { $nodeSchema } from '@milkdown/utils'\n\nimport { withMeta } from '../../__internal__'\n\nconst id = 'footnote_definition'\nconst markdownId = 'footnoteDefinition'\n\n/// Footnote definition node schema.\nexport const footnoteDefinitionSchema = $nodeSchema(\n 'footnote_definition',\n () => ({\n group: 'block',\n content: 'block+',\n defining: true,\n attrs: {\n label: {\n default: '',\n validate: 'string',\n },\n },\n parseDOM: [\n {\n tag: `dl[data-type=\"${id}\"]`,\n getAttrs: (dom) => {\n if (!(dom instanceof HTMLElement)) throw expectDomTypeError(dom)\n\n return {\n label: dom.dataset.label,\n }\n },\n contentElement: 'dd',\n },\n ],\n toDOM: (node) => {\n const label = node.attrs.label\n\n return [\n 'dl',\n {\n // TODO: add a prosemirror plugin to sync label on change\n 'data-label': label,\n 'data-type': id,\n },\n ['dt', label],\n ['dd', 0],\n ]\n },\n parseMarkdown: {\n match: ({ type }) => type === markdownId,\n runner: (state, node, type) => {\n state\n .openNode(type, {\n label: node.label as string,\n })\n .next(node.children)\n .closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === id,\n runner: (state, node) => {\n state\n .openNode(markdownId, undefined, {\n label: node.attrs.label,\n identifier: node.attrs.label,\n })\n .next(node.content)\n .closeNode()\n },\n },\n })\n)\n\nwithMeta(footnoteDefinitionSchema.ctx, {\n displayName: 'NodeSchemaCtx<footnodeDef>',\n group: 'footnote',\n})\n\nwithMeta(footnoteDefinitionSchema.node, {\n displayName: 'NodeSchema<footnodeDef>',\n group: 'footnote',\n})\n","import { expectDomTypeError } from '@milkdown/exception'\nimport { $nodeSchema } from '@milkdown/utils'\n\nimport { withMeta } from '../../__internal__'\n\nconst id = 'footnote_reference'\n\n/// Footnote reference node schema.\nexport const footnoteReferenceSchema = $nodeSchema(\n 'footnote_reference',\n () => ({\n group: 'inline',\n inline: true,\n atom: true,\n attrs: {\n label: {\n default: '',\n validate: 'string',\n },\n },\n parseDOM: [\n {\n tag: `sup[data-type=\"${id}\"]`,\n getAttrs: (dom) => {\n if (!(dom instanceof HTMLElement)) throw expectDomTypeError(dom)\n\n return {\n label: dom.dataset.label,\n }\n },\n },\n ],\n toDOM: (node) => {\n const label = node.attrs.label\n return [\n 'sup',\n {\n // TODO: add a prosemirror plugin to sync label on change\n 'data-label': label,\n 'data-type': id,\n },\n label,\n ]\n },\n parseMarkdown: {\n match: ({ type }) => type === 'footnoteReference',\n runner: (state, node, type) => {\n state.addNode(type, {\n label: node.label as string,\n })\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === id,\n runner: (state, node) => {\n state.addNode('footnoteReference', undefined, undefined, {\n label: node.attrs.label,\n identifier: node.attrs.label,\n })\n },\n },\n })\n)\n\nwithMeta(footnoteReferenceSchema.ctx, {\n displayName: 'NodeSchemaCtx<footnodeRef>',\n group: 'footnote',\n})\n\nwithMeta(footnoteReferenceSchema.node, {\n displayName: 'NodeSchema<footnodeRef>',\n group: 'footnote',\n})\n","import { expectDomTypeError } from '@milkdown/exception'\nimport { listItemSchema } from '@milkdown/preset-commonmark'\nimport { InputRule } from '@milkdown/prose/inputrules'\nimport { $inputRule } from '@milkdown/utils'\n\nimport { withMeta } from '../__internal__'\n\n/// This schema extends the [list item](/preset-commonmark#list-item) schema and add task list support for it.\nexport const extendListItemSchemaForTask = listItemSchema.extendSchema(\n (prev) => {\n return (ctx) => {\n const baseSchema = prev(ctx)\n return {\n ...baseSchema,\n attrs: {\n ...baseSchema.attrs,\n checked: {\n default: null,\n validate: 'boolean|null',\n },\n },\n parseDOM: [\n {\n tag: 'li[data-item-type=\"task\"]',\n getAttrs: (dom) => {\n if (!(dom instanceof HTMLElement)) throw expectDomTypeError(dom)\n\n return {\n label: dom.dataset.label,\n listType: dom.dataset.listType,\n spread: dom.dataset.spread,\n checked: dom.dataset.checked\n ? dom.dataset.checked === 'true'\n : null,\n }\n },\n },\n ...(baseSchema?.parseDOM || []),\n ],\n toDOM: (node) => {\n if (baseSchema.toDOM && node.attrs.checked == null)\n return baseSchema.toDOM(node)\n\n return [\n 'li',\n {\n 'data-item-type': 'task',\n 'data-label': node.attrs.label,\n 'data-list-type': node.attrs.listType,\n 'data-spread': node.attrs.spread,\n 'data-checked': node.attrs.checked,\n },\n 0,\n ]\n },\n parseMarkdown: {\n match: ({ type }) => type === 'listItem',\n runner: (state, node, type) => {\n if (node.checked == null) {\n baseSchema.parseMarkdown.runner(state, node, type)\n return\n }\n\n const label = node.label != null ? `${node.label}.` : '•'\n const checked = node.checked != null ? Boolean(node.checked) : null\n const listType = node.label != null ? 'ordered' : 'bullet'\n const spread = node.spread != null ? `${node.spread}` : 'true'\n\n state.openNode(type, { label, listType, spread, checked })\n state.next(node.children)\n state.closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'list_item',\n runner: (state, node) => {\n if (node.attrs.checked == null) {\n baseSchema.toMarkdown.runner(state, node)\n return\n }\n\n const label = node.attrs.label\n const listType = node.attrs.listType\n const spread = node.attrs.spread === 'true'\n const checked = node.attrs.checked\n\n state.openNode('listItem', undefined, {\n label,\n listType,\n spread,\n checked,\n })\n state.next(node.content)\n state.closeNode()\n },\n },\n }\n }\n }\n)\n\nwithMeta(extendListItemSchemaForTask.node, {\n displayName: 'NodeSchema<taskListItem>',\n group: 'ListItem',\n})\n\nwithMeta(extendListItemSchemaForTask.ctx, {\n displayName: 'NodeSchemaCtx<taskListItem>',\n group: 'ListItem',\n})\n\n/// Input rule for wrapping a block in task list node.\n/// Users can type `[ ] ` or `[x] ` to wrap the block in task list node with checked status.\nexport const wrapInTaskListInputRule = $inputRule(() => {\n return new InputRule(\n /^\\[(?<checked>\\s|x)\\]\\s$/,\n (state, match, start, end) => {\n const pos = state.doc.resolve(start)\n let depth = 0\n let node = pos.node(depth)\n while (node && node.type.name !== 'list_item') {\n depth--\n node = pos.node(depth)\n }\n\n if (!node || node.attrs.checked != null) return null\n\n const checked = Boolean(match.groups?.checked === 'x')\n\n const finPos = pos.before(depth)\n const tr = state.tr\n\n tr.deleteRange(start, end).setNodeMarkup(finPos, undefined, {\n ...node.attrs,\n checked,\n })\n\n return tr\n }\n )\n})\n\nwithMeta(wrapInTaskListInputRule, {\n displayName: 'InputRule<wrapInTaskListInputRule>',\n group: 'ListItem',\n})\n","import type { MilkdownPlugin } from '@milkdown/ctx'\n\nimport { strikethroughKeymap } from '../mark'\nimport { tableKeymap } from '../node'\n\n/// @internal\nexport const keymap: MilkdownPlugin[] = [\n strikethroughKeymap,\n tableKeymap,\n].flat()\n","import type { MilkdownPlugin } from '@milkdown/ctx'\n\nimport { strikethroughInputRule } from '../mark'\nimport { insertTableInputRule, wrapInTaskListInputRule } from '../node'\n\n/// @internal\nexport const inputRules: MilkdownPlugin[] = [\n insertTableInputRule,\n wrapInTaskListInputRule,\n]\n\nexport const markInputRules: MilkdownPlugin[] = [strikethroughInputRule]\n","import type { MilkdownPlugin } from '@milkdown/ctx'\n\nimport { tablePasteRule } from '../node'\n\n/// @internal\nexport const pasteRules: MilkdownPlugin[] = [tablePasteRule]\n","import { $prose } from '@milkdown/utils'\nimport { imeSpan } from 'prosemirror-safari-ime-span'\n\nimport { withMeta } from '../__internal__'\n\n/// This plugin is used to fix the bug of IME composing in table in Safari browser.\n/// original discussion in https://discuss.prosemirror.net/t/ime-composing-problems-on-td-or-th-element-in-safari-browser/4501\nexport const autoInsertSpanPlugin = $prose(() => imeSpan)\n\nwithMeta(autoInsertSpanPlugin, {\n displayName: 'Prose<autoInsertSpanPlugin>',\n group: 'Prose',\n})\n","import { columnResizing } from '@milkdown/prose/tables'\nimport { $prose } from '@milkdown/utils'\n\nimport { withMeta } from '../__internal__'\n\n/// This plugin is wrapping the `columnResizing` plugin from [prosemirror-tables](https://github.com/ProseMirror/prosemirror-tables).\nexport const columnResizingPlugin = $prose(() => columnResizing({}))\n\nwithMeta(columnResizingPlugin, {\n displayName: 'Prose<columnResizingPlugin>',\n group: 'Prose',\n})\n","import { tableEditing } from '@milkdown/prose/tables'\nimport { $prose } from '@milkdown/utils'\n\nimport { withMeta } from '../__internal__'\n\n/// This plugin is wrapping the `tableEditing` plugin from [prosemirror-tables](https://github.com/ProseMirror/prosemirror-tables).\nexport const tableEditingPlugin = $prose(() =>\n tableEditing({ allowTableNodeSelection: true })\n)\n\nwithMeta(tableEditingPlugin, {\n displayName: 'Prose<tableEditingPlugin>',\n group: 'Prose',\n})\n","import type { $Remark } from '@milkdown/utils'\nimport type { Options } from 'remark-gfm'\n\nimport { $remark } from '@milkdown/utils'\nimport remarkGFM from 'remark-gfm'\n\nimport { withMeta } from '../__internal__'\n\n/// This plugin is wrapping the [remark-gfm](https://github.com/remarkjs/remark-gfm).\nexport const remarkGFMPlugin: $Remark<'remarkGFM', Options | null | undefined> =\n $remark('remarkGFM', () => remarkGFM)\n\nwithMeta(remarkGFMPlugin.plugin, {\n displayName: 'Remark<remarkGFMPlugin>',\n group: 'Remark',\n})\n\nwithMeta(remarkGFMPlugin.options, {\n displayName: 'RemarkConfig<remarkGFMPlugin>',\n group: 'Remark',\n})\n","import type { Node } from '@milkdown/prose/model'\nimport type { Transaction } from '@milkdown/prose/state'\n\nimport { Plugin, PluginKey } from '@milkdown/prose/state'\nimport { $prose } from '@milkdown/utils'\n\nimport { withMeta } from '../__internal__'\n\nconst pluginKey = new PluginKey('MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN')\n\nfunction getChildIndex(node: Node, parent: Node) {\n let index = 0\n parent.forEach((child, _offset, i) => {\n if (child === node) index = i\n })\n return index\n}\n\nexport const keepTableAlignPlugin = $prose(() => {\n return new Plugin({\n key: pluginKey,\n appendTransaction: (_tr, oldState, state) => {\n let tr: Transaction | undefined\n const check = (node: Node, pos: number) => {\n if (!tr) tr = state.tr\n\n if (node.type.name !== 'table_cell') return\n\n const $pos = state.doc.resolve(pos)\n const tableRow = $pos.node($pos.depth)\n const table = $pos.node($pos.depth - 1)\n const tableHeaderRow = table.firstChild\n // TODO: maybe consider add a header row\n if (!tableHeaderRow) return\n\n const index = getChildIndex(node, tableRow)\n const headerCell = tableHeaderRow.maybeChild(index)\n if (!headerCell) return\n const align = headerCell.attrs.alignment\n const currentAlign = node.attrs.alignment\n if (align === currentAlign) return\n\n tr.setNodeMarkup(pos, undefined, { ...node.attrs, alignment: align })\n }\n if (oldState.doc !== state.doc) state.doc.descendants(check)\n\n return tr\n },\n })\n})\n\nwithMeta(keepTableAlignPlugin, {\n displayName: 'Prose<keepTableAlignPlugin>',\n group: 'Prose',\n})\n","import type { MilkdownPlugin } from '@milkdown/ctx'\n\nimport {\n autoInsertSpanPlugin,\n keepTableAlignPlugin,\n remarkGFMPlugin,\n tableEditingPlugin,\n} from '../plugin'\n\n/// @internal\nexport const plugins: MilkdownPlugin[] = [\n keepTableAlignPlugin,\n autoInsertSpanPlugin,\n remarkGFMPlugin,\n tableEditingPlugin,\n].flat()\n","import type { MilkdownPlugin } from '@milkdown/ctx'\n\nimport { strikethroughAttr, strikethroughSchema } from '../mark'\nimport {\n extendListItemSchemaForTask,\n footnoteDefinitionSchema,\n footnoteReferenceSchema,\n tableCellSchema,\n tableHeaderRowSchema,\n tableHeaderSchema,\n tableRowSchema,\n tableSchema,\n} from '../node'\n\n/// @internal\nexport const schema: MilkdownPlugin[] = [\n extendListItemSchemaForTask,\n\n tableSchema,\n tableHeaderRowSchema,\n tableRowSchema,\n tableHeaderSchema,\n tableCellSchema,\n\n footnoteDefinitionSchema,\n footnoteReferenceSchema,\n\n strikethroughAttr,\n strikethroughSchema,\n].flat()\n","import { toggleStrikethroughCommand } from '../mark'\nimport {\n addColAfterCommand,\n addColBeforeCommand,\n addRowAfterCommand,\n addRowBeforeCommand,\n deleteSelectedCellsCommand,\n exitTable,\n goToNextTableCellCommand,\n goToPrevTableCellCommand,\n insertTableCommand,\n moveColCommand,\n moveRowCommand,\n selectColCommand,\n selectRowCommand,\n selectTableCommand,\n setAlignCommand,\n} from '../node'\n\n/// @internal\nexport const commands = [\n goToNextTableCellCommand,\n goToPrevTableCellCommand,\n exitTable,\n insertTableCommand,\n moveRowCommand,\n moveColCommand,\n selectRowCommand,\n selectColCommand,\n selectTableCommand,\n deleteSelectedCellsCommand,\n addRowBeforeCommand,\n addRowAfterCommand,\n addColBeforeCommand,\n addColAfterCommand,\n setAlignCommand,\n\n toggleStrikethroughCommand,\n]\n","import {\n commands,\n inputRules,\n keymap,\n markInputRules,\n pasteRules,\n plugins,\n schema,\n} from './composed'\n\nexport * from './node'\nexport * from './mark'\nexport * from './plugin'\nexport * from './composed'\n\n/// The GFM preset, includes all the plugins.\nexport const gfm = [\n schema,\n inputRules,\n pasteRules,\n markInputRules,\n keymap,\n commands,\n plugins,\n].flat()\n"],"mappings":";;;;;;;;;;;;;AAEA,SAAgB,SACd,QACA,MACG;CACH,OAAO,OAAO,QAAQ,EACpB,MAAM;EACJ,SAAS;EACT,GAAG;EACJ,EACF,CAAC;CAEF,OAAO;;;;ACCT,IAAa,oBAAoB,UAAU,iBAAiB;AAE5D,SAAS,mBAAmB;CAC1B,aAAa;CACb,OAAO;CACR,CAAC;AAGF,IAAa,sBAAsB,YAAY,mBAAmB,SAAS;CACzE,UAAU,CACR,E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ACD,CAAC,MAAM;;;ACAR,IAAa,SAA2B;CACtC;CAEA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;CACA;CACD,CAAC,MAAM;;;ACTR,IAAa,WAAW;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACD;;;ACtBD,IAAa,MAAM;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,MAAM"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/__internal__/with-meta.ts","../src/mark/strike-through.ts","../src/node/table/schema.ts","../src/node/table/utils/create-table.ts","../src/node/table/utils/get-cells-in-col.ts","../src/node/table/utils/get-cells-in-row.ts","../src/node/table/utils/select-line.ts","../src/node/table/utils/add-row-with-alignment.ts","../src/node/table/utils/get-all-cells-in-table.ts","../src/node/table/utils/select-table.ts","../src/node/table/command.ts","../src/node/table/input.ts","../src/node/footnote/definition.ts","../src/node/footnote/reference.ts","../src/node/task-list-item.ts","../src/composed/keymap.ts","../src/composed/inputrules.ts","../src/composed/pasterules.ts","../src/plugin/auto-insert-span-plugin.ts","../src/plugin/column-resizing-plugin.ts","../src/plugin/table-editing-plugin.ts","../src/plugin/remark-gfm-plugin.ts","../src/plugin/keep-table-align-plugin.ts","../src/composed/plugins.ts","../src/composed/schema.ts","../src/composed/commands.ts","../src/index.ts"],"sourcesContent":["import type { Meta, MilkdownPlugin } from '@milkdown/ctx'\n\nexport function withMeta<T extends MilkdownPlugin>(\n plugin: T,\n meta: Partial<Meta> & Pick<Meta, 'displayName'>\n): T {\n Object.assign(plugin, {\n meta: {\n package: '@milkdown/preset-gfm',\n ...meta,\n },\n })\n\n return plugin\n}\n","import { commandsCtx } from '@milkdown/core'\nimport { markRule } from '@milkdown/prose'\nimport { toggleMark } from '@milkdown/prose/commands'\nimport {\n $command,\n $inputRule,\n $markAttr,\n $markSchema,\n $useKeymap,\n} from '@milkdown/utils'\n\nimport { withMeta } from '../__internal__'\n\n/// HTML attributes for the strikethrough mark.\nexport const strikethroughAttr = $markAttr('strike_through')\n\nwithMeta(strikethroughAttr, {\n displayName: 'Attr<strikethrough>',\n group: 'Strikethrough',\n})\n\n/// Strikethrough mark schema.\nexport const strikethroughSchema = $markSchema('strike_through', (ctx) => ({\n parseDOM: [\n { tag: 'del' },\n {\n style: 'text-decoration',\n getAttrs: (value) => (value === 'line-through') as false,\n },\n ],\n toDOM: (mark) => ['del', ctx.get(strikethroughAttr.key)(mark)],\n parseMarkdown: {\n match: (node) => node.type === 'delete',\n runner: (state, node, markType) => {\n state.openMark(markType)\n state.next(node.children)\n state.closeMark(markType)\n },\n },\n toMarkdown: {\n match: (mark) => mark.type.name === 'strike_through',\n runner: (state, mark) => {\n state.withMark(mark, 'delete')\n },\n },\n}))\n\nwithMeta(strikethroughSchema.mark, {\n displayName: 'MarkSchema<strikethrough>',\n group: 'Strikethrough',\n})\n\nwithMeta(strikethroughSchema.ctx, {\n displayName: 'MarkSchemaCtx<strikethrough>',\n group: 'Strikethrough',\n})\n\n/// A command to toggle the strikethrough mark.\nexport const toggleStrikethroughCommand = $command(\n 'ToggleStrikeThrough',\n (ctx) => () => {\n return toggleMark(strikethroughSchema.type(ctx))\n }\n)\n\nwithMeta(toggleStrikethroughCommand, {\n displayName: 'Command<ToggleStrikethrough>',\n group: 'Strikethrough',\n})\n\n/// Input rule to create the strikethrough mark.\nexport const strikethroughInputRule = $inputRule((ctx) => {\n return markRule(\n /(?<![\\w:/])(~{1,2})(.+?)\\1(?!\\w|\\/)$/,\n strikethroughSchema.type(ctx)\n )\n})\n\nwithMeta(strikethroughInputRule, {\n displayName: 'InputRule<strikethrough>',\n group: 'Strikethrough',\n})\n\n/// Keymap for the strikethrough mark.\n/// - `Mod-Alt-x` - Toggle the strikethrough mark.\nexport const strikethroughKeymap = $useKeymap('strikeThroughKeymap', {\n ToggleStrikethrough: {\n shortcuts: 'Mod-Alt-x',\n command: (ctx) => {\n const commands = ctx.get(commandsCtx)\n return () => commands.call(toggleStrikethroughCommand.key)\n },\n },\n})\n\nwithMeta(strikethroughKeymap.ctx, {\n displayName: 'KeymapCtx<strikethrough>',\n group: 'Strikethrough',\n})\n\nwithMeta(strikethroughKeymap.shortcuts, {\n displayName: 'Keymap<strikethrough>',\n group: 'Strikethrough',\n})\n","import type { NodeType } from '@milkdown/prose/model'\nimport type { MarkdownNode } from '@milkdown/transformer'\n\nimport { tableNodes } from '@milkdown/prose/tables'\nimport { $nodeSchema } from '@milkdown/utils'\n\nimport { withMeta } from '../../__internal__'\n\nconst originalSchema = tableNodes({\n tableGroup: 'block',\n cellContent: 'paragraph',\n cellAttributes: {\n alignment: {\n default: 'left',\n getFromDOM: (dom) => dom.style.textAlign || 'left',\n setDOMAttr: (value, attrs) => {\n attrs.style = `text-align: ${value || 'left'}`\n },\n },\n },\n})\n\n/// Schema for table node.\nexport const tableSchema = $nodeSchema('table', () => ({\n ...originalSchema.table,\n content: 'table_header_row table_row+',\n disableDropCursor: true,\n parseMarkdown: {\n match: (node) => node.type === 'table',\n runner: (state, node, type) => {\n const align = node.align as (string | null)[]\n const children = (node.children as MarkdownNode[]).map((x, i) => ({\n ...x,\n align,\n isHeader: i === 0,\n }))\n state.openNode(type)\n state.next(children)\n state.closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'table',\n runner: (state, node) => {\n const firstLine = node.content.firstChild?.content\n if (!firstLine) return\n\n const align: (string | null)[] = []\n firstLine.forEach((cell) => {\n align.push(cell.attrs.alignment)\n })\n state.openNode('table', undefined, { align })\n state.next(node.content)\n state.closeNode()\n },\n },\n}))\n\nwithMeta(tableSchema.node, {\n displayName: 'NodeSchema<table>',\n group: 'Table',\n})\n\nwithMeta(tableSchema.ctx, {\n displayName: 'NodeSchemaCtx<table>',\n group: 'Table',\n})\n\n/// Schema for table header row node.\nexport const tableHeaderRowSchema = $nodeSchema('table_header_row', () => ({\n ...originalSchema.table_row,\n disableDropCursor: true,\n content: '(table_header)*',\n parseDOM: [\n { tag: 'tr[data-is-header]' },\n {\n tag: 'tr',\n getAttrs: (dom: HTMLElement) => {\n if (dom instanceof HTMLElement) {\n const hasHeader = dom.querySelector('th')\n return hasHeader ? {} : false\n }\n return false\n },\n },\n ],\n toDOM() {\n return ['tr', { 'data-is-header': true }, 0]\n },\n parseMarkdown: {\n match: (node) => Boolean(node.type === 'tableRow' && node.isHeader),\n runner: (state, node, type) => {\n const align = node.align as (string | null)[]\n const children = (node.children as MarkdownNode[]).map((x, i) => ({\n ...x,\n align: align[i],\n isHeader: node.isHeader,\n }))\n state.openNode(type)\n state.next(children)\n state.closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'table_header_row',\n runner: (state, node) => {\n // if the row is empty, we don't need to create a table row\n // prevent remark from crashing\n if (node.content.size === 0) {\n return\n }\n state.openNode('tableRow', undefined, { isHeader: true })\n state.next(node.content)\n state.closeNode()\n },\n },\n}))\n\nwithMeta(tableHeaderRowSchema.node, {\n displayName: 'NodeSchema<tableHeaderRow>',\n group: 'Table',\n})\n\nwithMeta(tableHeaderRowSchema.ctx, {\n displayName: 'NodeSchemaCtx<tableHeaderRow>',\n group: 'Table',\n})\n\n/// Schema for table row node.\nexport const tableRowSchema = $nodeSchema('table_row', () => ({\n ...originalSchema.table_row,\n disableDropCursor: true,\n content: '(table_cell)*',\n parseMarkdown: {\n match: (node) => node.type === 'tableRow',\n runner: (state, node, type) => {\n const align = node.align as (string | null)[]\n const children = (node.children as MarkdownNode[]).map((x, i) => ({\n ...x,\n align: align[i],\n }))\n state.openNode(type)\n state.next(children)\n state.closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'table_row',\n runner: (state, node) => {\n // if the row is empty, we don't need to create a table row\n // prevent remark from crashing\n if (node.content.size === 0) {\n return\n }\n state.openNode('tableRow')\n state.next(node.content)\n state.closeNode()\n },\n },\n}))\n\nwithMeta(tableRowSchema.node, {\n displayName: 'NodeSchema<tableRow>',\n group: 'Table',\n})\n\nwithMeta(tableRowSchema.ctx, {\n displayName: 'NodeSchemaCtx<tableRow>',\n group: 'Table',\n})\n\n/// Schema for table cell node.\nexport const tableCellSchema = $nodeSchema('table_cell', () => ({\n ...originalSchema.table_cell,\n disableDropCursor: true,\n parseMarkdown: {\n match: (node) => node.type === 'tableCell' && !node.isHeader,\n runner: (state, node, type) => {\n const align = node.align as string\n state\n .openNode(type, { alignment: align })\n .openNode(state.schema.nodes.paragraph as NodeType)\n .next(node.children)\n .closeNode()\n .closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'table_cell',\n runner: (state, node) => {\n state.openNode('tableCell').next(node.content).closeNode()\n },\n },\n}))\n\nwithMeta(tableCellSchema.node, {\n displayName: 'NodeSchema<tableCell>',\n group: 'Table',\n})\n\nwithMeta(tableCellSchema.ctx, {\n displayName: 'NodeSchemaCtx<tableCell>',\n group: 'Table',\n})\n\n/// Schema for table header node.\nexport const tableHeaderSchema = $nodeSchema('table_header', () => ({\n ...originalSchema.table_header,\n disableDropCursor: true,\n parseMarkdown: {\n match: (node) => node.type === 'tableCell' && !!node.isHeader,\n runner: (state, node, type) => {\n const align = node.align as string\n state.openNode(type, { alignment: align })\n state.openNode(state.schema.nodes.paragraph as NodeType)\n state.next(node.children)\n state.closeNode()\n state.closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'table_header',\n runner: (state, node) => {\n state.openNode('tableCell')\n state.next(node.content)\n state.closeNode()\n },\n },\n}))\n\nwithMeta(tableHeaderSchema.node, {\n displayName: 'NodeSchema<tableHeader>',\n group: 'Table',\n})\n\nwithMeta(tableHeaderSchema.ctx, {\n displayName: 'NodeSchemaCtx<tableHeader>',\n group: 'Table',\n})\n","import type { Ctx } from '@milkdown/ctx'\nimport type { Node } from '@milkdown/prose/model'\n\nimport {\n tableCellSchema,\n tableHeaderRowSchema,\n tableHeaderSchema,\n tableRowSchema,\n tableSchema,\n} from '../schema'\n\n/// @internal\nexport function createTable(ctx: Ctx, rowsCount = 3, colsCount = 3): Node {\n const cells = Array(colsCount)\n .fill(0)\n .map(() => tableCellSchema.type(ctx).createAndFill()!)\n\n const headerCells = Array(colsCount)\n .fill(0)\n .map(() => tableHeaderSchema.type(ctx).createAndFill()!)\n\n const rows = Array(rowsCount)\n .fill(0)\n .map((_, i) =>\n i === 0\n ? tableHeaderRowSchema.type(ctx).create(null, headerCells)\n : tableRowSchema.type(ctx).create(null, cells)\n )\n\n return tableSchema.type(ctx).create(null, rows)\n}\n","import type { Selection } from '@milkdown/prose/state'\n\nimport { findTable, TableMap } from '@milkdown/prose/tables'\n\nimport type { CellPos } from './types'\n\n/// Get cells in a column of a table.\nexport function getCellsInCol(\n columnIndexes: number | number[],\n selection: Selection\n): CellPos[] | undefined {\n const table = findTable(selection.$from)\n if (!table) return undefined\n\n const map = TableMap.get(table.node)\n const indexes = Array.isArray(columnIndexes) ? columnIndexes : [columnIndexes]\n\n return indexes\n .filter((index) => index >= 0 && index <= map.width - 1)\n .flatMap((index) => {\n const cells = map.cellsInRect({\n left: index,\n right: index + 1,\n top: 0,\n bottom: map.height,\n })\n return cells.map((nodePos) => {\n const node = table.node.nodeAt(nodePos)!\n const pos = nodePos + table.start\n return { pos, start: pos + 1, node, depth: table.depth + 2 }\n })\n })\n}\n","import type { Selection } from '@milkdown/prose/state'\n\nimport { findTable, TableMap } from '@milkdown/prose/tables'\n\nimport type { CellPos } from './types'\n\n/// Get cells in a row of a table.\nexport function getCellsInRow(\n rowIndex: number | number[],\n selection: Selection\n): CellPos[] | undefined {\n const table = findTable(selection.$from)\n if (!table) {\n return\n }\n\n const map = TableMap.get(table.node)\n const indexes = Array.isArray(rowIndex) ? rowIndex : [rowIndex]\n\n return indexes\n .filter((index) => index >= 0 && index <= map.height - 1)\n .flatMap((index) => {\n const cells = map.cellsInRect({\n left: 0,\n right: map.width,\n top: index,\n bottom: index + 1,\n })\n return cells.map((nodePos) => {\n const node = table.node.nodeAt(nodePos)!\n const pos = nodePos + table.start\n return { pos, start: pos + 1, node, depth: table.depth + 2 }\n })\n })\n}\n","import type { Selection, Transaction } from '@milkdown/prose/state'\n\nimport { cloneTr, findParentNodeClosestToPos } from '@milkdown/prose'\nimport { CellSelection, TableMap } from '@milkdown/prose/tables'\n\n/// @internal\nexport function selectLine(type: 'row' | 'col') {\n return (index: number, pos?: number) => (tr: Transaction) => {\n pos = pos ?? tr.selection.from\n const $pos = tr.doc.resolve(pos)\n const $node = findParentNodeClosestToPos(\n (node) => node.type.name === 'table'\n )($pos)\n const table = $node\n ? {\n node: $node.node,\n from: $node.start,\n }\n : undefined\n\n const isRowSelection = type === 'row'\n if (table) {\n const map = TableMap.get(table.node)\n\n // Check if the index is valid\n if (index >= 0 && index < (isRowSelection ? map.height : map.width)) {\n const lastCell = map.positionAt(\n isRowSelection ? index : map.height - 1,\n isRowSelection ? map.width - 1 : index,\n table.node\n )\n const $lastCell = tr.doc.resolve(table.from + lastCell)\n\n const createCellSelection = isRowSelection\n ? // oxlint-disable-next-line typescript/unbound-method\n CellSelection.rowSelection\n : // oxlint-disable-next-line typescript/unbound-method\n CellSelection.colSelection\n\n const firstCell = map.positionAt(\n isRowSelection ? index : 0,\n isRowSelection ? 0 : index,\n table.node\n )\n const $firstCell = tr.doc.resolve(table.from + firstCell)\n return cloneTr(\n tr.setSelection(\n createCellSelection($lastCell, $firstCell) as unknown as Selection\n )\n )\n }\n }\n return tr\n }\n}\n\n/// If the selection is in a table,\n/// select the {index} row.\nexport const selectRow = selectLine('row')\n\n/// If the selection is in a table,\n/// select the {index} column.\nexport const selectCol = selectLine('col')\n","import type { Ctx } from '@milkdown/ctx'\nimport type { Node } from '@milkdown/prose/model'\nimport type { Transaction } from '@milkdown/prose/state'\nimport type { TableRect } from '@milkdown/prose/tables'\n\nimport { tableCellSchema, tableRowSchema } from '../schema'\n\n/// @internal\nexport function addRowWithAlignment(\n ctx: Ctx,\n tr: Transaction,\n { map, tableStart, table }: TableRect,\n row: number\n) {\n const rowPos = Array(row)\n .fill(0)\n .reduce((acc, _, i) => {\n return acc + table.child(i).nodeSize\n }, tableStart)\n\n const cells = Array(map.width)\n .fill(0)\n .map((_, col) => {\n const headerCol = table.nodeAt(map.map[col] as number)\n return tableCellSchema\n .type(ctx)\n .createAndFill({ alignment: headerCol?.attrs.alignment }) as Node\n })\n\n tr.insert(rowPos, tableRowSchema.type(ctx).create(null, cells))\n return tr\n}\n","import type { Selection } from '@milkdown/prose/state'\n\nimport { findTable, TableMap } from '@milkdown/prose/tables'\n\n/// Get all cells in a table.\nexport function getAllCellsInTable(selection: Selection) {\n const table = findTable(selection.$from)\n if (!table) return\n\n const map = TableMap.get(table.node)\n const cells = map.cellsInRect({\n left: 0,\n right: map.width,\n top: 0,\n bottom: map.height,\n })\n return cells.map((nodePos) => {\n const node = table.node.nodeAt(nodePos)\n const pos = nodePos + table.start\n return { pos, start: pos + 1, node }\n })\n}\n","import type { Transaction } from '@milkdown/prose/state'\n\nimport { cloneTr } from '@milkdown/prose'\nimport { CellSelection } from '@milkdown/prose/tables'\n\nimport { getAllCellsInTable } from './get-all-cells-in-table'\n\n/// Select a possible table in current selection.\nexport function selectTable(tr: Transaction) {\n const cells = getAllCellsInTable(tr.selection)\n if (cells && cells[0]) {\n const $firstCell = tr.doc.resolve(cells[0].pos)\n const last = cells[cells.length - 1]\n if (last) {\n const $lastCell = tr.doc.resolve(last.pos)\n return cloneTr(tr.setSelection(new CellSelection($lastCell, $firstCell)))\n }\n }\n return tr\n}\n","import { paragraphSchema } from '@milkdown/preset-commonmark'\nimport { findParentNodeType } from '@milkdown/prose'\nimport { Selection } from '@milkdown/prose/state'\nimport {\n CellSelection,\n addColumnAfter,\n addColumnBefore,\n deleteColumn,\n deleteRow,\n deleteTable,\n goToNextCell,\n isInTable,\n selectedRect,\n setCellAttr,\n moveTableRow,\n moveTableColumn,\n} from '@milkdown/prose/tables'\nimport { $command } from '@milkdown/utils'\n\nimport { withMeta } from '../../__internal__'\nimport { tableSchema } from './schema'\nimport {\n addRowWithAlignment,\n createTable,\n selectCol,\n selectRow,\n selectTable,\n} from './utils'\n\n/// A command for moving cursor to previous cell.\nexport const goToPrevTableCellCommand = $command(\n 'GoToPrevTableCell',\n () => () => goToNextCell(-1)\n)\n\nwithMeta(goToPrevTableCellCommand, {\n displayName: 'Command<goToPrevTableCellCommand>',\n group: 'Table',\n})\n\n/// A command for moving cursor to next cell.\nexport const goToNextTableCellCommand = $command(\n 'GoToNextTableCell',\n () => () => goToNextCell(1)\n)\n\nwithMeta(goToNextTableCellCommand, {\n displayName: 'Command<goToNextTableCellCommand>',\n group: 'Table',\n})\n\n/// A command for quitting current table and insert a new paragraph node.\nexport const exitTable = $command(\n 'ExitTable',\n (ctx) => () => (state, dispatch) => {\n if (!isInTable(state)) return false\n\n const { $head } = state.selection\n const table = findParentNodeType($head, tableSchema.type(ctx))\n if (!table) return false\n\n const { to } = table\n\n const tr = state.tr.replaceWith(\n to,\n to,\n paragraphSchema.type(ctx).createAndFill()!\n )\n\n tr.setSelection(Selection.near(tr.doc.resolve(to), 1)).scrollIntoView()\n dispatch?.(tr)\n return true\n }\n)\n\nwithMeta(exitTable, {\n displayName: 'Command<breakTableCommand>',\n group: 'Table',\n})\n\n/// A command for inserting a table.\n/// You can specify the number of rows and columns.\n/// By default, it will insert a 3x3 table.\nexport const insertTableCommand = $command(\n 'InsertTable',\n (ctx) =>\n ({ row, col }: { row?: number; col?: number } = {}) =>\n (state, dispatch) => {\n const { selection, tr } = state\n const { from } = selection\n const table = createTable(ctx, row, col)\n const _tr = tr.replaceSelectionWith(table)\n const sel = Selection.findFrom(_tr.doc.resolve(from), 1, true)\n if (sel) _tr.setSelection(sel)\n\n dispatch?.(_tr)\n\n return true\n }\n)\n\nwithMeta(insertTableCommand, {\n displayName: 'Command<insertTableCommand>',\n group: 'Table',\n})\n\n/// A command for moving a row in a table.\n/// You should specify the `from` and `to` index.\nexport const moveRowCommand = $command(\n 'MoveRow',\n () =>\n ({ from, to, pos }: { from?: number; to?: number; pos?: number } = {}) =>\n moveTableRow({\n from: from ?? 0,\n to: to ?? 0,\n pos,\n })\n)\n\nwithMeta(moveRowCommand, {\n displayName: 'Command<moveRowCommand>',\n group: 'Table',\n})\n\n/// A command for moving a column in a table.\n/// You should specify the `from` and `to` index.\nexport const moveColCommand = $command(\n 'MoveCol',\n () =>\n ({ from, to, pos }: { from?: number; to?: number; pos?: number } = {}) =>\n moveTableColumn({\n from: from ?? 0,\n to: to ?? 0,\n pos,\n })\n)\n\nwithMeta(moveColCommand, {\n displayName: 'Command<moveColCommand>',\n group: 'Table',\n})\n\n/// A command for selecting a row.\nexport const selectRowCommand = $command<\n { index: number; pos?: number },\n 'SelectRow'\n>(\n 'SelectRow',\n () =>\n (payload: { index: number; pos?: number } = { index: 0 }) =>\n (state, dispatch) => {\n const { tr } = state\n const result = dispatch?.(selectRow(payload.index, payload.pos)(tr))\n\n return Boolean(result)\n }\n)\n\nwithMeta(selectRowCommand, {\n displayName: 'Command<selectRowCommand>',\n group: 'Table',\n})\n\n/// A command for selecting a column.\nexport const selectColCommand = $command<\n { index: number; pos?: number },\n 'SelectCol'\n>(\n 'SelectCol',\n () =>\n (payload: { index: number; pos?: number } = { index: 0 }) =>\n (state, dispatch) => {\n const { tr } = state\n const result = dispatch?.(selectCol(payload.index, payload.pos)(tr))\n\n return Boolean(result)\n }\n)\n\nwithMeta(selectColCommand, {\n displayName: 'Command<selectColCommand>',\n group: 'Table',\n})\n\n/// A command for selecting a table.\nexport const selectTableCommand = $command(\n 'SelectTable',\n () => () => (state, dispatch) => {\n const { tr } = state\n const result = dispatch?.(selectTable(tr))\n\n return Boolean(result)\n }\n)\n\nwithMeta(selectTableCommand, {\n displayName: 'Command<selectTableCommand>',\n group: 'Table',\n})\n\n/// A command for deleting selected cells.\n/// If the selection is a row or column, the row or column will be deleted.\n/// If all cells are selected, the table will be deleted.\nexport const deleteSelectedCellsCommand = $command(\n 'DeleteSelectedCells',\n () => () => (state, dispatch) => {\n const { selection } = state\n if (!(selection instanceof CellSelection)) return false\n\n const isRow = selection.isRowSelection()\n const isCol = selection.isColSelection()\n\n if (isRow && isCol) return deleteTable(state, dispatch)\n\n if (isCol) return deleteColumn(state, dispatch)\n else return deleteRow(state, dispatch)\n }\n)\n\nwithMeta(deleteSelectedCellsCommand, {\n displayName: 'Command<deleteSelectedCellsCommand>',\n group: 'Table',\n})\n\n/// A command for adding a column before the current column.\nexport const addColBeforeCommand = $command(\n 'AddColBefore',\n () => () => addColumnBefore\n)\n\nwithMeta(addColBeforeCommand, {\n displayName: 'Command<addColBeforeCommand>',\n group: 'Table',\n})\n\n/// A command for adding a column after the current column.\nexport const addColAfterCommand = $command(\n 'AddColAfter',\n () => () => addColumnAfter\n)\n\nwithMeta(addColAfterCommand, {\n displayName: 'Command<addColAfterCommand>',\n group: 'Table',\n})\n\n/// A command for adding a row before the current row.\nexport const addRowBeforeCommand = $command(\n 'AddRowBefore',\n (ctx) => () => (state, dispatch) => {\n if (!isInTable(state)) return false\n if (dispatch) {\n const rect = selectedRect(state)\n dispatch(addRowWithAlignment(ctx, state.tr, rect, rect.top))\n }\n return true\n }\n)\n\nwithMeta(addRowBeforeCommand, {\n displayName: 'Command<addRowBeforeCommand>',\n group: 'Table',\n})\n\n/// A command for adding a row after the current row.\nexport const addRowAfterCommand = $command(\n 'AddRowAfter',\n (ctx) => () => (state, dispatch) => {\n if (!isInTable(state)) return false\n if (dispatch) {\n const rect = selectedRect(state)\n dispatch(addRowWithAlignment(ctx, state.tr, rect, rect.bottom))\n }\n return true\n }\n)\n\nwithMeta(addRowAfterCommand, {\n displayName: 'Command<addRowAfterCommand>',\n group: 'Table',\n})\n\n/// A command for setting alignment property for selected cells.\n/// You can specify the alignment as `left`, `center`, or `right`.\n/// It's `left` by default.\nexport const setAlignCommand = $command<\n 'left' | 'center' | 'right',\n 'SetAlign'\n>(\n 'SetAlign',\n () =>\n (alignment = 'left') =>\n setCellAttr('alignment', alignment)\n)\n\nwithMeta(setAlignCommand, {\n displayName: 'Command<setAlignCommand>',\n group: 'Table',\n})\n","import { commandsCtx } from '@milkdown/core'\nimport { paragraphSchema } from '@milkdown/preset-commonmark'\nimport { InputRule } from '@milkdown/prose/inputrules'\nimport {\n type Fragment as FragmentType,\n Fragment,\n type Node as ProsemirrorNode,\n Slice,\n} from '@milkdown/prose/model'\nimport { TextSelection } from '@milkdown/prose/state'\nimport { $inputRule, $pasteRule, $useKeymap } from '@milkdown/utils'\n\nimport { withMeta } from '../../__internal__'\nimport {\n exitTable,\n goToNextTableCellCommand,\n goToPrevTableCellCommand,\n} from './command'\nimport {\n tableHeaderRowSchema,\n tableHeaderSchema,\n tableRowSchema,\n tableSchema,\n} from './schema'\nimport { createTable } from './utils'\n\n/// A input rule for creating table.\n/// For example, `|2x2|` will create a 2x2 table.\nexport const insertTableInputRule = $inputRule(\n (ctx) =>\n new InputRule(\n /^\\|(?<col>\\d+)[xX](?<row>\\d+)\\|\\s$/,\n (state, match, start, end) => {\n const $start = state.doc.resolve(start)\n if (\n !$start\n .node(-1)\n .canReplaceWith(\n $start.index(-1),\n $start.indexAfter(-1),\n tableSchema.type(ctx)\n )\n )\n return null\n\n const row = Math.max(Number(match.groups?.row ?? 0), 2)\n\n const tableNode = createTable(ctx, row, Number(match.groups?.col))\n const tr = state.tr.replaceRangeWith(start, end, tableNode)\n return tr\n .setSelection(TextSelection.create(tr.doc, start + 3))\n .scrollIntoView()\n }\n )\n)\n\nwithMeta(insertTableInputRule, {\n displayName: 'InputRule<insertTableInputRule>',\n group: 'Table',\n})\n\n/// A paste rule for fixing tables without header cells.\n/// This is a workaround for some editors (e.g. Google Docs) which allow creating tables without header cells,\n/// which is not supported by Markdown schema.\n/// This paste rule will promote the first data row to header, or add empty header cells as a fallback.\nexport const tablePasteRule = $pasteRule((ctx) => ({\n run: (slice, _view, isPlainText) => {\n if (isPlainText) {\n return slice\n }\n\n function fixTable(node: ProsemirrorNode): ProsemirrorNode {\n const rowsCount = node.childCount\n const colsCount = node.lastChild?.childCount ?? 0\n if (rowsCount === 0 || colsCount === 0) {\n return paragraphSchema.type(ctx).create()\n }\n\n const headerRow = node.firstChild\n const needToFixHeaderRow =\n colsCount > 0 && headerRow && headerRow.childCount === 0\n if (!needToFixHeaderRow) {\n return node\n }\n\n // If there are 2+ data rows (3+ total: empty header + 2+ data rows),\n // promote the first data row to header\n if (rowsCount >= 3) {\n const firstDataRow = node.child(1)\n const headerCells: ProsemirrorNode[] = []\n for (let i = 0; i < firstDataRow.childCount; i++) {\n const cell = firstDataRow.child(i)\n headerCells.push(\n tableHeaderSchema\n .type(ctx)\n .create(cell.attrs, cell.content, cell.marks)\n )\n }\n const newHeaderRow = headerRow.type.create(headerRow.attrs, headerCells)\n\n // Collect remaining data rows (skip promoted row at index 1)\n const remainingRows: ProsemirrorNode[] = []\n for (let i = 2; i < rowsCount; i++) {\n remainingRows.push(node.child(i))\n }\n\n return node.type.create(node.attrs, [newHeaderRow, ...remainingRows])\n }\n\n // Fallback: only 1 data row, can't promote (would leave 0 data rows).\n // Fill the empty header with blank cells.\n const headerCells = Array(colsCount)\n .fill(0)\n .map(() => tableHeaderSchema.type(ctx).createAndFill()!)\n\n const tableCells = new Slice(Fragment.from(headerCells), 0, 0)\n\n const newHeaderRow = headerRow.replace(0, 0, tableCells)\n const newTable = node.replace(\n 0,\n headerRow.nodeSize,\n new Slice(Fragment.from(newHeaderRow), 0, 0)\n )\n return newTable\n }\n\n // Wrap consecutive orphaned table_row nodes (at the top level of a fragment)\n // into a proper table. This happens when ProseMirror's parseSlice breaks\n // a table apart (e.g. when pasting multiple tables from Google Docs).\n function wrapOrphanedRows(fragment: FragmentType): FragmentType {\n const rowType = tableRowSchema.type(ctx)\n const nodes: ProsemirrorNode[] = []\n let pendingRows: ProsemirrorNode[] = []\n let hasOrphans = false\n\n function flushPendingRows() {\n if (pendingRows.length === 0) return\n\n // Create an empty table_header_row, then fixTable will promote the first data row\n const emptyHeaderRow = tableHeaderRowSchema.type(ctx).createAndFill()!\n const table = tableSchema\n .type(ctx)\n .create(null, [emptyHeaderRow, ...pendingRows])\n nodes.push(fixTable(table))\n pendingRows = []\n }\n\n fragment.forEach((node) => {\n if (node.type === rowType) {\n hasOrphans = true\n pendingRows.push(node)\n } else {\n flushPendingRows()\n nodes.push(node)\n }\n })\n flushPendingRows()\n\n return hasOrphans ? Fragment.from(nodes) : fragment\n }\n\n function fixFragment(fragment: FragmentType): FragmentType {\n // First, wrap any orphaned table_row nodes into tables\n let result = wrapOrphanedRows(fragment)\n\n // Then fix existing tables and recurse into children\n let changed = result !== fragment\n const fixed: ProsemirrorNode[] = []\n result.forEach((node) => {\n if (node.type === tableSchema.type(ctx)) {\n const fixedNode = fixTable(node)\n if (fixedNode !== node) changed = true\n fixed.push(fixedNode)\n } else if (node.childCount > 0) {\n const fixedContent = fixFragment(node.content)\n if (fixedContent !== node.content) {\n changed = true\n fixed.push(node.copy(fixedContent))\n } else {\n fixed.push(node)\n }\n } else {\n fixed.push(node)\n }\n })\n return changed ? Fragment.from(fixed) : fragment\n }\n\n // Remove empty paragraphs that directly precede a table\n // (artifacts of broken table parsing from Google Docs)\n function cleanEmptyParagraphs(fragment: FragmentType): FragmentType {\n const nodes: ProsemirrorNode[] = []\n const allNodes: ProsemirrorNode[] = []\n fragment.forEach((node) => allNodes.push(node))\n\n for (let i = 0; i < allNodes.length; i++) {\n const node = allNodes[i]!\n const next = allNodes[i + 1]\n if (\n node.type === paragraphSchema.type(ctx) &&\n node.content.size === 0 &&\n next &&\n next.type === tableSchema.type(ctx)\n ) {\n continue // skip empty paragraph before table\n }\n nodes.push(node)\n }\n\n return nodes.length < allNodes.length ? Fragment.from(nodes) : fragment\n }\n\n let fragment = fixFragment(slice.content)\n fragment = cleanEmptyParagraphs(fragment)\n return new Slice(Fragment.from(fragment), slice.openStart, slice.openEnd)\n },\n}))\n\nwithMeta(tablePasteRule, {\n displayName: 'PasteRule<table>',\n group: 'Table',\n})\n\n/// Keymap for table commands.\n/// - `<Mod-]>`/`<Tab>`: Move to the next cell.\n/// - `<Mod-[>`/`<Shift-Tab>`: Move to the previous cell.\n/// - `<Mod-Enter>`: Exit the table, and break it if possible.\nexport const tableKeymap = $useKeymap('tableKeymap', {\n NextCell: {\n priority: 100,\n shortcuts: ['Mod-]', 'Tab'],\n command: (ctx) => {\n const commands = ctx.get(commandsCtx)\n\n return () => commands.call(goToNextTableCellCommand.key)\n },\n },\n PrevCell: {\n shortcuts: ['Mod-[', 'Shift-Tab'],\n command: (ctx) => {\n const commands = ctx.get(commandsCtx)\n\n return () => commands.call(goToPrevTableCellCommand.key)\n },\n },\n ExitTable: {\n shortcuts: ['Mod-Enter', 'Enter'],\n command: (ctx) => {\n const commands = ctx.get(commandsCtx)\n\n return () => commands.call(exitTable.key)\n },\n },\n})\n\nwithMeta(tableKeymap.ctx, {\n displayName: 'KeymapCtx<table>',\n group: 'Table',\n})\n\nwithMeta(tableKeymap.shortcuts, {\n displayName: 'Keymap<table>',\n group: 'Table',\n})\n","import { expectDomTypeError } from '@milkdown/exception'\nimport { $nodeSchema } from '@milkdown/utils'\n\nimport { withMeta } from '../../__internal__'\n\nconst id = 'footnote_definition'\nconst markdownId = 'footnoteDefinition'\n\n/// Footnote definition node schema.\nexport const footnoteDefinitionSchema = $nodeSchema(\n 'footnote_definition',\n () => ({\n group: 'block',\n content: 'block+',\n defining: true,\n attrs: {\n label: {\n default: '',\n validate: 'string',\n },\n },\n parseDOM: [\n {\n tag: `dl[data-type=\"${id}\"]`,\n getAttrs: (dom) => {\n if (!(dom instanceof HTMLElement)) throw expectDomTypeError(dom)\n\n return {\n label: dom.dataset.label,\n }\n },\n contentElement: 'dd',\n },\n ],\n toDOM: (node) => {\n const label = node.attrs.label\n\n return [\n 'dl',\n {\n // TODO: add a prosemirror plugin to sync label on change\n 'data-label': label,\n 'data-type': id,\n },\n ['dt', label],\n ['dd', 0],\n ]\n },\n parseMarkdown: {\n match: ({ type }) => type === markdownId,\n runner: (state, node, type) => {\n state\n .openNode(type, {\n label: node.label as string,\n })\n .next(node.children)\n .closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === id,\n runner: (state, node) => {\n state\n .openNode(markdownId, undefined, {\n label: node.attrs.label,\n identifier: node.attrs.label,\n })\n .next(node.content)\n .closeNode()\n },\n },\n })\n)\n\nwithMeta(footnoteDefinitionSchema.ctx, {\n displayName: 'NodeSchemaCtx<footnodeDef>',\n group: 'footnote',\n})\n\nwithMeta(footnoteDefinitionSchema.node, {\n displayName: 'NodeSchema<footnodeDef>',\n group: 'footnote',\n})\n","import { expectDomTypeError } from '@milkdown/exception'\nimport { $nodeSchema } from '@milkdown/utils'\n\nimport { withMeta } from '../../__internal__'\n\nconst id = 'footnote_reference'\n\n/// Footnote reference node schema.\nexport const footnoteReferenceSchema = $nodeSchema(\n 'footnote_reference',\n () => ({\n group: 'inline',\n inline: true,\n atom: true,\n attrs: {\n label: {\n default: '',\n validate: 'string',\n },\n },\n parseDOM: [\n {\n tag: `sup[data-type=\"${id}\"]`,\n getAttrs: (dom) => {\n if (!(dom instanceof HTMLElement)) throw expectDomTypeError(dom)\n\n return {\n label: dom.dataset.label,\n }\n },\n },\n ],\n toDOM: (node) => {\n const label = node.attrs.label\n return [\n 'sup',\n {\n // TODO: add a prosemirror plugin to sync label on change\n 'data-label': label,\n 'data-type': id,\n },\n label,\n ]\n },\n parseMarkdown: {\n match: ({ type }) => type === 'footnoteReference',\n runner: (state, node, type) => {\n state.addNode(type, {\n label: node.label as string,\n })\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === id,\n runner: (state, node) => {\n state.addNode('footnoteReference', undefined, undefined, {\n label: node.attrs.label,\n identifier: node.attrs.label,\n })\n },\n },\n })\n)\n\nwithMeta(footnoteReferenceSchema.ctx, {\n displayName: 'NodeSchemaCtx<footnodeRef>',\n group: 'footnote',\n})\n\nwithMeta(footnoteReferenceSchema.node, {\n displayName: 'NodeSchema<footnodeRef>',\n group: 'footnote',\n})\n","import { expectDomTypeError } from '@milkdown/exception'\nimport { listItemSchema } from '@milkdown/preset-commonmark'\nimport { InputRule } from '@milkdown/prose/inputrules'\nimport { $inputRule } from '@milkdown/utils'\n\nimport { withMeta } from '../__internal__'\n\n/// This schema extends the [list item](/preset-commonmark#list-item) schema and add task list support for it.\nexport const extendListItemSchemaForTask = listItemSchema.extendSchema(\n (prev) => {\n return (ctx) => {\n const baseSchema = prev(ctx)\n return {\n ...baseSchema,\n attrs: {\n ...baseSchema.attrs,\n checked: {\n default: null,\n validate: 'boolean|null',\n },\n },\n parseDOM: [\n {\n tag: 'li[data-item-type=\"task\"]',\n getAttrs: (dom) => {\n if (!(dom instanceof HTMLElement)) throw expectDomTypeError(dom)\n\n return {\n label: dom.dataset.label,\n listType: dom.dataset.listType,\n spread: dom.dataset.spread === 'true',\n checked: dom.dataset.checked\n ? dom.dataset.checked === 'true'\n : null,\n }\n },\n },\n ...(baseSchema?.parseDOM || []),\n ],\n toDOM: (node) => {\n if (baseSchema.toDOM && node.attrs.checked == null)\n return baseSchema.toDOM(node)\n\n return [\n 'li',\n {\n 'data-item-type': 'task',\n 'data-label': node.attrs.label,\n 'data-list-type': node.attrs.listType,\n 'data-spread': node.attrs.spread,\n 'data-checked': node.attrs.checked,\n },\n 0,\n ]\n },\n parseMarkdown: {\n match: ({ type }) => type === 'listItem',\n runner: (state, node, type) => {\n if (node.checked == null) {\n baseSchema.parseMarkdown.runner(state, node, type)\n return\n }\n\n const label = node.label != null ? `${node.label}.` : '•'\n const checked = node.checked != null ? Boolean(node.checked) : null\n const listType = node.label != null ? 'ordered' : 'bullet'\n const spread = node.spread ?? true\n\n state.openNode(type, { label, listType, spread, checked })\n state.next(node.children)\n state.closeNode()\n },\n },\n toMarkdown: {\n match: (node) => node.type.name === 'list_item',\n runner: (state, node) => {\n if (node.attrs.checked == null) {\n baseSchema.toMarkdown.runner(state, node)\n return\n }\n\n const label = node.attrs.label\n const listType = node.attrs.listType\n const spread = node.attrs.spread\n const checked = node.attrs.checked\n\n state.openNode('listItem', undefined, {\n label,\n listType,\n spread,\n checked,\n })\n state.next(node.content)\n state.closeNode()\n },\n },\n }\n }\n }\n)\n\nwithMeta(extendListItemSchemaForTask.node, {\n displayName: 'NodeSchema<taskListItem>',\n group: 'ListItem',\n})\n\nwithMeta(extendListItemSchemaForTask.ctx, {\n displayName: 'NodeSchemaCtx<taskListItem>',\n group: 'ListItem',\n})\n\n/// Input rule for wrapping a block in task list node.\n/// Users can type `[ ] ` or `[x] ` to wrap the block in task list node with checked status.\nexport const wrapInTaskListInputRule = $inputRule(() => {\n return new InputRule(\n /^\\[(?<checked>\\s|x)\\]\\s$/,\n (state, match, start, end) => {\n const pos = state.doc.resolve(start)\n let depth = 0\n let node = pos.node(depth)\n while (node && node.type.name !== 'list_item') {\n depth--\n node = pos.node(depth)\n }\n\n if (!node || node.attrs.checked != null) return null\n\n const checked = Boolean(match.groups?.checked === 'x')\n\n const finPos = pos.before(depth)\n const tr = state.tr\n\n tr.deleteRange(start, end).setNodeMarkup(finPos, undefined, {\n ...node.attrs,\n checked,\n })\n\n return tr\n }\n )\n})\n\nwithMeta(wrapInTaskListInputRule, {\n displayName: 'InputRule<wrapInTaskListInputRule>',\n group: 'ListItem',\n})\n","import type { MilkdownPlugin } from '@milkdown/ctx'\n\nimport { strikethroughKeymap } from '../mark'\nimport { tableKeymap } from '../node'\n\n/// @internal\nexport const keymap: MilkdownPlugin[] = [\n strikethroughKeymap,\n tableKeymap,\n].flat()\n","import type { MilkdownPlugin } from '@milkdown/ctx'\n\nimport { strikethroughInputRule } from '../mark'\nimport { insertTableInputRule, wrapInTaskListInputRule } from '../node'\n\n/// @internal\nexport const inputRules: MilkdownPlugin[] = [\n insertTableInputRule,\n wrapInTaskListInputRule,\n]\n\nexport const markInputRules: MilkdownPlugin[] = [strikethroughInputRule]\n","import type { MilkdownPlugin } from '@milkdown/ctx'\n\nimport { tablePasteRule } from '../node'\n\n/// @internal\nexport const pasteRules: MilkdownPlugin[] = [tablePasteRule]\n","import { $prose } from '@milkdown/utils'\nimport { imeSpan } from 'prosemirror-safari-ime-span'\n\nimport { withMeta } from '../__internal__'\n\n/// This plugin is used to fix the bug of IME composing in table in Safari browser.\n/// original discussion in https://discuss.prosemirror.net/t/ime-composing-problems-on-td-or-th-element-in-safari-browser/4501\nexport const autoInsertSpanPlugin = $prose(() => imeSpan)\n\nwithMeta(autoInsertSpanPlugin, {\n displayName: 'Prose<autoInsertSpanPlugin>',\n group: 'Prose',\n})\n","import { columnResizing } from '@milkdown/prose/tables'\nimport { $prose } from '@milkdown/utils'\n\nimport { withMeta } from '../__internal__'\n\n/// This plugin is wrapping the `columnResizing` plugin from [prosemirror-tables](https://github.com/ProseMirror/prosemirror-tables).\nexport const columnResizingPlugin = $prose(() => columnResizing({}))\n\nwithMeta(columnResizingPlugin, {\n displayName: 'Prose<columnResizingPlugin>',\n group: 'Prose',\n})\n","import { tableEditing } from '@milkdown/prose/tables'\nimport { $prose } from '@milkdown/utils'\n\nimport { withMeta } from '../__internal__'\n\n/// This plugin is wrapping the `tableEditing` plugin from [prosemirror-tables](https://github.com/ProseMirror/prosemirror-tables).\nexport const tableEditingPlugin = $prose(() =>\n tableEditing({ allowTableNodeSelection: true })\n)\n\nwithMeta(tableEditingPlugin, {\n displayName: 'Prose<tableEditingPlugin>',\n group: 'Prose',\n})\n","import type { $Remark } from '@milkdown/utils'\nimport type { Options } from 'remark-gfm'\n\nimport { $remark } from '@milkdown/utils'\nimport remarkGFM from 'remark-gfm'\n\nimport { withMeta } from '../__internal__'\n\n/// This plugin is wrapping the [remark-gfm](https://github.com/remarkjs/remark-gfm).\nexport const remarkGFMPlugin: $Remark<'remarkGFM', Options | null | undefined> =\n $remark('remarkGFM', () => remarkGFM)\n\nwithMeta(remarkGFMPlugin.plugin, {\n displayName: 'Remark<remarkGFMPlugin>',\n group: 'Remark',\n})\n\nwithMeta(remarkGFMPlugin.options, {\n displayName: 'RemarkConfig<remarkGFMPlugin>',\n group: 'Remark',\n})\n","import type { Node } from '@milkdown/prose/model'\nimport type { Transaction } from '@milkdown/prose/state'\n\nimport { Plugin, PluginKey } from '@milkdown/prose/state'\nimport { $prose } from '@milkdown/utils'\n\nimport { withMeta } from '../__internal__'\n\nconst pluginKey = new PluginKey('MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN')\n\nfunction getChildIndex(node: Node, parent: Node) {\n let index = 0\n parent.forEach((child, _offset, i) => {\n if (child === node) index = i\n })\n return index\n}\n\n// The span that differs between the two docs, in `next` coordinates, or `null`\n// when they are value-identical. Both scans compare children by reference\n// before looking inside them.\nfunction changedRange(prev: Node, next: Node) {\n const from = prev.content.findDiffStart(next.content)\n if (from == null) return null\n\n const diff = prev.content.findDiffEnd(next.content)\n if (!diff) return null\n\n // Repeated content (\"aa\" -> \"aaa\") lets the end scan overrun the start.\n return { from, to: Math.max(diff.b, from) }\n}\n\nexport const keepTableAlignPlugin = $prose(() => {\n return new Plugin({\n key: pluginKey,\n appendTransaction: (_tr, oldState, state) => {\n if (oldState.doc === state.doc) return\n\n const range = changedRange(oldState.doc, state.doc)\n if (!range) return\n\n let tr: Transaction | undefined\n const check = (node: Node, pos: number) => {\n if (node.type.name !== 'table_cell') return\n\n const $pos = state.doc.resolve(pos)\n const tableRow = $pos.node($pos.depth)\n const table = $pos.node($pos.depth - 1)\n const tableHeaderRow = table.firstChild\n // TODO: maybe consider add a header row\n if (!tableHeaderRow) return\n\n const index = getChildIndex(node, tableRow)\n const headerCell = tableHeaderRow.maybeChild(index)\n if (!headerCell) return\n const align = headerCell.attrs.alignment\n const currentAlign = node.attrs.alignment\n if (align === currentAlign) return\n\n // Creating `tr` any earlier appends an empty transaction to every\n // document change.\n if (!tr) tr = state.tr\n tr.setNodeMarkup(pos, undefined, { ...node.attrs, alignment: align })\n }\n\n // `nodesBetween` reports the range's ancestors, so an edit deep inside a\n // cell still reaches its table. Each table it finds is checked in full,\n // because a header cell reaches body cells outside the range.\n state.doc.nodesBetween(range.from, range.to, (node, pos) => {\n if (node.type.name !== 'table') return true\n\n state.doc.nodesBetween(pos, pos + node.nodeSize, check)\n // Tables do not nest.\n return false\n })\n\n return tr\n },\n })\n})\n\nwithMeta(keepTableAlignPlugin, {\n displayName: 'Prose<keepTableAlignPlugin>',\n group: 'Prose',\n})\n","import type { MilkdownPlugin } from '@milkdown/ctx'\n\nimport {\n autoInsertSpanPlugin,\n keepTableAlignPlugin,\n remarkGFMPlugin,\n tableEditingPlugin,\n} from '../plugin'\n\n/// @internal\nexport const plugins: MilkdownPlugin[] = [\n keepTableAlignPlugin,\n autoInsertSpanPlugin,\n remarkGFMPlugin,\n tableEditingPlugin,\n].flat()\n","import type { MilkdownPlugin } from '@milkdown/ctx'\n\nimport { strikethroughAttr, strikethroughSchema } from '../mark'\nimport {\n extendListItemSchemaForTask,\n footnoteDefinitionSchema,\n footnoteReferenceSchema,\n tableCellSchema,\n tableHeaderRowSchema,\n tableHeaderSchema,\n tableRowSchema,\n tableSchema,\n} from '../node'\n\n/// @internal\nexport const schema: MilkdownPlugin[] = [\n extendListItemSchemaForTask,\n\n tableSchema,\n tableHeaderRowSchema,\n tableRowSchema,\n tableHeaderSchema,\n tableCellSchema,\n\n footnoteDefinitionSchema,\n footnoteReferenceSchema,\n\n strikethroughAttr,\n strikethroughSchema,\n].flat()\n","import { toggleStrikethroughCommand } from '../mark'\nimport {\n addColAfterCommand,\n addColBeforeCommand,\n addRowAfterCommand,\n addRowBeforeCommand,\n deleteSelectedCellsCommand,\n exitTable,\n goToNextTableCellCommand,\n goToPrevTableCellCommand,\n insertTableCommand,\n moveColCommand,\n moveRowCommand,\n selectColCommand,\n selectRowCommand,\n selectTableCommand,\n setAlignCommand,\n} from '../node'\n\n/// @internal\nexport const commands = [\n goToNextTableCellCommand,\n goToPrevTableCellCommand,\n exitTable,\n insertTableCommand,\n moveRowCommand,\n moveColCommand,\n selectRowCommand,\n selectColCommand,\n selectTableCommand,\n deleteSelectedCellsCommand,\n addRowBeforeCommand,\n addRowAfterCommand,\n addColBeforeCommand,\n addColAfterCommand,\n setAlignCommand,\n\n toggleStrikethroughCommand,\n]\n","import {\n commands,\n inputRules,\n keymap,\n markInputRules,\n pasteRules,\n plugins,\n schema,\n} from './composed'\n\nexport * from './node'\nexport * from './mark'\nexport * from './plugin'\nexport * from './composed'\n\n/// The GFM preset, includes all the plugins.\nexport const gfm = [\n schema,\n inputRules,\n pasteRules,\n markInputRules,\n keymap,\n commands,\n plugins,\n].flat()\n"],"mappings":";;;;;;;;;;;;;AAEA,SAAgB,SACd,QACA,MACG;CACH,OAAO,OAAO,QAAQ,EACpB,MAAM;EACJ,SAAS;EACT,GAAG;CACL,EACF,CAAC;CAED,OAAO;AACT;;;ACAA,IAAa,oBAAoB,UAAU,gBAAgB;AAE3D,SAAS,mBAAmB;CAC1B,aAAa;CACb,OAAO;AACT,CAAC;AAGD,IAAa,sBAAsB,YAAY,mBAAmB,SAAS;CACzE,UAAU,CACR,EAAE,KAAK,MAAM,GACb;EACE,OAAO;EACP,WAAW,UAAW,UAAU;CAClC,CACF;CACA,QAAQ,SAAS,CAAC,OAAO,IAAI,IAAI,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;CAC7D,eAAe;EACb,QAAQ,SAAS,KAAK,SAAS;EAC/B,SAAS,OAAO,MAAM,aAAa;GACjC,MAAM,SAAS,QAAQ;GACvB,MAAM,KAAK,KAAK,QAAQ;GACxB,MAAM,UAAU,QAAQ;EAC1B;CACF;CACA,YAAY;EACV,QAAQ,SAAS,KAAK,KAAK,SAAS;EACpC,SAAS,OAAO,SAAS;GACvB,MAAM,SAAS,MAAM,QAAQ;EAC/B;CACF;AACF,EAAE;AAEF,SAAS,oBAAoB,MAAM;CACjC,aAAa;CACb,OAAO;AACT,CAAC;AAED,SAAS,oBAAoB,KAAK;CAChC,aAAa;CACb,OAAO;AACT,CAAC;AAGD,IAAa,6BAA6B,SACxC,wBACC,cAAc;CACb,OAAO,WAAW,oBAAoB,KAAK,GAAG,CAAC;AACjD,CACF;AAEA,SAAS,4BAA4B;CACnC,aAAa;CACb,OAA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;IAI5B,IAAI,CAAC,IAAI,KAAK,MAAM;IACpB,GAAG,cAAc,KAAK,KAAA,GAAW;KAAE,GAAG,KAAK;KAAO,WAAW;IAAM,CAAC;GACtE;GAKA,MAAM,IAAI,aAAa,MAAM,MAAM,MAAM,KAAK,MAAM,QAAQ;IAC1D,IAAI,KAAK,KAAK,SAAS,SAAS,OAAO;IAEvC,MAAM,IAAI,aAAa,KAAK,MAAM,KAAK,UAAU,KAAK;IAEtD,OAAO;GACT,CAAC;GAED,OAAO;EACT;CACF,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB;CAC7B,aAAa;CACb,OAAO;AACT,CAAC;;;AC1ED,IAAa,UAA4B;CACvC;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK;;;ACAP,IAAa,SAA2B;CACtC;CAEA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;CACA;AACF,CAAC,CAAC,KAAK;;;ACTP,IAAa,WAAW;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;AACF;;;ACtBA,IAAa,MAAM;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK"}
|
|
@@ -29,5 +29,5 @@ export declare const addColBeforeCommand: import("@milkdown/utils").$Command<unk
|
|
|
29
29
|
export declare const addColAfterCommand: import("@milkdown/utils").$Command<unknown>;
|
|
30
30
|
export declare const addRowBeforeCommand: import("@milkdown/utils").$Command<unknown>;
|
|
31
31
|
export declare const addRowAfterCommand: import("@milkdown/utils").$Command<unknown>;
|
|
32
|
-
export declare const setAlignCommand: import("@milkdown/utils").$Command<"
|
|
32
|
+
export declare const setAlignCommand: import("@milkdown/utils").$Command<"center" | "left" | "right">;
|
|
33
33
|
//# sourceMappingURL=command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-line.d.ts","sourceRoot":"","sources":["../../../../src/node/table/utils/select-line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAMnE,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"select-line.d.ts","sourceRoot":"","sources":["../../../../src/node/table/utils/select-line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAMnE,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,WAC7B,MAAM,QAAQ,MAAM,UAAU,WAAW,iBA+CzD;AAID,eAAO,MAAM,SAAS,UAnDL,MAAM,QAAQ,MAAM,UAAU,WAAW,gBAmDhB,CAAA;AAI1C,eAAO,MAAM,SAAS,UAvDL,MAAM,QAAQ,MAAM,UAAU,WAAW,gBAuDhB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keep-table-align-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/keep-table-align-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keep-table-align-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/keep-table-align-plugin.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,oBAAoB,kCA+C/B,CAAA"}
|