@webmcp-auto-ui/ui 2.5.20 → 2.5.21
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.
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
compressHistory?: boolean;
|
|
12
12
|
compressPreview?: number;
|
|
13
13
|
contextRAGEnabled?: boolean;
|
|
14
|
+
ragResidueSize?: number;
|
|
14
15
|
cacheEnabled?: boolean;
|
|
15
16
|
temperature?: number;
|
|
16
17
|
topK?: number;
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
compressHistory = $bindable(false),
|
|
30
31
|
compressPreview = $bindable(500),
|
|
31
32
|
contextRAGEnabled = $bindable(false),
|
|
33
|
+
ragResidueSize = $bindable(200),
|
|
32
34
|
cacheEnabled = $bindable(true),
|
|
33
35
|
temperature = $bindable(0.7),
|
|
34
36
|
topK = $bindable(10),
|
|
@@ -210,7 +212,7 @@
|
|
|
210
212
|
<div>
|
|
211
213
|
<label class="flex items-center gap-2 cursor-pointer select-none mb-1">
|
|
212
214
|
<input type="checkbox" bind:checked={compressHistory} class="accent-accent w-3.5 h-3.5" />
|
|
213
|
-
<span class="text-[9px] font-mono text-text2 uppercase tracking-wider">
|
|
215
|
+
<span class="text-[9px] font-mono text-text2 uppercase tracking-wider">Tronquer l'historique</span>
|
|
214
216
|
</label>
|
|
215
217
|
{#if compressHistory}
|
|
216
218
|
<div class="flex justify-between items-baseline mb-1">
|
|
@@ -230,9 +232,18 @@
|
|
|
230
232
|
<span class="text-[8px] font-mono text-text2/40 ml-auto">experimental</span>
|
|
231
233
|
</label>
|
|
232
234
|
{#if contextRAGEnabled}
|
|
233
|
-
<div class="text-[9px] font-mono text-text2/60 pl-5">
|
|
235
|
+
<div class="text-[9px] font-mono text-text2/60 pl-5 mb-2">
|
|
234
236
|
Semantic context compaction via vector embeddings
|
|
235
237
|
</div>
|
|
238
|
+
<div class="pl-5">
|
|
239
|
+
<div class="flex justify-between items-baseline mb-1">
|
|
240
|
+
<span class="text-[9px] font-mono text-text2 uppercase tracking-wider">Résidu inline (chars)</span>
|
|
241
|
+
<span class="font-mono text-xs text-text1">{ragResidueSize}</span>
|
|
242
|
+
</div>
|
|
243
|
+
<input type="range" bind:value={ragResidueSize}
|
|
244
|
+
min={0} max={2000} step={50}
|
|
245
|
+
class="w-full accent-accent" />
|
|
246
|
+
</div>
|
|
236
247
|
{/if}
|
|
237
248
|
</section>
|
|
238
249
|
|
|
@@ -89,23 +89,33 @@ function exportCsv(type: string, data: Record<string, unknown>): void {
|
|
|
89
89
|
|
|
90
90
|
async function exportPng(type: string, containerEl: HTMLElement): Promise<void> {
|
|
91
91
|
const name = filename(type, 'png');
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const
|
|
92
|
+
// Use scroll dimensions to capture the FULL content, not just the visible viewport.
|
|
93
|
+
// Widgets like data-table can overflow horizontally; clientWidth would crop them.
|
|
94
|
+
const scrollW = Math.max(containerEl.scrollWidth, containerEl.clientWidth, 1);
|
|
95
|
+
const scrollH = Math.max(containerEl.scrollHeight, containerEl.clientHeight, 1);
|
|
96
|
+
const pixelRatio = TARGET_PNG_WIDTH / scrollW;
|
|
97
|
+
|
|
98
|
+
const bg = (typeof document !== 'undefined'
|
|
99
|
+
? getComputedStyle(document.documentElement).getPropertyValue('--color-surface').trim()
|
|
100
|
+
: '') || '#ffffff';
|
|
95
101
|
|
|
96
102
|
try {
|
|
97
103
|
const dataUrl = await toPng(containerEl, {
|
|
98
104
|
pixelRatio,
|
|
105
|
+
width: scrollW,
|
|
106
|
+
height: scrollH,
|
|
99
107
|
cacheBust: true,
|
|
100
|
-
|
|
101
|
-
|
|
108
|
+
backgroundColor: bg,
|
|
109
|
+
style: {
|
|
110
|
+
// Force children visibility inside the cloned node so overflow content renders
|
|
111
|
+
overflow: 'visible',
|
|
112
|
+
},
|
|
102
113
|
});
|
|
103
114
|
downloadFile(dataUrl, name);
|
|
104
115
|
} catch (err) {
|
|
105
116
|
console.error('[exportWidget] PNG export failed for type', type, err);
|
|
106
117
|
alert(`Export PNG impossible : ${err instanceof Error ? err.message : String(err)}`);
|
|
107
118
|
}
|
|
108
|
-
// pixelRatio used as-is; final canvas size = clientW*pixelRatio × clientH*pixelRatio = 2048 × (2048 * clientH / clientW)
|
|
109
119
|
}
|
|
110
120
|
|
|
111
121
|
// ── Markdown ──────────────────────────────────────────────────────────────────
|