documint 0.0.15 → 0.0.17

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 CHANGED
@@ -1,18 +1,41 @@
1
1
  import { LucideIcon } from 'lucide-react';
2
2
 
3
+ declare const ANCHOR_KINDS: readonly [
4
+ "text",
5
+ "code",
6
+ "tableCell"
7
+ ];
8
+ type AnchorKind = (typeof ANCHOR_KINDS)[number];
9
+ type TextAnchor = {
10
+ kind?: AnchorKind;
11
+ prefix?: string;
12
+ suffix?: string;
13
+ };
3
14
  export type CommentThread = {
15
+ id: string;
4
16
  quote: string;
5
17
  comments: Comment$1[];
6
- anchor: Anchor;
18
+ anchor: TextAnchor;
7
19
  resolvedAt?: string;
8
20
  };
9
21
  type Comment$1 = {
10
22
  body: string;
11
23
  updatedAt: string;
12
24
  };
25
+ type CommentThreadAnchor = {
26
+ threadId: string;
27
+ };
28
+ export type Anchor = TextAnchor | CommentThreadAnchor;
13
29
  type Document$1 = {
14
30
  blocks: Block[];
15
31
  comments: CommentThread[];
32
+ /**
33
+ * Markdown-only round-trip slot for the leading `---`-fenced front matter,
34
+ * preserved verbatim. Treat as opaque metadata: the document engine never
35
+ * reads it. Intentionally an unparsed string until there is a concrete
36
+ * reason to model YAML/TOML structurally — once we do, this becomes a
37
+ * `metadata: Record<string, unknown>` slot owned at the document layer.
38
+ */
16
39
  frontMatter?: string;
17
40
  };
18
41
  export type Block = ParagraphBlock | HeadingBlock | ListBlock | ListItemBlock | BlockquoteBlock | TableBlock | DividerBlock | CodeBlock | DirectiveBlock | RawBlock;
@@ -101,17 +124,6 @@ export type Raw = DocumentNode<"raw", {
101
124
  originalType: string;
102
125
  source: string;
103
126
  }>;
104
- declare const ANCHOR_KINDS: readonly [
105
- "text",
106
- "code",
107
- "tableCell"
108
- ];
109
- type AnchorKind = (typeof ANCHOR_KINDS)[number];
110
- export type Anchor = {
111
- kind?: AnchorKind;
112
- prefix?: string;
113
- suffix?: string;
114
- };
115
127
  export type DocumintStorage = {
116
128
  readFile(path: string): Promise<Blob | null>;
117
129
  writeFile(file: File): Promise<string>;
@@ -160,11 +172,11 @@ export type EditorTheme = {
160
172
  leafShadow?: string;
161
173
  leafText: string;
162
174
  linkText: string;
163
- listMarkerText: string;
175
+ listMarkerText?: string;
164
176
  mentionBackground?: string;
165
177
  mentionText?: string;
166
- paddingX: number;
167
- paddingY: number;
178
+ paddingX?: number;
179
+ paddingY?: number;
168
180
  paragraphText: string;
169
181
  selectionBackground: string;
170
182
  selectionHandleBackground: string;
@@ -184,13 +196,12 @@ export type DocumentUser = {
184
196
  avatarUrl?: string;
185
197
  };
186
198
  /**
187
- * One user's live cursor in the document. `userId` foreign-keys into the
188
- * `users` roster; entries without a matching user are silently dropped.
199
+ * One user's live document presence. `userId` foreign-keys into the `users`
200
+ * roster; entries without a matching user are silently dropped.
189
201
  *
190
- * `cursor` is a content-addressable anchor (prefix/suffix). The editor
191
- * resolves it against the current document; if the anchor matches zero or
192
- * more than one place, the cursor is treated as unresolved and rendered as
193
- * an "unknown location" indicator rather than guessed.
202
+ * `cursor` is either a content-addressable text anchor (prefix/suffix) or a
203
+ * comment-thread anchor (`{ threadId }`). The editor resolves comment-thread
204
+ * anchors to a presence-active comment rule instead of a remote caret.
194
205
  */
195
206
  export type DocumentPresence = {
196
207
  userId: string;
@@ -207,6 +218,7 @@ export type EditorKeybinding = {
207
218
  export declare const defaultKeybindings: EditorKeybinding[];
208
219
  export type DocumintDecoration = {
209
220
  backgroundColor?: string;
221
+ pulse?: boolean;
210
222
  color?: string;
211
223
  pattern: RegExp;
212
224
  };
@@ -237,19 +249,19 @@ export type CommentChange = {
237
249
  comment: Comment$1;
238
250
  mentionedUserIds: string[];
239
251
  thread: CommentThread;
240
- threadIndex: number;
252
+ threadId: string;
241
253
  } | {
242
254
  kind: "edited";
243
255
  comment: Comment$1;
244
256
  previousBody: string;
245
257
  mentionedUserIds: string[];
246
258
  thread: CommentThread;
247
- threadIndex: number;
259
+ threadId: string;
248
260
  } | {
249
261
  kind: "deleted";
250
262
  comment: Comment$1;
251
263
  thread: CommentThread;
252
- threadIndex: number;
264
+ threadId: string;
253
265
  };
254
266
  export type UserMentionEvent = {
255
267
  lineMarkdown: string;