diff --git a/backend/app/access/policy.py b/backend/app/access/policy.py index dff0794..096b38e 100644 --- a/backend/app/access/policy.py +++ b/backend/app/access/policy.py @@ -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 diff --git a/backend/app/api/routes.py b/backend/app/api/routes.py index b0f1167..d9bc820 100644 --- a/backend/app/api/routes.py +++ b/backend/app/api/routes.py @@ -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 ], } diff --git a/docs/design/LIEFERUNG_2026-10-17.md b/docs/design/LIEFERUNG_2026-10-17.md new file mode 100644 index 0000000..95a7c5b --- /dev/null +++ b/docs/design/LIEFERUNG_2026-10-17.md @@ -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. diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 984d96e..e5d87f4 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -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 diff --git a/frontend/brand/enso-master.svg b/frontend/brand/enso-master.svg new file mode 100644 index 0000000..9a5949d --- /dev/null +++ b/frontend/brand/enso-master.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/brand/render.mjs b/frontend/brand/render.mjs new file mode 100644 index 0000000..d3873be --- /dev/null +++ b/frontend/brand/render.mjs @@ -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: ` + + + `, + tsumuguSmall: ` + + `, + mitai: ` + + + + + `, + shinkan: ` + + + + + + `, + kairo: ` + + + + + + + + `, + kansho: ` + `, +}; + +function symbolSvg({ glyph, small = false }) { + const ring = small ? ensoSmall : enso; + return ` + + + ${glyph} + +`; +} + +function iconSvg(glyph, { maskable = false } = {}) { + const scale = maskable ? 0.62 : 0.74; + const offset = (64 - 64 * scale) / 2; + return ` + + + + + ${glyph} + + +`; +} + +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"), ` + + + +`); +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 = ` + + + + + ${glyph} + + ${title} + ${subtitle} + +`; + 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"); diff --git a/frontend/index.html b/frontend/index.html index bd38bd2..2c2fa29 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,8 +2,16 @@ - + + + + Tsumugu + + + + +
diff --git a/frontend/package-lock.json b/frontend/package-lock.json index aaf7d35..41f4817 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -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", diff --git a/frontend/package.json b/frontend/package.json index 35a4ccb..25a42d4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -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" } } diff --git a/frontend/public/apple-touch-icon.png b/frontend/public/apple-touch-icon.png new file mode 100644 index 0000000..39e0eab Binary files /dev/null and b/frontend/public/apple-touch-icon.png differ diff --git a/frontend/public/brand/tsumugu-small.svg b/frontend/public/brand/tsumugu-small.svg new file mode 100644 index 0000000..d0d44f3 --- /dev/null +++ b/frontend/public/brand/tsumugu-small.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/frontend/public/brand/tsumugu-symbol-on-dark.svg b/frontend/public/brand/tsumugu-symbol-on-dark.svg new file mode 100644 index 0000000..a4dacaf --- /dev/null +++ b/frontend/public/brand/tsumugu-symbol-on-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/frontend/public/brand/tsumugu-symbol.svg b/frontend/public/brand/tsumugu-symbol.svg new file mode 100644 index 0000000..ec69b05 --- /dev/null +++ b/frontend/public/brand/tsumugu-symbol.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/frontend/public/favicon-16.png b/frontend/public/favicon-16.png new file mode 100644 index 0000000..5b7468a Binary files /dev/null and b/frontend/public/favicon-16.png differ diff --git a/frontend/public/favicon-32.png b/frontend/public/favicon-32.png new file mode 100644 index 0000000..c2e3260 Binary files /dev/null and b/frontend/public/favicon-32.png differ diff --git a/frontend/public/favicon.svg b/frontend/public/favicon.svg new file mode 100644 index 0000000..a0a3dad --- /dev/null +++ b/frontend/public/favicon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/frontend/public/icons/icon-192.png b/frontend/public/icons/icon-192.png new file mode 100644 index 0000000..0fa8b2d Binary files /dev/null and b/frontend/public/icons/icon-192.png differ diff --git a/frontend/public/icons/icon-512.png b/frontend/public/icons/icon-512.png new file mode 100644 index 0000000..66db966 Binary files /dev/null and b/frontend/public/icons/icon-512.png differ diff --git a/frontend/public/icons/icon-maskable-512.png b/frontend/public/icons/icon-maskable-512.png new file mode 100644 index 0000000..f295974 Binary files /dev/null and b/frontend/public/icons/icon-maskable-512.png differ diff --git a/frontend/public/manifest.webmanifest b/frontend/public/manifest.webmanifest new file mode 100644 index 0000000..1482831 --- /dev/null +++ b/frontend/public/manifest.webmanifest @@ -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" } + ] +} diff --git a/frontend/src/enso-path.js b/frontend/src/enso-path.js new file mode 100644 index 0000000..dd89893 --- /dev/null +++ b/frontend/src/enso-path.js @@ -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"; diff --git a/frontend/src/pages/Cases.jsx b/frontend/src/pages/Cases.jsx index 8e14527..94b7d48 100644 --- a/frontend/src/pages/Cases.jsx +++ b/frontend/src/pages/Cases.jsx @@ -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
; if (!record) return

