@r2digisolutions/components 0.24.9 → 0.25.0
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/components/atoms/AnalysisBadge/AnalysisBadge.svelte +38 -0
- package/dist/components/atoms/AnalysisBadge/AnalysisBadge.svelte.d.ts +10 -0
- package/dist/components/molecules/ClassificationSuggestion/ClassificationSuggestion.svelte +67 -0
- package/dist/components/molecules/ClassificationSuggestion/ClassificationSuggestion.svelte.d.ts +35 -0
- package/dist/components/molecules/SuggestedTags/SuggestedTags.svelte +57 -0
- package/dist/components/molecules/SuggestedTags/SuggestedTags.svelte.d.ts +35 -0
- package/dist/components/organisms/MapExplorer/MapExplorer.svelte +6 -0
- package/dist/components/organisms/MediaAnalysisPanel/MediaAnalysisPanel.stories.d.ts +22 -0
- package/dist/components/organisms/MediaAnalysisPanel/MediaAnalysisPanel.stories.js +17 -0
- package/dist/components/organisms/MediaAnalysisPanel/MediaAnalysisPanel.svelte +115 -0
- package/dist/components/organisms/MediaAnalysisPanel/MediaAnalysisPanel.svelte.d.ts +54 -0
- package/dist/components/organisms/MediaAnalysisPanel/MediaAnalysisPanelStory.svelte +54 -0
- package/dist/components/organisms/MediaAnalysisPanel/MediaAnalysisPanelStory.svelte.d.ts +7 -0
- package/dist/components/organisms/ModerationReviewPanel/ModerationReviewPanel.stories.d.ts +12 -0
- package/dist/components/organisms/ModerationReviewPanel/ModerationReviewPanel.stories.js +9 -0
- package/dist/components/organisms/ModerationReviewPanel/ModerationReviewPanel.svelte +125 -0
- package/dist/components/organisms/ModerationReviewPanel/ModerationReviewPanel.svelte.d.ts +44 -0
- package/dist/components/organisms/ModerationReviewPanel/ModerationReviewPanelStory.svelte +90 -0
- package/dist/components/organisms/ModerationReviewPanel/ModerationReviewPanelStory.svelte.d.ts +3 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +5 -0
- package/dist/styles.css +9 -0
- package/package.json +14 -14
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
export type AnalysisStatus = 'idle' | 'queued' | 'processing' | 'complete' | 'failed';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import Badge from '../Badge/Badge.svelte';
|
|
7
|
+
|
|
8
|
+
interface AnalysisBadgeProps {
|
|
9
|
+
status: AnalysisStatus;
|
|
10
|
+
labels?: Partial<Record<AnalysisStatus, string>>;
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { status, labels = {}, size = 'md', class: className = '' }: AnalysisBadgeProps = $props();
|
|
16
|
+
|
|
17
|
+
const defaultLabels: Record<AnalysisStatus, string> = {
|
|
18
|
+
idle: 'Not analyzed',
|
|
19
|
+
queued: 'Queued',
|
|
20
|
+
processing: 'Analyzing',
|
|
21
|
+
complete: 'Complete',
|
|
22
|
+
failed: 'Failed'
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const variants = {
|
|
26
|
+
idle: 'default',
|
|
27
|
+
queued: 'secondary',
|
|
28
|
+
processing: 'info',
|
|
29
|
+
complete: 'success',
|
|
30
|
+
failed: 'error'
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
const label = $derived(labels[status] ?? defaultLabels[status]);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<span class={className} role="status" aria-live={status === 'processing' ? 'polite' : 'off'}>
|
|
37
|
+
<Badge variant={variants[status]} {size} rounded dot>{label}</Badge>
|
|
38
|
+
</span>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type AnalysisStatus = 'idle' | 'queued' | 'processing' | 'complete' | 'failed';
|
|
2
|
+
interface AnalysisBadgeProps {
|
|
3
|
+
status: AnalysisStatus;
|
|
4
|
+
labels?: Partial<Record<AnalysisStatus, string>>;
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const AnalysisBadge: import("svelte").Component<AnalysisBadgeProps, {}, "">;
|
|
9
|
+
type AnalysisBadge = ReturnType<typeof AnalysisBadge>;
|
|
10
|
+
export default AnalysisBadge;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="ts" generics="T">
|
|
2
|
+
import ProgressBar from '../../atoms/ProgressBar/ProgressBar.svelte';
|
|
3
|
+
|
|
4
|
+
interface ClassificationSuggestionProps {
|
|
5
|
+
items?: readonly T[];
|
|
6
|
+
getKey: (item: T) => string;
|
|
7
|
+
getLabel: (item: T) => string;
|
|
8
|
+
getConfidence: (item: T) => number;
|
|
9
|
+
selectedKey?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
empty?: string;
|
|
12
|
+
confidenceLabel?: (confidence: number) => string;
|
|
13
|
+
onselect?: (item: T) => void;
|
|
14
|
+
class?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
items = [],
|
|
19
|
+
getKey,
|
|
20
|
+
getLabel,
|
|
21
|
+
getConfidence,
|
|
22
|
+
selectedKey,
|
|
23
|
+
disabled = false,
|
|
24
|
+
empty = 'No classifications',
|
|
25
|
+
confidenceLabel = (confidence) => `${Math.round(confidence * 100)}%`,
|
|
26
|
+
onselect,
|
|
27
|
+
class: className = ''
|
|
28
|
+
}: ClassificationSuggestionProps = $props();
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
{#if items.length > 0}
|
|
32
|
+
<ul class={['space-y-2', className]} aria-label="Classification suggestions">
|
|
33
|
+
{#each items as item (getKey(item))}
|
|
34
|
+
{@const key = getKey(item)}
|
|
35
|
+
{@const confidence = getConfidence(item)}
|
|
36
|
+
<li>
|
|
37
|
+
<button
|
|
38
|
+
type="button"
|
|
39
|
+
class={[
|
|
40
|
+
'rounded-xl px-3 py-2.5 focus-visible:ring-brand-500/40 w-full border text-left transition-colors focus-visible:ring-2 focus-visible:outline-none',
|
|
41
|
+
selectedKey === key
|
|
42
|
+
? 'border-border-strong bg-surface-overlay ring-border-strong ring-1'
|
|
43
|
+
: 'border-border bg-surface-elevated hover:bg-surface-overlay',
|
|
44
|
+
disabled || !onselect ? 'cursor-default' : 'cursor-pointer',
|
|
45
|
+
disabled && 'opacity-50'
|
|
46
|
+
]}
|
|
47
|
+
disabled={disabled || !onselect}
|
|
48
|
+
aria-pressed={onselect ? selectedKey === key : undefined}
|
|
49
|
+
onclick={() => onselect?.(item)}
|
|
50
|
+
>
|
|
51
|
+
<span class="mb-1.5 gap-3 text-sm flex items-center justify-between">
|
|
52
|
+
<span class="min-w-0 font-medium text-primary truncate">{getLabel(item)}</span>
|
|
53
|
+
<span class="font-mono text-xs text-muted shrink-0">{confidenceLabel(confidence)}</span>
|
|
54
|
+
</span>
|
|
55
|
+
<ProgressBar
|
|
56
|
+
value={confidence}
|
|
57
|
+
max={1}
|
|
58
|
+
size="sm"
|
|
59
|
+
label={`${getLabel(item)} confidence`}
|
|
60
|
+
/>
|
|
61
|
+
</button>
|
|
62
|
+
</li>
|
|
63
|
+
{/each}
|
|
64
|
+
</ul>
|
|
65
|
+
{:else}
|
|
66
|
+
<p class={['text-sm text-muted', className]}>{empty}</p>
|
|
67
|
+
{/if}
|
package/dist/components/molecules/ClassificationSuggestion/ClassificationSuggestion.svelte.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare function $$render<T>(): {
|
|
2
|
+
props: {
|
|
3
|
+
items?: readonly T[];
|
|
4
|
+
getKey: (item: T) => string;
|
|
5
|
+
getLabel: (item: T) => string;
|
|
6
|
+
getConfidence: (item: T) => number;
|
|
7
|
+
selectedKey?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
empty?: string;
|
|
10
|
+
confidenceLabel?: (confidence: number) => string;
|
|
11
|
+
onselect?: (item: T) => void;
|
|
12
|
+
class?: string;
|
|
13
|
+
};
|
|
14
|
+
exports: {};
|
|
15
|
+
bindings: "";
|
|
16
|
+
slots: {};
|
|
17
|
+
events: {};
|
|
18
|
+
};
|
|
19
|
+
declare class __sveltets_Render<T> {
|
|
20
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
21
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
22
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
23
|
+
bindings(): "";
|
|
24
|
+
exports(): {};
|
|
25
|
+
}
|
|
26
|
+
interface $$IsomorphicComponent {
|
|
27
|
+
new <T>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
28
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
29
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
30
|
+
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
31
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
32
|
+
}
|
|
33
|
+
declare const ClassificationSuggestion: $$IsomorphicComponent;
|
|
34
|
+
type ClassificationSuggestion<T> = InstanceType<typeof ClassificationSuggestion<T>>;
|
|
35
|
+
export default ClassificationSuggestion;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script lang="ts" generics="T">
|
|
2
|
+
import Chip from '../../atoms/Chip/Chip.svelte';
|
|
3
|
+
|
|
4
|
+
interface SuggestedTagsProps {
|
|
5
|
+
items?: readonly T[];
|
|
6
|
+
getKey: (item: T) => string;
|
|
7
|
+
getLabel: (item: T) => string;
|
|
8
|
+
getConfidence?: (item: T) => number | undefined;
|
|
9
|
+
selectedKeys?: readonly string[];
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
empty?: string;
|
|
12
|
+
confidenceLabel?: (confidence: number) => string;
|
|
13
|
+
onselectionchange?: (item: T, selected: boolean) => void;
|
|
14
|
+
class?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
items = [],
|
|
19
|
+
getKey,
|
|
20
|
+
getLabel,
|
|
21
|
+
getConfidence,
|
|
22
|
+
selectedKeys = [],
|
|
23
|
+
disabled = false,
|
|
24
|
+
empty = 'No suggested tags',
|
|
25
|
+
confidenceLabel = (confidence) => `${Math.round(confidence * 100)}%`,
|
|
26
|
+
onselectionchange,
|
|
27
|
+
class: className = ''
|
|
28
|
+
}: SuggestedTagsProps = $props();
|
|
29
|
+
|
|
30
|
+
const selected = $derived(new Set(selectedKeys));
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
{#if items.length > 0}
|
|
34
|
+
<ul class={['gap-2 flex flex-wrap', className]} aria-label="Suggested tags">
|
|
35
|
+
{#each items as item (getKey(item))}
|
|
36
|
+
{@const key = getKey(item)}
|
|
37
|
+
{@const confidence = getConfidence?.(item)}
|
|
38
|
+
<li>
|
|
39
|
+
<Chip
|
|
40
|
+
variant="default"
|
|
41
|
+
selected={selected.has(key)}
|
|
42
|
+
{disabled}
|
|
43
|
+
onclick={onselectionchange
|
|
44
|
+
? () => onselectionchange?.(item, !selected.has(key))
|
|
45
|
+
: undefined}
|
|
46
|
+
>
|
|
47
|
+
{getLabel(item)}
|
|
48
|
+
{#if confidence !== undefined}
|
|
49
|
+
<span class="ml-1 font-mono opacity-70">{confidenceLabel(confidence)}</span>
|
|
50
|
+
{/if}
|
|
51
|
+
</Chip>
|
|
52
|
+
</li>
|
|
53
|
+
{/each}
|
|
54
|
+
</ul>
|
|
55
|
+
{:else}
|
|
56
|
+
<p class={['text-sm text-muted', className]}>{empty}</p>
|
|
57
|
+
{/if}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare function $$render<T>(): {
|
|
2
|
+
props: {
|
|
3
|
+
items?: readonly T[];
|
|
4
|
+
getKey: (item: T) => string;
|
|
5
|
+
getLabel: (item: T) => string;
|
|
6
|
+
getConfidence?: (item: T) => number | undefined;
|
|
7
|
+
selectedKeys?: readonly string[];
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
empty?: string;
|
|
10
|
+
confidenceLabel?: (confidence: number) => string;
|
|
11
|
+
onselectionchange?: (item: T, selected: boolean) => void;
|
|
12
|
+
class?: string;
|
|
13
|
+
};
|
|
14
|
+
exports: {};
|
|
15
|
+
bindings: "";
|
|
16
|
+
slots: {};
|
|
17
|
+
events: {};
|
|
18
|
+
};
|
|
19
|
+
declare class __sveltets_Render<T> {
|
|
20
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
21
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
22
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
23
|
+
bindings(): "";
|
|
24
|
+
exports(): {};
|
|
25
|
+
}
|
|
26
|
+
interface $$IsomorphicComponent {
|
|
27
|
+
new <T>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
28
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
29
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
30
|
+
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
31
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
32
|
+
}
|
|
33
|
+
declare const SuggestedTags: $$IsomorphicComponent;
|
|
34
|
+
type SuggestedTags<T> = InstanceType<typeof SuggestedTags<T>>;
|
|
35
|
+
export default SuggestedTags;
|
|
@@ -260,6 +260,12 @@
|
|
|
260
260
|
onselect?.(item);
|
|
261
261
|
const row = listEl?.querySelector(`[data-map-item="${item.id}"]`);
|
|
262
262
|
row?.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
|
|
263
|
+
|
|
264
|
+
if (map && Number.isFinite(item.lat) && Number.isFinite(item.lng) && item.lat !== 0 && item.lng !== 0) {
|
|
265
|
+
skipNextMove = true;
|
|
266
|
+
const targetZoom = Math.max(map.getZoom(), 13);
|
|
267
|
+
map.flyTo([item.lat, item.lng], targetZoom, { duration: 0.8 });
|
|
268
|
+
}
|
|
263
269
|
}
|
|
264
270
|
|
|
265
271
|
function closeDetail() {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/svelte';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("svelte").Component<{
|
|
5
|
+
status?: import("../../../index.ts").AnalysisStatus;
|
|
6
|
+
}, {}, "">;
|
|
7
|
+
tags: string[];
|
|
8
|
+
argTypes: {
|
|
9
|
+
status: {
|
|
10
|
+
control: "select";
|
|
11
|
+
options: string[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
args: {
|
|
15
|
+
status: "complete";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
export declare const Complete: Story;
|
|
21
|
+
export declare const Processing: Story;
|
|
22
|
+
export declare const Failed: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import MediaAnalysisPanelStory from './MediaAnalysisPanelStory.svelte';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Organisms/MediaAnalysisPanel',
|
|
4
|
+
component: MediaAnalysisPanelStory,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {
|
|
7
|
+
status: {
|
|
8
|
+
control: 'select',
|
|
9
|
+
options: ['idle', 'queued', 'processing', 'complete', 'failed']
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
args: { status: 'complete' }
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
export const Complete = {};
|
|
16
|
+
export const Processing = { args: { status: 'processing' } };
|
|
17
|
+
export const Failed = { args: { status: 'failed' } };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
export interface ClassificationSuggestionSource<T> {
|
|
3
|
+
items: readonly T[];
|
|
4
|
+
getKey: (item: T) => string;
|
|
5
|
+
getLabel: (item: T) => string;
|
|
6
|
+
getConfidence: (item: T) => number;
|
|
7
|
+
selectedKey?: string;
|
|
8
|
+
onselect?: (item: T) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface SuggestedTagSource<T> {
|
|
12
|
+
items: readonly T[];
|
|
13
|
+
getKey: (item: T) => string;
|
|
14
|
+
getLabel: (item: T) => string;
|
|
15
|
+
getConfidence?: (item: T) => number | undefined;
|
|
16
|
+
selectedKeys?: readonly string[];
|
|
17
|
+
onselectionchange?: (item: T, selected: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<script lang="ts" generics="TClassification = never, TTag = never">
|
|
22
|
+
import type { Snippet } from 'svelte';
|
|
23
|
+
import AnalysisBadge from '../../atoms/AnalysisBadge/AnalysisBadge.svelte';
|
|
24
|
+
import type { AnalysisStatus } from '../../atoms/AnalysisBadge/AnalysisBadge.svelte';
|
|
25
|
+
import Card from '../../molecules/Card/Card.svelte';
|
|
26
|
+
import ClassificationSuggestion from '../../molecules/ClassificationSuggestion/ClassificationSuggestion.svelte';
|
|
27
|
+
import SuggestedTags from '../../molecules/SuggestedTags/SuggestedTags.svelte';
|
|
28
|
+
|
|
29
|
+
interface MediaAnalysisPanelProps {
|
|
30
|
+
status: AnalysisStatus;
|
|
31
|
+
title?: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
statusLabels?: Partial<Record<AnalysisStatus, string>>;
|
|
34
|
+
classifications?: ClassificationSuggestionSource<TClassification>;
|
|
35
|
+
tags?: SuggestedTagSource<TTag>;
|
|
36
|
+
classificationsTitle?: string;
|
|
37
|
+
tagsTitle?: string;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
details?: Snippet;
|
|
40
|
+
class?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
status,
|
|
45
|
+
title = 'Media analysis',
|
|
46
|
+
description,
|
|
47
|
+
statusLabels = {},
|
|
48
|
+
classifications,
|
|
49
|
+
tags,
|
|
50
|
+
classificationsTitle = 'Classification',
|
|
51
|
+
tagsTitle = 'Suggested tags',
|
|
52
|
+
disabled = false,
|
|
53
|
+
details,
|
|
54
|
+
class: className = ''
|
|
55
|
+
}: MediaAnalysisPanelProps = $props();
|
|
56
|
+
|
|
57
|
+
const uid = $props.id();
|
|
58
|
+
const titleId = `${uid}-title`;
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<section class={className} aria-labelledby={titleId}>
|
|
62
|
+
<Card padding="none">
|
|
63
|
+
<div
|
|
64
|
+
class="gap-3 border-border px-4 py-3.5 sm:flex-row sm:items-start sm:justify-between sm:px-5 sm:py-4 flex flex-col border-b"
|
|
65
|
+
>
|
|
66
|
+
<div class="min-w-0">
|
|
67
|
+
<h2 id={titleId} class="text-base font-semibold text-primary">{title}</h2>
|
|
68
|
+
{#if description}<p class="mt-1 text-sm text-muted">{description}</p>{/if}
|
|
69
|
+
</div>
|
|
70
|
+
<AnalysisBadge {status} labels={statusLabels} />
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
{#if classifications || tags}
|
|
74
|
+
<div class={['gap-5 px-4 py-4 sm:px-5 grid', classifications && tags && 'lg:grid-cols-2']}>
|
|
75
|
+
{#if classifications}
|
|
76
|
+
<section aria-labelledby={`${titleId}-classifications`}>
|
|
77
|
+
<h3 id={`${titleId}-classifications`} class="mb-2.5 text-sm font-semibold text-primary">
|
|
78
|
+
{classificationsTitle}
|
|
79
|
+
</h3>
|
|
80
|
+
<ClassificationSuggestion
|
|
81
|
+
items={classifications.items}
|
|
82
|
+
getKey={classifications.getKey}
|
|
83
|
+
getLabel={classifications.getLabel}
|
|
84
|
+
getConfidence={classifications.getConfidence}
|
|
85
|
+
selectedKey={classifications.selectedKey}
|
|
86
|
+
{disabled}
|
|
87
|
+
onselect={classifications.onselect}
|
|
88
|
+
/>
|
|
89
|
+
</section>
|
|
90
|
+
{/if}
|
|
91
|
+
|
|
92
|
+
{#if tags}
|
|
93
|
+
<section aria-labelledby={`${titleId}-tags`}>
|
|
94
|
+
<h3 id={`${titleId}-tags`} class="mb-2.5 text-sm font-semibold text-primary">
|
|
95
|
+
{tagsTitle}
|
|
96
|
+
</h3>
|
|
97
|
+
<SuggestedTags
|
|
98
|
+
items={tags.items}
|
|
99
|
+
getKey={tags.getKey}
|
|
100
|
+
getLabel={tags.getLabel}
|
|
101
|
+
getConfidence={tags.getConfidence}
|
|
102
|
+
selectedKeys={tags.selectedKeys}
|
|
103
|
+
{disabled}
|
|
104
|
+
onselectionchange={tags.onselectionchange}
|
|
105
|
+
/>
|
|
106
|
+
</section>
|
|
107
|
+
{/if}
|
|
108
|
+
</div>
|
|
109
|
+
{/if}
|
|
110
|
+
|
|
111
|
+
{#if details}
|
|
112
|
+
<div class="border-border px-4 py-4 sm:px-5 border-t">{@render details()}</div>
|
|
113
|
+
{/if}
|
|
114
|
+
</Card>
|
|
115
|
+
</section>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface ClassificationSuggestionSource<T> {
|
|
2
|
+
items: readonly T[];
|
|
3
|
+
getKey: (item: T) => string;
|
|
4
|
+
getLabel: (item: T) => string;
|
|
5
|
+
getConfidence: (item: T) => number;
|
|
6
|
+
selectedKey?: string;
|
|
7
|
+
onselect?: (item: T) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface SuggestedTagSource<T> {
|
|
10
|
+
items: readonly T[];
|
|
11
|
+
getKey: (item: T) => string;
|
|
12
|
+
getLabel: (item: T) => string;
|
|
13
|
+
getConfidence?: (item: T) => number | undefined;
|
|
14
|
+
selectedKeys?: readonly string[];
|
|
15
|
+
onselectionchange?: (item: T, selected: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
import type { Snippet } from 'svelte';
|
|
18
|
+
import type { AnalysisStatus } from '../../atoms/AnalysisBadge/AnalysisBadge.svelte';
|
|
19
|
+
declare function $$render<TClassification = never, TTag = never>(): {
|
|
20
|
+
props: {
|
|
21
|
+
status: AnalysisStatus;
|
|
22
|
+
title?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
statusLabels?: Partial<Record<AnalysisStatus, string>>;
|
|
25
|
+
classifications?: ClassificationSuggestionSource<TClassification>;
|
|
26
|
+
tags?: SuggestedTagSource<TTag>;
|
|
27
|
+
classificationsTitle?: string;
|
|
28
|
+
tagsTitle?: string;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
details?: Snippet;
|
|
31
|
+
class?: string;
|
|
32
|
+
};
|
|
33
|
+
exports: {};
|
|
34
|
+
bindings: "";
|
|
35
|
+
slots: {};
|
|
36
|
+
events: {};
|
|
37
|
+
};
|
|
38
|
+
declare class __sveltets_Render<TClassification = never, TTag = never> {
|
|
39
|
+
props(): ReturnType<typeof $$render<TClassification, TTag>>['props'];
|
|
40
|
+
events(): ReturnType<typeof $$render<TClassification, TTag>>['events'];
|
|
41
|
+
slots(): ReturnType<typeof $$render<TClassification, TTag>>['slots'];
|
|
42
|
+
bindings(): "";
|
|
43
|
+
exports(): {};
|
|
44
|
+
}
|
|
45
|
+
interface $$IsomorphicComponent {
|
|
46
|
+
new <TClassification = never, TTag = never>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<TClassification, TTag>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<TClassification, TTag>['props']>, ReturnType<__sveltets_Render<TClassification, TTag>['events']>, ReturnType<__sveltets_Render<TClassification, TTag>['slots']>> & {
|
|
47
|
+
$$bindings?: ReturnType<__sveltets_Render<TClassification, TTag>['bindings']>;
|
|
48
|
+
} & ReturnType<__sveltets_Render<TClassification, TTag>['exports']>;
|
|
49
|
+
<TClassification = never, TTag = never>(internal: unknown, props: ReturnType<__sveltets_Render<TClassification, TTag>['props']> & {}): ReturnType<__sveltets_Render<TClassification, TTag>['exports']>;
|
|
50
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any, any>['bindings']>;
|
|
51
|
+
}
|
|
52
|
+
declare const MediaAnalysisPanel: $$IsomorphicComponent;
|
|
53
|
+
type MediaAnalysisPanel<TClassification = never, TTag = never> = InstanceType<typeof MediaAnalysisPanel<TClassification, TTag>>;
|
|
54
|
+
export default MediaAnalysisPanel;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import MediaAnalysisPanel from './MediaAnalysisPanel.svelte';
|
|
3
|
+
import type { AnalysisStatus } from '../../atoms/AnalysisBadge/AnalysisBadge.svelte';
|
|
4
|
+
|
|
5
|
+
type Classification = { id: string; label: string; confidence: number };
|
|
6
|
+
type Tag = { id: string; label: string; confidence: number };
|
|
7
|
+
|
|
8
|
+
let { status = 'complete' }: { status?: AnalysisStatus } = $props();
|
|
9
|
+
|
|
10
|
+
const classifications: Classification[] = [
|
|
11
|
+
{ id: 'concert', label: 'Live concert', confidence: 0.94 },
|
|
12
|
+
{ id: 'crowd', label: 'Crowd scene', confidence: 0.71 },
|
|
13
|
+
{ id: 'nightlife', label: 'Nightlife', confidence: 0.43 }
|
|
14
|
+
];
|
|
15
|
+
const tags: Tag[] = [
|
|
16
|
+
{ id: 'stage', label: 'stage', confidence: 0.96 },
|
|
17
|
+
{ id: 'music', label: 'music', confidence: 0.91 },
|
|
18
|
+
{ id: 'crowd', label: 'crowd', confidence: 0.82 },
|
|
19
|
+
{ id: 'lights', label: 'lights', confidence: 0.67 }
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
let selectedClassificationKey = $state('concert');
|
|
23
|
+
let selectedTagKeys = $state(['stage', 'music']);
|
|
24
|
+
|
|
25
|
+
function toggleTag(tag: Tag, selected: boolean) {
|
|
26
|
+
selectedTagKeys = selected
|
|
27
|
+
? [...selectedTagKeys, tag.id]
|
|
28
|
+
: selectedTagKeys.filter((key) => key !== tag.id);
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<div class="max-w-4xl p-4 mx-auto">
|
|
33
|
+
<MediaAnalysisPanel
|
|
34
|
+
{status}
|
|
35
|
+
title="Media analysis"
|
|
36
|
+
description="Review model output before applying it to this asset."
|
|
37
|
+
classifications={{
|
|
38
|
+
items: classifications,
|
|
39
|
+
getKey: (item) => item.id,
|
|
40
|
+
getLabel: (item) => item.label,
|
|
41
|
+
getConfidence: (item) => item.confidence,
|
|
42
|
+
selectedKey: selectedClassificationKey,
|
|
43
|
+
onselect: (item) => (selectedClassificationKey = item.id)
|
|
44
|
+
}}
|
|
45
|
+
tags={{
|
|
46
|
+
items: tags,
|
|
47
|
+
getKey: (item) => item.id,
|
|
48
|
+
getLabel: (item) => item.label,
|
|
49
|
+
getConfidence: (item) => item.confidence,
|
|
50
|
+
selectedKeys: selectedTagKeys,
|
|
51
|
+
onselectionchange: toggleTag
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AnalysisStatus } from '../../atoms/AnalysisBadge/AnalysisBadge.svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
status?: AnalysisStatus;
|
|
4
|
+
};
|
|
5
|
+
declare const MediaAnalysisPanelStory: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type MediaAnalysisPanelStory = ReturnType<typeof MediaAnalysisPanelStory>;
|
|
7
|
+
export default MediaAnalysisPanelStory;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/svelte';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("svelte").Component<Record<string, never>, {}, "">;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ModerationReviewPanelStory from './ModerationReviewPanelStory.svelte';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Organisms/ModerationReviewPanel',
|
|
4
|
+
component: ModerationReviewPanelStory,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
parameters: { layout: 'fullscreen' }
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export const Default = {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
export type ModerationDecision = 'approve' | 'reject' | 'escalate';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" generics="T">
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
import Button from '../../atoms/Button/Button.svelte';
|
|
8
|
+
import Badge from '../../atoms/Badge/Badge.svelte';
|
|
9
|
+
import Card from '../../molecules/Card/Card.svelte';
|
|
10
|
+
|
|
11
|
+
interface ModerationReviewPanelProps {
|
|
12
|
+
item: T;
|
|
13
|
+
title: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
position?: number;
|
|
16
|
+
total?: number;
|
|
17
|
+
media: Snippet<[T]>;
|
|
18
|
+
summary?: Snippet<[T]>;
|
|
19
|
+
analysis?: Snippet<[T]>;
|
|
20
|
+
ondecision?: (item: T, decision: ModerationDecision) => void;
|
|
21
|
+
onnext?: (item: T) => void;
|
|
22
|
+
loadingDecision?: ModerationDecision;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
approveLabel?: string;
|
|
25
|
+
rejectLabel?: string;
|
|
26
|
+
escalateLabel?: string;
|
|
27
|
+
nextLabel?: string;
|
|
28
|
+
class?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const {
|
|
32
|
+
item,
|
|
33
|
+
title,
|
|
34
|
+
description,
|
|
35
|
+
position,
|
|
36
|
+
total,
|
|
37
|
+
media,
|
|
38
|
+
summary,
|
|
39
|
+
analysis,
|
|
40
|
+
ondecision,
|
|
41
|
+
onnext,
|
|
42
|
+
loadingDecision,
|
|
43
|
+
disabled = false,
|
|
44
|
+
approveLabel = 'Approve',
|
|
45
|
+
rejectLabel = 'Reject',
|
|
46
|
+
escalateLabel = 'Escalate',
|
|
47
|
+
nextLabel = 'Next',
|
|
48
|
+
class: className = ''
|
|
49
|
+
}: ModerationReviewPanelProps = $props();
|
|
50
|
+
|
|
51
|
+
const uid = $props.id();
|
|
52
|
+
const titleId = `${uid}-title`;
|
|
53
|
+
const busy = $derived(loadingDecision !== undefined);
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<section class={className} aria-labelledby={titleId} aria-busy={busy}>
|
|
57
|
+
<Card padding="none">
|
|
58
|
+
<header
|
|
59
|
+
class="gap-3 border-border px-4 py-3.5 sm:flex-row sm:items-start sm:justify-between sm:px-5 sm:py-4 flex flex-col border-b"
|
|
60
|
+
>
|
|
61
|
+
<div class="min-w-0">
|
|
62
|
+
<h2 id={titleId} class="text-base font-semibold text-primary">{title}</h2>
|
|
63
|
+
{#if description}<p class="mt-1 text-sm text-muted">{description}</p>{/if}
|
|
64
|
+
</div>
|
|
65
|
+
{#if position !== undefined && total !== undefined}
|
|
66
|
+
<Badge variant="secondary" rounded>{position} of {total}</Badge>
|
|
67
|
+
{/if}
|
|
68
|
+
</header>
|
|
69
|
+
|
|
70
|
+
<div class="min-w-0 lg:grid-cols-[minmax(0,1.25fr)_minmax(18rem,0.75fr)] grid">
|
|
71
|
+
<div
|
|
72
|
+
class="min-w-0 border-border bg-surface-overlay/40 p-3 sm:p-4 lg:border-r lg:border-b-0 border-b"
|
|
73
|
+
>
|
|
74
|
+
{@render media(item)}
|
|
75
|
+
</div>
|
|
76
|
+
<aside class="min-w-0 space-y-4 p-4 sm:p-5" aria-label="Review details">
|
|
77
|
+
{#if summary}{@render summary(item)}{/if}
|
|
78
|
+
{#if analysis}{@render analysis(item)}{/if}
|
|
79
|
+
</aside>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
{#if ondecision || onnext}
|
|
83
|
+
<footer
|
|
84
|
+
class="gap-2 border-border px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5 flex flex-col-reverse border-t"
|
|
85
|
+
>
|
|
86
|
+
<div class="gap-2 sm:flex-row flex flex-col">
|
|
87
|
+
{#if ondecision}
|
|
88
|
+
<Button
|
|
89
|
+
variant="destructive"
|
|
90
|
+
size="sm"
|
|
91
|
+
disabled={disabled || busy}
|
|
92
|
+
loading={loadingDecision === 'reject'}
|
|
93
|
+
onclick={() => ondecision?.(item, 'reject')}>{rejectLabel}</Button
|
|
94
|
+
>
|
|
95
|
+
<Button
|
|
96
|
+
variant="outline"
|
|
97
|
+
size="sm"
|
|
98
|
+
disabled={disabled || busy}
|
|
99
|
+
loading={loadingDecision === 'escalate'}
|
|
100
|
+
onclick={() => ondecision?.(item, 'escalate')}>{escalateLabel}</Button
|
|
101
|
+
>
|
|
102
|
+
{/if}
|
|
103
|
+
</div>
|
|
104
|
+
<div class="gap-2 sm:flex-row flex flex-col">
|
|
105
|
+
{#if onnext}
|
|
106
|
+
<Button
|
|
107
|
+
variant="ghost"
|
|
108
|
+
size="sm"
|
|
109
|
+
disabled={disabled || busy}
|
|
110
|
+
onclick={() => onnext?.(item)}>{nextLabel}</Button
|
|
111
|
+
>
|
|
112
|
+
{/if}
|
|
113
|
+
{#if ondecision}
|
|
114
|
+
<Button
|
|
115
|
+
size="sm"
|
|
116
|
+
disabled={disabled || busy}
|
|
117
|
+
loading={loadingDecision === 'approve'}
|
|
118
|
+
onclick={() => ondecision?.(item, 'approve')}>{approveLabel}</Button
|
|
119
|
+
>
|
|
120
|
+
{/if}
|
|
121
|
+
</div>
|
|
122
|
+
</footer>
|
|
123
|
+
{/if}
|
|
124
|
+
</Card>
|
|
125
|
+
</section>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type ModerationDecision = 'approve' | 'reject' | 'escalate';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
declare function $$render<T>(): {
|
|
4
|
+
props: {
|
|
5
|
+
item: T;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
position?: number;
|
|
9
|
+
total?: number;
|
|
10
|
+
media: Snippet<[T]>;
|
|
11
|
+
summary?: Snippet<[T]>;
|
|
12
|
+
analysis?: Snippet<[T]>;
|
|
13
|
+
ondecision?: (item: T, decision: ModerationDecision) => void;
|
|
14
|
+
onnext?: (item: T) => void;
|
|
15
|
+
loadingDecision?: ModerationDecision;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
approveLabel?: string;
|
|
18
|
+
rejectLabel?: string;
|
|
19
|
+
escalateLabel?: string;
|
|
20
|
+
nextLabel?: string;
|
|
21
|
+
class?: string;
|
|
22
|
+
};
|
|
23
|
+
exports: {};
|
|
24
|
+
bindings: "";
|
|
25
|
+
slots: {};
|
|
26
|
+
events: {};
|
|
27
|
+
};
|
|
28
|
+
declare class __sveltets_Render<T> {
|
|
29
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
30
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
31
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
32
|
+
bindings(): "";
|
|
33
|
+
exports(): {};
|
|
34
|
+
}
|
|
35
|
+
interface $$IsomorphicComponent {
|
|
36
|
+
new <T>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
37
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
38
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
39
|
+
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
40
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
41
|
+
}
|
|
42
|
+
declare const ModerationReviewPanel: $$IsomorphicComponent;
|
|
43
|
+
type ModerationReviewPanel<T> = InstanceType<typeof ModerationReviewPanel<T>>;
|
|
44
|
+
export default ModerationReviewPanel;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ModerationReviewPanel from './ModerationReviewPanel.svelte';
|
|
3
|
+
import type { ModerationDecision } from './ModerationReviewPanel.svelte';
|
|
4
|
+
import AnalysisBadge from '../../atoms/AnalysisBadge/AnalysisBadge.svelte';
|
|
5
|
+
import SuggestedTags from '../../molecules/SuggestedTags/SuggestedTags.svelte';
|
|
6
|
+
|
|
7
|
+
type ReviewItem = {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
source: string;
|
|
11
|
+
uploadedAt: string;
|
|
12
|
+
};
|
|
13
|
+
type Tag = { id: string; label: string; confidence: number };
|
|
14
|
+
|
|
15
|
+
const item: ReviewItem = {
|
|
16
|
+
id: 'asset-1842',
|
|
17
|
+
name: 'Summer stage teaser',
|
|
18
|
+
source: 'Organizer upload',
|
|
19
|
+
uploadedAt: '27 Sep 2026, 14:32'
|
|
20
|
+
};
|
|
21
|
+
const tags: Tag[] = [
|
|
22
|
+
{ id: 'concert', label: 'concert', confidence: 0.94 },
|
|
23
|
+
{ id: 'crowd', label: 'crowd', confidence: 0.81 },
|
|
24
|
+
{ id: 'night', label: 'night', confidence: 0.68 }
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
let lastAction = $state('No decision made');
|
|
28
|
+
|
|
29
|
+
function decide(reviewItem: ReviewItem, decision: ModerationDecision) {
|
|
30
|
+
lastAction = `${decision}: ${reviewItem.name}`;
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
{#snippet media(reviewItem: ReviewItem)}
|
|
35
|
+
<figure class="rounded-xl border-border bg-neutral-950 overflow-hidden border">
|
|
36
|
+
<div
|
|
37
|
+
class="aspect-video from-neutral-800 via-neutral-950 to-neutral-800 p-8 flex items-center justify-center bg-gradient-to-br text-center"
|
|
38
|
+
>
|
|
39
|
+
<div>
|
|
40
|
+
<div class="mb-3 h-14 w-14 border-white/20 bg-white/10 mx-auto rounded-full border"></div>
|
|
41
|
+
<p class="text-sm font-medium text-white">{reviewItem.name}</p>
|
|
42
|
+
<p class="mt-1 text-xs text-neutral-400">Video preview placeholder</p>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<figcaption class="bg-neutral-950 px-3 py-2 text-xs text-neutral-400">00:00 / 00:24</figcaption>
|
|
46
|
+
</figure>
|
|
47
|
+
{/snippet}
|
|
48
|
+
|
|
49
|
+
{#snippet summary(reviewItem: ReviewItem)}
|
|
50
|
+
<div>
|
|
51
|
+
<div class="mb-3 gap-3 flex items-center justify-between">
|
|
52
|
+
<h3 class="text-sm font-semibold text-primary">Review summary</h3>
|
|
53
|
+
<AnalysisBadge status="complete" />
|
|
54
|
+
</div>
|
|
55
|
+
<dl class="gap-x-3 gap-y-2 text-sm grid grid-cols-[auto_1fr]">
|
|
56
|
+
<dt class="text-muted">Source</dt>
|
|
57
|
+
<dd class="text-primary text-right">{reviewItem.source}</dd>
|
|
58
|
+
<dt class="text-muted">Uploaded</dt>
|
|
59
|
+
<dd class="text-primary text-right">{reviewItem.uploadedAt}</dd>
|
|
60
|
+
</dl>
|
|
61
|
+
</div>
|
|
62
|
+
{/snippet}
|
|
63
|
+
|
|
64
|
+
{#snippet analysis()}
|
|
65
|
+
<div class="border-border pt-4 border-t">
|
|
66
|
+
<h3 class="mb-2.5 text-sm font-semibold text-primary">Suggested tags</h3>
|
|
67
|
+
<SuggestedTags
|
|
68
|
+
items={tags}
|
|
69
|
+
getKey={(tag) => tag.id}
|
|
70
|
+
getLabel={(tag) => tag.label}
|
|
71
|
+
getConfidence={(tag) => tag.confidence}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
{/snippet}
|
|
75
|
+
|
|
76
|
+
<div class="max-w-6xl p-4 mx-auto">
|
|
77
|
+
<ModerationReviewPanel
|
|
78
|
+
{item}
|
|
79
|
+
title="Moderation review"
|
|
80
|
+
description="Inspect the asset and choose the appropriate outcome."
|
|
81
|
+
position={3}
|
|
82
|
+
total={18}
|
|
83
|
+
{media}
|
|
84
|
+
{summary}
|
|
85
|
+
{analysis}
|
|
86
|
+
ondecision={decide}
|
|
87
|
+
onnext={(reviewItem) => (lastAction = `skipped: ${reviewItem.name}`)}
|
|
88
|
+
/>
|
|
89
|
+
<p class="mt-3 text-xs text-muted text-center" aria-live="polite">{lastAction}</p>
|
|
90
|
+
</div>
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export { default as Slider } from './components/atoms/Slider/Slider.svelte';
|
|
|
6
6
|
export { default as Skeleton } from './components/atoms/Skeleton/Skeleton.svelte';
|
|
7
7
|
export { default as ProgressBar } from './components/atoms/ProgressBar/ProgressBar.svelte';
|
|
8
8
|
export { default as Badge } from './components/atoms/Badge/Badge.svelte';
|
|
9
|
+
export { default as AnalysisBadge } from './components/atoms/AnalysisBadge/AnalysisBadge.svelte';
|
|
10
|
+
export type { AnalysisStatus } from './components/atoms/AnalysisBadge/AnalysisBadge.svelte';
|
|
9
11
|
export { default as VerifiedBadge } from './components/atoms/VerifiedBadge/VerifiedBadge.svelte';
|
|
10
12
|
export { default as Avatar } from './components/atoms/Avatar/Avatar.svelte';
|
|
11
13
|
export { default as Spinner } from './components/atoms/Spinner/Spinner.svelte';
|
|
@@ -177,6 +179,8 @@ export { default as Pagination } from './components/molecules/Pagination/Paginat
|
|
|
177
179
|
export { default as Breadcrumb } from './components/molecules/Breadcrumb/Breadcrumb.svelte';
|
|
178
180
|
export type { BreadcrumbItem } from './components/molecules/Breadcrumb/Breadcrumb.svelte';
|
|
179
181
|
export { default as EmptyState } from './components/molecules/EmptyState/EmptyState.svelte';
|
|
182
|
+
export { default as SuggestedTags } from './components/molecules/SuggestedTags/SuggestedTags.svelte';
|
|
183
|
+
export { default as ClassificationSuggestion } from './components/molecules/ClassificationSuggestion/ClassificationSuggestion.svelte';
|
|
180
184
|
export { default as Accordion } from './components/molecules/Accordion/Accordion.svelte';
|
|
181
185
|
export type { AccordionItem } from './components/molecules/Accordion/Accordion.svelte';
|
|
182
186
|
export { default as Stepper } from './components/molecules/Stepper/Stepper.svelte';
|
|
@@ -653,6 +657,10 @@ export { SHEET_SIZE_SNAPS } from './components/organisms/Sheet/Sheet.svelte';
|
|
|
653
657
|
export { default as DataTable } from './components/organisms/DataTable/DataTable.svelte';
|
|
654
658
|
export type { DataTableColumn } from './components/organisms/DataTable/DataTable.svelte';
|
|
655
659
|
export { default as DataGrid } from './components/organisms/DataGrid/DataGrid.svelte';
|
|
660
|
+
export { default as MediaAnalysisPanel } from './components/organisms/MediaAnalysisPanel/MediaAnalysisPanel.svelte';
|
|
661
|
+
export type { ClassificationSuggestionSource, SuggestedTagSource } from './components/organisms/MediaAnalysisPanel/MediaAnalysisPanel.svelte';
|
|
662
|
+
export { default as ModerationReviewPanel } from './components/organisms/ModerationReviewPanel/ModerationReviewPanel.svelte';
|
|
663
|
+
export type { ModerationDecision } from './components/organisms/ModerationReviewPanel/ModerationReviewPanel.svelte';
|
|
656
664
|
export type { DataGridColumn, DataGridEditType, DataGridEditConfig, DataGridEditOption, DataGridViewMode, DataGridFilter, Breakpoint, CellRef, GridSelection, CellNote, GridMark, MarkColor, MarkPreset, ConditionalFormatRule, ConditionalFormatStyle, FormatCondition, FormatTarget, SortDir } from './components/organisms/DataGrid/DataGrid.svelte';
|
|
657
665
|
export { EMPTY_SELECTION, noteKey, markKey, selectionCount, selectionLabel, evaluateFormatRules, evaluateCondition, styleToCss, inferCellEditor, resolveCellEditor, coerceEditValue, draftFromValue, MARK_COLORS, MARK_TINT, MARK_SWATCH, markTint, markSwatch, isMarkPreset, BREAKPOINT_MIN, matchesMinBreakpoint, isColumnVisibleAtWidth, filterRows, cellText, uniqueColumnValues } from './components/organisms/DataGrid/DataGrid.svelte';
|
|
658
666
|
export { default as ResourceStudio } from './components/organisms/ResourceStudio/ResourceStudio.svelte';
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { default as Slider } from './components/atoms/Slider/Slider.svelte';
|
|
|
10
10
|
export { default as Skeleton } from './components/atoms/Skeleton/Skeleton.svelte';
|
|
11
11
|
export { default as ProgressBar } from './components/atoms/ProgressBar/ProgressBar.svelte';
|
|
12
12
|
export { default as Badge } from './components/atoms/Badge/Badge.svelte';
|
|
13
|
+
export { default as AnalysisBadge } from './components/atoms/AnalysisBadge/AnalysisBadge.svelte';
|
|
13
14
|
export { default as VerifiedBadge } from './components/atoms/VerifiedBadge/VerifiedBadge.svelte';
|
|
14
15
|
export { default as Avatar } from './components/atoms/Avatar/Avatar.svelte';
|
|
15
16
|
export { default as Spinner } from './components/atoms/Spinner/Spinner.svelte';
|
|
@@ -144,6 +145,8 @@ export { default as DropdownMenu } from './components/molecules/DropdownMenu/Dro
|
|
|
144
145
|
export { default as Pagination } from './components/molecules/Pagination/Pagination.svelte';
|
|
145
146
|
export { default as Breadcrumb } from './components/molecules/Breadcrumb/Breadcrumb.svelte';
|
|
146
147
|
export { default as EmptyState } from './components/molecules/EmptyState/EmptyState.svelte';
|
|
148
|
+
export { default as SuggestedTags } from './components/molecules/SuggestedTags/SuggestedTags.svelte';
|
|
149
|
+
export { default as ClassificationSuggestion } from './components/molecules/ClassificationSuggestion/ClassificationSuggestion.svelte';
|
|
147
150
|
export { default as Accordion } from './components/molecules/Accordion/Accordion.svelte';
|
|
148
151
|
export { default as Stepper } from './components/molecules/Stepper/Stepper.svelte';
|
|
149
152
|
export { default as NumberInput } from './components/molecules/NumberInput/NumberInput.svelte';
|
|
@@ -453,6 +456,8 @@ export { default as Sheet } from './components/organisms/Sheet/Sheet.svelte';
|
|
|
453
456
|
export { SHEET_SIZE_SNAPS } from './components/organisms/Sheet/Sheet.svelte';
|
|
454
457
|
export { default as DataTable } from './components/organisms/DataTable/DataTable.svelte';
|
|
455
458
|
export { default as DataGrid } from './components/organisms/DataGrid/DataGrid.svelte';
|
|
459
|
+
export { default as MediaAnalysisPanel } from './components/organisms/MediaAnalysisPanel/MediaAnalysisPanel.svelte';
|
|
460
|
+
export { default as ModerationReviewPanel } from './components/organisms/ModerationReviewPanel/ModerationReviewPanel.svelte';
|
|
456
461
|
export { EMPTY_SELECTION, noteKey, markKey, selectionCount, selectionLabel, evaluateFormatRules, evaluateCondition, styleToCss, inferCellEditor, resolveCellEditor, coerceEditValue, draftFromValue, MARK_COLORS, MARK_TINT, MARK_SWATCH, markTint, markSwatch, isMarkPreset, BREAKPOINT_MIN, matchesMinBreakpoint, isColumnVisibleAtWidth, filterRows, cellText, uniqueColumnValues } from './components/organisms/DataGrid/DataGrid.svelte';
|
|
457
462
|
export { default as ResourceStudio } from './components/organisms/ResourceStudio/ResourceStudio.svelte';
|
|
458
463
|
export { DEFAULT_CAPABILITIES, resolveCapabilities, fieldsToColumns, fieldsToSchema } from './components/organisms/ResourceStudio/ResourceStudio.svelte';
|
package/dist/styles.css
CHANGED
|
@@ -256,6 +256,15 @@
|
|
|
256
256
|
.bg-surface-overlay {
|
|
257
257
|
background-color: var(--surface-overlay);
|
|
258
258
|
}
|
|
259
|
+
.border-surface {
|
|
260
|
+
border-color: var(--surface);
|
|
261
|
+
}
|
|
262
|
+
.border-surface-elevated {
|
|
263
|
+
border-color: var(--surface-elevated);
|
|
264
|
+
}
|
|
265
|
+
.border-surface-overlay {
|
|
266
|
+
border-color: var(--surface-overlay);
|
|
267
|
+
}
|
|
259
268
|
.border-border {
|
|
260
269
|
border-color: var(--border);
|
|
261
270
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@r2digisolutions/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "R2DigiSolutions Svelte 5 component library — Atomic Design, Tailwind 4, Light/Dark mode",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@eslint/js": "^10.0.1",
|
|
69
|
-
"@lucide/svelte": "^1.
|
|
69
|
+
"@lucide/svelte": "^1.49.0",
|
|
70
70
|
"@playwright/test": "^1.63.0",
|
|
71
|
-
"@storybook/addon-a11y": "^10.6.
|
|
72
|
-
"@storybook/addon-docs": "^10.6.
|
|
73
|
-
"@storybook/addon-svelte-csf": "^5.1.
|
|
74
|
-
"@storybook/addon-themes": "^10.6.
|
|
75
|
-
"@storybook/svelte": "^10.6.
|
|
76
|
-
"@storybook/sveltekit": "^10.6.
|
|
71
|
+
"@storybook/addon-a11y": "^10.6.1",
|
|
72
|
+
"@storybook/addon-docs": "^10.6.1",
|
|
73
|
+
"@storybook/addon-svelte-csf": "^5.1.5",
|
|
74
|
+
"@storybook/addon-themes": "^10.6.1",
|
|
75
|
+
"@storybook/svelte": "^10.6.1",
|
|
76
|
+
"@storybook/sveltekit": "^10.6.1",
|
|
77
77
|
"@sveltejs/adapter-static": "next",
|
|
78
78
|
"@sveltejs/kit": "next",
|
|
79
79
|
"@sveltejs/package": "^2.5.8",
|
|
@@ -81,27 +81,27 @@
|
|
|
81
81
|
"@tailwindcss/vite": "^4.3.3",
|
|
82
82
|
"@types/leaflet": "^1.9.22",
|
|
83
83
|
"@types/leaflet.markercluster": "^1.5.6",
|
|
84
|
-
"@types/node": "^26.6.
|
|
85
|
-
"@vitest/browser-playwright": "^5.0.
|
|
84
|
+
"@types/node": "^26.6.3",
|
|
85
|
+
"@vitest/browser-playwright": "^5.0.3",
|
|
86
86
|
"bumpp": "~12.3.0",
|
|
87
87
|
"eslint": "^10.11.0",
|
|
88
88
|
"eslint-config-prettier": "^10.1.8",
|
|
89
89
|
"eslint-plugin-svelte": "^3.23.0",
|
|
90
|
-
"globals": "^17.
|
|
90
|
+
"globals": "^17.13.0",
|
|
91
91
|
"mdsvex": "^0.12.8",
|
|
92
92
|
"playwright": "^1.63.0",
|
|
93
93
|
"prettier": "^3.9.9",
|
|
94
94
|
"prettier-plugin-svelte": "^4.1.1",
|
|
95
95
|
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
96
96
|
"publint": "^0.3.24",
|
|
97
|
-
"storybook": "^10.6.
|
|
97
|
+
"storybook": "^10.6.1",
|
|
98
98
|
"svelte": "^5.57.1",
|
|
99
99
|
"svelte-check": "^4.7.6",
|
|
100
100
|
"tailwindcss": "^4.3.3",
|
|
101
101
|
"typescript": "6.0.3",
|
|
102
|
-
"typescript-eslint": "^8.
|
|
102
|
+
"typescript-eslint": "^8.71.0",
|
|
103
103
|
"vite": "^8.3.1",
|
|
104
|
-
"vitest": "^5.0.
|
|
104
|
+
"vitest": "^5.0.3",
|
|
105
105
|
"vitest-browser-svelte": "^3.1.0"
|
|
106
106
|
},
|
|
107
107
|
"keywords": [
|