Initial commit
This commit is contained in:
commit
57fc3525eb
7311 files changed
+1291398
No files matched your search
@@ -0,0 +1,701 @@
|
||||
:host {
|
||||
display: block;
|
||||
color: var(--uwa-ink, #33402c);
|
||||
font:
|
||||
13px/1.5 system-ui,
|
||||
-apple-system,
|
||||
"Segoe UI",
|
||||
sans-serif;
|
||||
--ws-paper: var(--uwa-paper, #f7f3ea);
|
||||
--ws-card: var(--uwa-paper-strong, #fffdf8);
|
||||
--ws-ink: var(--uwa-ink, #33402c);
|
||||
--ws-muted: var(--uwa-muted, #777b6c);
|
||||
--ws-line: var(--uwa-line, #dddccd);
|
||||
--ws-accent: var(--uwa-olive, #5d6b4d);
|
||||
}
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
button {
|
||||
cursor: pointer;
|
||||
}
|
||||
button:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
button:focus-visible,
|
||||
input:focus-visible,
|
||||
textarea:focus-visible,
|
||||
select:focus-visible {
|
||||
outline: 2px solid var(--ws-accent);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
button {
|
||||
border: 1px solid var(--ws-line);
|
||||
border-radius: 7px;
|
||||
background: var(--ws-card);
|
||||
padding: 6px 10px;
|
||||
}
|
||||
button:hover:not(:disabled) {
|
||||
border-color: var(--ws-accent);
|
||||
}
|
||||
.studio {
|
||||
border: 1px solid var(--ws-line);
|
||||
border-radius: 14px;
|
||||
background: var(--ws-paper);
|
||||
overflow: hidden;
|
||||
}
|
||||
.head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 14px;
|
||||
padding: 20px 22px;
|
||||
border-bottom: 1px solid var(--ws-line);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.eyebrow {
|
||||
font-size: 10px;
|
||||
letter-spacing: 2px;
|
||||
color: var(--ws-muted);
|
||||
font-weight: 700;
|
||||
}
|
||||
.head h2 {
|
||||
font-size: 21px;
|
||||
margin: 3px 0;
|
||||
font-weight: 650;
|
||||
letter-spacing: -0.6px;
|
||||
}
|
||||
.head p {
|
||||
margin: 4px 0 0;
|
||||
color: var(--ws-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.primary {
|
||||
background: var(--ws-accent);
|
||||
color: var(--ws-card);
|
||||
border-color: var(--ws-accent);
|
||||
}
|
||||
.tabs {
|
||||
display: flex;
|
||||
gap: 7px;
|
||||
padding: 10px 20px;
|
||||
border-bottom: 1px solid var(--ws-line);
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.tabs button {
|
||||
background: none;
|
||||
border-color: transparent;
|
||||
}
|
||||
.tabs button.active {
|
||||
background: var(--ws-card);
|
||||
border-color: var(--ws-line);
|
||||
font-weight: 650;
|
||||
}
|
||||
.counter {
|
||||
margin-left: auto;
|
||||
color: var(--ws-muted);
|
||||
font-size: 11px;
|
||||
}
|
||||
.workspace {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 290px;
|
||||
min-height: 480px;
|
||||
}
|
||||
.canvas {
|
||||
overflow: auto;
|
||||
padding: 26px 24px;
|
||||
max-height: 720px;
|
||||
background-image: radial-gradient(var(--ws-line) 0.7px, transparent 0.7px);
|
||||
background-size: 16px 16px;
|
||||
}
|
||||
.sequence {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
position: relative;
|
||||
min-width: 160px;
|
||||
gap: 0;
|
||||
max-width: 900px;
|
||||
margin: auto;
|
||||
}
|
||||
.sequence.root {
|
||||
min-width: 250px;
|
||||
}
|
||||
.unit {
|
||||
position: relative;
|
||||
margin: 0 0 20px;
|
||||
z-index: 1;
|
||||
}
|
||||
.node {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 11px;
|
||||
text-align: left;
|
||||
background: var(--ws-card);
|
||||
padding: 12px 13px;
|
||||
border: 1px solid var(--ws-line);
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 3px #00000003;
|
||||
position: relative;
|
||||
}
|
||||
.node.selected {
|
||||
border-color: var(--ws-accent);
|
||||
box-shadow: 0 0 0 2px color-mix(in srgb, var(--ws-accent) 15%, transparent);
|
||||
}
|
||||
.node.control {
|
||||
border-left: 3px solid var(--ws-accent);
|
||||
}
|
||||
.node.failed {
|
||||
border-color: #b3634d;
|
||||
}
|
||||
.node.completed,
|
||||
.node.captured,
|
||||
.node.assigned {
|
||||
border-right: 3px solid var(--ws-accent);
|
||||
}
|
||||
.symbol {
|
||||
flex-shrink: 0;
|
||||
width: 29px;
|
||||
height: 29px;
|
||||
background: var(--ws-paper);
|
||||
border-radius: 8px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
font-size: 16px;
|
||||
color: var(--ws-accent);
|
||||
}
|
||||
.node-info {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
.node-name {
|
||||
font-size: 12px;
|
||||
font-weight: 650;
|
||||
display: block;
|
||||
}
|
||||
.node-description {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
color: var(--ws-muted);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 360px;
|
||||
}
|
||||
.node-code {
|
||||
font-size: 9px;
|
||||
font-family: monospace;
|
||||
color: var(--ws-muted);
|
||||
align-self: flex-start;
|
||||
}
|
||||
.inspector {
|
||||
border-left: 1px solid var(--ws-line);
|
||||
background: var(--ws-card);
|
||||
padding: 20px;
|
||||
overflow: auto;
|
||||
max-height: 720px;
|
||||
}
|
||||
.inspector h3 {
|
||||
font-size: 15px;
|
||||
margin: 5px 0 10px;
|
||||
}
|
||||
.hint {
|
||||
color: var(--ws-muted);
|
||||
font-size: 11px;
|
||||
line-height: 1.8;
|
||||
margin: 8px 0 17px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.field {
|
||||
display: block;
|
||||
margin: 12px 0;
|
||||
font-size: 11px;
|
||||
font-weight: 550;
|
||||
}
|
||||
.field > span {
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.field input,
|
||||
.field select,
|
||||
.field textarea {
|
||||
width: 100%;
|
||||
background: var(--ws-paper);
|
||||
border: 1px solid var(--ws-line);
|
||||
border-radius: 6px;
|
||||
padding: 8px;
|
||||
min-height: 34px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.field textarea {
|
||||
resize: vertical;
|
||||
min-height: 72px;
|
||||
font-family: ui-monospace, monospace;
|
||||
}
|
||||
.field input[type="checkbox"] {
|
||||
width: auto;
|
||||
min-height: 0;
|
||||
vertical-align: middle;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.pair {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 10px;
|
||||
}
|
||||
.danger {
|
||||
color: #a55d43;
|
||||
}
|
||||
.divider {
|
||||
border: 0;
|
||||
border-top: 1px solid var(--ws-line);
|
||||
margin: 20px 0;
|
||||
}
|
||||
.inspector details {
|
||||
margin: 15px 0;
|
||||
}
|
||||
.inspector summary {
|
||||
font-size: 11px;
|
||||
cursor: pointer;
|
||||
color: var(--ws-muted);
|
||||
}
|
||||
.panel {
|
||||
padding: 24px;
|
||||
min-height: 480px;
|
||||
}
|
||||
.panel h3 {
|
||||
font-size: 16px;
|
||||
margin: 0 0 6px;
|
||||
}
|
||||
.empty {
|
||||
padding: 35px 10px;
|
||||
text-align: center;
|
||||
color: var(--ws-muted);
|
||||
}
|
||||
.palette {
|
||||
padding: 20px;
|
||||
background: var(--ws-card);
|
||||
border-bottom: 1px solid var(--ws-line);
|
||||
}
|
||||
.palette-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
||||
gap: 8px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.palette button {
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
}
|
||||
.palette small {
|
||||
display: block;
|
||||
color: var(--ws-muted);
|
||||
font-size: 10px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.palette h4 {
|
||||
margin: 8px 0;
|
||||
font-size: 11px;
|
||||
color: var(--ws-muted);
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
.banner {
|
||||
padding: 9px 20px;
|
||||
font-size: 12px;
|
||||
border-bottom: 1px solid var(--ws-line);
|
||||
background: var(--ws-card);
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.banner.error {
|
||||
color: #a55d43;
|
||||
}
|
||||
.table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 12px;
|
||||
}
|
||||
.table th,
|
||||
.table td {
|
||||
text-align: left;
|
||||
padding: 12px 10px;
|
||||
border-bottom: 1px solid var(--ws-line);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.table th {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
color: var(--ws-muted);
|
||||
}
|
||||
code {
|
||||
font:
|
||||
11px ui-monospace,
|
||||
monospace;
|
||||
}
|
||||
.test-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 18px;
|
||||
max-width: 720px;
|
||||
}
|
||||
.trace {
|
||||
margin-top: 20px;
|
||||
max-height: 380px;
|
||||
overflow: auto;
|
||||
}
|
||||
.trace button {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
gap: 12px;
|
||||
border: 0;
|
||||
border-bottom: 1px solid var(--ws-line);
|
||||
border-radius: 0;
|
||||
padding: 9px;
|
||||
}
|
||||
.trace .status {
|
||||
margin-left: auto;
|
||||
color: var(--ws-accent);
|
||||
}
|
||||
.maprow {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 14px 1fr 28px;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
margin: 5px 0;
|
||||
}
|
||||
.maprow input {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
background: var(--ws-paper);
|
||||
border: 1px solid var(--ws-line);
|
||||
border-radius: 5px;
|
||||
padding: 6px;
|
||||
font-size: 11px;
|
||||
}
|
||||
.maprow button {
|
||||
padding: 4px;
|
||||
}
|
||||
.footer {
|
||||
padding: 10px 20px;
|
||||
border-top: 1px solid var(--ws-line);
|
||||
font-size: 10px;
|
||||
color: var(--ws-muted);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
}
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
.row-actions {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
@media (max-width: 850px) {
|
||||
.workspace {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
.inspector {
|
||||
border-left: 0;
|
||||
border-top: 1px solid var(--ws-line);
|
||||
max-height: 500px;
|
||||
}
|
||||
.canvas {
|
||||
max-height: 560px;
|
||||
}
|
||||
.head {
|
||||
padding: 17px;
|
||||
}
|
||||
.test-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.counter {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:host([data-auto-dark]) {
|
||||
--ws-paper: #252b24;
|
||||
--ws-card: #30372d;
|
||||
--ws-ink: #e0e3d5;
|
||||
--ws-muted: #adb59e;
|
||||
--ws-line: #495241;
|
||||
--ws-accent: #a2b288;
|
||||
color: var(--ws-ink);
|
||||
}
|
||||
}
|
||||
:host([data-dark]) {
|
||||
--ws-paper: #252b24;
|
||||
--ws-card: #30372d;
|
||||
--ws-ink: #e0e3d5;
|
||||
--ws-muted: #adb59e;
|
||||
--ws-line: #495241;
|
||||
--ws-accent: #a2b288;
|
||||
color: var(--ws-ink);
|
||||
}
|
||||
|
||||
/* The injected canvas is movable; dashboard instances keep normal header behavior. */
|
||||
:host([data-draggable]) .head { cursor: grab; touch-action: none; user-select: none; }
|
||||
:host([data-draggable]) .head .eyebrow::after { content: ' · 拖动标题移动'; letter-spacing: 0; }
|
||||
|
||||
/* A quiet canvas first; settings appear only for the selected step. */
|
||||
.head { padding: 10px 18px; justify-content: flex-end; }
|
||||
.drag-handle { margin-right:auto; color:var(--ws-muted); font-size:11px; user-select:none; }
|
||||
.workspace { position:relative; grid-template-columns:minmax(0,1fr) 0px; transition:grid-template-columns .32s cubic-bezier(.22,.8,.3,1); }
|
||||
.workspace.is-inspecting { grid-template-columns:minmax(0,1fr) 290px; }
|
||||
.inspector-slot { min-width:0; overflow:hidden; position:relative; opacity:0; transform:translateX(18px); transition:opacity .24s ease,transform .32s ease; pointer-events:none; }
|
||||
.is-inspecting .inspector-slot { opacity:1; transform:translateX(0); pointer-events:auto; }
|
||||
.inspector { position:absolute; inset:0; width:290px; height:100%; padding:16px 20px; }
|
||||
.inspector-close { display:block; margin:0 0 18px auto; font-size:11px; color:var(--ws-muted); background:transparent; }
|
||||
@media (max-width:850px) {
|
||||
.workspace,.workspace.is-inspecting { grid-template-columns:minmax(0,1fr) 0px; }
|
||||
.inspector-slot { position:absolute; right:0; top:0; bottom:0; width:min(310px,100%); z-index:8; transform:translateX(100%); box-shadow:-12px 0 35px #00000012; }
|
||||
.inspector { width:100%; max-height:100%; border-top:0; border-left:1px solid var(--ws-line); }
|
||||
.head { padding:10px 12px; }
|
||||
.canvas { padding:24px 16px; }
|
||||
}
|
||||
@media (prefers-reduced-motion:reduce) { .workspace,.inspector-slot { transition:none; } }
|
||||
|
||||
/* Reading-first workflow: collapsible stages, vertically ordered alternatives. */
|
||||
[hidden] { display:none !important; }
|
||||
:host { color-scheme:light; }
|
||||
:host([data-dark]) { color-scheme:dark; }
|
||||
.canvas,.inspector,.panel { scrollbar-width:thin; scrollbar-color:var(--ws-line) transparent; }
|
||||
.node-row { position:relative; }
|
||||
.node-info { min-width:0; }
|
||||
.node-name { line-height:1.65; overflow-wrap:anywhere; }
|
||||
.node-description { max-width:none; line-height:1.65; font-size:11px; }
|
||||
.flow-view-tools { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:10px; color:var(--ws-muted); margin:-10px 0 24px; }
|
||||
.flow-view-tools > div { display:flex; gap:5px; }
|
||||
.flow-view-tools button { font-size:10px; padding:4px 8px; background:var(--ws-paper); }
|
||||
.note-card .node { align-items:flex-start; border-left:3px solid var(--ws-accent); }
|
||||
.note-card .node-description { white-space:pre-wrap; overflow:visible; text-overflow:clip; margin-top:5px; }
|
||||
.note-card .symbol { font-size:15px; }
|
||||
.note-card.tone-warning .node { border-left-color:#b19048; }
|
||||
.note-card.tone-danger .node { border-left-color:#ba755d; }
|
||||
.note-card.tone-success .node { border-left-color:#79915b; }
|
||||
.case-editor { margin:14px 0; padding:12px 10px; border:1px solid var(--ws-line); border-radius:9px; background:var(--ws-paper); }
|
||||
.case-heading { display:flex; align-items:center; justify-content:space-between; gap:4px; font-size:11px; }
|
||||
.case-heading button { padding:3px 5px; font-size:10px; }
|
||||
.panel { max-height:800px; overflow:auto; }
|
||||
.panel-intro { margin-bottom:22px; }
|
||||
.panel-intro h3 { font-size:20px; margin:6px 0 8px; }
|
||||
.panel-kicker { color:var(--ws-muted); font-size:10px; letter-spacing:1px; }
|
||||
.param-section { margin:20px 0; padding-top:18px; border-top:1px solid var(--ws-line); }
|
||||
.param-section h4,.run-option h4,.trace-section h4 { font-size:14px; margin:0 0 6px; }
|
||||
.section-heading { display:flex; align-items:flex-start; gap:12px; margin-bottom:12px; }
|
||||
.section-heading > div { flex:1; }
|
||||
.section-heading p { color:var(--ws-muted); font-size:11px; margin:4px 0; }
|
||||
.section-heading > button { font-size:10px; }
|
||||
.section-number { color:var(--ws-accent); background:var(--ws-card); border:1px solid var(--ws-line); width:28px; height:28px; display:grid; place-items:center; border-radius:8px; font-size:10px; flex-shrink:0; }
|
||||
.param-card { display:flex; align-items:center; gap:14px; padding:14px; background:var(--ws-card); border:1px solid var(--ws-line); border-radius:9px; margin:8px 0; }
|
||||
.param-label { flex:1; min-width:0; }
|
||||
.param-label strong,.param-label code,.param-label small { display:block; }
|
||||
.param-label strong { font-size:12px; }
|
||||
.param-label code { font-size:10px; color:var(--ws-muted); margin:3px 0; overflow-wrap:anywhere; }
|
||||
.param-label small { font-size:10px; color:var(--ws-muted); overflow-wrap:anywhere; }
|
||||
.param-card > button { font-size:10px; flex-shrink:0; }
|
||||
.param-value { width:40%; min-width:100px; }
|
||||
.param-value input:not([type=checkbox]),.param-value textarea,.sample-field input,.sample-field textarea,.sample-field > select,.sample-add input { display:block; width:100%; min-width:0; background:var(--ws-paper); border:1px solid var(--ws-line); border-radius:7px; padding:8px 10px; font:12px system-ui; color:var(--ws-ink); }
|
||||
.param-value textarea { min-height:75px; resize:vertical; }
|
||||
.param-boolean { display:flex; align-items:center; gap:8px; font-size:12px; }
|
||||
input[type=checkbox] { accent-color:var(--ws-accent); }
|
||||
.value-badge { background:var(--ws-paper); border:1px solid var(--ws-line); border-radius:20px; padding:4px 9px; font-size:10px; color:var(--ws-muted); white-space:nowrap; }
|
||||
.context-cards,.run-options { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
|
||||
.context-cards > div,.run-option { border:1px solid var(--ws-line); padding:16px; border-radius:10px; background:var(--ws-card); }
|
||||
.context-cards strong,.context-cards code { display:block; }
|
||||
.context-cards p,.run-option p { font-size:11px; line-height:1.8; color:var(--ws-muted); margin:8px 0 0; }
|
||||
.context-cards code { margin-top:6px; color:var(--ws-muted); }
|
||||
.technical { margin:15px 0; border-top:1px solid var(--ws-line); padding-top:12px; }
|
||||
.technical summary { font-size:11px; color:var(--ws-muted); cursor:pointer; }
|
||||
.technical pre { white-space:pre-wrap; overflow-wrap:anywhere; font-size:10px; max-height:260px; overflow:auto; }
|
||||
.section-empty { color:var(--ws-muted); font-size:11px; padding:12px 0; }
|
||||
.run-option.chosen { border-color:var(--ws-accent); }
|
||||
.run-option h4 { margin-top:12px; }
|
||||
.run-option button { margin-top:12px; font-size:11px; }
|
||||
.sample-field { padding:12px 14px; border:1px solid var(--ws-line); background:var(--ws-card); border-radius:9px; margin:8px 0; }
|
||||
.sample-label { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
|
||||
.sample-label strong { font-size:12px; }
|
||||
.sample-label code { font-size:10px; color:var(--ws-muted); }
|
||||
.sample-label > select { margin-left:auto; font-size:10px; border:0; background:var(--ws-paper); padding:3px; border-radius:4px; }
|
||||
.sample-add { display:flex; gap:8px; margin:12px 0; }
|
||||
.sample-add button { white-space:nowrap; font-size:11px; }
|
||||
.sample-warning { color:#b0774b; font-size:11px; }
|
||||
.run-actions { display:flex; align-items:center; gap:14px; margin:22px 0; }
|
||||
.run-actions > span { font-size:11px; color:var(--ws-muted); }
|
||||
.trace-section { border-top:1px solid var(--ws-line); padding-top:20px; }
|
||||
.trace { margin-top:10px; }
|
||||
.trace button { align-items:flex-start; border:1px solid var(--ws-line); border-radius:8px; margin:6px 0; padding:12px; }
|
||||
.trace-index { width:23px; font-size:10px; color:var(--ws-muted); }
|
||||
.trace-copy { min-width:0; flex:1; }
|
||||
.trace-copy strong { display:block; font-size:12px; }
|
||||
.trace-copy small { display:block; font-size:11px; line-height:1.7; color:var(--ws-muted); margin-top:4px; }
|
||||
.trace .status { font-size:10px; }
|
||||
@media(max-width:850px) {
|
||||
.node-code { display:none; }
|
||||
.param-card { flex-wrap:wrap; gap:10px; }
|
||||
.param-value { flex-basis:100%; order:3; }
|
||||
.context-cards,.run-options,.test-grid { grid-template-columns:1fr; }
|
||||
.panel { padding:18px 14px; }
|
||||
.flow-view-tools { flex-wrap:wrap; }
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------
|
||||
Tree canvas: every list is a rail, every step hangs off it with an
|
||||
elbow connector. Children start under their parent's symbol, branch
|
||||
lanes are colour-coded (✓ then / ✗ else / ! fallback) so the flow
|
||||
reads like a real tree instead of a flat stack of cards.
|
||||
------------------------------------------------------------------ */
|
||||
:host {
|
||||
--ws-rail: color-mix(in srgb, var(--ws-muted) 45%, var(--ws-paper));
|
||||
--ws-tint: color-mix(in srgb, var(--ws-accent) 12%, var(--ws-card));
|
||||
--ws-amber: #b08a3c;
|
||||
--ws-danger: #b3634d;
|
||||
--tree-indent: 26px; /* elbow length: rail → card edge */
|
||||
--tree-anchor: 24px; /* card padding-left 11px + symbol 26px / 2 */
|
||||
--tree-elbow: 26px; /* card padding-top 12px + symbol 26px / 2 +1 */
|
||||
--tree-gap: 12px; /* vertical gap between sibling items */
|
||||
--tree-lead: 10px; /* gap between a parent card and its children */
|
||||
}
|
||||
:host([data-dark]) { --ws-rail: color-mix(in srgb, var(--ws-muted) 52%, var(--ws-paper)); --ws-amber: #d4b060; --ws-danger: #d98a72; }
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:host([data-auto-dark]) { --ws-rail: color-mix(in srgb, var(--ws-muted) 52%, var(--ws-paper)); --ws-amber: #d4b060; --ws-danger: #d98a72; }
|
||||
}
|
||||
.canvas { background-image: radial-gradient(color-mix(in srgb, var(--ws-line) 80%, transparent) 0.8px, transparent 0.8px); background-size: 18px 18px; }
|
||||
.tree { max-width: 820px; margin: 0 auto; padding: 2px 0 6px; }
|
||||
.sequence, .sequence.root { display: block; position: relative; min-width: 0; max-width: none; margin: 0; padding: 0 0 0 var(--tree-indent); }
|
||||
|
||||
/* Connectors ------------------------------------------------------ */
|
||||
.tree-item { position: relative; min-width: 0; }
|
||||
.tree-item::before, .tree-item::after { content: ""; position: absolute; left: calc(-1 * var(--tree-indent)); box-sizing: border-box; pointer-events: none; }
|
||||
.tree-item::before { top: var(--elbow, var(--tree-elbow)); bottom: 0; width: 2px; background: var(--lane, var(--ws-rail)); }
|
||||
.tree-item::after { top: calc(-1 * var(--lead, 0px)); width: var(--tree-indent); height: calc(var(--elbow, var(--tree-elbow)) + var(--lead, 0px)); border: 0 solid var(--lane, var(--ws-rail)); border-left-width: 2px; border-bottom-width: 2px; border-bottom-left-radius: 10px; }
|
||||
.tree-item:last-child::before { display: none; }
|
||||
.tree-item:has(> .node-row > .node.selected)::after { border-color: var(--ws-accent); }
|
||||
|
||||
/* Start / end of the main trunk */
|
||||
.endpoint.tree-item { --elbow: 11px; display: flex; align-items: center; gap: 10px; width: auto; min-height: 22px; margin: 0; padding: 0 0 10px; border: 0; border-radius: 0; background: none; font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--ws-muted); text-align: left; }
|
||||
.endpoint .port { position: absolute; left: calc(-1 * var(--tree-indent) - 4px); top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ws-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ws-accent) 22%, transparent); }
|
||||
.endpoint.start::after { display: none; }
|
||||
.endpoint.end { margin: 0; padding: 12px 0 0; }
|
||||
.endpoint.end .port { top: 18px; }
|
||||
.endpoint.end::before { display: none; }
|
||||
.endpoint.end::after { top: 0; width: 2px; height: 23px; border: 0; border-radius: 0; background: var(--ws-rail); }
|
||||
|
||||
/* Step cards ------------------------------------------------------ */
|
||||
.unit { margin: 0; padding: 0 0 var(--tree-gap); z-index: auto; }
|
||||
.node-row { position: relative; }
|
||||
.node { align-items: flex-start; gap: 11px; min-height: 0; padding: 12px 12px 11px 11px; border-radius: 11px; box-shadow: 0 1px 2px #0000000a; transition: border-color .15s ease, box-shadow .15s ease; }
|
||||
.node:hover:not(:disabled) { border-color: color-mix(in srgb, var(--ws-accent) 55%, var(--ws-line)); }
|
||||
.node.selected { border-color: var(--ws-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ws-accent) 18%, transparent); }
|
||||
.symbol { position: relative; width: 26px; height: 26px; border-radius: 7px; font-size: 14px; background: var(--ws-tint); color: var(--ws-accent); }
|
||||
.symbol b { position: relative; z-index: 1; font-weight: 500; font-style: normal; }
|
||||
.symbol.diamond { background: transparent; }
|
||||
.symbol.diamond::before, .symbol.diamond::after { content: ""; position: absolute; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
|
||||
.symbol.diamond::before { inset: -4px; background: var(--ws-accent); }
|
||||
.symbol.diamond::after { inset: -2px; background: var(--ws-tint); }
|
||||
.symbol.diamond b { font-weight: 700; font-size: 13px; }
|
||||
.node-info { display: block; min-width: 0; flex: 1; }
|
||||
.node-head { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
|
||||
.node-index { flex-shrink: 0; margin-top: 2px; padding: 2px 5px; border: 1px solid color-mix(in srgb, var(--ws-accent) 35%, transparent); border-radius: 5px; background: var(--ws-tint); color: var(--ws-accent); font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .5px; }
|
||||
.node-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
|
||||
.node-code { flex-shrink: 0; align-self: flex-start; margin-top: 1px; padding: 1px 8px; border: 1px solid var(--ws-line); border-radius: 20px; font: 10px/1.6 system-ui, sans-serif; color: var(--ws-muted); white-space: nowrap; }
|
||||
.node.control .node-code { border-color: color-mix(in srgb, var(--ws-accent) 40%, transparent); color: var(--ws-accent); }
|
||||
.node-description { display: block; margin-top: 3px; max-width: none; font-size: 11px; line-height: 1.65; color: var(--ws-muted); white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
|
||||
.node.control { border-left: 3px solid var(--ws-accent); }
|
||||
.node.control.selected { border-left-color: var(--ws-accent); }
|
||||
.node.failed { border-color: var(--ws-danger); }
|
||||
|
||||
/* Stages (GROUP / SWITCH / TRY) look like chapter headers */
|
||||
.stage > .node-row > .node { padding-right: 116px; background: color-mix(in srgb, var(--ws-accent) 7%, var(--ws-card)); border-color: color-mix(in srgb, var(--ws-accent) 32%, var(--ws-line)); }
|
||||
.stage > .node-row > .node .symbol { background: var(--ws-accent); color: var(--ws-card); }
|
||||
.stage > .node-row > .node.kind-SWITCH .symbol.diamond { background: transparent; color: var(--ws-accent); }
|
||||
.stage > .node-row > .node .node-name { font-size: 13px; }
|
||||
.stage .node-code { display: none; }
|
||||
.stage-toggle { position: absolute; right: 10px; top: 11px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid color-mix(in srgb, var(--ws-accent) 35%, var(--ws-line)); border-radius: 20px; background: var(--ws-card); color: var(--ws-accent); font-size: 11px; line-height: 1.4; white-space: nowrap; }
|
||||
.stage-toggle .chev { font-size: 12px; line-height: 1; }
|
||||
.stage-toggle:hover { background: var(--ws-tint); }
|
||||
|
||||
/* Notes */
|
||||
.note-card .node { align-items: flex-start; border-left: 3px solid var(--ws-accent); }
|
||||
.note-card .node-description { white-space: pre-wrap; margin-top: 4px; }
|
||||
.note-card .symbol { font-size: 14px; font-weight: 700; }
|
||||
.note-card.tone-warning .node { border-left-color: var(--ws-amber); }
|
||||
.note-card.tone-warning .symbol { background: color-mix(in srgb, var(--ws-amber) 16%, var(--ws-card)); color: var(--ws-amber); }
|
||||
.note-card.tone-danger .node { border-left-color: var(--ws-danger); }
|
||||
.note-card.tone-danger .symbol { background: color-mix(in srgb, var(--ws-danger) 16%, var(--ws-card)); color: var(--ws-danger); }
|
||||
.note-card.tone-success .node { border-left-color: var(--ws-accent); }
|
||||
|
||||
/* Children hang under the parent's symbol ------------------------- */
|
||||
.stage-content { --lane: initial; margin-left: var(--tree-anchor); padding-top: var(--tree-lead); }
|
||||
.branches, .branches.lanes, .branches.plain { display: block; margin: 0; padding: 0 0 0 var(--tree-indent); border: 0; border-radius: 0; background: none; }
|
||||
.branches.plain { padding-left: 0; }
|
||||
.branches.lanes > .tree-item:first-child, .branch.plain > .sequence > .tree-item:first-child { --lead: var(--tree-lead); }
|
||||
.branch { min-width: 0; margin: 0; padding: 0; border: 0; }
|
||||
.branch.plain > .sequence { padding-top: 0; }
|
||||
.branch.tree-item { --elbow: 12px; padding-bottom: var(--tree-gap); }
|
||||
.branch.kind-then, .branch.kind-steps, .branch.kind-case { --pill: var(--ws-accent); }
|
||||
.branch.kind-else, .branch.kind-default { --pill: var(--ws-amber); }
|
||||
.branch.kind-fallback { --pill: var(--ws-danger); }
|
||||
.branch-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 24px; margin: 0; padding: 0; color: var(--ws-muted); font-size: 11px; letter-spacing: 0; text-align: left; justify-content: flex-start; }
|
||||
.branch-name .port { display: inline-grid; place-items: center; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--pill); color: var(--ws-card); font: 700 11px/1 system-ui, sans-serif; font-style: normal; }
|
||||
.branch-name > span { padding: 3px 10px; border: 1px solid color-mix(in srgb, var(--pill) 55%, transparent); border-radius: 20px; background: color-mix(in srgb, var(--pill) 10%, var(--ws-card)); color: var(--pill); font-size: 11px; font-weight: 650; line-height: 1.4; }
|
||||
.branch-name small { font-size: 10.5px; color: var(--ws-muted); overflow-wrap: anywhere; }
|
||||
.branch.taken .branch-name > span { background: var(--pill); color: var(--ws-card); }
|
||||
.branch.taken .branch-name::after { content: "本次命中"; font-size: 10px; color: var(--pill); }
|
||||
.branch:not(.plain) > .sequence { --lane: color-mix(in srgb, var(--pill) 72%, var(--ws-rail)); margin-left: 10px; padding-top: 6px; }
|
||||
.branch:not(.plain) > .sequence > .tree-item:first-child { --lead: 6px; }
|
||||
.branch.empty { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
|
||||
.empty-route { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 0; font-size: 11px; color: var(--ws-muted); }
|
||||
.empty-route .add { padding: 2px 8px; border: 1px dashed color-mix(in srgb, var(--ws-muted) 50%, transparent); border-radius: 20px; background: transparent; font-size: 10.5px; color: var(--ws-muted); }
|
||||
.empty-route .add:hover, .empty-route .add:focus-visible { color: var(--ws-accent); border-color: var(--ws-accent); background: var(--ws-card); }
|
||||
.decision-note.tree-item { --elbow: 10px; margin: 0; padding: 0 0 10px 6px; font-size: 11px; line-height: 20px; color: var(--ws-muted); }
|
||||
.merge.tree-item { --elbow: 10px; width: max-content; max-width: 100%; margin: 0; padding: 0 0 2px 6px; background: none; font-size: 10.5px; line-height: 20px; text-align: left; color: var(--ws-muted); }
|
||||
|
||||
/* Ghost leaf at the end of every list */
|
||||
.add.tree-item { --elbow: 13px; display: flex; align-items: center; width: max-content; max-width: 100%; min-height: 26px; margin: 0; padding: 3px 11px; border: 1px dashed color-mix(in srgb, var(--ws-muted) 50%, transparent); border-radius: 8px; background: transparent; font-size: 11px; color: var(--ws-muted); opacity: 1; z-index: auto; align-self: auto; }
|
||||
.add.tree-item:hover, .add.tree-item:focus-visible { color: var(--ws-accent); border-color: var(--ws-accent); background: var(--ws-card); }
|
||||
|
||||
/* Legend */
|
||||
.flow-view-tools { margin: -8px 0 22px; }
|
||||
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; }
|
||||
.legend em { display: inline-flex; align-items: center; gap: 6px; font-style: normal; }
|
||||
.legend em:last-child { color: var(--ws-muted); opacity: .8; }
|
||||
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--ws-accent); }
|
||||
.lg.decide { border-radius: 0; transform: rotate(45deg) scale(.85); background: var(--ws-tint); box-shadow: 0 0 0 2px var(--ws-accent); }
|
||||
.lg.then { border-radius: 50%; }
|
||||
.lg.else { border-radius: 50%; background: var(--ws-amber); }
|
||||
|
||||
@media (max-width: 850px) {
|
||||
:host { --tree-indent: 12px; --tree-anchor: 21px; --tree-elbow: 23px; --tree-gap: 10px; --tree-lead: 8px; }
|
||||
.canvas { padding: 20px 14px; }
|
||||
.node { gap: 9px; padding: 10px 9px 9px 9px; }
|
||||
.symbol { width: 24px; height: 24px; font-size: 13px; }
|
||||
.node-code { display: none; }
|
||||
.node-index { display: none; }
|
||||
.stage > .node-row > .node { padding-right: 46px; }
|
||||
.stage-toggle .toggle-text { display: none; }
|
||||
.stage-toggle { padding: 4px 7px; top: 9px; right: 8px; }
|
||||
.branch-name .port { width: 18px; height: 18px; font-size: 10px; }
|
||||
.branch:not(.plain) > .sequence { margin-left: 8px; }
|
||||
.legend em:last-child { display: none; }
|
||||
}
|
||||
Reference in new issue
Block a user