Skip to content

Commit cffffbb

Browse files
committed
release 0.1.17
1 parent dc796ce commit cffffbb

File tree

8 files changed

+34
-31
lines changed

8 files changed

+34
-31
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ export default function App() {
5252
}
5353
```
5454

55-
The `Edtior` is a React component that takes in the following props:
55+
The `Editor` is a React component that takes in the following props:
5656

5757
| Prop | Type | Description | Default |
5858
| ------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
5959
| `completionApi` | `string` | The API route to use for the OpenAI completion API. | `/api/generate` |
60-
| `className` | `string` | Additional classes to add to the editor container. | `"relative min-h-[500px] w-full max-w-screen-lg border-stone-200 bg-white p-12 px-8 sm:mb-[calc(20vh)] sm:rounded-lg sm:border sm:px-12 sm:shadow-lg"` |
60+
| `className` | `string` | Editor container classname. | `"relative min-h-[500px] w-full max-w-screen-lg border-stone-200 bg-white p-12 px-8 sm:mb-[calc(20vh)] sm:rounded-lg sm:border sm:px-12 sm:shadow-lg"` |
6161
| `defaultValue` | `JSONContent` or `string` | The default value to use for the editor. | [`defaultEditorContent`](https://github.com/steven-tey/novel/blob/main/packages/core/src/ui/editor/default-content.tsx) |
6262
| `extensions` | `Extension[]` | A list of extensions to use for the editor, in addition to the [default Novel extensions](https://github.com/steven-tey/novel/blob/main/packages/core/src/ui/editor/extensions/index.tsx). | `[]` |
6363
| `editorProps` | `EditorProps` | Props to pass to the underlying Tiptap editor, in addition to the [default Novel editor props](https://github.com/steven-tey/novel/blob/main/packages/core/src/ui/editor/props.ts). | `{}` |

apps/web/app/providers.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import { Dispatch, ReactNode, SetStateAction, createContext } from "react";
44
import { ThemeProvider, useTheme } from "next-themes";
55
import { Toaster } from "sonner";
66
import { Analytics } from "@vercel/analytics/react";
7-
import { displayFontMapper, defaultFontMapper } from "@/styles/fonts";
87
import useLocalStorage from "@/lib/hooks/use-local-storage";
9-
import { cn } from "@/lib/utils";
108

119
export const AppContext = createContext<{
1210
font: string;
@@ -41,9 +39,7 @@ export default function Providers({ children }: { children: ReactNode }) {
4139
}}
4240
>
4341
<ToasterProvider />
44-
<div className={cn(displayFontMapper[font], defaultFontMapper[font])}>
45-
{children}
46-
</div>
42+
{children}
4743
<Analytics />
4844
</AppContext.Provider>
4945
</ThemeProvider>

apps/web/ui/menu.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ import {
55
PopoverTrigger,
66
PopoverContent,
77
} from "@/ui/primitives/popover";
8-
import { useContext } from "react";
9-
import { AppContext } from "../app/providers";
10-
import { FontDefault, FontSerif, FontMono } from "@/ui/icons";
8+
// import { useContext } from "react";
9+
// import { AppContext } from "../app/providers";
10+
// import { FontDefault, FontSerif, FontMono } from "@/ui/icons";
1111
import { Check, Menu as MenuIcon, Monitor, Moon, SunDim } from "lucide-react";
1212
import { useTheme } from "next-themes";
1313

14-
const fonts = [
15-
{
16-
font: "Default",
17-
icon: <FontDefault className="h-4 w-4" />,
18-
},
19-
{
20-
font: "Serif",
21-
icon: <FontSerif className="h-4 w-4" />,
22-
},
23-
{
24-
font: "Mono",
25-
icon: <FontMono className="h-4 w-4" />,
26-
},
27-
];
14+
// const fonts = [
15+
// {
16+
// font: "Default",
17+
// icon: <FontDefault className="h-4 w-4" />,
18+
// },
19+
// {
20+
// font: "Serif",
21+
// icon: <FontSerif className="h-4 w-4" />,
22+
// },
23+
// {
24+
// font: "Mono",
25+
// icon: <FontMono className="h-4 w-4" />,
26+
// },
27+
// ];
2828
const appearances = [
2929
{
3030
theme: "System",
@@ -41,7 +41,7 @@ const appearances = [
4141
];
4242

4343
export default function Menu() {
44-
const { font: currentFont, setFont } = useContext(AppContext);
44+
// const { font: currentFont, setFont } = useContext(AppContext);
4545
const { theme: currentTheme, setTheme } = useTheme();
4646

4747
return (
@@ -50,7 +50,7 @@ export default function Menu() {
5050
<MenuIcon className="text-stone-600" width={16} />
5151
</PopoverTrigger>
5252
<PopoverContent className="w-52 divide-y divide-stone-200" align="end">
53-
<div className="p-2">
53+
{/* <div className="p-2">
5454
<p className="p-2 text-xs font-medium text-stone-500">Font</p>
5555
{fonts.map(({ font, icon }) => (
5656
<button
@@ -69,7 +69,7 @@ export default function Menu() {
6969
{currentFont === font && <Check className="h-4 w-4" />}
7070
</button>
7171
))}
72-
</div>
72+
</div> */}
7373
<div className="p-2">
7474
<p className="p-2 text-xs font-medium text-stone-500">Appearance</p>
7575
{appearances.map(({ theme, icon }) => (

packages/core/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ export default function App() {
5252
}
5353
```
5454

