@anlyx/ui 0.1.2 → 0.1.5
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/README.md +3 -2
- package/dist/capture/capture-runtime.d.ts +14 -0
- package/dist/capture/capture-runtime.js +300 -0
- package/dist/components/AnalysisEvidenceList.d.ts +5 -0
- package/dist/components/AnalysisEvidenceList.js +61 -0
- package/dist/components/AnlyxAppShell.d.ts +1 -1
- package/dist/components/AnlyxAppShell.js +16 -7
- package/dist/components/ApiCallList.d.ts +3 -2
- package/dist/components/ApiCallList.js +12 -2
- package/dist/components/CaptureStatusEmptyState.js +2 -2
- package/dist/components/EndpointMapCanvas.js +1 -1
- package/dist/components/FlowStoryView.d.ts +22 -0
- package/dist/components/FlowStoryView.js +117 -0
- package/dist/components/InspectorPanel.d.ts +1 -1
- package/dist/components/InspectorPanel.js +46 -1
- package/dist/components/PageStoryboardView.js +9 -1
- package/dist/components/ProcessFlowView.js +8 -1
- package/dist/components/ReplayControls.d.ts +2 -1
- package/dist/components/ReplayControls.js +29 -2
- package/dist/components/Sidebar.d.ts +2 -2
- package/dist/components/Sidebar.js +15 -3
- package/dist/components/StatusBadge.d.ts +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/mock-data.js +50 -4
- package/dist/overlay/AnlyxFlowEdge.d.ts +2 -0
- package/dist/overlay/AnlyxFlowEdge.js +15 -0
- package/dist/overlay/AnlyxFlowNode.d.ts +13 -0
- package/dist/overlay/AnlyxFlowNode.js +28 -0
- package/dist/overlay/FlowDrawer.d.ts +2 -0
- package/dist/overlay/FlowDrawer.js +59 -0
- package/dist/overlay/MainFlowCanvas.d.ts +20 -0
- package/dist/overlay/MainFlowCanvas.js +285 -0
- package/dist/overlay/RecentApiEventsTable.d.ts +5 -0
- package/dist/overlay/RecentApiEventsTable.js +19 -0
- package/dist/overlay/overlay-entry.d.ts +8 -0
- package/dist/overlay/overlay-entry.js +14 -0
- package/dist/overlay/overlay-ui.css +2 -0
- package/dist/overlay/overlay-ui.js +14 -0
- package/dist/overlay/types.d.ts +38 -0
- package/dist/overlay/types.js +1 -0
- package/dist/overlay/ui.d.ts +18 -0
- package/dist/overlay/ui.js +13 -0
- package/dist/readme-demo/ReadmeDemoApp.d.ts +15 -0
- package/dist/readme-demo/ReadmeDemoApp.js +184 -0
- package/dist/readme-demo/readme-demo-entry.d.ts +1 -0
- package/dist/readme-demo/readme-demo-entry.js +8 -0
- package/dist/styles.css +1165 -38
- package/dist/viewer/ViewerApp.js +26 -16
- package/dist/viewer/styles.css +2639 -0
- package/dist/viewer/viewer-entry.d.ts +1 -0
- package/dist/viewer/viewer-entry.js +1 -0
- package/dist/viewer/workspace/anlyx-logo-transparent.png +0 -0
- package/dist/viewer/workspace/workspace.css +6354 -0
- package/dist/workspace/ScanTreeMap.d.ts +6 -0
- package/dist/workspace/ScanTreeMap.js +838 -0
- package/dist/workspace/WorkspaceApp.d.ts +8 -0
- package/dist/workspace/WorkspaceApp.js +2293 -0
- package/dist/workspace/project-view-model.d.ts +63 -0
- package/dist/workspace/project-view-model.js +170 -0
- package/dist/workspace/workspace.css +6354 -0
- package/package.json +10 -3
package/dist/viewer/ViewerApp.js
CHANGED
|
@@ -1,38 +1,48 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { projectDataSchema } from "@anlyx/core";
|
|
4
|
+
import { WorkspaceApp } from "../workspace/WorkspaceApp.js";
|
|
5
5
|
export function ViewerApp() {
|
|
6
6
|
const [state, setState] = useState({ status: "loading" });
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
let active = true;
|
|
9
|
-
async function
|
|
9
|
+
async function loadViewerData() {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
if (!response.ok) {
|
|
13
|
-
throw new Error(`Failed to fetch report data: ${response.status}`);
|
|
14
|
-
}
|
|
15
|
-
const parsed = scanResultSchema.parse(await response.json());
|
|
11
|
+
const viewerData = await fetchViewerData();
|
|
16
12
|
if (active) {
|
|
17
|
-
setState({ status: "success",
|
|
13
|
+
setState({ status: "success", viewerData });
|
|
18
14
|
}
|
|
19
15
|
}
|
|
20
|
-
catch {
|
|
16
|
+
catch (error) {
|
|
21
17
|
if (active) {
|
|
22
|
-
setState({
|
|
18
|
+
setState({
|
|
19
|
+
status: "error",
|
|
20
|
+
detail: error instanceof Error ? error.message : "Unknown project data loading error"
|
|
21
|
+
});
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
void
|
|
25
|
+
void loadViewerData();
|
|
27
26
|
return () => {
|
|
28
27
|
active = false;
|
|
29
28
|
};
|
|
30
29
|
}, []);
|
|
31
30
|
if (state.status === "loading") {
|
|
32
|
-
return _jsx(
|
|
31
|
+
return (_jsx(ViewerStateCard, { detail: "Reading /api/project-data from the local Anlyx runtime.", label: "Anlyx project data loading", status: "loading", title: "Loading Anlyx project data" }));
|
|
33
32
|
}
|
|
34
33
|
if (state.status === "error") {
|
|
35
|
-
return _jsx(
|
|
34
|
+
return (_jsx(ViewerStateCard, { detail: state.detail, label: "Anlyx project data load failed", status: "error", title: "Failed to load Anlyx project data" }));
|
|
35
|
+
}
|
|
36
|
+
return _jsx(WorkspaceApp, { projectData: state.viewerData.data });
|
|
37
|
+
}
|
|
38
|
+
async function fetchViewerData() {
|
|
39
|
+
const projectResponse = await fetch("/api/project-data");
|
|
40
|
+
if (projectResponse.ok) {
|
|
41
|
+
return { kind: "project", data: projectDataSchema.parse(await projectResponse.json()) };
|
|
36
42
|
}
|
|
37
|
-
|
|
43
|
+
throw new Error(`/api/project-data returned ${projectResponse.status}`);
|
|
44
|
+
}
|
|
45
|
+
function ViewerStateCard({ detail, label, status, title }) {
|
|
46
|
+
const role = status === "error" ? "alert" : "status";
|
|
47
|
+
return (_jsx("main", { className: `anlyx-viewer-state anlyx-viewer-state--${status}`, children: _jsxs("section", { className: "anlyx-viewer-state__card", role: role, "aria-label": label, children: [_jsx("span", { className: "anlyx-viewer-state__eyebrow", children: status === "error" ? "Viewer waiting for project data" : "Preparing local project" }), _jsx("h1", { children: title }), _jsx("p", { children: detail }), status === "error" ? _jsx("p", { children: "Run `anlyx dev` again, then reload." }) : null] }) }));
|
|
38
48
|
}
|