fix: migrate rNetwork components to theme variables for dark/light mode
Replace 60+ hardcoded hex colors in folk-graph-viewer and folk-crm-view with var(--rs-*) CSS variables. Add city/location data to graph API query so graph nodes show the same location info as the CRM view. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ebecfe4983
commit
497bfd3db7
|
|
@ -321,33 +321,33 @@ class FolkCrmView extends HTMLElement {
|
|||
|
||||
this.shadow.innerHTML = `
|
||||
<style>
|
||||
:host { display: block; font-family: system-ui, -apple-system, sans-serif; color: #e0e0e0; }
|
||||
:host { display: block; font-family: system-ui, -apple-system, sans-serif; color: var(--rs-text-primary); }
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
.crm-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
|
||||
.crm-title { font-size: 15px; font-weight: 600; color: #e2e8f0; }
|
||||
.crm-title { font-size: 15px; font-weight: 600; color: var(--rs-text-primary); }
|
||||
|
||||
.tabs { display: flex; gap: 2px; background: #16161e; border-radius: 10px; padding: 3px; margin-bottom: 16px; }
|
||||
.tabs { display: flex; gap: 2px; background: var(--rs-input-bg); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
|
||||
.tab {
|
||||
padding: 8px 16px; border-radius: 8px; border: none;
|
||||
background: transparent; color: #888; cursor: pointer; font-size: 13px;
|
||||
background: transparent; color: var(--rs-text-muted); cursor: pointer; font-size: 13px;
|
||||
font-weight: 500; transition: all 0.15s;
|
||||
}
|
||||
.tab:hover { color: #ccc; }
|
||||
.tab.active { background: #1e1e2e; color: #e2e8f0; }
|
||||
.tab-count { font-size: 11px; color: #555; margin-left: 4px; }
|
||||
.tab.active .tab-count { color: #6366f1; }
|
||||
.tab:hover { color: var(--rs-text-secondary); }
|
||||
.tab.active { background: var(--rs-bg-surface); color: var(--rs-text-primary); }
|
||||
.tab-count { font-size: 11px; color: var(--rs-text-muted); margin-left: 4px; }
|
||||
.tab.active .tab-count { color: var(--rs-primary-hover); }
|
||||
|
||||
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; }
|
||||
.search-input {
|
||||
border: 1px solid #333; border-radius: 8px; padding: 8px 12px;
|
||||
background: #16161e; color: #e0e0e0; font-size: 13px; width: 260px; outline: none;
|
||||
border: 1px solid var(--rs-input-border); border-radius: 8px; padding: 8px 12px;
|
||||
background: var(--rs-input-bg); color: var(--rs-input-text); font-size: 13px; width: 260px; outline: none;
|
||||
}
|
||||
.search-input:focus { border-color: #6366f1; }
|
||||
.search-input:focus { border-color: var(--rs-primary-hover); }
|
||||
|
||||
.loading { text-align: center; color: #888; padding: 60px 20px; font-size: 14px; }
|
||||
.error { text-align: center; color: #ef5350; padding: 40px 20px; }
|
||||
.empty-state { text-align: center; color: #666; padding: 60px 20px; font-size: 14px; }
|
||||
.loading { text-align: center; color: var(--rs-text-muted); padding: 60px 20px; font-size: 14px; }
|
||||
.error { text-align: center; color: var(--rs-error); padding: 40px 20px; }
|
||||
.empty-state { text-align: center; color: var(--rs-text-muted); padding: 60px 20px; font-size: 14px; }
|
||||
|
||||
/* ── Pipeline grid ── */
|
||||
.pipeline-grid {
|
||||
|
|
@ -362,61 +362,61 @@ class FolkCrmView extends HTMLElement {
|
|||
display: flex; align-items: center; justify-content: space-between;
|
||||
font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
|
||||
}
|
||||
.stage-incoming { background: #1e293b; color: #93c5fd; }
|
||||
.stage-meeting { background: #1e2a1e; color: #86efac; }
|
||||
.stage-proposal { background: #2a2a1e; color: #fde68a; }
|
||||
.stage-closed-won { background: #1a2e1a; color: #4ade80; }
|
||||
.stage-closed-lost { background: #2e1a1a; color: #f87171; }
|
||||
.stage-incoming { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
|
||||
.stage-meeting { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
|
||||
.stage-proposal { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
|
||||
.stage-closed-won { background: rgba(34, 197, 94, 0.2); color: #16a34a; }
|
||||
.stage-closed-lost { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
|
||||
.pipeline-count {
|
||||
background: rgba(255,255,255,0.1); padding: 1px 7px; border-radius: 10px;
|
||||
font-size: 11px;
|
||||
}
|
||||
.pipeline-total { font-size: 12px; color: #888; padding: 4px 12px; }
|
||||
.pipeline-total { font-size: 12px; color: var(--rs-text-muted); padding: 4px 12px; }
|
||||
.pipeline-cards { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
|
||||
.pipeline-card {
|
||||
background: #1e1e2e; border: 1px solid #2a2a3a; border-radius: 8px;
|
||||
background: var(--rs-bg-surface); border: 1px solid var(--rs-border); border-radius: 8px;
|
||||
padding: 12px; transition: border-color 0.15s;
|
||||
}
|
||||
.pipeline-card:hover { border-color: #444; }
|
||||
.card-name { font-size: 13px; font-weight: 600; color: #e2e8f0; margin-bottom: 4px; }
|
||||
.card-amount { font-size: 14px; font-weight: 700; color: #6366f1; margin-bottom: 6px; }
|
||||
.card-company { font-size: 12px; color: #94a3b8; }
|
||||
.card-contact { font-size: 11px; color: #64748b; margin-top: 2px; }
|
||||
.card-date { font-size: 11px; color: #555; margin-top: 4px; }
|
||||
.pipeline-card:hover { border-color: var(--rs-border-strong); }
|
||||
.card-name { font-size: 13px; font-weight: 600; color: var(--rs-text-primary); margin-bottom: 4px; }
|
||||
.card-amount { font-size: 14px; font-weight: 700; color: var(--rs-primary-hover); margin-bottom: 6px; }
|
||||
.card-company { font-size: 12px; color: var(--rs-text-secondary); }
|
||||
.card-contact { font-size: 11px; color: var(--rs-text-muted); margin-top: 2px; }
|
||||
.card-date { font-size: 11px; color: var(--rs-text-muted); margin-top: 4px; }
|
||||
|
||||
/* ── Data tables ── */
|
||||
.data-table {
|
||||
width: 100%; border-collapse: collapse;
|
||||
background: #16161e; border-radius: 10px; overflow: hidden;
|
||||
background: var(--rs-input-bg); border-radius: 10px; overflow: hidden;
|
||||
}
|
||||
.data-table th {
|
||||
text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600;
|
||||
color: #64748b; text-transform: uppercase; letter-spacing: 0.04em;
|
||||
border-bottom: 1px solid #222; cursor: pointer; user-select: none;
|
||||
color: var(--rs-text-muted); text-transform: uppercase; letter-spacing: 0.04em;
|
||||
border-bottom: 1px solid var(--rs-border); cursor: pointer; user-select: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.data-table th:hover { color: #94a3b8; }
|
||||
.data-table th:hover { color: var(--rs-text-secondary); }
|
||||
.data-table td {
|
||||
padding: 10px 14px; font-size: 13px; border-bottom: 1px solid #1a1a2a;
|
||||
color: #c8c8d8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
||||
padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--rs-border-subtle);
|
||||
color: var(--rs-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
||||
max-width: 250px;
|
||||
}
|
||||
.data-table tr:hover td { background: #1a1a2a; }
|
||||
.cell-name { font-weight: 500; color: #e2e8f0; }
|
||||
.data-table tr:hover td { background: var(--rs-bg-hover); }
|
||||
.cell-name { font-weight: 500; color: var(--rs-text-primary); }
|
||||
.cell-email { color: #93c5fd; }
|
||||
.cell-domain a { color: #93c5fd; text-decoration: none; }
|
||||
.cell-domain a:hover { text-decoration: underline; }
|
||||
.table-footer { font-size: 12px; color: #555; padding: 10px 14px; }
|
||||
.table-footer { font-size: 12px; color: var(--rs-text-muted); padding: 10px 14px; }
|
||||
|
||||
/* ── Graph tab ── */
|
||||
.graph-link-section { text-align: center; padding: 60px 20px; }
|
||||
.graph-link-section p { color: #888; font-size: 14px; margin-bottom: 16px; }
|
||||
.graph-link-section p { color: var(--rs-text-muted); font-size: 14px; margin-bottom: 16px; }
|
||||
.graph-link-btn {
|
||||
display: inline-block; padding: 10px 24px; border-radius: 8px;
|
||||
background: #6366f1; color: #fff; text-decoration: none;
|
||||
background: var(--rs-primary-hover); color: #fff; text-decoration: none;
|
||||
font-size: 14px; font-weight: 500; transition: background 0.15s;
|
||||
}
|
||||
.graph-link-btn:hover { background: #5558e6; }
|
||||
.graph-link-btn:hover { background: var(--rs-primary); }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.pipeline-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ class FolkGraphViewer extends HTMLElement {
|
|||
private renderGraphNodes(): string {
|
||||
const filtered = this.getFilteredNodes();
|
||||
if (filtered.length === 0 && this.nodes.length > 0) {
|
||||
return `<div class="placeholder"><p style="font-size:14px;color:#888">No nodes match current filter.</p></div>`;
|
||||
return `<div class="placeholder"><p style="font-size:14px;color:var(--rs-text-muted)">No nodes match current filter.</p></div>`;
|
||||
}
|
||||
if (filtered.length === 0) {
|
||||
return `
|
||||
|
|
@ -347,7 +347,7 @@ class FolkGraphViewer extends HTMLElement {
|
|||
<p style="font-size:48px">🕸️</p>
|
||||
<p style="font-size:16px">Community Relationship Graph</p>
|
||||
<p>Connect the force-directed layout engine to visualize your network.</p>
|
||||
<p style="font-size:12px;color:#444">Automerge CRDT sync + d3-force layout</p>
|
||||
<p style="font-size:12px;color:var(--rs-text-muted)">Automerge CRDT sync + d3-force layout</p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
|
@ -382,7 +382,7 @@ class FolkGraphViewer extends HTMLElement {
|
|||
if (!filteredIds.has(edge.source) || !filteredIds.has(edge.target)) continue;
|
||||
|
||||
if (edge.type === "work_at") {
|
||||
edgesSvg.push(`<line x1="${sp.x}" y1="${sp.y}" x2="${tp.x}" y2="${tp.y}" stroke="#555" stroke-width="1" opacity="0.35"/>`);
|
||||
edgesSvg.push(`<line x1="${sp.x}" y1="${sp.y}" x2="${tp.x}" y2="${tp.y}" style="stroke:var(--rs-text-muted)" stroke-width="1" opacity="0.35"/>`);
|
||||
} else if (edge.type === "point_of_contact") {
|
||||
const mx = (sp.x + tp.x) / 2;
|
||||
const my = (sp.y + tp.y) / 2;
|
||||
|
|
@ -394,7 +394,7 @@ class FolkGraphViewer extends HTMLElement {
|
|||
edgesSvg.push(`<line x1="${sp.x}" y1="${sp.y}" x2="${tp.x}" y2="${tp.y}" stroke="#f59e0b" stroke-width="1" stroke-dasharray="3 3" opacity="0.4"/>`);
|
||||
} else {
|
||||
// Fallback for any unknown edge type
|
||||
edgesSvg.push(`<line x1="${sp.x}" y1="${sp.y}" x2="${tp.x}" y2="${tp.y}" stroke="#555" stroke-width="1" opacity="0.25"/>`);
|
||||
edgesSvg.push(`<line x1="${sp.x}" y1="${sp.y}" x2="${tp.x}" y2="${tp.y}" style="stroke:var(--rs-text-muted)" stroke-width="1" opacity="0.25"/>`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -410,15 +410,15 @@ class FolkGraphViewer extends HTMLElement {
|
|||
let label = this.esc(node.name);
|
||||
let sublabel = "";
|
||||
if (isOrg && node.description) {
|
||||
sublabel = `<text x="${pos.x}" y="${pos.y + radius + 26}" fill="#888" font-size="8" text-anchor="middle">${this.esc(node.description)}</text>`;
|
||||
sublabel = `<text x="${pos.x}" y="${pos.y + radius + 26}" style="fill:var(--rs-text-muted)" font-size="8" text-anchor="middle">${this.esc(node.description)}</text>`;
|
||||
} else if (!isOrg && node.role) {
|
||||
sublabel = `<text x="${pos.x}" y="${pos.y + radius + 24}" fill="#666" font-size="8" text-anchor="middle">${this.esc(node.role)}${node.location ? " \u00b7 " + this.esc(node.location) : ""}</text>`;
|
||||
sublabel = `<text x="${pos.x}" y="${pos.y + radius + 24}" style="fill:var(--rs-text-muted)" font-size="8" text-anchor="middle">${this.esc(node.role)}${node.location ? " \u00b7 " + this.esc(node.location) : ""}</text>`;
|
||||
}
|
||||
|
||||
// Trust score badge for people
|
||||
const trust = !isOrg ? this.getTrustScore(node.id) : -1;
|
||||
const trustBadge = trust >= 0 ? `
|
||||
<circle cx="${pos.x + radius - 2}" cy="${pos.y - radius + 2}" r="8" fill="#7c3aed" stroke="#0d0d14" stroke-width="1.5"/>
|
||||
<circle cx="${pos.x + radius - 2}" cy="${pos.y - radius + 2}" r="8" fill="#7c3aed" style="stroke:var(--rs-canvas-bg)" stroke-width="1.5"/>
|
||||
<text x="${pos.x + radius - 2}" y="${pos.y - radius + 5.5}" fill="#fff" font-size="7" font-weight="700" text-anchor="middle">${trust}</text>
|
||||
` : "";
|
||||
|
||||
|
|
@ -427,7 +427,7 @@ class FolkGraphViewer extends HTMLElement {
|
|||
${isSelected ? `<circle cx="${pos.x}" cy="${pos.y}" r="${radius + 6}" fill="none" stroke="${color}" stroke-width="2" opacity="0.6"/>` : ""}
|
||||
<circle cx="${pos.x}" cy="${pos.y}" r="${radius}" fill="${color}" opacity="${isOrg ? 0.9 : 0.75}" stroke="${isOrg ? color : "none"}" stroke-width="${isOrg ? 2 : 0}" stroke-opacity="0.3"/>
|
||||
${isOrg ? `<text x="${pos.x}" y="${pos.y + 4}" fill="#fff" font-size="9" font-weight="600" text-anchor="middle">${label.length > 14 ? label.slice(0, 12) + "\u2026" : label}</text>` : ""}
|
||||
<text x="${pos.x}" y="${pos.y + radius + 13}" fill="#ccc" font-size="${isOrg ? 11 : 10}" font-weight="${isOrg ? 600 : 400}" text-anchor="middle">${label}</text>
|
||||
<text x="${pos.x}" y="${pos.y + radius + 13}" style="fill:var(--rs-text-primary)" font-size="${isOrg ? 11 : 10}" font-weight="${isOrg ? 600 : 400}" text-anchor="middle">${label}</text>
|
||||
${sublabel}
|
||||
${trustBadge}
|
||||
</g>
|
||||
|
|
@ -440,45 +440,45 @@ class FolkGraphViewer extends HTMLElement {
|
|||
private render() {
|
||||
this.shadow.innerHTML = `
|
||||
<style>
|
||||
:host { display: block; font-family: system-ui, -apple-system, sans-serif; color: #e0e0e0; }
|
||||
:host { display: block; font-family: system-ui, -apple-system, sans-serif; color: var(--rs-text-primary); }
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
.rapp-nav { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; min-height: 36px; }
|
||||
.rapp-nav__title { font-size: 15px; font-weight: 600; flex: 1; color: #e2e8f0; }
|
||||
.rapp-nav__title { font-size: 15px; font-weight: 600; flex: 1; color: var(--rs-text-primary); }
|
||||
|
||||
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
|
||||
.search-input {
|
||||
border: 1px solid #333; border-radius: 8px; padding: 8px 12px;
|
||||
background: #16161e; color: #e0e0e0; font-size: 13px; width: 200px; outline: none;
|
||||
border: 1px solid var(--rs-input-border); border-radius: 8px; padding: 8px 12px;
|
||||
background: var(--rs-input-bg); color: var(--rs-input-text); font-size: 13px; width: 200px; outline: none;
|
||||
}
|
||||
.search-input:focus { border-color: #6366f1; }
|
||||
.search-input:focus { border-color: var(--rs-primary-hover); }
|
||||
.filter-btn {
|
||||
padding: 6px 12px; border-radius: 8px; border: 1px solid #333;
|
||||
background: #16161e; color: #888; cursor: pointer; font-size: 12px;
|
||||
padding: 6px 12px; border-radius: 8px; border: 1px solid var(--rs-input-border);
|
||||
background: var(--rs-input-bg); color: var(--rs-text-muted); cursor: pointer; font-size: 12px;
|
||||
}
|
||||
.filter-btn:hover { border-color: #555; }
|
||||
.filter-btn.active { border-color: #6366f1; color: #6366f1; }
|
||||
.filter-btn:hover { border-color: var(--rs-border-strong); }
|
||||
.filter-btn.active { border-color: var(--rs-primary-hover); color: var(--rs-primary-hover); }
|
||||
|
||||
.graph-canvas {
|
||||
width: 100%; height: 500px; border-radius: 12px;
|
||||
background: #0d0d14; border: 1px solid #222;
|
||||
background: var(--rs-canvas-bg); border: 1px solid var(--rs-border);
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
position: relative; overflow: hidden;
|
||||
}
|
||||
.placeholder { text-align: center; color: #555; padding: 40px; }
|
||||
.placeholder { text-align: center; color: var(--rs-text-muted); padding: 40px; }
|
||||
.placeholder p { margin: 6px 0; }
|
||||
|
||||
.workspace-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
|
||||
.ws-card {
|
||||
background: #1e1e2e; border: 1px solid #333; border-radius: 10px;
|
||||
background: var(--rs-bg-surface); border: 1px solid var(--rs-border-strong); border-radius: 10px;
|
||||
padding: 16px; cursor: pointer; transition: border-color 0.2s;
|
||||
}
|
||||
.ws-card:hover { border-color: #555; }
|
||||
.ws-card:hover { border-color: var(--rs-text-muted); }
|
||||
.ws-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
|
||||
.ws-meta { font-size: 12px; color: #888; }
|
||||
.ws-meta { font-size: 12px; color: var(--rs-text-muted); }
|
||||
|
||||
.legend { display: flex; gap: 16px; margin-top: 12px; }
|
||||
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #888; }
|
||||
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--rs-text-muted); }
|
||||
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
|
||||
.legend-line { display: inline-block; }
|
||||
.dot-person { background: #3b82f6; }
|
||||
|
|
@ -487,34 +487,34 @@ class FolkGraphViewer extends HTMLElement {
|
|||
|
||||
.stats { display: flex; gap: 20px; margin-bottom: 16px; }
|
||||
.stat { text-align: center; }
|
||||
.stat-value { font-size: 24px; font-weight: 700; color: #6366f1; }
|
||||
.stat-label { font-size: 11px; color: #888; }
|
||||
.stat-value { font-size: 24px; font-weight: 700; color: var(--rs-primary-hover); }
|
||||
.stat-label { font-size: 11px; color: var(--rs-text-muted); }
|
||||
|
||||
.demo-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #f59e0b22; color: #f59e0b; font-size: 11px; font-weight: 600; margin-left: 8px; }
|
||||
|
||||
.graph-node:hover circle:first-child { filter: brightness(1.2); }
|
||||
|
||||
.detail-panel {
|
||||
background: #1a1a2e; border: 1px solid #334155; border-radius: 10px;
|
||||
background: var(--rs-bg-surface); border: 1px solid var(--rs-border-strong); border-radius: 10px;
|
||||
padding: 16px; margin-top: 12px;
|
||||
}
|
||||
.detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
|
||||
.detail-icon { font-size: 24px; }
|
||||
.detail-info { flex: 1; }
|
||||
.detail-name { font-size: 15px; font-weight: 600; color: #e2e8f0; }
|
||||
.detail-type { font-size: 12px; color: #94a3b8; }
|
||||
.detail-close { background: none; border: none; color: #64748b; font-size: 16px; cursor: pointer; padding: 4px; }
|
||||
.detail-close:hover { color: #e2e8f0; }
|
||||
.detail-desc { font-size: 13px; color: #94a3b8; line-height: 1.5; margin: 8px 0; }
|
||||
.detail-name { font-size: 15px; font-weight: 600; color: var(--rs-text-primary); }
|
||||
.detail-type { font-size: 12px; color: var(--rs-text-secondary); }
|
||||
.detail-close { background: none; border: none; color: var(--rs-text-muted); font-size: 16px; cursor: pointer; padding: 4px; }
|
||||
.detail-close:hover { color: var(--rs-text-primary); }
|
||||
.detail-desc { font-size: 13px; color: var(--rs-text-secondary); line-height: 1.5; margin: 8px 0; }
|
||||
.detail-trust { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
|
||||
.trust-label { font-size: 11px; color: #64748b; min-width: 70px; }
|
||||
.trust-bar { flex: 1; height: 6px; background: #1e1e2e; border-radius: 3px; overflow: hidden; }
|
||||
.trust-label { font-size: 11px; color: var(--rs-text-muted); min-width: 70px; }
|
||||
.trust-bar { flex: 1; height: 6px; background: var(--rs-bg-surface-raised); border-radius: 3px; overflow: hidden; }
|
||||
.trust-fill { display: block; height: 100%; background: #7c3aed; border-radius: 3px; transition: width 0.3s; }
|
||||
.trust-val { font-size: 12px; font-weight: 700; color: #a78bfa; min-width: 24px; text-align: right; }
|
||||
.detail-section { font-size: 11px; font-weight: 600; color: #64748b; margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 0.05em; }
|
||||
.detail-conn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #e2e8f0; padding: 4px 0; }
|
||||
.detail-section { font-size: 11px; font-weight: 600; color: var(--rs-text-muted); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 0.05em; }
|
||||
.detail-conn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--rs-text-primary); padding: 4px 0; }
|
||||
.conn-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
|
||||
.conn-role { font-size: 11px; color: #64748b; margin-left: auto; }
|
||||
.conn-role { font-size: 11px; color: var(--rs-text-muted); margin-left: auto; }
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.graph-canvas { height: 350px; }
|
||||
|
|
@ -525,7 +525,7 @@ class FolkGraphViewer extends HTMLElement {
|
|||
}
|
||||
</style>
|
||||
|
||||
${this.error ? `<div style="color:#ef5350;text-align:center;padding:8px">${this.esc(this.error)}</div>` : ""}
|
||||
${this.error ? `<div style="color:var(--rs-error);text-align:center;padding:8px">${this.esc(this.error)}</div>` : ""}
|
||||
|
||||
<div class="rapp-nav">
|
||||
<span class="rapp-nav__title">Network Graph${this.space === "demo" ? '<span class="demo-badge">Demo</span>' : ""}</span>
|
||||
|
|
@ -553,7 +553,7 @@ class FolkGraphViewer extends HTMLElement {
|
|||
<p style="font-size:48px">🕸️</p>
|
||||
<p style="font-size:16px">Community Relationship Graph</p>
|
||||
<p>Connect the force-directed layout engine to visualize your network.</p>
|
||||
<p style="font-size:12px;color:#444">Automerge CRDT sync + d3-force layout</p>
|
||||
<p style="font-size:12px;color:var(--rs-text-muted)">Automerge CRDT sync + d3-force layout</p>
|
||||
</div>
|
||||
`}
|
||||
</div>
|
||||
|
|
@ -563,12 +563,12 @@ class FolkGraphViewer extends HTMLElement {
|
|||
<div class="legend">
|
||||
<div class="legend-item"><span class="legend-dot dot-person"></span> People</div>
|
||||
<div class="legend-item"><span class="legend-dot dot-company"></span> Organizations</div>
|
||||
<div class="legend-item"><svg width="20" height="10"><line x1="0" y1="5" x2="20" y2="5" stroke="#555" stroke-width="2"/></svg> Works at</div>
|
||||
<div class="legend-item"><svg width="20" height="10"><line x1="0" y1="5" x2="20" y2="5" style="stroke:var(--rs-text-muted)" stroke-width="2"/></svg> Works at</div>
|
||||
<div class="legend-item"><svg width="20" height="10"><line x1="0" y1="5" x2="20" y2="5" stroke="#c084fc" stroke-width="2" stroke-dasharray="4 2"/></svg> Point of contact</div>
|
||||
</div>
|
||||
|
||||
${this.workspaces.length > 0 ? `
|
||||
<div style="margin-top:20px;font-size:14px;font-weight:600;color:#aaa">${this.space === "demo" ? "Organizations" : "Workspaces"}</div>
|
||||
<div style="margin-top:20px;font-size:14px;font-weight:600;color:var(--rs-text-secondary)">${this.space === "demo" ? "Organizations" : "Workspaces"}</div>
|
||||
<div class="workspace-list">
|
||||
${this.workspaces.map(ws => `
|
||||
<div class="ws-card">
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@ routes.get("/api/graph", async (c) => {
|
|||
id
|
||||
name { firstName lastName }
|
||||
email { primaryEmail }
|
||||
city
|
||||
company { id name { firstName lastName } }
|
||||
}
|
||||
}
|
||||
|
|
@ -169,6 +170,7 @@ routes.get("/api/graph", async (c) => {
|
|||
name
|
||||
domainName { primaryLinkUrl }
|
||||
employees
|
||||
address { addressCity addressCountry }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -196,7 +198,7 @@ routes.get("/api/graph", async (c) => {
|
|||
// People → nodes
|
||||
for (const { node: p } of d.people?.edges || []) {
|
||||
const label = [p.name?.firstName, p.name?.lastName].filter(Boolean).join(" ") || "Unknown";
|
||||
nodes.push({ id: p.id, label, type: "person", data: { email: p.email?.primaryEmail } });
|
||||
nodes.push({ id: p.id, label, type: "person", data: { email: p.email?.primaryEmail, location: p.city } });
|
||||
nodeIds.add(p.id);
|
||||
|
||||
// Person → Company edge
|
||||
|
|
@ -207,7 +209,7 @@ routes.get("/api/graph", async (c) => {
|
|||
|
||||
// Companies → nodes
|
||||
for (const { node: co } of d.companies?.edges || []) {
|
||||
nodes.push({ id: co.id, label: co.name || "Unknown", type: "company", data: { domain: co.domainName?.primaryLinkUrl, employees: co.employees } });
|
||||
nodes.push({ id: co.id, label: co.name || "Unknown", type: "company", data: { domain: co.domainName?.primaryLinkUrl, employees: co.employees, location: co.address?.addressCity } });
|
||||
nodeIds.add(co.id);
|
||||
}
|
||||
|
||||
|
|
@ -275,7 +277,6 @@ routes.get("/crm", (c) => {
|
|||
moduleId: "rnetwork",
|
||||
spaceSlug: space,
|
||||
modules: getModuleInfoList(),
|
||||
theme: "dark",
|
||||
body: `<folk-crm-view space="${space}"></folk-crm-view>`,
|
||||
scripts: `<script type="module" src="/modules/rnetwork/folk-crm-view.js"></script>`,
|
||||
styles: `<link rel="stylesheet" href="/modules/rnetwork/network.css">`,
|
||||
|
|
@ -293,7 +294,6 @@ routes.get("/", (c) => {
|
|||
moduleId: "rnetwork",
|
||||
spaceSlug: space,
|
||||
modules: getModuleInfoList(),
|
||||
theme: "dark",
|
||||
body: `<folk-crm-view space="${space}"></folk-crm-view>`,
|
||||
scripts: `<script type="module" src="/modules/rnetwork/folk-crm-view.js"></script>`,
|
||||
styles: `<link rel="stylesheet" href="/modules/rnetwork/network.css">`,
|
||||
|
|
@ -305,10 +305,9 @@ routes.get("/", (c) => {
|
|||
moduleId: "rnetwork",
|
||||
spaceSlug: space,
|
||||
modules: getModuleInfoList(),
|
||||
theme: "dark",
|
||||
body: `<div class="rapp-nav" style="padding:0 1rem;margin-top:8px"><span class="rapp-nav__title"></span><a href="?view=app" class="rapp-nav__btn--app-toggle">Open Full App</a></div>
|
||||
<folk-graph-viewer space="${space}"></folk-graph-viewer>`,
|
||||
scripts: `<script type="module" src="/modules/rnetwork/folk-graph-viewer.js?v=3"></script>`,
|
||||
scripts: `<script type="module" src="/modules/rnetwork/folk-graph-viewer.js?v=4"></script>`,
|
||||
styles: `<link rel="stylesheet" href="/modules/rnetwork/network.css">`,
|
||||
}));
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue