Skip to content

Commit

Permalink
add colwidth
Browse files Browse the repository at this point in the history
  • Loading branch information
julianbenegas committed Dec 19, 2024
1 parent fc2488d commit fc506ba
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/basehub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# basehub

## 7.5.32

### Patch Changes

- Add colwidth props to td and th

## 7.5.31

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/basehub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "basehub",
"description": "A very fast Headless CMS.",
"author": "JB <[email protected]>",
"version": "7.5.31",
"version": "7.5.32",
"license": "MIT",
"repository": "basehub-ai/basehub",
"bugs": "https://github.com/basehub-ai/basehub/issues",
Expand Down
6 changes: 5 additions & 1 deletion packages/basehub/src/react/rich-text/primitive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export type Node =
}
| {
type: "tableCell" | "tableHeader" | "tableFooter";
attrs: { colspan: number; rowspan: number };
attrs: { colspan: number; rowspan: number; colwidth?: null | number[] };
marks?: Array<Mark>;
content?: Array<Node>;
}
Expand Down Expand Up @@ -169,11 +169,13 @@ type Handlers = {
children: ReactNode;
colspan: number;
rowspan: number;
colwidth?: number[];
}) => ReactNode;
th: (props: {
children: ReactNode;
colspan: number;
rowspan: number;
colwidth?: number[];
}) => ReactNode;
thead: (props: { children: ReactNode }) => ReactNode;
tbody: (props: { children: ReactNode }) => ReactNode;
Expand Down Expand Up @@ -499,6 +501,7 @@ const Node = ({
children,
colspan: node.attrs.colspan,
rowspan: node.attrs.rowspan,
colwidth: node.attrs.colwidth ?? undefined,
} satisfies ExtractPropsForHandler<Handlers["td"]>;
break;
case "tableHeader":
Expand All @@ -509,6 +512,7 @@ const Node = ({
children,
colspan: node.attrs.colspan,
rowspan: node.attrs.rowspan,
colwidth: node.attrs.colwidth ?? undefined,
} satisfies ExtractPropsForHandler<Handlers["th"]>;
break;
case "tableFooter":
Expand Down
7 changes: 7 additions & 0 deletions playground/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# playground

## 0.0.174

### Patch Changes

- Updated dependencies
- [email protected]

## 0.0.173

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "playground",
"private": true,
"version": "0.0.173",
"version": "0.0.174",
"scripts": {
"dev": "basehub dev & next dev --port 3003",
"build": "basehub && next build",
Expand Down

0 comments on commit fc506ba

Please sign in to comment.