@joewinke/jatui 0.2.6 → 0.2.7
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/CLAUDE.md
CHANGED
|
@@ -108,7 +108,7 @@ Then import:
|
|
|
108
108
|
| `MarkupOverlay` | Read-only canvas layer that renders saved `MarkupShape[]` over an image | `shapes: MarkupShape[]`, `imageUrl` |
|
|
109
109
|
| `ImageLightbox` | Inline image viewer with fullscreen modal, zoom controls, optional markup + annotation overlays | `imageUrl`, `filename?`, `markupShapes?`, `annotations?`, `activeAnnotationId?`, `annotationMode?`, `showResolved?` (forwarded to the internal `AnnotationLayer`; default false), `onAnnotationClick?`, `onImageClick?`, `onClose?` |
|
|
110
110
|
| `AnnotationLayer` | Absolute-positioned pin overlay — renders threaded annotation pins at `x_percent`/`y_percent` coordinates | `annotations: Annotation[]`, `activeAnnotationId?`, `annotationMode?`, `showResolved?`, `onAnnotationClick?`, `onImageClick?` |
|
|
111
|
-
| `AnnotationPanel` | Sidebar thread list for annotations — reply, resolve, edit, delete. Uses callback props for async ops. | `annotations`, `profiles`, `activeAnnotationId?`, `currentUserId`, `callbacks: AnnotationCallbacks`, `readOnly?` (
|
|
111
|
+
| `AnnotationPanel` | Sidebar thread list for annotations — reply, resolve, edit, delete. Uses callback props for async ops. | `annotations`, `profiles`, `activeAnnotationId?`, `currentUserId`, `callbacks: AnnotationCallbacks`, `readOnly?`, `title?` (panel heading, default "Annotations"; pass "Comments" to match host vocabulary), `emptyText?` (empty-state line, default "No annotations yet"), `onAnnotationSelect?`, `onAnnotationsChanged?` |
|
|
112
112
|
|
|
113
113
|
**Types & utilities:**
|
|
114
114
|
```typescript
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
callbacks: AnnotationCallbacks
|
|
10
10
|
/** Hides reply/resolve/edit/delete affordances — thread list stays readable */
|
|
11
11
|
readOnly?: boolean
|
|
12
|
+
/** Panel heading. Defaults to "Annotations"; pass e.g. "Comments" to match host vocabulary. */
|
|
13
|
+
title?: string
|
|
14
|
+
/** Empty-state line. Defaults to "No annotations yet". */
|
|
15
|
+
emptyText?: string
|
|
12
16
|
onAnnotationSelect?: (annotation: Annotation | null) => void
|
|
13
17
|
onAnnotationsChanged?: () => void
|
|
14
18
|
}
|
|
@@ -20,6 +24,8 @@
|
|
|
20
24
|
currentUserId,
|
|
21
25
|
callbacks,
|
|
22
26
|
readOnly = false,
|
|
27
|
+
title = "Annotations",
|
|
28
|
+
emptyText = "No annotations yet",
|
|
23
29
|
onAnnotationSelect,
|
|
24
30
|
onAnnotationsChanged,
|
|
25
31
|
}: Props = $props()
|
|
@@ -135,7 +141,7 @@
|
|
|
135
141
|
<!-- Header -->
|
|
136
142
|
<div class="flex items-center justify-between px-3 py-2 border-b border-base-300 flex-shrink-0">
|
|
137
143
|
<div class="flex items-center gap-2">
|
|
138
|
-
<h4 class="text-sm font-semibold">
|
|
144
|
+
<h4 class="text-sm font-semibold">{title}</h4>
|
|
139
145
|
{#if totalRoots > 0}
|
|
140
146
|
<span class="badge badge-xs badge-ghost">{totalRoots - resolvedCount} open</span>
|
|
141
147
|
{/if}
|
|
@@ -159,7 +165,7 @@
|
|
|
159
165
|
<svg class="mx-auto h-10 w-10 text-base-content/20" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
160
166
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z" />
|
|
161
167
|
</svg>
|
|
162
|
-
<p class="text-sm text-base-content/40 mt-2">
|
|
168
|
+
<p class="text-sm text-base-content/40 mt-2">{emptyText}</p>
|
|
163
169
|
<p class="text-xs text-base-content/30 mt-1">Click the pin icon then click on the image to add one</p>
|
|
164
170
|
</div>
|
|
165
171
|
{:else}
|
|
@@ -7,6 +7,10 @@ interface Props {
|
|
|
7
7
|
callbacks: AnnotationCallbacks;
|
|
8
8
|
/** Hides reply/resolve/edit/delete affordances — thread list stays readable */
|
|
9
9
|
readOnly?: boolean;
|
|
10
|
+
/** Panel heading. Defaults to "Annotations"; pass e.g. "Comments" to match host vocabulary. */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** Empty-state line. Defaults to "No annotations yet". */
|
|
13
|
+
emptyText?: string;
|
|
10
14
|
onAnnotationSelect?: (annotation: Annotation | null) => void;
|
|
11
15
|
onAnnotationsChanged?: () => void;
|
|
12
16
|
}
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
disabled = false,
|
|
26
26
|
displayValue,
|
|
27
27
|
colorFn,
|
|
28
|
+
header,
|
|
28
29
|
footer,
|
|
29
30
|
variant = 'default',
|
|
30
31
|
size = 'md',
|
|
@@ -41,6 +42,8 @@
|
|
|
41
42
|
disabled?: boolean;
|
|
42
43
|
displayValue?: string;
|
|
43
44
|
colorFn?: (value: string) => string | undefined;
|
|
45
|
+
/** Rendered above the search input — use for panel titles, descriptions, or controls */
|
|
46
|
+
header?: Snippet;
|
|
44
47
|
footer?: Snippet;
|
|
45
48
|
/** 'chip' renders a compact TopBar-style pill instead of the full-width trigger */
|
|
46
49
|
variant?: 'default' | 'chip';
|
|
@@ -197,6 +200,11 @@
|
|
|
197
200
|
</script>
|
|
198
201
|
|
|
199
202
|
{#snippet panelBody()}
|
|
203
|
+
{#if header}
|
|
204
|
+
<div class="sd-header">
|
|
205
|
+
{@render header()}
|
|
206
|
+
</div>
|
|
207
|
+
{/if}
|
|
200
208
|
<!-- Search input -->
|
|
201
209
|
<div class="sd-search">
|
|
202
210
|
<div class="sd-search-inner">
|
|
@@ -525,6 +533,11 @@
|
|
|
525
533
|
box-shadow: 0 -4px 24px oklch(0 0 0 / 0.4);
|
|
526
534
|
}
|
|
527
535
|
|
|
536
|
+
/* Header section */
|
|
537
|
+
.sd-header {
|
|
538
|
+
border-bottom: 1px solid oklch(0.25 0.02 250);
|
|
539
|
+
}
|
|
540
|
+
|
|
528
541
|
/* Search section */
|
|
529
542
|
.sd-search {
|
|
530
543
|
padding: 0.375rem 0.5rem;
|
|
@@ -16,6 +16,8 @@ type $$ComponentProps = {
|
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
displayValue?: string;
|
|
18
18
|
colorFn?: (value: string) => string | undefined;
|
|
19
|
+
/** Rendered above the search input — use for panel titles, descriptions, or controls */
|
|
20
|
+
header?: Snippet;
|
|
19
21
|
footer?: Snippet;
|
|
20
22
|
/** 'chip' renders a compact TopBar-style pill instead of the full-width trigger */
|
|
21
23
|
variant?: 'default' | 'chip';
|