@webmcp-auto-ui/ui 2.5.27 → 2.5.28
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 +15 -3
- package/src/agent/DataServersPanel.svelte +164 -0
- package/src/agent/LLMSelector.svelte +11 -3
- package/src/agent/ModelCacheManager.svelte +359 -0
- package/src/index.ts +42 -30
- package/src/widgets/WidgetRenderer.svelte +114 -104
- package/src/widgets/export-widget.ts +28 -1
- package/src/widgets/helpers/safe-image.ts +78 -0
- package/src/widgets/notebook/.gitkeep +0 -0
- package/src/widgets/notebook/chart-renderer.ts +63 -0
- package/src/widgets/notebook/compact.ts +823 -0
- package/src/widgets/notebook/document.ts +1065 -0
- package/src/widgets/notebook/editorial.ts +936 -0
- package/src/widgets/notebook/executors/.gitkeep +1 -0
- package/src/widgets/notebook/executors/index.ts +4 -0
- package/src/widgets/notebook/executors/js-worker.ts +269 -0
- package/src/widgets/notebook/executors/sql.ts +206 -0
- package/src/widgets/notebook/import-modals.ts +553 -0
- package/src/widgets/notebook/left-pane.ts +249 -0
- package/src/widgets/notebook/prose.ts +280 -0
- package/src/widgets/notebook/recipe-browser.ts +350 -0
- package/src/widgets/notebook/recipes/compact.md +124 -0
- package/src/widgets/notebook/recipes/document.md +139 -0
- package/src/widgets/notebook/recipes/editorial.md +120 -0
- package/src/widgets/notebook/recipes/workspace.md +119 -0
- package/src/widgets/notebook/resource-extractor.ts +162 -0
- package/src/widgets/notebook/share-handlers.ts +222 -0
- package/src/widgets/notebook/shared.ts +1592 -0
- package/src/widgets/notebook/workspace.ts +852 -0
- package/src/widgets/rich/cards.ts +181 -0
- package/src/widgets/rich/carousel.ts +319 -0
- package/src/widgets/rich/chart-rich.ts +386 -0
- package/src/widgets/rich/d3.ts +503 -0
- package/src/widgets/rich/data-table.ts +342 -0
- package/src/widgets/rich/gallery.ts +350 -0
- package/src/widgets/rich/grid-data.ts +173 -0
- package/src/widgets/rich/hemicycle.ts +313 -0
- package/src/widgets/rich/js-sandbox.ts +106 -0
- package/src/widgets/rich/json-viewer.ts +202 -0
- package/src/widgets/rich/log.ts +143 -0
- package/src/widgets/rich/map.ts +218 -0
- package/src/widgets/rich/profile.ts +256 -0
- package/src/widgets/rich/sankey.ts +262 -0
- package/src/widgets/rich/stat-card.ts +125 -0
- package/src/widgets/rich/timeline.ts +179 -0
- package/src/widgets/rich/trombinoscope.ts +246 -0
- package/src/widgets/simple/actions.ts +89 -0
- package/src/widgets/simple/alert.ts +100 -0
- package/src/widgets/simple/chart.ts +189 -0
- package/src/widgets/simple/code.ts +79 -0
- package/src/widgets/simple/kv.ts +68 -0
- package/src/widgets/simple/list.ts +89 -0
- package/src/widgets/simple/stat.ts +58 -0
- package/src/widgets/simple/tags.ts +125 -0
- package/src/widgets/simple/text.ts +198 -0
- package/src/widgets/SafeImage.svelte +0 -76
- package/src/widgets/rich/Cards.svelte +0 -39
- package/src/widgets/rich/Carousel.svelte +0 -88
- package/src/widgets/rich/Chart.svelte +0 -142
- package/src/widgets/rich/D3Widget.svelte +0 -378
- package/src/widgets/rich/DataTable.svelte +0 -62
- package/src/widgets/rich/Gallery.svelte +0 -94
- package/src/widgets/rich/GridData.svelte +0 -44
- package/src/widgets/rich/Hemicycle.svelte +0 -78
- package/src/widgets/rich/JsSandbox.svelte +0 -51
- package/src/widgets/rich/JsonViewer.svelte +0 -42
- package/src/widgets/rich/LogViewer.svelte +0 -24
- package/src/widgets/rich/MapView.svelte +0 -140
- package/src/widgets/rich/ProfileCard.svelte +0 -59
- package/src/widgets/rich/Sankey.svelte +0 -56
- package/src/widgets/rich/StatCard.svelte +0 -35
- package/src/widgets/rich/Timeline.svelte +0 -43
- package/src/widgets/rich/Trombinoscope.svelte +0 -48
- package/src/widgets/simple/ActionsBlock.svelte +0 -15
- package/src/widgets/simple/AlertBlock.svelte +0 -11
- package/src/widgets/simple/ChartBlock.svelte +0 -21
- package/src/widgets/simple/CodeBlock.svelte +0 -11
- package/src/widgets/simple/KVBlock.svelte +0 -16
- package/src/widgets/simple/ListBlock.svelte +0 -17
- package/src/widgets/simple/StatBlock.svelte +0 -14
- package/src/widgets/simple/TagsBlock.svelte +0 -15
- package/src/widgets/simple/TextBlock.svelte +0 -122
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
export interface TextBlockData { content?: string; }
|
|
3
|
-
interface Props { data: Partial<TextBlockData>; }
|
|
4
|
-
let { data }: Props = $props();
|
|
5
|
-
|
|
6
|
-
/** Minimal markdown → HTML renderer (no deps, naturally XSS-safe: only produces known tags) */
|
|
7
|
-
function renderMarkdown(src: string): string {
|
|
8
|
-
if (!src) return '';
|
|
9
|
-
|
|
10
|
-
// Escape HTML entities first (XSS protection)
|
|
11
|
-
const esc = (s: string) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
12
|
-
|
|
13
|
-
const lines = src.split('\n');
|
|
14
|
-
const out: string[] = [];
|
|
15
|
-
let inCode = false;
|
|
16
|
-
let codeLines: string[] = [];
|
|
17
|
-
let inUl = false;
|
|
18
|
-
let inOl = false;
|
|
19
|
-
|
|
20
|
-
const closeList = () => {
|
|
21
|
-
if (inUl) { out.push('</ul>'); inUl = false; }
|
|
22
|
-
if (inOl) { out.push('</ol>'); inOl = false; }
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/** Inline formatting: bold, italic, code, links */
|
|
26
|
-
const inline = (s: string): string => {
|
|
27
|
-
return esc(s)
|
|
28
|
-
.replace(/`([^`]+)`/g, '<code>$1</code>')
|
|
29
|
-
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
|
|
30
|
-
.replace(/\*([^*]+)\*/g, '<em>$1</em>')
|
|
31
|
-
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener">$1</a>');
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
for (const line of lines) {
|
|
35
|
-
// Fenced code block toggle
|
|
36
|
-
if (line.trimStart().startsWith('```')) {
|
|
37
|
-
if (!inCode) {
|
|
38
|
-
closeList();
|
|
39
|
-
inCode = true;
|
|
40
|
-
codeLines = [];
|
|
41
|
-
} else {
|
|
42
|
-
out.push(`<pre><code>${esc(codeLines.join('\n'))}</code></pre>`);
|
|
43
|
-
inCode = false;
|
|
44
|
-
}
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
if (inCode) { codeLines.push(line); continue; }
|
|
48
|
-
|
|
49
|
-
const trimmed = line.trim();
|
|
50
|
-
|
|
51
|
-
// Empty line → close lists, push break
|
|
52
|
-
if (!trimmed) { closeList(); out.push(''); continue; }
|
|
53
|
-
|
|
54
|
-
// Headers
|
|
55
|
-
const hMatch = trimmed.match(/^(#{1,6})\s+(.+)$/);
|
|
56
|
-
if (hMatch) {
|
|
57
|
-
closeList();
|
|
58
|
-
const level = hMatch[1].length;
|
|
59
|
-
out.push(`<h${level}>${inline(hMatch[2])}</h${level}>`);
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Unordered list
|
|
64
|
-
if (/^[-*+]\s+/.test(trimmed)) {
|
|
65
|
-
if (inOl) { out.push('</ol>'); inOl = false; }
|
|
66
|
-
if (!inUl) { out.push('<ul>'); inUl = true; }
|
|
67
|
-
out.push(`<li>${inline(trimmed.replace(/^[-*+]\s+/, ''))}</li>`);
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Ordered list
|
|
72
|
-
const olMatch = trimmed.match(/^(\d+)\.\s+(.+)$/);
|
|
73
|
-
if (olMatch) {
|
|
74
|
-
if (inUl) { out.push('</ul>'); inUl = false; }
|
|
75
|
-
if (!inOl) { out.push('<ol>'); inOl = true; }
|
|
76
|
-
out.push(`<li>${inline(olMatch[2])}</li>`);
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Horizontal rule
|
|
81
|
-
if (/^[-*_]{3,}$/.test(trimmed)) {
|
|
82
|
-
closeList();
|
|
83
|
-
out.push('<hr>');
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Regular paragraph line
|
|
88
|
-
closeList();
|
|
89
|
-
out.push(`<p>${inline(trimmed)}</p>`);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Close any open blocks
|
|
93
|
-
if (inCode) out.push(`<pre><code>${esc(codeLines.join('\n'))}</code></pre>`);
|
|
94
|
-
closeList();
|
|
95
|
-
|
|
96
|
-
return out.join('\n');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
let rendered = $derived(renderMarkdown(data.content ?? ''));
|
|
100
|
-
</script>
|
|
101
|
-
<div class="tb-md p-4 md:p-5 text-sm leading-relaxed">{@html rendered}</div>
|
|
102
|
-
|
|
103
|
-
<style>
|
|
104
|
-
.tb-md { color: var(--color-text2); }
|
|
105
|
-
.tb-md :global(h1) { font-size: 1.5em; font-weight: 700; color: var(--color-text1); margin: 0.8em 0 0.4em; }
|
|
106
|
-
.tb-md :global(h2) { font-size: 1.25em; font-weight: 600; color: var(--color-text1); margin: 0.7em 0 0.35em; }
|
|
107
|
-
.tb-md :global(h3) { font-size: 1.1em; font-weight: 600; color: var(--color-text1); margin: 0.6em 0 0.3em; }
|
|
108
|
-
.tb-md :global(h4), .tb-md :global(h5), .tb-md :global(h6) { font-size: 1em; font-weight: 600; color: var(--color-text1); margin: 0.5em 0 0.25em; }
|
|
109
|
-
.tb-md :global(p) { margin: 0.4em 0; }
|
|
110
|
-
.tb-md :global(strong) { font-weight: 600; color: var(--color-text1); }
|
|
111
|
-
.tb-md :global(em) { font-style: italic; }
|
|
112
|
-
.tb-md :global(a) { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
|
|
113
|
-
.tb-md :global(a:hover) { opacity: 0.8; }
|
|
114
|
-
.tb-md :global(ul), .tb-md :global(ol) { margin: 0.4em 0; padding-left: 1.5em; }
|
|
115
|
-
.tb-md :global(ul) { list-style: disc; }
|
|
116
|
-
.tb-md :global(ol) { list-style: decimal; }
|
|
117
|
-
.tb-md :global(li) { margin: 0.15em 0; }
|
|
118
|
-
.tb-md :global(code) { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.9em; background: var(--color-surface2); padding: 0.15em 0.35em; border-radius: 4px; }
|
|
119
|
-
.tb-md :global(pre) { background: var(--color-surface2); border-radius: 6px; padding: 0.75em 1em; margin: 0.5em 0; overflow-x: auto; }
|
|
120
|
-
.tb-md :global(pre code) { background: none; padding: 0; font-size: 0.85em; }
|
|
121
|
-
.tb-md :global(hr) { border: none; border-top: 1px solid var(--color-surface2); margin: 0.8em 0; }
|
|
122
|
-
</style>
|