Skip to content

Commit 32ab6e6

Browse files
committed
bump to 0.1.16
1 parent 4dc9105 commit 32ab6e6

File tree

4 files changed

+26
-29
lines changed

4 files changed

+26
-29
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ export default function App() {
5454

5555
The `Edtior` is a React component that takes in the following props:
5656

57-
| Prop | Type | Description | Default |
58-
| ------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
59-
| `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. | `""` |
61-
| `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) |
62-
| `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). | `[]` |
63-
| `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). | `{}` |
64-
| `onUpdate` | `(editor?: Editor) => void` | A callback function that is called whenever the editor is updated. | `() => {}` |
65-
| `onDebouncedUpdate` | `(editor?: Editor) => void` | A callback function that is called whenever the editor is updated, but only after the defined debounce duration. | `() => {}` |
66-
| `debounceDuration` | `number` | The duration (in milliseconds) to debounce the `onDebouncedUpdate` callback. | `750` |
67-
| `storageKey` | `string` | The key to use for storing the editor's value in local storage. | `novel__content` |
57+
| Prop | Type | Description | Default |
58+
| ------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
59+
| `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"` |
61+
| `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) |
62+
| `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). | `[]` |
63+
| `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). | `{}` |
64+
| `onUpdate` | `(editor?: Editor) => void` | A callback function that is called whenever the editor is updated. | `() => {}` |
65+
| `onDebouncedUpdate` | `(editor?: Editor) => void` | A callback function that is called whenever the editor is updated, but only after the defined debounce duration. | `() => {}` |
66+
| `debounceDuration` | `number` | The duration (in milliseconds) to debounce the `onDebouncedUpdate` callback. | `750` |
67+
| `storageKey` | `string` | The key to use for storing the editor's value in local storage. | `novel__content` |
6868

6969
> **Note**: Make sure to define an API endpoint that matches the `completionApi` prop (default is `/api/generate`). This is needed for the AI autocompletions to work. Here's an example: https://github.com/steven-tey/novel/blob/main/apps/web/app/api/generate/route.ts
7070

packages/core/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ export default function App() {
5454

5555
The `Edtior` is a React component that takes in the following props:
5656

57-
| Prop | Type | Description | Default |
58-
| ------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
59-
| `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. | `""` |
61-
| `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) |
62-
| `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). | `[]` |
63-
| `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). | `{}` |
64-
| `onUpdate` | `(editor?: Editor) => void` | A callback function that is called whenever the editor is updated. | `() => {}` |
65-
| `onDebouncedUpdate` | `(editor?: Editor) => void` | A callback function that is called whenever the editor is updated, but only after the defined debounce duration. | `() => {}` |
66-
| `debounceDuration` | `number` | The duration (in milliseconds) to debounce the `onDebouncedUpdate` callback. | `750` |
67-
| `storageKey` | `string` | The key to use for storing the editor's value in local storage. | `novel__content` |
57+
| Prop | Type | Description | Default |
58+
| ------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
59+
| `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"` |
61+
| `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) |
62+
| `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). | `[]` |
63+
| `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). | `{}` |
64+
| `onUpdate` | `(editor?: Editor) => void` | A callback function that is called whenever the editor is updated. | `() => {}` |
65+
| `onDebouncedUpdate` | `(editor?: Editor) => void` | A callback function that is called whenever the editor is updated, but only after the defined debounce duration. | `() => {}` |
66+
| `debounceDuration` | `number` | The duration (in milliseconds) to debounce the `onDebouncedUpdate` callback. | `750` |
67+
| `storageKey` | `string` | The key to use for storing the editor's value in local storage. | `novel__content` |
6868

6969
> **Note**: Make sure to define an API endpoint that matches the `completionApi` prop (default is `/api/generate`). This is needed for the AI autocompletions to work. Here's an example: https://github.com/steven-tey/novel/blob/main/apps/web/app/api/generate/route.ts
7070

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.15",
3+
"version": "0.1.16",
44
"description": "Notion-style WYSIWYG editor with AI-powered autocompletions",
55
"license": "Apache-2.0",
66
"main": "./dist/index.js",

packages/core/src/ui/editor/index.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ import { getPrevText } from "@/lib/editor";
2121
import { ImageResizer } from "./extensions/image-resizer";
2222
import { EditorProps } from "@tiptap/pm/view";
2323
import { Editor as EditorClass } from "@tiptap/core";
24-
import { cn } from "@/lib/utils";
2524

2625
export default function Editor({
2726
completionApi = "/api/generate",
28-
className = "",
27+
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",
2928
defaultValue = defaultEditorContent,
3029
extensions = [],
3130
editorProps = {},
@@ -41,6 +40,7 @@ export default function Editor({
4140
completionApi?: string;
4241
/**
4342
* Additional classes to add to the editor container.
43+
* Defaults to "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".
4444
*/
4545
className?: string;
4646
/**
@@ -195,10 +195,7 @@ export default function Editor({
195195
onClick={() => {
196196
editor?.chain().focus().run();
197197
}}
198-
className={cn(
199-
"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",
200-
className
201-
)}
198+
className={className}
202199
>
203200
{editor && <EditorBubbleMenu editor={editor} />}
204201
{editor?.isActive("image") && <ImageResizer editor={editor} />}

0 commit comments

Comments
 (0)