Refactor and harden graph browser assets
This commit is contained in:
parent
7a940b60c1
commit
f9f7105983
14 changed files with 1955 additions and 1867 deletions
385
src/docforge/assets/graph.css
Normal file
385
src/docforge/assets/graph.css
Normal file
|
|
@ -0,0 +1,385 @@
|
|||
:root {
|
||||
color-scheme: dark;
|
||||
--bg: #07101a;
|
||||
--panel: #0c1825;
|
||||
--panel-2: #111f2f;
|
||||
--line: #263b51;
|
||||
--text: #ecf5ff;
|
||||
--muted: #93abc3;
|
||||
--accent: #51d7ff;
|
||||
--accent-2: #8fffc5;
|
||||
--warn: #ffd27a;
|
||||
--left-width: 310px;
|
||||
--right-width: 350px;
|
||||
--primary-fill: #176b7d;
|
||||
--primary-stroke: #83e8ff;
|
||||
--child-fill: #216c51;
|
||||
--child-stroke: #91f2bd;
|
||||
--edge-fill: #634580;
|
||||
--edge-stroke: #d0a7ff;
|
||||
font: 14px/1.45 Inter, ui-sans-serif, system-ui, sans-serif;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
html, body { height: 100%; overflow: hidden; }
|
||||
body { margin: 0; background: var(--bg); color: var(--text); }
|
||||
button, input, select { font: inherit; }
|
||||
button { cursor: pointer; }
|
||||
code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
|
||||
.app { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
|
||||
header {
|
||||
display: flex; gap: 14px; align-items: center; padding: 10px 14px;
|
||||
border-bottom: 1px solid var(--line); background: rgba(8, 18, 30, .96);
|
||||
}
|
||||
header h1 { margin: 0; font-size: 17px; }
|
||||
.view-switch {
|
||||
position: relative; display: grid; grid-template-columns: repeat(2, 58px);
|
||||
flex: 0 0 auto; padding: 3px; border: 1px solid var(--line); border-radius: 9px;
|
||||
background: #08131f; isolation: isolate;
|
||||
}
|
||||
.view-switch::before {
|
||||
content: ""; position: absolute; z-index: -1; top: 3px; left: 3px;
|
||||
width: 58px; height: calc(100% - 6px); border-radius: 6px;
|
||||
background: #1b536b; box-shadow: 0 0 14px rgba(81, 215, 255, .18);
|
||||
transition: transform .18s ease;
|
||||
}
|
||||
.view-switch[data-mode="flow"]::before { transform: translateX(58px); }
|
||||
.view-switch button {
|
||||
min-height: 30px; border: 0; border-radius: 6px; padding: 4px 8px;
|
||||
background: transparent; color: var(--muted); font-size: 12px; font-weight: 700;
|
||||
}
|
||||
.view-switch button[aria-pressed="true"] { color: var(--text); }
|
||||
.view-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
||||
.stats { display: flex; flex: 0 0 auto; gap: 14px; color: var(--muted); }
|
||||
.status {
|
||||
min-width: 0; margin-left: auto; overflow: hidden; color: var(--muted);
|
||||
text-overflow: ellipsis; white-space: nowrap;
|
||||
}
|
||||
.layout {
|
||||
min-height: 0; overflow: hidden; display: grid;
|
||||
grid-template-columns: var(--left-width) 7px minmax(360px, 1fr) 7px var(--right-width);
|
||||
}
|
||||
aside { min-height: 0; overflow: hidden; padding: 16px; background: var(--panel); }
|
||||
.left, .right { display: flex; flex-direction: column; }
|
||||
.panel-empty {
|
||||
max-width: 220px; margin: auto; color: var(--muted); text-align: center;
|
||||
}
|
||||
.panel-resizer {
|
||||
position: relative; z-index: 4; min-height: 0; background: #0a1521;
|
||||
cursor: col-resize; touch-action: none;
|
||||
}
|
||||
.panel-resizer::after {
|
||||
content: ""; position: absolute; inset: 0 2px; background: var(--line);
|
||||
transition: background .15s;
|
||||
}
|
||||
.panel-resizer:hover::after, .panel-resizer:focus-visible::after,
|
||||
.panel-resizer.resizing::after { background: var(--accent); }
|
||||
.panel-resizer:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
|
||||
form { display: grid; flex: 0 0 auto; gap: 8px; }
|
||||
input, select {
|
||||
width: 100%; border: 1px solid var(--line); border-radius: 8px;
|
||||
padding: 9px 10px; background: var(--panel-2); color: var(--text);
|
||||
}
|
||||
input:focus-visible, select:focus-visible {
|
||||
border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px;
|
||||
}
|
||||
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
|
||||
.button {
|
||||
border: 1px solid #277fa0; border-radius: 8px; padding: 8px 12px;
|
||||
background: #12384a; color: var(--text);
|
||||
}
|
||||
.button:hover, .button:focus-visible {
|
||||
border-color: var(--accent); background: #17485f; outline: none;
|
||||
}
|
||||
.results-context {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
||||
min-height: 30px; margin-top: 12px; color: var(--muted); font-size: 11px;
|
||||
}
|
||||
.results-context strong {
|
||||
overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap;
|
||||
}
|
||||
#clear-result-filter {
|
||||
flex: 0 0 auto; border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px;
|
||||
background: var(--panel-2); color: var(--muted); font-size: 11px;
|
||||
}
|
||||
#clear-result-filter:hover, #clear-result-filter:focus-visible {
|
||||
border-color: var(--accent); color: var(--text); outline: none;
|
||||
}
|
||||
#clear-result-filter[hidden] { display: none; }
|
||||
.results {
|
||||
display: grid; align-content: start; gap: 7px; min-height: 0;
|
||||
margin-top: 8px; overflow: auto; padding-right: 2px;
|
||||
}
|
||||
.section-label {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
||||
margin: 18px 0 8px; color: var(--muted); font-size: 11px;
|
||||
font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
|
||||
}
|
||||
.section-label span {
|
||||
min-width: 24px; border: 1px solid var(--line); border-radius: 999px;
|
||||
padding: 1px 6px; text-align: center; letter-spacing: 0;
|
||||
}
|
||||
.neighborhood {
|
||||
display: flex; flex: 1; flex-direction: column; min-height: 0;
|
||||
}
|
||||
.neighborhood[hidden] { display: none; }
|
||||
.neighborhood-title { margin: 0; font-size: 15px; }
|
||||
#neighborhood-sections { min-height: 0; overflow: auto; padding-right: 2px; }
|
||||
.node-list { display: grid; gap: 6px; }
|
||||
.node-list-item {
|
||||
width: 100%; display: grid; grid-template-columns: 8px minmax(0, 1fr);
|
||||
gap: 9px; align-items: center; text-align: left; border: 1px solid var(--line);
|
||||
border-radius: 9px; padding: 8px; background: rgba(17, 31, 47, .72); color: var(--text);
|
||||
}
|
||||
.node-list-item:hover, .node-list-item:focus-visible {
|
||||
border-color: var(--item-color, var(--accent)); outline: none;
|
||||
background: rgba(24, 43, 62, .9);
|
||||
}
|
||||
.node-swatch {
|
||||
width: 8px; height: 28px; border-radius: 999px;
|
||||
background: var(--item-color, var(--accent));
|
||||
box-shadow: 0 0 12px color-mix(in srgb, var(--item-color, var(--accent)) 35%, transparent);
|
||||
}
|
||||
.node-list-copy { min-width: 0; }
|
||||
.node-list-copy strong, .node-list-copy span {
|
||||
display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||
}
|
||||
.node-list-copy span { color: var(--muted); font-size: 11px; }
|
||||
.node-legend {
|
||||
display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
.node-legend span {
|
||||
display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px;
|
||||
}
|
||||
.node-legend span[hidden] { display: none; }
|
||||
.node-legend i { width: 8px; height: 8px; border-radius: 50%; }
|
||||
.node-legend-primary i { background: var(--primary-stroke); }
|
||||
.node-legend-child i { background: var(--child-stroke); }
|
||||
.node-legend-edge i { background: var(--edge-stroke); }
|
||||
.result {
|
||||
width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 9px;
|
||||
padding: 9px; background: var(--panel-2); color: var(--text);
|
||||
}
|
||||
.result:hover, .result:focus-visible { border-color: var(--accent); outline: none; }
|
||||
.result strong, .result span { display: block; overflow: hidden; text-overflow: ellipsis; }
|
||||
.result span { color: var(--muted); font-size: 12px; white-space: nowrap; }
|
||||
.canvas { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
|
||||
svg { width: 100%; height: 100%; background:
|
||||
radial-gradient(circle at center, #10243a 0, #07101a 64%);
|
||||
cursor: grab; touch-action: none; user-select: none;
|
||||
}
|
||||
.canvas.dragging svg { cursor: grabbing; }
|
||||
.viewport-controls {
|
||||
position: absolute; z-index: 2; top: 12px; right: 12px;
|
||||
display: grid; grid-template-columns: repeat(3, 36px) auto auto;
|
||||
align-items: center; gap: 6px; padding: 6px;
|
||||
border: 1px solid var(--line); border-radius: 10px;
|
||||
background: rgba(7, 16, 26, .9); box-shadow: 0 5px 18px rgba(0, 0, 0, .28);
|
||||
}
|
||||
.viewport-control {
|
||||
width: 36px; height: 34px; border: 1px solid #31526d; border-radius: 7px;
|
||||
background: #102b3d; color: var(--text); font-weight: 700;
|
||||
}
|
||||
.viewport-control:hover, .viewport-control:focus-visible {
|
||||
border-color: var(--accent); outline: 2px solid transparent;
|
||||
}
|
||||
.zoom-level {
|
||||
min-width: 48px; padding: 0 5px; color: var(--muted);
|
||||
font-variant-numeric: tabular-nums; text-align: right;
|
||||
}
|
||||
.restore-hidden {
|
||||
min-width: 92px; height: 34px; border: 1px solid #31526d; border-radius: 7px;
|
||||
padding: 0 10px; background: #102b3d; color: var(--text); font-size: 11px;
|
||||
}
|
||||
.restore-hidden:hover, .restore-hidden:focus-visible {
|
||||
border-color: var(--accent); outline: 2px solid transparent;
|
||||
}
|
||||
.restore-hidden[hidden] { display: none; }
|
||||
.viewport-hint {
|
||||
position: absolute; z-index: 1; left: 12px; bottom: 12px;
|
||||
padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px;
|
||||
background: rgba(7, 16, 26, .78); color: var(--muted); font-size: 11px;
|
||||
pointer-events: none;
|
||||
}
|
||||
.relationship-key {
|
||||
position: absolute; z-index: 2; top: 12px; left: 12px;
|
||||
width: min(310px, calc(100% - 100px)); max-height: calc(100% - 64px);
|
||||
overflow: hidden; border: 1px solid var(--line); border-radius: 10px;
|
||||
background: rgba(7, 16, 26, .92); box-shadow: 0 5px 18px rgba(0, 0, 0, .28);
|
||||
}
|
||||
.relationship-key summary {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 10px;
|
||||
padding: 8px 10px; color: var(--text); cursor: pointer; font-size: 11px;
|
||||
font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
|
||||
}
|
||||
.relationship-key summary:focus-visible {
|
||||
outline: 2px solid var(--accent); outline-offset: -2px;
|
||||
}
|
||||
.relationship-key summary::marker { color: var(--accent); }
|
||||
.relationship-key-count {
|
||||
color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 0;
|
||||
text-transform: none;
|
||||
}
|
||||
.relationship-key:not([open]) { width: auto; }
|
||||
.relationship-key:not([open]) .relationship-key-count { display: none; }
|
||||
.relationship-key-list {
|
||||
display: grid; gap: 5px; max-height: min(360px, calc(100vh - 190px));
|
||||
overflow: auto; margin: 0; padding: 2px 10px 10px; list-style: none;
|
||||
}
|
||||
.relationship-key-item {
|
||||
display: grid; grid-template-columns: 58px minmax(0, 1fr) auto;
|
||||
gap: 8px; align-items: center; color: var(--text); font-size: 11px;
|
||||
}
|
||||
.relationship-symbol { display: block; width: 58px; height: 14px; overflow: visible; }
|
||||
.relationship-key-item small { color: var(--muted); }
|
||||
.relationship-key-empty { margin: 2px 0; color: var(--muted); font-size: 11px; }
|
||||
.relationship-edge {
|
||||
fill: none; stroke-opacity: .8; stroke-width: 1.7;
|
||||
vector-effect: non-scaling-stroke;
|
||||
}
|
||||
.edge-label {
|
||||
font-size: 9px; font-weight: 650; pointer-events: none;
|
||||
paint-order: stroke; stroke: #07101a; stroke-width: 3px; stroke-linejoin: round;
|
||||
}
|
||||
.node { cursor: pointer; }
|
||||
.node:focus { outline: none; }
|
||||
.node > circle:not(.selection-ring) {
|
||||
stroke-width: 1.8; transition: stroke-width .15s, filter .15s;
|
||||
}
|
||||
.node.root > circle:not(.selection-ring) {
|
||||
stroke-width: 3; filter: drop-shadow(0 0 8px rgba(81, 215, 255, .24));
|
||||
}
|
||||
.node:hover > circle:not(.selection-ring) { stroke: #fff; stroke-width: 3; }
|
||||
.node .selection-ring {
|
||||
fill: none; stroke: #ffd166; stroke-width: 0; opacity: 0;
|
||||
pointer-events: none; vector-effect: non-scaling-stroke;
|
||||
transition: opacity .15s, stroke-width .15s;
|
||||
}
|
||||
.node.selected .selection-ring, .node:focus-visible .selection-ring {
|
||||
stroke-width: 2.5; opacity: 1; filter: drop-shadow(0 0 5px rgba(255, 209, 102, .7));
|
||||
}
|
||||
.node text { fill: var(--text); font-size: 10px; pointer-events: none; }
|
||||
.node .family { fill: var(--muted); font-size: 8px; }
|
||||
.empty {
|
||||
position: absolute; inset: 0; display: grid; place-items: center;
|
||||
color: var(--muted); pointer-events: none;
|
||||
}
|
||||
.empty[hidden] { display: none; }
|
||||
.connection-state {
|
||||
position: absolute; z-index: 6; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
|
||||
width: min(440px, calc(100% - 40px)); border: 1px solid #9a4b59; border-radius: 12px;
|
||||
padding: 18px; background: rgba(32, 13, 20, .96); color: #ffd4dc;
|
||||
box-shadow: 0 18px 60px rgba(0, 0, 0, .45); text-align: center;
|
||||
}
|
||||
.connection-state[hidden] { display: none; }
|
||||
.connection-state strong { display: block; margin-bottom: 5px; }
|
||||
.detail-head { display: flex; align-items: start; gap: 10px; }
|
||||
.detail-head h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
|
||||
.badge {
|
||||
display: inline-block; margin: 4px 5px 0 0; border: 1px solid var(--line);
|
||||
border-radius: 999px; padding: 3px 7px; color: var(--muted); font-size: 11px;
|
||||
}
|
||||
.badge-button { background: #0d2031; }
|
||||
.badge-button:hover, .badge-button:focus-visible {
|
||||
border-color: var(--accent); color: var(--text); outline: none;
|
||||
}
|
||||
.meta { display: grid; gap: 8px; margin: 14px 0; }
|
||||
.meta div { display: grid; grid-template-columns: 82px 1fr; gap: 8px; }
|
||||
.meta dt { color: var(--muted); }
|
||||
.meta dd { margin: 0; overflow-wrap: anywhere; }
|
||||
.summary { color: #c9d9e8; }
|
||||
pre {
|
||||
white-space: pre-wrap; overflow-wrap: anywhere; max-height: 44vh; overflow: auto;
|
||||
padding: 12px; border: 1px solid var(--line); border-radius: 9px;
|
||||
background: #07111c; color: #d6e6f5;
|
||||
}
|
||||
dialog {
|
||||
width: fit-content; height: fit-content;
|
||||
min-width: min(360px, calc(100vw - 20px)); min-height: 0;
|
||||
max-width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
|
||||
padding: 0; overflow: hidden; border: 1px solid #36536e; border-radius: 14px;
|
||||
background: var(--panel); color: var(--text);
|
||||
box-shadow: 0 24px 80px rgba(0, 0, 0, .58); resize: both;
|
||||
}
|
||||
dialog::backdrop { background: rgba(2, 8, 14, .48); }
|
||||
.dialog-shell {
|
||||
display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: fit-content;
|
||||
min-width: min(360px, calc(100vw - 20px)); max-width: min(760px, calc(100vw - 32px));
|
||||
height: 100%; max-height: calc(100vh - 32px); overflow: hidden;
|
||||
}
|
||||
.dialog-head {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 12px;
|
||||
padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2);
|
||||
cursor: move; touch-action: none; user-select: none;
|
||||
}
|
||||
.dialog-head strong { min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
|
||||
.dialog-close {
|
||||
width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
|
||||
background: #102b3d; color: var(--text); font-size: 21px; line-height: 1;
|
||||
}
|
||||
.dialog-close:hover, .dialog-close:focus-visible {
|
||||
border-color: var(--accent); outline: 2px solid transparent;
|
||||
}
|
||||
.dialog-body { min-height: 0; overflow: auto; padding: 18px; }
|
||||
.dialog-body pre { max-height: none; }
|
||||
dialog.compact-dialog {
|
||||
position: fixed; inset: auto; margin: 0; width: min(400px, calc(100vw - 24px));
|
||||
height: auto; min-width: 0; min-height: 0; max-height: min(560px, calc(100vh - 24px));
|
||||
resize: none; border-color: rgba(91, 137, 169, .78); background: rgba(7, 18, 29, .82);
|
||||
box-shadow: 0 14px 42px rgba(0, 0, 0, .42);
|
||||
}
|
||||
.compact-dialog .dialog-shell { grid-template-rows: auto auto; }
|
||||
.compact-dialog .dialog-body { padding: 14px 16px; }
|
||||
.compact-dialog .dialog-body pre { display: none; }
|
||||
.compact-dialog .detail-head h2 { font-size: 16px; }
|
||||
.compact-dialog .meta { margin: 12px 0 0; gap: 6px; }
|
||||
.compact-dialog .meta div { grid-template-columns: 66px 1fr; }
|
||||
.dialog-actions {
|
||||
display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 16px;
|
||||
border-top: 1px solid var(--line); background: var(--panel-2);
|
||||
}
|
||||
.compact-dialog .dialog-actions { padding: 9px 12px; background: rgba(12, 35, 51, .72); }
|
||||
.source-dialog {
|
||||
width: min(920px, calc(100vw - 32px)); height: min(760px, calc(100vh - 32px));
|
||||
}
|
||||
.source-dialog .dialog-shell {
|
||||
width: 100%; max-width: none; min-width: 0; height: 100%;
|
||||
}
|
||||
.source-code {
|
||||
display: block; margin: 0; min-width: max-content; font: 12px/1.55 ui-monospace, monospace;
|
||||
counter-reset: source-line;
|
||||
}
|
||||
.source-line { display: block; min-height: 1.55em; padding: 0 12px 0 58px; position: relative; }
|
||||
.source-line::before {
|
||||
position: absolute; left: 0; width: 46px; color: #63809a; text-align: right;
|
||||
content: attr(data-line);
|
||||
}
|
||||
.source-line.target { background: rgba(81, 215, 255, .16); color: #fff; }
|
||||
.error { color: #ff9aac; }
|
||||
@media (max-width: 980px) {
|
||||
:root { --left-width: 240px; --right-width: 260px; }
|
||||
.layout {
|
||||
grid-template-columns: var(--left-width) 7px minmax(280px, 1fr);
|
||||
}
|
||||
.right, #right-resizer { display: none; }
|
||||
.stats { display: none; }
|
||||
}
|
||||
@media (max-width: 680px) {
|
||||
header h1 { font-size: 14px; }
|
||||
.status { display: none; }
|
||||
.layout {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-rows: minmax(280px, 42vh) minmax(280px, 1fr);
|
||||
}
|
||||
.left { overflow: auto; padding: 12px; }
|
||||
.results { overflow: visible; }
|
||||
#left-resizer { display: none; }
|
||||
.viewport-hint { display: none; }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after {
|
||||
scroll-behavior: auto !important;
|
||||
transition-duration: .01ms !important;
|
||||
transition-delay: 0s !important;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue