@acta-dev/web 1.0.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/astro.config.mjs +31 -0
- package/package.json +62 -0
- package/public/favicon.png +0 -0
- package/src/components/DocumentSearchList.astro +150 -0
- package/src/components/DocumentView.astro +198 -0
- package/src/components/LanguageSwitcher.tsx +115 -0
- package/src/components/SidebarToggle.tsx +42 -0
- package/src/components/ThemeToggle.tsx +129 -0
- package/src/components/graph/DocumentGraphIsland.tsx +226 -0
- package/src/components/graph/GraphContext.ts +15 -0
- package/src/components/graph/graph.css +330 -0
- package/src/components/graph/layout.ts +48 -0
- package/src/components/graph/nodes.tsx +80 -0
- package/src/components/ui/Button.astro +105 -0
- package/src/components/ui/Chip.astro +147 -0
- package/src/components/ui/Field.astro +29 -0
- package/src/components/ui/Input.astro +34 -0
- package/src/components/ui/Pill.astro +71 -0
- package/src/components/ui/SegmentedControl.astro +105 -0
- package/src/components/ui/Select.astro +41 -0
- package/src/components/ui/Tooltip.astro +94 -0
- package/src/layouts/BaseLayout.astro +147 -0
- package/src/lib/documents.test.ts +175 -0
- package/src/lib/documents.ts +156 -0
- package/src/lib/i18n-client.ts +32 -0
- package/src/lib/i18n.ts +92 -0
- package/src/lib/project.test.ts +24 -0
- package/src/lib/project.ts +120 -0
- package/src/lib/search-client.ts +192 -0
- package/src/lib/search.test.ts +94 -0
- package/src/lib/search.ts +153 -0
- package/src/locales/en/common.json +6 -0
- package/src/locales/en/dashboard.json +8 -0
- package/src/locales/en/documents.json +63 -0
- package/src/locales/en/graph.json +19 -0
- package/src/locales/en/search.json +7 -0
- package/src/locales/en/sidebar.json +25 -0
- package/src/locales/en/validation.json +13 -0
- package/src/locales/ru/common.json +6 -0
- package/src/locales/ru/dashboard.json +8 -0
- package/src/locales/ru/documents.json +63 -0
- package/src/locales/ru/graph.json +19 -0
- package/src/locales/ru/search.json +7 -0
- package/src/locales/ru/sidebar.json +25 -0
- package/src/locales/ru/validation.json +13 -0
- package/src/pages/documents/[id]/index.astro +39 -0
- package/src/pages/graph.astro +54 -0
- package/src/pages/index.astro +41 -0
- package/src/pages/ru/documents/[id]/index.astro +39 -0
- package/src/pages/ru/graph.astro +54 -0
- package/src/pages/ru/index.astro +41 -0
- package/src/pages/ru/search-index-full.json.ts +1 -0
- package/src/pages/ru/search.astro +27 -0
- package/src/pages/ru/validation.astro +63 -0
- package/src/pages/search-index-full.json.ts +12 -0
- package/src/pages/search-index.json.ts +12 -0
- package/src/pages/search.astro +27 -0
- package/src/pages/validation.astro +63 -0
- package/src/styles/global.css +1391 -0
- package/src/styles/themes/dark.css +61 -0
- package/src/styles/themes/light.css +63 -0
- package/src/styles/tokens/primitives.css +32 -0
- package/src/styles/tokens/semantic.css +34 -0
- package/src/styles/tokens/typography.css +28 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
import BaseLayout from "../layouts/BaseLayout.astro";
|
|
3
|
+
import Pill from "../components/ui/Pill.astro";
|
|
4
|
+
import { buildDocumentHref } from "@lib/documents.js";
|
|
5
|
+
import { loadActaWebData } from "@lib/project.js";
|
|
6
|
+
import { defaultLocale, getT, isLocale, localizedHref, type Locale } from "@lib/i18n.js";
|
|
7
|
+
|
|
8
|
+
const { project, validation } = await loadActaWebData();
|
|
9
|
+
const documentsById = new Map(project.documents.map((document) => [document.id, document]));
|
|
10
|
+
|
|
11
|
+
const rawLocale = Astro.currentLocale ?? defaultLocale;
|
|
12
|
+
const locale: Locale = isLocale(rawLocale) ? rawLocale : defaultLocale;
|
|
13
|
+
const t = await getT(locale);
|
|
14
|
+
const severityLabel = (sev: string) => t(`validation:severity.${sev}`);
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<BaseLayout title={t("validation:tab")} description={t("validation:meta")}>
|
|
18
|
+
<section class="page-header">
|
|
19
|
+
<div class="crumbs">
|
|
20
|
+
<span>{t("validation:eyebrow")}</span>
|
|
21
|
+
<span class="grow"></span>
|
|
22
|
+
<Pill
|
|
23
|
+
as="a"
|
|
24
|
+
href={localizedHref(locale, "/validation/")}
|
|
25
|
+
tone={validation.valid ? "success" : "danger"}
|
|
26
|
+
>
|
|
27
|
+
{validation.valid ? t("common:valid") : t("common:needsAttention")}
|
|
28
|
+
</Pill>
|
|
29
|
+
</div>
|
|
30
|
+
<h1>{t("validation:header")}<span class="accent-period">.</span></h1>
|
|
31
|
+
<p class="page-sub">
|
|
32
|
+
{t("validation:counts", { errors: validation.errorCount, warnings: validation.warningCount })}
|
|
33
|
+
</p>
|
|
34
|
+
</section>
|
|
35
|
+
|
|
36
|
+
{
|
|
37
|
+
validation.issues.length === 0 ? (
|
|
38
|
+
<p class="empty-state">{t("validation:empty")}</p>
|
|
39
|
+
) : (
|
|
40
|
+
<section class="issue-list">
|
|
41
|
+
{validation.issues.map((issue) => {
|
|
42
|
+
const document = issue.documentId ? documentsById.get(issue.documentId) : undefined;
|
|
43
|
+
return (
|
|
44
|
+
<article class={`issue severity-${issue.severity}`}>
|
|
45
|
+
<div>
|
|
46
|
+
<strong>{severityLabel(issue.severity)}</strong>
|
|
47
|
+
<span>{issue.ruleId}</span>
|
|
48
|
+
</div>
|
|
49
|
+
<p>{issue.message}</p>
|
|
50
|
+
{document ? (
|
|
51
|
+
<a href={localizedHref(locale, buildDocumentHref(document.id))}>
|
|
52
|
+
{document.id} · {document.title}
|
|
53
|
+
</a>
|
|
54
|
+
) : (
|
|
55
|
+
issue.path && <span class="muted">{issue.path}</span>
|
|
56
|
+
)}
|
|
57
|
+
</article>
|
|
58
|
+
);
|
|
59
|
+
})}
|
|
60
|
+
</section>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
</BaseLayout>
|