@seed-ship/mcp-ui-solid 6.22.0 → 6.24.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.
- package/CHANGELOG.md +219 -0
- package/README.md +209 -2
- package/dist/components/ChartJSRenderer.cjs +192 -66
- package/dist/components/ChartJSRenderer.cjs.map +1 -1
- package/dist/components/ChartJSRenderer.d.ts.map +1 -1
- package/dist/components/ChartJSRenderer.js +192 -66
- package/dist/components/ChartJSRenderer.js.map +1 -1
- package/dist/components/DegradedFallback.cjs +34 -2
- package/dist/components/DegradedFallback.cjs.map +1 -1
- package/dist/components/DegradedFallback.d.ts +7 -0
- package/dist/components/DegradedFallback.d.ts.map +1 -1
- package/dist/components/DegradedFallback.js +34 -2
- package/dist/components/DegradedFallback.js.map +1 -1
- package/dist/components/MissingValue.cjs +43 -0
- package/dist/components/MissingValue.cjs.map +1 -0
- package/dist/components/MissingValue.d.ts +27 -0
- package/dist/components/MissingValue.d.ts.map +1 -0
- package/dist/components/MissingValue.js +43 -0
- package/dist/components/MissingValue.js.map +1 -0
- package/dist/components/UIResourceRenderer.cjs +250 -202
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts +2 -1
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +250 -202
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/components/chart-data-table.cjs +30 -5
- package/dist/components/chart-data-table.cjs.map +1 -1
- package/dist/components/chart-data-table.d.ts +18 -1
- package/dist/components/chart-data-table.d.ts.map +1 -1
- package/dist/components/chart-data-table.js +30 -5
- package/dist/components/chart-data-table.js.map +1 -1
- package/dist/components/chart-missing-plugin.cjs +194 -0
- package/dist/components/chart-missing-plugin.cjs.map +1 -0
- package/dist/components/chart-missing-plugin.d.ts +127 -0
- package/dist/components/chart-missing-plugin.d.ts.map +1 -0
- package/dist/components/chart-missing-plugin.js +194 -0
- package/dist/components/chart-missing-plugin.js.map +1 -0
- package/dist/context/MCPUIConfigContext.cjs.map +1 -1
- package/dist/context/MCPUIConfigContext.d.ts +57 -28
- package/dist/context/MCPUIConfigContext.d.ts.map +1 -1
- package/dist/context/MCPUIConfigContext.js.map +1 -1
- package/dist/context/MCPUIMathContext.cjs +19 -0
- package/dist/context/MCPUIMathContext.cjs.map +1 -0
- package/dist/context/MCPUIMathContext.d.ts +18 -0
- package/dist/context/MCPUIMathContext.d.ts.map +1 -0
- package/dist/context/MCPUIMathContext.js +19 -0
- package/dist/context/MCPUIMathContext.js.map +1 -0
- package/dist/context/MCPUIStringsContext.cjs +12 -1
- package/dist/context/MCPUIStringsContext.cjs.map +1 -1
- package/dist/context/MCPUIStringsContext.d.ts +62 -0
- package/dist/context/MCPUIStringsContext.d.ts.map +1 -1
- package/dist/context/MCPUIStringsContext.js +12 -1
- package/dist/context/MCPUIStringsContext.js.map +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/plugins/katex.cjs +23 -0
- package/dist/plugins/katex.cjs.map +1 -0
- package/dist/plugins/katex.d.cts +7 -0
- package/dist/plugins/katex.d.ts +7 -0
- package/dist/plugins/katex.d.ts.map +1 -0
- package/dist/plugins/katex.js +23 -0
- package/dist/plugins/katex.js.map +1 -0
- package/dist/services/component-registry.cjs +9 -2
- package/dist/services/component-registry.cjs.map +1 -1
- package/dist/services/component-registry.d.ts.map +1 -1
- package/dist/services/component-registry.js +9 -2
- package/dist/services/component-registry.js.map +1 -1
- package/dist/services/validation.cjs +31 -8
- package/dist/services/validation.cjs.map +1 -1
- package/dist/services/validation.d.ts.map +1 -1
- package/dist/services/validation.js +31 -8
- package/dist/services/validation.js.map +1 -1
- package/dist/types/index.d.ts +14 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/degraded-projections.cjs +19 -3
- package/dist/utils/degraded-projections.cjs.map +1 -1
- package/dist/utils/degraded-projections.d.ts +22 -2
- package/dist/utils/degraded-projections.d.ts.map +1 -1
- package/dist/utils/degraded-projections.js +19 -3
- package/dist/utils/degraded-projections.js.map +1 -1
- package/dist/utils/iframe-coep.cjs.map +1 -1
- package/dist/utils/iframe-coep.d.ts +7 -6
- package/dist/utils/iframe-coep.d.ts.map +1 -1
- package/dist/utils/iframe-coep.js.map +1 -1
- package/dist/utils/math-markdown.cjs +240 -0
- package/dist/utils/math-markdown.cjs.map +1 -0
- package/dist/utils/math-markdown.d.ts +16 -0
- package/dist/utils/math-markdown.d.ts.map +1 -0
- package/dist/utils/math-markdown.js +240 -0
- package/dist/utils/math-markdown.js.map +1 -0
- package/dist/utils/missing-value.cjs +60 -0
- package/dist/utils/missing-value.cjs.map +1 -0
- package/dist/utils/missing-value.d.ts +79 -0
- package/dist/utils/missing-value.d.ts.map +1 -0
- package/dist/utils/missing-value.js +60 -0
- package/dist/utils/missing-value.js.map +1 -0
- package/package.json +23 -4
- package/src/components/ChartJSRenderer.tsx +159 -6
- package/src/components/DegradedFallback.tsx +24 -2
- package/src/components/MissingValue.tsx +61 -0
- package/src/components/UIResourceRenderer.tsx +64 -10
- package/src/components/chart-data-table.ts +50 -6
- package/src/components/chart-missing-plugin.ts +334 -0
- package/src/context/MCPUIConfigContext.tsx +57 -28
- package/src/context/MCPUIMathContext.tsx +32 -0
- package/src/context/MCPUIStringsContext.tsx +76 -0
- package/src/index.ts +4 -0
- package/src/plugins/katex.ts +25 -0
- package/src/services/component-registry.ts +10 -2
- package/src/services/validation.ts +44 -9
- package/src/types/index.ts +13 -1
- package/src/utils/degraded-projections.ts +44 -4
- package/src/utils/iframe-coep.ts +7 -6
- package/src/utils/math-markdown.ts +222 -0
- package/src/utils/missing-value.ts +127 -0
|
@@ -37,6 +37,8 @@ const duplicateMountRegistry = require("../utils/duplicate-mount-registry.cjs");
|
|
|
37
37
|
const MCPUITelemetryContext = require("../context/MCPUITelemetryContext.cjs");
|
|
38
38
|
const MCPUIStringsContext = require("../context/MCPUIStringsContext.cjs");
|
|
39
39
|
const MCPUIConfigContext = require("../context/MCPUIConfigContext.cjs");
|
|
40
|
+
const missingValue = require("../utils/missing-value.cjs");
|
|
41
|
+
const MissingValue = require("./MissingValue.cjs");
|
|
40
42
|
const iframeCoep = require("../utils/iframe-coep.cjs");
|
|
41
43
|
const IframeFallbackLink = require("./IframeFallbackLink.cjs");
|
|
42
44
|
const GridRenderer = require("./GridRenderer.cjs");
|
|
@@ -60,8 +62,10 @@ const RenderContext = require("./RenderContext.cjs");
|
|
|
60
62
|
const useAction = require("../hooks/useAction.cjs");
|
|
61
63
|
const createResponsiveGrid = require("../hooks/createResponsiveGrid.cjs");
|
|
62
64
|
const marked = require("marked");
|
|
65
|
+
const MCPUIMathContext = require("../context/MCPUIMathContext.cjs");
|
|
66
|
+
const mathMarkdown = require("../utils/math-markdown.cjs");
|
|
63
67
|
const formatString = require("../utils/format-string.cjs");
|
|
64
|
-
var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button data-mcp-ui-action=copy type=button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700"><p class="text-red-500 dark:text-red-400 text-sm">`), _tmpl$5 = /* @__PURE__ */ web.template(`<div class=p-3>`), _tmpl$6 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$7 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium"></p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$8 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$9 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$0 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/><!$><!/>`), _tmpl$1 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$10 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$11 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6">`), _tmpl$12 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$13 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">`), _tmpl$14 = /* @__PURE__ */ web.template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"aria-haspopup=menu><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$15 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">`), _tmpl$16 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3 flex-shrink-0"><!$><!/><!$><!/>`), _tmpl$17 = /* @__PURE__ */ web.template(`<button type=button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm">×`), _tmpl$18 = /* @__PURE__ */ web.template(`<div class="relative mb-3"><span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none text-sm">🔍</span><input type=text class="w-full max-w-xs min-w-[200px] pl-8 pr-8 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 outline-none"><!$><!/>`), _tmpl$19 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2">`), _tmpl$20 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>`), _tmpl$21 = /* @__PURE__ */ web.template(`<select class="ml-2 px-1 py-0.5 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300"data-mcp-ui-action=page-size>`), _tmpl$22 = /* @__PURE__ */ web.template(`<span class=text-gray-400>`), _tmpl$23 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span><!$><!/>–<!$><!/> / <!$><!/></span><div class="flex items-center gap-2"><button type=button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors"data-mcp-ui-action=page-prev><span aria-hidden=true>◀</span></button><span aria-live=polite><!$><!/> / <!$><!/></span><button type=button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors"data-mcp-ui-action=page-next><span aria-hidden=true>▶</span></button><!$><!/>`), _tmpl$24 = /* @__PURE__ */ web.template(`<div><!$><!/><div><!$><!/><!$><!/><div role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-100 dark:bg-gray-900 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/>`), _tmpl$25 = /* @__PURE__ */ web.template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-100 dark:bg-gray-900 cursor-pointer select-none hover:bg-gray-200 dark:hover:bg-gray-800 transition-colors"><span class="inline-flex items-center gap-1"><!$><!/><span class="text-[10px] leading-none">`), _tmpl$26 = /* @__PURE__ */ web.template(`<option>`), _tmpl$27 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$28 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$29 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$30 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$31 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><!$><!/>`), _tmpl$32 = /* @__PURE__ */ web.template(`<img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy>`, true, false, false), _tmpl$33 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`), _tmpl$34 = /* @__PURE__ */ web.template(`<a target=_blank rel="noopener noreferrer"class=cursor-zoom-in>`), _tmpl$35 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$36 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"loading=lazy></iframe><!$><!/>`, true, false, false), _tmpl$37 = /* @__PURE__ */ web.template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$38 = /* @__PURE__ */ web.template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$39 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$40 = /* @__PURE__ */ web.template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$41 = /* @__PURE__ */ web.template(`<div class="inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 text-xs text-yellow-800 dark:text-yellow-200"role=alert><svg xmlns=http://www.w3.org/2000/svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1=12 y1=9 x2=12 y2=13></line><line x1=12 y1=17 x2=12.01 y2=17></line></svg><span>`), _tmpl$42 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100"></p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$43 = /* @__PURE__ */ web.template(`<div role=alert class="w-full rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:border-amber-700/50 dark:bg-amber-900/20 dark:text-amber-200"><!$><!/> <code class=font-mono>`), _tmpl$44 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$45 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$46 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$47 = /* @__PURE__ */ web.template(`<button type=button><!$><!/><!$><!/><!$><!/>`), _tmpl$48 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">`), _tmpl$49 = /* @__PURE__ */ web.template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300"></p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$50 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$51 = /* @__PURE__ */ web.template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200"></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$52 = /* @__PURE__ */ web.template(`<li>`), _tmpl$53 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$54 = /* @__PURE__ */ web.template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/>`), _tmpl$55 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"data-mcp-ui-grid></div><!$><!/>`), _tmpl$56 = /* @__PURE__ */ web.template(`<div class=min-w-0>`);
|
|
68
|
+
var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button data-mcp-ui-action=copy type=button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700"><p class="text-red-500 dark:text-red-400 text-sm">`), _tmpl$5 = /* @__PURE__ */ web.template(`<div class=p-3>`), _tmpl$6 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$7 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium"></p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$8 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$9 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$0 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/><!$><!/>`), _tmpl$1 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$10 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$11 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6">`), _tmpl$12 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$13 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">`), _tmpl$14 = /* @__PURE__ */ web.template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"aria-haspopup=menu><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$15 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">`), _tmpl$16 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3 flex-shrink-0"><!$><!/><!$><!/>`), _tmpl$17 = /* @__PURE__ */ web.template(`<button type=button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm">×`), _tmpl$18 = /* @__PURE__ */ web.template(`<div class="relative mb-3"><span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none text-sm">🔍</span><input type=text class="w-full max-w-xs min-w-[200px] pl-8 pr-8 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 outline-none"><!$><!/>`), _tmpl$19 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2">`), _tmpl$20 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>`), _tmpl$21 = /* @__PURE__ */ web.template(`<select class="ml-2 px-1 py-0.5 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300"data-mcp-ui-action=page-size>`), _tmpl$22 = /* @__PURE__ */ web.template(`<span class=text-gray-400>`), _tmpl$23 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span><!$><!/>–<!$><!/> / <!$><!/></span><div class="flex items-center gap-2"><button type=button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors"data-mcp-ui-action=page-prev><span aria-hidden=true>◀</span></button><span aria-live=polite><!$><!/> / <!$><!/></span><button type=button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors"data-mcp-ui-action=page-next><span aria-hidden=true>▶</span></button><!$><!/>`), _tmpl$24 = /* @__PURE__ */ web.template(`<div><!$><!/><div><!$><!/><!$><!/><div role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-100 dark:bg-gray-900 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/><!$><!/>`), _tmpl$25 = /* @__PURE__ */ web.template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-100 dark:bg-gray-900 cursor-pointer select-none hover:bg-gray-200 dark:hover:bg-gray-800 transition-colors"><span class="inline-flex items-center gap-1"><!$><!/><span class="text-[10px] leading-none">`), _tmpl$26 = /* @__PURE__ */ web.template(`<option>`), _tmpl$27 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$28 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$29 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$30 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$31 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><!$><!/>`), _tmpl$32 = /* @__PURE__ */ web.template(`<img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy>`, true, false, false), _tmpl$33 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`), _tmpl$34 = /* @__PURE__ */ web.template(`<a target=_blank rel="noopener noreferrer"class=cursor-zoom-in>`), _tmpl$35 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$36 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"loading=lazy></iframe><!$><!/>`, true, false, false), _tmpl$37 = /* @__PURE__ */ web.template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$38 = /* @__PURE__ */ web.template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$39 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$40 = /* @__PURE__ */ web.template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$41 = /* @__PURE__ */ web.template(`<div class="inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 text-xs text-yellow-800 dark:text-yellow-200"role=alert><svg xmlns=http://www.w3.org/2000/svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1=12 y1=9 x2=12 y2=13></line><line x1=12 y1=17 x2=12.01 y2=17></line></svg><span>`), _tmpl$42 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100"></p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$43 = /* @__PURE__ */ web.template(`<div role=alert class="w-full rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:border-amber-700/50 dark:bg-amber-900/20 dark:text-amber-200"><!$><!/> <code class=font-mono>`), _tmpl$44 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$45 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$46 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$47 = /* @__PURE__ */ web.template(`<button type=button><!$><!/><!$><!/><!$><!/>`), _tmpl$48 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">`), _tmpl$49 = /* @__PURE__ */ web.template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300"></p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$50 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$51 = /* @__PURE__ */ web.template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200"></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$52 = /* @__PURE__ */ web.template(`<li>`), _tmpl$53 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$54 = /* @__PURE__ */ web.template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/>`), _tmpl$55 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"data-mcp-ui-grid></div><!$><!/>`), _tmpl$56 = /* @__PURE__ */ web.template(`<div class=min-w-0>`);
|
|
65
69
|
function CopyButton(props) {
|
|
66
70
|
const strings = MCPUIStringsContext.useMCPUIStrings();
|
|
67
71
|
const [copied, setCopied] = solidJs.createSignal(false);
|
|
@@ -216,7 +220,8 @@ function ChartRenderer(props) {
|
|
|
216
220
|
return strings.chartQuickchartCaption;
|
|
217
221
|
}
|
|
218
222
|
}, () => degradedProjections.chartToDegradedTable(params() ?? {}, {
|
|
219
|
-
series: strings.degradedSeries
|
|
223
|
+
series: strings.degradedSeries,
|
|
224
|
+
withUnit: strings.chartLabelWithUnit
|
|
220
225
|
}))));
|
|
221
226
|
return _el$7;
|
|
222
227
|
}
|
|
@@ -308,7 +313,7 @@ function ChartRenderer(props) {
|
|
|
308
313
|
}
|
|
309
314
|
const HIGHLIGHT_MARK_CLASS = "bg-yellow-200 dark:bg-[#222F49] text-inherit rounded px-0.5";
|
|
310
315
|
function highlightQuery(html, query) {
|
|
311
|
-
var _a;
|
|
316
|
+
var _a, _b;
|
|
312
317
|
const q = query.trim();
|
|
313
318
|
if (!q) return html;
|
|
314
319
|
if (typeof document === "undefined") return html;
|
|
@@ -319,6 +324,7 @@ function highlightQuery(html, query) {
|
|
|
319
324
|
const walker = document.createTreeWalker(template.content, NodeFilter.SHOW_TEXT);
|
|
320
325
|
const textNodes = [];
|
|
321
326
|
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
327
|
+
if ((_a = node.parentElement) == null ? void 0 : _a.closest("math")) continue;
|
|
322
328
|
textNodes.push(node);
|
|
323
329
|
}
|
|
324
330
|
for (const node of textNodes) {
|
|
@@ -346,7 +352,7 @@ function highlightQuery(html, query) {
|
|
|
346
352
|
if (cursor < text.length) {
|
|
347
353
|
fragment.appendChild(document.createTextNode(text.slice(cursor)));
|
|
348
354
|
}
|
|
349
|
-
(
|
|
355
|
+
(_b = node.parentNode) == null ? void 0 : _b.replaceChild(fragment, node);
|
|
350
356
|
}
|
|
351
357
|
return template.innerHTML;
|
|
352
358
|
}
|
|
@@ -374,7 +380,7 @@ function transformCellCitations(text, ctx) {
|
|
|
374
380
|
});
|
|
375
381
|
});
|
|
376
382
|
}
|
|
377
|
-
function renderCellValue(value, citationCtx) {
|
|
383
|
+
function renderCellValue(value, citationCtx, mathRenderer) {
|
|
378
384
|
if (value === null || value === void 0) {
|
|
379
385
|
return "-";
|
|
380
386
|
}
|
|
@@ -396,14 +402,16 @@ function renderCellValue(value, citationCtx) {
|
|
|
396
402
|
}
|
|
397
403
|
}
|
|
398
404
|
let strValue = String(value);
|
|
399
|
-
strValue =
|
|
400
|
-
strValue = strValue.replace(/^undefined\s*[–-]\s*/gi, "");
|
|
405
|
+
strValue = missingValue.stripUndefinedDebris(strValue);
|
|
401
406
|
if (strValue.trim().toLowerCase() === "undefined") {
|
|
402
407
|
return "-";
|
|
403
408
|
}
|
|
404
409
|
if (strValue.trim() === "") {
|
|
405
410
|
return "-";
|
|
406
411
|
}
|
|
412
|
+
if (mathRenderer && strValue.includes("$")) {
|
|
413
|
+
return mathMarkdown.parseMathMarkdown(strValue, mathRenderer, "cellMarkdown", citationCtx ? (text) => transformCellCitations(text, citationCtx) : void 0);
|
|
414
|
+
}
|
|
407
415
|
const markdownLinkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
|
|
408
416
|
if (markdownLinkRegex.test(strValue)) {
|
|
409
417
|
const htmlValue = strValue.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer" class="text-blue-600 dark:text-blue-400 hover:underline">$1</a>');
|
|
@@ -429,6 +437,7 @@ function TableRenderer(props) {
|
|
|
429
437
|
const tableParams = props.component.params;
|
|
430
438
|
let scrollContainerRef;
|
|
431
439
|
const strings = MCPUIStringsContext.useMCPUIStrings();
|
|
440
|
+
const mathRenderer = MCPUIMathContext.useMCPUIMath();
|
|
432
441
|
const citationCtx = tableParams.citationMap ? {
|
|
433
442
|
map: tableParams.citationMap,
|
|
434
443
|
render: tableParams.citationRender,
|
|
@@ -464,12 +473,14 @@ function TableRenderer(props) {
|
|
|
464
473
|
const dir = sortDir();
|
|
465
474
|
if (!key || !dir) return r;
|
|
466
475
|
const col = columns().find((c) => c.key === key);
|
|
467
|
-
const
|
|
476
|
+
const firstObserved = (_a = r.find((row) => !missingValue.isMissingCellValue(row == null ? void 0 : row[key]))) == null ? void 0 : _a[key];
|
|
477
|
+
const isNum = (col == null ? void 0 : col.type) === "number" || typeof firstObserved === "number";
|
|
468
478
|
return [...r].sort((a, b) => {
|
|
469
479
|
const va = a[key], vb = b[key];
|
|
470
|
-
|
|
471
|
-
if (
|
|
472
|
-
if (
|
|
480
|
+
const missA = missingValue.isMissingCellValue(va), missB = missingValue.isMissingCellValue(vb);
|
|
481
|
+
if (missA && missB) return 0;
|
|
482
|
+
if (missA) return 1;
|
|
483
|
+
if (missB) return -1;
|
|
473
484
|
let cmp;
|
|
474
485
|
if (isNum) {
|
|
475
486
|
cmp = (Number(va) || 0) - (Number(vb) || 0);
|
|
@@ -505,7 +516,7 @@ function TableRenderer(props) {
|
|
|
505
516
|
const cols = columns();
|
|
506
517
|
return sortedRows().filter((row) => cols.some((col) => {
|
|
507
518
|
const val = row[col.key];
|
|
508
|
-
if (val
|
|
519
|
+
if (missingValue.isMissingCellValue(val)) return false;
|
|
509
520
|
return normalize(String(val)).includes(q);
|
|
510
521
|
}));
|
|
511
522
|
});
|
|
@@ -673,6 +684,10 @@ ${dataRows}`;
|
|
|
673
684
|
}
|
|
674
685
|
};
|
|
675
686
|
const tableId = `table-${Math.random().toString(36).slice(2, 9)}`;
|
|
687
|
+
const hasMissingCells = solidJs.createMemo(() => {
|
|
688
|
+
const cols = columns();
|
|
689
|
+
return allRows().some((row) => cols.some((col) => missingValue.isMissingCellValue(row == null ? void 0 : row[col.key])));
|
|
690
|
+
});
|
|
676
691
|
const StandardTableBody = () => (() => {
|
|
677
692
|
var _el$25 = web.getNextElement(_tmpl$1);
|
|
678
693
|
web.insert(_el$25, web.createComponent(solidJs.For, {
|
|
@@ -687,8 +702,18 @@ ${dataRows}`;
|
|
|
687
702
|
},
|
|
688
703
|
children: (column) => (() => {
|
|
689
704
|
var _el$27 = web.getNextElement(_tmpl$11);
|
|
690
|
-
web.insert(_el$27, web.createComponent(
|
|
691
|
-
|
|
705
|
+
web.insert(_el$27, web.createComponent(solidJs.Show, {
|
|
706
|
+
get when() {
|
|
707
|
+
return !missingValue.isMissingCellValue(row[column.key]);
|
|
708
|
+
},
|
|
709
|
+
get fallback() {
|
|
710
|
+
return web.createComponent(MissingValue.MissingValueMark, {});
|
|
711
|
+
},
|
|
712
|
+
get children() {
|
|
713
|
+
return web.createComponent(SafeHtml.SafeHtml, {
|
|
714
|
+
html: () => highlightQuery(renderCellValue(row[column.key], citationCtx, mathRenderer()), debouncedQuery())
|
|
715
|
+
});
|
|
716
|
+
}
|
|
692
717
|
}));
|
|
693
718
|
return _el$27;
|
|
694
719
|
})()
|
|
@@ -722,8 +747,18 @@ ${dataRows}`;
|
|
|
722
747
|
},
|
|
723
748
|
children: (column) => (() => {
|
|
724
749
|
var _el$30 = web.getNextElement(_tmpl$11);
|
|
725
|
-
web.insert(_el$30, web.createComponent(
|
|
726
|
-
|
|
750
|
+
web.insert(_el$30, web.createComponent(solidJs.Show, {
|
|
751
|
+
get when() {
|
|
752
|
+
return !missingValue.isMissingCellValue(row[column.key]);
|
|
753
|
+
},
|
|
754
|
+
get fallback() {
|
|
755
|
+
return web.createComponent(MissingValue.MissingValueMark, {});
|
|
756
|
+
},
|
|
757
|
+
get children() {
|
|
758
|
+
return web.createComponent(SafeHtml.SafeHtml, {
|
|
759
|
+
html: () => highlightQuery(renderCellValue(row[column.key], citationCtx, mathRenderer()), debouncedQuery())
|
|
760
|
+
});
|
|
761
|
+
}
|
|
727
762
|
}));
|
|
728
763
|
return _el$30;
|
|
729
764
|
})()
|
|
@@ -759,7 +794,7 @@ ${dataRows}`;
|
|
|
759
794
|
},
|
|
760
795
|
onExpandedChange: setSelfExpanded,
|
|
761
796
|
get children() {
|
|
762
|
-
var _el$31 = web.getNextElement(_tmpl$24), _el$
|
|
797
|
+
var _el$31 = web.getNextElement(_tmpl$24), _el$94 = _el$31.firstChild, [_el$95, _co$20] = web.getNextMarker(_el$94.nextSibling), _el$39 = _el$95.nextSibling, _el$84 = _el$39.firstChild, [_el$85, _co$15] = web.getNextMarker(_el$84.nextSibling), _el$86 = _el$85.nextSibling, [_el$87, _co$16] = web.getNextMarker(_el$86.nextSibling), _el$53 = _el$87.nextSibling, _el$54 = _el$53.firstChild, _el$55 = _el$54.firstChild, _el$56 = _el$55.firstChild, _el$57 = _el$55.nextSibling, [_el$58, _co$0] = web.getNextMarker(_el$57.nextSibling), _el$88 = _el$53.nextSibling, [_el$89, _co$17] = web.getNextMarker(_el$88.nextSibling), _el$90 = _el$89.nextSibling, [_el$91, _co$18] = web.getNextMarker(_el$90.nextSibling), _el$92 = _el$91.nextSibling, [_el$93, _co$19] = web.getNextMarker(_el$92.nextSibling);
|
|
763
798
|
web.insert(_el$31, web.createComponent(solidJs.Show, {
|
|
764
799
|
when: exportable,
|
|
765
800
|
get fallback() {
|
|
@@ -834,7 +869,7 @@ ${dataRows}`;
|
|
|
834
869
|
web.runHydrationEvents();
|
|
835
870
|
return _el$32;
|
|
836
871
|
}
|
|
837
|
-
}), _el$
|
|
872
|
+
}), _el$95, _co$20);
|
|
838
873
|
web.insert(_el$39, web.createComponent(solidJs.Show, {
|
|
839
874
|
get when() {
|
|
840
875
|
return tableParams.title;
|
|
@@ -911,10 +946,10 @@ ${dataRows}`;
|
|
|
911
946
|
return tableParams.columns;
|
|
912
947
|
},
|
|
913
948
|
children: (column) => (() => {
|
|
914
|
-
var _el$
|
|
915
|
-
web.addEventListener(_el$
|
|
916
|
-
web.insert(_el$
|
|
917
|
-
web.insert(_el$
|
|
949
|
+
var _el$96 = web.getNextElement(_tmpl$25), _el$97 = _el$96.firstChild, _el$99 = _el$97.firstChild, [_el$100, _co$21] = web.getNextMarker(_el$99.nextSibling), _el$98 = _el$100.nextSibling;
|
|
950
|
+
web.addEventListener(_el$96, "click", () => handleSort(column.key));
|
|
951
|
+
web.insert(_el$97, () => column.label, _el$100, _co$21);
|
|
952
|
+
web.insert(_el$98, () => sortIndicator(column.key));
|
|
918
953
|
web.effect((_p$) => {
|
|
919
954
|
var _v$20 = column.width ? {
|
|
920
955
|
width: column.width
|
|
@@ -924,16 +959,16 @@ ${dataRows}`;
|
|
|
924
959
|
"opacity-30": sortKey() !== column.key,
|
|
925
960
|
"opacity-100 text-blue-600 dark:text-blue-400": sortKey() === column.key
|
|
926
961
|
};
|
|
927
|
-
_p$.e = web.style(_el$
|
|
928
|
-
_v$21 !== _p$.t && web.setAttribute(_el$
|
|
929
|
-
_p$.a = web.classList(_el$
|
|
962
|
+
_p$.e = web.style(_el$96, _v$20, _p$.e);
|
|
963
|
+
_v$21 !== _p$.t && web.setAttribute(_el$96, "title", _p$.t = _v$21);
|
|
964
|
+
_p$.a = web.classList(_el$98, _v$22, _p$.a);
|
|
930
965
|
return _p$;
|
|
931
966
|
}, {
|
|
932
967
|
e: void 0,
|
|
933
968
|
t: void 0,
|
|
934
969
|
a: void 0
|
|
935
970
|
});
|
|
936
|
-
return _el$
|
|
971
|
+
return _el$96;
|
|
937
972
|
})()
|
|
938
973
|
}));
|
|
939
974
|
web.insert(_el$54, web.createComponent(solidJs.Show, {
|
|
@@ -947,6 +982,16 @@ ${dataRows}`;
|
|
|
947
982
|
return web.createComponent(VirtualizedTableBody, {});
|
|
948
983
|
}
|
|
949
984
|
}), _el$58, _co$0);
|
|
985
|
+
web.insert(_el$39, web.createComponent(solidJs.Show, {
|
|
986
|
+
get when() {
|
|
987
|
+
return hasMissingCells();
|
|
988
|
+
},
|
|
989
|
+
get children() {
|
|
990
|
+
return web.createComponent(MissingValue.MissingValueLegend, {
|
|
991
|
+
"class": "mt-2 px-1"
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
}), _el$89, _co$17);
|
|
950
995
|
web.insert(_el$39, web.createComponent(solidJs.Show, {
|
|
951
996
|
get when() {
|
|
952
997
|
return tableParams.pagination;
|
|
@@ -960,7 +1005,7 @@ ${dataRows}`;
|
|
|
960
1005
|
}));
|
|
961
1006
|
return _el$59;
|
|
962
1007
|
}
|
|
963
|
-
}), _el$
|
|
1008
|
+
}), _el$91, _co$18);
|
|
964
1009
|
web.insert(_el$39, web.createComponent(solidJs.Show, {
|
|
965
1010
|
get when() {
|
|
966
1011
|
return needsClientPagination();
|
|
@@ -987,10 +1032,10 @@ ${dataRows}`;
|
|
|
987
1032
|
return pageSizeOptions();
|
|
988
1033
|
},
|
|
989
1034
|
children: (opt) => (() => {
|
|
990
|
-
var _el$
|
|
991
|
-
web.insert(_el$
|
|
992
|
-
web.effect(() => web.setProperty(_el$
|
|
993
|
-
return _el$
|
|
1035
|
+
var _el$101 = web.getNextElement(_tmpl$26);
|
|
1036
|
+
web.insert(_el$101, () => opt.label);
|
|
1037
|
+
web.effect(() => web.setProperty(_el$101, "value", opt.value));
|
|
1038
|
+
return _el$101;
|
|
994
1039
|
})()
|
|
995
1040
|
}));
|
|
996
1041
|
web.effect(() => web.setAttribute(_el$80, "aria-label", strings.paginationPageSize));
|
|
@@ -1019,7 +1064,7 @@ ${dataRows}`;
|
|
|
1019
1064
|
web.runHydrationEvents();
|
|
1020
1065
|
return _el$61;
|
|
1021
1066
|
}
|
|
1022
|
-
}), _el$
|
|
1067
|
+
}), _el$93, _co$19);
|
|
1023
1068
|
web.effect((_p$) => {
|
|
1024
1069
|
var _v$14 = `relative w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group ${isExpanded() ? "flex-1 min-h-0 flex flex-col" : "h-full"} ${tableParams.className || ""}`, _v$15 = `p-4 ${isExpanded() ? "flex-1 min-h-0 flex flex-col" : ""}`, _v$16 = `overflow-x-auto ${isExpanded() ? "flex-1 min-h-0" : ""}`, _v$17 = (
|
|
1025
1070
|
// v6.1.0 — when expanded, the scroll container fills the
|
|
@@ -1080,53 +1125,53 @@ function MetricRenderer(props) {
|
|
|
1080
1125
|
return `${title}: ${value}${unit ? " " + unit : ""}`;
|
|
1081
1126
|
};
|
|
1082
1127
|
return (() => {
|
|
1083
|
-
var _el$
|
|
1084
|
-
web.insert(_el$
|
|
1128
|
+
var _el$102 = web.getNextElement(_tmpl$30), _el$124 = _el$102.firstChild, [_el$125, _co$27] = web.getNextMarker(_el$124.nextSibling), _el$103 = _el$125.nextSibling, _el$104 = _el$103.firstChild, _el$105 = _el$104.firstChild, _el$106 = _el$105.nextSibling, _el$107 = _el$106.firstChild, _el$109 = _el$107.nextSibling, [_el$110, _co$22] = web.getNextMarker(_el$109.nextSibling), _el$120 = _el$104.nextSibling, [_el$121, _co$25] = web.getNextMarker(_el$120.nextSibling), _el$122 = _el$121.nextSibling, [_el$123, _co$26] = web.getNextMarker(_el$122.nextSibling);
|
|
1129
|
+
web.insert(_el$102, web.createComponent(CopyButton, {
|
|
1085
1130
|
getText: getMetricText,
|
|
1086
1131
|
get title() {
|
|
1087
1132
|
return strings.copyMetric;
|
|
1088
1133
|
},
|
|
1089
1134
|
position: "top-right"
|
|
1090
|
-
}), _el$
|
|
1091
|
-
web.insert(_el$
|
|
1092
|
-
web.insert(_el$
|
|
1093
|
-
web.insert(_el$
|
|
1135
|
+
}), _el$125, _co$27);
|
|
1136
|
+
web.insert(_el$105, () => metricParams.title);
|
|
1137
|
+
web.insert(_el$107, () => metricParams.value);
|
|
1138
|
+
web.insert(_el$106, web.createComponent(solidJs.Show, {
|
|
1094
1139
|
get when() {
|
|
1095
1140
|
return metricParams.unit;
|
|
1096
1141
|
},
|
|
1097
1142
|
get children() {
|
|
1098
|
-
var _el$
|
|
1099
|
-
web.insert(_el$
|
|
1100
|
-
return _el$
|
|
1143
|
+
var _el$108 = web.getNextElement(_tmpl$27);
|
|
1144
|
+
web.insert(_el$108, () => metricParams.unit);
|
|
1145
|
+
return _el$108;
|
|
1101
1146
|
}
|
|
1102
|
-
}), _el$
|
|
1103
|
-
web.insert(_el$
|
|
1147
|
+
}), _el$110, _co$22);
|
|
1148
|
+
web.insert(_el$103, web.createComponent(solidJs.Show, {
|
|
1104
1149
|
get when() {
|
|
1105
1150
|
return metricParams.trend;
|
|
1106
1151
|
},
|
|
1107
1152
|
get children() {
|
|
1108
|
-
var _el$
|
|
1109
|
-
_el$
|
|
1110
|
-
web.insert(_el$
|
|
1153
|
+
var _el$111 = web.getNextElement(_tmpl$28), _el$112 = _el$111.firstChild, _el$115 = _el$112.firstChild, [_el$116, _co$23] = web.getNextMarker(_el$115.nextSibling), _el$113 = _el$116.nextSibling, _el$117 = _el$113.nextSibling, [_el$118, _co$24] = web.getNextMarker(_el$117.nextSibling);
|
|
1154
|
+
_el$118.nextSibling;
|
|
1155
|
+
web.insert(_el$112, (() => {
|
|
1111
1156
|
var _c$ = web.memo(() => metricParams.trend.direction === "up");
|
|
1112
1157
|
return () => _c$() ? "�" : metricParams.trend.direction === "down" ? "�" : "�";
|
|
1113
|
-
})(), _el$
|
|
1114
|
-
web.insert(_el$
|
|
1115
|
-
web.effect(() => web.className(_el$
|
|
1116
|
-
return _el$
|
|
1158
|
+
})(), _el$116, _co$23);
|
|
1159
|
+
web.insert(_el$112, () => Math.abs(metricParams.trend.value), _el$118, _co$24);
|
|
1160
|
+
web.effect(() => web.className(_el$112, `text-sm font-medium ${metricParams.trend.direction === "up" ? "text-green-600 dark:text-green-400" : metricParams.trend.direction === "down" ? "text-red-600 dark:text-red-400" : "text-gray-600 dark:text-gray-400"}`));
|
|
1161
|
+
return _el$111;
|
|
1117
1162
|
}
|
|
1118
|
-
}), _el$
|
|
1119
|
-
web.insert(_el$
|
|
1163
|
+
}), _el$121, _co$25);
|
|
1164
|
+
web.insert(_el$103, web.createComponent(solidJs.Show, {
|
|
1120
1165
|
get when() {
|
|
1121
1166
|
return metricParams.subtitle;
|
|
1122
1167
|
},
|
|
1123
1168
|
get children() {
|
|
1124
|
-
var _el$
|
|
1125
|
-
web.insert(_el$
|
|
1126
|
-
return _el$
|
|
1169
|
+
var _el$119 = web.getNextElement(_tmpl$29);
|
|
1170
|
+
web.insert(_el$119, () => metricParams.subtitle);
|
|
1171
|
+
return _el$119;
|
|
1127
1172
|
}
|
|
1128
|
-
}), _el$
|
|
1129
|
-
return _el$
|
|
1173
|
+
}), _el$123, _co$26);
|
|
1174
|
+
return _el$102;
|
|
1130
1175
|
})();
|
|
1131
1176
|
}
|
|
1132
1177
|
function extractImageFromMarkdown(content, fallbackAlt) {
|
|
@@ -1144,6 +1189,7 @@ function extractImageFromMarkdown(content, fallbackAlt) {
|
|
|
1144
1189
|
}
|
|
1145
1190
|
function TextRenderer(props) {
|
|
1146
1191
|
const strings = MCPUIStringsContext.useMCPUIStrings();
|
|
1192
|
+
const mathRenderer = MCPUIMathContext.useMCPUIMath();
|
|
1147
1193
|
const textParams = props.component.params;
|
|
1148
1194
|
const imageData = solidJs.createMemo(() => {
|
|
1149
1195
|
if (textParams.markdown && textParams.content) {
|
|
@@ -1168,6 +1214,8 @@ function TextRenderer(props) {
|
|
|
1168
1214
|
return escapeHtml.escapeHtml(String(raw));
|
|
1169
1215
|
}
|
|
1170
1216
|
if (textParams.markdown && !imageData()) {
|
|
1217
|
+
const renderMath = mathRenderer();
|
|
1218
|
+
if (renderMath) return mathMarkdown.parseMathMarkdown(String(raw), renderMath, "prose");
|
|
1171
1219
|
return sanitizeHtml.sanitizeHtml(marked.marked.parse(raw, {
|
|
1172
1220
|
async: false
|
|
1173
1221
|
}), sanitizeHtml.SANITIZE_PROFILES.prose);
|
|
@@ -1183,40 +1231,40 @@ function TextRenderer(props) {
|
|
|
1183
1231
|
},
|
|
1184
1232
|
get fallback() {
|
|
1185
1233
|
return (() => {
|
|
1186
|
-
var _el$
|
|
1187
|
-
web.insert(_el$
|
|
1234
|
+
var _el$126 = web.getNextElement(_tmpl$31), _el$127 = _el$126.firstChild, [_el$128, _co$28] = web.getNextMarker(_el$127.nextSibling), _el$129 = _el$128.nextSibling, [_el$130, _co$29] = web.getNextMarker(_el$129.nextSibling);
|
|
1235
|
+
web.insert(_el$126, web.createComponent(CopyButton, {
|
|
1188
1236
|
getText: getTextContent,
|
|
1189
1237
|
get title() {
|
|
1190
1238
|
return strings.copyText;
|
|
1191
1239
|
},
|
|
1192
1240
|
position: "top-right"
|
|
1193
|
-
}), _el$
|
|
1194
|
-
web.insert(_el$
|
|
1241
|
+
}), _el$128, _co$28);
|
|
1242
|
+
web.insert(_el$126, web.createComponent(SafeHtml.SafeHtml, {
|
|
1195
1243
|
get ["class"]() {
|
|
1196
1244
|
return `prose prose-sm dark:prose-invert max-w-none ${textParams.className || ""}`;
|
|
1197
1245
|
},
|
|
1198
1246
|
html: htmlContent
|
|
1199
|
-
}), _el$
|
|
1200
|
-
return _el$
|
|
1247
|
+
}), _el$130, _co$29);
|
|
1248
|
+
return _el$126;
|
|
1201
1249
|
})();
|
|
1202
1250
|
},
|
|
1203
1251
|
children: (data) => {
|
|
1204
1252
|
const image = () => (() => {
|
|
1205
|
-
var _el$
|
|
1253
|
+
var _el$131 = web.getNextElement(_tmpl$32);
|
|
1206
1254
|
web.effect((_p$) => {
|
|
1207
1255
|
var _v$23 = data().imageUrl, _v$24 = data().alt;
|
|
1208
|
-
_v$23 !== _p$.e && web.setAttribute(_el$
|
|
1209
|
-
_v$24 !== _p$.t && web.setAttribute(_el$
|
|
1256
|
+
_v$23 !== _p$.e && web.setAttribute(_el$131, "src", _p$.e = _v$23);
|
|
1257
|
+
_v$24 !== _p$.t && web.setAttribute(_el$131, "alt", _p$.t = _v$24);
|
|
1210
1258
|
return _p$;
|
|
1211
1259
|
}, {
|
|
1212
1260
|
e: void 0,
|
|
1213
1261
|
t: void 0
|
|
1214
1262
|
});
|
|
1215
|
-
return _el$
|
|
1263
|
+
return _el$131;
|
|
1216
1264
|
})();
|
|
1217
1265
|
return (() => {
|
|
1218
|
-
var _el$
|
|
1219
|
-
web.insert(_el$
|
|
1266
|
+
var _el$132 = web.getNextElement(_tmpl$33), _el$133 = _el$132.firstChild, _el$134 = _el$133.nextSibling, _el$135 = _el$134.firstChild;
|
|
1267
|
+
web.insert(_el$133, web.createComponent(solidJs.Show, {
|
|
1220
1268
|
get when() {
|
|
1221
1269
|
return data().linkUrl;
|
|
1222
1270
|
},
|
|
@@ -1224,14 +1272,14 @@ function TextRenderer(props) {
|
|
|
1224
1272
|
return image();
|
|
1225
1273
|
},
|
|
1226
1274
|
children: (href) => (() => {
|
|
1227
|
-
var _el$
|
|
1228
|
-
web.insert(_el$
|
|
1229
|
-
web.effect(() => web.setAttribute(_el$
|
|
1230
|
-
return _el$
|
|
1275
|
+
var _el$136 = web.getNextElement(_tmpl$34);
|
|
1276
|
+
web.insert(_el$136, image);
|
|
1277
|
+
web.effect(() => web.setAttribute(_el$136, "href", href()));
|
|
1278
|
+
return _el$136;
|
|
1231
1279
|
})()
|
|
1232
1280
|
}));
|
|
1233
|
-
web.insert(_el$
|
|
1234
|
-
return _el$
|
|
1281
|
+
web.insert(_el$135, () => data().credit);
|
|
1282
|
+
return _el$132;
|
|
1235
1283
|
})();
|
|
1236
1284
|
}
|
|
1237
1285
|
});
|
|
@@ -1244,34 +1292,34 @@ function IframeRenderer(props) {
|
|
|
1244
1292
|
customTrustedDomains: config.customTrustedIframeDomains
|
|
1245
1293
|
});
|
|
1246
1294
|
return (() => {
|
|
1247
|
-
var _el$
|
|
1248
|
-
web.insert(_el$
|
|
1295
|
+
var _el$137 = web.getNextElement(_tmpl$36), _el$141 = _el$137.firstChild, [_el$142, _co$30] = web.getNextMarker(_el$141.nextSibling), _el$140 = _el$142.nextSibling, _el$143 = _el$140.nextSibling, [_el$144, _co$31] = web.getNextMarker(_el$143.nextSibling);
|
|
1296
|
+
web.insert(_el$137, web.createComponent(solidJs.Show, {
|
|
1249
1297
|
get when() {
|
|
1250
1298
|
return params.title;
|
|
1251
1299
|
},
|
|
1252
1300
|
get children() {
|
|
1253
|
-
var _el$
|
|
1254
|
-
web.insert(_el$
|
|
1255
|
-
return _el$
|
|
1301
|
+
var _el$138 = web.getNextElement(_tmpl$35), _el$139 = _el$138.firstChild;
|
|
1302
|
+
web.insert(_el$139, () => params.title);
|
|
1303
|
+
return _el$138;
|
|
1256
1304
|
}
|
|
1257
|
-
}), _el$
|
|
1258
|
-
web.insert(_el$
|
|
1305
|
+
}), _el$142, _co$30);
|
|
1306
|
+
web.insert(_el$137, web.createComponent(IframeFallbackLink.IframeFallbackLink, {
|
|
1259
1307
|
get url() {
|
|
1260
1308
|
return params.url;
|
|
1261
1309
|
},
|
|
1262
1310
|
"class": "border-t border-gray-200 dark:border-gray-700"
|
|
1263
|
-
}), _el$
|
|
1311
|
+
}), _el$144, _co$31);
|
|
1264
1312
|
web.effect((_p$) => {
|
|
1265
1313
|
var _v$25 = params.url, _v$26 = params.title || strings.iframeTitle, _v$27 = `height: ${params.height || "400px"}; min-height: 300px;`, _v$28 = validation.getIframeSandbox(params.url, trustOptions()), _v$29 = iframeCoep.shouldSetCredentialless(params.url, config, {
|
|
1266
1314
|
// This iframe's sandbox never carries `allow-same-origin` for an
|
|
1267
1315
|
// untrusted host, so it already runs without cookies.
|
|
1268
1316
|
sandboxedWithoutSameOrigin: !validation.isTrustedIframeDomain(params.url, trustOptions())
|
|
1269
1317
|
}) || void 0;
|
|
1270
|
-
_v$25 !== _p$.e && web.setAttribute(_el$
|
|
1271
|
-
_v$26 !== _p$.t && web.setAttribute(_el$
|
|
1272
|
-
_p$.a = web.style(_el$
|
|
1273
|
-
_v$28 !== _p$.o && web.setAttribute(_el$
|
|
1274
|
-
_v$29 !== _p$.i && web.setAttribute(_el$
|
|
1318
|
+
_v$25 !== _p$.e && web.setAttribute(_el$140, "src", _p$.e = _v$25);
|
|
1319
|
+
_v$26 !== _p$.t && web.setAttribute(_el$140, "title", _p$.t = _v$26);
|
|
1320
|
+
_p$.a = web.style(_el$140, _v$27, _p$.a);
|
|
1321
|
+
_v$28 !== _p$.o && web.setAttribute(_el$140, "sandbox", _p$.o = _v$28);
|
|
1322
|
+
_v$29 !== _p$.i && web.setAttribute(_el$140, "credentialless", _p$.i = _v$29);
|
|
1275
1323
|
return _p$;
|
|
1276
1324
|
}, {
|
|
1277
1325
|
e: void 0,
|
|
@@ -1280,35 +1328,35 @@ function IframeRenderer(props) {
|
|
|
1280
1328
|
o: void 0,
|
|
1281
1329
|
i: void 0
|
|
1282
1330
|
});
|
|
1283
|
-
return _el$
|
|
1331
|
+
return _el$137;
|
|
1284
1332
|
})();
|
|
1285
1333
|
}
|
|
1286
1334
|
function ImageRenderer(props) {
|
|
1287
1335
|
const strings = MCPUIStringsContext.useMCPUIStrings();
|
|
1288
1336
|
const params = props.component.params;
|
|
1289
1337
|
return (() => {
|
|
1290
|
-
var _el$
|
|
1291
|
-
web.insert(_el$
|
|
1338
|
+
var _el$145 = web.getNextElement(_tmpl$38), _el$146 = _el$145.firstChild, _el$147 = _el$146.firstChild, _el$148 = _el$147.firstChild, _el$151 = _el$146.nextSibling, [_el$152, _co$32] = web.getNextMarker(_el$151.nextSibling);
|
|
1339
|
+
web.insert(_el$145, web.createComponent(solidJs.Show, {
|
|
1292
1340
|
get when() {
|
|
1293
1341
|
return params.caption;
|
|
1294
1342
|
},
|
|
1295
1343
|
get children() {
|
|
1296
|
-
var _el$
|
|
1297
|
-
web.insert(_el$
|
|
1298
|
-
return _el$
|
|
1344
|
+
var _el$149 = web.getNextElement(_tmpl$37), _el$150 = _el$149.firstChild;
|
|
1345
|
+
web.insert(_el$150, () => params.caption);
|
|
1346
|
+
return _el$149;
|
|
1299
1347
|
}
|
|
1300
|
-
}), _el$
|
|
1348
|
+
}), _el$152, _co$32);
|
|
1301
1349
|
web.effect((_p$) => {
|
|
1302
1350
|
var _v$30 = `w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col ${params.className || ""}`, _v$31 = safeUrl.safeUrl(params.url), _v$32 = formatString.formatMCPUIString(strings.imageViewFullSize, {
|
|
1303
1351
|
alt: params.alt || strings.imageAltFallback
|
|
1304
1352
|
}), _v$33 = safeUrl.safeUrl(params.url, {
|
|
1305
1353
|
allowDataImage: true
|
|
1306
1354
|
}), _v$34 = params.alt || strings.imageAlt;
|
|
1307
|
-
_v$30 !== _p$.e && web.className(_el$
|
|
1308
|
-
_v$31 !== _p$.t && web.setAttribute(_el$
|
|
1309
|
-
_v$32 !== _p$.a && web.setAttribute(_el$
|
|
1310
|
-
_v$33 !== _p$.o && web.setAttribute(_el$
|
|
1311
|
-
_v$34 !== _p$.i && web.setAttribute(_el$
|
|
1355
|
+
_v$30 !== _p$.e && web.className(_el$145, _p$.e = _v$30);
|
|
1356
|
+
_v$31 !== _p$.t && web.setAttribute(_el$147, "href", _p$.t = _v$31);
|
|
1357
|
+
_v$32 !== _p$.a && web.setAttribute(_el$147, "aria-label", _p$.a = _v$32);
|
|
1358
|
+
_v$33 !== _p$.o && web.setAttribute(_el$148, "src", _p$.o = _v$33);
|
|
1359
|
+
_v$34 !== _p$.i && web.setAttribute(_el$148, "alt", _p$.i = _v$34);
|
|
1312
1360
|
return _p$;
|
|
1313
1361
|
}, {
|
|
1314
1362
|
e: void 0,
|
|
@@ -1317,34 +1365,34 @@ function ImageRenderer(props) {
|
|
|
1317
1365
|
o: void 0,
|
|
1318
1366
|
i: void 0
|
|
1319
1367
|
});
|
|
1320
|
-
return _el$
|
|
1368
|
+
return _el$145;
|
|
1321
1369
|
})();
|
|
1322
1370
|
}
|
|
1323
1371
|
function LinkRenderer(props) {
|
|
1324
1372
|
const strings = MCPUIStringsContext.useMCPUIStrings();
|
|
1325
1373
|
const params = props.component.params;
|
|
1326
1374
|
return (() => {
|
|
1327
|
-
var _el$
|
|
1328
|
-
_el$
|
|
1329
|
-
web.insert(_el$
|
|
1330
|
-
web.insert(_el$
|
|
1375
|
+
var _el$153 = web.getNextElement(_tmpl$40), _el$154 = _el$153.firstChild, _el$155 = _el$154.nextSibling, _el$156 = _el$155.firstChild, _el$158 = _el$156.nextSibling, [_el$159, _co$33] = web.getNextMarker(_el$158.nextSibling);
|
|
1376
|
+
_el$153.$$click = (e) => e.stopPropagation();
|
|
1377
|
+
web.insert(_el$156, () => params.label || params.url);
|
|
1378
|
+
web.insert(_el$155, web.createComponent(solidJs.Show, {
|
|
1331
1379
|
get when() {
|
|
1332
1380
|
return params.description;
|
|
1333
1381
|
},
|
|
1334
1382
|
get children() {
|
|
1335
|
-
var _el$
|
|
1336
|
-
web.insert(_el$
|
|
1337
|
-
return _el$
|
|
1383
|
+
var _el$157 = web.getNextElement(_tmpl$39);
|
|
1384
|
+
web.insert(_el$157, () => params.description);
|
|
1385
|
+
return _el$157;
|
|
1338
1386
|
}
|
|
1339
|
-
}), _el$
|
|
1387
|
+
}), _el$159, _co$33);
|
|
1340
1388
|
web.effect((_p$) => {
|
|
1341
1389
|
var _v$35 = safeUrl.safeUrl(params.url), _v$36 = formatString.formatMCPUIString(strings.linkOpensInNewTab, {
|
|
1342
1390
|
label: params.label || strings.linkLabel,
|
|
1343
1391
|
description: params.description || params.url
|
|
1344
1392
|
}), _v$37 = `flex items-center gap-3 p-4 bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors group h-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${params.className || ""}`;
|
|
1345
|
-
_v$35 !== _p$.e && web.setAttribute(_el$
|
|
1346
|
-
_v$36 !== _p$.t && web.setAttribute(_el$
|
|
1347
|
-
_v$37 !== _p$.a && web.className(_el$
|
|
1393
|
+
_v$35 !== _p$.e && web.setAttribute(_el$153, "href", _p$.e = _v$35);
|
|
1394
|
+
_v$36 !== _p$.t && web.setAttribute(_el$153, "aria-label", _p$.t = _v$36);
|
|
1395
|
+
_v$37 !== _p$.a && web.className(_el$153, _p$.a = _v$37);
|
|
1348
1396
|
return _p$;
|
|
1349
1397
|
}, {
|
|
1350
1398
|
e: void 0,
|
|
@@ -1352,7 +1400,7 @@ function LinkRenderer(props) {
|
|
|
1352
1400
|
a: void 0
|
|
1353
1401
|
});
|
|
1354
1402
|
web.runHydrationEvents();
|
|
1355
|
-
return _el$
|
|
1403
|
+
return _el$153;
|
|
1356
1404
|
})();
|
|
1357
1405
|
}
|
|
1358
1406
|
function ComponentRenderer(props) {
|
|
@@ -1431,20 +1479,20 @@ function ComponentRenderer(props) {
|
|
|
1431
1479
|
}
|
|
1432
1480
|
if (mode === "inline-warn") {
|
|
1433
1481
|
return (() => {
|
|
1434
|
-
var _el$
|
|
1435
|
-
web.setAttribute(_el$
|
|
1436
|
-
web.insert(_el$
|
|
1482
|
+
var _el$160 = web.getNextElement(_tmpl$41), _el$161 = _el$160.firstChild, _el$162 = _el$161.nextSibling;
|
|
1483
|
+
web.setAttribute(_el$160, "title", firstError);
|
|
1484
|
+
web.insert(_el$162, () => formatString.formatMCPUIString(strings.invalidComponent, {
|
|
1437
1485
|
type: props.component.type
|
|
1438
1486
|
}));
|
|
1439
|
-
web.effect(() => web.setAttribute(_el$
|
|
1440
|
-
return _el$
|
|
1487
|
+
web.effect(() => web.setAttribute(_el$160, "aria-label", strings.validationWarning));
|
|
1488
|
+
return _el$160;
|
|
1441
1489
|
})();
|
|
1442
1490
|
}
|
|
1443
1491
|
return (() => {
|
|
1444
|
-
var _el$
|
|
1445
|
-
web.insert(_el$
|
|
1446
|
-
web.insert(_el$
|
|
1447
|
-
return _el$
|
|
1492
|
+
var _el$163 = web.getNextElement(_tmpl$42), _el$164 = _el$163.firstChild, _el$165 = _el$164.nextSibling;
|
|
1493
|
+
web.insert(_el$164, () => strings.validationError);
|
|
1494
|
+
web.insert(_el$165, firstError);
|
|
1495
|
+
return _el$163;
|
|
1448
1496
|
})();
|
|
1449
1497
|
}
|
|
1450
1498
|
return web.createComponent(GenerativeUIErrorBoundary.GenerativeUIErrorBoundary, {
|
|
@@ -1738,10 +1786,10 @@ function ComponentRenderer(props) {
|
|
|
1738
1786
|
function UnsupportedComponentFallback(props) {
|
|
1739
1787
|
const strings = MCPUIStringsContext.useMCPUIStrings();
|
|
1740
1788
|
return (() => {
|
|
1741
|
-
var _el$
|
|
1742
|
-
web.insert(_el$
|
|
1743
|
-
web.insert(_el$
|
|
1744
|
-
return _el$
|
|
1789
|
+
var _el$166 = web.getNextElement(_tmpl$43), _el$169 = _el$166.firstChild, [_el$170, _co$34] = web.getNextMarker(_el$169.nextSibling), _el$167 = _el$170.nextSibling, _el$168 = _el$167.nextSibling;
|
|
1790
|
+
web.insert(_el$166, () => strings.unsupportedComponentType, _el$170, _co$34);
|
|
1791
|
+
web.insert(_el$168, () => props.component.type);
|
|
1792
|
+
return _el$166;
|
|
1745
1793
|
})();
|
|
1746
1794
|
}
|
|
1747
1795
|
function ActionRenderer(props) {
|
|
@@ -1781,27 +1829,27 @@ function ActionRenderer(props) {
|
|
|
1781
1829
|
const isDisabled = () => params.disabled || isExecutable() && isExecuting();
|
|
1782
1830
|
if (params.type === "link" || params.action === "link") {
|
|
1783
1831
|
return (() => {
|
|
1784
|
-
var _el$
|
|
1785
|
-
_el$
|
|
1786
|
-
web.insert(_el$
|
|
1832
|
+
var _el$171 = web.getNextElement(_tmpl$45), _el$173 = _el$171.firstChild, [_el$174, _co$35] = web.getNextMarker(_el$173.nextSibling), _el$175 = _el$174.nextSibling, [_el$176, _co$36] = web.getNextMarker(_el$175.nextSibling);
|
|
1833
|
+
_el$171.$$click = handleClick;
|
|
1834
|
+
web.insert(_el$171, web.createComponent(solidJs.Show, {
|
|
1787
1835
|
get when() {
|
|
1788
1836
|
return params.icon;
|
|
1789
1837
|
},
|
|
1790
1838
|
get children() {
|
|
1791
|
-
var _el$
|
|
1792
|
-
web.insert(_el$
|
|
1793
|
-
return _el$
|
|
1839
|
+
var _el$172 = web.getNextElement(_tmpl$44);
|
|
1840
|
+
web.insert(_el$172, () => params.icon);
|
|
1841
|
+
return _el$172;
|
|
1794
1842
|
}
|
|
1795
|
-
}), _el$
|
|
1796
|
-
web.insert(_el$
|
|
1843
|
+
}), _el$174, _co$35);
|
|
1844
|
+
web.insert(_el$171, () => params.label, _el$176, _co$36);
|
|
1797
1845
|
web.effect((_p$) => {
|
|
1798
1846
|
var _v$38 = safeUrl.safeUrl(params.url) ?? "#", _v$39 = safeUrl.safeUrl(params.url) ? "_blank" : void 0, _v$40 = params.ariaLabel || params.label, _v$41 = `inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
|
|
1799
1847
|
${params.variant === "primary" ? "bg-blue-600 text-white hover:bg-blue-700" : params.variant === "outline" ? "border border-gray-300 text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800" : "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300"}
|
|
1800
1848
|
${params.className || ""}`;
|
|
1801
|
-
_v$38 !== _p$.e && web.setAttribute(_el$
|
|
1802
|
-
_v$39 !== _p$.t && web.setAttribute(_el$
|
|
1803
|
-
_v$40 !== _p$.a && web.setAttribute(_el$
|
|
1804
|
-
_v$41 !== _p$.o && web.className(_el$
|
|
1849
|
+
_v$38 !== _p$.e && web.setAttribute(_el$171, "href", _p$.e = _v$38);
|
|
1850
|
+
_v$39 !== _p$.t && web.setAttribute(_el$171, "target", _p$.t = _v$39);
|
|
1851
|
+
_v$40 !== _p$.a && web.setAttribute(_el$171, "aria-label", _p$.a = _v$40);
|
|
1852
|
+
_v$41 !== _p$.o && web.className(_el$171, _p$.o = _v$41);
|
|
1805
1853
|
return _p$;
|
|
1806
1854
|
}, {
|
|
1807
1855
|
e: void 0,
|
|
@@ -1810,41 +1858,41 @@ function ActionRenderer(props) {
|
|
|
1810
1858
|
o: void 0
|
|
1811
1859
|
});
|
|
1812
1860
|
web.runHydrationEvents();
|
|
1813
|
-
return _el$
|
|
1861
|
+
return _el$171;
|
|
1814
1862
|
})();
|
|
1815
1863
|
}
|
|
1816
1864
|
return (() => {
|
|
1817
|
-
var _el$
|
|
1818
|
-
_el$
|
|
1819
|
-
web.insert(_el$
|
|
1865
|
+
var _el$177 = web.getNextElement(_tmpl$47), _el$180 = _el$177.firstChild, [_el$181, _co$37] = web.getNextMarker(_el$180.nextSibling), _el$182 = _el$181.nextSibling, [_el$183, _co$38] = web.getNextMarker(_el$182.nextSibling), _el$184 = _el$183.nextSibling, [_el$185, _co$39] = web.getNextMarker(_el$184.nextSibling);
|
|
1866
|
+
_el$177.$$click = handleClick;
|
|
1867
|
+
web.insert(_el$177, web.createComponent(solidJs.Show, {
|
|
1820
1868
|
get when() {
|
|
1821
1869
|
return web.memo(() => !!isExecuting())() && isExecutable();
|
|
1822
1870
|
},
|
|
1823
1871
|
get children() {
|
|
1824
1872
|
return web.getNextElement(_tmpl$46);
|
|
1825
1873
|
}
|
|
1826
|
-
}), _el$
|
|
1827
|
-
web.insert(_el$
|
|
1874
|
+
}), _el$181, _co$37);
|
|
1875
|
+
web.insert(_el$177, web.createComponent(solidJs.Show, {
|
|
1828
1876
|
get when() {
|
|
1829
1877
|
return web.memo(() => !!params.icon)() && !(isExecuting() && isExecutable());
|
|
1830
1878
|
},
|
|
1831
1879
|
get children() {
|
|
1832
|
-
var _el$
|
|
1833
|
-
web.insert(_el$
|
|
1834
|
-
return _el$
|
|
1880
|
+
var _el$179 = web.getNextElement(_tmpl$44);
|
|
1881
|
+
web.insert(_el$179, () => params.icon);
|
|
1882
|
+
return _el$179;
|
|
1835
1883
|
}
|
|
1836
|
-
}), _el$
|
|
1837
|
-
web.insert(_el$
|
|
1884
|
+
}), _el$183, _co$38);
|
|
1885
|
+
web.insert(_el$177, () => params.label, _el$185, _co$39);
|
|
1838
1886
|
web.effect((_p$) => {
|
|
1839
1887
|
var _v$42 = isDisabled(), _v$43 = isExecuting() && isExecutable(), _v$44 = params.ariaLabel || params.label, _v$45 = `inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
|
|
1840
1888
|
${params.variant === "primary" ? "bg-blue-600 text-white hover:bg-blue-700 shadow-sm" : params.variant === "secondary" ? "bg-gray-100 text-gray-900 hover:bg-gray-200 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600" : params.variant === "outline" ? "border border-gray-300 text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800" : params.variant === "danger" ? "bg-red-600 text-white hover:bg-red-700" : "bg-transparent text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-800"}
|
|
1841
1889
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1842
1890
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1843
1891
|
${params.className || ""}`;
|
|
1844
|
-
_v$42 !== _p$.e && web.setProperty(_el$
|
|
1845
|
-
_v$43 !== _p$.t && web.setAttribute(_el$
|
|
1846
|
-
_v$44 !== _p$.a && web.setAttribute(_el$
|
|
1847
|
-
_v$45 !== _p$.o && web.className(_el$
|
|
1892
|
+
_v$42 !== _p$.e && web.setProperty(_el$177, "disabled", _p$.e = _v$42);
|
|
1893
|
+
_v$43 !== _p$.t && web.setAttribute(_el$177, "aria-busy", _p$.t = _v$43);
|
|
1894
|
+
_v$44 !== _p$.a && web.setAttribute(_el$177, "aria-label", _p$.a = _v$44);
|
|
1895
|
+
_v$45 !== _p$.o && web.className(_el$177, _p$.o = _v$45);
|
|
1848
1896
|
return _p$;
|
|
1849
1897
|
}, {
|
|
1850
1898
|
e: void 0,
|
|
@@ -1853,7 +1901,7 @@ function ActionRenderer(props) {
|
|
|
1853
1901
|
o: void 0
|
|
1854
1902
|
});
|
|
1855
1903
|
web.runHydrationEvents();
|
|
1856
|
-
return _el$
|
|
1904
|
+
return _el$177;
|
|
1857
1905
|
})();
|
|
1858
1906
|
}
|
|
1859
1907
|
function ErrorCardRenderer(props) {
|
|
@@ -1867,62 +1915,62 @@ function ErrorCardRenderer(props) {
|
|
|
1867
1915
|
});
|
|
1868
1916
|
};
|
|
1869
1917
|
return (() => {
|
|
1870
|
-
var _el$
|
|
1871
|
-
web.insert(_el$
|
|
1918
|
+
var _el$186 = web.getNextElement(_tmpl$51), _el$203 = _el$186.firstChild, [_el$204, _co$43] = web.getNextMarker(_el$203.nextSibling), _el$187 = _el$204.nextSibling, _el$188 = _el$187.firstChild, _el$189 = _el$188.nextSibling, _el$190 = _el$189.firstChild, _el$191 = _el$190.nextSibling, _el$197 = _el$191.nextSibling, [_el$198, _co$40] = web.getNextMarker(_el$197.nextSibling), _el$199 = _el$198.nextSibling, [_el$200, _co$41] = web.getNextMarker(_el$199.nextSibling), _el$201 = _el$200.nextSibling, [_el$202, _co$42] = web.getNextMarker(_el$201.nextSibling);
|
|
1919
|
+
web.insert(_el$186, web.createComponent(CopyButton, {
|
|
1872
1920
|
getText: getErrorText,
|
|
1873
1921
|
get title() {
|
|
1874
1922
|
return strings.copyErrorDetails;
|
|
1875
1923
|
},
|
|
1876
1924
|
position: "top-right"
|
|
1877
|
-
}), _el$
|
|
1878
|
-
web.insert(_el$
|
|
1925
|
+
}), _el$204, _co$43);
|
|
1926
|
+
web.insert(_el$190, () => formatString.formatMCPUIString(strings.toolErrorTitle, {
|
|
1879
1927
|
tool: props.error.tool || strings.errorUnknownToolName
|
|
1880
1928
|
}));
|
|
1881
|
-
web.insert(_el$
|
|
1882
|
-
web.insert(_el$
|
|
1929
|
+
web.insert(_el$191, () => props.error.message || strings.errorToolExecution);
|
|
1930
|
+
web.insert(_el$189, web.createComponent(solidJs.Show, {
|
|
1883
1931
|
get when() {
|
|
1884
1932
|
return props.error.type;
|
|
1885
1933
|
},
|
|
1886
1934
|
get children() {
|
|
1887
|
-
var _el$
|
|
1888
|
-
web.insert(_el$
|
|
1935
|
+
var _el$192 = web.getNextElement(_tmpl$48);
|
|
1936
|
+
web.insert(_el$192, () => formatString.formatMCPUIString(strings.errorTypeLabel, {
|
|
1889
1937
|
type: props.error.type
|
|
1890
1938
|
}));
|
|
1891
|
-
return _el$
|
|
1939
|
+
return _el$192;
|
|
1892
1940
|
}
|
|
1893
|
-
}), _el$
|
|
1894
|
-
web.insert(_el$
|
|
1941
|
+
}), _el$198, _co$40);
|
|
1942
|
+
web.insert(_el$189, web.createComponent(solidJs.Show, {
|
|
1895
1943
|
get when() {
|
|
1896
1944
|
var _a;
|
|
1897
1945
|
return (_a = props.error.suggestions) == null ? void 0 : _a.length;
|
|
1898
1946
|
},
|
|
1899
1947
|
get children() {
|
|
1900
|
-
var _el$
|
|
1901
|
-
web.insert(_el$
|
|
1902
|
-
web.insert(_el$
|
|
1948
|
+
var _el$193 = web.getNextElement(_tmpl$49), _el$194 = _el$193.firstChild, _el$195 = _el$194.nextSibling;
|
|
1949
|
+
web.insert(_el$194, () => strings.errorSuggestions);
|
|
1950
|
+
web.insert(_el$195, web.createComponent(solidJs.For, {
|
|
1903
1951
|
get each() {
|
|
1904
1952
|
return props.error.suggestions;
|
|
1905
1953
|
},
|
|
1906
1954
|
children: (suggestion) => (() => {
|
|
1907
|
-
var _el$
|
|
1908
|
-
web.insert(_el$
|
|
1909
|
-
return _el$
|
|
1955
|
+
var _el$205 = web.getNextElement(_tmpl$52);
|
|
1956
|
+
web.insert(_el$205, suggestion);
|
|
1957
|
+
return _el$205;
|
|
1910
1958
|
})()
|
|
1911
1959
|
}));
|
|
1912
|
-
return _el$
|
|
1960
|
+
return _el$193;
|
|
1913
1961
|
}
|
|
1914
|
-
}), _el$
|
|
1915
|
-
web.insert(_el$
|
|
1962
|
+
}), _el$200, _co$41);
|
|
1963
|
+
web.insert(_el$189, web.createComponent(solidJs.Show, {
|
|
1916
1964
|
get when() {
|
|
1917
1965
|
return web.memo(() => !!mounted())() && props.error.timestamp;
|
|
1918
1966
|
},
|
|
1919
1967
|
get children() {
|
|
1920
|
-
var _el$
|
|
1921
|
-
web.insert(_el$
|
|
1922
|
-
return _el$
|
|
1968
|
+
var _el$196 = web.getNextElement(_tmpl$50);
|
|
1969
|
+
web.insert(_el$196, () => new Date(props.error.timestamp).toLocaleString(strings.locale));
|
|
1970
|
+
return _el$196;
|
|
1923
1971
|
}
|
|
1924
|
-
}), _el$
|
|
1925
|
-
return _el$
|
|
1972
|
+
}), _el$202, _co$42);
|
|
1973
|
+
return _el$186;
|
|
1926
1974
|
})();
|
|
1927
1975
|
}
|
|
1928
1976
|
function isErrorResponse(content) {
|
|
@@ -1946,23 +1994,23 @@ function UIResourceHtmlRenderer(props) {
|
|
|
1946
1994
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || strings.resourceTitle;
|
|
1947
1995
|
};
|
|
1948
1996
|
return (() => {
|
|
1949
|
-
var _el$
|
|
1950
|
-
web.insert(_el$
|
|
1997
|
+
var _el$206 = web.getNextElement(_tmpl$54), _el$209 = _el$206.firstChild, [_el$210, _co$44] = web.getNextMarker(_el$209.nextSibling), _el$211 = _el$210.nextSibling, [_el$212, _co$45] = web.getNextMarker(_el$211.nextSibling);
|
|
1998
|
+
web.insert(_el$206, web.createComponent(solidJs.Show, {
|
|
1951
1999
|
get when() {
|
|
1952
2000
|
var _a;
|
|
1953
2001
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
|
|
1954
2002
|
},
|
|
1955
2003
|
get children() {
|
|
1956
|
-
var _el$
|
|
1957
|
-
web.insert(_el$
|
|
1958
|
-
return _el$
|
|
2004
|
+
var _el$207 = web.getNextElement(_tmpl$53), _el$208 = _el$207.firstChild;
|
|
2005
|
+
web.insert(_el$208, resourceTitle);
|
|
2006
|
+
return _el$207;
|
|
1959
2007
|
}
|
|
1960
|
-
}), _el$
|
|
1961
|
-
web.insert(_el$
|
|
2008
|
+
}), _el$210, _co$44);
|
|
2009
|
+
web.insert(_el$206, web.createComponent(SafeHtml.SafeHtml, {
|
|
1962
2010
|
"class": "p-4 prose prose-sm dark:prose-invert max-w-none",
|
|
1963
2011
|
html: htmlContent
|
|
1964
|
-
}), _el$
|
|
1965
|
-
return _el$
|
|
2012
|
+
}), _el$212, _co$45);
|
|
2013
|
+
return _el$206;
|
|
1966
2014
|
})();
|
|
1967
2015
|
}
|
|
1968
2016
|
const UIResourceRenderer = (props) => {
|
|
@@ -2068,8 +2116,8 @@ const UIResourceRenderer = (props) => {
|
|
|
2068
2116
|
return web.createComponent(RenderContext.RenderProvider, {
|
|
2069
2117
|
renderComponent,
|
|
2070
2118
|
get children() {
|
|
2071
|
-
var _el$
|
|
2072
|
-
web.spread(_el$
|
|
2119
|
+
var _el$213 = web.getNextElement(_tmpl$55), _el$214 = _el$213.firstChild, _el$215 = _el$214.nextSibling, [_el$216, _co$46] = web.getNextMarker(_el$215.nextSibling);
|
|
2120
|
+
web.spread(_el$213, web.mergeProps({
|
|
2073
2121
|
get ["class"]() {
|
|
2074
2122
|
return `w-full ${props.class || ""}`;
|
|
2075
2123
|
}
|
|
@@ -2079,14 +2127,14 @@ const UIResourceRenderer = (props) => {
|
|
|
2079
2127
|
"data-mcp-ui-component-id": outerKey()
|
|
2080
2128
|
}), false, true);
|
|
2081
2129
|
var _ref$3 = responsiveGrid.ref;
|
|
2082
|
-
typeof _ref$3 === "function" ? web.use(_ref$3, _el$
|
|
2083
|
-
web.insert(_el$
|
|
2130
|
+
typeof _ref$3 === "function" ? web.use(_ref$3, _el$214) : responsiveGrid.ref = _el$214;
|
|
2131
|
+
web.insert(_el$214, web.createComponent(solidJs.For, {
|
|
2084
2132
|
get each() {
|
|
2085
2133
|
return layout().components;
|
|
2086
2134
|
},
|
|
2087
2135
|
children: (component) => (() => {
|
|
2088
|
-
var _el$
|
|
2089
|
-
web.insert(_el$
|
|
2136
|
+
var _el$217 = web.getNextElement(_tmpl$56);
|
|
2137
|
+
web.insert(_el$217, web.createComponent(ComponentRenderer, {
|
|
2090
2138
|
component,
|
|
2091
2139
|
get onError() {
|
|
2092
2140
|
return props.onError;
|
|
@@ -2103,17 +2151,17 @@ const UIResourceRenderer = (props) => {
|
|
|
2103
2151
|
}));
|
|
2104
2152
|
web.effect((_p$) => {
|
|
2105
2153
|
var _v$48 = getGridStyleString(component), _v$49 = stableKey.getUiResourceStableKey(component);
|
|
2106
|
-
_p$.e = web.style(_el$
|
|
2107
|
-
_v$49 !== _p$.t && web.setAttribute(_el$
|
|
2154
|
+
_p$.e = web.style(_el$217, _v$48, _p$.e);
|
|
2155
|
+
_v$49 !== _p$.t && web.setAttribute(_el$217, "data-mcp-ui-component-id", _p$.t = _v$49);
|
|
2108
2156
|
return _p$;
|
|
2109
2157
|
}, {
|
|
2110
2158
|
e: void 0,
|
|
2111
2159
|
t: void 0
|
|
2112
2160
|
});
|
|
2113
|
-
return _el$
|
|
2161
|
+
return _el$217;
|
|
2114
2162
|
})()
|
|
2115
2163
|
}));
|
|
2116
|
-
web.insert(_el$
|
|
2164
|
+
web.insert(_el$213, web.createComponent(solidJs.Show, {
|
|
2117
2165
|
get when() {
|
|
2118
2166
|
return shouldShowAutoFooter();
|
|
2119
2167
|
},
|
|
@@ -2124,18 +2172,18 @@ const UIResourceRenderer = (props) => {
|
|
|
2124
2172
|
}
|
|
2125
2173
|
});
|
|
2126
2174
|
}
|
|
2127
|
-
}), _el$
|
|
2175
|
+
}), _el$216, _co$46);
|
|
2128
2176
|
web.effect((_p$) => {
|
|
2129
2177
|
var _v$46 = gridContainerStyle(), _v$47 = responsiveGrid.stacked();
|
|
2130
|
-
_p$.e = web.style(_el$
|
|
2131
|
-
_v$47 !== _p$.t && web.setAttribute(_el$
|
|
2178
|
+
_p$.e = web.style(_el$214, _v$46, _p$.e);
|
|
2179
|
+
_v$47 !== _p$.t && web.setAttribute(_el$214, "data-mcp-ui-stacked", _p$.t = _v$47);
|
|
2132
2180
|
return _p$;
|
|
2133
2181
|
}, {
|
|
2134
2182
|
e: void 0,
|
|
2135
2183
|
t: void 0
|
|
2136
2184
|
});
|
|
2137
2185
|
web.runHydrationEvents();
|
|
2138
|
-
return _el$
|
|
2186
|
+
return _el$213;
|
|
2139
2187
|
}
|
|
2140
2188
|
});
|
|
2141
2189
|
};
|