Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure correct type exports #2

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,12 @@
"test": "bun test",
"prepare": "husky"
},
"files": [
"dist"
],
"files": ["dist"],
"repository": "ronin-co/react-ronin",
"homepage": "https://github.com/ronin-co/react-ronin",
"keywords": [
"ronin",
"react",
"client",
"database",
"orm"
],
"keywords": ["ronin", "react", "client", "database", "orm"],
"lint-staged": {
"**/*": [
"bunx @biomejs/biome format --write"
]
"**/*": ["bunx @biomejs/biome format --write"]
},
"exports": {
".": {
Expand All @@ -44,6 +34,12 @@
"require": "./dist/components.js"
}
},
"typesVersions": {
"*": {
"*": ["dist/index.d.ts"],
"components": ["dist/components.d.mts"]
deebov marked this conversation as resolved.
Show resolved Hide resolved
}
},
"dependencies": {
"ronin": "3.0.5"
},
Expand Down
8 changes: 4 additions & 4 deletions src/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { FunctionComponent, ReactHTML, ReactNode } from "react";

type ValueOf<T> = T[keyof T];

export type Content =
export type RichTextContent =
| {
type:
| "doc"
Expand All @@ -13,7 +13,7 @@ export type Content =
| "listItem";
// If the node is empty in the editor, it won't have `content` set. For
// example, you might add a new empty paragraph inside the editor.
content?: Content[];
content?: RichTextContent[];
attrs: {
language: string | null;
};
Expand All @@ -33,7 +33,7 @@ export type Content =
| {
type: "heading";
// If the node is empty in the editor, it won't have `content` set.
content?: Content[];
content?: RichTextContent[];
attrs: {
level: 1 | 2 | 3 | 4;
};
Expand Down Expand Up @@ -61,7 +61,7 @@ export const RichText = ({
data,
components,
}: {
data: Content | Content[];
data: RichTextContent | RichTextContent[];
components?: ReactHTML;
}) => {
const items = Array.isArray(data) ? data : [data];
Expand Down
Loading