@unhingged/vizu-core 0.1.15 → 0.1.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/auto.cjs +43 -5
- package/dist/auto.cjs.map +1 -1
- package/dist/auto.js +43 -5
- package/dist/auto.js.map +1 -1
- package/dist/index.cjs +43 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -2
- package/dist/index.d.ts +17 -2
- package/dist/index.js +43 -5
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +2538 -0
- package/dist/internal.cjs.map +1 -0
- package/dist/internal.d.cts +446 -0
- package/dist/internal.d.ts +446 -0
- package/dist/internal.js +2507 -0
- package/dist/internal.js.map +1 -0
- package/dist/vizu.min.js +10 -6
- package/dist/vizu.min.js.map +1 -1
- package/package.json +8 -1
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single rung of the ancestor chain: the element's tag and its
|
|
3
|
+
* `nth-of-type` index inside its parent (1-indexed). Captured root-near
|
|
4
|
+
* → closer-to-target so the matcher can shift-search through wrapper
|
|
5
|
+
* additions.
|
|
6
|
+
*/
|
|
7
|
+
interface AncestorStep {
|
|
8
|
+
tag: string;
|
|
9
|
+
nthOfType: number;
|
|
10
|
+
}
|
|
11
|
+
interface ElementFingerprint {
|
|
12
|
+
selector: string;
|
|
13
|
+
parentSelector: string;
|
|
14
|
+
tagName: string;
|
|
15
|
+
textSnippet: string;
|
|
16
|
+
siblingIndex: number;
|
|
17
|
+
attributes: {
|
|
18
|
+
id?: string;
|
|
19
|
+
classList?: string[];
|
|
20
|
+
role?: string;
|
|
21
|
+
ariaLabel?: string;
|
|
22
|
+
dataKey?: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* 3-step ancestor chain. Added in algorithm v2 (Phase 11.4.2). Order:
|
|
26
|
+
* immediate parent first, then grandparent, then great-grandparent.
|
|
27
|
+
* Legacy fingerprints written before this field lack it; the matcher
|
|
28
|
+
* falls back to the parent+sibling-index+tag heuristic for those.
|
|
29
|
+
*/
|
|
30
|
+
ancestorChain?: {
|
|
31
|
+
steps: AncestorStep[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Algorithm version that produced this fingerprint. Absent (or `1`) on
|
|
35
|
+
* legacy captures; new captures stamp `2` (Phase 11.4 hardened matcher
|
|
36
|
+
* — class-signature rung, multi-ancestor chain, Levenshtein text scan).
|
|
37
|
+
* The matcher routes on the presence of {@link ancestorChain} today, so
|
|
38
|
+
* this field is informational; it gives us a stable handle to migrate
|
|
39
|
+
* data when v3 ships without re-introspecting fingerprint shape.
|
|
40
|
+
*/
|
|
41
|
+
algorithmVersion?: 1 | 2;
|
|
42
|
+
}
|
|
43
|
+
interface VizuUser {
|
|
44
|
+
id?: string;
|
|
45
|
+
name: string;
|
|
46
|
+
avatarUrl?: string;
|
|
47
|
+
email?: string;
|
|
48
|
+
/** Free-form host-defined extras (team, role, etc.) preserved on each comment. */
|
|
49
|
+
meta?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Slim shape for the mention picker. The host can @-mention any of
|
|
53
|
+
* these in a comment body. Returned by `Vizu.searchMentionable()` and
|
|
54
|
+
* cached by the popover dropdown. Name + avatar is all the UI needs;
|
|
55
|
+
* email/role intentionally omitted to keep the cross-origin surface
|
|
56
|
+
* minimal.
|
|
57
|
+
*/
|
|
58
|
+
interface MentionableUser {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
avatarUrl?: string;
|
|
62
|
+
}
|
|
63
|
+
/** Current schema version. Bump + add a migration when the shape changes. */
|
|
64
|
+
declare const SCHEMA_VERSION: 2;
|
|
65
|
+
type SchemaVersion = typeof SCHEMA_VERSION;
|
|
66
|
+
/**
|
|
67
|
+
* Triage state. Cloud workspaces use this for filtering;
|
|
68
|
+
* the local sidebar treats `resolved` / `wontfix` as "dim".
|
|
69
|
+
*/
|
|
70
|
+
type CommentStatus = 'open' | 'resolved' | 'wontfix';
|
|
71
|
+
/**
|
|
72
|
+
* Outcome of resolving a comment's fingerprint against the current DOM.
|
|
73
|
+
*
|
|
74
|
+
* - `exact` : `data-vizu-key` or `id` matched. We trust this 100%.
|
|
75
|
+
* - `likely` : The full CSS selector path matched. Probably the right
|
|
76
|
+
* element but not guaranteed if the page has dynamic
|
|
77
|
+
* duplicates.
|
|
78
|
+
* - `drifted` : Only the structural fallback (parent + sibling-index)
|
|
79
|
+
* or the page-wide text snippet matched. The page has
|
|
80
|
+
* changed since the comment was written. Render with a
|
|
81
|
+
* visible warning so visitors don't act on a stale match.
|
|
82
|
+
* - `orphaned` : Nothing matched. The element is gone. Comment is shown
|
|
83
|
+
* in a separate sidebar section.
|
|
84
|
+
*
|
|
85
|
+
* Returned by `findByFingerprint`; emitted via the `anchor:resolved` event.
|
|
86
|
+
*/
|
|
87
|
+
type MatchConfidence = 'exact' | 'likely' | 'drifted' | 'orphaned';
|
|
88
|
+
/**
|
|
89
|
+
* Embedded reply in a comment thread. Threading UI ships in v1.1 — the
|
|
90
|
+
* shape is stamped in v2 so writes are already future-correct.
|
|
91
|
+
*/
|
|
92
|
+
interface Reply {
|
|
93
|
+
id: string;
|
|
94
|
+
text: string;
|
|
95
|
+
createdAt: number;
|
|
96
|
+
author?: VizuUser;
|
|
97
|
+
/** Identity provider's user id (Clerk, etc.) when known. */
|
|
98
|
+
authorId?: string;
|
|
99
|
+
/** Clerk user ids mentioned in this reply. */
|
|
100
|
+
mentions?: string[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* File attachment metadata. Storage backend (Vercel Blob, S3, …) is
|
|
104
|
+
* decided by the host / cloud adapter; the comment only carries the
|
|
105
|
+
* resolved URL.
|
|
106
|
+
*/
|
|
107
|
+
interface Attachment {
|
|
108
|
+
id: string;
|
|
109
|
+
url: string;
|
|
110
|
+
mimeType: string;
|
|
111
|
+
sizeBytes: number;
|
|
112
|
+
uploadedAt: number;
|
|
113
|
+
/** Original filename the user uploaded. */
|
|
114
|
+
filename?: string;
|
|
115
|
+
}
|
|
116
|
+
interface VizuComment {
|
|
117
|
+
id: string;
|
|
118
|
+
/** Schema version. Set to {@link SCHEMA_VERSION} on every new write. */
|
|
119
|
+
schemaVersion: SchemaVersion;
|
|
120
|
+
/**
|
|
121
|
+
* One or more elements this comment is anchored to. Length 1 = single-anchor
|
|
122
|
+
* (the common case); >1 = "grouped" comment that applies to multiple
|
|
123
|
+
* elements together (e.g., "align these three CTAs to the same baseline").
|
|
124
|
+
*
|
|
125
|
+
* Always has length ≥ 1. Legacy v1 comments (with a singular `fingerprint`
|
|
126
|
+
* field) are auto-migrated to `[fingerprint]` on load — see `migrateComment`.
|
|
127
|
+
*/
|
|
128
|
+
fingerprints: ElementFingerprint[];
|
|
129
|
+
/** @deprecated v1 only — kept on the type so older payloads parse cleanly; migrated at load time. */
|
|
130
|
+
fingerprint?: ElementFingerprint;
|
|
131
|
+
text: string;
|
|
132
|
+
createdAt: number;
|
|
133
|
+
pageVersion?: string;
|
|
134
|
+
/** @deprecated use `pageUrl` — kept for backwards-compat read of v1 payloads. */
|
|
135
|
+
url?: string;
|
|
136
|
+
/** Page URL where the comment was anchored. Cloud reads filter on this. */
|
|
137
|
+
pageUrl?: string;
|
|
138
|
+
/** Captured from `Vizu.setUser` / `options.user` at the moment the comment was created. */
|
|
139
|
+
author?: VizuUser;
|
|
140
|
+
/** Identity provider's user id (Clerk, etc.) when known. Cloud writes set this from the session. */
|
|
141
|
+
authorId?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Element references the user inserted via `#` mentions. Keyed by short refId.
|
|
144
|
+
* The comment text contains tokens like `[#label](vizu-ref:refId)` that resolve
|
|
145
|
+
* to these fingerprints; clicking a rendered reference jumps to the element.
|
|
146
|
+
*/
|
|
147
|
+
references?: Record<string, ElementFingerprint>;
|
|
148
|
+
/** Triage state. Defaults to `'open'` on new comments. */
|
|
149
|
+
status: CommentStatus;
|
|
150
|
+
/** Threaded replies. UI ships in v1.1; the array is always present. */
|
|
151
|
+
replies: Reply[];
|
|
152
|
+
/** File attachments. UI ships in v1.2; the array is always present. */
|
|
153
|
+
attachments: Attachment[];
|
|
154
|
+
/** Clerk user ids mentioned in this comment. */
|
|
155
|
+
mentions: string[];
|
|
156
|
+
/**
|
|
157
|
+
* Timestamp (ms) of the last self-healing re-fingerprint pass. Set by
|
|
158
|
+
* the Vizu class when a `drifted` resolution lands on an existing
|
|
159
|
+
* element and the fingerprint is rewritten in place. Reads as null
|
|
160
|
+
* for comments that have never drifted. Surface in the dashboard if
|
|
161
|
+
* you want to flag "auto-healed" rows; ignore otherwise.
|
|
162
|
+
*/
|
|
163
|
+
fingerprintsRefreshedAt?: number | null;
|
|
164
|
+
}
|
|
165
|
+
/** Context handed to every action's onClick. Has the data and the side-effect helpers. */
|
|
166
|
+
interface ActionContext {
|
|
167
|
+
comments: VizuComment[];
|
|
168
|
+
pageHtml: string;
|
|
169
|
+
pageUrl?: string;
|
|
170
|
+
pageVersion?: string;
|
|
171
|
+
user?: VizuUser;
|
|
172
|
+
timestamp: number;
|
|
173
|
+
/** Quick copy-to-clipboard helper. */
|
|
174
|
+
copyToClipboard: (text: string) => void;
|
|
175
|
+
/** Briefly show a toast above the pill. */
|
|
176
|
+
toast: (message: string) => void;
|
|
177
|
+
}
|
|
178
|
+
interface VizuAction {
|
|
179
|
+
id: string;
|
|
180
|
+
label: string;
|
|
181
|
+
/** Tooltip / aria-label */
|
|
182
|
+
title?: string;
|
|
183
|
+
variant?: 'primary' | 'default' | 'ghost';
|
|
184
|
+
/** Placement in the pill. Defaults to 'main'. */
|
|
185
|
+
position?: 'main';
|
|
186
|
+
onClick: (ctx: ActionContext) => void | Promise<void>;
|
|
187
|
+
/** Only render the action when this returns true. */
|
|
188
|
+
visibleWhen?: (ctx: {
|
|
189
|
+
commentsCount: number;
|
|
190
|
+
}) => boolean;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
interface PillCallbacks {
|
|
194
|
+
onToggleSidebar: () => void;
|
|
195
|
+
onDisable: () => void;
|
|
196
|
+
onAction: (id: string) => void;
|
|
197
|
+
onToggleMultiSelect: () => void;
|
|
198
|
+
onCommitSelection: () => void;
|
|
199
|
+
onClearSelection: () => void;
|
|
200
|
+
}
|
|
201
|
+
declare class Pill {
|
|
202
|
+
private el;
|
|
203
|
+
private root;
|
|
204
|
+
private callbacks;
|
|
205
|
+
private sidebarOpen;
|
|
206
|
+
private actions;
|
|
207
|
+
private commentsCount;
|
|
208
|
+
private user;
|
|
209
|
+
private multiSelectMode;
|
|
210
|
+
private selectionCount;
|
|
211
|
+
constructor(root: HTMLElement, callbacks: PillCallbacks);
|
|
212
|
+
setActions(actions: VizuAction[]): void;
|
|
213
|
+
setComments(comments: VizuComment[]): void;
|
|
214
|
+
setUser(user: VizuUser | null): void;
|
|
215
|
+
setSidebarOpen(open: boolean): void;
|
|
216
|
+
setMultiSelectState(mode: boolean, selectionCount: number): void;
|
|
217
|
+
show(): void;
|
|
218
|
+
hide(): void;
|
|
219
|
+
private render;
|
|
220
|
+
private handleClick;
|
|
221
|
+
toast(message: string): void;
|
|
222
|
+
destroy(): void;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
interface PopoverCallbacks {
|
|
226
|
+
/**
|
|
227
|
+
* Save a comment with one or more anchored fingerprints and the parsed
|
|
228
|
+
* reference map. Refs are inline tokens in `text` and resolved via `references`.
|
|
229
|
+
*/
|
|
230
|
+
onAdd: (text: string, fingerprints: ElementFingerprint[], references?: Record<string, ElementFingerprint>, mentions?: string[], attachments?: Attachment[]) => void;
|
|
231
|
+
onDelete: (id: string) => void;
|
|
232
|
+
onAddReply: (commentId: string, text: string) => void;
|
|
233
|
+
onDeleteReply: (commentId: string, replyId: string) => void;
|
|
234
|
+
/** Upload a file via the active storage adapter; returns the resolved Attachment. */
|
|
235
|
+
onUploadAttachment: (file: File) => Promise<Attachment>;
|
|
236
|
+
/** True iff the active storage adapter supports uploads (popover hides the UI otherwise). */
|
|
237
|
+
canUploadAttachments: () => boolean;
|
|
238
|
+
onClose: () => void;
|
|
239
|
+
onStartReferencePick: (onPicked: (fp: ElementFingerprint) => void, onCancel: () => void) => void;
|
|
240
|
+
onJumpToReference: (commentId: string, refId: string) => void;
|
|
241
|
+
onAnchorsChanged: (fingerprints: ElementFingerprint[]) => void;
|
|
242
|
+
/**
|
|
243
|
+
* Fetch the workspace's mentionable users for the @ picker dropdown.
|
|
244
|
+
* Called every time the user opens the picker — keeps the list fresh
|
|
245
|
+
* if members were added/removed in another tab. Returns [] for hosts
|
|
246
|
+
* that don't support mentions (local/memory storage adapters).
|
|
247
|
+
*/
|
|
248
|
+
onMentionSearch?: () => Promise<MentionableUser[]>;
|
|
249
|
+
}
|
|
250
|
+
declare class Popover {
|
|
251
|
+
private el;
|
|
252
|
+
private root;
|
|
253
|
+
private callbacks;
|
|
254
|
+
private currentUser;
|
|
255
|
+
/** All elements this in-progress comment is anchored to. First one positions the popover. */
|
|
256
|
+
private anchorTargets;
|
|
257
|
+
private anchorFingerprints;
|
|
258
|
+
/** Refs the user inserted via # picker during this session, keyed by refId. */
|
|
259
|
+
private pendingRefs;
|
|
260
|
+
/** Attachments uploaded during this session, persisted into `comment.attachments` on save. */
|
|
261
|
+
private pendingAttachments;
|
|
262
|
+
/** Open mention picker element, if any. Held so the next openMentionPicker / close calls can tear it down. */
|
|
263
|
+
private mentionPicker;
|
|
264
|
+
/** Dismiss handlers wired to document for the open picker; cleared in closeMentionPicker. */
|
|
265
|
+
private mentionPickerDismiss;
|
|
266
|
+
/** All mentionable users fetched for the open picker — pre-filter list. */
|
|
267
|
+
private mentionPickerUsers;
|
|
268
|
+
/** Currently visible subset of `mentionPickerUsers` after the user's filter. */
|
|
269
|
+
private mentionPickerFiltered;
|
|
270
|
+
/** Highlighted index in `mentionPickerFiltered`. Up/Down arrows mutate this. */
|
|
271
|
+
private mentionPickerSelected;
|
|
272
|
+
/**
|
|
273
|
+
* 'manual' = opened from the @ mention button (separate search input).
|
|
274
|
+
* 'editor' = opened by typing `@` in the editor; filter is derived
|
|
275
|
+
* from the text after `@` in the editor itself, no search input.
|
|
276
|
+
*/
|
|
277
|
+
private mentionPickerMode;
|
|
278
|
+
/**
|
|
279
|
+
* In editor mode: a Range covering `@<query>` in the editor's text.
|
|
280
|
+
* Used to replace that span with the mention chip on commit, and to
|
|
281
|
+
* recompute the bounding rect when re-positioning after typing.
|
|
282
|
+
*/
|
|
283
|
+
private mentionPickerEditorRange;
|
|
284
|
+
constructor(root: HTMLElement, callbacks: PopoverCallbacks);
|
|
285
|
+
setUser(user: VizuUser | null): void;
|
|
286
|
+
/**
|
|
287
|
+
* Open the popover anchored to one OR more elements. The popover positions
|
|
288
|
+
* itself relative to `targets[0]` but commits with every fingerprint in `fingerprints`.
|
|
289
|
+
*/
|
|
290
|
+
open(targets: Element[], fingerprints: ElementFingerprint[], existingComments: VizuComment[]): void;
|
|
291
|
+
/** Refresh the rendered comment list (called by host when comments change). */
|
|
292
|
+
update(existingComments: VizuComment[]): void;
|
|
293
|
+
/** Add another anchor to the in-progress comment (Shift+Click flow). */
|
|
294
|
+
addAnchor(fp: ElementFingerprint, target: Element | null): boolean;
|
|
295
|
+
/** Remove an anchor by fingerprint key. Never removes the last anchor. */
|
|
296
|
+
removeAnchor(key: string): boolean;
|
|
297
|
+
private updateHeader;
|
|
298
|
+
/** Recompute viewport position; called by host on scroll/resize. */
|
|
299
|
+
reposition(): void;
|
|
300
|
+
close(): void;
|
|
301
|
+
isOpen(): boolean;
|
|
302
|
+
getAnchors(): ElementFingerprint[];
|
|
303
|
+
getAnchorTargets(): Element[];
|
|
304
|
+
private render;
|
|
305
|
+
private renderAnchorList;
|
|
306
|
+
private handleEditorKey;
|
|
307
|
+
/**
|
|
308
|
+
* Fires after every keystroke in the editor (post-insertion). Looks
|
|
309
|
+
* for an `@<query>` pattern adjacent to the caret. If found, opens
|
|
310
|
+
* (or refreshes) the mention picker in editor mode. If the trigger
|
|
311
|
+
* disappears (user typed a space, backspaced over @, etc.), closes
|
|
312
|
+
* the picker.
|
|
313
|
+
*/
|
|
314
|
+
private handleEditorInput;
|
|
315
|
+
/**
|
|
316
|
+
* Walk back from the caret looking for the most recent `@` that
|
|
317
|
+
* starts a mention trigger — must be at start-of-text-node or
|
|
318
|
+
* preceded by whitespace, and there must be no whitespace between
|
|
319
|
+
* `@` and the caret. Returns the Range covering `@<query>` plus
|
|
320
|
+
* the bare query string.
|
|
321
|
+
*/
|
|
322
|
+
private detectMentionTrigger;
|
|
323
|
+
private handleEditorPaste;
|
|
324
|
+
private handleDragOver;
|
|
325
|
+
private handleDragLeave;
|
|
326
|
+
private handleDrop;
|
|
327
|
+
private handleFileChange;
|
|
328
|
+
private uploadAndAppend;
|
|
329
|
+
private renderAttachmentList;
|
|
330
|
+
private saveRange;
|
|
331
|
+
private restoreRange;
|
|
332
|
+
private insertChip;
|
|
333
|
+
private moveCursorToEnd;
|
|
334
|
+
/** Walk the editor and produce the markdown-ish string with ref tokens. */
|
|
335
|
+
private serializeEditor;
|
|
336
|
+
private handleClick;
|
|
337
|
+
/**
|
|
338
|
+
* Manual-mode picker: opens from the @ mention button. Renders a
|
|
339
|
+
* search input above the list; the user types into the input to
|
|
340
|
+
* filter, arrows + Enter to pick. The selection inserts a mention
|
|
341
|
+
* chip at the editor's current caret (no `@<query>` replacement —
|
|
342
|
+
* the user didn't type one).
|
|
343
|
+
*/
|
|
344
|
+
private openMentionPicker;
|
|
345
|
+
/**
|
|
346
|
+
* Editor-mode picker: opens because the user typed `@` in the
|
|
347
|
+
* editor. No search input — the editor IS the search; the query is
|
|
348
|
+
* the text after `@`. On commit, replaces the `@<query>` range with
|
|
349
|
+
* the chip.
|
|
350
|
+
*/
|
|
351
|
+
private openOrUpdateEditorMentionPicker;
|
|
352
|
+
/**
|
|
353
|
+
* Build the picker DOM scaffold and attach it to the popover. Does
|
|
354
|
+
* NOT fetch users or render the body — caller's responsibility.
|
|
355
|
+
* Search input is hidden in editor mode where the user already has
|
|
356
|
+
* a perfectly good text-entry surface (the editor itself).
|
|
357
|
+
*/
|
|
358
|
+
private createMentionPickerShell;
|
|
359
|
+
/** Fetch the mentionable list. Swallows errors → []. */
|
|
360
|
+
private fetchMentionables;
|
|
361
|
+
/**
|
|
362
|
+
* Re-filter the cached users by `query`, render the list, reset
|
|
363
|
+
* selected to 0. Called on every search input change and on every
|
|
364
|
+
* editor input event while in editor mode.
|
|
365
|
+
*/
|
|
366
|
+
private renderMentionPickerBody;
|
|
367
|
+
private moveMentionPickerSelection;
|
|
368
|
+
private refreshMentionPickerHighlight;
|
|
369
|
+
private commitMentionPickerSelection;
|
|
370
|
+
/**
|
|
371
|
+
* Swap a Range covering `@<query>` for a mention chip + trailing
|
|
372
|
+
* space, then place the caret after the space so the user can keep
|
|
373
|
+
* typing. Used only in editor-trigger mode.
|
|
374
|
+
*/
|
|
375
|
+
private replaceRangeWithMentionChip;
|
|
376
|
+
/** Wires Esc + outside-click handlers to close the open picker. */
|
|
377
|
+
private wireMentionPickerDismiss;
|
|
378
|
+
private closeMentionPicker;
|
|
379
|
+
/** Position the picker below the given anchor (the @ mention button). */
|
|
380
|
+
private positionMentionPickerByElement;
|
|
381
|
+
/** Position the picker below the `@<query>` text range in the editor. */
|
|
382
|
+
private positionMentionPickerByRange;
|
|
383
|
+
/**
|
|
384
|
+
* Insert a mention chip for the given user into the editor at the
|
|
385
|
+
* current caret position. Accepts any user-like shape with a required
|
|
386
|
+
* `id` + `name` — covers both the current VizuUser (for self-mention)
|
|
387
|
+
* and MentionableUser (from the workspace member picker).
|
|
388
|
+
*/
|
|
389
|
+
private insertMentionChip;
|
|
390
|
+
private save;
|
|
391
|
+
private position;
|
|
392
|
+
destroy(): void;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
declare class Highlighter {
|
|
396
|
+
private overlay;
|
|
397
|
+
private root;
|
|
398
|
+
private current;
|
|
399
|
+
private extraIgnore;
|
|
400
|
+
private onClick;
|
|
401
|
+
private active;
|
|
402
|
+
private paused;
|
|
403
|
+
constructor(root: HTMLElement, extraIgnore: string[], onClick: (el: Element, mouseEvent: MouseEvent) => void);
|
|
404
|
+
private setCurrent;
|
|
405
|
+
start(): void;
|
|
406
|
+
stop(): void;
|
|
407
|
+
private shouldIgnore;
|
|
408
|
+
private handleMove;
|
|
409
|
+
private handleClick;
|
|
410
|
+
setPaused(paused: boolean): void;
|
|
411
|
+
isPaused(): boolean;
|
|
412
|
+
private handleScroll;
|
|
413
|
+
private updateOverlay;
|
|
414
|
+
destroy(): void;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
interface SidebarCallbacks {
|
|
418
|
+
onJumpTo: (fp: ElementFingerprint) => void;
|
|
419
|
+
onJumpToReference: (commentId: string, refId: string) => void;
|
|
420
|
+
onDelete: (id: string) => void;
|
|
421
|
+
onUpdateStatus: (id: string, status: CommentStatus) => void;
|
|
422
|
+
onClose: () => void;
|
|
423
|
+
}
|
|
424
|
+
declare class Sidebar {
|
|
425
|
+
private el;
|
|
426
|
+
private root;
|
|
427
|
+
private callbacks;
|
|
428
|
+
private open;
|
|
429
|
+
private filter;
|
|
430
|
+
private lastComments;
|
|
431
|
+
private lastConfidence;
|
|
432
|
+
constructor(root: HTMLElement, callbacks: SidebarCallbacks);
|
|
433
|
+
toggle(comments: VizuComment[], confidence?: Map<string, MatchConfidence>): void;
|
|
434
|
+
show(comments: VizuComment[], confidence?: Map<string, MatchConfidence>): void;
|
|
435
|
+
update(comments: VizuComment[], confidence?: Map<string, MatchConfidence>): void;
|
|
436
|
+
close(): void;
|
|
437
|
+
isOpen(): boolean;
|
|
438
|
+
private render;
|
|
439
|
+
private headerHtml;
|
|
440
|
+
private handleClick;
|
|
441
|
+
destroy(): void;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
declare function injectStyles(): void;
|
|
445
|
+
|
|
446
|
+
export { Highlighter, Pill, type PillCallbacks, Popover, type PopoverCallbacks, Sidebar, injectStyles };
|