Skip to content

Commit

Permalink
prosemirror-tables upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
YousefED committed Oct 25, 2024
1 parent 195e6c8 commit 8352718
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"hast-util-from-dom": "^4.2.0",
"prosemirror-model": "^1.21.0",
"prosemirror-state": "^1.4.3",
"prosemirror-tables": "^1.3.7",
"prosemirror-tables": "^1.6.0",
"prosemirror-transform": "^1.9.0",
"prosemirror-view": "^1.33.7",
"rehype-format": "^5.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { mergeCSSClasses } from "../../util/browser.js";
import { createDefaultBlockDOMOutputSpec } from "../defaultBlockHelpers.js";
import { defaultProps } from "../defaultProps.js";
import { MIN_CELL_WIDTH, TableExtension } from "./TableExtension.js";
import { EMPTY_CELL_WIDTH, TableExtension } from "./TableExtension.js";

export const tablePropSchema = {
backgroundColor: defaultProps.backgroundColor,
Expand Down Expand Up @@ -99,7 +99,7 @@ export const TableBlockContent = createStronglyTypedTiptapNode({
}
}

return new BlockNoteTableView(node, MIN_CELL_WIDTH, {
return new BlockNoteTableView(node, EMPTY_CELL_WIDTH, {
...(this.options.domAttributes?.blockContent || {}),
...HTMLAttributes,
});
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/blocks/TableBlockContent/TableExtension.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { callOrReturn, Extension, getExtensionField } from "@tiptap/core";
import { columnResizing, tableEditing } from "prosemirror-tables";

export const MIN_CELL_WIDTH = 35;
export const RESIZE_MIN_WIDTH = 35;
export const EMPTY_CELL_WIDTH = 120;
export const EMPTY_CELL_HEIGHT = 31;

Expand All @@ -11,7 +11,8 @@ export const TableExtension = Extension.create({
addProseMirrorPlugins: () => {
return [
columnResizing({
cellMinWidth: MIN_CELL_WIDTH,
cellMinWidth: RESIZE_MIN_WIDTH,
defaultCellMinWidth: EMPTY_CELL_WIDTH,
// We set this to null as we implement our own node view in the table
// block content. This node view is the same as what's used by default,
// but is wrapped in a `blockContent` HTML element.
Expand Down

0 comments on commit 8352718

Please sign in to comment.