Oeffne Kapitel und Dokument auf derselben Arbeitsflaeche, damit Pfad, Rechte und eigene Reihenfolge beim Lesen erhalten bleiben.
Co-authored-by: Cursor <cursoragent@cursor.com>
No files matched your search
@@ -652,6 +652,7 @@ def visible_bindings_for_element(conn, actor: UUID, element: dict) -> list[dict]
|
||||
"context_kind": binding["context_kind"],
|
||||
"context_id": str(binding["context_id"]),
|
||||
"context_title": title,
|
||||
"chapter_id": str(binding["chapter_id"]) if binding.get("chapter_id") else None,
|
||||
}
|
||||
)
|
||||
return result
|
||||
|
||||
@@ -1199,7 +1199,13 @@ def search(q: str, principal: Principal = Depends(get_principal), conn: Connecti
|
||||
"id": str(element["id"]),
|
||||
"title": element["title"],
|
||||
"contexts": [
|
||||
{"kind": item["context_kind"], "id": item["context_id"], "title": item["context_title"]}
|
||||
{
|
||||
"kind": item["context_kind"],
|
||||
"id": item["context_id"],
|
||||
"title": item["context_title"],
|
||||
"binding_id": item["id"],
|
||||
"chapter_id": item.get("chapter_id"),
|
||||
}
|
||||
for item in bindings
|
||||
],
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
# Lieferung der Arbeitsfläche, 17.10.2026
|
||||
|
||||
Lokaler Stand auf `develop`, nicht committed und nicht nach `develop` gepusht. Es gibt deshalb kein Development-Deploy und keinen Production-Stand. `docs/architecture/ARCHITECTURE_DISCOVERY.md` ist unverändert fremde Arbeit.
|
||||
|
||||
## Was benutzbar ist
|
||||
|
||||
Die bestehende Anwendung zeigt Akten, Vorgänge und Teilvorgänge in einer Fläche: dunkelgrüne Navigation, Strukturnavigator, Vorschauzeilen und Leser. Der Ablauf Akte öffnen, Unterakte wählen, Vorgang öffnen, Teilvorgang öffnen, Kapitel wechseln oder anlegen, Inhalt hinzufügen, Reihenfolge ändern, Dokument lesen und ins Kapitel zurückkehren läuft im Bestand.
|
||||
|
||||
Fachlichkeit und serverseitige Rechte sind unverändert. Kapitel bleiben am geöffneten Objekt. „Alle Inhalte“ zeigt die direkten Einträge dieses Objekts, nicht still die Inhalte eines Teilvorgangs. Eigene Reihenfolge liegt serverseitig und bleibt nach Neuladen erhalten. Datumssortierung ist davon getrennt.
|
||||
|
||||
Der Leser hängt an `eintrag` und `kapitel` in der Adresse. Schließen nimmt den Eintrag aus der Adresse und lässt das Kapitel stehen. Ein alter Direktlink auf die bisherige Leserroute landet in dieser Fläche.
|
||||
|
||||
## Logo
|
||||
|
||||
Tsumugu nutzt den offenen Pinsel-Ensō mit Aktenmappe: Vektormaster unter `frontend/brand/`, Symbol hell und dunkel, Favicon 16/32, Apple-Touch-Icon, PWA-Icons einschließlich maskable. Ein Service Worker ist bewusst nicht enthalten; Offline-Schreiben gehört nicht zu dieser Lieferung. Die übrigen Familienlogos liegen im Designpaket unter `C:\Dev\jinkendo-app-design-2026-10-17\assets\`. Andere App-Repositories sind nicht geändert.
|
||||
|
||||
## Bewusste Abweichungen
|
||||
|
||||
- Der sichtbare Objektpfad ist die Vorgangslinie. Die Akte steht daneben als „In Akte“, nicht im selben Breadcrumb. So bleibt der Handlungskontext von der Zuordnung getrennt.
|
||||
- Eine Akte öffnet zuerst ihre direkten Inhalte. Die gemischte Lesesicht heißt „Überblick“ und ist nur Datum sortiert.
|
||||
- Ein Vorgang aus der Akte öffnet die Vorgangsseite im Aktenkontext, er wird nicht in die Akte eingebettet.
|
||||
- Das Kapitel steht im Navigator und in der Liste, nicht im Breadcrumb.
|
||||
- Ohne gewähltes Kapitel ist „Alle Inhalte“ aktiv, nicht das erste Kapitel.
|
||||
- Es gibt weiterhin nur eine Unteraktenebene und eine Teilvorgangsebene.
|
||||
- Ohne Aktenkontext zeigt der Navigator nicht die Geschwister aus dem Aktenbaum.
|
||||
- E-Mail ist kein neuer Fachtyp.
|
||||
- Die Suche öffnet den Treffer mit Eintrag und Kapitel. Sie übergibt dabei nicht zusätzlich den Aktenkontext. Der Vorgang nennt seine Akten, der Handlungskontext ist dann direkt.
|
||||
|
||||
## Prüfung am 17.10.2026
|
||||
|
||||
Geprüft im lokalen Browser gegen eine eigene Datenbank `tsumugu_ui_test` auf einem portablen Postgres, Port 60269. API `http://127.0.0.1:8011`, Oberfläche `http://127.0.0.1:5173`. Nicht gegen `tsumugu` oder `tsumugu_dev`. Die Beispieldaten und das Konto sind fiktiv. Die große Beispielrechnung aus dem Referenzbild ist keine eingebaute Oberfläche.
|
||||
|
||||
Konto nur für diese lokale Datenbank: `pruefung@example.test` / `Beispiel-Pruefung-2026`, Anzeigename Max Lehmann.
|
||||
|
||||
Ausgeführt:
|
||||
|
||||
- Anmeldung, Akte Vermietung, Unterakte Wohnung am Park, Vorgang Nebenkosten 2025, Teilvorgang Belegeinsicht.
|
||||
- Kapitel Belege gewählt, dreiseitiges PDF im Leser, Seite 2 über „Nächste Seite“.
|
||||
- Notiz „Nachtrag zur Prüfung“ im Kapitel Belege angelegt. Zähler danach: Belege 4, Alle Inhalte 6, neues Kapitel Rückfragen 0.
|
||||
- „Notiz zur Belegpruefung“ per Nach-unten hinter die Hausverwaltungszeile geschoben. Nach Neuladen dieselbe Reihenfolge, Leser und Kapitel aus der Adresse wieder da.
|
||||
- Paperless-Referenz ohne Quelle: Leser sagt, Paperless sei nicht verbunden und die Vorschau sei nicht verfügbar.
|
||||
- Schließen des Lesers bleibt im Kapitel Belege.
|
||||
- Suche „Heizkosten“ findet die Abrechnung und die Notiz. Der Treffer öffnet den Leser.
|
||||
- Querverweis öffnet Kautionsabrechnung, ohne das Kapitel mitzunehmen.
|
||||
- Vorgang „Eigenstaendig ohne Akte“ ohne Aktenzeile. „Versicherung Hausrat“ zeigt Ferienhaus und Wohnung am Park, mit gesetztem Handlungskontext.
|
||||
- Breiten: 1920 mit Navigator, Liste und Leser; 1280 mit geteilter Liste und Leser, Struktur über den Schalter; 820 mit kompakter Icon-Leiste und Leser statt Liste, Zurück zum Kapitel; 390 mit Leser ohne globale Leiste und ohne untere Navigation; 360 mit unterer Navigation Start, Vorgänge, Akten, Aufgaben, Mehr und ohne horizontales Überlaufen. Zurück aus dem Leser zeigt wieder die untere Navigation und das Kapitel.
|
||||
|
||||
`npm run build` im Frontend ist durchgelaufen. Die Backend-Suite auf der separaten Datenbank `tsumugu_local_test`: 34 bestanden, 2 Fehler schon beim Aufbau der Paperless-Dateitests wegen verweigertem Zugriff auf `C:\Users\lars\AppData\Local\Temp\pytest-of-lars`. Das ist diese Windows-Umgebung, kein fachlicher Fehlschlag der neuen Fläche.
|
||||
|
||||
Nicht ausgeführt: Ziehen per Drag-and-drop, Pfeiltasten im Leser, Escape zum Schließen. Die Schalter Nach-oben und Nach-unten sowie „Nächste Seite“ sind geprüft.
|
||||
|
||||
Während der Prüfung korrigiert: PDF-Vorschauzeilen zeichnen die erste Seite, geschlossene Zeilenmenüs überdecken nicht mehr die nächste Zeile, der Hinzufügen-Schalter auf dem Handy liegt in der Kopfzeile statt über dem Text, die Struktur lässt den letzten Eintrag über der unteren Navigation frei.
|
||||
|
||||
## Nutzungsrunde
|
||||
|
||||
Dieselbe lokale Oberfläche und dasselbe Konto. Vorschlag, etwa 20 Minuten, eine Person klickt, die andere notiert nur Beobachtetes:
|
||||
|
||||
1. Akte Vermietung, Wohnung am Park, Nebenkosten 2025, Belegeinsicht. Wirkt der Weg lang oder klar?
|
||||
2. Kapitel Belege, die Abrechnung lesen, eine Seite weiter, schließen. Ist das Kapitel danach noch das richtige?
|
||||
3. Eine eigene Notiz anlegen und eine Zeile nach oben oder unten schieben. Seite neu laden.
|
||||
4. Auf einem schmalen Fenster oder Handy: Struktur öffnen, Kapitel wählen, lesen, zurück.
|
||||
5. Suche nach Heizkosten und den Treffer öffnen. Fehlt dabei die Akte als Handlungskontext?
|
||||
|
||||
Keine Wertung vorweg nehmen. Was sich wiederholt, wird Kandidat für eine Regel. Ein einzelner Eindruck bleibt eine Beobachtung.
|
||||
|
||||
## Kandidaten für Jinkendo-Designregeln
|
||||
|
||||
Diese Punkte sind gestaltet, in Tsumugu umgesetzt und in der lokalen Prüfung gesehen. Sie sind nicht alltagsbewährt.
|
||||
|
||||
- Dunkle Markenleiste, warme Arbeitsfläche, Inhalt in Vorschauzeilen, das geöffnete Dokument daneben oder an seiner Stelle.
|
||||
- Struktur und Kapitel gehören zum geöffneten Objekt. Die Akte ist Kontext, nicht eine zweite Elternzeile im Pfad.
|
||||
- Eine Liste. Der Leser ersetzt sie auf schmalen Breiten und steht daneben, sobald genug Platz da ist.
|
||||
- Zurück aus dem Dokument führt ins Kapitel, nicht in eine andere Ebene.
|
||||
- Eigene Reihenfolge ist eine gespeicherte Position. Sortieren nach Datum ist eine Ansicht und kein stilles Umsortieren dieser Position.
|
||||
- Eine fehlende Vorschau zeigt einen benannten Zustand und einen Öffnungsweg, keine erfundene Seite.
|
||||
@@ -6,6 +6,7 @@ COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY index.html vite.config.js ./
|
||||
COPY public ./public
|
||||
COPY src ./src
|
||||
RUN npm run build
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||
<path fill="#085041" d="M 49.21 17.51 L 50.41 18.25 L 51.45 19.16 L 52.41 20.17 L 53.29 21.26 L 54.10 22.43 L 54.80 23.66 L 55.42 24.96 L 55.92 26.30 L 56.32 27.68 L 56.60 29.10 L 56.78 30.53 L 56.84 31.98 L 56.79 33.42 L 56.64 34.86 L 56.39 36.28 L 56.04 37.68 L 55.61 39.05 L 55.10 40.39 L 54.52 41.70 L 53.87 42.97 L 53.16 44.21 L 52.39 45.40 L 51.57 46.56 L 50.69 47.68 L 49.76 48.75 L 48.78 49.78 L 47.75 50.77 L 46.66 51.70 L 45.52 52.57 L 44.34 53.38 L 43.10 54.12 L 41.82 54.79 L 40.49 55.36 L 39.12 55.85 L 37.73 56.23 L 36.30 56.51 L 34.86 56.69 L 33.42 56.75 L 31.98 56.70 L 30.55 56.54 L 29.14 56.27 L 27.76 55.90 L 26.41 55.44 L 25.12 54.88 L 23.87 54.25 L 22.67 53.54 L 21.53 52.78 L 20.44 51.96 L 19.40 51.09 L 18.41 50.19 L 17.47 49.25 L 16.57 48.29 L 15.71 47.31 L 14.89 46.29 L 14.11 45.26 L 13.36 44.20 L 12.65 43.12 L 11.97 42.00 L 11.33 40.86 L 10.74 39.68 L 10.20 38.46 L 9.72 37.22 L 9.31 35.94 L 8.96 34.63 L 8.70 33.29 L 8.53 31.93 L 8.45 30.56 L 8.47 29.18 L 8.60 27.80 L 8.82 26.43 L 9.15 25.08 L 9.59 23.76 L 10.12 22.47 L 10.74 21.23 L 11.45 20.04 L 12.23 18.90 L 13.09 17.81 L 14.01 16.79 L 14.99 15.83 L 16.02 14.93 L 17.09 14.08 L 18.20 13.30 L 19.34 12.57 L 20.51 11.90 L 21.71 11.29 L 22.94 10.74 L 24.19 10.24 L 25.46 9.80 L 26.76 9.43 L 28.08 9.14 L 29.41 8.92 L 30.76 8.78 L 32.11 8.75 L 33.47 8.82 L 34.80 9.02 L 36.09 9.50 L 36.09 9.50 L 34.74 9.55 L 33.42 9.62 L 32.11 9.75 L 30.82 9.96 L 29.56 10.22 L 28.32 10.54 L 27.10 10.91 L 25.91 11.33 L 24.74 11.78 L 23.60 12.28 L 22.47 12.82 L 21.36 13.39 L 20.27 14.01 L 19.20 14.66 L 18.16 15.37 L 17.13 16.12 L 16.14 16.92 L 15.18 17.78 L 14.27 18.70 L 13.41 19.67 L 12.60 20.71 L 11.87 21.80 L 11.21 22.95 L 10.63 24.14 L 10.15 25.38 L 9.76 26.65 L 9.47 27.95 L 9.29 29.27 L 9.20 30.60 L 9.22 31.93 L 9.34 33.26 L 9.54 34.56 L 9.84 35.85 L 10.22 37.10 L 10.66 38.33 L 11.18 39.52 L 11.76 40.67 L 12.38 41.79 L 13.06 42.88 L 13.78 43.93 L 14.54 44.94 L 15.33 45.93 L 16.17 46.88 L 17.04 47.79 L 17.96 48.67 L 18.91 49.51 L 19.91 50.31 L 20.95 51.06 L 22.04 51.76 L 23.17 52.40 L 24.34 52.97 L 25.54 53.46 L 26.79 53.87 L 28.06 54.19 L 29.35 54.41 L 30.66 54.54 L 31.98 54.57 L 33.29 54.49 L 34.59 54.31 L 35.87 54.04 L 37.12 53.67 L 38.34 53.21 L 39.51 52.67 L 40.64 52.07 L 41.73 51.39 L 42.77 50.66 L 43.76 49.89 L 44.70 49.07 L 45.60 48.22 L 46.46 47.33 L 47.28 46.42 L 48.07 45.48 L 48.82 44.52 L 49.54 43.53 L 50.22 42.51 L 50.87 41.47 L 51.48 40.39 L 52.05 39.29 L 52.57 38.14 L 53.04 36.97 L 53.44 35.76 L 53.78 34.53 L 54.04 33.26 L 54.22 31.98 L 54.30 30.68 L 54.30 29.37 L 54.19 28.06 L 53.99 26.76 L 53.69 25.48 L 53.29 24.22 L 52.79 22.99 L 52.21 21.81 L 51.55 20.67 L 50.82 19.58 L 50.02 18.53 L 49.21 17.51 Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,163 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import sharp from "sharp";
|
||||
|
||||
const here = path.dirname(fileURLToPath(import.meta.url));
|
||||
const publicDir = path.resolve(here, "../public");
|
||||
const designDir = "C:/Dev/jinkendo-app-design-2026-10-17/assets";
|
||||
|
||||
function brushRing(cx, cy, r) {
|
||||
const start = -0.7;
|
||||
const end = start + Math.PI * 1.78;
|
||||
const steps = 96;
|
||||
const outer = [];
|
||||
const inner = [];
|
||||
for (let i = 0; i <= steps; i += 1) {
|
||||
const u = i / steps;
|
||||
const angle = start + (end - start) * u;
|
||||
const taper = Math.sin(Math.PI * u) ** 0.62;
|
||||
const wave = 0.55 + 0.45 * Math.sin(u * Math.PI * 2.15 + 0.6);
|
||||
const width = r * 0.2 * taper * wave;
|
||||
const wobble = 1 + 0.028 * Math.sin(u * Math.PI * 6.2);
|
||||
const radius = r * wobble;
|
||||
const x = cx + radius * Math.cos(angle);
|
||||
const y = cy + radius * Math.sin(angle);
|
||||
const nx = Math.cos(angle);
|
||||
const ny = Math.sin(angle);
|
||||
outer.push([x + nx * width * 0.78, y + ny * width * 0.78]);
|
||||
inner.push([x - nx * width * 0.28, y - ny * width * 0.28]);
|
||||
}
|
||||
const point = (pair) => pair.map((value) => value.toFixed(2)).join(" ");
|
||||
let d = `M ${point(outer[0])}`;
|
||||
for (const pair of outer.slice(1)) d += ` L ${point(pair)}`;
|
||||
for (const pair of inner.reverse()) d += ` L ${point(pair)}`;
|
||||
return `${d} Z`;
|
||||
}
|
||||
|
||||
const enso = brushRing(32, 32, 22.5);
|
||||
const ensoSmall = brushRing(32, 32, 23.5);
|
||||
|
||||
const glyphs = {
|
||||
tsumugu: `
|
||||
<path fill="currentColor" opacity=".72" d="M37.2 25.2h11.2v13.2h-1.8V27.4H38.6z"/>
|
||||
<path fill="currentColor" d="M22.8 29.2h8.8l1.7 2.2h10.2V44H22.8z"/>
|
||||
<path fill="currentColor" opacity=".45" d="M26.2 34.2h6.4v1.3h-6.4zm0 2.8h4.5v1.3h-4.5z"/>`,
|
||||
tsumuguSmall: `
|
||||
<path fill="currentColor" d="M20 28.5h10l2 2.4h12V46H20z"/>
|
||||
<path fill="currentColor" opacity=".7" d="M34 24h12v12h-2.2V27.2H35.6z"/>`,
|
||||
mitai: `
|
||||
<g fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="32" cy="22.5" r="2.3" fill="currentColor" stroke="none"/>
|
||||
<path d="M32 25v6.5M27.2 28.2 32 30.2l4.8-2M32 31.5 28.6 39M32 31.5l3.4 7.5"/>
|
||||
<path d="M18.5 41.5h5.2l1.7-3.6 1.8 5.2 2-6.2 1.7 4.6h8.2"/>
|
||||
</g>`,
|
||||
shinkan: `
|
||||
<g fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="25.5" cy="24" r="2.2" fill="currentColor" stroke="none"/>
|
||||
<path d="M25.5 26.4 29 31.2l4.2-2.2M29 31.2 24.2 37.2M29 31.2l4.6 2.2 1.8 5.2"/>
|
||||
<rect x="37.5" y="26.5" width="9.5" height="12" rx="1.2"/>
|
||||
<path d="M39.6 30h5.4M39.6 33h5.4M39.6 36h3.6"/>
|
||||
</g>`,
|
||||
kairo: `
|
||||
<g fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path fill="none" d="M19.5 42.5 27.5 34.5 34.5 38.5 43 25"/>
|
||||
<circle cx="19.5" cy="42.5" r="2.1" stroke="none"/>
|
||||
<circle cx="27.5" cy="34.5" r="2.1" stroke="none"/>
|
||||
<circle cx="34.5" cy="38.5" r="2.1" stroke="none"/>
|
||||
<circle cx="43" cy="25" r="2.1" stroke="none"/>
|
||||
<path fill="currentColor" stroke="none" d="M43 23.2h8.2l-2.3 2.6 2.3 2.6H43z"/>
|
||||
</g>`,
|
||||
kansho: `
|
||||
<path fill="currentColor" fill-rule="evenodd" d="M25 34.5c.4-8.2 6.4-13.4 13.2-12.6 2.6.4 4.6 2 5.6 4.2 1.6-.6 3.4-.2 4.2 1.4-.8 1.4-2.2 2-3.6 1.8.4 2.2.2 4.2-.8 5.8-2.4 3.6-6.4 5.4-10.4 5-5.4-.4-8.6-4.2-8.2-10.6z M39.2 27.2l.9 1.8 2 .2-1.5 1.3.5 2-1.9-1.1-1.9 1.1.5-2-1.5-1.3 2-.2z"/>`,
|
||||
};
|
||||
|
||||
function symbolSvg({ glyph, small = false }) {
|
||||
const ring = small ? ensoSmall : enso;
|
||||
return `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
|
||||
<path fill="currentColor" d="${ring}"/>
|
||||
${glyph}
|
||||
</svg>
|
||||
`;
|
||||
}
|
||||
|
||||
function iconSvg(glyph, { maskable = false } = {}) {
|
||||
const scale = maskable ? 0.62 : 0.74;
|
||||
const offset = (64 - 64 * scale) / 2;
|
||||
return `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||
<rect width="64" height="64" fill="#085041"/>
|
||||
<g transform="translate(${offset.toFixed(2)} ${offset.toFixed(2)}) scale(${scale})" color="#9FE1CB">
|
||||
<path fill="currentColor" d="${enso}"/>
|
||||
${glyph}
|
||||
</g>
|
||||
</svg>
|
||||
`;
|
||||
}
|
||||
|
||||
function write(file, contents) {
|
||||
fs.mkdirSync(path.dirname(file), { recursive: true });
|
||||
fs.writeFileSync(file, contents);
|
||||
}
|
||||
|
||||
const products = [
|
||||
["mitai", "Mitai", "Körper und Gesundheit"],
|
||||
["shinkan", "Shinkan", "Training planen"],
|
||||
["kairo", "Kairo", "Vorhaben steuern"],
|
||||
["kansho", "Kanshō", "Reflektieren und verstehen"],
|
||||
["tsumugu", "Tsumugu", "Unterlagen ordnen"],
|
||||
];
|
||||
|
||||
write(path.join(here, "enso-master.svg"), `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||
<path fill="#085041" d="${enso}"/>
|
||||
</svg>
|
||||
`);
|
||||
write(path.join(publicDir, "brand/tsumugu-symbol.svg"), symbolSvg({ glyph: glyphs.tsumugu }).replaceAll("currentColor", "#085041"));
|
||||
write(path.join(publicDir, "brand/tsumugu-symbol-on-dark.svg"), symbolSvg({ glyph: glyphs.tsumugu }).replaceAll("currentColor", "#9FE1CB"));
|
||||
write(path.join(publicDir, "brand/tsumugu-small.svg"), symbolSvg({ glyph: glyphs.tsumuguSmall, small: true }).replaceAll("currentColor", "#9FE1CB"));
|
||||
write(path.join(publicDir, "favicon.svg"), iconSvg(glyphs.tsumuguSmall));
|
||||
|
||||
write(path.join(here, "../src/enso-path.js"), `export const ENSO_PATH = ${JSON.stringify(enso)};\n`);
|
||||
|
||||
for (const [id, title, subtitle] of products) {
|
||||
const glyph = glyphs[id];
|
||||
const master = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 220">
|
||||
<rect width="360" height="220" rx="28" fill="#085041"/>
|
||||
<g transform="translate(118 28) scale(1.9)" color="#9FE1CB">
|
||||
<path fill="currentColor" d="${enso}"/>
|
||||
${glyph}
|
||||
</g>
|
||||
<text x="180" y="176" text-anchor="middle" font-family="Segoe UI, sans-serif" font-size="28" font-weight="700" fill="#f7fbf8">${title}</text>
|
||||
<text x="180" y="200" text-anchor="middle" font-family="Segoe UI, sans-serif" font-size="14" fill="#9FE1CB">${subtitle}</text>
|
||||
</svg>
|
||||
`;
|
||||
write(path.join(designDir, `${id}-master.svg`), master);
|
||||
write(path.join(designDir, `${id}-symbol-on-dark.svg`), symbolSvg({ glyph }).replaceAll("currentColor", "#9FE1CB"));
|
||||
write(path.join(designDir, `${id}-symbol-on-light.svg`), symbolSvg({ glyph }).replaceAll("currentColor", "#085041"));
|
||||
write(path.join(designDir, `${id}-icon.svg`), iconSvg(glyph));
|
||||
write(path.join(designDir, `${id}-maskable.svg`), iconSvg(glyph, { maskable: true }));
|
||||
}
|
||||
|
||||
async function png(svg, file, size) {
|
||||
await sharp(Buffer.from(svg)).resize(size, size).png().toFile(file);
|
||||
}
|
||||
|
||||
const tsumuguIcon = iconSvg(glyphs.tsumugu);
|
||||
const tsumuguMask = iconSvg(glyphs.tsumugu, { maskable: true });
|
||||
const tsumuguSmallIcon = iconSvg(glyphs.tsumuguSmall);
|
||||
await png(tsumuguSmallIcon, path.join(publicDir, "favicon-16.png"), 16);
|
||||
await png(tsumuguSmallIcon, path.join(publicDir, "favicon-32.png"), 32);
|
||||
await png(tsumuguIcon, path.join(publicDir, "apple-touch-icon.png"), 180);
|
||||
await png(tsumuguIcon, path.join(publicDir, "icons/icon-192.png"), 192);
|
||||
await png(tsumuguIcon, path.join(publicDir, "icons/icon-512.png"), 512);
|
||||
await png(tsumuguMask, path.join(publicDir, "icons/icon-maskable-512.png"), 512);
|
||||
|
||||
for (const [id] of products) {
|
||||
const svg = fs.readFileSync(path.join(designDir, `${id}-icon.svg`));
|
||||
await png(svg, path.join(designDir, `${id}-32.png`), 32);
|
||||
await png(svg, path.join(designDir, `${id}-192.png`), 192);
|
||||
}
|
||||
console.log("icons written");
|
||||
@@ -2,8 +2,16 @@
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
||||
<meta name="theme-color" content="#085041" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-title" content="Tsumugu" />
|
||||
<title>Tsumugu</title>
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
||||
<link rel="icon" href="/favicon-32.png" sizes="32x32" type="image/png" />
|
||||
<link rel="icon" href="/favicon-16.png" sizes="16x16" type="image/png" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<link rel="manifest" href="/manifest.webmanifest" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -6,12 +6,14 @@
|
||||
"": {
|
||||
"name": "tsumugu-frontend",
|
||||
"dependencies": {
|
||||
"pdfjs-dist": "^4.10.38",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"react-router-dom": "6.28.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-react": "4.3.4",
|
||||
"sharp": "^0.35.5",
|
||||
"vite": "5.4.11"
|
||||
}
|
||||
},
|
||||
@@ -298,6 +300,17 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emnapi/runtime": {
|
||||
"version": "1.11.3",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz",
|
||||
"integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",
|
||||
@@ -689,6 +702,533 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/colour": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz",
|
||||
"integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-darwin-arm64": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz",
|
||||
"integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-darwin-arm64": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-darwin-x64": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz",
|
||||
"integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-darwin-x64": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-freebsd-wasm32": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz",
|
||||
"integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"dependencies": {
|
||||
"@img/sharp-wasm32": "0.35.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-darwin-arm64": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz",
|
||||
"integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-darwin-x64": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz",
|
||||
"integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-arm": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz",
|
||||
"integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-arm64": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz",
|
||||
"integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-ppc64": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz",
|
||||
"integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-riscv64": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz",
|
||||
"integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-s390x": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz",
|
||||
"integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-x64": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz",
|
||||
"integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linuxmusl-arm64": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz",
|
||||
"integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linuxmusl-x64": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz",
|
||||
"integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-arm": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz",
|
||||
"integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-arm": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-arm64": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz",
|
||||
"integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-arm64": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-ppc64": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz",
|
||||
"integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-ppc64": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-riscv64": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz",
|
||||
"integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-riscv64": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-s390x": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz",
|
||||
"integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-s390x": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-x64": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz",
|
||||
"integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-x64": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linuxmusl-arm64": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz",
|
||||
"integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linuxmusl-arm64": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linuxmusl-x64": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz",
|
||||
"integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linuxmusl-x64": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-wasm32": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz",
|
||||
"integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@emnapi/runtime": "^1.11.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-webcontainers-wasm32": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz",
|
||||
"integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==",
|
||||
"cpu": [
|
||||
"wasm32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@img/sharp-wasm32": "0.35.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-win32-arm64": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz",
|
||||
"integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0 AND LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-win32-ia32": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz",
|
||||
"integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0 AND LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-win32-x64": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz",
|
||||
"integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "Apache-2.0 AND LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.3.13",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
|
||||
@@ -739,6 +1279,256 @@
|
||||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.100.tgz",
|
||||
"integrity": "sha512-xglYA6q3XO5P3BNJYxVZ1IV7DLVjp1Py6nwag88YntrS+3vKHyYcMqXVS4ZztJmwz2uGvz1FWhI/4LgbR5uQDA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"workspaces": [
|
||||
"e2e/*"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@napi-rs/canvas-android-arm64": "0.1.100",
|
||||
"@napi-rs/canvas-darwin-arm64": "0.1.100",
|
||||
"@napi-rs/canvas-darwin-x64": "0.1.100",
|
||||
"@napi-rs/canvas-linux-arm-gnueabihf": "0.1.100",
|
||||
"@napi-rs/canvas-linux-arm64-gnu": "0.1.100",
|
||||
"@napi-rs/canvas-linux-arm64-musl": "0.1.100",
|
||||
"@napi-rs/canvas-linux-riscv64-gnu": "0.1.100",
|
||||
"@napi-rs/canvas-linux-x64-gnu": "0.1.100",
|
||||
"@napi-rs/canvas-linux-x64-musl": "0.1.100",
|
||||
"@napi-rs/canvas-win32-arm64-msvc": "0.1.100",
|
||||
"@napi-rs/canvas-win32-x64-msvc": "0.1.100"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas-android-arm64": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.100.tgz",
|
||||
"integrity": "sha512-hjhCKhntPv9+t4ckHymdx0phYNcVW+GKQR6Lzw2zE+pOVjOplSmtx9nNNknTjbEDLcuLZqA1y8ufKg1XfgftzQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas-darwin-arm64": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.100.tgz",
|
||||
"integrity": "sha512-2PcswRaC7Ly645DGt88///zuFDhJxJYdKAs1uU3mfk1atYkXufgcgLfBpk6Tm12nCQBaNt1wpybuPZ4qOhTo8A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas-darwin-x64": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.100.tgz",
|
||||
"integrity": "sha512-ePNZtj7pNIva/siZMg+HmbeozkIjqUIYdoymH8HaA3qK7LfzFN4WMBM8G6HQ9ZC+H3+Dnn5pqtiXpgLykaPOhw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas-linux-arm-gnueabihf": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.100.tgz",
|
||||
"integrity": "sha512-d5cDB48oWFGU8/XPhUOFAlySgb/VAu7D+s8fi55K1Pcfg8aPplHWqMgibhVLU8ky7Pyg/fuiVLz4Nf3JrSTuUA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas-linux-arm64-gnu": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.100.tgz",
|
||||
"integrity": "sha512-rDxgxRu69RvDlX/bh9o22DxLsGr8EqsNgotL9+RwQE1S0b0cqeatqsw6aW45mukm0B42DIAaAacKaYQ8cqS1nw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas-linux-arm64-musl": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.100.tgz",
|
||||
"integrity": "sha512-K3mDW66N+xT2/V439u1alFANiBUjdEx2gLiNYnCmUsva5jZMxWTjafBYwTzYK+EMFMHrUoabuU+T1BIP5CgbYQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas-linux-riscv64-gnu": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.100.tgz",
|
||||
"integrity": "sha512-mooqUBTIsccZpnoQC4NgrC1v6C1vof39etLNMnBwCY+p0gajWJvAHLGQ6g/gGyS5YrpDW+GefSN4+Cvcr08UWw==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas-linux-x64-gnu": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.100.tgz",
|
||||
"integrity": "sha512-1eCvkDCazm7FFhsT7DfGOdSaHgZVK3bt/dSBl5EWHOWmnz+I7j8tPseJqqD81NF+MH21jKUK4wQSDjN0mdhnTg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas-linux-x64-musl": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.100.tgz",
|
||||
"integrity": "sha512-20arT6lnI19S68qNlii73TSEDbECNgzMz2EpldC1V3mZFuRkeujXkcebRk0LRJe9SEUAooYiLokfMViY8IX7yA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas-win32-arm64-msvc": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-arm64-msvc/-/canvas-win32-arm64-msvc-0.1.100.tgz",
|
||||
"integrity": "sha512-DZFFT1wIAg37LJw37yhMRFfjATd3vTQzjZ1Yki8u2vhO6Hi5VE6BVaGQ1aaDu7xb4iMErz+9EOwjpS7xcxFeBw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/canvas-win32-x64-msvc": {
|
||||
"version": "0.1.100",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.100.tgz",
|
||||
"integrity": "sha512-MyT1j3mHC2+Lu4pBi9mKyMJhtP6U7k7EldY7sj/uS5gJA65gTXt8MefJQXLJo5d/vZbuWmfxzkEUNc/urV3pHA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/lzma-linux-x64-gnu": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz",
|
||||
@@ -1281,6 +2071,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/detect-libc": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
||||
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.5.458",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.458.tgz",
|
||||
@@ -1452,6 +2252,18 @@
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/pdfjs-dist": {
|
||||
"version": "4.10.38",
|
||||
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.10.38.tgz",
|
||||
"integrity": "sha512-/Y3fcFrXEAsMjJXeL9J8+ZG9U01LbuWaYypvDW2ycW1jL269L3js3DVBjDJ0Up9Np1uqDXsDrRihHANhZOlwdQ==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@napi-rs/canvas": "^0.1.65"
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
|
||||
@@ -1622,6 +2434,69 @@
|
||||
"semver": "bin/semver.js"
|
||||
}
|
||||
},
|
||||
"node_modules/sharp": {
|
||||
"version": "0.35.5",
|
||||
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz",
|
||||
"integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@img/colour": "^1.1.0",
|
||||
"detect-libc": "^2.1.2",
|
||||
"semver": "^7.8.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-darwin-arm64": "0.35.5",
|
||||
"@img/sharp-darwin-x64": "0.35.5",
|
||||
"@img/sharp-freebsd-wasm32": "0.35.5",
|
||||
"@img/sharp-libvips-darwin-arm64": "1.3.4",
|
||||
"@img/sharp-libvips-darwin-x64": "1.3.4",
|
||||
"@img/sharp-libvips-linux-arm": "1.3.4",
|
||||
"@img/sharp-libvips-linux-arm64": "1.3.4",
|
||||
"@img/sharp-libvips-linux-ppc64": "1.3.4",
|
||||
"@img/sharp-libvips-linux-riscv64": "1.3.4",
|
||||
"@img/sharp-libvips-linux-s390x": "1.3.4",
|
||||
"@img/sharp-libvips-linux-x64": "1.3.4",
|
||||
"@img/sharp-libvips-linuxmusl-arm64": "1.3.4",
|
||||
"@img/sharp-libvips-linuxmusl-x64": "1.3.4",
|
||||
"@img/sharp-linux-arm": "0.35.5",
|
||||
"@img/sharp-linux-arm64": "0.35.5",
|
||||
"@img/sharp-linux-ppc64": "0.35.5",
|
||||
"@img/sharp-linux-riscv64": "0.35.5",
|
||||
"@img/sharp-linux-s390x": "0.35.5",
|
||||
"@img/sharp-linux-x64": "0.35.5",
|
||||
"@img/sharp-linuxmusl-arm64": "0.35.5",
|
||||
"@img/sharp-linuxmusl-x64": "0.35.5",
|
||||
"@img/sharp-webcontainers-wasm32": "0.35.5",
|
||||
"@img/sharp-win32-arm64": "0.35.5",
|
||||
"@img/sharp-win32-ia32": "0.35.5",
|
||||
"@img/sharp-win32-x64": "0.35.5"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/node": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/sharp/node_modules/semver": {
|
||||
"version": "7.8.5",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
|
||||
"integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
|
||||
@@ -1632,6 +2507,14 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
||||
"dev": true,
|
||||
"license": "0BSD",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/update-browserslist-db": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz",
|
||||
|
||||
@@ -8,12 +8,14 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"pdfjs-dist": "^4.10.38",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"react-router-dom": "6.28.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-react": "4.3.4",
|
||||
"sharp": "^0.35.5",
|
||||
"vite": "5.4.11"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.7 KiB |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
|
||||
<path fill="#9FE1CB" d="M 49.97 16.86 L 51.22 17.64 L 52.31 18.59 L 53.32 19.65 L 54.24 20.79 L 55.08 22.00 L 55.82 23.29 L 56.46 24.64 L 56.98 26.04 L 57.40 27.49 L 57.70 28.97 L 57.88 30.47 L 57.94 31.97 L 57.89 33.48 L 57.73 34.99 L 57.47 36.47 L 57.11 37.93 L 56.66 39.37 L 56.13 40.77 L 55.52 42.13 L 54.85 43.46 L 54.10 44.75 L 53.30 46.00 L 52.44 47.21 L 51.52 48.38 L 50.55 49.50 L 49.52 50.57 L 48.44 51.60 L 47.31 52.57 L 46.13 53.49 L 44.89 54.33 L 43.59 55.11 L 42.25 55.80 L 40.87 56.40 L 39.44 56.91 L 37.98 57.31 L 36.49 57.60 L 34.99 57.78 L 33.48 57.85 L 31.98 57.80 L 30.48 57.63 L 29.01 57.35 L 27.57 56.96 L 26.17 56.48 L 24.81 55.90 L 23.51 55.24 L 22.26 54.50 L 21.06 53.70 L 19.92 52.84 L 18.84 51.94 L 17.80 51.00 L 16.82 50.02 L 15.88 49.02 L 14.99 47.99 L 14.13 46.93 L 13.31 45.85 L 12.53 44.74 L 11.79 43.61 L 11.08 42.45 L 10.41 41.25 L 9.80 40.02 L 9.23 38.75 L 8.73 37.45 L 8.30 36.11 L 7.94 34.74 L 7.67 33.35 L 7.49 31.93 L 7.41 30.49 L 7.43 29.05 L 7.56 27.61 L 7.79 26.18 L 8.14 24.77 L 8.59 23.39 L 9.14 22.05 L 9.79 20.75 L 10.53 19.50 L 11.36 18.31 L 12.25 17.18 L 13.21 16.12 L 14.24 15.11 L 15.31 14.17 L 16.43 13.29 L 17.58 12.47 L 18.78 11.71 L 20.00 11.01 L 21.25 10.37 L 22.53 9.79 L 23.84 9.27 L 25.17 8.82 L 26.53 8.43 L 27.90 8.12 L 29.30 7.89 L 30.71 7.75 L 32.12 7.71 L 33.53 7.79 L 34.93 8.00 L 36.27 8.50 L 36.27 8.50 L 34.86 8.55 L 33.48 8.62 L 32.11 8.77 L 30.77 8.98 L 29.45 9.25 L 28.16 9.59 L 26.89 9.97 L 25.64 10.41 L 24.42 10.88 L 23.22 11.40 L 22.05 11.96 L 20.89 12.56 L 19.75 13.21 L 18.63 13.89 L 17.54 14.63 L 16.47 15.41 L 15.44 16.25 L 14.44 17.15 L 13.48 18.11 L 12.58 19.13 L 11.74 20.21 L 10.97 21.35 L 10.28 22.54 L 9.68 23.79 L 9.18 25.08 L 8.77 26.42 L 8.47 27.77 L 8.28 29.15 L 8.19 30.54 L 8.21 31.93 L 8.33 33.31 L 8.55 34.68 L 8.85 36.02 L 9.25 37.33 L 9.72 38.61 L 10.26 39.85 L 10.86 41.06 L 11.51 42.23 L 12.22 43.36 L 12.97 44.46 L 13.76 45.52 L 14.59 46.55 L 15.47 47.54 L 16.38 48.49 L 17.33 49.41 L 18.33 50.29 L 19.37 51.13 L 20.46 51.91 L 21.59 52.64 L 22.77 53.30 L 24.00 53.90 L 25.26 54.41 L 26.56 54.84 L 27.89 55.17 L 29.24 55.41 L 30.60 55.54 L 31.98 55.57 L 33.35 55.49 L 34.70 55.30 L 36.04 55.02 L 37.35 54.63 L 38.62 54.15 L 39.85 53.59 L 41.03 52.96 L 42.16 52.25 L 43.25 51.49 L 44.28 50.68 L 45.27 49.83 L 46.21 48.94 L 47.11 48.01 L 47.96 47.06 L 48.78 46.08 L 49.57 45.07 L 50.32 44.04 L 51.03 42.98 L 51.71 41.89 L 52.35 40.77 L 52.94 39.61 L 53.49 38.42 L 53.97 37.19 L 54.40 35.93 L 54.75 34.64 L 55.02 33.32 L 55.20 31.98 L 55.30 30.62 L 55.29 29.25 L 55.18 27.88 L 54.97 26.53 L 54.65 25.19 L 54.23 23.87 L 53.72 22.59 L 53.11 21.36 L 52.42 20.16 L 51.66 19.02 L 50.83 17.93 L 49.97 16.86 Z"/>
|
||||
|
||||
<path fill="#9FE1CB" d="M20 28.5h10l2 2.4h12V46H20z"/>
|
||||
<path fill="#9FE1CB" opacity=".7" d="M34 24h12v12h-2.2V27.2H35.6z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
|
||||
<path fill="#9FE1CB" d="M 49.21 17.51 L 50.41 18.25 L 51.45 19.16 L 52.41 20.17 L 53.29 21.26 L 54.10 22.43 L 54.80 23.66 L 55.42 24.96 L 55.92 26.30 L 56.32 27.68 L 56.60 29.10 L 56.78 30.53 L 56.84 31.98 L 56.79 33.42 L 56.64 34.86 L 56.39 36.28 L 56.04 37.68 L 55.61 39.05 L 55.10 40.39 L 54.52 41.70 L 53.87 42.97 L 53.16 44.21 L 52.39 45.40 L 51.57 46.56 L 50.69 47.68 L 49.76 48.75 L 48.78 49.78 L 47.75 50.77 L 46.66 51.70 L 45.52 52.57 L 44.34 53.38 L 43.10 54.12 L 41.82 54.79 L 40.49 55.36 L 39.12 55.85 L 37.73 56.23 L 36.30 56.51 L 34.86 56.69 L 33.42 56.75 L 31.98 56.70 L 30.55 56.54 L 29.14 56.27 L 27.76 55.90 L 26.41 55.44 L 25.12 54.88 L 23.87 54.25 L 22.67 53.54 L 21.53 52.78 L 20.44 51.96 L 19.40 51.09 L 18.41 50.19 L 17.47 49.25 L 16.57 48.29 L 15.71 47.31 L 14.89 46.29 L 14.11 45.26 L 13.36 44.20 L 12.65 43.12 L 11.97 42.00 L 11.33 40.86 L 10.74 39.68 L 10.20 38.46 L 9.72 37.22 L 9.31 35.94 L 8.96 34.63 L 8.70 33.29 L 8.53 31.93 L 8.45 30.56 L 8.47 29.18 L 8.60 27.80 L 8.82 26.43 L 9.15 25.08 L 9.59 23.76 L 10.12 22.47 L 10.74 21.23 L 11.45 20.04 L 12.23 18.90 L 13.09 17.81 L 14.01 16.79 L 14.99 15.83 L 16.02 14.93 L 17.09 14.08 L 18.20 13.30 L 19.34 12.57 L 20.51 11.90 L 21.71 11.29 L 22.94 10.74 L 24.19 10.24 L 25.46 9.80 L 26.76 9.43 L 28.08 9.14 L 29.41 8.92 L 30.76 8.78 L 32.11 8.75 L 33.47 8.82 L 34.80 9.02 L 36.09 9.50 L 36.09 9.50 L 34.74 9.55 L 33.42 9.62 L 32.11 9.75 L 30.82 9.96 L 29.56 10.22 L 28.32 10.54 L 27.10 10.91 L 25.91 11.33 L 24.74 11.78 L 23.60 12.28 L 22.47 12.82 L 21.36 13.39 L 20.27 14.01 L 19.20 14.66 L 18.16 15.37 L 17.13 16.12 L 16.14 16.92 L 15.18 17.78 L 14.27 18.70 L 13.41 19.67 L 12.60 20.71 L 11.87 21.80 L 11.21 22.95 L 10.63 24.14 L 10.15 25.38 L 9.76 26.65 L 9.47 27.95 L 9.29 29.27 L 9.20 30.60 L 9.22 31.93 L 9.34 33.26 L 9.54 34.56 L 9.84 35.85 L 10.22 37.10 L 10.66 38.33 L 11.18 39.52 L 11.76 40.67 L 12.38 41.79 L 13.06 42.88 L 13.78 43.93 L 14.54 44.94 L 15.33 45.93 L 16.17 46.88 L 17.04 47.79 L 17.96 48.67 L 18.91 49.51 L 19.91 50.31 L 20.95 51.06 L 22.04 51.76 L 23.17 52.40 L 24.34 52.97 L 25.54 53.46 L 26.79 53.87 L 28.06 54.19 L 29.35 54.41 L 30.66 54.54 L 31.98 54.57 L 33.29 54.49 L 34.59 54.31 L 35.87 54.04 L 37.12 53.67 L 38.34 53.21 L 39.51 52.67 L 40.64 52.07 L 41.73 51.39 L 42.77 50.66 L 43.76 49.89 L 44.70 49.07 L 45.60 48.22 L 46.46 47.33 L 47.28 46.42 L 48.07 45.48 L 48.82 44.52 L 49.54 43.53 L 50.22 42.51 L 50.87 41.47 L 51.48 40.39 L 52.05 39.29 L 52.57 38.14 L 53.04 36.97 L 53.44 35.76 L 53.78 34.53 L 54.04 33.26 L 54.22 31.98 L 54.30 30.68 L 54.30 29.37 L 54.19 28.06 L 53.99 26.76 L 53.69 25.48 L 53.29 24.22 L 52.79 22.99 L 52.21 21.81 L 51.55 20.67 L 50.82 19.58 L 50.02 18.53 L 49.21 17.51 Z"/>
|
||||
|
||||
<path fill="#9FE1CB" opacity=".72" d="M37.2 25.2h11.2v13.2h-1.8V27.4H38.6z"/>
|
||||
<path fill="#9FE1CB" d="M22.8 29.2h8.8l1.7 2.2h10.2V44H22.8z"/>
|
||||
<path fill="#9FE1CB" opacity=".45" d="M26.2 34.2h6.4v1.3h-6.4zm0 2.8h4.5v1.3h-4.5z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
|
||||
<path fill="#085041" d="M 49.21 17.51 L 50.41 18.25 L 51.45 19.16 L 52.41 20.17 L 53.29 21.26 L 54.10 22.43 L 54.80 23.66 L 55.42 24.96 L 55.92 26.30 L 56.32 27.68 L 56.60 29.10 L 56.78 30.53 L 56.84 31.98 L 56.79 33.42 L 56.64 34.86 L 56.39 36.28 L 56.04 37.68 L 55.61 39.05 L 55.10 40.39 L 54.52 41.70 L 53.87 42.97 L 53.16 44.21 L 52.39 45.40 L 51.57 46.56 L 50.69 47.68 L 49.76 48.75 L 48.78 49.78 L 47.75 50.77 L 46.66 51.70 L 45.52 52.57 L 44.34 53.38 L 43.10 54.12 L 41.82 54.79 L 40.49 55.36 L 39.12 55.85 L 37.73 56.23 L 36.30 56.51 L 34.86 56.69 L 33.42 56.75 L 31.98 56.70 L 30.55 56.54 L 29.14 56.27 L 27.76 55.90 L 26.41 55.44 L 25.12 54.88 L 23.87 54.25 L 22.67 53.54 L 21.53 52.78 L 20.44 51.96 L 19.40 51.09 L 18.41 50.19 L 17.47 49.25 L 16.57 48.29 L 15.71 47.31 L 14.89 46.29 L 14.11 45.26 L 13.36 44.20 L 12.65 43.12 L 11.97 42.00 L 11.33 40.86 L 10.74 39.68 L 10.20 38.46 L 9.72 37.22 L 9.31 35.94 L 8.96 34.63 L 8.70 33.29 L 8.53 31.93 L 8.45 30.56 L 8.47 29.18 L 8.60 27.80 L 8.82 26.43 L 9.15 25.08 L 9.59 23.76 L 10.12 22.47 L 10.74 21.23 L 11.45 20.04 L 12.23 18.90 L 13.09 17.81 L 14.01 16.79 L 14.99 15.83 L 16.02 14.93 L 17.09 14.08 L 18.20 13.30 L 19.34 12.57 L 20.51 11.90 L 21.71 11.29 L 22.94 10.74 L 24.19 10.24 L 25.46 9.80 L 26.76 9.43 L 28.08 9.14 L 29.41 8.92 L 30.76 8.78 L 32.11 8.75 L 33.47 8.82 L 34.80 9.02 L 36.09 9.50 L 36.09 9.50 L 34.74 9.55 L 33.42 9.62 L 32.11 9.75 L 30.82 9.96 L 29.56 10.22 L 28.32 10.54 L 27.10 10.91 L 25.91 11.33 L 24.74 11.78 L 23.60 12.28 L 22.47 12.82 L 21.36 13.39 L 20.27 14.01 L 19.20 14.66 L 18.16 15.37 L 17.13 16.12 L 16.14 16.92 L 15.18 17.78 L 14.27 18.70 L 13.41 19.67 L 12.60 20.71 L 11.87 21.80 L 11.21 22.95 L 10.63 24.14 L 10.15 25.38 L 9.76 26.65 L 9.47 27.95 L 9.29 29.27 L 9.20 30.60 L 9.22 31.93 L 9.34 33.26 L 9.54 34.56 L 9.84 35.85 L 10.22 37.10 L 10.66 38.33 L 11.18 39.52 L 11.76 40.67 L 12.38 41.79 L 13.06 42.88 L 13.78 43.93 L 14.54 44.94 L 15.33 45.93 L 16.17 46.88 L 17.04 47.79 L 17.96 48.67 L 18.91 49.51 L 19.91 50.31 L 20.95 51.06 L 22.04 51.76 L 23.17 52.40 L 24.34 52.97 L 25.54 53.46 L 26.79 53.87 L 28.06 54.19 L 29.35 54.41 L 30.66 54.54 L 31.98 54.57 L 33.29 54.49 L 34.59 54.31 L 35.87 54.04 L 37.12 53.67 L 38.34 53.21 L 39.51 52.67 L 40.64 52.07 L 41.73 51.39 L 42.77 50.66 L 43.76 49.89 L 44.70 49.07 L 45.60 48.22 L 46.46 47.33 L 47.28 46.42 L 48.07 45.48 L 48.82 44.52 L 49.54 43.53 L 50.22 42.51 L 50.87 41.47 L 51.48 40.39 L 52.05 39.29 L 52.57 38.14 L 53.04 36.97 L 53.44 35.76 L 53.78 34.53 L 54.04 33.26 L 54.22 31.98 L 54.30 30.68 L 54.30 29.37 L 54.19 28.06 L 53.99 26.76 L 53.69 25.48 L 53.29 24.22 L 52.79 22.99 L 52.21 21.81 L 51.55 20.67 L 50.82 19.58 L 50.02 18.53 L 49.21 17.51 Z"/>
|
||||
|
||||
<path fill="#085041" opacity=".72" d="M37.2 25.2h11.2v13.2h-1.8V27.4H38.6z"/>
|
||||
<path fill="#085041" d="M22.8 29.2h8.8l1.7 2.2h10.2V44H22.8z"/>
|
||||
<path fill="#085041" opacity=".45" d="M26.2 34.2h6.4v1.3h-6.4zm0 2.8h4.5v1.3h-4.5z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 617 B |
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||
<rect width="64" height="64" fill="#085041"/>
|
||||
<g transform="translate(8.32 8.32) scale(0.74)" color="#9FE1CB">
|
||||
<path fill="currentColor" d="M 49.21 17.51 L 50.41 18.25 L 51.45 19.16 L 52.41 20.17 L 53.29 21.26 L 54.10 22.43 L 54.80 23.66 L 55.42 24.96 L 55.92 26.30 L 56.32 27.68 L 56.60 29.10 L 56.78 30.53 L 56.84 31.98 L 56.79 33.42 L 56.64 34.86 L 56.39 36.28 L 56.04 37.68 L 55.61 39.05 L 55.10 40.39 L 54.52 41.70 L 53.87 42.97 L 53.16 44.21 L 52.39 45.40 L 51.57 46.56 L 50.69 47.68 L 49.76 48.75 L 48.78 49.78 L 47.75 50.77 L 46.66 51.70 L 45.52 52.57 L 44.34 53.38 L 43.10 54.12 L 41.82 54.79 L 40.49 55.36 L 39.12 55.85 L 37.73 56.23 L 36.30 56.51 L 34.86 56.69 L 33.42 56.75 L 31.98 56.70 L 30.55 56.54 L 29.14 56.27 L 27.76 55.90 L 26.41 55.44 L 25.12 54.88 L 23.87 54.25 L 22.67 53.54 L 21.53 52.78 L 20.44 51.96 L 19.40 51.09 L 18.41 50.19 L 17.47 49.25 L 16.57 48.29 L 15.71 47.31 L 14.89 46.29 L 14.11 45.26 L 13.36 44.20 L 12.65 43.12 L 11.97 42.00 L 11.33 40.86 L 10.74 39.68 L 10.20 38.46 L 9.72 37.22 L 9.31 35.94 L 8.96 34.63 L 8.70 33.29 L 8.53 31.93 L 8.45 30.56 L 8.47 29.18 L 8.60 27.80 L 8.82 26.43 L 9.15 25.08 L 9.59 23.76 L 10.12 22.47 L 10.74 21.23 L 11.45 20.04 L 12.23 18.90 L 13.09 17.81 L 14.01 16.79 L 14.99 15.83 L 16.02 14.93 L 17.09 14.08 L 18.20 13.30 L 19.34 12.57 L 20.51 11.90 L 21.71 11.29 L 22.94 10.74 L 24.19 10.24 L 25.46 9.80 L 26.76 9.43 L 28.08 9.14 L 29.41 8.92 L 30.76 8.78 L 32.11 8.75 L 33.47 8.82 L 34.80 9.02 L 36.09 9.50 L 36.09 9.50 L 34.74 9.55 L 33.42 9.62 L 32.11 9.75 L 30.82 9.96 L 29.56 10.22 L 28.32 10.54 L 27.10 10.91 L 25.91 11.33 L 24.74 11.78 L 23.60 12.28 L 22.47 12.82 L 21.36 13.39 L 20.27 14.01 L 19.20 14.66 L 18.16 15.37 L 17.13 16.12 L 16.14 16.92 L 15.18 17.78 L 14.27 18.70 L 13.41 19.67 L 12.60 20.71 L 11.87 21.80 L 11.21 22.95 L 10.63 24.14 L 10.15 25.38 L 9.76 26.65 L 9.47 27.95 L 9.29 29.27 L 9.20 30.60 L 9.22 31.93 L 9.34 33.26 L 9.54 34.56 L 9.84 35.85 L 10.22 37.10 L 10.66 38.33 L 11.18 39.52 L 11.76 40.67 L 12.38 41.79 L 13.06 42.88 L 13.78 43.93 L 14.54 44.94 L 15.33 45.93 L 16.17 46.88 L 17.04 47.79 L 17.96 48.67 L 18.91 49.51 L 19.91 50.31 L 20.95 51.06 L 22.04 51.76 L 23.17 52.40 L 24.34 52.97 L 25.54 53.46 L 26.79 53.87 L 28.06 54.19 L 29.35 54.41 L 30.66 54.54 L 31.98 54.57 L 33.29 54.49 L 34.59 54.31 L 35.87 54.04 L 37.12 53.67 L 38.34 53.21 L 39.51 52.67 L 40.64 52.07 L 41.73 51.39 L 42.77 50.66 L 43.76 49.89 L 44.70 49.07 L 45.60 48.22 L 46.46 47.33 L 47.28 46.42 L 48.07 45.48 L 48.82 44.52 L 49.54 43.53 L 50.22 42.51 L 50.87 41.47 L 51.48 40.39 L 52.05 39.29 L 52.57 38.14 L 53.04 36.97 L 53.44 35.76 L 53.78 34.53 L 54.04 33.26 L 54.22 31.98 L 54.30 30.68 L 54.30 29.37 L 54.19 28.06 L 53.99 26.76 L 53.69 25.48 L 53.29 24.22 L 52.79 22.99 L 52.21 21.81 L 51.55 20.67 L 50.82 19.58 L 50.02 18.53 L 49.21 17.51 Z"/>
|
||||
|
||||
<path fill="currentColor" d="M20 28.5h10l2 2.4h12V46H20z"/>
|
||||
<path fill="currentColor" opacity=".7" d="M34 24h12v12h-2.2V27.2H35.6z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 14 KiB |
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "Tsumugu",
|
||||
"short_name": "Tsumugu",
|
||||
"description": "Unterlagen im Zusammenhang ordnen und wiederfinden.",
|
||||
"start_url": "/",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#f3f1ea",
|
||||
"theme_color": "#085041",
|
||||
"lang": "de",
|
||||
"icons": [
|
||||
{ "src": "/icons/icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any" },
|
||||
{ "src": "/icons/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" },
|
||||
{ "src": "/icons/icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const ENSO_PATH = "M 49.21 17.51 L 50.41 18.25 L 51.45 19.16 L 52.41 20.17 L 53.29 21.26 L 54.10 22.43 L 54.80 23.66 L 55.42 24.96 L 55.92 26.30 L 56.32 27.68 L 56.60 29.10 L 56.78 30.53 L 56.84 31.98 L 56.79 33.42 L 56.64 34.86 L 56.39 36.28 L 56.04 37.68 L 55.61 39.05 L 55.10 40.39 L 54.52 41.70 L 53.87 42.97 L 53.16 44.21 L 52.39 45.40 L 51.57 46.56 L 50.69 47.68 L 49.76 48.75 L 48.78 49.78 L 47.75 50.77 L 46.66 51.70 L 45.52 52.57 L 44.34 53.38 L 43.10 54.12 L 41.82 54.79 L 40.49 55.36 L 39.12 55.85 L 37.73 56.23 L 36.30 56.51 L 34.86 56.69 L 33.42 56.75 L 31.98 56.70 L 30.55 56.54 L 29.14 56.27 L 27.76 55.90 L 26.41 55.44 L 25.12 54.88 L 23.87 54.25 L 22.67 53.54 L 21.53 52.78 L 20.44 51.96 L 19.40 51.09 L 18.41 50.19 L 17.47 49.25 L 16.57 48.29 L 15.71 47.31 L 14.89 46.29 L 14.11 45.26 L 13.36 44.20 L 12.65 43.12 L 11.97 42.00 L 11.33 40.86 L 10.74 39.68 L 10.20 38.46 L 9.72 37.22 L 9.31 35.94 L 8.96 34.63 L 8.70 33.29 L 8.53 31.93 L 8.45 30.56 L 8.47 29.18 L 8.60 27.80 L 8.82 26.43 L 9.15 25.08 L 9.59 23.76 L 10.12 22.47 L 10.74 21.23 L 11.45 20.04 L 12.23 18.90 L 13.09 17.81 L 14.01 16.79 L 14.99 15.83 L 16.02 14.93 L 17.09 14.08 L 18.20 13.30 L 19.34 12.57 L 20.51 11.90 L 21.71 11.29 L 22.94 10.74 L 24.19 10.24 L 25.46 9.80 L 26.76 9.43 L 28.08 9.14 L 29.41 8.92 L 30.76 8.78 L 32.11 8.75 L 33.47 8.82 L 34.80 9.02 L 36.09 9.50 L 36.09 9.50 L 34.74 9.55 L 33.42 9.62 L 32.11 9.75 L 30.82 9.96 L 29.56 10.22 L 28.32 10.54 L 27.10 10.91 L 25.91 11.33 L 24.74 11.78 L 23.60 12.28 L 22.47 12.82 L 21.36 13.39 L 20.27 14.01 L 19.20 14.66 L 18.16 15.37 L 17.13 16.12 L 16.14 16.92 L 15.18 17.78 L 14.27 18.70 L 13.41 19.67 L 12.60 20.71 L 11.87 21.80 L 11.21 22.95 L 10.63 24.14 L 10.15 25.38 L 9.76 26.65 L 9.47 27.95 L 9.29 29.27 L 9.20 30.60 L 9.22 31.93 L 9.34 33.26 L 9.54 34.56 L 9.84 35.85 L 10.22 37.10 L 10.66 38.33 L 11.18 39.52 L 11.76 40.67 L 12.38 41.79 L 13.06 42.88 L 13.78 43.93 L 14.54 44.94 L 15.33 45.93 L 16.17 46.88 L 17.04 47.79 L 17.96 48.67 L 18.91 49.51 L 19.91 50.31 L 20.95 51.06 L 22.04 51.76 L 23.17 52.40 L 24.34 52.97 L 25.54 53.46 L 26.79 53.87 L 28.06 54.19 L 29.35 54.41 L 30.66 54.54 L 31.98 54.57 L 33.29 54.49 L 34.59 54.31 L 35.87 54.04 L 37.12 53.67 L 38.34 53.21 L 39.51 52.67 L 40.64 52.07 L 41.73 51.39 L 42.77 50.66 L 43.76 49.89 L 44.70 49.07 L 45.60 48.22 L 46.46 47.33 L 47.28 46.42 L 48.07 45.48 L 48.82 44.52 L 49.54 43.53 L 50.22 42.51 L 50.87 41.47 L 51.48 40.39 L 52.05 39.29 L 52.57 38.14 L 53.04 36.97 L 53.44 35.76 L 53.78 34.53 L 54.04 33.26 L 54.22 31.98 L 54.30 30.68 L 54.30 29.37 L 54.19 28.06 L 53.99 26.76 L 53.69 25.48 L 53.29 24.22 L 52.79 22.99 L 52.21 21.81 L 51.55 20.67 L 50.82 19.58 L 50.02 18.53 L 49.21 17.51 Z";
|
||||
@@ -1,11 +1,14 @@
|
||||
import { useContext, useEffect, useRef, useState } from "react";
|
||||
import { Link, useParams, useSearchParams } from "react-router-dom";
|
||||
import { Link, useNavigate, useParams, useSearchParams } from "react-router-dom";
|
||||
import { api, markDirty, textToDocument } from "../api.js";
|
||||
import { SessionContext } from "../session.js";
|
||||
import { Modal } from "./Modal.jsx";
|
||||
import { MailPicker, PaperlessPicker } from "./Sources.jsx";
|
||||
import { ErrorNote, ShareBox } from "./widgets.jsx";
|
||||
import { ContentBoard, ObjectMenu, OrderChoice, RecordTree, SurfaceView, TargetLine, Trail, WorkLists, WorkSwitch, selectionOf, withSelection, writeSelection } from "./content.jsx";
|
||||
import { ContentBoard, ObjectMenu, OrderChoice, RecordTree, SurfaceView, TargetLine, Trail, WorkLists, WorkSwitch, saveChapterOrder, writeSelection } from "./content.jsx";
|
||||
import { ReadingPane } from "./ReadingPane.jsx";
|
||||
import { StructureNavigator, Workspace, rememberScroll, restoreScroll, useWorkspaceLayout } from "./workspace.jsx";
|
||||
import { NavIcon } from "./icons.jsx";
|
||||
|
||||
export function CaseList() {
|
||||
const { session } = useContext(SessionContext);
|
||||
@@ -208,12 +211,12 @@ function mergedCaseItems(record, direction, caseId) {
|
||||
...(record.bindings || []).map((binding) => ({
|
||||
...binding,
|
||||
origin: chapterOrigin("Direkt in dieser Akte", record.chapters, binding.chapter_id),
|
||||
readerHref: `/cases/${caseId}/items/${binding.id}`,
|
||||
readerHref: `/cases/${caseId}?eintrag=${binding.id}${binding.chapter_id ? `&kapitel=${binding.chapter_id}` : ""}`,
|
||||
})),
|
||||
...(record.contained || []).flatMap((group) => (group.bindings || []).map((binding) => ({
|
||||
...binding,
|
||||
origin: chapterOrigin(matterOrigin(group), group.chapters, binding.chapter_id),
|
||||
readerHref: `/matters/${group.matter_id}/items/${binding.id}?context_kind=case&context_id=${caseId}`,
|
||||
readerHref: `/matters/${group.matter_id}?context_kind=case&context_id=${caseId}&eintrag=${binding.id}${binding.chapter_id ? `&kapitel=${binding.chapter_id}` : ""}`,
|
||||
}))),
|
||||
];
|
||||
const counts = {};
|
||||
@@ -227,16 +230,72 @@ function mergedCaseItems(record, direction, caseId) {
|
||||
return [...dated, ...undated];
|
||||
}
|
||||
|
||||
function matterNode(matter, caseId) {
|
||||
const query = `?context_kind=case&context_id=${caseId}`;
|
||||
return {
|
||||
id: matter.id,
|
||||
title: matter.title,
|
||||
kind: matter.kind_label || "Vorgang",
|
||||
href: `/matters/${matter.id}${query}`,
|
||||
current: false,
|
||||
children: (matter.children || []).map((child) => matterNode(child, caseId)),
|
||||
};
|
||||
}
|
||||
|
||||
function caseNodes(record, parentRecord) {
|
||||
const self = {
|
||||
id: record.id,
|
||||
title: record.title,
|
||||
kind: record.kind_label || "Akte",
|
||||
href: null,
|
||||
current: true,
|
||||
children: [
|
||||
...(record.subcases || []).map((item) => ({
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
kind: "Unterakte",
|
||||
href: `/cases/${item.id}`,
|
||||
current: false,
|
||||
children: [],
|
||||
})),
|
||||
...(record.matters || []).map((matter) => matterNode(matter, record.id)),
|
||||
],
|
||||
};
|
||||
if (!parentRecord) return [self];
|
||||
const siblings = (parentRecord.subcases || []).map((item) => (item.id === record.id ? self : {
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
kind: "Unterakte",
|
||||
href: `/cases/${item.id}`,
|
||||
current: false,
|
||||
children: [],
|
||||
}));
|
||||
return [{
|
||||
id: parentRecord.id,
|
||||
title: parentRecord.title,
|
||||
kind: "Akte",
|
||||
href: `/cases/${parentRecord.id}`,
|
||||
current: false,
|
||||
children: siblings.length ? siblings : [self],
|
||||
}];
|
||||
}
|
||||
|
||||
export function CaseDetail() {
|
||||
const { id } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [params, setParams] = useSearchParams();
|
||||
const { scope, chapterId } = selectionOf(params);
|
||||
const rawScope = params.get("bereich") || "";
|
||||
const overview = rawScope === "all" || rawScope === "ueberblick";
|
||||
const chapterId = overview ? "" : (params.get("kapitel") || "");
|
||||
const entryId = params.get("eintrag") || "";
|
||||
const [record, setRecord] = useState(null);
|
||||
const [parentTree, setParentTree] = useState(null);
|
||||
const [error, setError] = useState("");
|
||||
const [modal, setModal] = useState("");
|
||||
const [view, setView] = useState("contents");
|
||||
const [dateDir, setDateDir] = useState("asc");
|
||||
const [outlineOpen, setOutlineOpen] = useState(false);
|
||||
const { width, structureOpen, setStructureOpen } = useWorkspaceLayout();
|
||||
const listRef = useRef(null);
|
||||
const pendingChapter = useRef("");
|
||||
const context = { kind: "case", id };
|
||||
|
||||
@@ -254,7 +313,8 @@ export function CaseDetail() {
|
||||
setView("contents");
|
||||
setModal("");
|
||||
setDateDir("asc");
|
||||
setOutlineOpen(false);
|
||||
setStructureOpen(false);
|
||||
setParentTree(null);
|
||||
api(`/api/v1/cases/${id}`).then((detail) => {
|
||||
if (!alive) return;
|
||||
pendingChapter.current = "";
|
||||
@@ -266,158 +326,248 @@ export function CaseDetail() {
|
||||
}, [id]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!record || record.id !== id) return;
|
||||
const known = new Set(["all", "direct", ...(record.contained || []).map((item) => item.matter_id)]);
|
||||
const nextScope = known.has(scope) ? scope : "all";
|
||||
const chapters = nextScope === "direct"
|
||||
? (record.chapters || [])
|
||||
: (record.contained || []).find((item) => item.matter_id === nextScope)?.chapters || [];
|
||||
const nextChapter = chapterId && chapters.some((chapter) => chapter.id === chapterId) ? chapterId : "";
|
||||
if (chapterId && !nextChapter && pendingChapter.current === chapterId) return;
|
||||
if (nextScope !== scope || nextChapter !== chapterId) writeSelection(params, setParams, nextScope, nextChapter);
|
||||
}, [record, id, scope, chapterId, params, setParams]);
|
||||
if (!record || record.id !== id || !record.parent_case_id) return undefined;
|
||||
let alive = true;
|
||||
api(`/api/v1/cases/${record.parent_case_id}`).then((parent) => {
|
||||
if (alive) setParentTree(parent);
|
||||
}).catch(() => {
|
||||
if (alive) setParentTree(null);
|
||||
});
|
||||
return () => {
|
||||
alive = false;
|
||||
};
|
||||
}, [record, id]);
|
||||
|
||||
function choose(nextScope, nextChapter = "") {
|
||||
writeSelection(params, setParams, nextScope, nextChapter);
|
||||
useEffect(() => {
|
||||
if (!record || record.id !== id) return;
|
||||
const matterId = rawScope && !["all", "ueberblick", "direkt", "direct"].includes(rawScope) ? rawScope : "";
|
||||
if (matterId && (record.contained || []).some((item) => item.matter_id === matterId)) {
|
||||
const next = new URLSearchParams();
|
||||
next.set("context_kind", "case");
|
||||
next.set("context_id", id);
|
||||
const chapter = params.get("kapitel");
|
||||
if (chapter) next.set("kapitel", chapter);
|
||||
navigate(`/matters/${matterId}?${next.toString()}`, { replace: true });
|
||||
return;
|
||||
}
|
||||
if (!overview && chapterId && !(record.chapters || []).some((chapter) => chapter.id === chapterId)) {
|
||||
if (pendingChapter.current === chapterId) return;
|
||||
writeSelection(params, setParams, "direct", "");
|
||||
}
|
||||
}, [record, id, rawScope, overview, chapterId, params, setParams, navigate]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!record || record.id !== id || !entryId || overview) return;
|
||||
const binding = (record.bindings || []).find((item) => item.id === entryId);
|
||||
if (!binding) return;
|
||||
const nextChapter = binding.chapter_id || "";
|
||||
if ((chapterId || "") !== nextChapter) writeSelection(params, setParams, "direct", nextChapter);
|
||||
}, [record, id, entryId, overview, chapterId, params, setParams]);
|
||||
|
||||
useEffect(() => {
|
||||
if (entryId) return;
|
||||
restoreScroll(listRef.current, `tsumugu-scroll:case:${id}:${chapterId}:${overview ? "over" : "direct"}`);
|
||||
}, [entryId, id, chapterId, overview, record]);
|
||||
|
||||
function chooseChapter(next) {
|
||||
const updated = new URLSearchParams(params);
|
||||
updated.delete("bereich");
|
||||
updated.delete("eintrag");
|
||||
if (next) updated.set("kapitel", next);
|
||||
else updated.delete("kapitel");
|
||||
setParams(updated);
|
||||
setView("contents");
|
||||
setOutlineOpen(false);
|
||||
setStructureOpen(false);
|
||||
}
|
||||
|
||||
function showOverview() {
|
||||
const updated = new URLSearchParams(params);
|
||||
updated.set("bereich", "ueberblick");
|
||||
updated.delete("kapitel");
|
||||
updated.delete("eintrag");
|
||||
setParams(updated);
|
||||
setView("contents");
|
||||
setStructureOpen(false);
|
||||
}
|
||||
|
||||
function openEntry(binding) {
|
||||
rememberScroll(listRef.current, `tsumugu-scroll:case:${id}:${chapterId}:direct`);
|
||||
const updated = new URLSearchParams(params);
|
||||
updated.delete("bereich");
|
||||
updated.set("eintrag", binding.id);
|
||||
if (binding.chapter_id) updated.set("kapitel", binding.chapter_id);
|
||||
else updated.delete("kapitel");
|
||||
setParams(updated);
|
||||
setView("contents");
|
||||
}
|
||||
|
||||
function closeEntry() {
|
||||
const updated = new URLSearchParams(params);
|
||||
updated.delete("eintrag");
|
||||
setParams(updated, { replace: true });
|
||||
}
|
||||
|
||||
async function moveChapter(chapterIdToMove, delta) {
|
||||
const ids = (record?.chapters || []).map((chapter) => chapter.id);
|
||||
const index = ids.indexOf(chapterIdToMove);
|
||||
const target = index + delta;
|
||||
if (!record || index < 0 || target < 0 || target >= ids.length) return;
|
||||
const [moved] = ids.splice(index, 1);
|
||||
ids.splice(target, 0, moved);
|
||||
try {
|
||||
await saveChapterOrder({ containerKind: "case", containerId: id, record, ids });
|
||||
await load();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
if (error && !record) return <main className="page"><ErrorNote error={error} /></main>;
|
||||
if (!record) return <main className="page"><p className="muted">Akte wird geladen …</p></main>;
|
||||
|
||||
const group = scope !== "all" && scope !== "direct"
|
||||
? (record.contained || []).find((item) => item.matter_id === scope) || null
|
||||
: null;
|
||||
const target = scope === "direct"
|
||||
? {
|
||||
scope: "direct",
|
||||
label: `Akte ${record.title}`,
|
||||
edit: Boolean(record.rights?.edit),
|
||||
chapters: record.chapters || [],
|
||||
chapterPath: `/api/v1/cases/${id}/chapters`,
|
||||
}
|
||||
: group
|
||||
? {
|
||||
scope: group.matter_id,
|
||||
label: `${group.kind_label || "Vorgang"} ${group.title}`,
|
||||
edit: Boolean(group.rights?.edit),
|
||||
chapters: group.chapters || [],
|
||||
chapterPath: `/api/v1/matters/${group.matter_id}/chapters?context_kind=case&context_id=${id}`,
|
||||
}
|
||||
: null;
|
||||
const activeChapter = target?.chapters.find((chapter) => chapter.id === chapterId) || null;
|
||||
const canEdit = Boolean(record.rights?.edit);
|
||||
const targetLabel = `${record.kind_label || "Akte"} ${record.title}`;
|
||||
const activeChapter = (record.chapters || []).find((chapter) => chapter.id === chapterId) || null;
|
||||
const chapters = (record.chapters || []).map((chapter) => ({
|
||||
...chapter,
|
||||
count: (record.bindings || []).filter((item) => item.chapter_id === chapter.id).length,
|
||||
}));
|
||||
const merged = mergedCaseItems(record, dateDir, id);
|
||||
const addPlacement = group ? { kind: "matter", id: group.matter_id } : null;
|
||||
const contexts = [
|
||||
...(parentTree ? [{ id: parentTree.id, label: parentTree.title }] : []),
|
||||
{ id: record.id, label: record.title },
|
||||
];
|
||||
const entry = overview ? null : ((record.bindings || []).find((item) => item.id === entryId) || null);
|
||||
const hasContained = Boolean(record.contained?.length);
|
||||
|
||||
return (
|
||||
<main className="page">
|
||||
<header className="page-head">
|
||||
<>
|
||||
<Workspace
|
||||
width={width}
|
||||
structureOpen={structureOpen}
|
||||
setStructureOpen={setStructureOpen}
|
||||
hasEntry={Boolean(entryId) && !overview}
|
||||
listRef={listRef}
|
||||
nav={(
|
||||
<StructureNavigator
|
||||
contexts={contexts}
|
||||
contextValue={id}
|
||||
onContext={parentTree ? ((next) => { if (next !== id) navigate(`/cases/${next}`); }) : null}
|
||||
nodes={caseNodes(record, parentTree)}
|
||||
chapters={chapters}
|
||||
chapterId={overview ? "" : chapterId}
|
||||
allCount={(record.bindings || []).length}
|
||||
overview={hasContained ? { active: overview, count: merged.length, onSelect: showOverview } : null}
|
||||
chapterHeading={`Kapitel in ${record.title}`}
|
||||
onChapter={chooseChapter}
|
||||
onAddChapter={canEdit ? () => setModal("chapter") : null}
|
||||
canAddChapter={canEdit}
|
||||
onMoveChapter={moveChapter}
|
||||
canReorder={canEdit && chapters.length > 1}
|
||||
links={[]}
|
||||
onNavigate={() => setStructureOpen(false)}
|
||||
onClose={width < 1500 ? () => setStructureOpen(false) : null}
|
||||
/>
|
||||
)}
|
||||
reader={entryId && !overview ? (
|
||||
<ReadingPane
|
||||
binding={entry}
|
||||
context={context}
|
||||
backLabel={activeChapter?.title || "Alle Inhalte"}
|
||||
onClose={closeEntry}
|
||||
onReload={load}
|
||||
canDetach={canEdit}
|
||||
canDestroy={Boolean(record.is_owner)}
|
||||
/>
|
||||
) : null}
|
||||
>
|
||||
<header className="workspace-head">
|
||||
<div>
|
||||
<Trail items={caseTrail(record, id, group, scope, activeChapter)} />
|
||||
<p className="eyebrow">{record.kind_label || "Akte"} · {record.home_scope_name}</p>
|
||||
<h1>{record.title}</h1>
|
||||
<p className="muted">{record.status === "open" ? "Offen" : "Geschlossen"}</p>
|
||||
<Trail items={record.trail} />
|
||||
<div className="title-row">
|
||||
<h1>{record.title}</h1>
|
||||
<span className={record.status === "open" ? "status-pill" : "status-pill is-closed"}>{record.status === "open" ? "Offen" : "Geschlossen"}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="page-actions">
|
||||
{target?.edit ? <button type="button" onClick={() => setModal("add")}>Inhalt hinzufügen</button> : null}
|
||||
{width < 1500 ? <button type="button" className="quiet" onClick={() => setStructureOpen(true)}>Struktur</button> : null}
|
||||
{canEdit ? (
|
||||
<button type="button" className="desktop-add" onClick={() => setModal("add")}>
|
||||
<NavIcon name="plus" /> Inhalt hinzufügen
|
||||
</button>
|
||||
) : null}
|
||||
<ObjectMenu view={view} onView={setView}>
|
||||
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("matter")}>Vorgang anlegen und zuordnen</button> : null}
|
||||
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("assign")}>Vorhandenen Vorgang zuordnen</button> : null}
|
||||
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("subcase")}>Unterakte anlegen</button> : null}
|
||||
{record.rights.share || record.is_owner ? <button type="button" className="quiet" onClick={() => setModal("share")}>Teilen</button> : null}
|
||||
</ObjectMenu>
|
||||
{target && !target.edit ? <p className="muted">In {target.label} fehlt das Bearbeitungsrecht.</p> : null}
|
||||
</div>
|
||||
</header>
|
||||
{!canEdit ? <p className="muted">In {targetLabel} fehlt das Bearbeitungsrecht.</p> : null}
|
||||
<ErrorNote error={error} />
|
||||
<div className="record-layout">
|
||||
<aside className={outlineOpen ? "outline is-open" : "outline"}>
|
||||
<button type="button" className="outline__toggle" onClick={() => setOutlineOpen((open) => !open)}>{outlineOpen ? "Bereiche schließen" : "Bereiche"}</button>
|
||||
<div className="outline__body">
|
||||
<CaseOutline
|
||||
record={record}
|
||||
caseId={id}
|
||||
scope={scope}
|
||||
chapterId={chapterId}
|
||||
onScope={(next) => choose(next)}
|
||||
onChapter={(nextScope, nextChapter) => choose(nextScope, nextChapter)}
|
||||
/>
|
||||
</div>
|
||||
</aside>
|
||||
<div className="record-main">
|
||||
<WorkSwitch view={view} onView={setView} />
|
||||
{view === "contents" ? (
|
||||
<p className="target-line">
|
||||
{target ? (
|
||||
<>Bearbeitet wird <strong>{target.label}</strong>{activeChapter ? <> · Kapitel <strong>{activeChapter.title}</strong></> : null}</>
|
||||
) : (
|
||||
"Lesesicht aller Inhalte. Zum Bearbeiten einen Bereich in der Gliederung wählen."
|
||||
)}
|
||||
</p>
|
||||
) : null}
|
||||
{view === "contents" && scope === "all" ? (
|
||||
<div className="stack">
|
||||
<OrderChoice mode="date" direction={dateDir} onChange={(_mode, next) => setDateDir(next)} />
|
||||
<ContentBoard
|
||||
record={{ bindings: merged, chapters: [], content_order: "date", content_order_dir: dateDir, rights: { edit: false }, version: record.version }}
|
||||
bindings={merged}
|
||||
sortable={false}
|
||||
containerKind="case"
|
||||
containerId={id}
|
||||
onChange={load}
|
||||
itemHref={(binding) => binding.readerHref}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
{view === "contents" && scope === "direct" ? (
|
||||
<ContentBoard
|
||||
record={record}
|
||||
containerKind="case"
|
||||
containerId={id}
|
||||
onlyChapter={chapterId}
|
||||
onChange={load}
|
||||
itemHref={(binding) => withSelection(`/cases/${id}/items/${binding.id}`, params)}
|
||||
/>
|
||||
) : null}
|
||||
{view === "contents" && group ? (
|
||||
<ContentBoard
|
||||
record={{ ...group, rights: group.rights, chapters: group.chapters || [] }}
|
||||
bindings={group.bindings}
|
||||
context={context}
|
||||
containerKind="matter"
|
||||
containerId={group.matter_id}
|
||||
onlyChapter={chapterId}
|
||||
onChange={load}
|
||||
itemHref={(binding) => withSelection(`/matters/${group.matter_id}/items/${binding.id}?context_kind=case&context_id=${id}`, params)}
|
||||
/>
|
||||
) : null}
|
||||
{view === "contents" && scope !== "all" && scope !== "direct" && !group ? (
|
||||
<p className="muted">Dieser Bereich hat in der Akte keine eigenen Unterlagen.</p>
|
||||
) : null}
|
||||
{view === "work" ? <WorkLists record={record} context={context} onChange={load} /> : null}
|
||||
{view === "course" || view === "audit" ? (
|
||||
<SurfaceView view={view} coursePath={`/api/v1/cases/${id}/course`} auditPath={`/api/v1/cases/${id}/chronology`} />
|
||||
) : null}
|
||||
{view === "links" ? (
|
||||
<div className="stack">
|
||||
<h2>Zuordnungen</h2>
|
||||
<p className="muted">Unterakten, Vorgänge und Freigaben dieses Objekts.</p>
|
||||
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("matter")}>Vorgang anlegen und zuordnen</button> : null}
|
||||
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("assign")}>Vorhandenen Vorgang zuordnen</button> : null}
|
||||
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("subcase")}>Unterakte anlegen</button> : null}
|
||||
</div>
|
||||
) : null}
|
||||
<WorkSwitch view={view} onView={setView} />
|
||||
{view === "contents" && overview ? (
|
||||
<div className="stack">
|
||||
<p className="muted">Überblick über direkte Inhalte und Inhalte der zugeordneten Vorgänge. Herkunft steht an jeder Zeile. Neue Inhalte und die eigene Reihenfolge gelten in der Akte oder im geöffneten Vorgang.</p>
|
||||
<OrderChoice mode="date" direction={dateDir} onChange={(_mode, next) => setDateDir(next)} />
|
||||
<ContentBoard
|
||||
record={{ bindings: merged, chapters: [], content_order: "date", content_order_dir: dateDir, rights: { edit: false }, version: record.version }}
|
||||
bindings={merged}
|
||||
sortable={false}
|
||||
listTitle="Überblick"
|
||||
containerKind="case"
|
||||
containerId={id}
|
||||
onChange={load}
|
||||
itemHref={(binding) => binding.readerHref}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
{view === "contents" && !overview ? (
|
||||
<ContentBoard
|
||||
record={record}
|
||||
containerKind="case"
|
||||
containerId={id}
|
||||
onlyChapter={chapterId}
|
||||
selectedId={entryId}
|
||||
listTitle={activeChapter ? activeChapter.title : "Alle Inhalte"}
|
||||
onOpen={openEntry}
|
||||
onChange={load}
|
||||
itemHref={(binding) => {
|
||||
const search = new URLSearchParams();
|
||||
search.set("eintrag", binding.id);
|
||||
if (binding.chapter_id) search.set("kapitel", binding.chapter_id);
|
||||
return `/cases/${id}?${search}`;
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
{view === "work" ? <WorkLists record={record} context={context} onChange={load} /> : null}
|
||||
{view === "course" || view === "audit" ? (
|
||||
<SurfaceView view={view} coursePath={`/api/v1/cases/${id}/course`} auditPath={`/api/v1/cases/${id}/chronology`} />
|
||||
) : null}
|
||||
{view === "links" ? (
|
||||
<div className="stack">
|
||||
<h2>Zuordnungen</h2>
|
||||
<p className="muted">Unterakten, Vorgänge und Freigaben dieses Objekts.</p>
|
||||
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("matter")}>Vorgang anlegen und zuordnen</button> : null}
|
||||
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("assign")}>Vorhandenen Vorgang zuordnen</button> : null}
|
||||
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("subcase")}>Unterakte anlegen</button> : null}
|
||||
</div>
|
||||
) : null}
|
||||
{canEdit && view === "contents" && !overview ? (
|
||||
<button type="button" className="mobile-add" onClick={() => setModal("add")}>
|
||||
<NavIcon name="plus" /> Inhalt hinzufügen
|
||||
</button>
|
||||
) : null}
|
||||
</Workspace>
|
||||
<Modal open={modal === "matter"} title="Vorgang anlegen und zuordnen" onClose={() => setModal("")}>
|
||||
<NewMatter caseId={id} homeScopeId={record.home_scope_id} onChange={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
<Modal open={modal === "assign"} title="Vorhandenen Vorgang zuordnen" onClose={() => setModal("")}>
|
||||
<AssignMatter caseId={id} onChange={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
<Modal open={modal === "add" && Boolean(target)} title={target ? `Hinzufügen in ${target.label}` : "Hinzufügen"} onClose={() => setModal("")}>
|
||||
<TargetLine label={target?.label} chapters={target?.chapters} chapterId={activeChapter?.id || ""} />
|
||||
<Modal open={modal === "add"} title={`Hinzufügen in ${targetLabel}`} onClose={() => setModal("")}>
|
||||
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={activeChapter?.id || ""} />
|
||||
<div className="add-choices">
|
||||
<button type="button" onClick={() => setModal("chapter")}>Kapitel</button>
|
||||
<button type="button" onClick={() => setModal("note")}>Notiz</button>
|
||||
@@ -426,29 +576,29 @@ export function CaseDetail() {
|
||||
<button type="button" onClick={() => setModal("mail")}>E-Mail</button>
|
||||
</div>
|
||||
</Modal>
|
||||
<Modal open={modal === "note" && Boolean(target)} title="Notiz" onClose={() => setModal("")}>
|
||||
<NoteForm context={context} placement={addPlacement} chapters={target?.chapters || []} initialChapter={activeChapter?.id || ""} targetLabel={target?.label || ""} onChange={() => { setModal(""); load(); }} />
|
||||
<Modal open={modal === "note"} title="Notiz" onClose={() => setModal("")}>
|
||||
<NoteForm context={context} chapters={record.chapters} initialChapter={activeChapter?.id || ""} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
<Modal open={modal === "file" && Boolean(target)} title="Datei" onClose={() => setModal("")}>
|
||||
<FileForm context={context} placement={addPlacement} chapters={target?.chapters || []} initialChapter={activeChapter?.id || ""} targetLabel={target?.label || ""} onChange={() => { setModal(""); load(); }} />
|
||||
<Modal open={modal === "file"} title="Datei" onClose={() => setModal("")}>
|
||||
<FileForm context={context} chapters={record.chapters} initialChapter={activeChapter?.id || ""} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
<Modal open={modal === "paperless" && Boolean(target)} title="Aus Paperless" onClose={() => setModal("")}>
|
||||
<PaperlessPicker context={context} placement={addPlacement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={target?.label || ""} onDone={() => { setModal(""); load(); }} />
|
||||
<Modal open={modal === "paperless"} title="Aus Paperless" onClose={() => setModal("")}>
|
||||
<PaperlessPicker context={context} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
<Modal open={modal === "mail" && Boolean(target)} title="E-Mail verbinden" wide onClose={() => setModal("")}>
|
||||
<MailPicker context={context} placement={addPlacement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={target?.label || ""} onDone={() => { setModal(""); load(); }} />
|
||||
<Modal open={modal === "mail"} title="E-Mail verbinden" wide onClose={() => setModal("")}>
|
||||
<MailPicker context={context} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
<Modal open={modal === "subcase"} title="Unterakte anlegen" onClose={() => setModal("")}>
|
||||
<NewSubcase parentId={id} onChange={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
<Modal open={modal === "chapter" && Boolean(target)} title={target ? `Kapitel in ${target.label} hinzufügen` : "Kapitel hinzufügen"} onClose={() => setModal("")}>
|
||||
<Modal open={modal === "chapter"} title={`Kapitel in ${targetLabel} hinzufügen`} onClose={() => setModal("")}>
|
||||
<ChapterForm
|
||||
path={target?.chapterPath || ""}
|
||||
path={`/api/v1/cases/${id}/chapters`}
|
||||
onChange={(created) => {
|
||||
setModal("");
|
||||
if (created?.id && target) {
|
||||
if (created?.id) {
|
||||
pendingChapter.current = created.id;
|
||||
writeSelection(params, setParams, target.scope, created.id);
|
||||
writeSelection(params, setParams, "direct", created.id);
|
||||
}
|
||||
load();
|
||||
}}
|
||||
@@ -457,7 +607,7 @@ export function CaseDetail() {
|
||||
<Modal open={modal === "share"} title="Teilen" onClose={() => setModal("")}>
|
||||
<ShareBox path={`/api/v1/cases/${id}/grants`} grants={record.grants || []} onChange={load} />
|
||||
</Modal>
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useContext, useEffect, useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { api, applySession } from "../api.js";
|
||||
import { SessionContext } from "../session.js";
|
||||
import { Mark } from "./icons.jsx";
|
||||
|
||||
export function Login() {
|
||||
const { setSession } = useContext(SessionContext);
|
||||
@@ -61,6 +62,7 @@ export function Login() {
|
||||
return (
|
||||
<main className="login">
|
||||
<section className="card login-card">
|
||||
<p className="login-mark" aria-hidden="true"><Mark size={72} /></p>
|
||||
<p className="eyebrow">Jinkendo</p>
|
||||
<h1>Tsumugu</h1>
|
||||
<p className="lead">Akten, Vorgänge und Fristen an einem Ort. Die erste Lieferung organisiert und verfolgt.</p>
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { useContext, useEffect, useRef, useState } from "react";
|
||||
import { Link, useNavigate, useParams, useSearchParams } from "react-router-dom";
|
||||
import { api, markDirty } from "../api.js";
|
||||
import { api, isDirty, markDirty } from "../api.js";
|
||||
import { SessionContext } from "../session.js";
|
||||
import { Modal } from "./Modal.jsx";
|
||||
import { MailPicker, PaperlessPicker } from "./Sources.jsx";
|
||||
import { ErrorNote, ShareBox } from "./widgets.jsx";
|
||||
import { ChapterForm, FileForm, NoteForm } from "./Cases.jsx";
|
||||
import { ContentBoard, ObjectMenu, Placements, RecordTree, SurfaceView, TargetLine, Trail, WorkLists, WorkSwitch, formatDate, matterOpenHref, writeChapter } from "./content.jsx";
|
||||
import { ContentBoard, ObjectMenu, Placements, RecordTree, SurfaceView, TargetLine, Trail, WorkLists, WorkSwitch, matterOpenHref, saveChapterOrder, writeChapter } from "./content.jsx";
|
||||
import { ReadingPane } from "./ReadingPane.jsx";
|
||||
import { StructureNavigator, Workspace, rememberScroll, restoreScroll, useWorkspaceLayout } from "./workspace.jsx";
|
||||
import { NavIcon } from "./icons.jsx";
|
||||
|
||||
function pageContext(params) {
|
||||
const kind = params.get("context_kind");
|
||||
@@ -79,78 +82,99 @@ export function MatterList() {
|
||||
);
|
||||
}
|
||||
|
||||
function matterTrail(record, chapter, href) {
|
||||
if (!chapter) return record.trail;
|
||||
const items = (record.trail || []).map((item, index, all) => (
|
||||
index === all.length - 1 ? { ...item, href } : item
|
||||
));
|
||||
items.push({ label: `Kapitel ${chapter.title}`, href: null });
|
||||
return items;
|
||||
function contextQuery(inherited) {
|
||||
return inherited ? `?context_kind=${inherited.kind}&context_id=${inherited.id}` : "";
|
||||
}
|
||||
|
||||
function MatterOutline({ record, inherited, chapterId, onChapter }) {
|
||||
const matterQuery = inherited ? `?context_kind=${inherited.kind}&context_id=${inherited.id}` : "";
|
||||
const hasParent = Boolean(record.parent_matter_id && record.parent_title);
|
||||
const hasChildren = Boolean(record.submatters?.length);
|
||||
const hasCases = Boolean(record.placements?.length);
|
||||
return (
|
||||
<nav className="outline-nav" aria-label="Gliederung">
|
||||
<h2>Gliederung</h2>
|
||||
<button type="button" className={chapterId ? "hierarchy__row" : "hierarchy__row is-current"} onClick={() => onChapter("")}>
|
||||
<span className="hierarchy__kind">Überblick</span>
|
||||
<strong>Alle Inhalte</strong>
|
||||
</button>
|
||||
{hasParent ? (
|
||||
<p className="hierarchy__parent">Übergeordnet: <Link to={`/matters/${record.parent_matter_id}${matterQuery}`}>Vorgang {record.parent_title}</Link></p>
|
||||
) : null}
|
||||
{hasCases ? (
|
||||
<>
|
||||
<h3>In diesen Akten</h3>
|
||||
<ul className="hierarchy">
|
||||
{record.placements.map((link) => (
|
||||
<li key={link.case_id}>
|
||||
<Link className="hierarchy__row" to={link.href}>
|
||||
<span className="hierarchy__kind">Akte</span>
|
||||
<strong>{link.label.replaceAll("Unterakte ", "").replaceAll("Akte ", "")}</strong>
|
||||
{link.current ? <span className="muted">aktueller Handlungskontext</span> : null}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
) : null}
|
||||
{hasChildren ? (
|
||||
<>
|
||||
<h3>Teilvorgänge</h3>
|
||||
<ul className="hierarchy">
|
||||
{record.submatters.map((item) => (
|
||||
<li key={item.id}>
|
||||
<Link className="hierarchy__row" to={`/matters/${item.id}${matterQuery}`}>
|
||||
<span className="hierarchy__kind">Teilvorgang</span>
|
||||
<strong>{item.title}</strong>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
) : null}
|
||||
{record.chapters?.length ? (
|
||||
<>
|
||||
<h3>Kapitel</h3>
|
||||
<ul className="hierarchy">
|
||||
{record.chapters.map((chapter) => (
|
||||
<li key={chapter.id}>
|
||||
<button type="button" className={chapterId === chapter.id ? "hierarchy__row is-current" : "hierarchy__row"} onClick={() => onChapter(chapter.id)}>
|
||||
<span className="hierarchy__kind">Kapitel</span>
|
||||
<strong>{chapter.title}</strong>
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
) : null}
|
||||
</nav>
|
||||
);
|
||||
function mapMatterNodes(nodes, activeId, query) {
|
||||
return (nodes || []).map((node) => ({
|
||||
id: node.id,
|
||||
title: node.title,
|
||||
kind: node.kind_label || "Vorgang",
|
||||
href: `/matters/${node.id}${query}`,
|
||||
current: node.id === activeId,
|
||||
children: mapMatterNodes(node.children, activeId, query),
|
||||
}));
|
||||
}
|
||||
|
||||
function caseNodes(caseRecord, parentRecord, activeId, contextId) {
|
||||
const query = `?context_kind=case&context_id=${contextId}`;
|
||||
const self = {
|
||||
id: caseRecord.id,
|
||||
title: caseRecord.title,
|
||||
kind: caseRecord.kind_label || "Akte",
|
||||
href: `/cases/${caseRecord.id}`,
|
||||
current: false,
|
||||
children: [
|
||||
...(caseRecord.subcases || []).map((item) => ({
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
kind: "Unterakte",
|
||||
href: `/cases/${item.id}`,
|
||||
current: false,
|
||||
children: [],
|
||||
})),
|
||||
...mapMatterNodes(caseRecord.matters, activeId, query),
|
||||
],
|
||||
};
|
||||
if (!parentRecord) return [self];
|
||||
const siblings = (parentRecord.subcases || []).map((item) => (item.id === caseRecord.id ? self : {
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
kind: "Unterakte",
|
||||
href: `/cases/${item.id}`,
|
||||
current: false,
|
||||
children: [],
|
||||
}));
|
||||
return [{
|
||||
id: parentRecord.id,
|
||||
title: parentRecord.title,
|
||||
kind: "Akte",
|
||||
href: `/cases/${parentRecord.id}`,
|
||||
current: false,
|
||||
children: [
|
||||
...(siblings.length ? siblings : [self]),
|
||||
...mapMatterNodes(parentRecord.matters, activeId, `?context_kind=case&context_id=${parentRecord.id}`),
|
||||
],
|
||||
}];
|
||||
}
|
||||
|
||||
function loneNodes(record, query) {
|
||||
const current = {
|
||||
id: record.id,
|
||||
title: record.title,
|
||||
kind: record.kind_label || "Vorgang",
|
||||
href: null,
|
||||
current: true,
|
||||
children: (record.submatters || []).map((item) => ({
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
kind: "Teilvorgang",
|
||||
href: `/matters/${item.id}${query}`,
|
||||
current: false,
|
||||
children: [],
|
||||
})),
|
||||
};
|
||||
if (record.parent_matter_id && record.parent_title) {
|
||||
return [{
|
||||
id: record.parent_matter_id,
|
||||
title: record.parent_title,
|
||||
kind: "Vorgang",
|
||||
href: `/matters/${record.parent_matter_id}${query}`,
|
||||
current: false,
|
||||
children: [current],
|
||||
}];
|
||||
}
|
||||
return [current];
|
||||
}
|
||||
|
||||
function objectTrail(record, query) {
|
||||
const items = [{ label: "Vorgänge", href: "/matters" }];
|
||||
if (record.parent_matter_id && record.parent_title) {
|
||||
items.push({ label: record.parent_title, href: `/matters/${record.parent_matter_id}${query}` });
|
||||
}
|
||||
items.push({ label: record.title, href: null });
|
||||
return items;
|
||||
}
|
||||
|
||||
export function MatterDetail() {
|
||||
@@ -164,8 +188,12 @@ export function MatterDetail() {
|
||||
const rightsContext = inherited || { kind: "matter", id };
|
||||
const placement = inherited?.kind === "case" ? { kind: "matter", id } : null;
|
||||
const [view, setView] = useState("contents");
|
||||
const [outlineOpen, setOutlineOpen] = useState(false);
|
||||
const { width, structureOpen, setStructureOpen } = useWorkspaceLayout();
|
||||
const listRef = useRef(null);
|
||||
const [caseTree, setCaseTree] = useState(null);
|
||||
const [parentTree, setParentTree] = useState(null);
|
||||
const pendingChapter = useRef("");
|
||||
const entryId = params.get("eintrag") || "";
|
||||
|
||||
async function load() {
|
||||
const query = inherited ? `?context_kind=${inherited.kind}&context_id=${inherited.id}` : "";
|
||||
@@ -181,7 +209,7 @@ export function MatterDetail() {
|
||||
setError("");
|
||||
setView("contents");
|
||||
setModal("");
|
||||
setOutlineOpen(false);
|
||||
setStructureOpen(false);
|
||||
const query = inherited ? `?context_kind=${inherited.kind}&context_id=${inherited.id}` : "";
|
||||
api(`/api/v1/matters/${id}${query}`).then((detail) => {
|
||||
if (!alive) return;
|
||||
@@ -205,95 +233,249 @@ export function MatterDetail() {
|
||||
}
|
||||
}, [record, id, chapterId, params, setParams]);
|
||||
|
||||
useEffect(() => {
|
||||
if (inherited?.kind !== "case") {
|
||||
setCaseTree(null);
|
||||
setParentTree(null);
|
||||
return undefined;
|
||||
}
|
||||
let alive = true;
|
||||
api(`/api/v1/cases/${inherited.id}`).then((detail) => {
|
||||
if (!alive) return;
|
||||
setCaseTree(detail);
|
||||
if (!detail.parent_case_id) {
|
||||
setParentTree(null);
|
||||
return;
|
||||
}
|
||||
api(`/api/v1/cases/${detail.parent_case_id}`).then((parent) => {
|
||||
if (alive) setParentTree(parent);
|
||||
}).catch(() => {
|
||||
if (alive) setParentTree(null);
|
||||
});
|
||||
}).catch(() => {
|
||||
if (alive) setCaseTree(null);
|
||||
});
|
||||
return () => {
|
||||
alive = false;
|
||||
};
|
||||
}, [inherited?.kind, inherited?.id]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!record || record.id !== id || !entryId) return;
|
||||
const binding = (record.bindings || []).find((item) => item.id === entryId);
|
||||
if (!binding) return;
|
||||
const nextChapter = binding.chapter_id || "";
|
||||
if ((chapterId || "") !== nextChapter) writeChapter(params, setParams, nextChapter);
|
||||
}, [record, id, entryId, chapterId, params, setParams]);
|
||||
|
||||
useEffect(() => {
|
||||
if (entryId) return;
|
||||
restoreScroll(listRef.current, `tsumugu-scroll:${id}:${chapterId}`);
|
||||
}, [entryId, id, chapterId, record]);
|
||||
|
||||
function chooseChapter(next) {
|
||||
writeChapter(params, setParams, next);
|
||||
const updated = new URLSearchParams(params);
|
||||
if (next) updated.set("kapitel", next);
|
||||
else updated.delete("kapitel");
|
||||
updated.delete("eintrag");
|
||||
updated.delete("bereich");
|
||||
setParams(updated);
|
||||
setView("contents");
|
||||
setOutlineOpen(false);
|
||||
setStructureOpen(false);
|
||||
}
|
||||
|
||||
function openEntry(binding) {
|
||||
rememberScroll(listRef.current, `tsumugu-scroll:${id}:${chapterId}`);
|
||||
const updated = new URLSearchParams(params);
|
||||
updated.set("eintrag", binding.id);
|
||||
if (binding.chapter_id) updated.set("kapitel", binding.chapter_id);
|
||||
else updated.delete("kapitel");
|
||||
setParams(updated);
|
||||
setView("contents");
|
||||
}
|
||||
|
||||
function closeEntry() {
|
||||
const updated = new URLSearchParams(params);
|
||||
updated.delete("eintrag");
|
||||
setParams(updated, { replace: true });
|
||||
}
|
||||
|
||||
function switchContext(caseId) {
|
||||
if (caseId === (inherited?.id || "")) return;
|
||||
if (isDirty() && !window.confirm("Ungespeicherte Eingaben verwerfen und den Aktenkontext wechseln?")) return;
|
||||
const updated = new URLSearchParams();
|
||||
if (caseId) {
|
||||
updated.set("context_kind", "case");
|
||||
updated.set("context_id", caseId);
|
||||
}
|
||||
setParams(updated);
|
||||
setStructureOpen(false);
|
||||
}
|
||||
|
||||
async function moveChapter(chapterIdToMove, delta) {
|
||||
const ids = (record?.chapters || []).map((chapter) => chapter.id);
|
||||
const index = ids.indexOf(chapterIdToMove);
|
||||
const target = index + delta;
|
||||
if (!record || index < 0 || target < 0 || target >= ids.length) return;
|
||||
const [moved] = ids.splice(index, 1);
|
||||
ids.splice(target, 0, moved);
|
||||
try {
|
||||
await saveChapterOrder({ containerKind: "matter", containerId: id, record, context: inherited, ids });
|
||||
await load();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
if (error && !record) return <main className="page"><ErrorNote error={error} /></main>;
|
||||
if (!record) return <main className="page"><p className="muted">Vorgang wird geladen …</p></main>;
|
||||
|
||||
const query = inherited ? `?context_kind=${inherited.kind}&context_id=${inherited.id}` : "";
|
||||
const query = contextQuery(inherited);
|
||||
const targetLabel = `${record.kind_label || "Vorgang"} ${record.title}`;
|
||||
const activeChapter = (record.chapters || []).find((chapter) => chapter.id === chapterId) || null;
|
||||
const canEdit = Boolean(record.rights?.edit);
|
||||
const chapters = (record.chapters || []).map((chapter) => ({
|
||||
...chapter,
|
||||
count: (record.bindings || []).filter((item) => item.chapter_id === chapter.id).length,
|
||||
}));
|
||||
const contexts = (record.placements || []).map((item) => ({
|
||||
id: item.case_id,
|
||||
label: item.label.replaceAll("Unterakte ", "").replaceAll("Akte ", "").replaceAll(" → ", " / "),
|
||||
}));
|
||||
const contextValue = inherited?.kind === "case" ? inherited.id : (contexts.length === 1 ? contexts[0].id : "");
|
||||
const nodes = caseTree ? caseNodes(caseTree, parentTree, id, inherited.id) : loneNodes(record, query);
|
||||
const links = [
|
||||
...(record.cross_links || []).map((item) => ({
|
||||
id: `cross-${item.id}`,
|
||||
title: item.title,
|
||||
kind: "Querverweis",
|
||||
href: `/matters/${item.matter_id}${query}`,
|
||||
})),
|
||||
...(record.case_links || []).filter((item) => item.case_id !== inherited?.id).map((item) => ({
|
||||
id: `case-${item.id}`,
|
||||
title: item.title,
|
||||
kind: "Weitere Akte",
|
||||
href: `/cases/${item.case_id}`,
|
||||
})),
|
||||
];
|
||||
const entry = (record.bindings || []).find((item) => item.id === entryId) || null;
|
||||
const scrollKey = `tsumugu-scroll:${id}:${chapterId}`;
|
||||
|
||||
return (
|
||||
<main className="page">
|
||||
<header className="page-head">
|
||||
<>
|
||||
<Workspace
|
||||
width={width}
|
||||
structureOpen={structureOpen}
|
||||
setStructureOpen={setStructureOpen}
|
||||
hasEntry={Boolean(entryId)}
|
||||
listRef={listRef}
|
||||
nav={(
|
||||
<StructureNavigator
|
||||
contexts={contexts.length > 1 && !inherited ? [{ id: "", label: "Keine Akte gewählt" }, ...contexts] : contexts}
|
||||
contextValue={contextValue}
|
||||
onContext={contexts.length > 1 ? switchContext : null}
|
||||
nodes={nodes}
|
||||
chapters={chapters}
|
||||
chapterId={chapterId}
|
||||
allCount={(record.bindings || []).length}
|
||||
chapterHeading={`Kapitel in ${record.title}`}
|
||||
onChapter={chooseChapter}
|
||||
onAddChapter={canEdit ? () => setModal("chapter") : null}
|
||||
canAddChapter={canEdit}
|
||||
onMoveChapter={moveChapter}
|
||||
canReorder={canEdit && chapters.length > 1}
|
||||
links={links}
|
||||
onNavigate={() => setStructureOpen(false)}
|
||||
onClose={width < 1500 ? () => setStructureOpen(false) : null}
|
||||
/>
|
||||
)}
|
||||
reader={entryId ? (
|
||||
<ReadingPane
|
||||
binding={entry}
|
||||
context={rightsContext}
|
||||
backLabel={activeChapter?.title || "Alle Inhalte"}
|
||||
onClose={closeEntry}
|
||||
onReload={load}
|
||||
canDetach={canEdit}
|
||||
canDestroy={Boolean(record.is_owner)}
|
||||
/>
|
||||
) : null}
|
||||
>
|
||||
<header className="workspace-head">
|
||||
<div>
|
||||
<Trail items={matterTrail(record, activeChapter, `/matters/${id}${query}`)} />
|
||||
<Trail items={objectTrail(record, query)} />
|
||||
<Placements items={record.placements} />
|
||||
<p className="eyebrow">{record.kind_label || "Vorgang"} · {record.home_scope_name}</p>
|
||||
<h1>{record.title}</h1>
|
||||
<p className="muted">{record.status === "open" ? "Offen" : "Geschlossen"}</p>
|
||||
<div className="title-row">
|
||||
<h1>{record.title}</h1>
|
||||
<span className={record.status === "open" ? "status-pill" : "status-pill is-closed"}>{record.status === "open" ? "Offen" : "Geschlossen"}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="page-actions">
|
||||
{canEdit ? <button type="button" onClick={() => setModal("add")}>Inhalt hinzufügen</button> : null}
|
||||
{width < 1500 ? <button type="button" className="quiet" onClick={() => setStructureOpen(true)}>Struktur</button> : null}
|
||||
{canEdit ? (
|
||||
<button type="button" className="desktop-add" onClick={() => setModal("add")}>
|
||||
<NavIcon name="plus" /> Inhalt hinzufügen
|
||||
</button>
|
||||
) : null}
|
||||
<ObjectMenu view={view} onView={setView}>
|
||||
{canEdit ? <button type="button" className="quiet" onClick={() => setModal("submatter")}>Teilvorgang anlegen</button> : null}
|
||||
{canEdit ? <button type="button" className="quiet" onClick={() => setModal("cross")}>Querverweis</button> : null}
|
||||
{record.rights.share || record.is_owner ? <button type="button" className="quiet" onClick={() => setModal("share")}>Teilen</button> : null}
|
||||
</ObjectMenu>
|
||||
{!canEdit ? <p className="muted">In {targetLabel} fehlt das Bearbeitungsrecht.</p> : null}
|
||||
</div>
|
||||
</header>
|
||||
{!canEdit ? <p className="muted">In {targetLabel} fehlt das Bearbeitungsrecht.</p> : null}
|
||||
<ErrorNote error={error} />
|
||||
<div className="record-layout">
|
||||
<aside className={outlineOpen ? "outline is-open" : "outline"}>
|
||||
<button type="button" className="outline__toggle" onClick={() => setOutlineOpen((open) => !open)}>{outlineOpen ? "Bereiche schließen" : "Bereiche"}</button>
|
||||
<div className="outline__body">
|
||||
<MatterOutline record={record} inherited={inherited} chapterId={chapterId} onChapter={chooseChapter} />
|
||||
</div>
|
||||
</aside>
|
||||
<div className="record-main">
|
||||
<WorkSwitch view={view} onView={setView} />
|
||||
{view === "contents" ? (
|
||||
<>
|
||||
<p className="target-line">
|
||||
Bearbeitet wird <strong>{targetLabel}</strong>
|
||||
{activeChapter ? <> · Kapitel <strong>{activeChapter.title}</strong></> : null}
|
||||
</p>
|
||||
<ContentBoard
|
||||
record={record}
|
||||
context={inherited}
|
||||
containerKind="matter"
|
||||
containerId={id}
|
||||
onlyChapter={chapterId}
|
||||
onChange={load}
|
||||
itemHref={(binding) => {
|
||||
const search = new URLSearchParams(query.replace(/^\?/, ""));
|
||||
if (chapterId) search.set("kapitel", chapterId);
|
||||
const next = search.toString();
|
||||
return `/matters/${id}/items/${binding.id}${next ? `?${next}` : ""}`;
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
{view === "work" ? (
|
||||
<div className="stack">
|
||||
{record.rights.edit ? <button type="button" onClick={() => setModal("work")}>Aufgabe oder Frist</button> : null}
|
||||
<WorkLists record={record} context={inherited} onChange={load} />
|
||||
</div>
|
||||
) : null}
|
||||
{view === "course" || view === "audit" ? (
|
||||
<SurfaceView view={view} coursePath={`/api/v1/matters/${id}/course${query}`} auditPath={`/api/v1/matters/${id}/chronology${query}`} />
|
||||
) : null}
|
||||
{view === "links" ? (
|
||||
<div className="stack">
|
||||
<h2>Zuordnungen</h2>
|
||||
{record.case_links?.length ? record.case_links.map((item) => (
|
||||
<p key={item.id}><Link to={`/cases/${item.case_id}`}>Akte {item.title}</Link></p>
|
||||
)) : <p className="muted">Noch keiner Akte zugeordnet.</p>}
|
||||
{record.cross_links?.length ? record.cross_links.map((item) => (
|
||||
<p key={item.id}>Querverweis <Link to={matterOpenHref({ id: item.matter_id, contexts: [] })}>{item.title}</Link></p>
|
||||
)) : <p className="muted">Kein Querverweis.</p>}
|
||||
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("cross")}>Querverweis</button> : null}
|
||||
</div>
|
||||
) : null}
|
||||
<WorkSwitch view={view} onView={setView} />
|
||||
{view === "contents" ? (
|
||||
<ContentBoard
|
||||
record={record}
|
||||
context={inherited}
|
||||
containerKind="matter"
|
||||
containerId={id}
|
||||
onlyChapter={chapterId}
|
||||
selectedId={entryId}
|
||||
listTitle={activeChapter ? activeChapter.title : "Alle Inhalte"}
|
||||
onOpen={(binding) => {
|
||||
rememberScroll(listRef.current, scrollKey);
|
||||
openEntry(binding);
|
||||
}}
|
||||
onChange={load}
|
||||
itemHref={(binding) => {
|
||||
const search = new URLSearchParams(query.replace(/^\?/, ""));
|
||||
search.set("eintrag", binding.id);
|
||||
if (binding.chapter_id) search.set("kapitel", binding.chapter_id);
|
||||
return `/matters/${id}?${search}`;
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
{view === "work" ? (
|
||||
<div className="stack">
|
||||
{record.rights.edit ? <button type="button" onClick={() => setModal("work")}>Aufgabe oder Frist</button> : null}
|
||||
<WorkLists record={record} context={inherited} onChange={load} />
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
{view === "course" || view === "audit" ? (
|
||||
<SurfaceView view={view} coursePath={`/api/v1/matters/${id}/course${query}`} auditPath={`/api/v1/matters/${id}/chronology${query}`} />
|
||||
) : null}
|
||||
{view === "links" ? (
|
||||
<div className="stack">
|
||||
<h2>Zuordnungen</h2>
|
||||
{record.case_links?.length ? record.case_links.map((item) => (
|
||||
<p key={item.id}><Link to={`/cases/${item.case_id}`}>Akte {item.title}</Link></p>
|
||||
)) : <p className="muted">Noch keiner Akte zugeordnet.</p>}
|
||||
{record.cross_links?.length ? record.cross_links.map((item) => (
|
||||
<p key={item.id}>Querverweis <Link to={matterOpenHref({ id: item.matter_id, contexts: [] })}>{item.title}</Link></p>
|
||||
)) : <p className="muted">Kein Querverweis.</p>}
|
||||
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("cross")}>Querverweis</button> : null}
|
||||
</div>
|
||||
) : null}
|
||||
{canEdit && view === "contents" ? (
|
||||
<button type="button" className="mobile-add" onClick={() => setModal("add")}>
|
||||
<NavIcon name="plus" /> Inhalt hinzufügen
|
||||
</button>
|
||||
) : null}
|
||||
</Workspace>
|
||||
<Modal open={modal === "work"} title="Aufgabe oder Frist" onClose={() => setModal("")}>
|
||||
<WorkForms matterId={id} context={inherited} tasks={record.tasks} onChange={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
@@ -341,7 +523,7 @@ export function MatterDetail() {
|
||||
<Modal open={modal === "share"} title="Teilen" onClose={() => setModal("")}>
|
||||
<ShareBox path={`/api/v1/matters/${id}/grants`} grants={record.grants || []} onChange={load} />
|
||||
</Modal>
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { isDirty, markDirty } from "../api.js";
|
||||
|
||||
export function Modal({ open, title, onClose, wide = false, children }) {
|
||||
const dialogRef = useRef(null);
|
||||
const restoreRef = useRef(null);
|
||||
|
||||
function requestClose() {
|
||||
if (isDirty() && !window.confirm("Ungespeicherte Eingaben verwerfen?")) return;
|
||||
markDirty(false);
|
||||
@@ -10,6 +13,10 @@ export function Modal({ open, title, onClose, wide = false, children }) {
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) return undefined;
|
||||
restoreRef.current = document.activeElement;
|
||||
const node = dialogRef.current;
|
||||
const focusable = node?.querySelector("input, textarea, select, button");
|
||||
(focusable || node)?.focus();
|
||||
function onKey(event) {
|
||||
if (event.key === "Escape") requestClose();
|
||||
}
|
||||
@@ -19,13 +26,14 @@ export function Modal({ open, title, onClose, wide = false, children }) {
|
||||
return () => {
|
||||
document.removeEventListener("keydown", onKey);
|
||||
document.body.style.overflow = previous;
|
||||
restoreRef.current?.focus?.();
|
||||
};
|
||||
}, [open, onClose]);
|
||||
}, [open]);
|
||||
|
||||
if (!open) return null;
|
||||
return (
|
||||
<div className="modal-overlay" onClick={(event) => { if (event.target === event.currentTarget) requestClose(); }}>
|
||||
<div className={wide ? "modal modal--wide" : "modal"} role="dialog" aria-modal="true" aria-label={title}>
|
||||
<div ref={dialogRef} className={wide ? "modal modal--wide" : "modal"} role="dialog" aria-modal="true" aria-label={title} tabIndex={-1}>
|
||||
<header className="modal__bar">
|
||||
<h2>{title}</h2>
|
||||
<button type="button" className="quiet" onClick={requestClose}>Schließen</button>
|
||||
|
||||
@@ -1,294 +1,11 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Link, useLocation, useNavigate, useParams, useSearchParams } from "react-router-dom";
|
||||
import { api, documentToText, fetchFile, fetchPaperless, markDirty, textToDocument } from "../api.js";
|
||||
import { ErrorNote } from "./widgets.jsx";
|
||||
import { formatDate, kindLabel, Trail } from "./content.jsx";
|
||||
|
||||
function pageContext(params) {
|
||||
const kind = params.get("context_kind");
|
||||
const id = params.get("context_id");
|
||||
if (!kind || !id || kind === "direct") return null;
|
||||
return { kind, id };
|
||||
}
|
||||
|
||||
function returnHref(kind, id, params) {
|
||||
const bereich = params.get("bereich");
|
||||
const kapitel = params.get("kapitel");
|
||||
const contextKind = params.get("context_kind");
|
||||
const contextId = params.get("context_id");
|
||||
if (kind === "matters" && bereich && contextKind === "case" && contextId) {
|
||||
const search = new URLSearchParams();
|
||||
search.set("bereich", bereich);
|
||||
if (kapitel) search.set("kapitel", kapitel);
|
||||
return `/cases/${contextId}?${search}`;
|
||||
}
|
||||
const search = new URLSearchParams();
|
||||
if (kind === "matters" && contextKind && contextId && contextKind !== "direct") {
|
||||
search.set("context_kind", contextKind);
|
||||
search.set("context_id", contextId);
|
||||
}
|
||||
if (kind === "cases" && bereich) search.set("bereich", bereich);
|
||||
if (kapitel) search.set("kapitel", kapitel);
|
||||
const query = search.toString();
|
||||
return `/${kind}/${id}${query ? `?${query}` : ""}`;
|
||||
}
|
||||
import { Navigate, useLocation, useParams, useSearchParams } from "react-router-dom";
|
||||
|
||||
export function Reader() {
|
||||
const location = useLocation();
|
||||
const kind = location.pathname.startsWith("/cases") ? "cases" : "matters";
|
||||
const { id, bindingId } = useParams();
|
||||
const [params] = useSearchParams();
|
||||
const inherited = pageContext(params);
|
||||
const [record, setRecord] = useState(null);
|
||||
const [error, setError] = useState("");
|
||||
const [previewUrl, setPreviewUrl] = useState("");
|
||||
const [text, setText] = useState("");
|
||||
const [note, setNote] = useState("");
|
||||
const [documentOn, setDocumentOn] = useState("");
|
||||
const [summary, setSummary] = useState("");
|
||||
const [previewKind, setPreviewKind] = useState("");
|
||||
const [notice, setNotice] = useState("");
|
||||
const navigate = useNavigate();
|
||||
|
||||
const context = kind === "cases" ? { kind: "case", id } : (inherited || { kind: "matter", id });
|
||||
const query = kind === "matters" && inherited ? `?context_kind=${inherited.kind}&context_id=${inherited.id}` : "";
|
||||
|
||||
async function load() {
|
||||
const detail = await api(`/api/v1/${kind}/${id}${query}`);
|
||||
const pools = [...(detail.bindings || [])];
|
||||
for (const group of detail.contained || []) pools.push(...group.bindings);
|
||||
const binding = pools.find((item) => item.id === bindingId);
|
||||
if (!binding) {
|
||||
setRecord(detail);
|
||||
setError("Diese Unterlage ist in dieser Ansicht nicht sichtbar.");
|
||||
return;
|
||||
}
|
||||
setRecord({ ...detail, binding });
|
||||
setText(binding.element.kind === "note" ? documentToText(binding.element.document) : "");
|
||||
setDocumentOn(binding.element.dates?.document_on || "");
|
||||
setSummary(binding.element.summary || "");
|
||||
setError("");
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setRecord(null);
|
||||
setPreviewUrl((current) => {
|
||||
if (current) URL.revokeObjectURL(current);
|
||||
return "";
|
||||
});
|
||||
load().catch((err) => setError(err.message));
|
||||
}, [kind, id, bindingId, query]);
|
||||
|
||||
useEffect(() => () => {
|
||||
if (previewUrl) URL.revokeObjectURL(previewUrl);
|
||||
}, [previewUrl]);
|
||||
|
||||
useEffect(() => {
|
||||
const element = record?.binding?.element;
|
||||
if (!element || element.kind === "note") return undefined;
|
||||
if (!element.preview?.available) return undefined;
|
||||
let alive = true;
|
||||
const load = element.kind === "external_ref" ? fetchPaperless(element.id, context) : fetchFile(element.id, context);
|
||||
load.then((blob) => {
|
||||
if (!alive) return;
|
||||
const next = URL.createObjectURL(blob);
|
||||
setPreviewUrl((current) => {
|
||||
if (current) URL.revokeObjectURL(current);
|
||||
return next;
|
||||
});
|
||||
if (blob.type.startsWith("image/")) setPreviewKind("image");
|
||||
else if (blob.type.includes("pdf")) setPreviewKind("pdf");
|
||||
else setPreviewKind("other");
|
||||
}).catch((err) => {
|
||||
if (alive) setError(err.message);
|
||||
});
|
||||
return () => {
|
||||
alive = false;
|
||||
};
|
||||
}, [record?.binding?.id]);
|
||||
|
||||
if (error && !record?.binding) {
|
||||
return <main className="page"><ErrorNote error={error} /><p><Link to={returnHref(kind, id, params)}>Zurück</Link></p></main>;
|
||||
}
|
||||
if (!record?.binding) return <main className="page"><p className="muted">Unterlage wird geladen …</p></main>;
|
||||
|
||||
const binding = record.binding;
|
||||
const element = binding.element;
|
||||
const back = returnHref(kind, id, params);
|
||||
|
||||
async function openFile() {
|
||||
setError("");
|
||||
try {
|
||||
const blob = element.kind === "external_ref"
|
||||
? await fetchPaperless(element.id, context)
|
||||
: await fetchFile(element.id, context);
|
||||
if (previewUrl) URL.revokeObjectURL(previewUrl);
|
||||
setPreviewUrl(URL.createObjectURL(blob));
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function saveNote(event) {
|
||||
event.preventDefault();
|
||||
setError("");
|
||||
try {
|
||||
const updated = await api(`/api/v1/notes/${element.id}`, {
|
||||
method: "PATCH",
|
||||
body: { expected_version: element.version, document: textToDocument(text), context },
|
||||
});
|
||||
markDirty(false);
|
||||
setNotice(updated.notice || "Der gemeinsame Text ist gespeichert.");
|
||||
load();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function saveSummary(event) {
|
||||
event.preventDefault();
|
||||
setError("");
|
||||
try {
|
||||
await api(`/api/v1/elements/${element.id}/summary`, {
|
||||
method: "PATCH",
|
||||
body: { expected_version: element.version, summary: summary.trim() || null, context },
|
||||
});
|
||||
markDirty(false);
|
||||
load();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function saveDate(event) {
|
||||
event.preventDefault();
|
||||
setError("");
|
||||
try {
|
||||
await api(`/api/v1/elements/${element.id}/dates`, {
|
||||
method: "PATCH",
|
||||
body: {
|
||||
expected_version: element.version,
|
||||
document_on: documentOn || null,
|
||||
sent_on: element.dates?.sent_on || null,
|
||||
received_on: element.dates?.received_on || null,
|
||||
context,
|
||||
},
|
||||
});
|
||||
markDirty(false);
|
||||
load();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function annotate(event) {
|
||||
event.preventDefault();
|
||||
const search = new URLSearchParams();
|
||||
search.set("context_kind", context.kind);
|
||||
search.set("context_id", context.id);
|
||||
try {
|
||||
await api(`/api/v1/bindings/${binding.id}/annotations?${search}`, { method: "POST", body: { body: note } });
|
||||
setNote("");
|
||||
markDirty(false);
|
||||
load();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function detach() {
|
||||
if (!window.confirm("Aus diesem Zusammenhang entfernen? Die Unterlage bleibt an anderen Stellen erhalten.")) return;
|
||||
const search = new URLSearchParams();
|
||||
search.set("context_kind", context.kind);
|
||||
search.set("context_id", context.id);
|
||||
await api(`/api/v1/bindings/${binding.id}?${search}`, { method: "DELETE" });
|
||||
navigate(back);
|
||||
}
|
||||
|
||||
async function destroy() {
|
||||
if (!window.confirm("Überall löschen? Alle Einbindungen verschwinden. Eine Paperless-Quelle bleibt unangetastet.")) return;
|
||||
await api(`/api/v1/elements/${element.id}/delete`, { method: "POST", body: { expected_version: element.version } });
|
||||
navigate(back);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="page reader">
|
||||
<Trail items={[...(record.trail || []).map((item, index, all) => (index === all.length - 1 ? { ...item, href: back } : item)), { label: element.title, href: null }]} />
|
||||
<p><Link to={back}>{kind === "cases" ? "Zurück zur Akte" : "Zurück zum Vorgang"}</Link></p>
|
||||
<header className="page-head">
|
||||
<div>
|
||||
<p className="eyebrow">{kindLabel(element.kind)}</p>
|
||||
<h1>{element.title}</h1>
|
||||
<p className="muted">Fachliches Datum: {formatDate(element.dates?.document_on)}</p>
|
||||
</div>
|
||||
</header>
|
||||
<ErrorNote error={error} />
|
||||
{element.kind === "note" ? (
|
||||
<form className="stack" onSubmit={saveNote}>
|
||||
<label>
|
||||
Gemeinsamer Text
|
||||
<textarea rows={8} value={text} disabled={!binding.rights.edit} onChange={(event) => { setText(event.target.value); markDirty(true); }} />
|
||||
</label>
|
||||
<p className="muted">Diese Änderung betrifft den gemeinsamen Inhalt der Notiz.</p>
|
||||
{notice ? <p className="notice">{notice}</p> : null}
|
||||
{binding.rights.edit ? <button type="submit">Text speichern</button> : <p className="muted">In diesem Kontext nur lesbar.</p>}
|
||||
</form>
|
||||
) : previewUrl && previewKind === "image" ? (
|
||||
<img className="reader-preview" alt={element.title} src={previewUrl} />
|
||||
) : previewUrl ? (
|
||||
<iframe className="preview" title={element.title} src={previewUrl} />
|
||||
) : (
|
||||
<div className="stack">
|
||||
<p className="muted">{element.preview?.available ? "Vorschau wird geladen …" : "Für diesen Typ gibt es keine eingebaute Vorschau."}</p>
|
||||
<button type="button" onClick={openFile}>{element.kind === "external_ref" ? "Paperless öffnen" : "Datei öffnen"}</button>
|
||||
</div>
|
||||
)}
|
||||
{binding.rights.edit ? (
|
||||
<form className="stack" onSubmit={saveSummary}>
|
||||
<label>
|
||||
Kurzbeschreibung, optional
|
||||
<textarea rows={2} maxLength={400} value={summary} onChange={(event) => { setSummary(event.target.value); markDirty(true); }} />
|
||||
</label>
|
||||
<button type="submit" className="quiet">Kurzbeschreibung speichern</button>
|
||||
</form>
|
||||
) : element.summary ? <p>{element.summary}</p> : null}
|
||||
{binding.rights.edit ? (
|
||||
<form className="stack" onSubmit={saveDate}>
|
||||
<label>
|
||||
{element.kind === "note" ? "Bezugsdatum, optional" : "Dokumentdatum, optional"}
|
||||
<input type="date" value={documentOn} onChange={(event) => { setDocumentOn(event.target.value); markDirty(true); }} />
|
||||
</label>
|
||||
<button type="submit" className="quiet">Datum speichern</button>
|
||||
</form>
|
||||
) : null}
|
||||
<section className="section">
|
||||
<h2>Anmerkung in diesem Zusammenhang</h2>
|
||||
<p className="muted">Die Anmerkung gilt nur hier, nicht für den gemeinsamen Inhalt.</p>
|
||||
{binding.annotations?.length ? (
|
||||
<ul className="notes">
|
||||
{binding.annotations.map((item) => (
|
||||
<li key={item.id}><strong>{item.author_display_name}</strong> {item.body}</li>
|
||||
))}
|
||||
</ul>
|
||||
) : <p className="muted">Noch keine Anmerkung.</p>}
|
||||
{binding.rights.edit ? (
|
||||
<form className="stack" onSubmit={annotate}>
|
||||
<label>
|
||||
Neue Anmerkung
|
||||
<textarea rows={3} value={note} onChange={(event) => { setNote(event.target.value); markDirty(true); }} required />
|
||||
</label>
|
||||
<button type="submit" className="quiet">Anmerkung speichern</button>
|
||||
</form>
|
||||
) : null}
|
||||
</section>
|
||||
<details className="fold">
|
||||
<summary>Weitere Aktionen</summary>
|
||||
<div className="row">
|
||||
{record.rights?.edit ? <button type="button" className="quiet" onClick={detach}>Aus diesem Zusammenhang entfernen</button> : null}
|
||||
{record.is_owner ? <button type="button" className="danger" onClick={destroy}>Überall löschen</button> : null}
|
||||
</div>
|
||||
</details>
|
||||
</main>
|
||||
);
|
||||
const next = new URLSearchParams(params);
|
||||
next.set("eintrag", bindingId);
|
||||
return <Navigate to={`/${kind}/${id}?${next.toString()}`} replace />;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,382 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { documentToText, fetchFile, fetchPaperless, markDirty, textToDocument, api } from "../api.js";
|
||||
import { ErrorNote } from "./widgets.jsx";
|
||||
import { formatDate, kindLabel } from "./content.jsx";
|
||||
import { NavIcon } from "./icons.jsx";
|
||||
import workerSrc from "pdfjs-dist/build/pdf.worker.min.mjs?url";
|
||||
|
||||
const SCALES = [0.75, 1, 1.25, 1.5, 2];
|
||||
|
||||
export function ReadingPane({ binding, context, backLabel, onClose, onReload, canDetach, canDestroy }) {
|
||||
const element = binding?.element;
|
||||
const [error, setError] = useState("");
|
||||
const [phase, setPhase] = useState("idle");
|
||||
const [media, setMedia] = useState("");
|
||||
const [blobUrl, setBlobUrl] = useState("");
|
||||
const [pdf, setPdf] = useState(null);
|
||||
const [page, setPage] = useState(1);
|
||||
const [pages, setPages] = useState(0);
|
||||
const [scale, setScale] = useState(1);
|
||||
const [text, setText] = useState("");
|
||||
const [note, setNote] = useState("");
|
||||
const [summary, setSummary] = useState("");
|
||||
const [documentOn, setDocumentOn] = useState("");
|
||||
const [notice, setNotice] = useState("");
|
||||
const [annotate, setAnnotate] = useState(false);
|
||||
const canvasRef = useRef(null);
|
||||
const closeRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
closeRef.current?.focus();
|
||||
}, [binding?.id]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!element) return undefined;
|
||||
setText(element.kind === "note" ? documentToText(element.document) : "");
|
||||
setDocumentOn(element.dates?.document_on || "");
|
||||
setSummary(element.summary || "");
|
||||
setError("");
|
||||
setNotice("");
|
||||
setPage(1);
|
||||
setPdf(null);
|
||||
setPages(0);
|
||||
setMedia("");
|
||||
setPhase(element.kind === "note" ? "ready" : element.preview?.available ? "loading" : "missing");
|
||||
return undefined;
|
||||
}, [element?.id, element?.version]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!element || element.kind === "note" || !element.preview?.available) return undefined;
|
||||
let alive = true;
|
||||
let url = "";
|
||||
setPhase("loading");
|
||||
const load = element.kind === "external_ref" ? fetchPaperless(element.id, context) : fetchFile(element.id, context);
|
||||
load.then(async (blob) => {
|
||||
if (!alive) return;
|
||||
url = URL.createObjectURL(blob);
|
||||
setBlobUrl(url);
|
||||
if (blob.type.startsWith("image/")) {
|
||||
setMedia("image");
|
||||
setPhase("ready");
|
||||
return;
|
||||
}
|
||||
if (blob.type.includes("pdf") || element.file?.content_type === "application/pdf") {
|
||||
setMedia("pdf");
|
||||
try {
|
||||
const bytes = await blob.arrayBuffer();
|
||||
const pdfjs = await import("pdfjs-dist");
|
||||
pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;
|
||||
const doc = await pdfjs.getDocument({ data: bytes }).promise;
|
||||
if (!alive) {
|
||||
doc.destroy();
|
||||
return;
|
||||
}
|
||||
setPdf(doc);
|
||||
setPages(doc.numPages);
|
||||
setPhase("ready");
|
||||
} catch (err) {
|
||||
if (!alive) return;
|
||||
setMedia("pdf-frame");
|
||||
setPhase("ready");
|
||||
setError("");
|
||||
}
|
||||
return;
|
||||
}
|
||||
setMedia("other");
|
||||
setPhase("ready");
|
||||
}).catch((err) => {
|
||||
if (!alive) return;
|
||||
setPhase("error");
|
||||
setError(err.message || "Die Vorschau ist nicht verfügbar.");
|
||||
});
|
||||
return () => {
|
||||
alive = false;
|
||||
if (url) URL.revokeObjectURL(url);
|
||||
};
|
||||
}, [element?.id, element?.preview?.available, context?.kind, context?.id]);
|
||||
|
||||
useEffect(() => () => {
|
||||
pdf?.destroy?.();
|
||||
}, [pdf]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!pdf || !canvasRef.current) return undefined;
|
||||
let alive = true;
|
||||
const task = { cancel: null };
|
||||
pdf.getPage(page).then((pdfPage) => {
|
||||
if (!alive) return;
|
||||
const viewport = pdfPage.getViewport({ scale });
|
||||
const canvas = canvasRef.current;
|
||||
const context2d = canvas.getContext("2d");
|
||||
canvas.width = viewport.width;
|
||||
canvas.height = viewport.height;
|
||||
const render = pdfPage.render({ canvasContext: context2d, viewport });
|
||||
task.cancel = () => render.cancel();
|
||||
return render.promise;
|
||||
}).catch((err) => {
|
||||
if (!alive || err?.name === "RenderingCancelledException") return;
|
||||
setPhase("error");
|
||||
setError("Die Seite konnte nicht dargestellt werden.");
|
||||
});
|
||||
return () => {
|
||||
alive = false;
|
||||
task.cancel?.();
|
||||
};
|
||||
}, [pdf, page, scale]);
|
||||
|
||||
useEffect(() => {
|
||||
function onKey(event) {
|
||||
if (event.key === "Escape") {
|
||||
onClose();
|
||||
return;
|
||||
}
|
||||
const tag = event.target?.tagName;
|
||||
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return;
|
||||
if (!pages) return;
|
||||
if (event.key === "ArrowRight") setPage((current) => Math.min(pages, current + 1));
|
||||
if (event.key === "ArrowLeft") setPage((current) => Math.max(1, current - 1));
|
||||
}
|
||||
window.addEventListener("keydown", onKey);
|
||||
return () => window.removeEventListener("keydown", onKey);
|
||||
}, [onClose, pages]);
|
||||
|
||||
async function openOriginal() {
|
||||
setError("");
|
||||
try {
|
||||
const blob = element.kind === "external_ref"
|
||||
? await fetchPaperless(element.id, context)
|
||||
: await fetchFile(element.id, context);
|
||||
const url = URL.createObjectURL(blob);
|
||||
window.open(url, "_blank", "noopener");
|
||||
setTimeout(() => URL.revokeObjectURL(url), 60000);
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function saveNote(event) {
|
||||
event.preventDefault();
|
||||
setError("");
|
||||
try {
|
||||
const updated = await api(`/api/v1/notes/${element.id}`, {
|
||||
method: "PATCH",
|
||||
body: { expected_version: element.version, document: textToDocument(text), context },
|
||||
});
|
||||
markDirty(false);
|
||||
setNotice(updated.notice || "Der gemeinsame Text ist gespeichert.");
|
||||
onReload();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function saveSummary(event) {
|
||||
event.preventDefault();
|
||||
setError("");
|
||||
try {
|
||||
await api(`/api/v1/elements/${element.id}/summary`, {
|
||||
method: "PATCH",
|
||||
body: { expected_version: element.version, summary: summary.trim() || null, context },
|
||||
});
|
||||
markDirty(false);
|
||||
onReload();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function saveDate(event) {
|
||||
event.preventDefault();
|
||||
setError("");
|
||||
try {
|
||||
await api(`/api/v1/elements/${element.id}/dates`, {
|
||||
method: "PATCH",
|
||||
body: {
|
||||
expected_version: element.version,
|
||||
document_on: documentOn || null,
|
||||
sent_on: element.dates?.sent_on || null,
|
||||
received_on: element.dates?.received_on || null,
|
||||
context,
|
||||
},
|
||||
});
|
||||
markDirty(false);
|
||||
onReload();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function annotateSubmit(event) {
|
||||
event.preventDefault();
|
||||
const search = new URLSearchParams();
|
||||
search.set("context_kind", context.kind);
|
||||
search.set("context_id", context.id);
|
||||
try {
|
||||
await api(`/api/v1/bindings/${binding.id}/annotations?${search}`, { method: "POST", body: { body: note } });
|
||||
setNote("");
|
||||
markDirty(false);
|
||||
onReload();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function detach() {
|
||||
if (!window.confirm("Aus diesem Zusammenhang entfernen? Die Unterlage bleibt an anderen Stellen erhalten.")) return;
|
||||
const search = new URLSearchParams();
|
||||
search.set("context_kind", context.kind);
|
||||
search.set("context_id", context.id);
|
||||
await api(`/api/v1/bindings/${binding.id}?${search}`, { method: "DELETE" });
|
||||
onClose();
|
||||
onReload();
|
||||
}
|
||||
|
||||
async function destroy() {
|
||||
if (!window.confirm("Überall löschen? Alle Einbindungen verschwinden. Eine Paperless-Quelle bleibt unangetastet.")) return;
|
||||
await api(`/api/v1/elements/${element.id}/delete`, { method: "POST", body: { expected_version: element.version } });
|
||||
onClose();
|
||||
onReload();
|
||||
}
|
||||
|
||||
if (!binding) {
|
||||
return (
|
||||
<section className="reader-pane" aria-label="Leser">
|
||||
<header className="reader-pane__bar">
|
||||
<button type="button" className="quiet" onClick={onClose}>Zurück zu {backLabel || "den Inhalten"}</button>
|
||||
</header>
|
||||
<p className="muted reader-pane__state">Diese Unterlage ist hier nicht sichtbar.</p>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
const typeLabel = element.kind === "file" && element.file?.content_type === "application/pdf"
|
||||
? "PDF"
|
||||
: element.kind === "external_ref"
|
||||
? (element.external?.source === "imap" ? "E-Mail" : kindLabel(element.kind))
|
||||
: kindLabel(element.kind);
|
||||
|
||||
return (
|
||||
<section className="reader-pane" aria-label="Leser">
|
||||
<header className="reader-pane__bar">
|
||||
<button type="button" className="reader-back" onClick={onClose}>
|
||||
<span aria-hidden="true">‹</span> {backLabel || "Inhalte"}
|
||||
</button>
|
||||
<div className="reader-pane__heading">
|
||||
<h2>{element.title}</h2>
|
||||
<p>{formatDate(element.dates?.document_on)} · {typeLabel}</p>
|
||||
</div>
|
||||
<div className="reader-pane__tools">
|
||||
{element.kind !== "note" ? (
|
||||
<button type="button" className="icon-button" aria-label="Original öffnen" onClick={openOriginal}>
|
||||
<NavIcon name="link" />
|
||||
</button>
|
||||
) : null}
|
||||
<button ref={closeRef} type="button" className="icon-button" aria-label="Leser schließen" onClick={onClose}>
|
||||
<NavIcon name="close" />
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
<div className="reader-pane__stage">
|
||||
<ErrorNote error={error} />
|
||||
{element.kind === "note" ? (
|
||||
<form className="reader-note" onSubmit={saveNote}>
|
||||
<label>
|
||||
Gemeinsamer Text
|
||||
<textarea rows={12} value={text} disabled={!binding.rights.edit} onChange={(event) => { setText(event.target.value); markDirty(true); }} />
|
||||
</label>
|
||||
<p className="muted">Diese Änderung betrifft den gemeinsamen Inhalt der Notiz, nicht die hiesige Anmerkung.</p>
|
||||
{notice ? <p className="notice">{notice}</p> : null}
|
||||
{binding.rights.edit ? <button type="submit">Text speichern</button> : <p className="muted">In diesem Kontext nur lesbar.</p>}
|
||||
</form>
|
||||
) : null}
|
||||
{phase === "loading" ? <p className="reader-pane__state">Vorschau wird geladen …</p> : null}
|
||||
{phase === "missing" ? (
|
||||
<div className="reader-pane__state">
|
||||
<p>Für diesen Inhalt gibt es keine eingebaute Vorschau.</p>
|
||||
<button type="button" onClick={openOriginal}>Original öffnen</button>
|
||||
</div>
|
||||
) : null}
|
||||
{phase === "error" ? (
|
||||
<div className="reader-pane__state">
|
||||
<p>Die Vorschau ist nicht verfügbar.</p>
|
||||
<button type="button" onClick={openOriginal}>Original öffnen</button>
|
||||
</div>
|
||||
) : null}
|
||||
{media === "image" && blobUrl ? (
|
||||
<img className="reader-image" alt={element.title} src={blobUrl} style={{ width: `${Math.round(scale * 100)}%` }} />
|
||||
) : null}
|
||||
{media === "pdf" && pdf ? <canvas ref={canvasRef} className="reader-canvas" /> : null}
|
||||
{media === "pdf-frame" && blobUrl ? <iframe className="reader-frame" title={element.title} src={blobUrl} /> : null}
|
||||
{media === "other" && blobUrl ? (
|
||||
<div className="reader-pane__state">
|
||||
<p>Die Datei ist geladen, aber hier nicht als Seite darstellbar.</p>
|
||||
<a href={blobUrl} target="_blank" rel="noreferrer">Original öffnen</a>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
<footer className="reader-pane__foot">
|
||||
{pages > 1 || media === "image" ? (
|
||||
<div className="reader-controls">
|
||||
{pages > 1 ? (
|
||||
<div className="reader-pages">
|
||||
<button type="button" className="icon-button" aria-label="Vorherige Seite" disabled={page <= 1} onClick={() => setPage((current) => Math.max(1, current - 1))}>‹</button>
|
||||
<span>{page} / {pages}</span>
|
||||
<button type="button" className="icon-button" aria-label="Nächste Seite" disabled={page >= pages} onClick={() => setPage((current) => Math.min(pages, current + 1))}>›</button>
|
||||
</div>
|
||||
) : <span />}
|
||||
<div className="reader-zoom">
|
||||
<button type="button" className="icon-button" aria-label="Verkleinern" disabled={scale <= SCALES[0]} onClick={() => setScale((current) => SCALES[Math.max(0, SCALES.indexOf(current) - 1)] || current)}>−</button>
|
||||
<span>{Math.round(scale * 100)}%</span>
|
||||
<button type="button" className="icon-button" aria-label="Vergrößern" disabled={scale >= SCALES[SCALES.length - 1]} onClick={() => setScale((current) => SCALES[Math.min(SCALES.length - 1, SCALES.indexOf(current) + 1)] || current)}>+</button>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
<button type="button" className="quiet" onClick={() => setAnnotate((open) => !open)}>{annotate ? "Anmerkung schließen" : "Anmerkung"}</button>
|
||||
</footer>
|
||||
{annotate ? (
|
||||
<div className="reader-annotate">
|
||||
<h3>Anmerkung in diesem Zusammenhang</h3>
|
||||
<p className="muted">Sie gilt nur hier und ändert den gemeinsamen Inhalt nicht.</p>
|
||||
{binding.annotations?.length ? (
|
||||
<ul className="notes">
|
||||
{binding.annotations.map((item) => (
|
||||
<li key={item.id}><strong>{item.author_display_name}</strong> {item.body}</li>
|
||||
))}
|
||||
</ul>
|
||||
) : <p className="muted">Noch keine Anmerkung.</p>}
|
||||
{binding.rights.edit ? (
|
||||
<form className="stack" onSubmit={annotateSubmit}>
|
||||
<label>
|
||||
Neue Anmerkung
|
||||
<textarea rows={3} value={note} onChange={(event) => { setNote(event.target.value); markDirty(true); }} required />
|
||||
</label>
|
||||
<button type="submit">Anmerkung speichern</button>
|
||||
</form>
|
||||
) : null}
|
||||
{binding.rights.edit ? (
|
||||
<form className="stack" onSubmit={saveSummary}>
|
||||
<label>
|
||||
Kurzbeschreibung, optional
|
||||
<textarea rows={2} maxLength={400} value={summary} onChange={(event) => { setSummary(event.target.value); markDirty(true); }} />
|
||||
</label>
|
||||
<button type="submit" className="quiet">Kurzbeschreibung speichern</button>
|
||||
</form>
|
||||
) : null}
|
||||
{binding.rights.edit ? (
|
||||
<form className="stack" onSubmit={saveDate}>
|
||||
<label>
|
||||
{element.kind === "note" ? "Bezugsdatum, optional" : "Dokumentdatum, optional"}
|
||||
<input type="date" value={documentOn} onChange={(event) => { setDocumentOn(event.target.value); markDirty(true); }} />
|
||||
</label>
|
||||
<button type="submit" className="quiet">Datum speichern</button>
|
||||
</form>
|
||||
) : null}
|
||||
<div className="row">
|
||||
{canDetach ? <button type="button" className="quiet" onClick={detach}>Aus diesem Zusammenhang entfernen</button> : null}
|
||||
{canDestroy ? <button type="button" className="danger" onClick={destroy}>Überall löschen</button> : null}
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -46,8 +46,14 @@ function Result({ item }) {
|
||||
if (item.kind === "matter") return <Link to={matterOpenHref(item)}>{item.title}</Link>;
|
||||
const context = item.contexts?.[0];
|
||||
if (!context) return <span>{item.title}</span>;
|
||||
if (context.kind === "case") return <Link to={`/cases/${context.id}`}>{item.title}</Link>;
|
||||
return <Link to={`/matters/${context.id}`}>{item.title}</Link>;
|
||||
const search = new URLSearchParams();
|
||||
if (context.binding_id) search.set("eintrag", context.binding_id);
|
||||
if (context.chapter_id) search.set("kapitel", context.chapter_id);
|
||||
const query = search.toString();
|
||||
if (context.kind === "case") {
|
||||
return <Link to={`/cases/${context.id}${query ? `?${query}` : ""}`}>{item.title}</Link>;
|
||||
}
|
||||
return <Link to={`/matters/${context.id}${query ? `?${query}` : ""}`}>{item.title}</Link>;
|
||||
}
|
||||
|
||||
function label(kind) {
|
||||
|
||||
@@ -1,110 +1,161 @@
|
||||
import { useContext, useState } from "react";
|
||||
import { NavLink, Outlet, useNavigate } from "react-router-dom";
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import { NavLink, Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||
import { SessionContext } from "../session.js";
|
||||
import { Mark, NavIcon } from "./icons.jsx";
|
||||
|
||||
const NAV_KEY = "tsumugu-nav-expanded";
|
||||
|
||||
const WORK = [
|
||||
{ to: "/", end: true, label: "Übersicht", icon: "home" },
|
||||
{ to: "/matters", label: "Vorgänge", icon: "layers" },
|
||||
{ to: "/cases", label: "Akten", icon: "folder" },
|
||||
{ to: "/work", label: "Aufgaben", icon: "check" },
|
||||
{ to: "/", end: true, label: "Übersicht", short: "Start", icon: "home" },
|
||||
{ to: "/matters", label: "Vorgänge", short: "Vorgänge", icon: "layers" },
|
||||
{ to: "/cases", label: "Akten", short: "Akten", icon: "folder" },
|
||||
{ to: "/work", label: "Aufgaben", short: "Aufgaben", icon: "check" },
|
||||
];
|
||||
|
||||
const ADMIN = [
|
||||
{ to: "/settings", label: "Verwaltung", icon: "rooms" },
|
||||
];
|
||||
function initials(name) {
|
||||
const parts = String(name || "").trim().split(/\s+/).filter(Boolean);
|
||||
if (!parts.length) return "·";
|
||||
return parts.slice(0, 2).map((part) => part[0]).join("").toUpperCase();
|
||||
}
|
||||
|
||||
export function Shell() {
|
||||
const { session, logout } = useContext(SessionContext);
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const [expanded, setExpanded] = useState(() => {
|
||||
try {
|
||||
return localStorage.getItem(NAV_KEY) !== "0";
|
||||
} catch {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
const [query, setQuery] = useState("");
|
||||
const items = [...WORK, ...ADMIN];
|
||||
const [more, setMore] = useState(false);
|
||||
const [width, setWidth] = useState(() => window.innerWidth);
|
||||
|
||||
useEffect(() => {
|
||||
const onResize = () => setWidth(window.innerWidth);
|
||||
window.addEventListener("resize", onResize);
|
||||
return () => window.removeEventListener("resize", onResize);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setMore(false);
|
||||
}, [location.pathname]);
|
||||
|
||||
const forcedCompact = width < 1180;
|
||||
const compact = forcedCompact || !expanded;
|
||||
|
||||
function toggleNav() {
|
||||
setExpanded((value) => {
|
||||
const next = !value;
|
||||
try {
|
||||
localStorage.setItem(NAV_KEY, next ? "1" : "0");
|
||||
} catch {
|
||||
/* Die Breite bleibt auch ohne gespeicherte Präferenz bedienbar. */
|
||||
}
|
||||
return next;
|
||||
});
|
||||
}
|
||||
|
||||
function onSearch(event) {
|
||||
event.preventDefault();
|
||||
const term = query.trim();
|
||||
if (term.length < 2) return;
|
||||
navigate(`/search?q=${encodeURIComponent(term)}`);
|
||||
setQuery("");
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="app-shell">
|
||||
<aside className="desktop-sidebar" aria-label="Hauptnavigation">
|
||||
<div className="desktop-sidebar__brand">
|
||||
<div className="desktop-sidebar__logo" aria-hidden="true" />
|
||||
<div className="desktop-sidebar__title">Tsumugu</div>
|
||||
<div className={`app-shell${compact ? " is-compact" : ""}`}>
|
||||
<aside className="rail" aria-label="Hauptnavigation">
|
||||
<div className="rail__brand">
|
||||
<Mark />
|
||||
<span className="rail__name">Tsumugu</span>
|
||||
</div>
|
||||
<nav className="desktop-sidebar__nav">
|
||||
{items.map((item) => (
|
||||
<NavLink key={item.to} to={item.to} end={item.end} className={({ isActive }) => `desktop-sidebar__link${isActive ? " active" : ""}`}>
|
||||
<button
|
||||
type="button"
|
||||
className="rail__toggle"
|
||||
aria-expanded={!compact}
|
||||
aria-label={compact ? "Navigation ausklappen" : "Navigation einklappen"}
|
||||
onClick={toggleNav}
|
||||
disabled={forcedCompact}
|
||||
title={forcedCompact ? "Bei dieser Breite bleibt die Navigation kompakt" : undefined}
|
||||
>
|
||||
<NavIcon name="menu" />
|
||||
</button>
|
||||
<nav className="rail__nav">
|
||||
{WORK.map((item) => (
|
||||
<NavLink key={item.to} to={item.to} end={item.end} className={({ isActive }) => `rail__link${isActive ? " active" : ""}`} aria-label={item.label}>
|
||||
<NavIcon name={item.icon} />
|
||||
<span>{item.label}</span>
|
||||
<span className="rail__label">{item.label}</span>
|
||||
</NavLink>
|
||||
))}
|
||||
</nav>
|
||||
<div className="desktop-sidebar__footer">
|
||||
<div className="desktop-sidebar__user-text">
|
||||
<span className="desktop-sidebar__user-name">{session.account.display_name}</span>
|
||||
<div className="rail__foot">
|
||||
<form className="rail__search" onSubmit={onSearch}>
|
||||
<label className="visually-hidden" htmlFor="rail-search">Suchen</label>
|
||||
<input id="rail-search" value={query} onChange={(event) => setQuery(event.target.value)} placeholder="Suchen" />
|
||||
</form>
|
||||
{compact ? (
|
||||
<button type="button" className="rail__link rail__button" aria-label="Suchen" onClick={() => { if (forcedCompact) navigate("/search"); else toggleNav(); }}>
|
||||
<NavIcon name="search" />
|
||||
</button>
|
||||
) : null}
|
||||
<NavLink to="/settings" className={({ isActive }) => `rail__link${isActive ? " active" : ""}`} aria-label="Verwaltung">
|
||||
<NavIcon name="gear" />
|
||||
<span className="rail__label">Verwaltung</span>
|
||||
</NavLink>
|
||||
<div className="rail__user">
|
||||
<span className="avatar" title={session.account.display_name}>{initials(session.account.display_name)}</span>
|
||||
<span className="rail__user-name">{session.account.display_name}</span>
|
||||
<button type="button" className="icon-button rail__logout" aria-label="Abmelden" onClick={logout}>
|
||||
<NavIcon name="logout" />
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" className="desktop-sidebar__logout" onClick={logout} title="Abmelden">
|
||||
<NavIcon name="logout" />
|
||||
</button>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div className="app-shell__column">
|
||||
<header className="app-header">
|
||||
<div className="app-header__bar mobile-only">
|
||||
<NavLink to="/" className="app-logo">Tsumugu</NavLink>
|
||||
<button type="button" className="quiet" onClick={logout}>Abmelden</button>
|
||||
</div>
|
||||
<header className="app-header mobile-only">
|
||||
<NavLink to="/" className="app-logo" aria-label="Tsumugu">
|
||||
<Mark size={28} />
|
||||
<span>Tsumugu</span>
|
||||
</NavLink>
|
||||
<form className="search" onSubmit={onSearch}>
|
||||
<input
|
||||
value={query}
|
||||
onChange={(event) => setQuery(event.target.value)}
|
||||
placeholder="Suchen"
|
||||
aria-label="Suchen"
|
||||
/>
|
||||
<button type="submit">Suchen</button>
|
||||
<input value={query} onChange={(event) => setQuery(event.target.value)} placeholder="Suchen" aria-label="Suchen" />
|
||||
</form>
|
||||
</header>
|
||||
<div className="app-main">
|
||||
<Outlet />
|
||||
</div>
|
||||
<nav className="bottom-nav" aria-label="Hauptnavigation">
|
||||
{[...WORK, ADMIN[0]].map((item) => (
|
||||
{WORK.map((item) => (
|
||||
<NavLink key={item.to} to={item.to} end={item.end} className={({ isActive }) => `nav-item${isActive ? " active" : ""}`}>
|
||||
<NavIcon name={item.icon} />
|
||||
<span>{item.label}</span>
|
||||
<span>{item.short}</span>
|
||||
</NavLink>
|
||||
))}
|
||||
<button type="button" className={`nav-item${more ? " active" : ""}`} onClick={() => setMore(true)}>
|
||||
<NavIcon name="more" />
|
||||
<span>Mehr</span>
|
||||
</button>
|
||||
</nav>
|
||||
{more ? (
|
||||
<div className="modal-overlay" onClick={(event) => { if (event.target === event.currentTarget) setMore(false); }}>
|
||||
<div className="sheet" role="dialog" aria-modal="true" aria-label="Weitere Ziele">
|
||||
<header className="modal__bar">
|
||||
<h2>Mehr</h2>
|
||||
<button type="button" className="quiet" onClick={() => setMore(false)}>Schließen</button>
|
||||
</header>
|
||||
<div className="menu-list">
|
||||
<NavLink to="/settings" onClick={() => setMore(false)}>Verwaltung</NavLink>
|
||||
<NavLink to="/search" onClick={() => setMore(false)}>Suche</NavLink>
|
||||
<button type="button" className="quiet" onClick={logout}>Abmelden</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function NavIcon({ name }) {
|
||||
const common = { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true };
|
||||
if (name === "home") {
|
||||
return <svg {...common}><path d="M4 10.5 12 4l8 6.5V20a1 1 0 0 1-1 1h-5v-6H10v6H5a1 1 0 0 1-1-1z" /></svg>;
|
||||
}
|
||||
if (name === "folder") {
|
||||
return <svg {...common}><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" /></svg>;
|
||||
}
|
||||
if (name === "layers") {
|
||||
return <svg {...common}><path d="m12 3 9 5-9 5-9-5z" /><path d="m3 12 9 5 9-5" /><path d="m3 17 9 5 9-5" /></svg>;
|
||||
}
|
||||
if (name === "sources") {
|
||||
return <svg {...common}><path d="M4 7h16" /><path d="M4 12h10" /><path d="M4 17h16" /><path d="M18 10v4" /></svg>;
|
||||
}
|
||||
if (name === "users") {
|
||||
return <svg {...common}><circle cx="12" cy="8" r="3" /><path d="M5 19c1.2-2.4 3.4-3.5 7-3.5s5.8 1.1 7 3.5" /></svg>;
|
||||
}
|
||||
if (name === "check") {
|
||||
return <svg {...common}><path d="M8 12h8" /><path d="M8 7h8" /><path d="M8 17h5" /><path d="M4 7.5 5.2 9 8 6" /></svg>;
|
||||
}
|
||||
if (name === "logout") {
|
||||
return <svg {...common}><path d="M9 6H5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h4" /><path d="M14 16l4-4-4-4" /><path d="M18 12H9" /></svg>;
|
||||
}
|
||||
return <svg {...common}><path d="M4 8h16M4 12h16M4 16h10" /></svg>;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import workerSrc from "pdfjs-dist/build/pdf.worker.min.mjs?url";
|
||||
import { api, fetchFile, fetchPaperless } from "../api.js";
|
||||
import { Modal } from "./Modal.jsx";
|
||||
import { ErrorNote } from "./widgets.jsx";
|
||||
@@ -180,7 +181,7 @@ export function Placements({ items }) {
|
||||
{items.map((item, index) => (
|
||||
<span key={item.case_id}>
|
||||
{index ? <span aria-hidden="true"> · </span> : null}
|
||||
<Link to={item.href} aria-current={item.current ? "true" : undefined}>{item.label.replaceAll("Unterakte ", "").replaceAll("Akte ", "")}</Link>
|
||||
<Link to={item.href} aria-current={item.current ? "true" : undefined}>{item.label.replaceAll("Unterakte ", "").replaceAll("Akte ", "").replaceAll(" → ", " / ")}</Link>
|
||||
</span>
|
||||
))}
|
||||
{current ? <span className="muted"> · aktueller Handlungskontext</span> : <span className="muted"> · Handlungskontext direkt, solange keine Akte gewählt ist</span>}
|
||||
@@ -196,7 +197,7 @@ export function ObjectMenu({ view, onView, children }) {
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<button type="button" className="quiet" onClick={() => setOpen(true)}>Aktionen</button>
|
||||
<button type="button" className="icon-button" aria-label="Aktionen" onClick={() => setOpen(true)}>⋯</button>
|
||||
<Modal open={open} title="Aktionen" onClose={() => setOpen(false)}>
|
||||
<div className="menu-list" onClick={() => setOpen(false)}>
|
||||
<button type="button" className={view === "course" ? "" : "quiet"} onClick={() => choose("course")}>Fachlicher Verlauf</button>
|
||||
@@ -211,7 +212,7 @@ export function ObjectMenu({ view, onView, children }) {
|
||||
|
||||
export function WorkSwitch({ view, onView }) {
|
||||
return (
|
||||
<div className="order-bar" role="tablist" aria-label="Arbeitsfläche">
|
||||
<div className="surface-tabs" role="tablist" aria-label="Arbeitsfläche">
|
||||
<button type="button" role="tab" aria-selected={view === "contents"} className={view === "contents" ? "" : "quiet"} onClick={() => onView("contents")}>Inhalte</button>
|
||||
<button type="button" role="tab" aria-selected={view === "work"} className={view === "work" ? "" : "quiet"} onClick={() => onView("work")}>Aufgaben und Fristen</button>
|
||||
{view !== "contents" && view !== "work" ? (
|
||||
@@ -234,6 +235,39 @@ function blurb(element) {
|
||||
return element.summary || element.excerpt || "";
|
||||
}
|
||||
|
||||
function PdfThumb({ url, title }) {
|
||||
const canvasRef = useRef(null);
|
||||
const [failed, setFailed] = useState(false);
|
||||
useEffect(() => {
|
||||
let alive = true;
|
||||
let doc;
|
||||
(async () => {
|
||||
try {
|
||||
const pdfjs = await import("pdfjs-dist");
|
||||
pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;
|
||||
const bytes = await fetch(url).then((response) => response.arrayBuffer());
|
||||
doc = await pdfjs.getDocument({ data: bytes }).promise;
|
||||
const pdfPage = await doc.getPage(1);
|
||||
if (!alive || !canvasRef.current) return;
|
||||
const base = pdfPage.getViewport({ scale: 1 });
|
||||
const viewport = pdfPage.getViewport({ scale: 148 / base.width });
|
||||
const canvas = canvasRef.current;
|
||||
canvas.width = viewport.width;
|
||||
canvas.height = viewport.height;
|
||||
await pdfPage.render({ canvasContext: canvas.getContext("2d"), viewport }).promise;
|
||||
} catch {
|
||||
if (alive) setFailed(true);
|
||||
}
|
||||
})();
|
||||
return () => {
|
||||
alive = false;
|
||||
doc?.destroy?.();
|
||||
};
|
||||
}, [url]);
|
||||
if (failed) return <span className="thumb thumb--empty">Vorschau nicht verfügbar</span>;
|
||||
return <canvas ref={canvasRef} className="thumb thumb--pdf" aria-label={`Vorschau ${title}`} />;
|
||||
}
|
||||
|
||||
function Thumb({ element, context }) {
|
||||
const [url, setUrl] = useState("");
|
||||
const [media, setMedia] = useState("");
|
||||
@@ -260,12 +294,30 @@ function Thumb({ element, context }) {
|
||||
}, [element.id, element.preview?.available, element.preview?.source, context?.kind, context?.id]);
|
||||
if (element.kind === "note") return <span className="thumb thumb--note">Notiz</span>;
|
||||
if (url && media === "image") return <img className="thumb" alt="" src={url} />;
|
||||
if (url && media === "pdf") return <iframe className="thumb thumb--pdf" title={`Vorschau ${element.title}`} src={url} />;
|
||||
if (url && media === "pdf") return <PdfThumb url={url} title={element.title} />;
|
||||
if (failed) return <span className="thumb thumb--empty">Vorschau nicht verfügbar</span>;
|
||||
if (element.preview?.available) return <span className="thumb thumb--empty">Vorschau wird geladen</span>;
|
||||
return <span className="thumb thumb--empty">Keine Vorschau</span>;
|
||||
}
|
||||
|
||||
export async function saveChapterOrder({ containerKind, containerId, record, context, ids }) {
|
||||
const orderPath = `/api/v1/${containerKind === "case" ? "cases" : "matters"}/${containerId}`;
|
||||
const orderContext = context && containerKind === "matter" ? { context } : {};
|
||||
let version = record.version;
|
||||
const direction = record?.content_order_dir === "desc" ? "desc" : "asc";
|
||||
if (record?.content_order !== "position") {
|
||||
const switched = await api(`${orderPath}/content-order`, {
|
||||
method: "PATCH",
|
||||
body: { expected_version: version, mode: "position", direction, ...orderContext },
|
||||
});
|
||||
version = switched.version;
|
||||
}
|
||||
await api(`${orderPath}/chapters/order`, {
|
||||
method: "POST",
|
||||
body: { expected_version: version, chapter_ids: ids, ...orderContext },
|
||||
});
|
||||
}
|
||||
|
||||
export function ContentBoard({
|
||||
record,
|
||||
bindings,
|
||||
@@ -276,6 +328,9 @@ export function ContentBoard({
|
||||
onChange,
|
||||
itemHref,
|
||||
onlyChapter = "",
|
||||
selectedId = "",
|
||||
onOpen,
|
||||
listTitle = "",
|
||||
}) {
|
||||
const source = bindings || record?.bindings || [];
|
||||
const chapters = record?.chapters || [];
|
||||
@@ -288,7 +343,8 @@ export function ContentBoard({
|
||||
const custom = record?.content_order === "position";
|
||||
const direction = record?.content_order_dir === "desc" ? "desc" : "asc";
|
||||
const sections = sectionsOf(chapters, source);
|
||||
const visibleSections = onlyChapter ? sections.filter((section) => section.id !== "loose") : sections;
|
||||
const visibleSections = onlyChapter ? sections.filter((section) => section.id === onlyChapter) : sections;
|
||||
const shownCount = onlyChapter ? (visibleSections[0]?.items.length || 0) : source.length;
|
||||
const canSort = sortable && record?.rights?.edit;
|
||||
const canMoveChapters = Boolean(canSort && chapters.length > 1);
|
||||
const orderPath = `/api/v1/${containerKind === "case" ? "cases" : "matters"}/${containerId}`;
|
||||
@@ -605,17 +661,23 @@ export function ContentBoard({
|
||||
|
||||
return (
|
||||
<div className="contents" ref={rootRef}>
|
||||
{canSort ? (
|
||||
<OrderChoice
|
||||
mode={custom ? "position" : "date"}
|
||||
direction={direction}
|
||||
disabled={pending}
|
||||
allowPosition
|
||||
onChange={saveMode}
|
||||
/>
|
||||
) : sortable ? (
|
||||
<p className="muted">{custom ? "Eigene Reihenfolge" : `Fachliches Datum, ${direction === "desc" ? "absteigend" : "aufsteigend"}`}</p>
|
||||
) : null}
|
||||
<div className="content-toolbar">
|
||||
<div>
|
||||
<h2>{onlyChapter ? (visibleSections[0]?.title || listTitle || "Kapitel") : (listTitle || "Inhalte")}</h2>
|
||||
<p className="muted">{shownCount} {shownCount === 1 ? "Eintrag" : "Einträge"}</p>
|
||||
</div>
|
||||
{canSort ? (
|
||||
<OrderChoice
|
||||
mode={custom ? "position" : "date"}
|
||||
direction={direction}
|
||||
disabled={pending}
|
||||
allowPosition
|
||||
onChange={saveMode}
|
||||
/>
|
||||
) : sortable ? (
|
||||
<p className="muted">{custom ? "Eigene Reihenfolge" : `Fachliches Datum, ${direction === "desc" ? "absteigend" : "aufsteigend"}`}</p>
|
||||
) : null}
|
||||
</div>
|
||||
{pending ? <p className="muted">Ordnung wird gespeichert …</p> : null}
|
||||
<ErrorNote error={error} />
|
||||
{source.length || chapters.length ? (
|
||||
@@ -637,7 +699,7 @@ export function ContentBoard({
|
||||
data-chapter={section.id === "loose" ? undefined : section.id}
|
||||
>
|
||||
{insertBefore ? <div className="insert-line" aria-hidden="true" /> : null}
|
||||
{section.title ? (
|
||||
{section.title && !onlyChapter ? (
|
||||
<div
|
||||
className={movable ? "chapter-head is-movable" : "chapter-head"}
|
||||
draggable={movable && !pending}
|
||||
@@ -692,7 +754,7 @@ export function ContentBoard({
|
||||
const href = itemHref(binding);
|
||||
const text = blurb(element);
|
||||
return (
|
||||
<li key={binding.id} data-binding={binding.id} className={draggingId === binding.id ? "preview-row is-dragging" : "preview-row"}>
|
||||
<li key={binding.id} data-binding={binding.id} className={`preview-row${draggingId === binding.id ? " is-dragging" : ""}${selectedId === binding.id ? " is-selected" : ""}`}>
|
||||
{indicator?.sectionId === section.id && indicator?.kind !== "chapter" && indicator.index === index ? <div className="insert-line" /> : null}
|
||||
{canSort && custom ? (
|
||||
<button
|
||||
@@ -714,11 +776,23 @@ export function ContentBoard({
|
||||
</button>
|
||||
) : null}
|
||||
<Thumb element={element} context={context} />
|
||||
<Link className="preview-row__main" to={href}>
|
||||
<Link
|
||||
className="preview-row__main"
|
||||
to={href}
|
||||
aria-current={selectedId === binding.id ? "true" : undefined}
|
||||
onClick={(event) => {
|
||||
if (!onOpen || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button !== 0) return;
|
||||
event.preventDefault();
|
||||
onOpen(binding);
|
||||
}}
|
||||
>
|
||||
<strong>{element.title}</strong>
|
||||
<span className="preview-row__meta">{formatDate(fachDate(element))} · {sourceLabel(element)}</span>
|
||||
{text ? <span className="preview-row__text">{text}</span> : null}
|
||||
{binding.origin ? <span className="preview-row__origin">{binding.origin}{binding.shared ? " · weitere Einbindung" : ""}</span> : null}
|
||||
{!onlyChapter && !binding.origin && binding.chapter_id ? (
|
||||
<span className="preview-row__origin">Kapitel {(chapters.find((chapter) => chapter.id === binding.chapter_id)?.title) || ""}</span>
|
||||
) : null}
|
||||
</Link>
|
||||
{(canSort && custom) || (canSort && chapters.length) ? (
|
||||
<div className="preview-row__actions">
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
const common = {
|
||||
width: 22,
|
||||
height: 22,
|
||||
viewBox: "0 0 24 24",
|
||||
fill: "none",
|
||||
stroke: "currentColor",
|
||||
strokeWidth: 1.8,
|
||||
strokeLinecap: "round",
|
||||
strokeLinejoin: "round",
|
||||
"aria-hidden": true,
|
||||
};
|
||||
|
||||
export function NavIcon({ name }) {
|
||||
if (name === "home") return <svg {...common}><path d="M4 10.5 12 4l8 6.5V20a1 1 0 0 1-1 1h-5v-6H10v6H5a1 1 0 0 1-1-1z" /></svg>;
|
||||
if (name === "folder") return <svg {...common}><path d="M3 7.5A2 2 0 0 1 5 5.5h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" /></svg>;
|
||||
if (name === "layers") return <svg {...common}><path d="m12 3 9 5-9 5-9-5z" /><path d="m3 12 9 5 9-5" /></svg>;
|
||||
if (name === "check") return <svg {...common}><rect x="4" y="4" width="16" height="16" rx="2" /><path d="m8 12 2.5 2.5L16 9" /></svg>;
|
||||
if (name === "gear") return <svg {...common}><circle cx="12" cy="12" r="3" /><path d="M12 3.5v2.2M12 18.3v2.2M3.5 12h2.2M18.3 12h2.2M6 6l1.6 1.6M16.4 16.4 18 18M18 6l-1.6 1.6M7.6 16.4 6 18" /></svg>;
|
||||
if (name === "search") return <svg {...common}><circle cx="11" cy="11" r="6" /><path d="m16 16 4 4" /></svg>;
|
||||
if (name === "more") return <svg {...common}><circle cx="6" cy="12" r="1.2" fill="currentColor" /><circle cx="12" cy="12" r="1.2" fill="currentColor" /><circle cx="18" cy="12" r="1.2" fill="currentColor" /></svg>;
|
||||
if (name === "logout") return <svg {...common}><path d="M9 6H5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h4" /><path d="M14 16l4-4-4-4" /><path d="M18 12H9" /></svg>;
|
||||
if (name === "menu") return <svg {...common}><path d="M4 7h16M4 12h16M4 17h16" /></svg>;
|
||||
if (name === "close") return <svg {...common}><path d="M6 6l12 12M18 6 6 18" /></svg>;
|
||||
if (name === "plus") return <svg {...common}><path d="M12 5v14M5 12h14" /></svg>;
|
||||
if (name === "link") return <svg {...common}><path d="M10 13a5 5 0 0 0 7.1.1l1.4-1.5a5 5 0 0 0-7.1-7.1L10 6" /><path d="M14 11a5 5 0 0 0-7.1-.1L5.5 12.4a5 5 0 0 0 7.1 7.1L14 18" /></svg>;
|
||||
return <svg {...common}><circle cx="12" cy="12" r="8" /></svg>;
|
||||
}
|
||||
|
||||
import { ENSO_PATH } from "../enso-path.js";
|
||||
|
||||
export function Mark({ size = 36 }) {
|
||||
return (
|
||||
<svg className="mark" width={size} height={size} viewBox="0 0 64 64" aria-hidden="true">
|
||||
<path fill="currentColor" d={ENSO_PATH} />
|
||||
<path fill="currentColor" opacity="0.72" d="M37.2 25.2h11.2v13.2h-1.8V27.4H38.6z" />
|
||||
<path fill="currentColor" d="M22.8 29.2h8.8l1.7 2.2h10.2V44H22.8z" />
|
||||
<path fill="currentColor" opacity="0.45" d="M26.2 34.2h6.4v1.3h-6.4zm0 2.8h4.5v1.3h-4.5z" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { NavIcon } from "./icons.jsx";
|
||||
|
||||
export function useWorkspaceLayout() {
|
||||
const [width, setWidth] = useState(() => (typeof window === "undefined" ? 1280 : window.innerWidth));
|
||||
const [structureOpen, setStructureOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const onResize = () => setWidth(window.innerWidth);
|
||||
window.addEventListener("resize", onResize);
|
||||
return () => window.removeEventListener("resize", onResize);
|
||||
}, []);
|
||||
|
||||
return { width, structureOpen, setStructureOpen };
|
||||
}
|
||||
|
||||
export function Workspace({ width, structureOpen, setStructureOpen, hasEntry, nav, reader, listRef, children }) {
|
||||
const phone = width < 760;
|
||||
const navColumn = width >= 1500;
|
||||
const split = width >= 1180 && hasEntry;
|
||||
const showNav = phone ? structureOpen && !hasEntry : navColumn || structureOpen;
|
||||
const showList = phone ? !structureOpen && !hasEntry : !(hasEntry && width < 1180);
|
||||
const showReader = hasEntry && (phone ? !structureOpen : true);
|
||||
const overlay = showNav && !phone && !navColumn;
|
||||
|
||||
useEffect(() => {
|
||||
document.body.classList.toggle("is-phone-reading", phone && hasEntry && !structureOpen);
|
||||
return () => document.body.classList.remove("is-phone-reading");
|
||||
}, [phone, hasEntry, structureOpen]);
|
||||
|
||||
const classes = ["workspace"];
|
||||
if (phone && structureOpen && !hasEntry) classes.push("is-structure");
|
||||
else if (!showNav || overlay) classes.push("is-nav-hidden");
|
||||
if (split && showList && showReader) classes.push("is-split");
|
||||
if (!showList && showReader) classes.push("is-reader-focus");
|
||||
|
||||
return (
|
||||
<div className={classes.join(" ")}>
|
||||
{showNav ? <div className={overlay ? "workspace-nav is-overlay" : "workspace-nav"}>{nav}</div> : null}
|
||||
{overlay ? (
|
||||
<button type="button" className="workspace-scrim" aria-label="Struktur schließen" onClick={() => setStructureOpen(false)} />
|
||||
) : null}
|
||||
{showList ? (
|
||||
<div className="workspace-main" ref={listRef}>
|
||||
{children}
|
||||
</div>
|
||||
) : null}
|
||||
{showReader ? <div className="workspace-reader">{reader}</div> : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function TreeNodes({ nodes, onNavigate }) {
|
||||
if (!nodes?.length) return null;
|
||||
return (
|
||||
<ul className="nav-tree">
|
||||
{nodes.map((node) => (
|
||||
<li key={node.id}>
|
||||
{node.href ? (
|
||||
<Link
|
||||
className={node.current ? "nav-tree__link is-current" : "nav-tree__link"}
|
||||
to={node.href}
|
||||
aria-current={node.current ? "page" : undefined}
|
||||
title={node.title}
|
||||
onClick={onNavigate}
|
||||
>
|
||||
<NavIcon name={node.kind === "Querverweis" ? "link" : node.kind === "Akte" || node.kind === "Unterakte" ? "folder" : "layers"} />
|
||||
<span>
|
||||
<span className="nav-tree__kind">{node.kind}</span>
|
||||
<span className="nav-tree__title">{node.title}</span>
|
||||
</span>
|
||||
</Link>
|
||||
) : (
|
||||
<span className="nav-tree__link is-current">
|
||||
<NavIcon name="layers" />
|
||||
<span>
|
||||
<span className="nav-tree__kind">{node.kind}</span>
|
||||
<span className="nav-tree__title">{node.title}</span>
|
||||
</span>
|
||||
</span>
|
||||
)}
|
||||
{node.children?.length ? <TreeNodes nodes={node.children} onNavigate={onNavigate} /> : null}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
export function StructureNavigator({
|
||||
contexts = [],
|
||||
contextValue = "",
|
||||
onContext,
|
||||
nodes = [],
|
||||
chapters = [],
|
||||
chapterId = "",
|
||||
allCount = 0,
|
||||
overview = null,
|
||||
chapterHeading,
|
||||
onChapter,
|
||||
onAddChapter,
|
||||
canAddChapter = false,
|
||||
onMoveChapter,
|
||||
canReorder = false,
|
||||
links = [],
|
||||
onNavigate,
|
||||
onClose,
|
||||
}) {
|
||||
return (
|
||||
<nav className="structure" aria-label="Struktur">
|
||||
<div className="structure__bar">
|
||||
<h2>Struktur</h2>
|
||||
{onClose ? (
|
||||
<button type="button" className="icon-button" aria-label="Struktur schließen" onClick={onClose}>
|
||||
<NavIcon name="close" />
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
<label className="context-select">
|
||||
Aktenkontext
|
||||
<select
|
||||
aria-label="Aktenkontext"
|
||||
value={contextValue}
|
||||
onChange={(event) => onContext?.(event.target.value)}
|
||||
disabled={!onContext || contexts.length < 2}
|
||||
>
|
||||
{contexts.length ? contexts.map((item) => (
|
||||
<option key={item.id} value={item.id}>{item.label}</option>
|
||||
)) : <option value="">Ohne Akte</option>}
|
||||
</select>
|
||||
</label>
|
||||
<TreeNodes nodes={nodes} onNavigate={onNavigate} />
|
||||
<div className="structure__chapters">
|
||||
<h3>{chapterHeading}</h3>
|
||||
{overview ? (
|
||||
<button type="button" className={overview.active ? "chapter-link is-current" : "chapter-link"} onClick={overview.onSelect}>
|
||||
<span>Überblick</span>
|
||||
<span className="count">{overview.count}</span>
|
||||
</button>
|
||||
) : null}
|
||||
<button type="button" className={!chapterId && !overview?.active ? "chapter-link is-current" : "chapter-link"} onClick={() => onChapter("")}>
|
||||
<span>Alle Inhalte</span>
|
||||
<span className="count">{allCount}</span>
|
||||
</button>
|
||||
<ul className="chapter-links">
|
||||
{chapters.map((chapter, index) => (
|
||||
<li key={chapter.id}>
|
||||
<button
|
||||
type="button"
|
||||
className={chapterId === chapter.id ? "chapter-link is-current" : "chapter-link"}
|
||||
onClick={() => onChapter(chapter.id)}
|
||||
>
|
||||
<span>{chapter.title}</span>
|
||||
<span className="count">{chapter.count}</span>
|
||||
</button>
|
||||
{canReorder && chapterId === chapter.id ? (
|
||||
<span className="chapter-link__move">
|
||||
<button type="button" aria-label={`${chapter.title} nach oben`} disabled={index === 0} onClick={() => onMoveChapter(chapter.id, -1)}>Nach oben</button>
|
||||
<button type="button" aria-label={`${chapter.title} nach unten`} disabled={index === chapters.length - 1} onClick={() => onMoveChapter(chapter.id, 1)}>Nach unten</button>
|
||||
</span>
|
||||
) : null}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{canAddChapter ? (
|
||||
<button type="button" className="quiet chapter-add" onClick={onAddChapter}>
|
||||
<NavIcon name="plus" /> Kapitel
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
{links.length ? (
|
||||
<div className="structure__links">
|
||||
<h3>Weitere Zuordnungen</h3>
|
||||
<ul className="nav-tree">
|
||||
{links.map((item) => (
|
||||
<li key={item.id}>
|
||||
<Link className="nav-tree__link" to={item.href} onClick={onNavigate}>
|
||||
<NavIcon name="link" />
|
||||
<span>
|
||||
<span className="nav-tree__kind">{item.kind}</span>
|
||||
<span className="nav-tree__title">{item.title}</span>
|
||||
</span>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
) : null}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
export function rememberScroll(node, key) {
|
||||
if (node && key) sessionStorage.setItem(key, String(node.scrollTop));
|
||||
}
|
||||
|
||||
export function restoreScroll(node, key) {
|
||||
if (!node || !key) return;
|
||||
const saved = sessionStorage.getItem(key);
|
||||
if (saved) node.scrollTop = Number(saved);
|
||||
}
|
||||
@@ -1,21 +1,25 @@
|
||||
:root {
|
||||
--bg: #f4f3ef;
|
||||
--surface: #ffffff;
|
||||
--surface2: #f9f8f5;
|
||||
--border: rgba(0, 0, 0, 0.09);
|
||||
--border2: rgba(0, 0, 0, 0.16);
|
||||
--bg: #f3f1ea;
|
||||
--surface: #fffcf7;
|
||||
--surface2: #f7f4ec;
|
||||
--border: rgba(28, 27, 24, 0.08);
|
||||
--border2: rgba(28, 27, 24, 0.16);
|
||||
--text1: #1c1b18;
|
||||
--text2: #5a5955;
|
||||
--text3: #9a9892;
|
||||
--text2: #5c574e;
|
||||
--text3: #6f6a62;
|
||||
--brand: #085041;
|
||||
--accent: #1d9e75;
|
||||
--accent-light: #e1f5ee;
|
||||
--accent-dark: #0a5c43;
|
||||
--danger: #d85a30;
|
||||
--warn: #ef9f27;
|
||||
--nav-h: 56px;
|
||||
--nav-pad-top: 8px;
|
||||
--header-h: 52px;
|
||||
--font: system-ui, -apple-system, "Segoe UI", sans-serif;
|
||||
--accent-2: #5dcaa5;
|
||||
--accent-3: #9fe1cb;
|
||||
--accent-light: #e7f6ef;
|
||||
--accent-dark: #085041;
|
||||
--danger: #b42318;
|
||||
--warn: #8a5a12;
|
||||
--nav-h: 58px;
|
||||
--nav-pad-top: 6px;
|
||||
--header-h: 56px;
|
||||
--font: "Segoe UI", system-ui, -apple-system, sans-serif;
|
||||
--shadow: 0 10px 30px rgba(28, 27, 24, 0.08);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
@@ -145,14 +149,17 @@ label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(-
|
||||
background: var(--bg);
|
||||
}
|
||||
.login-card { width: min(28rem, 100%); display: grid; gap: 16px; }
|
||||
.login-card h1 { color: var(--accent); letter-spacing: -0.02em; font-size: 28px; margin: 0; }
|
||||
.login-card h1 { color: var(--brand); letter-spacing: -0.02em; font-size: 28px; margin: 0; }
|
||||
.login-mark { color: var(--brand); display: grid; justify-content: center; }
|
||||
|
||||
.app-shell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-direction: row;
|
||||
height: 100%;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
background: var(--bg);
|
||||
}
|
||||
.app-shell__column {
|
||||
display: flex;
|
||||
@@ -485,20 +492,11 @@ label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(-
|
||||
.work-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.app-shell { display: block; max-width: none; margin: 0; width: 100%; min-height: 100%; }
|
||||
.desktop-sidebar { display: flex; }
|
||||
.app-shell__column { margin-left: 220px; min-height: 100vh; }
|
||||
@media (min-width: 760px) {
|
||||
.mobile-only { display: none !important; }
|
||||
.bottom-nav { display: none !important; }
|
||||
.app-header { grid-template-columns: 1fr; }
|
||||
.app-main {
|
||||
padding: 24px 32px 32px;
|
||||
max-width: 1280px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 100%;
|
||||
}
|
||||
.app-main { padding: 0; }
|
||||
.page { padding: 28px 32px 40px; }
|
||||
.split { grid-template-columns: 1fr 1fr; }
|
||||
.forms { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
|
||||
}
|
||||
@@ -595,7 +593,10 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
|
||||
color: var(--text2);
|
||||
border: 1px solid var(--border2);
|
||||
}
|
||||
.row-menu, .menu-list { display: grid; gap: 8px; }
|
||||
.row-menu { display: block; }
|
||||
.row-menu[open] { display: grid; gap: 8px; }
|
||||
.row-menu:not([open]) > :not(summary) { display: none; }
|
||||
.menu-list { display: grid; gap: 8px; }
|
||||
.menu-list button { width: 100%; justify-content: flex-start; }
|
||||
.placements { margin: 4px 0 0; overflow-wrap: anywhere; }
|
||||
.reader-preview { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); }
|
||||
@@ -648,6 +649,301 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
button.danger { background: rgba(216, 90, 48, 0.16); }
|
||||
.notice { color: var(--accent-dark); }
|
||||
.notice { color: var(--accent-2); }
|
||||
.thumb { background: #1c1c1c; }
|
||||
.preview-row.is-selected { background: #14382c; }
|
||||
.reader-pane { background: #1a2420; }
|
||||
}
|
||||
|
||||
.visually-hidden {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.rail {
|
||||
width: 240px;
|
||||
flex: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
background: var(--brand);
|
||||
color: #f4fbf7;
|
||||
padding: 16px 10px 14px;
|
||||
}
|
||||
.app-shell.is-compact .rail { width: 72px; padding-inline: 8px; }
|
||||
.rail__brand { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px 8px; color: #9fe1cb; }
|
||||
.rail__name { font-weight: 700; letter-spacing: -0.03em; font-size: 18px; }
|
||||
.app-shell.is-compact .rail__name,
|
||||
.app-shell.is-compact .rail__label,
|
||||
.app-shell.is-compact .rail__search,
|
||||
.app-shell.is-compact .rail__user-name,
|
||||
.app-shell.is-compact .rail__logout { display: none; }
|
||||
.rail__toggle, .rail__link, .rail__button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
min-height: 44px;
|
||||
margin: 2px 0;
|
||||
padding: 8px 12px;
|
||||
border-radius: 12px;
|
||||
color: #e7f6ef;
|
||||
background: transparent;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
border: 0;
|
||||
}
|
||||
.rail__toggle { color: #9fe1cb; }
|
||||
.rail__toggle:disabled { opacity: 0.45; }
|
||||
.rail__nav { display: flex; flex-direction: column; gap: 2px; }
|
||||
.rail__link.active { background: rgba(159, 225, 203, 0.16); color: #fff; }
|
||||
.app-shell.is-compact .rail__link,
|
||||
.app-shell.is-compact .rail__toggle,
|
||||
.app-shell.is-compact .rail__button {
|
||||
width: 44px;
|
||||
justify-content: center;
|
||||
padding: 8px;
|
||||
margin-inline: auto;
|
||||
}
|
||||
.app-shell.is-compact .rail__link.active { background: var(--accent-3); color: var(--brand); }
|
||||
.rail__foot { margin-top: auto; display: grid; gap: 8px; }
|
||||
.rail__search input {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border-color: transparent;
|
||||
color: #fff;
|
||||
}
|
||||
.rail__search input::placeholder { color: #c9e8db; }
|
||||
.rail__user { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px; }
|
||||
.app-shell.is-compact .rail__user { justify-content: center; }
|
||||
.avatar {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 50%;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
background: var(--accent-3);
|
||||
color: var(--brand);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
flex: none;
|
||||
}
|
||||
.rail__user-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.rail__logout { margin-left: auto; color: #d7efe4; background: transparent; }
|
||||
.mark { display: block; }
|
||||
|
||||
.app-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); text-decoration: none; }
|
||||
.app-main:has(.workspace) {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.workspace {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
|
||||
background: var(--bg);
|
||||
}
|
||||
.workspace.is-nav-hidden { grid-template-columns: minmax(0, 1fr); }
|
||||
.workspace.is-split { grid-template-columns: minmax(220px, 280px) minmax(320px, 0.92fr) minmax(420px, 1.12fr); }
|
||||
.workspace.is-nav-hidden.is-split { grid-template-columns: minmax(320px, 0.9fr) minmax(400px, 1.15fr); }
|
||||
.workspace.is-structure,
|
||||
.workspace.is-reader-focus { grid-template-columns: minmax(0, 1fr); }
|
||||
.workspace-nav, .workspace-main, .workspace-reader { min-width: 0; min-height: 0; overflow: auto; }
|
||||
.workspace-nav { background: #f7f6f1; border-right: 1px solid var(--border); }
|
||||
.workspace-nav.is-overlay {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
inset: 0 auto 0 0;
|
||||
width: min(340px, 88vw);
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
.workspace-scrim { position: absolute; inset: 0; z-index: 5; border: 0; background: rgba(28, 27, 24, 0.28); }
|
||||
.workspace-main { padding: 22px 28px 32px; }
|
||||
.workspace-reader { background: #eef2ee; border-left: 1px solid var(--border); display: flex; min-height: 0; }
|
||||
.workspace-head, .title-row, .page-actions, .content-toolbar, .reader-pane__bar, .reader-controls {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.workspace-head { margin-bottom: 8px; }
|
||||
.title-row { align-items: center; justify-content: flex-start; gap: 10px; }
|
||||
.title-row h1 { margin: 0; }
|
||||
.status-pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 28px;
|
||||
padding: 2px 10px;
|
||||
border-radius: 999px;
|
||||
background: #f3e6c8;
|
||||
color: #6a4b12;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.status-pill.is-closed { background: #eceae4; color: #4d4a45; }
|
||||
.surface-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border); margin: 8px 0 16px; }
|
||||
.surface-tabs button {
|
||||
background: transparent;
|
||||
color: var(--text2);
|
||||
border-radius: 0;
|
||||
min-height: 44px;
|
||||
padding: 8px 0;
|
||||
border-bottom: 2px solid transparent;
|
||||
}
|
||||
.surface-tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--accent); }
|
||||
.structure { display: grid; align-content: start; gap: 14px; padding: 16px 14px 24px; }
|
||||
.structure__bar, .structure h2 { display: flex; align-items: center; justify-content: space-between; margin: 0; font-size: 20px; }
|
||||
.structure h3 { margin: 8px 0 4px; font-size: 13px; color: var(--text2); font-weight: 700; }
|
||||
.context-select select { background: #fff; }
|
||||
.nav-tree, .chapter-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
|
||||
.nav-tree ul { margin: 0; padding: 0 0 0 14px; }
|
||||
.nav-tree__link, .chapter-link {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
min-height: 44px;
|
||||
padding: 8px 10px;
|
||||
border: 0;
|
||||
border-radius: 12px;
|
||||
background: transparent;
|
||||
color: inherit;
|
||||
text-align: left;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
}
|
||||
.nav-tree__link.is-current, .chapter-link.is-current { background: var(--accent-light); color: var(--brand); }
|
||||
.nav-tree__kind { display: block; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text3); font-weight: 700; }
|
||||
.nav-tree__title, .chapter-link span:first-child, .preview-row__main strong, h1 { overflow-wrap: anywhere; }
|
||||
.chapter-link { justify-content: space-between; align-items: center; }
|
||||
.count {
|
||||
min-width: 1.6rem;
|
||||
text-align: center;
|
||||
color: var(--text2);
|
||||
font-size: 13px;
|
||||
font-weight: 650;
|
||||
}
|
||||
.chapter-link__move { display: flex; gap: 6px; padding: 0 8px 8px; }
|
||||
.chapter-link__move button { min-height: 36px; padding: 4px 8px; font-size: 13px; }
|
||||
.chapter-add { justify-content: flex-start; }
|
||||
.content-toolbar { align-items: center; margin-bottom: 12px; }
|
||||
.content-toolbar h2 { font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--text1); }
|
||||
.order-choice { margin: 0; }
|
||||
.preview-list { display: grid; gap: 8px; }
|
||||
.preview-row {
|
||||
border: 1px solid transparent;
|
||||
border-radius: 16px;
|
||||
padding: 12px;
|
||||
background: transparent;
|
||||
}
|
||||
.preview-row.is-selected { background: var(--accent-light); }
|
||||
.preview-row__main strong { font-size: 17px; }
|
||||
.thumb {
|
||||
width: 74px;
|
||||
height: 96px;
|
||||
flex-basis: 74px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 1px 2px rgba(28, 27, 24, 0.08);
|
||||
}
|
||||
.icon-button {
|
||||
width: 44px;
|
||||
min-width: 44px;
|
||||
height: 44px;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: var(--text2);
|
||||
border: 0;
|
||||
}
|
||||
.row-menu summary { min-height: 44px; min-width: 44px; justify-content: center; }
|
||||
.desktop-add svg, .mobile-add svg { width: 18px; height: 18px; }
|
||||
.mobile-add { display: none; }
|
||||
.reader-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; width: 100%; }
|
||||
.reader-pane__bar { padding: 16px 16px 8px; align-items: center; }
|
||||
.reader-pane__heading { flex: 1 1 12rem; min-width: 0; }
|
||||
.reader-pane__heading h2 { font-size: 22px; overflow-wrap: anywhere; }
|
||||
.reader-pane__heading p, .reader-back { color: var(--text2); font-size: 14px; }
|
||||
.reader-back { background: transparent; color: var(--brand); padding-inline: 0; }
|
||||
.reader-pane__tools { display: flex; gap: 4px; }
|
||||
.reader-pane__stage { flex: 1; min-height: 240px; overflow: auto; padding: 8px 16px 16px; }
|
||||
.reader-pane__state, .reader-note {
|
||||
background: var(--surface);
|
||||
border-radius: 16px;
|
||||
padding: 16px;
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
}
|
||||
.reader-canvas, .reader-image, .reader-frame {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
background: #fff;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
.reader-frame { width: 100%; min-height: 70vh; border: 0; }
|
||||
.reader-pane__foot {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px 12px;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
|
||||
background: rgba(255, 252, 247, 0.92);
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
.reader-pages, .reader-zoom { display: flex; align-items: center; gap: 6px; }
|
||||
.reader-annotate { display: grid; gap: 10px; padding: 12px 16px 20px; background: var(--surface); }
|
||||
.sheet {
|
||||
width: min(520px, 100%);
|
||||
margin-top: auto;
|
||||
background: var(--surface);
|
||||
border-radius: 16px 16px 0 0;
|
||||
padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
.menu-list a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 44px;
|
||||
padding: 8px 10px;
|
||||
border-radius: 10px;
|
||||
text-decoration: none;
|
||||
font-weight: 650;
|
||||
background: var(--surface2);
|
||||
}
|
||||
|
||||
@media (max-width: 759px) {
|
||||
.rail { display: none; }
|
||||
.app-shell { flex-direction: column; }
|
||||
.workspace-main, .structure { padding-bottom: 96px; }
|
||||
.mobile-add { display: none; }
|
||||
.page-actions { flex-wrap: wrap; }
|
||||
.desktop-add { width: 100%; justify-content: center; }
|
||||
.modal-overlay { padding: 0; align-items: end; }
|
||||
.modal {
|
||||
width: 100%;
|
||||
max-height: 100%;
|
||||
height: 100%;
|
||||
border-radius: 0;
|
||||
padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
.sheet { height: auto; }
|
||||
body.is-phone-reading .bottom-nav,
|
||||
body.is-phone-reading .app-header { display: none !important; }
|
||||
body.is-phone-reading .workspace-reader { min-height: 100%; }
|
||||
.preview-row__actions { flex-basis: 100%; margin-left: 0; }
|
||||
}
|
||||
|
||||
@media (min-width: 760px) and (max-width: 1179px) {
|
||||
.rail { width: 72px; }
|
||||
.rail__name, .rail__label, .rail__search, .rail__user-name, .rail__logout { display: none; }
|
||||
.rail__link, .rail__toggle, .rail__button { width: 44px; justify-content: center; margin-inline: auto; padding: 8px; }
|
||||
}
|
||||
@@ -6,8 +6,8 @@ export default defineConfig({
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: {
|
||||
"/api": "http://127.0.0.1:8000",
|
||||
"/health": "http://127.0.0.1:8000",
|
||||
"/api": process.env.VITE_API_PROXY || "http://127.0.0.1:8000",
|
||||
"/health": process.env.VITE_API_PROXY || "http://127.0.0.1:8000",
|
||||
},
|
||||
},
|
||||
});
|
||||