documint 0.0.11 → 0.0.12
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/dist/index.d.ts +14 -4
- package/dist/index.js +72 -41
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
2
|
|
|
3
3
|
export type CommentThread = {
|
|
4
4
|
quote: string;
|
|
@@ -16,7 +16,7 @@ type Document$1 = {
|
|
|
16
16
|
frontMatter?: string;
|
|
17
17
|
};
|
|
18
18
|
export type Block = ParagraphBlock | HeadingBlock | ListBlock | ListItemBlock | BlockquoteBlock | TableBlock | DividerBlock | CodeBlock | DirectiveBlock | RawBlock;
|
|
19
|
-
export type Inline = Text$1 | Link | Image$1 | Code | LineBreak | Raw;
|
|
19
|
+
export type Inline = Text$1 | Link | Image$1 | Mention | Code | LineBreak | Raw;
|
|
20
20
|
type DocumentNode<K extends string, P = {}> = {
|
|
21
21
|
id: string;
|
|
22
22
|
type: K;
|
|
@@ -89,6 +89,10 @@ type Image$1 = DocumentNode<"image", {
|
|
|
89
89
|
url: string;
|
|
90
90
|
width: number | null;
|
|
91
91
|
}>;
|
|
92
|
+
type Mention = DocumentNode<"mention", {
|
|
93
|
+
name: string;
|
|
94
|
+
userId: string;
|
|
95
|
+
}>;
|
|
92
96
|
type LineBreak = DocumentNode<"lineBreak">;
|
|
93
97
|
type Code = DocumentNode<"code", {
|
|
94
98
|
code: string;
|
|
@@ -212,10 +216,11 @@ export type DocumintProps = {
|
|
|
212
216
|
users?: DocumentUser[];
|
|
213
217
|
onContentChanged?: (content: string, document: Document$1) => void;
|
|
214
218
|
onCommentChanged?: (change: CommentChange) => void;
|
|
219
|
+
onUserMentioned?: (event: UserMentionEvent) => void;
|
|
215
220
|
};
|
|
216
221
|
export type DocumintAction<T> = {
|
|
217
|
-
icon:
|
|
218
|
-
label
|
|
222
|
+
icon: LucideIcon;
|
|
223
|
+
label: string;
|
|
219
224
|
onClick: (arg: T) => void;
|
|
220
225
|
};
|
|
221
226
|
export type DocumintActions = {
|
|
@@ -240,6 +245,11 @@ export type CommentChange = {
|
|
|
240
245
|
thread: CommentThread;
|
|
241
246
|
threadIndex: number;
|
|
242
247
|
};
|
|
248
|
+
export type UserMentionEvent = {
|
|
249
|
+
lineMarkdown: string;
|
|
250
|
+
lineNumber: number;
|
|
251
|
+
userId: string;
|
|
252
|
+
};
|
|
243
253
|
export type DocumintTheme = EditorTheme | {
|
|
244
254
|
dark: EditorTheme;
|
|
245
255
|
light: EditorTheme;
|