living-documentation 4.2.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of living-documentation might be problematic. Click here for more details.
- package/README.md +7 -6
- package/dist/src/frontend/diagram/main.js +2 -1
- package/dist/src/frontend/diagram/network.js +167 -12
- package/dist/src/frontend/diagram/node-rendering.js +440 -167
- package/dist/src/frontend/diagram/persistence.js +4 -2
- package/dist/src/frontend/diagram/state.js +1 -0
- package/dist/src/frontend/diagram.html +10 -0
- package/dist/src/frontend/index.html +63 -12
- package/dist/src/frontend/wordcloud.js +581 -209
- package/dist/src/routes/browse.d.ts.map +1 -1
- package/dist/src/routes/browse.js +2 -1
- package/dist/src/routes/browse.js.map +1 -1
- package/dist/src/routes/diagrams.d.ts.map +1 -1
- package/dist/src/routes/diagrams.js +2 -1
- package/dist/src/routes/diagrams.js.map +1 -1
- package/dist/src/routes/wordcloud.d.ts.map +1 -1
- package/dist/src/routes/wordcloud.js +42 -20
- package/dist/src/routes/wordcloud.js.map +1 -1
- package/package.json +1 -1
|
@@ -63,9 +63,11 @@ export async function openDiagram(id) {
|
|
|
63
63
|
const diagram = await res.json();
|
|
64
64
|
st.currentDiagramId = id;
|
|
65
65
|
st.isDirty = false;
|
|
66
|
+
st.edgesStraight = diagram.edgesStraight === true;
|
|
66
67
|
document.getElementById('btnSave').disabled = true;
|
|
67
68
|
document.getElementById('diagramTitle').value = diagram.title || '';
|
|
68
|
-
|
|
69
|
+
document.getElementById('btnEdgeStraight').classList.toggle('tool-active', st.edgesStraight);
|
|
70
|
+
initNetwork(diagram.nodes || [], diagram.edges || [], st.edgesStraight);
|
|
69
71
|
renderDiagramList();
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -135,7 +137,7 @@ export async function saveDiagram() {
|
|
|
135
137
|
await fetch(`/api/diagrams/${st.currentDiagramId}`, {
|
|
136
138
|
method: 'PUT',
|
|
137
139
|
headers: { 'Content-Type': 'application/json' },
|
|
138
|
-
body: JSON.stringify({ title, nodes: nodeData, edges: edgeData }),
|
|
140
|
+
body: JSON.stringify({ title, nodes: nodeData, edges: edgeData, edgesStraight: st.edgesStraight }),
|
|
139
141
|
});
|
|
140
142
|
st.isDirty = false;
|
|
141
143
|
document.getElementById('btnSave').disabled = true;
|
|
@@ -25,6 +25,7 @@ export const st = {
|
|
|
25
25
|
stampTargetIds: [], // node IDs waiting to receive the stamped property
|
|
26
26
|
clipboard: null, // { nodes: [], edges: [] }
|
|
27
27
|
canonicalOrder: [], // user-defined z-order, immune to vis.js hover reordering
|
|
28
|
+
edgesStraight: false, // when true, all edges use smooth: disabled (straight lines)
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
export function markDirty() {
|
|
@@ -480,6 +480,16 @@
|
|
|
480
480
|
<rect x="1" y="1" width="12" height="12" rx="1" />
|
|
481
481
|
</svg>
|
|
482
482
|
</button>
|
|
483
|
+
<button
|
|
484
|
+
id="btnEdgeStraight"
|
|
485
|
+
class="tool-btn"
|
|
486
|
+
title="Basculer flèches courbes / droites"
|
|
487
|
+
>
|
|
488
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
|
|
489
|
+
<line x1="2" y1="12" x2="12" y2="2" />
|
|
490
|
+
<polyline points="8,2 12,2 12,6" />
|
|
491
|
+
</svg>
|
|
492
|
+
</button>
|
|
483
493
|
<div class="w-px h-6 bg-gray-200 dark:bg-gray-700 mx-0.5"></div>
|
|
484
494
|
|
|
485
495
|
<input
|
|
@@ -494,16 +494,48 @@
|
|
|
494
494
|
▶ Launch
|
|
495
495
|
</button>
|
|
496
496
|
</div>
|
|
497
|
+
<!-- Row 1b: exclude folders -->
|
|
498
|
+
<div class="flex items-start gap-3 px-6 pb-2">
|
|
499
|
+
<label class="text-xs font-medium text-gray-500 dark:text-gray-400 shrink-0 pt-1.5">Exclude</label>
|
|
500
|
+
<textarea
|
|
501
|
+
id="wc-exclude"
|
|
502
|
+
rows="3"
|
|
503
|
+
spellcheck="false"
|
|
504
|
+
placeholder="components/ui, package-lock.json (one per line or comma-separated)"
|
|
505
|
+
oninput="wcOnExcludeChange()"
|
|
506
|
+
class="flex-1 px-3 py-1.5 text-sm rounded-lg border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 font-mono focus:outline-none focus:ring-1 focus:ring-blue-400 resize-y"
|
|
507
|
+
></textarea>
|
|
508
|
+
<button
|
|
509
|
+
onclick="wcToggleExcludeBrowser()"
|
|
510
|
+
class="text-sm px-3 py-1.5 rounded-lg border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors shrink-0"
|
|
511
|
+
>
|
|
512
|
+
📁 Browse
|
|
513
|
+
</button>
|
|
514
|
+
</div>
|
|
515
|
+
<!-- Row 1c: exclude browser (collapsed by default) -->
|
|
516
|
+
<div id="wc-exclude-browser" class="hidden border-t border-gray-200 dark:border-gray-700">
|
|
517
|
+
<div class="flex items-center gap-2 px-3 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700">
|
|
518
|
+
<button id="wc-excl-browse-up" onclick="wcExclBrowseUp()"
|
|
519
|
+
class="text-xs text-blue-600 dark:text-blue-400 hover:underline disabled:opacity-30 disabled:pointer-events-none shrink-0">
|
|
520
|
+
↑ Up
|
|
521
|
+
</button>
|
|
522
|
+
<span id="wc-excl-browse-path" class="font-mono text-xs text-gray-400 dark:text-gray-500 truncate flex-1 text-right"></span>
|
|
523
|
+
</div>
|
|
524
|
+
<div id="wc-excl-browse-list" class="divide-y divide-gray-100 dark:divide-gray-800 max-h-52 overflow-y-auto"></div>
|
|
525
|
+
</div>
|
|
497
526
|
<!-- Row 2: extension checkboxes -->
|
|
498
527
|
<div class="flex items-center gap-x-4 gap-y-2 px-6 pb-3 flex-wrap">
|
|
499
528
|
<span class="text-xs font-medium text-gray-500 dark:text-gray-400 shrink-0">Extensions</span>
|
|
529
|
+
<button onclick="wcToggleAllExts()" id="wcToggleAllBtn" class="text-xs text-blue-600 dark:text-blue-400 hover:underline shrink-0">All</button>
|
|
500
530
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="md" checked /> .md</label>
|
|
531
|
+
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="mdx" /> .mdx</label>
|
|
501
532
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="txt" /> .txt</label>
|
|
502
533
|
<span class="text-gray-200 dark:text-gray-700 text-xs">|</span>
|
|
503
534
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="ts" /> .ts</label>
|
|
504
535
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="tsx" /> .tsx</label>
|
|
505
536
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="js" /> .js</label>
|
|
506
537
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="jsx" /> .jsx</label>
|
|
538
|
+
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="mjs" /> .mjs</label>
|
|
507
539
|
<span class="text-gray-200 dark:text-gray-700 text-xs">|</span>
|
|
508
540
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="java" /> .java</label>
|
|
509
541
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="kt" /> .kt</label>
|
|
@@ -514,6 +546,10 @@
|
|
|
514
546
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="swift" /> .swift</label>
|
|
515
547
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="rb" /> .rb</label>
|
|
516
548
|
<span class="text-gray-200 dark:text-gray-700 text-xs">|</span>
|
|
549
|
+
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="prisma" /> .prisma</label>
|
|
550
|
+
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="graphql" /> .graphql</label>
|
|
551
|
+
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="gql" /> .gql</label>
|
|
552
|
+
<span class="text-gray-200 dark:text-gray-700 text-xs">|</span>
|
|
517
553
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="html" /> .html</label>
|
|
518
554
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="css" /> .css</label>
|
|
519
555
|
<label class="flex items-center gap-1.5 text-xs text-gray-700 dark:text-gray-300 cursor-pointer"><input type="checkbox" class="wc-ext" value="scss" /> .scss</label>
|
|
@@ -536,18 +572,33 @@
|
|
|
536
572
|
<div id="wc-browse-list" class="divide-y divide-gray-100 dark:divide-gray-800 max-h-52 overflow-y-auto"></div>
|
|
537
573
|
</div>
|
|
538
574
|
</div>
|
|
539
|
-
<div
|
|
540
|
-
|
|
541
|
-
class="
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
class="
|
|
550
|
-
|
|
575
|
+
<div id="wc-body" class="flex-1 overflow-hidden flex">
|
|
576
|
+
<!-- Left sidebar: stats + controls + top-50 words -->
|
|
577
|
+
<div id="wc-sidebar" class="hidden w-56 shrink-0 border-r border-gray-200 dark:border-gray-800 flex flex-col bg-white dark:bg-gray-900 overflow-hidden">
|
|
578
|
+
<div id="wc-stats" class="px-3 py-2 text-xs text-gray-500 dark:text-gray-400 space-y-0.5 border-b border-gray-100 dark:border-gray-800"></div>
|
|
579
|
+
<div class="px-3 py-2 border-b border-gray-100 dark:border-gray-800 flex items-center gap-2">
|
|
580
|
+
<span class="text-xs text-gray-500 dark:text-gray-400 shrink-0">Min files</span>
|
|
581
|
+
<input id="wc-min-files" type="number" min="1" max="20" value="1"
|
|
582
|
+
class="w-12 px-1.5 py-0.5 text-xs rounded border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 text-gray-800 dark:text-gray-200 focus:outline-none" />
|
|
583
|
+
<button onclick="wcApplyFilter()" class="text-xs text-blue-600 dark:text-blue-400 hover:underline">Apply</button>
|
|
584
|
+
</div>
|
|
585
|
+
<p class="px-3 pt-2 pb-1 text-xs font-semibold text-gray-400 dark:text-gray-600 uppercase tracking-wider">Top words</p>
|
|
586
|
+
<div id="wc-top-list" class="flex-1 overflow-y-auto"></div>
|
|
587
|
+
</div>
|
|
588
|
+
<!-- Canvas / status area -->
|
|
589
|
+
<div id="wc-canvas-wrap" class="flex-1 relative overflow-hidden">
|
|
590
|
+
<p id="wc-status" class="absolute inset-0 flex items-center justify-center text-gray-400 dark:text-gray-500 text-sm animate-pulse"></p>
|
|
591
|
+
<canvas id="wc-canvas" class="hidden" style="position:absolute;inset:0"></canvas>
|
|
592
|
+
</div>
|
|
593
|
+
<!-- Right detail panel: shown on word click -->
|
|
594
|
+
<div id="wc-detail" class="hidden w-80 shrink-0 border-l border-gray-200 dark:border-gray-800 flex flex-col bg-white dark:bg-gray-900 overflow-hidden">
|
|
595
|
+
<div class="px-3 py-2 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between">
|
|
596
|
+
<span id="wc-detail-word" class="font-bold text-sm text-gray-900 dark:text-gray-100"></span>
|
|
597
|
+
<button onclick="wcCloseDetail()" class="text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 text-xs leading-none">✕</button>
|
|
598
|
+
</div>
|
|
599
|
+
<p class="px-3 pt-2 pb-1 text-xs font-semibold text-gray-400 dark:text-gray-600 uppercase tracking-wider">Found in</p>
|
|
600
|
+
<div id="wc-detail-files" class="flex-1 overflow-y-auto px-3 py-1 space-y-1 text-xs"></div>
|
|
601
|
+
</div>
|
|
551
602
|
</div>
|
|
552
603
|
</div>
|
|
553
604
|
|