documint 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -40,7 +40,7 @@ This editor takes markdown in and gives markdown back out.
40
40
  export function App() {
41
41
  const [content, setContent] = useState(initialMarkdown);
42
42
 
43
- return <Documint content={content} onContentChange={setContent} />;
43
+ return <Documint content={content} onContentChanged={setContent} />;
44
44
  }
45
45
  ```
46
46
 
@@ -60,6 +60,6 @@ const customTheme = {
60
60
  export function App() {
61
61
  const [content, setContent] = useState("# Themed Documint");
62
62
 
63
- return <Documint content={content} onContentChange={setContent} theme={customTheme} />;
63
+ return <Documint content={content} onContentChanged={setContent} theme={customTheme} />;
64
64
  }
65
65
  ```
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ type Comment$1 = {
11
11
  type Document$1 = {
12
12
  blocks: Block[];
13
13
  comments: CommentThread[];
14
+ frontMatter?: string;
14
15
  };
15
16
  export type Block = ParagraphBlock | HeadingBlock | ListBlock | ListItemBlock | BlockquoteBlock | TableBlock | DividerBlock | CodeBlock | DirectiveBlock | RawBlock;
16
17
  export type Inline = Text$1 | Link | Image$1 | Code | LineBreak | Raw;
@@ -199,8 +200,28 @@ export type DocumintProps = {
199
200
  keybindings?: EditorKeybinding[];
200
201
  presence?: DocumentPresence[];
201
202
  users?: DocumentUser[];
202
- onContentChange?: (content: string, document: Document$1) => void;
203
- onStateChange?: (state: DocumintState) => void;
203
+ onContentChanged?: (content: string, document: Document$1) => void;
204
+ onStateChanged?: (state: DocumintState) => void;
205
+ onCommentChanged?: (event: CommentChangedEvent) => void;
206
+ };
207
+ export type CommentChangedEvent = {
208
+ kind: "added";
209
+ comment: Comment$1;
210
+ mentionedUserIds: string[];
211
+ thread: CommentThread;
212
+ threadIndex: number;
213
+ } | {
214
+ kind: "edited";
215
+ comment: Comment$1;
216
+ previousBody: string;
217
+ mentionedUserIds: string[];
218
+ thread: CommentThread;
219
+ threadIndex: number;
220
+ } | {
221
+ kind: "deleted";
222
+ comment: Comment$1;
223
+ thread: CommentThread;
224
+ threadIndex: number;
204
225
  };
205
226
  export type DocumintTheme = EditorTheme | {
206
227
  dark: EditorTheme;
@@ -218,7 +239,7 @@ export type DocumintState = {
218
239
  selectionFrom: number;
219
240
  selectionTo: number;
220
241
  };
221
- export declare function Documint({ className, content, keybindings, onContentChange, onStateChange, presence, theme, users, }: DocumintProps): import("react/jsx-runtime").JSX.Element;
242
+ export declare function Documint({ className, content, keybindings, onCommentChanged, onContentChanged, onStateChanged, presence, theme, users, }: DocumintProps): import("react/jsx-runtime").JSX.Element;
222
243
  export declare const lightTheme: EditorTheme;
223
244
  export declare const darkTheme: EditorTheme;
224
245
  export declare const mintTheme: EditorTheme;