Schliesse das Ablegen an der Markierung ab und halte Anlagen und Belege getrennt, damit der Dialog erscheint und zugeordnete Unterlagen im Uebergabepaket nur beim Schreiben stehen.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
be027a1025
commit
9f5327f3be
5 files changed
+457
-234
No files matched your search
@@ -272,6 +272,8 @@ def _matter_node(conn, actor, matter, page: Ctx, root: bool) -> ExportNode:
|
|||||||
children: list[ExportNode] = []
|
children: list[ExportNode] = []
|
||||||
children.extend(_chapter_nodes(conn, actor, page, chapters, grouped))
|
children.extend(_chapter_nodes(conn, actor, page, chapters, grouped))
|
||||||
for binding in grouped.get(None, []):
|
for binding in grouped.get(None, []):
|
||||||
|
if not _stands_in_chapter(binding):
|
||||||
|
continue
|
||||||
children.append(_binding_node(conn, actor, binding, page))
|
children.append(_binding_node(conn, actor, binding, page))
|
||||||
rows = conn.execute(
|
rows = conn.execute(
|
||||||
"SELECT * FROM matters WHERE parent_matter_id = %s AND deleted_at IS NULL ORDER BY title, id",
|
"SELECT * FROM matters WHERE parent_matter_id = %s AND deleted_at IS NULL ORDER BY title, id",
|
||||||
@@ -293,6 +295,16 @@ def _matter_node(conn, actor, matter, page: Ctx, root: bool) -> ExportNode:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _stands_in_chapter(binding: dict) -> bool:
|
||||||
|
"""A folded attachment or receipt stays under its letter, not as another chapter row."""
|
||||||
|
pack = binding.get("correspondence") or {}
|
||||||
|
if pack.get("fold") in {"attachment", "evidence"}:
|
||||||
|
return False
|
||||||
|
if pack.get("hosts"):
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def _chapter_nodes(conn, actor, page, chapters: list[dict], grouped: dict[str | None, list]) -> list[ExportNode]:
|
def _chapter_nodes(conn, actor, page, chapters: list[dict], grouped: dict[str | None, list]) -> list[ExportNode]:
|
||||||
by_parent: dict[str | None, list[dict]] = {}
|
by_parent: dict[str | None, list[dict]] = {}
|
||||||
for chapter in chapters:
|
for chapter in chapters:
|
||||||
@@ -305,6 +317,8 @@ def _chapter_nodes(conn, actor, page, chapters: list[dict], grouped: dict[str |
|
|||||||
nested = build(chapter["id"], chapter_path)
|
nested = build(chapter["id"], chapter_path)
|
||||||
items = []
|
items = []
|
||||||
for item in grouped.get(chapter["id"], []):
|
for item in grouped.get(chapter["id"], []):
|
||||||
|
if not _stands_in_chapter(item):
|
||||||
|
continue
|
||||||
node = _binding_node(conn, actor, item, page)
|
node = _binding_node(conn, actor, item, page)
|
||||||
node.relation = f"Kapitel: {chapter_path}"
|
node.relation = f"Kapitel: {chapter_path}"
|
||||||
items.append(node)
|
items.append(node)
|
||||||
|
|||||||
@@ -311,6 +311,11 @@ def test_dispatch_keeps_the_secured_stand_and_distinct_mail_parts(client, db, mo
|
|||||||
assert uses == 3
|
assert uses == 3
|
||||||
hidden = _detail(ada, matter["id"])
|
hidden = _detail(ada, matter["id"])
|
||||||
assert _binding(hidden, "Gesendete Nachricht")["correspondence"]["fold"] == "evidence"
|
assert _binding(hidden, "Gesendete Nachricht")["correspondence"]["fold"] == "evidence"
|
||||||
|
placed = list(_walk(ada.request("GET", f"/api/v1/matters/{matter['id']}/export-tree")["tree"]))
|
||||||
|
assert not any(node["kind"] == "binding" and node["title"] in {"Rechnung 2023", "Gesendete Nachricht"} for node in placed)
|
||||||
|
assert sum(1 for node in placed if node["kind"] == "attachment" and node["title"] == "Rechnung 2023") == 1
|
||||||
|
assert any(node["kind"] == "dispatch_item" and node["title"] == "Rechnung 2023" for node in placed)
|
||||||
|
assert any(node["kind"] == "evidence" and node["title"] == "Gesendete Nachricht" for node in placed)
|
||||||
ada.request(
|
ada.request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
f"/api/v1/bindings/{_binding(hidden, 'Gesendete Nachricht')['id']}/fold",
|
f"/api/v1/bindings/{_binding(hidden, 'Gesendete Nachricht')['id']}/fold",
|
||||||
|
|||||||
+113
-82
@@ -1099,14 +1099,17 @@ export function ContentBoard({
|
|||||||
const carried = carryRef.current;
|
const carried = carryRef.current;
|
||||||
if (carried) {
|
if (carried) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
if (event.dataTransfer) event.dataTransfer.dropEffect = "move";
|
||||||
const useId = useDropId(event.target);
|
const useId = useDropId(event.target);
|
||||||
if (useId && useId !== carried.bindingId) setIndicator({ kind: "use", bindingId: useId });
|
carried.useBindingId = useId && useId !== carried.bindingId ? useId : "";
|
||||||
|
if (carried.useBindingId) setIndicator({ kind: "use", bindingId: carried.useBindingId });
|
||||||
else setIndicator(null);
|
else setIndicator(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const drag = dragRef.current;
|
const drag = dragRef.current;
|
||||||
if (!drag?.html5) return;
|
if (!drag?.html5 || drag.done) return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
if (event.dataTransfer) event.dataTransfer.dropEffect = "move";
|
||||||
if (drag.kind === "chapter") {
|
if (drag.kind === "chapter") {
|
||||||
drag.useBindingId = null;
|
drag.useBindingId = null;
|
||||||
drag.index = chapterUnder(event.clientY, drag.parentId);
|
drag.index = chapterUnder(event.clientY, drag.parentId);
|
||||||
@@ -1130,17 +1133,20 @@ export function ContentBoard({
|
|||||||
function drop(event) {
|
function drop(event) {
|
||||||
const carried = carryRef.current;
|
const carried = carryRef.current;
|
||||||
if (carried) {
|
if (carried) {
|
||||||
const useId = useDropId(event.target);
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
if (carried.settled) return;
|
||||||
|
carried.settled = true;
|
||||||
|
const useId = useDropId(event.target) || carried.useBindingId || "";
|
||||||
carryRef.current = null;
|
carryRef.current = null;
|
||||||
setIndicator(null);
|
setIndicator(null);
|
||||||
if (useId) placeUseRef.current?.(useId, carried);
|
if (useId && useId !== carried.bindingId) placeUseRef.current?.(useId, carried);
|
||||||
else if (carried.source === "attachment" || carried.source === "evidence") releaseRef.current?.(carried);
|
else if (carried.source === "attachment" || carried.source === "evidence") releaseRef.current?.(carried);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!dragRef.current?.html5) return;
|
const drag = dragRef.current;
|
||||||
|
if (!drag?.html5 || drag.done) return;
|
||||||
place(event);
|
place(event);
|
||||||
finishDragRef.current(dragRef.current);
|
finishDragRef.current(drag);
|
||||||
}
|
}
|
||||||
node.addEventListener("dragover", place);
|
node.addEventListener("dragover", place);
|
||||||
node.addEventListener("drop", drop);
|
node.addEventListener("drop", drop);
|
||||||
@@ -1396,6 +1402,8 @@ export function ContentBoard({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function finishDrag(drag) {
|
function finishDrag(drag) {
|
||||||
|
if (!drag || drag.done) return;
|
||||||
|
drag.done = true;
|
||||||
dragRef.current = null;
|
dragRef.current = null;
|
||||||
setDraggingId("");
|
setDraggingId("");
|
||||||
setIndicator(null);
|
setIndicator(null);
|
||||||
@@ -1491,7 +1499,7 @@ export function ContentBoard({
|
|||||||
window.removeEventListener("pointermove", track);
|
window.removeEventListener("pointermove", track);
|
||||||
window.removeEventListener("pointerup", release);
|
window.removeEventListener("pointerup", release);
|
||||||
window.removeEventListener("pointercancel", cancel);
|
window.removeEventListener("pointercancel", cancel);
|
||||||
if (!drag || drag.html5 || drag.pointerId !== event.pointerId) return;
|
if (!drag || drag.done || drag.pointerId !== event.pointerId) return;
|
||||||
finishDrag(drag);
|
finishDrag(drag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1519,10 +1527,8 @@ export function ContentBoard({
|
|||||||
function endHtml5() {
|
function endHtml5() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const drag = dragRef.current;
|
const drag = dragRef.current;
|
||||||
if (!drag?.html5) return;
|
if (!drag?.html5 || drag.done) return;
|
||||||
dragRef.current = null;
|
finishDrag(drag);
|
||||||
setDraggingId("");
|
|
||||||
setIndicator(null);
|
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1530,9 +1536,32 @@ export function ContentBoard({
|
|||||||
carryRef.current = payload;
|
carryRef.current = payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
function endCarry() {
|
function endCarry(event) {
|
||||||
|
const carried = carryRef.current;
|
||||||
|
if (!carried) {
|
||||||
|
setIndicator(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
carryRef.current = null;
|
carryRef.current = null;
|
||||||
setIndicator(null);
|
setIndicator(null);
|
||||||
|
if (carried.settled) return;
|
||||||
|
carried.settled = true;
|
||||||
|
const x = event?.clientX || 0;
|
||||||
|
const y = event?.clientY || 0;
|
||||||
|
const pointOk = x > 0 || y > 0;
|
||||||
|
const moved = Math.hypot(x - (carried.anchorX || 0), y - (carried.anchorY || 0));
|
||||||
|
if (pointOk && moved < 8 && !carried.useBindingId) return;
|
||||||
|
const hit = pointOk ? document.elementFromPoint(x, y) : null;
|
||||||
|
if (hit && rootRef.current && !rootRef.current.contains(hit)) return;
|
||||||
|
if (!hit && !carried.useBindingId) return;
|
||||||
|
const useId = hit ? useDropId(hit) : (carried.useBindingId || "");
|
||||||
|
if (useId && useId !== carried.bindingId) {
|
||||||
|
placeUseRef.current?.(useId, carried);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!hit || useId) return;
|
||||||
|
if (hit.closest?.(`[data-carry="${carried.source}:${carried.elementId}"]`)) return;
|
||||||
|
if (carried.source === "attachment" || carried.source === "evidence") releaseRef.current?.(carried);
|
||||||
}
|
}
|
||||||
|
|
||||||
function bindingByElement(elementId) {
|
function bindingByElement(elementId) {
|
||||||
@@ -1992,16 +2021,9 @@ export function ContentBoard({
|
|||||||
type="button"
|
type="button"
|
||||||
className="handle"
|
className="handle"
|
||||||
aria-label={`${element.title} ziehen`}
|
aria-label={`${element.title} ziehen`}
|
||||||
draggable={!pending}
|
draggable={false}
|
||||||
disabled={pending}
|
disabled={pending}
|
||||||
onPointerDown={(event) => beginDrag(event, { bindingId: binding.id, sectionId: section.id })}
|
onPointerDown={(event) => beginDrag(event, { bindingId: binding.id, sectionId: section.id })}
|
||||||
onDragStart={(event) => {
|
|
||||||
event.dataTransfer.effectAllowed = "move";
|
|
||||||
event.dataTransfer.setData("text/plain", binding.id);
|
|
||||||
markHtml5({ bindingId: binding.id, sectionId: section.id, targetSectionId: section.id });
|
|
||||||
setDraggingId(binding.id);
|
|
||||||
}}
|
|
||||||
onDragEnd={endHtml5}
|
|
||||||
>
|
>
|
||||||
<span className="handle__grip" aria-hidden="true" />
|
<span className="handle__grip" aria-hidden="true" />
|
||||||
</button>
|
</button>
|
||||||
@@ -2018,6 +2040,8 @@ export function ContentBoard({
|
|||||||
elementId: element.id,
|
elementId: element.id,
|
||||||
bindingId: binding.id,
|
bindingId: binding.id,
|
||||||
title: element.title,
|
title: element.title,
|
||||||
|
anchorX: event.clientX,
|
||||||
|
anchorY: event.clientY,
|
||||||
});
|
});
|
||||||
writeAssign(event, {
|
writeAssign(event, {
|
||||||
source: "list",
|
source: "list",
|
||||||
@@ -2028,68 +2052,75 @@ export function ContentBoard({
|
|||||||
}}
|
}}
|
||||||
onAssignEnd={endCarry}
|
onAssignEnd={endCarry}
|
||||||
/>
|
/>
|
||||||
<div className="preview-row__body">
|
<UnitDetail
|
||||||
<Link
|
binding={binding}
|
||||||
className="preview-row__title"
|
canEdit={canEdit}
|
||||||
to={href}
|
pending={pending}
|
||||||
draggable={false}
|
scope={scopeBody(actionContext(), containerKind, containerId)}
|
||||||
aria-current={selectedId === binding.id ? "true" : undefined}
|
onCarryStart={beginCarry}
|
||||||
onClick={openFromList}
|
onCarryEnd={endCarry}
|
||||||
>
|
onOpen={(elementId) => {
|
||||||
<strong>{element.title}</strong>
|
const found = source.find((item) => item.element?.id === elementId);
|
||||||
</Link>
|
if (found) onOpen?.(found);
|
||||||
<div className="preview-row__meta">
|
}}
|
||||||
{sourceSymbol ? (
|
onDetach={(elementId) => releaseToList({
|
||||||
<span className="source-mark">
|
source: "attachment",
|
||||||
<TypeGlyph name={sourceSymbol} tone="light" size={16} />
|
elementId,
|
||||||
<TypeGlyph name={sourceSymbol} tone="dark" size={16} />
|
hostElementId: element.id,
|
||||||
</span>
|
})}
|
||||||
) : null}
|
onDetachEvidence={(proof, dispatch) => releaseToList({
|
||||||
<span className="preview-row__facts">{facts}</span>
|
source: "evidence",
|
||||||
<BezugMenu element={element} source={source} onOpen={onOpen} itemHref={itemHref} canEdit={canEdit} onClearBezug={clearBezug} />
|
elementId: proof.element_id,
|
||||||
</div>
|
dispatchId: dispatch.id,
|
||||||
{text ? (
|
})}
|
||||||
<Link className="preview-row__text" to={href} draggable={false} onClick={openFromList}>{text}</Link>
|
onUnfold={async (elementId) => {
|
||||||
) : null}
|
const found = source.find((item) => item.element?.id === elementId);
|
||||||
{samePiece ? <span className="preview-row__origin">{samePiece}</span> : null}
|
if (!found) return;
|
||||||
{originText ? <span className="preview-row__origin">{originText}</span> : null}
|
setPending(true);
|
||||||
<UnitDetail
|
setError("");
|
||||||
binding={binding}
|
try {
|
||||||
canEdit={canEdit}
|
await restoreFold(found.id, found.element.version, scopeBody(actionContext(), containerKind, containerId));
|
||||||
pending={pending}
|
onChange();
|
||||||
scope={scopeBody(actionContext(), containerKind, containerId)}
|
} catch (err) {
|
||||||
onCarryStart={beginCarry}
|
setError(err.message);
|
||||||
onCarryEnd={endCarry}
|
} finally {
|
||||||
onOpen={(elementId) => {
|
setPending(false);
|
||||||
const found = source.find((item) => item.element?.id === elementId);
|
}
|
||||||
if (found) onOpen?.(found);
|
}}
|
||||||
}}
|
>
|
||||||
onDetach={(elementId) => releaseToList({
|
{(switches, lists) => (
|
||||||
source: "attachment",
|
<div className="preview-row__body">
|
||||||
elementId,
|
<div className="preview-row__headline">
|
||||||
hostElementId: element.id,
|
<Link
|
||||||
})}
|
className="preview-row__title"
|
||||||
onDetachEvidence={(proof, dispatch) => releaseToList({
|
to={href}
|
||||||
source: "evidence",
|
draggable={false}
|
||||||
elementId: proof.element_id,
|
aria-current={selectedId === binding.id ? "true" : undefined}
|
||||||
dispatchId: dispatch.id,
|
onClick={openFromList}
|
||||||
})}
|
>
|
||||||
onUnfold={async (elementId) => {
|
<strong>{element.title}</strong>
|
||||||
const found = source.find((item) => item.element?.id === elementId);
|
</Link>
|
||||||
if (!found) return;
|
{switches}
|
||||||
setPending(true);
|
</div>
|
||||||
setError("");
|
<div className="preview-row__meta">
|
||||||
try {
|
{sourceSymbol ? (
|
||||||
await restoreFold(found.id, found.element.version, scopeBody(actionContext(), containerKind, containerId));
|
<span className="source-mark">
|
||||||
onChange();
|
<TypeGlyph name={sourceSymbol} tone="light" size={16} />
|
||||||
} catch (err) {
|
<TypeGlyph name={sourceSymbol} tone="dark" size={16} />
|
||||||
setError(err.message);
|
</span>
|
||||||
} finally {
|
) : null}
|
||||||
setPending(false);
|
<span className="preview-row__facts">{facts}</span>
|
||||||
}
|
<BezugMenu element={element} source={source} onOpen={onOpen} itemHref={itemHref} canEdit={canEdit} onClearBezug={clearBezug} />
|
||||||
}}
|
</div>
|
||||||
/>
|
{text ? (
|
||||||
</div>
|
<Link className="preview-row__text" to={href} draggable={false} onClick={openFromList}>{text}</Link>
|
||||||
|
) : null}
|
||||||
|
{samePiece ? <span className="preview-row__origin">{samePiece}</span> : null}
|
||||||
|
{originText ? <span className="preview-row__origin">{originText}</span> : null}
|
||||||
|
{lists}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</UnitDetail>
|
||||||
<EntryActions
|
<EntryActions
|
||||||
element={element}
|
element={element}
|
||||||
binding={binding}
|
binding={binding}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useMemo, useState } from "react";
|
import { useEffect, useMemo, useRef, useState } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { api } from "../api.js";
|
import { api } from "../api.js";
|
||||||
import { buildChapterSections, sectionCounts } from "./chapters.js";
|
import { buildChapterSections, sectionCounts } from "./chapters.js";
|
||||||
@@ -113,6 +113,32 @@ function branchVisible(section, needle) {
|
|||||||
return (section.children || []).some((child) => branchVisible(child, needle));
|
return (section.children || []).some((child) => branchVisible(child, needle));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function PickBox({ checked, mixed = false, disabled = false, label, onChange }) {
|
||||||
|
const ref = useRef(null);
|
||||||
|
useEffect(() => {
|
||||||
|
if (ref.current) ref.current.indeterminate = mixed;
|
||||||
|
}, [mixed]);
|
||||||
|
return (
|
||||||
|
<input
|
||||||
|
ref={ref}
|
||||||
|
type="checkbox"
|
||||||
|
checked={checked}
|
||||||
|
disabled={disabled}
|
||||||
|
aria-checked={mixed ? "mixed" : checked}
|
||||||
|
aria-label={label}
|
||||||
|
onChange={onChange}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectionState(ids, selected) {
|
||||||
|
if (!ids.length) return "off";
|
||||||
|
const count = ids.filter((id) => selected.has(id)).length;
|
||||||
|
if (count === 0) return "off";
|
||||||
|
if (count === ids.length) return "on";
|
||||||
|
return "mixed";
|
||||||
|
}
|
||||||
|
|
||||||
export function StructureAssignDialog({ host, bindings, chapters, scope, pending, onClose, onDone }) {
|
export function StructureAssignDialog({ host, bindings, chapters, scope, pending, onClose, onDone }) {
|
||||||
const tree = useMemo(() => buildChapterSections(chapters, bindings), [chapters, bindings]);
|
const tree = useMemo(() => buildChapterSections(chapters, bindings), [chapters, bindings]);
|
||||||
const [opened, setOpened] = useState(() => new Set(host.chapter_id ? ancestorIds(chapters, host.chapter_id) : ["loose"]));
|
const [opened, setOpened] = useState(() => new Set(host.chapter_id ? ancestorIds(chapters, host.chapter_id) : ["loose"]));
|
||||||
@@ -252,34 +278,40 @@ export function StructureAssignDialog({ host, bindings, chapters, scope, pending
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderRow(item, depth) {
|
function renderRow(item) {
|
||||||
const id = item.element.id;
|
const id = item.element.id;
|
||||||
const isHost = id === host.element.id;
|
const isHost = id === host.element.id;
|
||||||
|
const notes = [
|
||||||
|
formatDate(item.element.dates?.document_on),
|
||||||
|
isHost ? "dieses Schriftstück" : "",
|
||||||
|
taken.has(id) ? "Anlage" : "",
|
||||||
|
].filter(Boolean).join(" · ");
|
||||||
return (
|
return (
|
||||||
<li key={item.id} className="pick-tree__row" style={{ "--depth": depth }}>
|
<li key={item.id}>
|
||||||
<label>
|
<label className="pick-tree__row">
|
||||||
<input type="checkbox" checked={selected.has(id)} disabled={isHost} onChange={() => toggle(id)} />
|
<PickBox checked={selected.has(id)} disabled={isHost} label={item.element.title} onChange={() => toggle(id)} />
|
||||||
<span>{item.element.title}</span>
|
<span className="pick-tree__title">{item.element.title}</span>
|
||||||
<span className="muted">{formatDate(item.element.dates?.document_on)}</span>
|
<span className="pick-tree__kind">{notes}</span>
|
||||||
{isHost ? <span className="muted">dieses Schriftstück</span> : null}
|
|
||||||
{taken.has(id) ? <span className="muted">Anlage</span> : null}
|
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSection(section, depth) {
|
function renderSection(section) {
|
||||||
if (!branchVisible(section, needle)) return null;
|
if (!branchVisible(section, needle)) return null;
|
||||||
const expanded = Boolean(needle) || opened.has(section.id);
|
const expanded = Boolean(needle) || opened.has(section.id);
|
||||||
const counts = sectionCounts(section);
|
const counts = sectionCounts(section);
|
||||||
const total = counts.direct + counts.nested;
|
const total = counts.direct + counts.nested;
|
||||||
|
const ids = branchItems(section).map((item) => item.element.id).filter((id) => id !== host.element.id);
|
||||||
|
const state = selectionState(ids, selected);
|
||||||
return (
|
return (
|
||||||
<li key={section.id}>
|
<li key={section.id}>
|
||||||
<div className="pick-tree__chapter" style={{ "--depth": depth }}>
|
<div className="pick-tree__row">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="quiet"
|
className="pick-tree__twist"
|
||||||
aria-expanded={expanded}
|
aria-expanded={expanded}
|
||||||
|
aria-label={`${section.title} ${expanded ? "zuklappen" : "aufklappen"}`}
|
||||||
onClick={() => setOpened((current) => {
|
onClick={() => setOpened((current) => {
|
||||||
const next = new Set(current);
|
const next = new Set(current);
|
||||||
if (next.has(section.id)) next.delete(section.id);
|
if (next.has(section.id)) next.delete(section.id);
|
||||||
@@ -287,15 +319,24 @@ export function StructureAssignDialog({ host, bindings, chapters, scope, pending
|
|||||||
return next;
|
return next;
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{expanded ? "▾" : "▸"} {section.title}
|
{expanded ? "▾" : "▸"}
|
||||||
<span className="muted">{total}</span>
|
|
||||||
</button>
|
</button>
|
||||||
<button type="button" className="quiet" aria-label={`Alle in ${section.title} auswählen`} onClick={() => toggleChapter(section)}>alle</button>
|
<label>
|
||||||
|
<PickBox
|
||||||
|
checked={state === "on"}
|
||||||
|
mixed={state === "mixed"}
|
||||||
|
disabled={!ids.length}
|
||||||
|
label={`Alle in ${section.title}`}
|
||||||
|
onChange={() => toggleChapter(section)}
|
||||||
|
/>
|
||||||
|
<span className="pick-tree__title">{section.title}</span>
|
||||||
|
<span className="pick-tree__kind">{total}</span>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{expanded ? (
|
{expanded ? (
|
||||||
<ul className="pick-tree__items">
|
<ul>
|
||||||
{(section.items || []).filter((item) => titleMatches(item, needle)).map((item) => renderRow(item, depth + 1))}
|
{(section.items || []).filter((item) => titleMatches(item, needle)).map((item) => renderRow(item))}
|
||||||
{(section.children || []).map((child) => renderSection(child, depth + 1))}
|
{(section.children || []).map((child) => renderSection(child))}
|
||||||
</ul>
|
</ul>
|
||||||
) : null}
|
) : null}
|
||||||
</li>
|
</li>
|
||||||
@@ -305,24 +346,29 @@ export function StructureAssignDialog({ host, bindings, chapters, scope, pending
|
|||||||
const loose = tree.loose.filter((item) => titleMatches(item, needle));
|
const loose = tree.loose.filter((item) => titleMatches(item, needle));
|
||||||
const roots = tree.roots.map((section) => renderSection(section, 0)).filter(Boolean);
|
const roots = tree.roots.map((section) => renderSection(section, 0)).filter(Boolean);
|
||||||
|
|
||||||
|
const looseIds = loose.map((item) => item.element.id).filter((id) => id !== host.element.id);
|
||||||
|
const looseState = selectionState(looseIds, selected);
|
||||||
|
const looseOpen = Boolean(needle) || opened.has("loose");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="stack pick-tree">
|
<div className="stack pick-tree-dialog">
|
||||||
<p>Zuordnen an <strong>{host.element.title}</strong>. Kapitel bleiben geschlossen, bis sie geöffnet werden.</p>
|
<p className="pick-tree__lead">Zuordnen an {host.element.title}</p>
|
||||||
<label>
|
<label className="pick-tree__find">
|
||||||
Suchen
|
Suchen
|
||||||
<input value={query} onChange={(event) => setQuery(event.target.value)} placeholder="Titel" />
|
<input value={query} onChange={(event) => setQuery(event.target.value)} placeholder="Titel" />
|
||||||
</label>
|
</label>
|
||||||
{step === "pick" ? (
|
{step === "pick" ? (
|
||||||
<>
|
<>
|
||||||
<ul className="pick-tree__list">
|
<ul className="pick-tree">
|
||||||
{roots}
|
{roots}
|
||||||
{loose.length ? (
|
{loose.length ? (
|
||||||
<li>
|
<li>
|
||||||
<div className="pick-tree__chapter">
|
<div className="pick-tree__row">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="quiet"
|
className="pick-tree__twist"
|
||||||
aria-expanded={Boolean(needle) || opened.has("loose")}
|
aria-expanded={looseOpen}
|
||||||
|
aria-label={`Ohne Kapitel ${looseOpen ? "zuklappen" : "aufklappen"}`}
|
||||||
onClick={() => setOpened((current) => {
|
onClick={() => setOpened((current) => {
|
||||||
const next = new Set(current);
|
const next = new Set(current);
|
||||||
if (next.has("loose")) next.delete("loose");
|
if (next.has("loose")) next.delete("loose");
|
||||||
@@ -330,19 +376,28 @@ export function StructureAssignDialog({ host, bindings, chapters, scope, pending
|
|||||||
return next;
|
return next;
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{needle || opened.has("loose") ? "▾" : "▸"} Ohne Kapitel
|
{looseOpen ? "▾" : "▸"}
|
||||||
<span className="muted">{loose.length}</span>
|
|
||||||
</button>
|
</button>
|
||||||
<button type="button" className="quiet" onClick={() => toggleIds(loose.map((item) => item.element.id).filter((id) => id !== host.element.id))}>alle</button>
|
<label>
|
||||||
|
<PickBox
|
||||||
|
checked={looseState === "on"}
|
||||||
|
mixed={looseState === "mixed"}
|
||||||
|
disabled={!looseIds.length}
|
||||||
|
label="Alle ohne Kapitel"
|
||||||
|
onChange={() => toggleIds(looseIds)}
|
||||||
|
/>
|
||||||
|
<span className="pick-tree__title">Ohne Kapitel</span>
|
||||||
|
<span className="pick-tree__kind">{loose.length}</span>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{needle || opened.has("loose") ? (
|
{looseOpen ? (
|
||||||
<ul className="pick-tree__items">
|
<ul>
|
||||||
{loose.map((item) => renderRow(item, 1))}
|
{loose.map((item) => renderRow(item))}
|
||||||
</ul>
|
</ul>
|
||||||
) : null}
|
) : null}
|
||||||
</li>
|
</li>
|
||||||
) : null}
|
) : null}
|
||||||
{!roots.length && !loose.length ? <li className="muted">Nichts mit diesem Titel.</li> : null}
|
{!roots.length && !loose.length ? <li className="pick-tree__empty">Nichts mit diesem Titel.</li> : null}
|
||||||
</ul>
|
</ul>
|
||||||
<div className="pick-tree__bar">
|
<div className="pick-tree__bar">
|
||||||
<span>{selected.size} ausgewählt</span>
|
<span>{selected.size} ausgewählt</span>
|
||||||
@@ -645,16 +700,41 @@ export function ComparisonList({ comparisons = [], state, reason }) {
|
|||||||
|
|
||||||
function chipDrag(enabled, payload, onCarryStart, onCarryEnd) {
|
function chipDrag(enabled, payload, onCarryStart, onCarryEnd) {
|
||||||
return {
|
return {
|
||||||
role: "button",
|
|
||||||
tabIndex: enabled ? 0 : undefined,
|
|
||||||
draggable: enabled,
|
draggable: enabled,
|
||||||
onDragStart(event) {
|
onDragStart(event) {
|
||||||
|
if (event.target.closest("button, a")) {
|
||||||
|
event.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
payload.anchorX = event.clientX;
|
||||||
|
payload.anchorY = event.clientY;
|
||||||
|
event.currentTarget.dataset.dragged = "1";
|
||||||
writeAssign(event, payload);
|
writeAssign(event, payload);
|
||||||
onCarryStart?.(payload);
|
onCarryStart?.(payload);
|
||||||
},
|
},
|
||||||
onDragEnd() {
|
onDragEnd(event) {
|
||||||
onCarryEnd?.();
|
onCarryEnd?.(event);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function openTitleProps(onOpen) {
|
||||||
|
return {
|
||||||
|
role: "link",
|
||||||
|
tabIndex: 0,
|
||||||
|
onClick(event) {
|
||||||
|
const row = event.currentTarget.closest(".use-chip");
|
||||||
|
if (row?.dataset.dragged === "1") {
|
||||||
|
delete row.dataset.dragged;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
onOpen();
|
||||||
|
},
|
||||||
|
onKeyDown(event) {
|
||||||
|
if (event.key !== "Enter" && event.key !== " ") return;
|
||||||
|
event.preventDefault();
|
||||||
|
onOpen();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -670,113 +750,134 @@ export function UnitDetail({
|
|||||||
onUnfold,
|
onUnfold,
|
||||||
onCarryStart,
|
onCarryStart,
|
||||||
onCarryEnd,
|
onCarryEnd,
|
||||||
|
children,
|
||||||
}) {
|
}) {
|
||||||
const pack = binding.correspondence || {};
|
const pack = binding.correspondence || {};
|
||||||
const attachments = pack.attachments || [];
|
const attachments = pack.attachments || [];
|
||||||
const dispatches = pack.dispatches || [];
|
const dispatches = pack.dispatches || [];
|
||||||
const [open, setOpen] = useState(false);
|
const [attachmentsOpen, setAttachmentsOpen] = useState(false);
|
||||||
if (!attachments.length && !dispatches.length) return null;
|
const [receiptsOpen, setReceiptsOpen] = useState(false);
|
||||||
const summary = unitMarks(binding) || "Anlagen und Belege";
|
if (!attachments.length && !dispatches.length) {
|
||||||
|
return typeof children === "function" ? children(null, null) : null;
|
||||||
|
}
|
||||||
|
const evidenceCount = dispatches.reduce((sum, item) => sum + (item.evidence || []).length, 0);
|
||||||
|
const attachmentLabel = attachments.length === 1 ? "1 Anlage" : `${attachments.length} Anlagen`;
|
||||||
|
const receiptParts = [];
|
||||||
|
if (dispatches.length === 1) receiptParts.push("1 Versand");
|
||||||
|
else if (dispatches.length > 1) receiptParts.push(`${dispatches.length} Versände`);
|
||||||
|
if (evidenceCount === 1) receiptParts.push("1 Beleg");
|
||||||
|
else if (evidenceCount > 1) receiptParts.push(`${evidenceCount} Belege`);
|
||||||
|
const switches = (
|
||||||
|
<span className="unit-switches">
|
||||||
|
{attachments.length ? (
|
||||||
|
<button type="button" className="unit-switch" aria-expanded={attachmentsOpen} onClick={() => setAttachmentsOpen((value) => !value)}>
|
||||||
|
{attachmentLabel}
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
|
{dispatches.length ? (
|
||||||
|
<button type="button" className="unit-switch" aria-expanded={receiptsOpen} onClick={() => setReceiptsOpen((value) => !value)}>
|
||||||
|
{receiptParts.join(" · ") || "Belege"}
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
const lists = attachmentsOpen || receiptsOpen ? (
|
||||||
|
<div className="unit-detail unit-detail--slim">
|
||||||
|
{attachmentsOpen && attachments.length ? (
|
||||||
|
<section>
|
||||||
|
<h4>Anlagen</h4>
|
||||||
|
<ol>
|
||||||
|
{attachments.map((item, index) => (
|
||||||
|
<li
|
||||||
|
key={item.id}
|
||||||
|
className="use-chip"
|
||||||
|
data-carry={`attachment:${item.element_id}`}
|
||||||
|
{...(canEdit ? chipDrag(!pending, {
|
||||||
|
source: "attachment",
|
||||||
|
elementId: item.element_id,
|
||||||
|
hostElementId: binding.element.id,
|
||||||
|
bindingId: item.binding_id || "",
|
||||||
|
title: item.title,
|
||||||
|
}, onCarryStart, onCarryEnd) : {})}
|
||||||
|
>
|
||||||
|
{canEdit ? <span className="use-chip__grip" aria-hidden="true" /> : null}
|
||||||
|
<span className="use-chip__title" {...openTitleProps(() => onOpen(item.element_id))}>
|
||||||
|
{index + 1}. {item.title}
|
||||||
|
</span>
|
||||||
|
<span className="muted">{formatDate(item.document_on)}</span>
|
||||||
|
{canEdit ? (
|
||||||
|
<button type="button" className="quiet" disabled={pending} onClick={() => onDetach(item.element_id)}>In die Liste</button>
|
||||||
|
) : null}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
) : null}
|
||||||
|
{receiptsOpen ? dispatches.map((item) => (
|
||||||
|
<section key={item.id}>
|
||||||
|
<h4>
|
||||||
|
Versand {item.undated ? "undatiert" : formatDate(item.sent_on)} · {item.channel_label}
|
||||||
|
{item.counterpart ? ` · ${item.counterpart}` : ""}
|
||||||
|
</h4>
|
||||||
|
{item.evidence?.length ? (
|
||||||
|
<ul>
|
||||||
|
{item.evidence.map((proof) => (
|
||||||
|
<li
|
||||||
|
key={proof.id}
|
||||||
|
className="use-chip"
|
||||||
|
data-carry={`evidence:${proof.element_id}`}
|
||||||
|
{...(canEdit ? chipDrag(!pending, {
|
||||||
|
source: "evidence",
|
||||||
|
elementId: proof.element_id,
|
||||||
|
dispatchId: item.id,
|
||||||
|
hostElementId: binding.element.id,
|
||||||
|
version: item.version,
|
||||||
|
title: proof.title,
|
||||||
|
}, onCarryStart, onCarryEnd) : {})}
|
||||||
|
>
|
||||||
|
{canEdit ? <span className="use-chip__grip" aria-hidden="true" /> : null}
|
||||||
|
<span className="use-chip__title" {...openTitleProps(() => onOpen(proof.element_id))}>
|
||||||
|
{receiptRoleLabel(proof.role, proof.role_label)}: {proof.title}
|
||||||
|
</span>
|
||||||
|
<span className="muted">{formatDate(proof.document_on)}</span>
|
||||||
|
{proof.source_state === "gap" ? <span>Lücke: {proof.gap_reason}</span> : null}
|
||||||
|
{canEdit ? (
|
||||||
|
<button type="button" className="quiet" disabled={pending} onClick={() => onDetachEvidence(proof, item)}>
|
||||||
|
In die Liste
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
|
{canEdit && proof.listed_fold === "evidence" ? (
|
||||||
|
<button type="button" className="quiet" disabled={pending} onClick={() => onUnfold(proof.element_id)}>
|
||||||
|
Zusätzlich in der Liste zeigen
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
) : <p className="muted">Ohne Beleg</p>}
|
||||||
|
<details className="use-editions">
|
||||||
|
<summary>Gesicherte Fassung</summary>
|
||||||
|
<ol>
|
||||||
|
{item.items.map((part) => (
|
||||||
|
<li key={part.id}>
|
||||||
|
<span>{part.role === "host" ? "Schreiben" : "Anlage"}: {part.title}</span>
|
||||||
|
<span className="muted">{formatDate(part.document_on)}</span>
|
||||||
|
{part.source_state === "gap" ? <span>Lücke: {part.gap_reason}</span> : scope ? (
|
||||||
|
<a href={snapshotHref(item.id, part.id, scope)}>Öffnen</a>
|
||||||
|
) : <span>Gesichert</span>}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ol>
|
||||||
|
</details>
|
||||||
|
</section>
|
||||||
|
)) : null}
|
||||||
|
</div>
|
||||||
|
) : null;
|
||||||
|
if (typeof children === "function") return children(switches, lists);
|
||||||
return (
|
return (
|
||||||
<div className="unit-fold">
|
<div className="unit-fold">
|
||||||
<button type="button" className="quiet unit-toggle" aria-expanded={open} onClick={() => setOpen((value) => !value)}>
|
{switches}
|
||||||
{open ? "Zuklappen" : summary}
|
{lists}
|
||||||
</button>
|
|
||||||
{open ? (
|
|
||||||
<div className="unit-detail unit-detail--slim">
|
|
||||||
{attachments.length ? (
|
|
||||||
<section>
|
|
||||||
<h4>Anlagen</h4>
|
|
||||||
<ol>
|
|
||||||
{attachments.map((item, index) => (
|
|
||||||
<li key={item.id} className="use-chip">
|
|
||||||
{canEdit ? (
|
|
||||||
<span
|
|
||||||
className="use-chip__grip"
|
|
||||||
aria-label={`${item.title} aus den Anlagen ziehen`}
|
|
||||||
{...chipDrag(!pending, {
|
|
||||||
source: "attachment",
|
|
||||||
elementId: item.element_id,
|
|
||||||
hostElementId: binding.element.id,
|
|
||||||
bindingId: item.binding_id || "",
|
|
||||||
title: item.title,
|
|
||||||
}, onCarryStart, onCarryEnd)}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
<span>{index + 1}. {item.title}</span>
|
|
||||||
<span className="muted">{formatDate(item.document_on)}</span>
|
|
||||||
{item.binding_id ? (
|
|
||||||
<button type="button" className="quiet" onClick={() => onOpen(item.element_id)}>Öffnen</button>
|
|
||||||
) : null}
|
|
||||||
{canEdit ? (
|
|
||||||
<button type="button" className="quiet" disabled={pending} onClick={() => onDetach(item.element_id)}>In die Liste</button>
|
|
||||||
) : null}
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ol>
|
|
||||||
</section>
|
|
||||||
) : null}
|
|
||||||
{dispatches.map((item) => (
|
|
||||||
<section key={item.id}>
|
|
||||||
<h4>
|
|
||||||
Versand {item.undated ? "undatiert" : formatDate(item.sent_on)} · {item.channel_label}
|
|
||||||
{item.counterpart ? ` · ${item.counterpart}` : ""}
|
|
||||||
</h4>
|
|
||||||
{item.evidence?.length ? (
|
|
||||||
<ul>
|
|
||||||
{item.evidence.map((proof) => (
|
|
||||||
<li key={proof.id} className="use-chip">
|
|
||||||
{canEdit ? (
|
|
||||||
<span
|
|
||||||
className="use-chip__grip"
|
|
||||||
aria-label={`${proof.title} aus den Belegen ziehen`}
|
|
||||||
{...chipDrag(!pending, {
|
|
||||||
source: "evidence",
|
|
||||||
elementId: proof.element_id,
|
|
||||||
dispatchId: item.id,
|
|
||||||
hostElementId: binding.element.id,
|
|
||||||
version: item.version,
|
|
||||||
title: proof.title,
|
|
||||||
}, onCarryStart, onCarryEnd)}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
<button type="button" className="quiet" onClick={() => onOpen(proof.element_id)}>
|
|
||||||
{receiptRoleLabel(proof.role, proof.role_label)}: {proof.title}
|
|
||||||
</button>
|
|
||||||
<span className="muted">{formatDate(proof.document_on)}</span>
|
|
||||||
{proof.source_state === "gap" ? <span>Lücke: {proof.gap_reason}</span> : null}
|
|
||||||
{canEdit ? (
|
|
||||||
<button type="button" className="quiet" disabled={pending} onClick={() => onDetachEvidence(proof, item)}>
|
|
||||||
In die Liste
|
|
||||||
</button>
|
|
||||||
) : null}
|
|
||||||
{canEdit && proof.listed_fold === "evidence" ? (
|
|
||||||
<button type="button" className="quiet" disabled={pending} onClick={() => onUnfold(proof.element_id)}>
|
|
||||||
Zusätzlich in der Liste zeigen
|
|
||||||
</button>
|
|
||||||
) : null}
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
) : <p className="muted">Ohne Beleg</p>}
|
|
||||||
<details className="use-editions">
|
|
||||||
<summary>Gesicherte Fassung</summary>
|
|
||||||
<ol>
|
|
||||||
{item.items.map((part) => (
|
|
||||||
<li key={part.id}>
|
|
||||||
<span>{part.role === "host" ? "Schreiben" : "Anlage"}: {part.title}</span>
|
|
||||||
<span className="muted">{formatDate(part.document_on)}</span>
|
|
||||||
{part.source_state === "gap" ? <span>Lücke: {part.gap_reason}</span> : scope ? (
|
|
||||||
<a href={snapshotHref(item.id, part.id, scope)}>Öffnen</a>
|
|
||||||
) : <span>Gesichert</span>}
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ol>
|
|
||||||
</details>
|
|
||||||
</section>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+87
-15
@@ -721,6 +721,7 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
|
|||||||
.preview-row > .insert-line { grid-column: 1 / -1; }
|
.preview-row > .insert-line { grid-column: 1 / -1; }
|
||||||
.preview-row.is-dragging { opacity: 0.4; }
|
.preview-row.is-dragging { opacity: 0.4; }
|
||||||
.preview-row__body { display: grid; gap: 2px; min-width: 0; }
|
.preview-row__body { display: grid; gap: 2px; min-width: 0; }
|
||||||
|
.preview-row__headline { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 2px 12px; min-width: 0; }
|
||||||
.preview-row__title, .preview-row__text { color: inherit; text-decoration: none; min-width: 0; }
|
.preview-row__title, .preview-row__text { color: inherit; text-decoration: none; min-width: 0; }
|
||||||
.preview-row__title strong, .preview-row__main strong {
|
.preview-row__title strong, .preview-row__main strong {
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
@@ -1329,33 +1330,104 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
|
|||||||
.choice-list li, .choice-list label { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
.choice-list li, .choice-list label { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
||||||
.choice-list--scroll { max-height: 240px; overflow: auto; }
|
.choice-list--scroll { max-height: 240px; overflow: auto; }
|
||||||
.choice-list__move { display: inline-flex; gap: 4px; margin-left: auto; }
|
.choice-list__move { display: inline-flex; gap: 4px; margin-left: auto; }
|
||||||
.unit-fold { margin-top: 2px; }
|
.unit-fold { display: grid; justify-items: start; gap: 2px; margin-top: 2px; }
|
||||||
|
.unit-switches { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 2px 12px; }
|
||||||
|
button.unit-switch {
|
||||||
|
min-height: 22px;
|
||||||
|
height: 22px;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text2);
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 650;
|
||||||
|
line-height: 22px;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
button.unit-switch[aria-expanded="true"] { color: var(--brand); }
|
||||||
.unit-detail, .comparison, .chrono { display: grid; gap: 8px; margin-top: 8px; }
|
.unit-detail, .comparison, .chrono { display: grid; gap: 8px; margin-top: 8px; }
|
||||||
.unit-detail--slim { gap: 4px; margin-top: 2px; }
|
.unit-detail--slim { gap: 4px; margin-top: 2px; justify-items: start; text-align: left; }
|
||||||
.unit-detail h4, .chrono h3 { margin: 0; font-size: 13px; }
|
.unit-detail h4, .chrono h3 { margin: 0; font-size: 13px; text-align: left; }
|
||||||
.unit-detail section { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface) 88%, var(--bg)); }
|
.unit-detail section { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface) 88%, var(--bg)); }
|
||||||
.unit-detail--slim section { padding: 0; border: 0; border-radius: 0; background: transparent; gap: 2px; }
|
.unit-detail--slim section { padding: 0 0 0 8px; border: 0; border-left: 1px solid var(--border); border-radius: 0; background: transparent; gap: 2px; }
|
||||||
.unit-detail--slim button.quiet, .unit-detail--slim summary { min-height: 22px; height: 22px; padding: 0 6px; font-size: 12px; }
|
.unit-detail--slim button.quiet, .unit-detail--slim summary { min-height: 22px; height: 22px; padding: 0 6px; font-size: 12px; }
|
||||||
.unit-detail ol, .unit-detail ul, .comparison ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
|
.unit-detail ol, .unit-detail ul, .comparison ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
|
||||||
.unit-detail--slim ol, .unit-detail--slim ul { gap: 0; }
|
.unit-detail--slim ol, .unit-detail--slim ul { gap: 0; }
|
||||||
.unit-detail li { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; min-width: 0; max-width: 100%; }
|
.unit-detail li { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 2px 10px; align-items: center; min-width: 0; max-width: 100%; min-height: 22px; text-align: left; }
|
||||||
.unit-detail li .muted { white-space: nowrap; }
|
.unit-detail li .muted { white-space: nowrap; }
|
||||||
.use-chip { cursor: default; }
|
.use-chip { cursor: grab; }
|
||||||
.use-chip__grip { width: 14px; height: 22px; border: 0; padding: 0; border-left: 2px dotted var(--text3); border-right: 2px dotted var(--text3); background: transparent; flex: none; cursor: grab; }
|
.use-chip__grip { width: 10px; height: 14px; border: 0; padding: 0; border-left: 2px dotted var(--text3); border-right: 2px dotted var(--text3); background: transparent; flex: none; }
|
||||||
|
.use-chip__title { cursor: pointer; font-weight: 600; text-align: left; }
|
||||||
.entry-mark[draggable="true"] { cursor: grab; }
|
.entry-mark[draggable="true"] { cursor: grab; }
|
||||||
.use-editions summary { cursor: pointer; color: var(--text2); font-size: 13px; }
|
.use-editions summary { cursor: pointer; color: var(--text2); font-size: 13px; text-align: left; }
|
||||||
.unit-toggle { min-height: 22px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
|
|
||||||
.preview-row.is-use-target .direction-trigger,
|
.preview-row.is-use-target .direction-trigger,
|
||||||
.preview-row.is-use-target .entry-mark {
|
.preview-row.is-use-target .entry-mark {
|
||||||
box-shadow: inset 0 0 0 2px var(--accent);
|
box-shadow: inset 0 0 0 2px var(--accent);
|
||||||
background: var(--accent-light);
|
background: var(--accent-light);
|
||||||
}
|
}
|
||||||
.pick-tree__list { max-height: 60vh; overflow: auto; margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
|
.pick-tree-dialog { justify-items: start; text-align: left; gap: 8px; }
|
||||||
.pick-tree__items { margin: 0; padding: 0; list-style: none; }
|
.pick-tree__lead { margin: 0; text-align: left; font-size: 13px; font-weight: 400; color: var(--text2); }
|
||||||
.pick-tree__chapter, .pick-tree__row { display: flex; gap: 8px; align-items: center; min-height: 28px; padding-left: calc(var(--depth, 0) * 14px); }
|
.pick-tree__find { width: 100%; font-size: 13px; font-weight: 500; gap: 4px; text-align: left; }
|
||||||
.pick-tree__chapter > span, .pick-tree__row label { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
|
.pick-tree__find input { min-height: 32px; padding: 4px 8px; font-size: 13px; }
|
||||||
.pick-tree button.quiet { min-height: 28px; height: 28px; padding: 0 8px; font-size: 13px; }
|
.pick-tree, .pick-tree ul { list-style: none; margin: 0; padding: 0; text-align: left; }
|
||||||
.pick-tree__bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; }
|
.pick-tree { max-height: min(60vh, 520px); overflow: auto; width: 100%; }
|
||||||
|
.pick-tree ul { margin-left: 11px; padding-left: 8px; border-left: 1px solid var(--border); }
|
||||||
|
.pick-tree__row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
gap: 4px;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 28px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 1px 4px;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.35;
|
||||||
|
}
|
||||||
|
.pick-tree__row > label {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
justify-content: flex-start;
|
||||||
|
gap: 6px;
|
||||||
|
min-width: 0;
|
||||||
|
flex: 1;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
.pick-tree__row input[type="checkbox"] {
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
min-width: 14px;
|
||||||
|
min-height: 14px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
flex: 0 0 14px;
|
||||||
|
accent-color: var(--accent);
|
||||||
|
background: transparent;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
button.pick-tree__twist {
|
||||||
|
width: 22px;
|
||||||
|
min-width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
min-height: 22px;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text2);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
.pick-tree__title { font-weight: 600; text-align: left; min-width: 0; overflow-wrap: anywhere; }
|
||||||
|
.pick-tree__kind { color: var(--text3); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
|
||||||
|
.pick-tree__empty { padding: 4px; color: var(--text3); font-size: 13px; text-align: left; }
|
||||||
|
.pick-tree__bar { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; align-items: center; position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; width: 100%; }
|
||||||
.count { white-space: normal; }
|
.count { white-space: normal; }
|
||||||
.chapter-children { display: grid; gap: 8px; margin-top: 8px; }
|
.chapter-children { display: grid; gap: 8px; margin-top: 8px; }
|
||||||
.pick-bar {
|
.pick-bar {
|
||||||
|
|||||||
Reference in new issue
Block a user