@ltm-blueverse/alpha-semantic-hub 0.7.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/LICENSE +21 -0
- package/README.md +1674 -0
- package/explorer/README.md +282 -0
- package/explorer/src/App.css +0 -0
- package/explorer/src/App.tsx +2035 -0
- package/explorer/src/ErrorBoundary.tsx +112 -0
- package/explorer/src/ExploreWorkspaceTabs.tsx +29 -0
- package/explorer/src/assets/hero.png +0 -0
- package/explorer/src/assets/react.svg +1 -0
- package/explorer/src/assets/vite.svg +1 -0
- package/explorer/src/explorerCapabilities.ts +24 -0
- package/explorer/src/index.css +71 -0
- package/explorer/src/main.tsx +7 -0
- package/explorer/src/store/edgePairKeys.d.ts +2 -0
- package/explorer/src/store/edgePairKeys.js +7 -0
- package/explorer/src/store/graphStore.ts +183 -0
- package/explorer/src/store/registryStore.ts +78 -0
- package/explorer/src/types.d.ts +16 -0
- package/explorer/src/ui/primitives.css +414 -0
- package/explorer/src/ui/primitives.tsx +170 -0
- package/explorer/src/workspaces/DecisionWorkspace/DecisionWorkspace.tsx +279 -0
- package/explorer/src/workspaces/DiffMergeWorkspace/DiffMergeWorkspace.tsx +121 -0
- package/explorer/src/workspaces/EnrichWorkspace/EntityResolutionTab.tsx +454 -0
- package/explorer/src/workspaces/EnrichWorkspace/RegistryTab.tsx +285 -0
- package/explorer/src/workspaces/GraphWorkspace/GraphCanvas.tsx +2673 -0
- package/explorer/src/workspaces/GraphWorkspace/GraphInspectorPanel.tsx +771 -0
- package/explorer/src/workspaces/GraphWorkspace/GraphLoadingOverlay.tsx +410 -0
- package/explorer/src/workspaces/GraphWorkspace/GraphWorkspace.tsx +3584 -0
- package/explorer/src/workspaces/GraphWorkspace/MarkdownContentViewer.tsx +705 -0
- package/explorer/src/workspaces/GraphWorkspace/SigmaSceneAdapter.tsx +55 -0
- package/explorer/src/workspaces/GraphWorkspace/TimelinePanel.tsx +193 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/clickSelectionBehavior.ts +29 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/fitViewBehavior.ts +15 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/focusCameraBehavior.ts +25 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/hoverActivationBehavior.ts +15 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/pathHighlightBehavior.ts +52 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/searchFocusBehavior.ts +36 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/types.ts +41 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/viewModeSwitchBehavior.ts +29 -0
- package/explorer/src/workspaces/GraphWorkspace/graphAnalytics.ts +779 -0
- package/explorer/src/workspaces/GraphWorkspace/graphColorLegend.ts +36 -0
- package/explorer/src/workspaces/GraphWorkspace/graphConfig.ts +102 -0
- package/explorer/src/workspaces/GraphWorkspace/graphEntityShape.ts +34 -0
- package/explorer/src/workspaces/GraphWorkspace/graphLoading.ts +84 -0
- package/explorer/src/workspaces/GraphWorkspace/graphSceneLayers.ts +775 -0
- package/explorer/src/workspaces/GraphWorkspace/graphSceneState.ts +2753 -0
- package/explorer/src/workspaces/GraphWorkspace/graphStructureLayer.ts +335 -0
- package/explorer/src/workspaces/GraphWorkspace/graphTheme.ts +1078 -0
- package/explorer/src/workspaces/GraphWorkspace/graphViewCopy.ts +41 -0
- package/explorer/src/workspaces/GraphWorkspace/localGraphTransition.ts +9 -0
- package/explorer/src/workspaces/GraphWorkspace/markdownEditorState.ts +114 -0
- package/explorer/src/workspaces/GraphWorkspace/markdownResourceClient.ts +103 -0
- package/explorer/src/workspaces/GraphWorkspace/markdownUrlSafety.ts +29 -0
- package/explorer/src/workspaces/GraphWorkspace/nodeMarkdownSync.ts +81 -0
- package/explorer/src/workspaces/GraphWorkspace/pluginRegistryPredicates.ts +24 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/explorationEffectsPlugin.tsx +353 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/explorationEffectsPluginPhaseC.tsx +522 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/index.ts +16 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/legendPlugin.tsx +120 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/neighborhoodPanelPlugin.tsx +231 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx +142 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/types.ts +106 -0
- package/explorer/src/workspaces/GraphWorkspace/realtimeGraphAttributes.ts +50 -0
- package/explorer/src/workspaces/GraphWorkspace/scene.ts +79 -0
- package/explorer/src/workspaces/GraphWorkspace/sigmaNativeRendering.ts +421 -0
- package/explorer/src/workspaces/GraphWorkspace/smallGraphLayout.ts +135 -0
- package/explorer/src/workspaces/GraphWorkspace/temporalLifecyclePredicates.ts +31 -0
- package/explorer/src/workspaces/GraphWorkspace/temporalScrubberBounds.ts +46 -0
- package/explorer/src/workspaces/GraphWorkspace/temporalSnapshotGuards.ts +113 -0
- package/explorer/src/workspaces/GraphWorkspace/types.ts +395 -0
- package/explorer/src/workspaces/GraphWorkspace/useLoadGraph.ts +746 -0
- package/explorer/src/workspaces/GraphWorkspace/useMarkdownEditor.ts +177 -0
- package/explorer/src/workspaces/ImportExportWorkspace/ImportExportWorkspace.tsx +196 -0
- package/explorer/src/workspaces/LineageWorkspace/LineageDiagram.tsx +177 -0
- package/explorer/src/workspaces/ManageWorkspace/KGOverviewTab.tsx +291 -0
- package/explorer/src/workspaces/ManageWorkspace/OntologySummaryTab.tsx +346 -0
- package/explorer/src/workspaces/MemoryWorkspace.tsx +464 -0
- package/explorer/src/workspaces/OntologyWorkspace/AlignmentsTab.tsx +437 -0
- package/explorer/src/workspaces/OntologyWorkspace/HealthTab.tsx +214 -0
- package/explorer/src/workspaces/OntologyWorkspace/OntologyEditor.tsx +770 -0
- package/explorer/src/workspaces/OntologyWorkspace/OntologyLoader.tsx +913 -0
- package/explorer/src/workspaces/OntologyWorkspace/OntologyManager.tsx +930 -0
- package/explorer/src/workspaces/OntologyWorkspace/OntologySearch.tsx +590 -0
- package/explorer/src/workspaces/OntologyWorkspace/ProposalReview.tsx +429 -0
- package/explorer/src/workspaces/OntologyWorkspace/SKOSVocabularyManager.tsx +696 -0
- package/explorer/src/workspaces/OntologyWorkspace/ShaclStudio.tsx +363 -0
- package/explorer/src/workspaces/OntologyWorkspace/VersionsTab.tsx +546 -0
- package/explorer/src/workspaces/OntologyWorkspace/api.ts +164 -0
- package/explorer/src/workspaces/OntologyWorkspace/index.tsx +101 -0
- package/explorer/src/workspaces/OntologyWorkspace/ontologyEditorModel.ts +87 -0
- package/explorer/src/workspaces/OntologyWorkspace/ontologyUrlState.ts +94 -0
- package/explorer/src/workspaces/OntologyWorkspace/types.ts +119 -0
- package/explorer/src/workspaces/ReasoningWorkspace.tsx +243 -0
- package/explorer/src/workspaces/SparqlWorkspace/SparqlWorkspace.tsx +271 -0
- package/explorer/src/workspaces/VocabularyWorkspace/ConceptTree.tsx +97 -0
- package/explorer/src/workspaces/VocabularyWorkspace/ImportDropzone.tsx +95 -0
- package/explorer/src/workspaces/VocabularyWorkspace/PropertyPanel.tsx +116 -0
- package/explorer/src/workspaces/VocabularyWorkspace/Sidebar.tsx +112 -0
- package/explorer/src/workspaces/VocabularyWorkspace/VocabularyWorkspace.tsx +70 -0
- package/explorer/src/workspaces/VocabularyWorkspace/queries.ts +52 -0
- package/explorer/src/workspaces/VocabularyWorkspace/types.ts +24 -0
- package/package.json +31 -0
- package/plugins/.claude-plugin/README.md +262 -0
- package/plugins/.claude-plugin/marketplace.json +20 -0
- package/plugins/.claude-plugin/plugin.json +33 -0
- package/plugins/.cline-plugin/README.md +32 -0
- package/plugins/.cline-plugin/marketplace.json +17 -0
- package/plugins/.cline-plugin/plugin.json +35 -0
- package/plugins/.codex-plugin/marketplace.json +21 -0
- package/plugins/.codex-plugin/plugin.json +35 -0
- package/plugins/.continue-plugin/README.md +34 -0
- package/plugins/.continue-plugin/marketplace.json +17 -0
- package/plugins/.continue-plugin/plugin.json +33 -0
- package/plugins/.cursor-plugin/marketplace.json +18 -0
- package/plugins/.cursor-plugin/plugin.json +32 -0
- package/plugins/.openclaw-plugin/README.md +62 -0
- package/plugins/.openclaw-plugin/marketplace.json +18 -0
- package/plugins/.openclaw-plugin/plugin.json +46 -0
- package/plugins/.pi-plugin/README.md +35 -0
- package/plugins/.vscode-plugin/README.md +48 -0
- package/plugins/.vscode-plugin/marketplace.json +17 -0
- package/plugins/.vscode-plugin/plugin.json +35 -0
- package/plugins/.windsurf-plugin/README.md +39 -0
- package/plugins/.windsurf-plugin/marketplace.json +17 -0
- package/plugins/.windsurf-plugin/plugin.json +35 -0
- package/plugins/agents/decision-advisor.md +126 -0
- package/plugins/agents/explainability.md +129 -0
- package/plugins/agents/kg-assistant.md +73 -0
- package/plugins/hooks/hooks.json +12 -0
- package/plugins/skills/causal/SKILL.md +74 -0
- package/plugins/skills/change/SKILL.md +80 -0
- package/plugins/skills/decision/SKILL.md +197 -0
- package/plugins/skills/deduplicate/SKILL.md +41 -0
- package/plugins/skills/embed/SKILL.md +230 -0
- package/plugins/skills/explain/SKILL.md +44 -0
- package/plugins/skills/export/SKILL.md +67 -0
- package/plugins/skills/extract/SKILL.md +93 -0
- package/plugins/skills/ingest/SKILL.md +38 -0
- package/plugins/skills/ontology/SKILL.md +89 -0
- package/plugins/skills/policy/SKILL.md +66 -0
- package/plugins/skills/provenance/SKILL.md +70 -0
- package/plugins/skills/query/SKILL.md +84 -0
- package/plugins/skills/reason/SKILL.md +201 -0
- package/plugins/skills/temporal/SKILL.md +164 -0
- package/plugins/skills/validate/SKILL.md +228 -0
- package/plugins/skills/visualize/SKILL.md +249 -0
|
@@ -0,0 +1,930 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
AlertCircle,
|
|
4
|
+
BookMarked,
|
|
5
|
+
BookOpen,
|
|
6
|
+
CheckCircle2,
|
|
7
|
+
ExternalLink,
|
|
8
|
+
Layers,
|
|
9
|
+
Loader2,
|
|
10
|
+
Plus,
|
|
11
|
+
RefreshCw,
|
|
12
|
+
Search,
|
|
13
|
+
Trash2,
|
|
14
|
+
ToggleLeft,
|
|
15
|
+
ToggleRight,
|
|
16
|
+
} from "lucide-react";
|
|
17
|
+
import { OntologyLoader } from "./OntologyLoader";
|
|
18
|
+
import { OntologySearch } from "./OntologySearch";
|
|
19
|
+
import { SKOSVocabularyManager } from "./SKOSVocabularyManager";
|
|
20
|
+
|
|
21
|
+
interface OntologyEntry {
|
|
22
|
+
uri: string;
|
|
23
|
+
name: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
format: string;
|
|
26
|
+
status: "published" | "draft" | "external";
|
|
27
|
+
source_url?: string;
|
|
28
|
+
version?: string;
|
|
29
|
+
class_count: number;
|
|
30
|
+
concept_count: number;
|
|
31
|
+
property_count: number;
|
|
32
|
+
loaded_at: string;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
tags: string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type RightPanel = "none" | "search" | "skos";
|
|
38
|
+
|
|
39
|
+
const STATUS_COLORS: Record<string, string> = {
|
|
40
|
+
published: "#4cc38a",
|
|
41
|
+
draft: "#ff7a45",
|
|
42
|
+
external: "#ff2d4b",
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const FORMAT_COLORS: Record<string, string> = {
|
|
46
|
+
turtle: "#9ee8d7",
|
|
47
|
+
xml: "#ff9daf",
|
|
48
|
+
"json-ld": "#ff7a45",
|
|
49
|
+
nt: "#d2a8ff",
|
|
50
|
+
unknown: "#9c7a82",
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
function StatusBadge({ status }: { status: string }) {
|
|
54
|
+
const color = STATUS_COLORS[status] || "#9c7a82";
|
|
55
|
+
return (
|
|
56
|
+
<span
|
|
57
|
+
style={{
|
|
58
|
+
padding: "2px 7px",
|
|
59
|
+
borderRadius: 999,
|
|
60
|
+
fontSize: 10,
|
|
61
|
+
fontWeight: 700,
|
|
62
|
+
letterSpacing: "0.07em",
|
|
63
|
+
textTransform: "uppercase" as const,
|
|
64
|
+
background: `${color}18`,
|
|
65
|
+
border: `1px solid ${color}33`,
|
|
66
|
+
color,
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
{status}
|
|
70
|
+
</span>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function FormatBadge({ format }: { format: string }) {
|
|
75
|
+
const color = FORMAT_COLORS[format] || FORMAT_COLORS.unknown;
|
|
76
|
+
return (
|
|
77
|
+
<span
|
|
78
|
+
style={{
|
|
79
|
+
padding: "2px 7px",
|
|
80
|
+
borderRadius: 999,
|
|
81
|
+
fontSize: 10,
|
|
82
|
+
fontWeight: 700,
|
|
83
|
+
background: `${color}14`,
|
|
84
|
+
border: `1px solid ${color}28`,
|
|
85
|
+
color,
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
{format}
|
|
89
|
+
</span>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function Stat({ value, label }: { value: number; label: string }) {
|
|
94
|
+
return (
|
|
95
|
+
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", gap: 1 }}>
|
|
96
|
+
<span style={{ color: "#fff0f2", fontSize: 14, fontWeight: 800 }}>
|
|
97
|
+
{value.toLocaleString()}
|
|
98
|
+
</span>
|
|
99
|
+
<span style={{ color: "#9c7a82", fontSize: 10 }}>{label}</span>
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function RegistryRow({
|
|
105
|
+
entry,
|
|
106
|
+
selected,
|
|
107
|
+
onSelect,
|
|
108
|
+
onToggle,
|
|
109
|
+
onRefresh,
|
|
110
|
+
onRemove,
|
|
111
|
+
}: {
|
|
112
|
+
entry: OntologyEntry;
|
|
113
|
+
selected: boolean;
|
|
114
|
+
onSelect: (e: OntologyEntry) => void;
|
|
115
|
+
onToggle: (uri: string) => void;
|
|
116
|
+
onRefresh: (uri: string) => void;
|
|
117
|
+
onRemove: (uri: string) => void;
|
|
118
|
+
}) {
|
|
119
|
+
const [busyToggle, setBusyToggle] = useState(false);
|
|
120
|
+
const [busyRefresh, setBusyRefresh] = useState(false);
|
|
121
|
+
const [busyRemove, setBusyRemove] = useState(false);
|
|
122
|
+
|
|
123
|
+
const handleToggle = async (ev: React.MouseEvent) => {
|
|
124
|
+
ev.stopPropagation();
|
|
125
|
+
setBusyToggle(true);
|
|
126
|
+
await onToggle(entry.uri);
|
|
127
|
+
setBusyToggle(false);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const handleRefresh = async (ev: React.MouseEvent) => {
|
|
131
|
+
ev.stopPropagation();
|
|
132
|
+
setBusyRefresh(true);
|
|
133
|
+
await onRefresh(entry.uri);
|
|
134
|
+
setBusyRefresh(false);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const handleRemove = async (ev: React.MouseEvent) => {
|
|
138
|
+
ev.stopPropagation();
|
|
139
|
+
if (!window.confirm(`Remove "${entry.name}" from the registry?`)) return;
|
|
140
|
+
setBusyRemove(true);
|
|
141
|
+
await onRemove(entry.uri);
|
|
142
|
+
setBusyRemove(false);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<div
|
|
147
|
+
onClick={() => onSelect(entry)}
|
|
148
|
+
style={{
|
|
149
|
+
...rowStyle,
|
|
150
|
+
background: selected
|
|
151
|
+
? "rgba(255,45,75,0.1)"
|
|
152
|
+
: "rgba(255,255,255,0.02)",
|
|
153
|
+
borderColor: selected
|
|
154
|
+
? "rgba(255,107,129,0.26)"
|
|
155
|
+
: "rgba(255,107,129,0.1)",
|
|
156
|
+
opacity: entry.enabled ? 1 : 0.55,
|
|
157
|
+
}}
|
|
158
|
+
>
|
|
159
|
+
<div style={rowMainStyle}>
|
|
160
|
+
<div style={{ display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }}>
|
|
161
|
+
<span style={rowNameStyle}>{entry.name}</span>
|
|
162
|
+
<StatusBadge status={entry.status} />
|
|
163
|
+
<FormatBadge format={entry.format} />
|
|
164
|
+
{!entry.enabled && (
|
|
165
|
+
<span style={disabledBadgeStyle}>Disabled</span>
|
|
166
|
+
)}
|
|
167
|
+
</div>
|
|
168
|
+
<div style={rowUriStyle}>{entry.uri}</div>
|
|
169
|
+
{entry.source_url && (
|
|
170
|
+
<a
|
|
171
|
+
href={entry.source_url}
|
|
172
|
+
target="_blank"
|
|
173
|
+
rel="noreferrer"
|
|
174
|
+
onClick={(e) => e.stopPropagation()}
|
|
175
|
+
style={sourceLinkStyle}
|
|
176
|
+
>
|
|
177
|
+
<ExternalLink size={10} />
|
|
178
|
+
{entry.source_url.slice(0, 60)}{entry.source_url.length > 60 ? "…" : ""}
|
|
179
|
+
</a>
|
|
180
|
+
)}
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div style={rowStatsStyle}>
|
|
184
|
+
<Stat value={entry.class_count} label="Classes" />
|
|
185
|
+
<Stat value={entry.concept_count} label="Concepts" />
|
|
186
|
+
<Stat value={entry.property_count} label="Props" />
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<div style={rowActionsStyle}>
|
|
190
|
+
<button
|
|
191
|
+
title={entry.enabled ? "Disable" : "Enable"}
|
|
192
|
+
onClick={handleToggle}
|
|
193
|
+
disabled={busyToggle}
|
|
194
|
+
style={actionBtnStyle}
|
|
195
|
+
>
|
|
196
|
+
{busyToggle ? (
|
|
197
|
+
<Loader2 size={13} style={{ animation: "spin 0.8s linear infinite" }} />
|
|
198
|
+
) : entry.enabled ? (
|
|
199
|
+
<ToggleRight size={15} color="#4cc38a" />
|
|
200
|
+
) : (
|
|
201
|
+
<ToggleLeft size={15} color="#9c7a82" />
|
|
202
|
+
)}
|
|
203
|
+
</button>
|
|
204
|
+
|
|
205
|
+
{entry.source_url && (
|
|
206
|
+
<button
|
|
207
|
+
title="Re-fetch from source URL"
|
|
208
|
+
onClick={handleRefresh}
|
|
209
|
+
disabled={busyRefresh}
|
|
210
|
+
style={actionBtnStyle}
|
|
211
|
+
>
|
|
212
|
+
{busyRefresh ? (
|
|
213
|
+
<Loader2 size={13} style={{ animation: "spin 0.8s linear infinite" }} />
|
|
214
|
+
) : (
|
|
215
|
+
<RefreshCw size={13} color="#ff2d4b" />
|
|
216
|
+
)}
|
|
217
|
+
</button>
|
|
218
|
+
)}
|
|
219
|
+
|
|
220
|
+
<button
|
|
221
|
+
title="Remove from registry"
|
|
222
|
+
onClick={handleRemove}
|
|
223
|
+
disabled={busyRemove}
|
|
224
|
+
style={{ ...actionBtnStyle, color: "#ff9daf" }}
|
|
225
|
+
>
|
|
226
|
+
{busyRemove ? (
|
|
227
|
+
<Loader2 size={13} style={{ animation: "spin 0.8s linear infinite" }} />
|
|
228
|
+
) : (
|
|
229
|
+
<Trash2 size={13} />
|
|
230
|
+
)}
|
|
231
|
+
</button>
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// ---------------------------------------------------------------------------
|
|
238
|
+
// Main component
|
|
239
|
+
// ---------------------------------------------------------------------------
|
|
240
|
+
|
|
241
|
+
export function OntologyManager() {
|
|
242
|
+
const [entries, setEntries] = useState<OntologyEntry[]>([]);
|
|
243
|
+
const [loading, setLoading] = useState(true);
|
|
244
|
+
const [searchQ, setSearchQ] = useState("");
|
|
245
|
+
const [statusFilter, setStatusFilter] = useState<string>("all");
|
|
246
|
+
const [showLoader, setShowLoader] = useState(false);
|
|
247
|
+
const [selectedEntry, setSelectedEntry] = useState<OntologyEntry | null>(null);
|
|
248
|
+
const [rightPanel, setRightPanel] = useState<RightPanel>("none");
|
|
249
|
+
const [actionMsg, setActionMsg] = useState<{ type: "ok" | "err"; text: string } | null>(null);
|
|
250
|
+
|
|
251
|
+
const [prevSearchQ, setPrevSearchQ] = useState(searchQ);
|
|
252
|
+
if (searchQ !== prevSearchQ) {
|
|
253
|
+
setPrevSearchQ(searchQ);
|
|
254
|
+
setLoading(true);
|
|
255
|
+
setActionMsg(null);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const flashMsg = useCallback((type: "ok" | "err", text: string) => {
|
|
259
|
+
setActionMsg({ type, text });
|
|
260
|
+
setTimeout(() => setActionMsg(null), 3000);
|
|
261
|
+
}, []);
|
|
262
|
+
|
|
263
|
+
const fetchRegistry = useCallback(async () => {
|
|
264
|
+
setLoading(true);
|
|
265
|
+
setActionMsg(null);
|
|
266
|
+
try {
|
|
267
|
+
const params = new URLSearchParams();
|
|
268
|
+
if (searchQ) params.set("q", searchQ);
|
|
269
|
+
const res = await fetch(`/api/ontology/registry?${params}`);
|
|
270
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
271
|
+
const data = await res.json();
|
|
272
|
+
setEntries(data);
|
|
273
|
+
if (res.status === 207) flashMsg("err", data.message || "Warning: Partial success loading registry.");
|
|
274
|
+
} catch {
|
|
275
|
+
setEntries([]);
|
|
276
|
+
flashMsg("err", "Failed to load ontology registry");
|
|
277
|
+
} finally {
|
|
278
|
+
setLoading(false);
|
|
279
|
+
}
|
|
280
|
+
}, [searchQ, flashMsg]);
|
|
281
|
+
|
|
282
|
+
useEffect(() => {
|
|
283
|
+
let ignore = false;
|
|
284
|
+
async function fetchInitial() {
|
|
285
|
+
try {
|
|
286
|
+
const params = new URLSearchParams();
|
|
287
|
+
if (searchQ) params.set("q", searchQ);
|
|
288
|
+
const res = await fetch(`/api/ontology/registry?${params}`);
|
|
289
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
290
|
+
const data = await res.json();
|
|
291
|
+
if (ignore) return;
|
|
292
|
+
setEntries(data);
|
|
293
|
+
if (res.status === 207) flashMsg("err", data.message || "Warning: Partial success loading registry.");
|
|
294
|
+
} catch {
|
|
295
|
+
if (!ignore) {
|
|
296
|
+
setEntries([]);
|
|
297
|
+
flashMsg("err", "Failed to load ontology registry");
|
|
298
|
+
}
|
|
299
|
+
} finally {
|
|
300
|
+
if (!ignore) setLoading(false);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
void fetchInitial();
|
|
304
|
+
return () => { ignore = true; };
|
|
305
|
+
}, [searchQ, flashMsg]);
|
|
306
|
+
|
|
307
|
+
const handleToggle = useCallback(async (uri: string) => {
|
|
308
|
+
try {
|
|
309
|
+
const res = await fetch(`/api/ontology/${encodeURIComponent(uri)}/toggle`, {
|
|
310
|
+
method: "PATCH",
|
|
311
|
+
});
|
|
312
|
+
if (!res.ok) throw new Error("Toggle failed");
|
|
313
|
+
const data = await res.json();
|
|
314
|
+
setEntries((prev) =>
|
|
315
|
+
prev.map((e) => (e.uri === uri ? { ...e, enabled: data.enabled } : e))
|
|
316
|
+
);
|
|
317
|
+
} catch {
|
|
318
|
+
flashMsg("err", "Could not toggle ontology");
|
|
319
|
+
}
|
|
320
|
+
}, []);
|
|
321
|
+
|
|
322
|
+
const handleRefresh = useCallback(async (uri: string) => {
|
|
323
|
+
try {
|
|
324
|
+
const res = await fetch(`/api/ontology/${encodeURIComponent(uri)}/refresh`, {
|
|
325
|
+
method: "POST",
|
|
326
|
+
});
|
|
327
|
+
if (!res.ok) throw new Error("Refresh failed");
|
|
328
|
+
flashMsg("ok", "Ontology refreshed");
|
|
329
|
+
fetchRegistry();
|
|
330
|
+
} catch {
|
|
331
|
+
flashMsg("err", "Refresh failed — check source URL");
|
|
332
|
+
}
|
|
333
|
+
}, [fetchRegistry]);
|
|
334
|
+
|
|
335
|
+
const handleRemove = useCallback(async (uri: string) => {
|
|
336
|
+
try {
|
|
337
|
+
const res = await fetch(`/api/ontology/${encodeURIComponent(uri)}`, {
|
|
338
|
+
method: "DELETE",
|
|
339
|
+
});
|
|
340
|
+
if (!res.ok) throw new Error("Remove failed");
|
|
341
|
+
setEntries((prev) => prev.filter((e) => e.uri !== uri));
|
|
342
|
+
if (selectedEntry?.uri === uri) setSelectedEntry(null);
|
|
343
|
+
flashMsg("ok", "Removed from registry");
|
|
344
|
+
} catch {
|
|
345
|
+
flashMsg("err", "Could not remove ontology");
|
|
346
|
+
}
|
|
347
|
+
}, [selectedEntry]);
|
|
348
|
+
|
|
349
|
+
const handleSelect = (entry: OntologyEntry) => {
|
|
350
|
+
setSelectedEntry((prev) => (prev?.uri === entry.uri ? null : entry));
|
|
351
|
+
setRightPanel("none");
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
const handleLoaded = () => {
|
|
355
|
+
setShowLoader(false);
|
|
356
|
+
fetchRegistry();
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
const filteredEntries = entries.filter((e) => {
|
|
360
|
+
if (statusFilter === "owl") return ["owl:Ontology"].includes(e.format) || e.format === "xml" || e.format === "turtle";
|
|
361
|
+
if (statusFilter === "skos") return e.concept_count > 0;
|
|
362
|
+
if (statusFilter === "internal") return e.status === "draft" || e.status === "published";
|
|
363
|
+
if (statusFilter === "external") return e.status === "external";
|
|
364
|
+
return true;
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
const isSKOS = selectedEntry ? selectedEntry.concept_count > 0 : false;
|
|
368
|
+
|
|
369
|
+
return (
|
|
370
|
+
<>
|
|
371
|
+
{showLoader && (
|
|
372
|
+
<OntologyLoader
|
|
373
|
+
onLoaded={handleLoaded}
|
|
374
|
+
onClose={() => setShowLoader(false)}
|
|
375
|
+
/>
|
|
376
|
+
)}
|
|
377
|
+
|
|
378
|
+
<div style={shellStyle}>
|
|
379
|
+
{/* Toolbar */}
|
|
380
|
+
<div style={toolbarStyle}>
|
|
381
|
+
<div style={searchBoxStyle}>
|
|
382
|
+
<Search size={14} color="#9c7a82" />
|
|
383
|
+
<input
|
|
384
|
+
value={searchQ}
|
|
385
|
+
onChange={(e) => setSearchQ(e.target.value)}
|
|
386
|
+
placeholder="Search ontologies by name, URI, or namespace…"
|
|
387
|
+
style={searchInputStyle}
|
|
388
|
+
/>
|
|
389
|
+
</div>
|
|
390
|
+
|
|
391
|
+
<div style={{ display: "flex", gap: 6, flexWrap: "wrap" }}>
|
|
392
|
+
{(["all", "owl", "skos", "internal", "external"] as const).map((f) => (
|
|
393
|
+
<button
|
|
394
|
+
key={f}
|
|
395
|
+
onClick={() => setStatusFilter(f)}
|
|
396
|
+
style={{
|
|
397
|
+
...filterPillBase,
|
|
398
|
+
...(statusFilter === f ? filterPillActive : filterPillIdle),
|
|
399
|
+
}}
|
|
400
|
+
>
|
|
401
|
+
{f === "all" ? "All" : f.toUpperCase()}
|
|
402
|
+
</button>
|
|
403
|
+
))}
|
|
404
|
+
</div>
|
|
405
|
+
|
|
406
|
+
<div style={{ display: "flex", gap: 8, marginLeft: "auto" }}>
|
|
407
|
+
<button
|
|
408
|
+
onClick={() => setRightPanel((p) => (p === "search" ? "none" : "search"))}
|
|
409
|
+
style={{
|
|
410
|
+
...toolBtnStyle,
|
|
411
|
+
...(rightPanel === "search" ? toolBtnActive : {}),
|
|
412
|
+
}}
|
|
413
|
+
>
|
|
414
|
+
<Search size={13} />
|
|
415
|
+
Entity Search
|
|
416
|
+
</button>
|
|
417
|
+
<button
|
|
418
|
+
onClick={() => setShowLoader(true)}
|
|
419
|
+
style={primaryToolBtnStyle}
|
|
420
|
+
>
|
|
421
|
+
<Plus size={13} />
|
|
422
|
+
Load Ontology
|
|
423
|
+
</button>
|
|
424
|
+
</div>
|
|
425
|
+
</div>
|
|
426
|
+
|
|
427
|
+
{actionMsg && (
|
|
428
|
+
<div
|
|
429
|
+
style={{
|
|
430
|
+
...actionMsgStyle,
|
|
431
|
+
borderColor:
|
|
432
|
+
actionMsg.type === "ok"
|
|
433
|
+
? "rgba(76,195,138,0.22)"
|
|
434
|
+
: "rgba(255,157,175,0.22)",
|
|
435
|
+
background:
|
|
436
|
+
actionMsg.type === "ok"
|
|
437
|
+
? "rgba(76,195,138,0.06)"
|
|
438
|
+
: "rgba(255,157,175,0.06)",
|
|
439
|
+
color: actionMsg.type === "ok" ? "#4cc38a" : "#ff9daf",
|
|
440
|
+
}}
|
|
441
|
+
>
|
|
442
|
+
{actionMsg.type === "ok" ? (
|
|
443
|
+
<CheckCircle2 size={13} />
|
|
444
|
+
) : (
|
|
445
|
+
<AlertCircle size={13} />
|
|
446
|
+
)}
|
|
447
|
+
{actionMsg.text}
|
|
448
|
+
</div>
|
|
449
|
+
)}
|
|
450
|
+
|
|
451
|
+
{/* Main content area */}
|
|
452
|
+
<div style={mainAreaStyle}>
|
|
453
|
+
{/* Registry list */}
|
|
454
|
+
<div style={listPanelStyle}>
|
|
455
|
+
{loading ? (
|
|
456
|
+
<div style={centerStyle}>
|
|
457
|
+
<Loader2 size={22} color="#ff2d4b" style={{ animation: "spin 1s linear infinite" }} />
|
|
458
|
+
<span style={{ color: "#c99aa3", fontSize: 13, marginTop: 10 }}>Loading registry…</span>
|
|
459
|
+
</div>
|
|
460
|
+
) : filteredEntries.length === 0 ? (
|
|
461
|
+
<div style={emptyStateStyle}>
|
|
462
|
+
<BookMarked size={36} color="rgba(255,45,75,0.18)" />
|
|
463
|
+
<div style={{ color: "#c99aa3", fontSize: 14, fontWeight: 600, marginTop: 14 }}>
|
|
464
|
+
{searchQ ? "No ontologies match your search" : "No ontologies loaded yet"}
|
|
465
|
+
</div>
|
|
466
|
+
<div style={{ color: "#9c7a82", fontSize: 12, marginTop: 6, textAlign: "center", maxWidth: 300, lineHeight: 1.6 }}>
|
|
467
|
+
{searchQ
|
|
468
|
+
? "Try a different search term or clear the filter."
|
|
469
|
+
: <>Import from a URL, upload a file, or create a new ontology to get started. Click <strong style={{ color: "#ff6b81" }}>Load Ontology</strong> above.</>}
|
|
470
|
+
</div>
|
|
471
|
+
{!searchQ && (
|
|
472
|
+
<button onClick={() => setShowLoader(true)} style={{ ...primaryToolBtnStyle, marginTop: 18 }}>
|
|
473
|
+
<Plus size={13} />
|
|
474
|
+
Load Ontology
|
|
475
|
+
</button>
|
|
476
|
+
)}
|
|
477
|
+
</div>
|
|
478
|
+
) : (
|
|
479
|
+
<div style={listStyle}>
|
|
480
|
+
<div style={listHeaderStyle}>
|
|
481
|
+
<span style={listHeaderTextStyle}>
|
|
482
|
+
{filteredEntries.length} ontolog{filteredEntries.length === 1 ? "y" : "ies"}
|
|
483
|
+
</span>
|
|
484
|
+
</div>
|
|
485
|
+
{filteredEntries.map((entry) => (
|
|
486
|
+
<RegistryRow
|
|
487
|
+
key={entry.uri}
|
|
488
|
+
entry={entry}
|
|
489
|
+
selected={selectedEntry?.uri === entry.uri}
|
|
490
|
+
onSelect={handleSelect}
|
|
491
|
+
onToggle={handleToggle}
|
|
492
|
+
onRefresh={handleRefresh}
|
|
493
|
+
onRemove={handleRemove}
|
|
494
|
+
/>
|
|
495
|
+
))}
|
|
496
|
+
</div>
|
|
497
|
+
)}
|
|
498
|
+
</div>
|
|
499
|
+
|
|
500
|
+
{/* Right panel */}
|
|
501
|
+
{rightPanel === "search" && (
|
|
502
|
+
<div style={rightPanelStyle}>
|
|
503
|
+
<div style={rightPanelHeaderStyle}>
|
|
504
|
+
<span style={rightPanelTitleStyle}>Entity Search</span>
|
|
505
|
+
<button onClick={() => setRightPanel("none")} style={closePanelBtnStyle}>×</button>
|
|
506
|
+
</div>
|
|
507
|
+
<OntologySearch />
|
|
508
|
+
</div>
|
|
509
|
+
)}
|
|
510
|
+
|
|
511
|
+
{rightPanel === "none" && selectedEntry && (
|
|
512
|
+
<div style={rightPanelStyle}>
|
|
513
|
+
<div style={rightPanelHeaderStyle}>
|
|
514
|
+
<span style={rightPanelTitleStyle}>{selectedEntry.name}</span>
|
|
515
|
+
<div style={{ display: "flex", gap: 6 }}>
|
|
516
|
+
{isSKOS && (
|
|
517
|
+
<button
|
|
518
|
+
onClick={() => setRightPanel("skos")}
|
|
519
|
+
style={browseBtnStyle}
|
|
520
|
+
>
|
|
521
|
+
<BookOpen size={12} />
|
|
522
|
+
Browse SKOS
|
|
523
|
+
</button>
|
|
524
|
+
)}
|
|
525
|
+
<button onClick={() => setSelectedEntry(null)} style={closePanelBtnStyle}>×</button>
|
|
526
|
+
</div>
|
|
527
|
+
</div>
|
|
528
|
+
<div style={detailBodyStyle}>
|
|
529
|
+
<DetailSection label="URI">
|
|
530
|
+
<span style={{ fontFamily: "monospace", fontSize: 11, wordBreak: "break-all", color: "#f0cdd3" }}>
|
|
531
|
+
{selectedEntry.uri}
|
|
532
|
+
</span>
|
|
533
|
+
</DetailSection>
|
|
534
|
+
{selectedEntry.description && (
|
|
535
|
+
<DetailSection label="Description">
|
|
536
|
+
<span style={{ color: "#f0cdd3", fontSize: 13, lineHeight: 1.6 }}>
|
|
537
|
+
{selectedEntry.description}
|
|
538
|
+
</span>
|
|
539
|
+
</DetailSection>
|
|
540
|
+
)}
|
|
541
|
+
{selectedEntry.source_url && (
|
|
542
|
+
<DetailSection label="Source URL">
|
|
543
|
+
<a
|
|
544
|
+
href={selectedEntry.source_url}
|
|
545
|
+
target="_blank"
|
|
546
|
+
rel="noreferrer"
|
|
547
|
+
style={{ color: "#ff2d4b", fontSize: 11, wordBreak: "break-all" }}
|
|
548
|
+
>
|
|
549
|
+
{selectedEntry.source_url}
|
|
550
|
+
</a>
|
|
551
|
+
</DetailSection>
|
|
552
|
+
)}
|
|
553
|
+
{selectedEntry.version && (
|
|
554
|
+
<DetailSection label="Version">
|
|
555
|
+
<span style={{ color: "#f0cdd3", fontSize: 12 }}>{selectedEntry.version}</span>
|
|
556
|
+
</DetailSection>
|
|
557
|
+
)}
|
|
558
|
+
{selectedEntry.loaded_at && (
|
|
559
|
+
<DetailSection label="Loaded at">
|
|
560
|
+
<span style={{ color: "#f0cdd3", fontSize: 12 }}>
|
|
561
|
+
{new Date(selectedEntry.loaded_at).toLocaleString()}
|
|
562
|
+
</span>
|
|
563
|
+
</DetailSection>
|
|
564
|
+
)}
|
|
565
|
+
<div style={statRowStyle}>
|
|
566
|
+
<StatBlock value={selectedEntry.class_count} label="Classes" color="#d2a8ff" />
|
|
567
|
+
<StatBlock value={selectedEntry.concept_count} label="Concepts" color="#9ee8d7" />
|
|
568
|
+
<StatBlock value={selectedEntry.property_count} label="Properties" color="#ff7a45" />
|
|
569
|
+
</div>
|
|
570
|
+
{selectedEntry.tags.length > 0 && (
|
|
571
|
+
<DetailSection label="Tags">
|
|
572
|
+
<div style={{ display: "flex", flexWrap: "wrap", gap: 6 }}>
|
|
573
|
+
{selectedEntry.tags.map((tag) => (
|
|
574
|
+
<span key={tag} style={tagChipStyle}>{tag}</span>
|
|
575
|
+
))}
|
|
576
|
+
</div>
|
|
577
|
+
</DetailSection>
|
|
578
|
+
)}
|
|
579
|
+
</div>
|
|
580
|
+
</div>
|
|
581
|
+
)}
|
|
582
|
+
|
|
583
|
+
{rightPanel === "skos" && selectedEntry && (
|
|
584
|
+
<div style={rightPanelStyle}>
|
|
585
|
+
<div style={rightPanelHeaderStyle}>
|
|
586
|
+
<span style={rightPanelTitleStyle}>SKOS — {selectedEntry.name}</span>
|
|
587
|
+
<div style={{ display: "flex", gap: 6 }}>
|
|
588
|
+
<button onClick={() => setRightPanel("none")} style={browseBtnStyle}>
|
|
589
|
+
<Layers size={12} />
|
|
590
|
+
Registry Detail
|
|
591
|
+
</button>
|
|
592
|
+
<button onClick={() => setRightPanel("none")} style={closePanelBtnStyle}>×</button>
|
|
593
|
+
</div>
|
|
594
|
+
</div>
|
|
595
|
+
<SKOSVocabularyManager schemeUri={selectedEntry.uri} />
|
|
596
|
+
</div>
|
|
597
|
+
)}
|
|
598
|
+
</div>
|
|
599
|
+
</div>
|
|
600
|
+
</>
|
|
601
|
+
);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/* ─── sub-components ─────────────────────────────────────────────────── */
|
|
605
|
+
|
|
606
|
+
function DetailSection({ label, children }: { label: string; children: React.ReactNode }) {
|
|
607
|
+
return (
|
|
608
|
+
<div style={{ borderTop: "1px solid rgba(255,255,255,0.05)", paddingTop: 10, paddingBottom: 2 }}>
|
|
609
|
+
<div style={{ color: "#9c7a82", fontSize: 10, fontWeight: 700, textTransform: "uppercase" as const, letterSpacing: "0.07em", marginBottom: 4 }}>
|
|
610
|
+
{label}
|
|
611
|
+
</div>
|
|
612
|
+
{children}
|
|
613
|
+
</div>
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
function StatBlock({ value, label, color }: { value: number; label: string; color: string }) {
|
|
618
|
+
return (
|
|
619
|
+
<div style={{ flex: 1, display: "flex", flexDirection: "column", alignItems: "center", gap: 2, padding: "10px 6px", background: "rgba(255,255,255,0.02)", borderRadius: 8, border: "1px solid rgba(255,255,255,0.05)" }}>
|
|
620
|
+
<span style={{ color, fontSize: 18, fontWeight: 800 }}>{value.toLocaleString()}</span>
|
|
621
|
+
<span style={{ color: "#9c7a82", fontSize: 10 }}>{label}</span>
|
|
622
|
+
</div>
|
|
623
|
+
);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/* ─── styles ─────────────────────────────────────────────────────────── */
|
|
627
|
+
|
|
628
|
+
const shellStyle: React.CSSProperties = {
|
|
629
|
+
display: "flex",
|
|
630
|
+
flexDirection: "column",
|
|
631
|
+
width: "100%",
|
|
632
|
+
height: "100%",
|
|
633
|
+
background: "#0a1525",
|
|
634
|
+
overflow: "hidden",
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
const toolbarStyle: React.CSSProperties = {
|
|
638
|
+
display: "flex",
|
|
639
|
+
alignItems: "center",
|
|
640
|
+
gap: 10,
|
|
641
|
+
padding: "12px 18px",
|
|
642
|
+
borderBottom: "1px solid rgba(255,107,129,0.1)",
|
|
643
|
+
background: "rgba(5,12,22,0.72)",
|
|
644
|
+
flexWrap: "wrap",
|
|
645
|
+
flexShrink: 0,
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
const searchBoxStyle: React.CSSProperties = {
|
|
649
|
+
display: "flex",
|
|
650
|
+
alignItems: "center",
|
|
651
|
+
gap: 8,
|
|
652
|
+
padding: "7px 12px",
|
|
653
|
+
borderRadius: 10,
|
|
654
|
+
border: "1px solid rgba(255,107,129,0.14)",
|
|
655
|
+
background: "rgba(0,0,0,0.24)",
|
|
656
|
+
flex: "0 0 280px",
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
const searchInputStyle: React.CSSProperties = {
|
|
660
|
+
background: "transparent",
|
|
661
|
+
border: "none",
|
|
662
|
+
outline: "none",
|
|
663
|
+
color: "#fff0f2",
|
|
664
|
+
fontSize: 12,
|
|
665
|
+
width: "100%",
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
const filterPillBase: React.CSSProperties = {
|
|
669
|
+
padding: "5px 11px",
|
|
670
|
+
borderRadius: 999,
|
|
671
|
+
border: "1px solid transparent",
|
|
672
|
+
fontSize: 11,
|
|
673
|
+
fontWeight: 700,
|
|
674
|
+
cursor: "pointer",
|
|
675
|
+
transition: "160ms ease",
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
const filterPillIdle: React.CSSProperties = {
|
|
679
|
+
background: "transparent",
|
|
680
|
+
color: "#c99aa3",
|
|
681
|
+
borderColor: "rgba(255,107,129,0.1)",
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
const filterPillActive: React.CSSProperties = {
|
|
685
|
+
background: "rgba(255,45,75,0.14)",
|
|
686
|
+
color: "#fff0f2",
|
|
687
|
+
borderColor: "rgba(255,107,129,0.26)",
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
const toolBtnStyle: React.CSSProperties = {
|
|
691
|
+
display: "inline-flex",
|
|
692
|
+
alignItems: "center",
|
|
693
|
+
gap: 6,
|
|
694
|
+
padding: "7px 12px",
|
|
695
|
+
borderRadius: 8,
|
|
696
|
+
border: "1px solid rgba(255,107,129,0.16)",
|
|
697
|
+
background: "rgba(255,45,75,0.06)",
|
|
698
|
+
color: "#c99aa3",
|
|
699
|
+
fontSize: 12,
|
|
700
|
+
fontWeight: 600,
|
|
701
|
+
cursor: "pointer",
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
const toolBtnActive: React.CSSProperties = {
|
|
705
|
+
background: "rgba(255,45,75,0.16)",
|
|
706
|
+
color: "#fff0f2",
|
|
707
|
+
borderColor: "rgba(255,107,129,0.28)",
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
const primaryToolBtnStyle: React.CSSProperties = {
|
|
711
|
+
display: "inline-flex",
|
|
712
|
+
alignItems: "center",
|
|
713
|
+
gap: 7,
|
|
714
|
+
padding: "7px 14px",
|
|
715
|
+
borderRadius: 9,
|
|
716
|
+
border: "1px solid rgba(255,45,75,0.3)",
|
|
717
|
+
background: "linear-gradient(135deg, rgba(255,45,75,0.2), rgba(255,45,75,0.08))",
|
|
718
|
+
color: "#ff6b81",
|
|
719
|
+
fontSize: 12,
|
|
720
|
+
fontWeight: 700,
|
|
721
|
+
cursor: "pointer",
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
const actionMsgStyle: React.CSSProperties = {
|
|
725
|
+
display: "flex",
|
|
726
|
+
alignItems: "center",
|
|
727
|
+
gap: 8,
|
|
728
|
+
padding: "8px 18px",
|
|
729
|
+
fontSize: 12,
|
|
730
|
+
borderBottom: "1px solid",
|
|
731
|
+
flexShrink: 0,
|
|
732
|
+
};
|
|
733
|
+
|
|
734
|
+
const mainAreaStyle: React.CSSProperties = {
|
|
735
|
+
flex: 1,
|
|
736
|
+
minHeight: 0,
|
|
737
|
+
display: "flex",
|
|
738
|
+
overflow: "hidden",
|
|
739
|
+
};
|
|
740
|
+
|
|
741
|
+
const listPanelStyle: React.CSSProperties = {
|
|
742
|
+
flex: 1,
|
|
743
|
+
minWidth: 0,
|
|
744
|
+
overflowY: "auto",
|
|
745
|
+
borderRight: "1px solid rgba(255,107,129,0.08)",
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
const listStyle: React.CSSProperties = {
|
|
749
|
+
display: "flex",
|
|
750
|
+
flexDirection: "column",
|
|
751
|
+
padding: "12px 14px",
|
|
752
|
+
gap: 8,
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
const listHeaderStyle: React.CSSProperties = {
|
|
756
|
+
paddingBottom: 6,
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
const listHeaderTextStyle: React.CSSProperties = {
|
|
760
|
+
color: "#9c7a82",
|
|
761
|
+
fontSize: 11,
|
|
762
|
+
fontWeight: 700,
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
const rowStyle: React.CSSProperties = {
|
|
766
|
+
display: "flex",
|
|
767
|
+
alignItems: "center",
|
|
768
|
+
gap: 14,
|
|
769
|
+
padding: "12px 14px",
|
|
770
|
+
borderRadius: 12,
|
|
771
|
+
border: "1px solid",
|
|
772
|
+
cursor: "pointer",
|
|
773
|
+
transition: "160ms ease",
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
const rowMainStyle: React.CSSProperties = {
|
|
777
|
+
flex: 1,
|
|
778
|
+
minWidth: 0,
|
|
779
|
+
display: "flex",
|
|
780
|
+
flexDirection: "column",
|
|
781
|
+
gap: 4,
|
|
782
|
+
};
|
|
783
|
+
|
|
784
|
+
const rowNameStyle: React.CSSProperties = {
|
|
785
|
+
color: "#fff0f2",
|
|
786
|
+
fontSize: 14,
|
|
787
|
+
fontWeight: 700,
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
const rowUriStyle: React.CSSProperties = {
|
|
791
|
+
color: "#9c7a82",
|
|
792
|
+
fontSize: 11,
|
|
793
|
+
fontFamily: "monospace",
|
|
794
|
+
overflow: "hidden",
|
|
795
|
+
textOverflow: "ellipsis",
|
|
796
|
+
whiteSpace: "nowrap",
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
const sourceLinkStyle: React.CSSProperties = {
|
|
800
|
+
display: "inline-flex",
|
|
801
|
+
alignItems: "center",
|
|
802
|
+
gap: 4,
|
|
803
|
+
color: "#ff2d4b",
|
|
804
|
+
fontSize: 11,
|
|
805
|
+
textDecoration: "none",
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
const rowStatsStyle: React.CSSProperties = {
|
|
809
|
+
display: "flex",
|
|
810
|
+
gap: 16,
|
|
811
|
+
flexShrink: 0,
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
const rowActionsStyle: React.CSSProperties = {
|
|
815
|
+
display: "flex",
|
|
816
|
+
gap: 4,
|
|
817
|
+
flexShrink: 0,
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
const actionBtnStyle: React.CSSProperties = {
|
|
821
|
+
background: "transparent",
|
|
822
|
+
border: "none",
|
|
823
|
+
cursor: "pointer",
|
|
824
|
+
padding: 5,
|
|
825
|
+
borderRadius: 6,
|
|
826
|
+
display: "grid",
|
|
827
|
+
placeItems: "center",
|
|
828
|
+
color: "#c99aa3",
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
const rightPanelStyle: React.CSSProperties = {
|
|
832
|
+
width: 360,
|
|
833
|
+
flexShrink: 0,
|
|
834
|
+
display: "flex",
|
|
835
|
+
flexDirection: "column",
|
|
836
|
+
borderLeft: "1px solid rgba(255,107,129,0.1)",
|
|
837
|
+
background: "rgba(5,12,22,0.6)",
|
|
838
|
+
overflow: "hidden",
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
const rightPanelHeaderStyle: React.CSSProperties = {
|
|
842
|
+
display: "flex",
|
|
843
|
+
alignItems: "center",
|
|
844
|
+
justifyContent: "space-between",
|
|
845
|
+
padding: "14px 16px",
|
|
846
|
+
borderBottom: "1px solid rgba(255,107,129,0.1)",
|
|
847
|
+
flexShrink: 0,
|
|
848
|
+
};
|
|
849
|
+
|
|
850
|
+
const rightPanelTitleStyle: React.CSSProperties = {
|
|
851
|
+
color: "#fff0f2",
|
|
852
|
+
fontSize: 13,
|
|
853
|
+
fontWeight: 700,
|
|
854
|
+
overflow: "hidden",
|
|
855
|
+
textOverflow: "ellipsis",
|
|
856
|
+
whiteSpace: "nowrap",
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
const closePanelBtnStyle: React.CSSProperties = {
|
|
860
|
+
background: "transparent",
|
|
861
|
+
border: "none",
|
|
862
|
+
color: "#c99aa3",
|
|
863
|
+
cursor: "pointer",
|
|
864
|
+
fontSize: 18,
|
|
865
|
+
lineHeight: 1,
|
|
866
|
+
padding: "0 2px",
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
const browseBtnStyle: React.CSSProperties = {
|
|
870
|
+
display: "inline-flex",
|
|
871
|
+
alignItems: "center",
|
|
872
|
+
gap: 5,
|
|
873
|
+
padding: "4px 10px",
|
|
874
|
+
borderRadius: 7,
|
|
875
|
+
border: "1px solid rgba(255,107,129,0.18)",
|
|
876
|
+
background: "rgba(255,45,75,0.06)",
|
|
877
|
+
color: "#ff6b81",
|
|
878
|
+
fontSize: 11,
|
|
879
|
+
fontWeight: 600,
|
|
880
|
+
cursor: "pointer",
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
const detailBodyStyle: React.CSSProperties = {
|
|
884
|
+
padding: "14px 16px",
|
|
885
|
+
overflowY: "auto",
|
|
886
|
+
flex: 1,
|
|
887
|
+
display: "flex",
|
|
888
|
+
flexDirection: "column",
|
|
889
|
+
gap: 0,
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
const statRowStyle: React.CSSProperties = {
|
|
893
|
+
display: "flex",
|
|
894
|
+
gap: 6,
|
|
895
|
+
marginTop: 12,
|
|
896
|
+
marginBottom: 4,
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
const tagChipStyle: React.CSSProperties = {
|
|
900
|
+
padding: "3px 8px",
|
|
901
|
+
borderRadius: 999,
|
|
902
|
+
background: "rgba(255,255,255,0.04)",
|
|
903
|
+
border: "1px solid rgba(255,255,255,0.08)",
|
|
904
|
+
color: "#c99aa3",
|
|
905
|
+
fontSize: 11,
|
|
906
|
+
};
|
|
907
|
+
|
|
908
|
+
const disabledBadgeStyle: React.CSSProperties = {
|
|
909
|
+
padding: "2px 7px",
|
|
910
|
+
borderRadius: 999,
|
|
911
|
+
fontSize: 10,
|
|
912
|
+
fontWeight: 700,
|
|
913
|
+
background: "rgba(106,127,151,0.12)",
|
|
914
|
+
border: "1px solid rgba(106,127,151,0.2)",
|
|
915
|
+
color: "#9c7a82",
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
const centerStyle: React.CSSProperties = {
|
|
919
|
+
display: "flex",
|
|
920
|
+
flexDirection: "column",
|
|
921
|
+
alignItems: "center",
|
|
922
|
+
justifyContent: "center",
|
|
923
|
+
height: "100%",
|
|
924
|
+
padding: 40,
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
const emptyStateStyle: React.CSSProperties = {
|
|
928
|
+
...centerStyle,
|
|
929
|
+
textAlign: "center",
|
|
930
|
+
};
|