@sentropic/design-system-svelte 0.42.0 → 0.43.1
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/CommentAuthorship.svelte +186 -0
- package/dist/CommentAuthorship.svelte.d.ts +18 -0
- package/dist/CommentAuthorship.svelte.d.ts.map +1 -0
- package/dist/CommentComposer.svelte +336 -0
- package/dist/CommentComposer.svelte.d.ts +33 -0
- package/dist/CommentComposer.svelte.d.ts.map +1 -0
- package/dist/CommentLayer.svelte +1629 -0
- package/dist/CommentLayer.svelte.d.ts +64 -0
- package/dist/CommentLayer.svelte.d.ts.map +1 -0
- package/dist/CommentPin.svelte +219 -0
- package/dist/CommentPin.svelte.d.ts +26 -0
- package/dist/CommentPin.svelte.d.ts.map +1 -0
- package/dist/CommentThread.svelte +801 -0
- package/dist/CommentThread.svelte.d.ts +42 -0
- package/dist/CommentThread.svelte.d.ts.map +1 -0
- package/dist/DiagramCard.svelte +14 -4
- package/dist/DiagramCard.svelte.d.ts.map +1 -1
- package/dist/DiagramCardHeader.svelte +14 -2
- package/dist/DiagramCardHeader.svelte.d.ts +2 -0
- package/dist/DiagramCardHeader.svelte.d.ts.map +1 -1
- package/dist/DiagramSceneFigure.svelte +24 -3
- package/dist/DiagramSceneFigure.svelte.d.ts +1 -1
- package/dist/DiagramSceneFigure.svelte.d.ts.map +1 -1
- package/dist/DiagramZone.svelte +31 -13
- package/dist/DiagramZone.svelte.d.ts.map +1 -1
- package/dist/DiagramZoneHeader.svelte +1 -0
- package/dist/Drawer.svelte +96 -4
- package/dist/Drawer.svelte.d.ts.map +1 -1
- package/dist/OrphanList.svelte +267 -0
- package/dist/OrphanList.svelte.d.ts +18 -0
- package/dist/OrphanList.svelte.d.ts.map +1 -0
- package/dist/ReviewModeToggle.svelte +110 -0
- package/dist/ReviewModeToggle.svelte.d.ts +19 -0
- package/dist/ReviewModeToggle.svelte.d.ts.map +1 -0
- package/dist/ThreadPanel.svelte +654 -0
- package/dist/ThreadPanel.svelte.d.ts +42 -0
- package/dist/ThreadPanel.svelte.d.ts.map +1 -0
- package/dist/diagram-render/renderCardSvg.js +1 -1
- package/dist/diagram-render/renderZoneSvg.js +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/review-markdown.d.ts +90 -0
- package/dist/review-markdown.d.ts.map +1 -0
- package/dist/review-markdown.js +379 -0
- package/package.json +5 -4
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type {
|
|
4
|
+
CollaborationActor,
|
|
5
|
+
ReviewThread,
|
|
6
|
+
ThreadReadState,
|
|
7
|
+
} from "@sentropic/design-system-review-core";
|
|
8
|
+
|
|
9
|
+
export type OrphanListProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
10
|
+
threads: readonly ReviewThread[];
|
|
11
|
+
currentUser: CollaborationActor;
|
|
12
|
+
readState?: ThreadReadState | null;
|
|
13
|
+
heading?: string;
|
|
14
|
+
class?: string;
|
|
15
|
+
onSelect?: (threadId: string) => void;
|
|
16
|
+
/** Optional re-anchor action; button is hidden when unbound (SPEC-r6 §2, §3). */
|
|
17
|
+
onReanchor?: (threadId: string) => void | Promise<void>;
|
|
18
|
+
onResolve?: (threadId: string) => void | Promise<void>;
|
|
19
|
+
onReopen?: (threadId: string) => void | Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import { Unlink } from "@lucide/svelte";
|
|
25
|
+
import {
|
|
26
|
+
getCommentStateLabel,
|
|
27
|
+
isUnread,
|
|
28
|
+
} from "@sentropic/design-system-review-core";
|
|
29
|
+
import Badge from "./Badge.svelte";
|
|
30
|
+
import Button from "./Button.svelte";
|
|
31
|
+
import CommentAuthorship from "./CommentAuthorship.svelte";
|
|
32
|
+
import EmptyState from "./EmptyState.svelte";
|
|
33
|
+
import { formatAnchorLabel, formatReviewError } from "./review-markdown.js";
|
|
34
|
+
|
|
35
|
+
let {
|
|
36
|
+
threads,
|
|
37
|
+
currentUser,
|
|
38
|
+
readState = null,
|
|
39
|
+
heading = "No longer attached",
|
|
40
|
+
class: className,
|
|
41
|
+
onSelect,
|
|
42
|
+
onReanchor,
|
|
43
|
+
onResolve,
|
|
44
|
+
onReopen,
|
|
45
|
+
...rest
|
|
46
|
+
}: OrphanListProps = $props();
|
|
47
|
+
|
|
48
|
+
let actionError = $state<string | null>(null);
|
|
49
|
+
let pendingId = $state<string | null>(null);
|
|
50
|
+
|
|
51
|
+
const uid = $props.id();
|
|
52
|
+
const headingId = `st-review-orphans-heading-${uid}`;
|
|
53
|
+
const classes = $derived(["st-review-orphans", className].filter(Boolean).join(" "));
|
|
54
|
+
|
|
55
|
+
async function runThreadAction(
|
|
56
|
+
threadId: string,
|
|
57
|
+
fn: ((id: string) => void | Promise<void>) | undefined,
|
|
58
|
+
) {
|
|
59
|
+
if (!fn || pendingId !== null) return;
|
|
60
|
+
actionError = null;
|
|
61
|
+
pendingId = threadId;
|
|
62
|
+
try {
|
|
63
|
+
await fn(threadId);
|
|
64
|
+
} catch (err) {
|
|
65
|
+
actionError = formatReviewError(err);
|
|
66
|
+
} finally {
|
|
67
|
+
pendingId = null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<section {...rest} class={classes} aria-labelledby={headingId}>
|
|
73
|
+
<header class="st-review-orphans__header">
|
|
74
|
+
<h3 id={headingId} class="st-review-orphans__heading">
|
|
75
|
+
<Unlink size={14} strokeWidth={2} aria-hidden="true" />
|
|
76
|
+
<span>{heading}</span>
|
|
77
|
+
</h3>
|
|
78
|
+
<Badge size="sm" tone="warning" class="st-review-orphans__count">
|
|
79
|
+
{threads.length}
|
|
80
|
+
</Badge>
|
|
81
|
+
</header>
|
|
82
|
+
|
|
83
|
+
{#if actionError}
|
|
84
|
+
<div class="st-review-orphans__error" role="alert">
|
|
85
|
+
{actionError}
|
|
86
|
+
</div>
|
|
87
|
+
{/if}
|
|
88
|
+
|
|
89
|
+
{#if threads.length === 0}
|
|
90
|
+
<EmptyState
|
|
91
|
+
title="No unattached threads"
|
|
92
|
+
message="All comment threads are currently anchored to the document."
|
|
93
|
+
/>
|
|
94
|
+
{:else}
|
|
95
|
+
<ul class="st-review-orphans__list">
|
|
96
|
+
{#each threads as thread (thread.threadId)}
|
|
97
|
+
{@const rootComment = thread.comments[0]}
|
|
98
|
+
{@const unread = isUnread(thread, currentUser, readState)}
|
|
99
|
+
{@const stateLabel = getCommentStateLabel(thread.state)}
|
|
100
|
+
{@const excerpt =
|
|
101
|
+
thread.anchor !== null
|
|
102
|
+
? formatAnchorLabel(thread.anchor, 100)
|
|
103
|
+
: "Original location removed"}
|
|
104
|
+
|
|
105
|
+
<li
|
|
106
|
+
class="st-review-orphans__item"
|
|
107
|
+
class:st-review-orphans__item--unread={unread}
|
|
108
|
+
data-thread-id={thread.threadId}
|
|
109
|
+
data-thread-state={thread.state}
|
|
110
|
+
data-unread={unread ? "true" : "false"}
|
|
111
|
+
>
|
|
112
|
+
<div class="st-review-orphans__item-top">
|
|
113
|
+
{#if rootComment}
|
|
114
|
+
<CommentAuthorship
|
|
115
|
+
author={rootComment.authorship.author}
|
|
116
|
+
sponsor={rootComment.authorship.sponsor}
|
|
117
|
+
size="sm"
|
|
118
|
+
/>
|
|
119
|
+
{/if}
|
|
120
|
+
<Badge
|
|
121
|
+
size="sm"
|
|
122
|
+
tone={thread.state === "closed" ? "success" : "info"}
|
|
123
|
+
>
|
|
124
|
+
{stateLabel}
|
|
125
|
+
</Badge>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<p class="st-review-orphans__excerpt">{excerpt}</p>
|
|
129
|
+
|
|
130
|
+
{#if rootComment}
|
|
131
|
+
<p class="st-review-orphans__preview">{rootComment.body}</p>
|
|
132
|
+
{/if}
|
|
133
|
+
|
|
134
|
+
<div class="st-review-orphans__actions">
|
|
135
|
+
{#if onSelect}
|
|
136
|
+
<Button
|
|
137
|
+
type="button"
|
|
138
|
+
variant="secondary"
|
|
139
|
+
size="sm"
|
|
140
|
+
aria-label={`Open thread ${thread.threadId}`}
|
|
141
|
+
onclick={() => onSelect(thread.threadId)}
|
|
142
|
+
>
|
|
143
|
+
Open ({thread.comments.length})
|
|
144
|
+
</Button>
|
|
145
|
+
{/if}
|
|
146
|
+
{#if onReanchor}
|
|
147
|
+
<Button
|
|
148
|
+
type="button"
|
|
149
|
+
variant="ghost"
|
|
150
|
+
size="sm"
|
|
151
|
+
disabled={pendingId === thread.threadId}
|
|
152
|
+
onclick={() => runThreadAction(thread.threadId, onReanchor)}
|
|
153
|
+
>
|
|
154
|
+
Re-anchor
|
|
155
|
+
</Button>
|
|
156
|
+
{/if}
|
|
157
|
+
{#if thread.state === "open" && onResolve}
|
|
158
|
+
<Button
|
|
159
|
+
type="button"
|
|
160
|
+
variant="ghost"
|
|
161
|
+
size="sm"
|
|
162
|
+
disabled={pendingId === thread.threadId}
|
|
163
|
+
onclick={() => runThreadAction(thread.threadId, onResolve)}
|
|
164
|
+
>
|
|
165
|
+
Resolve
|
|
166
|
+
</Button>
|
|
167
|
+
{:else if thread.state === "closed" && onReopen}
|
|
168
|
+
<Button
|
|
169
|
+
type="button"
|
|
170
|
+
variant="ghost"
|
|
171
|
+
size="sm"
|
|
172
|
+
disabled={pendingId === thread.threadId}
|
|
173
|
+
onclick={() => runThreadAction(thread.threadId, onReopen)}
|
|
174
|
+
>
|
|
175
|
+
Reopen
|
|
176
|
+
</Button>
|
|
177
|
+
{/if}
|
|
178
|
+
</div>
|
|
179
|
+
</li>
|
|
180
|
+
{/each}
|
|
181
|
+
</ul>
|
|
182
|
+
{/if}
|
|
183
|
+
</section>
|
|
184
|
+
|
|
185
|
+
<style>
|
|
186
|
+
.st-review-orphans {
|
|
187
|
+
display: grid;
|
|
188
|
+
gap: var(--st-spacing-2, 0.5rem);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.st-review-orphans__header {
|
|
192
|
+
align-items: center;
|
|
193
|
+
display: flex;
|
|
194
|
+
gap: var(--st-spacing-2, 0.5rem);
|
|
195
|
+
justify-content: space-between;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.st-review-orphans__heading {
|
|
199
|
+
align-items: center;
|
|
200
|
+
color: var(--st-semantic-text-secondary);
|
|
201
|
+
display: inline-flex;
|
|
202
|
+
font-size: 0.8125rem;
|
|
203
|
+
font-weight: 600;
|
|
204
|
+
gap: var(--st-spacing-1, 0.25rem);
|
|
205
|
+
margin: 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.st-review-orphans__error {
|
|
209
|
+
background: color-mix(in srgb, var(--st-semantic-feedback-danger, #b91c1c) 10%, white);
|
|
210
|
+
border: 1px solid var(--st-semantic-feedback-danger, #b91c1c);
|
|
211
|
+
border-radius: var(--st-radius-sm, 0.375rem);
|
|
212
|
+
color: var(--st-semantic-feedback-danger, #b91c1c);
|
|
213
|
+
font-size: 0.8125rem;
|
|
214
|
+
padding: var(--st-spacing-2, 0.5rem);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.st-review-orphans__list {
|
|
218
|
+
display: grid;
|
|
219
|
+
gap: var(--st-spacing-2, 0.5rem);
|
|
220
|
+
list-style: none;
|
|
221
|
+
margin: 0;
|
|
222
|
+
padding: 0;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.st-review-orphans__item {
|
|
226
|
+
background: var(--st-semantic-surface-raised, #ffffff);
|
|
227
|
+
border: 1px solid var(--st-semantic-border-subtle);
|
|
228
|
+
border-radius: var(--st-radius-md, 0.5rem);
|
|
229
|
+
display: grid;
|
|
230
|
+
gap: var(--st-spacing-2, 0.5rem);
|
|
231
|
+
padding: var(--st-spacing-3, 0.75rem);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.st-review-orphans__item--unread {
|
|
235
|
+
border-color: var(--st-semantic-border-interactive, #2563eb);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.st-review-orphans__item-top {
|
|
239
|
+
align-items: flex-start;
|
|
240
|
+
display: flex;
|
|
241
|
+
gap: var(--st-spacing-2, 0.5rem);
|
|
242
|
+
justify-content: space-between;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.st-review-orphans__excerpt {
|
|
246
|
+
color: var(--st-semantic-text-secondary);
|
|
247
|
+
font-size: 0.75rem;
|
|
248
|
+
font-style: italic;
|
|
249
|
+
margin: 0;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.st-review-orphans__preview {
|
|
253
|
+
color: var(--st-semantic-text-primary);
|
|
254
|
+
font-size: 0.8125rem;
|
|
255
|
+
line-height: 1.45;
|
|
256
|
+
margin: 0;
|
|
257
|
+
overflow: hidden;
|
|
258
|
+
text-overflow: ellipsis;
|
|
259
|
+
white-space: nowrap;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.st-review-orphans__actions {
|
|
263
|
+
display: flex;
|
|
264
|
+
flex-wrap: wrap;
|
|
265
|
+
gap: var(--st-spacing-1, 0.25rem);
|
|
266
|
+
}
|
|
267
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
import type { CollaborationActor, ReviewThread, ThreadReadState } from "@sentropic/design-system-review-core";
|
|
3
|
+
export type OrphanListProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
4
|
+
threads: readonly ReviewThread[];
|
|
5
|
+
currentUser: CollaborationActor;
|
|
6
|
+
readState?: ThreadReadState | null;
|
|
7
|
+
heading?: string;
|
|
8
|
+
class?: string;
|
|
9
|
+
onSelect?: (threadId: string) => void;
|
|
10
|
+
/** Optional re-anchor action; button is hidden when unbound (SPEC-r6 §2, §3). */
|
|
11
|
+
onReanchor?: (threadId: string) => void | Promise<void>;
|
|
12
|
+
onResolve?: (threadId: string) => void | Promise<void>;
|
|
13
|
+
onReopen?: (threadId: string) => void | Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
declare const OrphanList: import("svelte").Component<OrphanListProps, {}, "">;
|
|
16
|
+
type OrphanList = ReturnType<typeof OrphanList>;
|
|
17
|
+
export default OrphanList;
|
|
18
|
+
//# sourceMappingURL=OrphanList.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrphanList.svelte.d.ts","sourceRoot":"","sources":["../src/lib/OrphanList.svelte.ts"],"names":[],"mappings":"AAGE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,eAAe,EAChB,MAAM,sCAAsC,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IACzE,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IACjC,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,iFAAiF;IACjF,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC;AA2IJ,QAAA,MAAM,UAAU,qDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
3
|
+
import type { ReviewMode } from "./CommentLayer.svelte";
|
|
4
|
+
|
|
5
|
+
export type ReviewModeToggleProps = Omit<
|
|
6
|
+
HTMLButtonAttributes,
|
|
7
|
+
"class" | "type" | "disabled" | "aria-pressed"
|
|
8
|
+
> & {
|
|
9
|
+
/** Current host-controlled mode (`"view"` or `"review"`). */
|
|
10
|
+
mode?: ReviewMode;
|
|
11
|
+
/** Number of open comment threads shown beside the label (e.g. "Review · 3"). */
|
|
12
|
+
openCount?: number;
|
|
13
|
+
/** Number of unread threads for the current user. */
|
|
14
|
+
unreadCount?: number;
|
|
15
|
+
/** Visible toggle label (default "Review"). */
|
|
16
|
+
label?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
class?: string;
|
|
19
|
+
onModeChange?: (mode: ReviewMode) => void;
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import { MessageSquare } from "@lucide/svelte";
|
|
25
|
+
import Badge from "./Badge.svelte";
|
|
26
|
+
import Button from "./Button.svelte";
|
|
27
|
+
|
|
28
|
+
let {
|
|
29
|
+
mode = "view",
|
|
30
|
+
openCount = 0,
|
|
31
|
+
unreadCount = 0,
|
|
32
|
+
label = "Review",
|
|
33
|
+
disabled = false,
|
|
34
|
+
class: className,
|
|
35
|
+
onModeChange,
|
|
36
|
+
onclick,
|
|
37
|
+
...rest
|
|
38
|
+
}: ReviewModeToggleProps = $props();
|
|
39
|
+
|
|
40
|
+
const isReview = $derived(mode === "review");
|
|
41
|
+
|
|
42
|
+
const ariaLabel = $derived.by(() => {
|
|
43
|
+
const parts = [label];
|
|
44
|
+
if (openCount > 0) parts.push(`${openCount} open`);
|
|
45
|
+
if (unreadCount > 0) parts.push(`${unreadCount} unread`);
|
|
46
|
+
return parts.join(", ");
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const classes = $derived(
|
|
50
|
+
[
|
|
51
|
+
"st-review-toggle",
|
|
52
|
+
isReview ? "st-review-toggle--active" : undefined,
|
|
53
|
+
className,
|
|
54
|
+
]
|
|
55
|
+
.filter(Boolean)
|
|
56
|
+
.join(" "),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
function handleClick(event: MouseEvent & { currentTarget: EventTarget & HTMLButtonElement }) {
|
|
60
|
+
onclick?.(event);
|
|
61
|
+
if (disabled) return;
|
|
62
|
+
onModeChange?.(isReview ? "view" : "review");
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<Button
|
|
67
|
+
{...rest}
|
|
68
|
+
type="button"
|
|
69
|
+
variant={isReview ? "primary" : "secondary"}
|
|
70
|
+
size="sm"
|
|
71
|
+
class={classes}
|
|
72
|
+
{disabled}
|
|
73
|
+
aria-pressed={isReview ? "true" : "false"}
|
|
74
|
+
aria-label={ariaLabel}
|
|
75
|
+
data-review-mode={mode}
|
|
76
|
+
onclick={handleClick}
|
|
77
|
+
>
|
|
78
|
+
<MessageSquare size={15} strokeWidth={2} aria-hidden="true" />
|
|
79
|
+
<span class="st-review-toggle__label">
|
|
80
|
+
{label}{#if openCount > 0}<span class="st-review-toggle__count"> · {openCount}</span>{/if}
|
|
81
|
+
</span>
|
|
82
|
+
{#if unreadCount > 0}
|
|
83
|
+
<Badge
|
|
84
|
+
size="sm"
|
|
85
|
+
shape="circle"
|
|
86
|
+
tone="info"
|
|
87
|
+
class="st-review-toggle__unread"
|
|
88
|
+
aria-hidden="true"
|
|
89
|
+
>
|
|
90
|
+
{unreadCount}
|
|
91
|
+
</Badge>
|
|
92
|
+
{/if}
|
|
93
|
+
</Button>
|
|
94
|
+
|
|
95
|
+
<style>
|
|
96
|
+
:global(.st-review-toggle) {
|
|
97
|
+
gap: var(--st-component-review-toggle-gap, var(--st-spacing-2, 0.5rem));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.st-review-toggle__label {
|
|
101
|
+
align-items: center;
|
|
102
|
+
display: inline-flex;
|
|
103
|
+
font-variant-numeric: tabular-nums;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.st-review-toggle__count {
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
opacity: 0.9;
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
2
|
+
import type { ReviewMode } from "./CommentLayer.svelte";
|
|
3
|
+
export type ReviewModeToggleProps = Omit<HTMLButtonAttributes, "class" | "type" | "disabled" | "aria-pressed"> & {
|
|
4
|
+
/** Current host-controlled mode (`"view"` or `"review"`). */
|
|
5
|
+
mode?: ReviewMode;
|
|
6
|
+
/** Number of open comment threads shown beside the label (e.g. "Review · 3"). */
|
|
7
|
+
openCount?: number;
|
|
8
|
+
/** Number of unread threads for the current user. */
|
|
9
|
+
unreadCount?: number;
|
|
10
|
+
/** Visible toggle label (default "Review"). */
|
|
11
|
+
label?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
class?: string;
|
|
14
|
+
onModeChange?: (mode: ReviewMode) => void;
|
|
15
|
+
};
|
|
16
|
+
declare const ReviewModeToggle: import("svelte").Component<ReviewModeToggleProps, {}, "">;
|
|
17
|
+
type ReviewModeToggle = ReturnType<typeof ReviewModeToggle>;
|
|
18
|
+
export default ReviewModeToggle;
|
|
19
|
+
//# sourceMappingURL=ReviewModeToggle.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReviewModeToggle.svelte.d.ts","sourceRoot":"","sources":["../src/lib/ReviewModeToggle.svelte.ts"],"names":[],"mappings":"AAGE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,oBAAoB,EACpB,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,cAAc,CAC/C,GAAG;IACF,6DAA6D;IAC7D,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CAC3C,CAAC;AAoEJ,QAAA,MAAM,gBAAgB,2DAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|