documint 0.0.15 → 0.0.16
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 +17 -12
- package/dist/index.js +37 -37
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LucideIcon } from 'lucide-react';
|
|
2
2
|
|
|
3
3
|
export type CommentThread = {
|
|
4
|
+
id: string;
|
|
4
5
|
quote: string;
|
|
5
6
|
comments: Comment$1[];
|
|
6
|
-
anchor:
|
|
7
|
+
anchor: TextAnchor;
|
|
7
8
|
resolvedAt?: string;
|
|
8
9
|
};
|
|
9
10
|
type Comment$1 = {
|
|
@@ -107,11 +108,15 @@ declare const ANCHOR_KINDS: readonly [
|
|
|
107
108
|
"tableCell"
|
|
108
109
|
];
|
|
109
110
|
type AnchorKind = (typeof ANCHOR_KINDS)[number];
|
|
110
|
-
|
|
111
|
+
type TextAnchor = {
|
|
111
112
|
kind?: AnchorKind;
|
|
112
113
|
prefix?: string;
|
|
113
114
|
suffix?: string;
|
|
114
115
|
};
|
|
116
|
+
type CommentThreadAnchor = {
|
|
117
|
+
threadId: string;
|
|
118
|
+
};
|
|
119
|
+
export type Anchor = TextAnchor | CommentThreadAnchor;
|
|
115
120
|
export type DocumintStorage = {
|
|
116
121
|
readFile(path: string): Promise<Blob | null>;
|
|
117
122
|
writeFile(file: File): Promise<string>;
|
|
@@ -160,7 +165,7 @@ export type EditorTheme = {
|
|
|
160
165
|
leafShadow?: string;
|
|
161
166
|
leafText: string;
|
|
162
167
|
linkText: string;
|
|
163
|
-
listMarkerText
|
|
168
|
+
listMarkerText?: string;
|
|
164
169
|
mentionBackground?: string;
|
|
165
170
|
mentionText?: string;
|
|
166
171
|
paddingX: number;
|
|
@@ -184,13 +189,12 @@ export type DocumentUser = {
|
|
|
184
189
|
avatarUrl?: string;
|
|
185
190
|
};
|
|
186
191
|
/**
|
|
187
|
-
* One user's live
|
|
188
|
-
*
|
|
192
|
+
* One user's live document presence. `userId` foreign-keys into the `users`
|
|
193
|
+
* roster; entries without a matching user are silently dropped.
|
|
189
194
|
*
|
|
190
|
-
* `cursor` is a content-addressable anchor (prefix/suffix)
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* an "unknown location" indicator rather than guessed.
|
|
195
|
+
* `cursor` is either a content-addressable text anchor (prefix/suffix) or a
|
|
196
|
+
* comment-thread anchor (`{ threadId }`). The editor resolves comment-thread
|
|
197
|
+
* anchors to a presence-active comment rule instead of a remote caret.
|
|
194
198
|
*/
|
|
195
199
|
export type DocumentPresence = {
|
|
196
200
|
userId: string;
|
|
@@ -207,6 +211,7 @@ export type EditorKeybinding = {
|
|
|
207
211
|
export declare const defaultKeybindings: EditorKeybinding[];
|
|
208
212
|
export type DocumintDecoration = {
|
|
209
213
|
backgroundColor?: string;
|
|
214
|
+
pulse?: boolean;
|
|
210
215
|
color?: string;
|
|
211
216
|
pattern: RegExp;
|
|
212
217
|
};
|
|
@@ -237,19 +242,19 @@ export type CommentChange = {
|
|
|
237
242
|
comment: Comment$1;
|
|
238
243
|
mentionedUserIds: string[];
|
|
239
244
|
thread: CommentThread;
|
|
240
|
-
|
|
245
|
+
threadId: string;
|
|
241
246
|
} | {
|
|
242
247
|
kind: "edited";
|
|
243
248
|
comment: Comment$1;
|
|
244
249
|
previousBody: string;
|
|
245
250
|
mentionedUserIds: string[];
|
|
246
251
|
thread: CommentThread;
|
|
247
|
-
|
|
252
|
+
threadId: string;
|
|
248
253
|
} | {
|
|
249
254
|
kind: "deleted";
|
|
250
255
|
comment: Comment$1;
|
|
251
256
|
thread: CommentThread;
|
|
252
|
-
|
|
257
|
+
threadId: string;
|
|
253
258
|
};
|
|
254
259
|
export type UserMentionEvent = {
|
|
255
260
|
lineMarkdown: string;
|