Skip to content

Commit

Permalink
Update all dev dependencies (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue authored Jun 14, 2023
1 parent ccf40dd commit c1fc8cb
Show file tree
Hide file tree
Showing 6 changed files with 748 additions and 529 deletions.
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@
"prosemirror-view": "^1.13.3"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"builddocs": "^1.0.3",
"eslint": "^8.16.0",
"eslint-plugin-jest": "^26.2.2",
"ist": "^1.1.1",
"prettier": "^2.6.2",
"prosemirror-commands": "^1.5.0",
"prosemirror-example-setup": "^1.2.1",
"prosemirror-menu": "^1.2.1",
"prosemirror-schema-basic": "^1.2.0",
"prosemirror-test-builder": "^1.1.0",
"tsup": "^6.5.0",
"typescript": "^4.0.0",
"vite": "^3.2.4",
"vitest": "^0.25.3"
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"builddocs": "^1.0.7",
"eslint": "^8.42.0",
"eslint-plugin-jest": "^26.9.0",
"ist": "^1.1.7",
"prettier": "^2.8.8",
"prosemirror-commands": "^1.5.2",
"prosemirror-example-setup": "^1.2.2",
"prosemirror-menu": "^1.2.2",
"prosemirror-schema-basic": "^1.2.2",
"prosemirror-test-builder": "^1.1.1",
"tsup": "^6.7.0",
"typescript": "^4.9.5",
"vite": "^4.3.9",
"vitest": "^0.32.0"
},
"scripts": {
"dev": "vite demo",
Expand Down
7 changes: 5 additions & 2 deletions src/columnresizing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,16 @@ function edgeCell(
view: EditorView,
event: MouseEvent,
side: 'left' | 'right',
handleWidth: number
handleWidth: number,
): number {
// posAtCoords returns inconsistent positions when cursor is moving
// across a collapsed table border. Use an offset to adjust the
// target viewport coordinates away from the table border.
const offset = side == 'right' ? -handleWidth : handleWidth;
const found = view.posAtCoords({ left: event.clientX + offset, top: event.clientY });
const found = view.posAtCoords({
left: event.clientX + offset,
top: event.clientY,
});
if (!found) return -1;
const { pos } = found;
const $cell = cellAround(view.state.doc.resolve(pos));
Expand Down
12 changes: 3 additions & 9 deletions test/build.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Attrs, Node, ResolvedPos, Schema } from 'prosemirror-model';
import { Node, ResolvedPos, Schema } from 'prosemirror-model';
import { schema as baseSchema } from 'prosemirror-schema-basic';
import { NodeSelection, TextSelection } from 'prosemirror-state';
import { builders, eq } from 'prosemirror-test-builder';
import { cellAround, CellSelection, tableNodes } from '../src/';
import { CellSelection, cellAround, tableNodes } from '../src/';

export type TaggedNode = Node & { tag: Record<string, number> };

Expand All @@ -27,18 +27,12 @@ function resolveCell(
return cellAround(doc.resolve(tag));
}

type TaggedNodeBuilder = (
attrsOrFirstChild?: Attrs | Node | string,
...children: (Node | string)[]
) => TaggedNode;

// @ts-expect-error: the return type of builders is not correct
const nodeBuilders = builders(schema, {
p: { nodeType: 'paragraph' },
tr: { nodeType: 'table_row' },
td: { nodeType: 'table_cell' },
th: { nodeType: 'table_header' },
}) as Record<string, TaggedNodeBuilder>;
});

export const { doc, table, tr, p, td, th } = nodeBuilders;

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"allowSyntheticDefaultImports": true,
"declarationDir": ".",
"noEmitOnError": false,
"moduleResolution": "node"
Expand Down
2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'tsup';

export default defineConfig({
target: 'ES2018',
target: 'es2018',
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
Expand Down
Loading

0 comments on commit c1fc8cb

Please sign in to comment.