Akte wird geladen …

; - 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 ( -
-
+ <> + { 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 ? ( + + ) : null} + > +
- -

{record.kind_label || "Akte"} · {record.home_scope_name}

-

{record.title}

-

{record.status === "open" ? "Offen" : "Geschlossen"}

+ +
+

{record.title}

+ {record.status === "open" ? "Offen" : "Geschlossen"} +
- {target?.edit ? : null} + {width < 1500 ? : null} + {canEdit ? ( + + ) : null} {record.rights.edit ? : null} {record.rights.edit ? : null} {record.rights.edit ? : null} {record.rights.share || record.is_owner ? : null} - {target && !target.edit ?

In {target.label} fehlt das Bearbeitungsrecht.

: null}
+ {!canEdit ?

In {targetLabel} fehlt das Bearbeitungsrecht.

: null} -
- -
- - {view === "contents" ? ( -

- {target ? ( - <>Bearbeitet wird {target.label}{activeChapter ? <> · Kapitel {activeChapter.title} : null} - ) : ( - "Lesesicht aller Inhalte. Zum Bearbeiten einen Bereich in der Gliederung wählen." - )} -

- ) : null} - {view === "contents" && scope === "all" ? ( -
- setDateDir(next)} /> - binding.readerHref} - /> -
- ) : null} - {view === "contents" && scope === "direct" ? ( - withSelection(`/cases/${id}/items/${binding.id}`, params)} - /> - ) : null} - {view === "contents" && group ? ( - withSelection(`/matters/${group.matter_id}/items/${binding.id}?context_kind=case&context_id=${id}`, params)} - /> - ) : null} - {view === "contents" && scope !== "all" && scope !== "direct" && !group ? ( -

Dieser Bereich hat in der Akte keine eigenen Unterlagen.

- ) : null} - {view === "work" ? : null} - {view === "course" || view === "audit" ? ( - - ) : null} - {view === "links" ? ( -
-

Zuordnungen

-

Unterakten, Vorgänge und Freigaben dieses Objekts.

- {record.rights.edit ? : null} - {record.rights.edit ? : null} - {record.rights.edit ? : null} -
- ) : null} + + {view === "contents" && overview ? ( +
+

Ü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.

+ setDateDir(next)} /> + binding.readerHref} + />
-
+ ) : null} + {view === "contents" && !overview ? ( + { + 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" ? : null} + {view === "course" || view === "audit" ? ( + + ) : null} + {view === "links" ? ( +
+

Zuordnungen

+

Unterakten, Vorgänge und Freigaben dieses Objekts.

+ {record.rights.edit ? : null} + {record.rights.edit ? : null} + {record.rights.edit ? : null} +
+ ) : null} + {canEdit && view === "contents" && !overview ? ( + + ) : null} + setModal("")}> { setModal(""); load(); }} /> setModal("")}> { setModal(""); load(); }} /> - setModal("")}> - + setModal("")}> +
@@ -426,29 +576,29 @@ export function CaseDetail() {
- setModal("")}> - { setModal(""); load(); }} /> + setModal("")}> + { setModal(""); load(); }} /> - setModal("")}> - { setModal(""); load(); }} /> + setModal("")}> + { setModal(""); load(); }} /> - setModal("")}> - { setModal(""); load(); }} /> + setModal("")}> + { setModal(""); load(); }} /> - setModal("")}> - { setModal(""); load(); }} /> + setModal("")}> + { setModal(""); load(); }} /> setModal("")}> { setModal(""); load(); }} /> - setModal("")}> + setModal("")}> { 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() { setModal("")}> -
+ ); } diff --git a/frontend/src/pages/Login.jsx b/frontend/src/pages/Login.jsx index ce3b267..aa71d11 100644 --- a/frontend/src/pages/Login.jsx +++ b/frontend/src/pages/Login.jsx @@ -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 (
+

Jinkendo

Tsumugu

Akten, Vorgänge und Fristen an einem Ort. Die erste Lieferung organisiert und verfolgt.

diff --git a/frontend/src/pages/Matters.jsx b/frontend/src/pages/Matters.jsx index 2f689f6..457cf56 100644 --- a/frontend/src/pages/Matters.jsx +++ b/frontend/src/pages/Matters.jsx @@ -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 ( - - ); +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
; if (!record) return

Vorgang wird geladen …

; - 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 ( -
-
+ <> + 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 ? ( + + ) : null} + > +
- + -

{record.kind_label || "Vorgang"} · {record.home_scope_name}

-

{record.title}

-

{record.status === "open" ? "Offen" : "Geschlossen"}

+
+

{record.title}

+ {record.status === "open" ? "Offen" : "Geschlossen"} +
- {canEdit ? : null} + {width < 1500 ? : null} + {canEdit ? ( + + ) : null} {canEdit ? : null} {canEdit ? : null} {record.rights.share || record.is_owner ? : null} - {!canEdit ?

In {targetLabel} fehlt das Bearbeitungsrecht.

: null}
+ {!canEdit ?

In {targetLabel} fehlt das Bearbeitungsrecht.

: null} -
- -
- - {view === "contents" ? ( - <> -

- Bearbeitet wird {targetLabel} - {activeChapter ? <> · Kapitel {activeChapter.title} : null} -

- { - 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" ? ( -
- {record.rights.edit ? : null} - -
- ) : null} - {view === "course" || view === "audit" ? ( - - ) : null} - {view === "links" ? ( -
-

Zuordnungen

- {record.case_links?.length ? record.case_links.map((item) => ( -

Akte {item.title}

- )) :

Noch keiner Akte zugeordnet.

} - {record.cross_links?.length ? record.cross_links.map((item) => ( -

Querverweis {item.title}

- )) :

Kein Querverweis.

} - {record.rights.edit ? : null} -
- ) : null} + + {view === "contents" ? ( + { + 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" ? ( +
+ {record.rights.edit ? : null} +
-
+ ) : null} + {view === "course" || view === "audit" ? ( + + ) : null} + {view === "links" ? ( +
+

Zuordnungen

+ {record.case_links?.length ? record.case_links.map((item) => ( +

Akte {item.title}

+ )) :

Noch keiner Akte zugeordnet.

} + {record.cross_links?.length ? record.cross_links.map((item) => ( +

Querverweis {item.title}

+ )) :

Kein Querverweis.

} + {record.rights.edit ? : null} +
+ ) : null} + {canEdit && view === "contents" ? ( + + ) : null} + setModal("")}> { setModal(""); load(); }} /> @@ -341,7 +523,7 @@ export function MatterDetail() { setModal("")}> -
+ ); } diff --git a/frontend/src/pages/Modal.jsx b/frontend/src/pages/Modal.jsx index 080e26e..fdc960e 100644 --- a/frontend/src/pages/Modal.jsx +++ b/frontend/src/pages/Modal.jsx @@ -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 (
{ if (event.target === event.currentTarget) requestClose(); }}> -
+

{title}

diff --git a/frontend/src/pages/Reader.jsx b/frontend/src/pages/Reader.jsx index 64213ce..44c374d 100644 --- a/frontend/src/pages/Reader.jsx +++ b/frontend/src/pages/Reader.jsx @@ -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

Zurück

; - } - if (!record?.binding) return

Unterlage wird geladen …

; - - 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 ( -
- (index === all.length - 1 ? { ...item, href: back } : item)), { label: element.title, href: null }]} /> -

{kind === "cases" ? "Zurück zur Akte" : "Zurück zum Vorgang"}

-
-
-

{kindLabel(element.kind)}

-

{element.title}

-

Fachliches Datum: {formatDate(element.dates?.document_on)}

-
-
- - {element.kind === "note" ? ( -
-