55-
The `Edtior` is a React component that takes in the following props:
55+
The `Editor` is a React component that takes in the following props:
5656

5757
| Prop | Type | Description | Default |
5858
| ------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
5959
| `completionApi` | `string` | The API route to use for the OpenAI completion API. | `/api/generate` |
60-
| `className` | `string` | Additional classes to add to the editor container. | `"relative min-h-[500px] w-full max-w-screen-lg border-stone-200 bg-white p-12 px-8 sm:mb-[calc(20vh)] sm:rounded-lg sm:border sm:px-12 sm:shadow-lg"` |
60+
| `className` | `string` | Editor container classname. | `"relative min-h-[500px] w-full max-w-screen-lg border-stone-200 bg-white p-12 px-8 sm:mb-[calc(20vh)] sm:rounded-lg sm:border sm:px-12 sm:shadow-lg"` |
6161
| `defaultValue` | `JSONContent` or `string` | The default value to use for the editor. | [`defaultEditorContent`](https://github.com/steven-tey/novel/blob/main/packages/core/src/ui/editor/default-content.tsx) |
6262
| `extensions` | `Extension[]` | A list of extensions to use for the editor, in addition to the [default Novel extensions](https://github.com/steven-tey/novel/blob/main/packages/core/src/ui/editor/extensions/index.tsx). | `[]` |
6363
| `editorProps` | `EditorProps` | Props to pass to the underlying Tiptap editor, in addition to the [default Novel editor props](https://github.com/steven-tey/novel/blob/main/packages/core/src/ui/editor/props.ts). | `{}` |

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "novel",
3-
"version": "0.1.16",
3+
"version": "0.1.17",
44
"description": "Notion-style WYSIWYG editor with AI-powered autocompletions",
55
"license": "Apache-2.0",
66
"main": "./dist/index.js",
File renamed without changes.

apps/web/styles/fonts.ts renamed to packages/core/src/styles/fonts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const inconsolata = Inconsolata({
3434
subsets: ["latin"],
3535
});
3636

37-
export const displayFontMapper = {
37+
export const titleFontMapper = {
3838
Default: cal.variable,
3939
Serif: crimsonBold.variable,
4040
Mono: inconsolataBold.variable,

packages/core/src/styles/index.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
--novel-highlight-orange: #faebdd;
2222
--novel-highlight-pink: #faf1f5;
2323
--novel-highlight-gray: #f1f1ef;
24+
25+
--font-title: "Cal Sans", sans-serif;
2426
}
2527

2628
.dark-theme {
@@ -47,3 +49,8 @@
4749
--novel-highlight-pink: #5c1a3a;
4850
--novel-highlight-gray: #3a3a3a;
4951
}
52+
53+
@font-face {
54+
font-family: "Cal Sans";
55+
src: local("Cal Sans"), url(CalSans-SemiBold.otf) format("otf");
56+
}

0 commit comments

Comments
 (0)