@seed-ship/mcp-ui-solid 4.0.3 → 4.0.5
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/dist/components/DataPreviewSection.cjs +95 -55
- package/dist/components/DataPreviewSection.cjs.map +1 -1
- package/dist/components/DataPreviewSection.d.ts +1 -9
- package/dist/components/DataPreviewSection.d.ts.map +1 -1
- package/dist/components/DataPreviewSection.js +97 -57
- package/dist/components/DataPreviewSection.js.map +1 -1
- package/dist/components/UIResourceRenderer.cjs +281 -181
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +282 -182
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/types/chat-bus.d.ts +7 -1
- package/dist/types/chat-bus.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/DataPreviewSection.tsx +64 -70
- package/src/components/UIResourceRenderer.tsx +108 -7
- package/src/types/chat-bus.ts +7 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -21,7 +21,7 @@ const ExpandableWrapper = require("./ExpandableWrapper.cjs");
|
|
|
21
21
|
const RenderContext = require("./RenderContext.cjs");
|
|
22
22
|
const useAction = require("../hooks/useAction.cjs");
|
|
23
23
|
const marked_esm = require("../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.cjs");
|
|
24
|
-
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>`), _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">Invalid chart data: missing data.datasets`), _tmpl$5 = /* @__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$6 = /* @__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">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$7 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__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$9 = /* @__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$0 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$10 = /* @__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"><div>`), _tmpl$11 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__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">Copy TSV`), _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">Download CSV`), _tmpl$14 = /* @__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">Download JSON`), _tmpl$15 = /* @__PURE__ */ web.template(`<div class="absolute right-0 mt-1 w-36 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm"><!$><!/><!$><!/><!$><!/>`), _tmpl$16 = /* @__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"title="Export table"aria-label="Export table"><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$17 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$18 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$20 = /* @__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 overflow-hidden group"><!$><!/><div class=p-4><!$><!/><div class=overflow-x-auto 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-50 dark:bg-gray-900/50 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/>`), _tmpl$21 = /* @__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-50 dark:bg-gray-900/50">`), _tmpl$22 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$23 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$24 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$25 = /* @__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$26 = /* @__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>`), _tmpl$27 = /* @__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]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></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">`, true, false, false), _tmpl$28 = /* @__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$29 = /* @__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>`, true, false, false), _tmpl$30 = /* @__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$31 = /* @__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$32 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$33 = /* @__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$34 = /* @__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">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$35 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$36 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$37 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$38 = /* @__PURE__ */ web.template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$39 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$40 = /* @__PURE__ */ web.template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$41 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$42 = /* @__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">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$43 = /* @__PURE__ */ web.template(`<li>`), _tmpl$44 = /* @__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$45 = /* @__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"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$46 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$47 = /* @__PURE__ */ web.template(`<div>`);
|
|
24
|
+
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>`), _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">Invalid chart data: missing data.datasets`), _tmpl$5 = /* @__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$6 = /* @__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">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$7 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__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$9 = /* @__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$0 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$10 = /* @__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"><div>`), _tmpl$11 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__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">Copy TSV`), _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">Download CSV`), _tmpl$14 = /* @__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">Download JSON`), _tmpl$15 = /* @__PURE__ */ web.template(`<div class="absolute right-0 mt-1 w-36 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm"><!$><!/><!$><!/><!$><!/>`), _tmpl$16 = /* @__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"title="Export table"aria-label="Export table"><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$17 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$18 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$20 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/>–<!$><!/> of <!$><!/></span><div class="flex items-center gap-1"><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">◀ Prev</button><span class=px-2>Page <!$><!/> / <!$><!/></span><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">Next ▶`), _tmpl$21 = /* @__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 overflow-hidden group"><!$><!/><div class=p-4><!$><!/><div class=overflow-x-auto 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-50 dark:bg-gray-900/50 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/>`), _tmpl$22 = /* @__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-50 dark:bg-gray-900/50 cursor-pointer select-none hover:bg-gray-100 dark:hover:bg-gray-800/50 transition-colors"><span class="inline-flex items-center gap-1"><!$><!/><span class="text-[10px] leading-none">`), _tmpl$23 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$24 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$25 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$26 = /* @__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$27 = /* @__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>`), _tmpl$28 = /* @__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]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></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">`, true, false, false), _tmpl$29 = /* @__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$30 = /* @__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>`, true, false, false), _tmpl$31 = /* @__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$32 = /* @__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$33 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$34 = /* @__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$35 = /* @__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">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$36 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$37 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$38 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$39 = /* @__PURE__ */ web.template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$40 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$41 = /* @__PURE__ */ web.template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$42 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$43 = /* @__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">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$44 = /* @__PURE__ */ web.template(`<li>`), _tmpl$45 = /* @__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$46 = /* @__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"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$47 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$48 = /* @__PURE__ */ web.template(`<div>`);
|
|
25
25
|
function CopyButton(props) {
|
|
26
26
|
const [copied, setCopied] = solidJs.createSignal(false);
|
|
27
27
|
const handleCopy = async () => {
|
|
@@ -266,10 +266,68 @@ function renderCellValue(value) {
|
|
|
266
266
|
function TableRenderer(props) {
|
|
267
267
|
const tableParams = props.component.params;
|
|
268
268
|
let scrollContainerRef;
|
|
269
|
+
const allRows = () => tableParams.rows || [];
|
|
270
|
+
const columns = () => tableParams.columns || [];
|
|
271
|
+
const [sortKey, setSortKey] = solidJs.createSignal(null);
|
|
272
|
+
const [sortDir, setSortDir] = solidJs.createSignal(null);
|
|
273
|
+
const handleSort = (key) => {
|
|
274
|
+
if (sortKey() === key) {
|
|
275
|
+
if (sortDir() === "asc") setSortDir("desc");
|
|
276
|
+
else {
|
|
277
|
+
setSortKey(null);
|
|
278
|
+
setSortDir(null);
|
|
279
|
+
}
|
|
280
|
+
} else {
|
|
281
|
+
setSortKey(key);
|
|
282
|
+
setSortDir("asc");
|
|
283
|
+
}
|
|
284
|
+
setClientPage(0);
|
|
285
|
+
};
|
|
286
|
+
const sortedRows = solidJs.createMemo(() => {
|
|
287
|
+
var _a;
|
|
288
|
+
const r = allRows();
|
|
289
|
+
const key = sortKey();
|
|
290
|
+
const dir = sortDir();
|
|
291
|
+
if (!key || !dir) return r;
|
|
292
|
+
const col = columns().find((c) => c.key === key);
|
|
293
|
+
const isNum = (col == null ? void 0 : col.type) === "number" || r.length > 0 && typeof ((_a = r[0]) == null ? void 0 : _a[key]) === "number";
|
|
294
|
+
return [...r].sort((a, b) => {
|
|
295
|
+
const va = a[key], vb = b[key];
|
|
296
|
+
if (va == null && vb == null) return 0;
|
|
297
|
+
if (va == null) return 1;
|
|
298
|
+
if (vb == null) return -1;
|
|
299
|
+
let cmp;
|
|
300
|
+
if (isNum) {
|
|
301
|
+
cmp = (Number(va) || 0) - (Number(vb) || 0);
|
|
302
|
+
} else {
|
|
303
|
+
cmp = String(va).localeCompare(String(vb), "fr", {
|
|
304
|
+
sensitivity: "base"
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
return dir === "desc" ? -cmp : cmp;
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
const sortIndicator = (key) => {
|
|
311
|
+
if (sortKey() !== key) return "↕";
|
|
312
|
+
return sortDir() === "asc" ? "↑" : "↓";
|
|
313
|
+
};
|
|
314
|
+
const clientPageSize = () => tableParams.pageSize ?? 25;
|
|
315
|
+
const hasServerPagination = () => !!tableParams.pagination;
|
|
316
|
+
const needsClientPagination = () => !hasServerPagination() && clientPageSize() > 0 && sortedRows().length > clientPageSize();
|
|
317
|
+
const [clientPage, setClientPage] = solidJs.createSignal(tableParams.initialPage ?? 0);
|
|
318
|
+
const clientTotalPages = () => needsClientPagination() ? Math.ceil(sortedRows().length / clientPageSize()) : 1;
|
|
319
|
+
const clientVisibleRows = solidJs.createMemo(() => {
|
|
320
|
+
if (!needsClientPagination()) return sortedRows();
|
|
321
|
+
const start = clientPage() * clientPageSize();
|
|
322
|
+
return sortedRows().slice(start, start + clientPageSize());
|
|
323
|
+
});
|
|
324
|
+
const clientRangeStart = () => needsClientPagination() ? clientPage() * clientPageSize() + 1 : 1;
|
|
325
|
+
const clientRangeEnd = () => needsClientPagination() ? Math.min((clientPage() + 1) * clientPageSize(), sortedRows().length) : sortedRows().length;
|
|
269
326
|
const [virtualizer, setVirtualizer] = solidJs.createSignal(null);
|
|
270
327
|
const [isVirtualizing, setIsVirtualizing] = solidJs.createSignal(false);
|
|
271
328
|
const shouldVirtualize = solidJs.createMemo(() => {
|
|
272
329
|
var _a, _b;
|
|
330
|
+
if (needsClientPagination()) return false;
|
|
273
331
|
const opts = tableParams.virtualize;
|
|
274
332
|
if (opts === false) return false;
|
|
275
333
|
if (opts === true) return true;
|
|
@@ -320,15 +378,15 @@ function TableRenderer(props) {
|
|
|
320
378
|
return String(value);
|
|
321
379
|
};
|
|
322
380
|
const getTableText = () => {
|
|
323
|
-
const
|
|
381
|
+
const columns2 = tableParams.columns || [];
|
|
324
382
|
const rows = tableParams.rows || [];
|
|
325
|
-
const header =
|
|
326
|
-
const dataRows = rows.map((row) =>
|
|
383
|
+
const header = columns2.map((c) => c.label).join(" ");
|
|
384
|
+
const dataRows = rows.map((row) => columns2.map((c) => getCellValue(row, c.key)).join(" ")).join("\n");
|
|
327
385
|
return `${header}
|
|
328
386
|
${dataRows}`;
|
|
329
387
|
};
|
|
330
388
|
const getTableCSV = () => {
|
|
331
|
-
const
|
|
389
|
+
const columns2 = tableParams.columns || [];
|
|
332
390
|
const rows = tableParams.rows || [];
|
|
333
391
|
const escapeCSV = (val) => {
|
|
334
392
|
if (val.includes(",") || val.includes('"') || val.includes("\n")) {
|
|
@@ -336,16 +394,16 @@ ${dataRows}`;
|
|
|
336
394
|
}
|
|
337
395
|
return val;
|
|
338
396
|
};
|
|
339
|
-
const header =
|
|
340
|
-
const dataRows = rows.map((row) =>
|
|
397
|
+
const header = columns2.map((c) => escapeCSV(c.label)).join(",");
|
|
398
|
+
const dataRows = rows.map((row) => columns2.map((c) => escapeCSV(getCellValue(row, c.key))).join(",")).join("\n");
|
|
341
399
|
return `${header}
|
|
342
400
|
${dataRows}`;
|
|
343
401
|
};
|
|
344
402
|
const getTableJSON = () => {
|
|
345
|
-
const
|
|
403
|
+
const columns2 = tableParams.columns || [];
|
|
346
404
|
const rows = tableParams.rows || [];
|
|
347
405
|
return JSON.stringify({
|
|
348
|
-
columns:
|
|
406
|
+
columns: columns2.map((c) => ({
|
|
349
407
|
key: c.key,
|
|
350
408
|
label: c.label
|
|
351
409
|
})),
|
|
@@ -386,7 +444,7 @@ ${dataRows}`;
|
|
|
386
444
|
var _el$21 = web.getNextElement(_tmpl$0);
|
|
387
445
|
web.insert(_el$21, web.createComponent(solidJs.For, {
|
|
388
446
|
get each() {
|
|
389
|
-
return
|
|
447
|
+
return clientVisibleRows().slice(0, validation.DEFAULT_RESOURCE_LIMITS.maxTableRows);
|
|
390
448
|
},
|
|
391
449
|
children: (row, i) => (() => {
|
|
392
450
|
var _el$22 = web.getNextElement(_tmpl$1);
|
|
@@ -458,7 +516,7 @@ ${dataRows}`;
|
|
|
458
516
|
},
|
|
459
517
|
copyLabel: "Copy table (TSV)",
|
|
460
518
|
get children() {
|
|
461
|
-
var _el$29 = web.getNextElement(_tmpl$
|
|
519
|
+
var _el$29 = web.getNextElement(_tmpl$21), _el$101 = _el$29.firstChild, [_el$102, _co$22] = web.getNextMarker(_el$101.nextSibling), _el$44 = _el$102.nextSibling, _el$95 = _el$44.firstChild, [_el$96, _co$19] = web.getNextMarker(_el$95.nextSibling), _el$55 = _el$96.nextSibling, _el$56 = _el$55.firstChild, _el$57 = _el$56.firstChild, _el$58 = _el$57.firstChild, _el$59 = _el$57.nextSibling, [_el$60, _co$10] = web.getNextMarker(_el$59.nextSibling), _el$97 = _el$55.nextSibling, [_el$98, _co$20] = web.getNextMarker(_el$97.nextSibling), _el$99 = _el$98.nextSibling, [_el$100, _co$21] = web.getNextMarker(_el$99.nextSibling);
|
|
462
520
|
web.insert(_el$29, web.createComponent(solidJs.Show, {
|
|
463
521
|
when: exportable,
|
|
464
522
|
get fallback() {
|
|
@@ -516,7 +574,7 @@ ${dataRows}`;
|
|
|
516
574
|
web.runHydrationEvents();
|
|
517
575
|
return _el$30;
|
|
518
576
|
}
|
|
519
|
-
}), _el$
|
|
577
|
+
}), _el$102, _co$22);
|
|
520
578
|
web.insert(_el$44, web.createComponent(solidJs.Show, {
|
|
521
579
|
get when() {
|
|
522
580
|
return tableParams.title;
|
|
@@ -541,7 +599,7 @@ ${dataRows}`;
|
|
|
541
599
|
}), _el$54, _co$1);
|
|
542
600
|
return _el$45;
|
|
543
601
|
}
|
|
544
|
-
}), _el$
|
|
602
|
+
}), _el$96, _co$19);
|
|
545
603
|
var _ref$ = scrollContainerRef;
|
|
546
604
|
typeof _ref$ === "function" ? web.use(_ref$, _el$55) : scrollContainerRef = _el$55;
|
|
547
605
|
web.insert(_el$58, web.createComponent(solidJs.For, {
|
|
@@ -549,12 +607,28 @@ ${dataRows}`;
|
|
|
549
607
|
return tableParams.columns;
|
|
550
608
|
},
|
|
551
609
|
children: (column) => (() => {
|
|
552
|
-
var _el$
|
|
553
|
-
|
|
554
|
-
web.
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
610
|
+
var _el$103 = web.getNextElement(_tmpl$22), _el$104 = _el$103.firstChild, _el$106 = _el$104.firstChild, [_el$107, _co$23] = web.getNextMarker(_el$106.nextSibling), _el$105 = _el$107.nextSibling;
|
|
611
|
+
_el$103.$$click = () => handleSort(column.key);
|
|
612
|
+
web.insert(_el$104, () => column.label, _el$107, _co$23);
|
|
613
|
+
web.insert(_el$105, () => sortIndicator(column.key));
|
|
614
|
+
web.effect((_p$) => {
|
|
615
|
+
var _v$11 = column.width ? {
|
|
616
|
+
width: column.width
|
|
617
|
+
} : {}, _v$12 = `Sort by ${column.label}`, _v$13 = {
|
|
618
|
+
"opacity-30": sortKey() !== column.key,
|
|
619
|
+
"opacity-100 text-blue-600 dark:text-blue-400": sortKey() === column.key
|
|
620
|
+
};
|
|
621
|
+
_p$.e = web.style(_el$103, _v$11, _p$.e);
|
|
622
|
+
_v$12 !== _p$.t && web.setAttribute(_el$103, "title", _p$.t = _v$12);
|
|
623
|
+
_p$.a = web.classList(_el$105, _v$13, _p$.a);
|
|
624
|
+
return _p$;
|
|
625
|
+
}, {
|
|
626
|
+
e: void 0,
|
|
627
|
+
t: void 0,
|
|
628
|
+
a: void 0
|
|
629
|
+
});
|
|
630
|
+
web.runHydrationEvents();
|
|
631
|
+
return _el$103;
|
|
558
632
|
})()
|
|
559
633
|
}));
|
|
560
634
|
web.insert(_el$56, web.createComponent(solidJs.Show, {
|
|
@@ -579,15 +653,41 @@ ${dataRows}`;
|
|
|
579
653
|
web.insert(_el$62, () => tableParams.pagination.totalRows, _el$73, _co$13);
|
|
580
654
|
return _el$61;
|
|
581
655
|
}
|
|
582
|
-
}), _el$
|
|
656
|
+
}), _el$98, _co$20);
|
|
657
|
+
web.insert(_el$44, web.createComponent(solidJs.Show, {
|
|
658
|
+
get when() {
|
|
659
|
+
return needsClientPagination();
|
|
660
|
+
},
|
|
661
|
+
get children() {
|
|
662
|
+
var _el$74 = web.getNextElement(_tmpl$20), _el$75 = _el$74.firstChild, _el$76 = _el$75.firstChild, _el$79 = _el$76.nextSibling, [_el$80, _co$14] = web.getNextMarker(_el$79.nextSibling), _el$77 = _el$80.nextSibling, _el$81 = _el$77.nextSibling, [_el$82, _co$15] = web.getNextMarker(_el$81.nextSibling), _el$78 = _el$82.nextSibling, _el$83 = _el$78.nextSibling, [_el$84, _co$16] = web.getNextMarker(_el$83.nextSibling), _el$85 = _el$75.nextSibling, _el$86 = _el$85.firstChild, _el$87 = _el$86.nextSibling, _el$88 = _el$87.firstChild, _el$90 = _el$88.nextSibling, [_el$91, _co$17] = web.getNextMarker(_el$90.nextSibling), _el$89 = _el$91.nextSibling, _el$92 = _el$89.nextSibling, [_el$93, _co$18] = web.getNextMarker(_el$92.nextSibling), _el$94 = _el$87.nextSibling;
|
|
663
|
+
web.insert(_el$75, clientRangeStart, _el$80, _co$14);
|
|
664
|
+
web.insert(_el$75, clientRangeEnd, _el$82, _co$15);
|
|
665
|
+
web.insert(_el$75, () => allRows().length.toLocaleString("fr-FR"), _el$84, _co$16);
|
|
666
|
+
_el$86.$$click = () => setClientPage((p) => p - 1);
|
|
667
|
+
web.insert(_el$87, () => clientPage() + 1, _el$91, _co$17);
|
|
668
|
+
web.insert(_el$87, clientTotalPages, _el$93, _co$18);
|
|
669
|
+
_el$94.$$click = () => setClientPage((p) => p + 1);
|
|
670
|
+
web.effect((_p$) => {
|
|
671
|
+
var _v$8 = clientPage() === 0, _v$9 = clientPage() >= clientTotalPages() - 1;
|
|
672
|
+
_v$8 !== _p$.e && web.setProperty(_el$86, "disabled", _p$.e = _v$8);
|
|
673
|
+
_v$9 !== _p$.t && web.setProperty(_el$94, "disabled", _p$.t = _v$9);
|
|
674
|
+
return _p$;
|
|
675
|
+
}, {
|
|
676
|
+
e: void 0,
|
|
677
|
+
t: void 0
|
|
678
|
+
});
|
|
679
|
+
web.runHydrationEvents();
|
|
680
|
+
return _el$74;
|
|
681
|
+
}
|
|
682
|
+
}), _el$100, _co$21);
|
|
583
683
|
web.effect((_p$) => {
|
|
584
|
-
var _v$
|
|
684
|
+
var _v$0 = isVirtualizing() ? {
|
|
585
685
|
"max-height": "500px",
|
|
586
686
|
"overflow-y": "auto"
|
|
587
|
-
} : {}, _v$
|
|
588
|
-
_p$.e = web.style(_el$55, _v$
|
|
589
|
-
_v$
|
|
590
|
-
_v$
|
|
687
|
+
} : {}, _v$1 = tableParams.title || "Data table", _v$10 = tableParams.title ? `${tableId}-title` : void 0;
|
|
688
|
+
_p$.e = web.style(_el$55, _v$0, _p$.e);
|
|
689
|
+
_v$1 !== _p$.t && web.setAttribute(_el$55, "aria-label", _p$.t = _v$1);
|
|
690
|
+
_v$10 !== _p$.a && web.setAttribute(_el$56, "aria-labelledby", _p$.a = _v$10);
|
|
591
691
|
return _p$;
|
|
592
692
|
}, {
|
|
593
693
|
e: void 0,
|
|
@@ -607,51 +707,51 @@ function MetricRenderer(props) {
|
|
|
607
707
|
return `${title}: ${value}${unit ? " " + unit : ""}`;
|
|
608
708
|
};
|
|
609
709
|
return (() => {
|
|
610
|
-
var _el$
|
|
611
|
-
web.insert(_el$
|
|
710
|
+
var _el$108 = web.getNextElement(_tmpl$26), _el$130 = _el$108.firstChild, [_el$131, _co$29] = web.getNextMarker(_el$130.nextSibling), _el$109 = _el$131.nextSibling, _el$110 = _el$109.firstChild, _el$111 = _el$110.firstChild, _el$112 = _el$111.nextSibling, _el$113 = _el$112.firstChild, _el$115 = _el$113.nextSibling, [_el$116, _co$24] = web.getNextMarker(_el$115.nextSibling), _el$126 = _el$110.nextSibling, [_el$127, _co$27] = web.getNextMarker(_el$126.nextSibling), _el$128 = _el$127.nextSibling, [_el$129, _co$28] = web.getNextMarker(_el$128.nextSibling);
|
|
711
|
+
web.insert(_el$108, web.createComponent(CopyButton, {
|
|
612
712
|
getText: getMetricText,
|
|
613
713
|
title: "Copy metric",
|
|
614
714
|
position: "top-right"
|
|
615
|
-
}), _el$
|
|
616
|
-
web.insert(_el$
|
|
617
|
-
web.insert(_el$
|
|
618
|
-
web.insert(_el$
|
|
715
|
+
}), _el$131, _co$29);
|
|
716
|
+
web.insert(_el$111, () => metricParams.title);
|
|
717
|
+
web.insert(_el$113, () => metricParams.value);
|
|
718
|
+
web.insert(_el$112, web.createComponent(solidJs.Show, {
|
|
619
719
|
get when() {
|
|
620
720
|
return metricParams.unit;
|
|
621
721
|
},
|
|
622
722
|
get children() {
|
|
623
|
-
var _el$
|
|
624
|
-
web.insert(_el$
|
|
625
|
-
return _el$
|
|
723
|
+
var _el$114 = web.getNextElement(_tmpl$23);
|
|
724
|
+
web.insert(_el$114, () => metricParams.unit);
|
|
725
|
+
return _el$114;
|
|
626
726
|
}
|
|
627
|
-
}), _el$
|
|
628
|
-
web.insert(_el$
|
|
727
|
+
}), _el$116, _co$24);
|
|
728
|
+
web.insert(_el$109, web.createComponent(solidJs.Show, {
|
|
629
729
|
get when() {
|
|
630
730
|
return metricParams.trend;
|
|
631
731
|
},
|
|
632
732
|
get children() {
|
|
633
|
-
var _el$
|
|
634
|
-
_el$
|
|
635
|
-
web.insert(_el$
|
|
733
|
+
var _el$117 = web.getNextElement(_tmpl$24), _el$118 = _el$117.firstChild, _el$121 = _el$118.firstChild, [_el$122, _co$25] = web.getNextMarker(_el$121.nextSibling), _el$119 = _el$122.nextSibling, _el$123 = _el$119.nextSibling, [_el$124, _co$26] = web.getNextMarker(_el$123.nextSibling);
|
|
734
|
+
_el$124.nextSibling;
|
|
735
|
+
web.insert(_el$118, (() => {
|
|
636
736
|
var _c$ = web.memo(() => metricParams.trend.direction === "up");
|
|
637
737
|
return () => _c$() ? "�" : metricParams.trend.direction === "down" ? "�" : "�";
|
|
638
|
-
})(), _el$
|
|
639
|
-
web.insert(_el$
|
|
640
|
-
web.effect(() => web.className(_el$
|
|
641
|
-
return _el$
|
|
738
|
+
})(), _el$122, _co$25);
|
|
739
|
+
web.insert(_el$118, () => Math.abs(metricParams.trend.value), _el$124, _co$26);
|
|
740
|
+
web.effect(() => web.className(_el$118, `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"}`));
|
|
741
|
+
return _el$117;
|
|
642
742
|
}
|
|
643
|
-
}), _el$
|
|
644
|
-
web.insert(_el$
|
|
743
|
+
}), _el$127, _co$27);
|
|
744
|
+
web.insert(_el$109, web.createComponent(solidJs.Show, {
|
|
645
745
|
get when() {
|
|
646
746
|
return metricParams.subtitle;
|
|
647
747
|
},
|
|
648
748
|
get children() {
|
|
649
|
-
var _el$
|
|
650
|
-
web.insert(_el$
|
|
651
|
-
return _el$
|
|
749
|
+
var _el$125 = web.getNextElement(_tmpl$25);
|
|
750
|
+
web.insert(_el$125, () => metricParams.subtitle);
|
|
751
|
+
return _el$125;
|
|
652
752
|
}
|
|
653
|
-
}), _el$
|
|
654
|
-
return _el$
|
|
753
|
+
}), _el$129, _co$28);
|
|
754
|
+
return _el$108;
|
|
655
755
|
})();
|
|
656
756
|
}
|
|
657
757
|
function extractImageFromMarkdown(content) {
|
|
@@ -692,62 +792,62 @@ function TextRenderer(props) {
|
|
|
692
792
|
},
|
|
693
793
|
get fallback() {
|
|
694
794
|
return (() => {
|
|
695
|
-
var _el$
|
|
696
|
-
web.insert(_el$
|
|
795
|
+
var _el$132 = web.getNextElement(_tmpl$27), _el$134 = _el$132.firstChild, [_el$135, _co$30] = web.getNextMarker(_el$134.nextSibling), _el$133 = _el$135.nextSibling;
|
|
796
|
+
web.insert(_el$132, web.createComponent(CopyButton, {
|
|
697
797
|
getText: getTextContent,
|
|
698
798
|
title: "Copy text",
|
|
699
799
|
position: "top-right"
|
|
700
|
-
}), _el$
|
|
800
|
+
}), _el$135, _co$30);
|
|
701
801
|
web.effect((_p$) => {
|
|
702
|
-
var _v$
|
|
703
|
-
_v$
|
|
704
|
-
_v$
|
|
802
|
+
var _v$14 = `prose prose-sm dark:prose-invert max-w-none ${textParams.className || ""}`, _v$15 = htmlContent();
|
|
803
|
+
_v$14 !== _p$.e && web.className(_el$133, _p$.e = _v$14);
|
|
804
|
+
_v$15 !== _p$.t && web.setProperty(_el$133, "innerHTML", _p$.t = _v$15);
|
|
705
805
|
return _p$;
|
|
706
806
|
}, {
|
|
707
807
|
e: void 0,
|
|
708
808
|
t: void 0
|
|
709
809
|
});
|
|
710
|
-
return _el$
|
|
810
|
+
return _el$132;
|
|
711
811
|
})();
|
|
712
812
|
},
|
|
713
813
|
children: (data) => (() => {
|
|
714
|
-
var _el$
|
|
715
|
-
web.insert(_el$
|
|
814
|
+
var _el$136 = web.getNextElement(_tmpl$28), _el$137 = _el$136.firstChild, _el$138 = _el$137.firstChild, _el$139 = _el$138.firstChild, _el$140 = _el$137.nextSibling, _el$141 = _el$140.firstChild;
|
|
815
|
+
web.insert(_el$141, () => data().credit);
|
|
716
816
|
web.effect((_p$) => {
|
|
717
|
-
var _v$
|
|
718
|
-
_v$
|
|
719
|
-
_v$
|
|
720
|
-
_v$
|
|
817
|
+
var _v$16 = data().linkUrl, _v$17 = data().imageUrl, _v$18 = data().alt;
|
|
818
|
+
_v$16 !== _p$.e && web.setAttribute(_el$138, "href", _p$.e = _v$16);
|
|
819
|
+
_v$17 !== _p$.t && web.setAttribute(_el$139, "src", _p$.t = _v$17);
|
|
820
|
+
_v$18 !== _p$.a && web.setAttribute(_el$139, "alt", _p$.a = _v$18);
|
|
721
821
|
return _p$;
|
|
722
822
|
}, {
|
|
723
823
|
e: void 0,
|
|
724
824
|
t: void 0,
|
|
725
825
|
a: void 0
|
|
726
826
|
});
|
|
727
|
-
return _el$
|
|
827
|
+
return _el$136;
|
|
728
828
|
})()
|
|
729
829
|
});
|
|
730
830
|
}
|
|
731
831
|
function IframeRenderer(props) {
|
|
732
832
|
const params = props.component.params;
|
|
733
833
|
return (() => {
|
|
734
|
-
var _el$
|
|
735
|
-
web.insert(_el$
|
|
834
|
+
var _el$142 = web.getNextElement(_tmpl$30), _el$146 = _el$142.firstChild, [_el$147, _co$31] = web.getNextMarker(_el$146.nextSibling), _el$145 = _el$147.nextSibling;
|
|
835
|
+
web.insert(_el$142, web.createComponent(solidJs.Show, {
|
|
736
836
|
get when() {
|
|
737
837
|
return params.title;
|
|
738
838
|
},
|
|
739
839
|
get children() {
|
|
740
|
-
var _el$
|
|
741
|
-
web.insert(_el$
|
|
742
|
-
return _el$
|
|
840
|
+
var _el$143 = web.getNextElement(_tmpl$29), _el$144 = _el$143.firstChild;
|
|
841
|
+
web.insert(_el$144, () => params.title);
|
|
842
|
+
return _el$143;
|
|
743
843
|
}
|
|
744
|
-
}), _el$
|
|
844
|
+
}), _el$147, _co$31);
|
|
745
845
|
web.effect((_p$) => {
|
|
746
|
-
var _v$
|
|
747
|
-
_v$
|
|
748
|
-
_v$
|
|
749
|
-
_p$.a = web.style(_el$
|
|
750
|
-
_v$
|
|
846
|
+
var _v$19 = params.url, _v$20 = params.title || "Embedded content", _v$21 = `height: ${params.height || "400px"}; min-height: 300px;`, _v$22 = validation.getIframeSandbox(params.url);
|
|
847
|
+
_v$19 !== _p$.e && web.setAttribute(_el$145, "src", _p$.e = _v$19);
|
|
848
|
+
_v$20 !== _p$.t && web.setAttribute(_el$145, "title", _p$.t = _v$20);
|
|
849
|
+
_p$.a = web.style(_el$145, _v$21, _p$.a);
|
|
850
|
+
_v$22 !== _p$.o && web.setAttribute(_el$145, "sandbox", _p$.o = _v$22);
|
|
751
851
|
return _p$;
|
|
752
852
|
}, {
|
|
753
853
|
e: void 0,
|
|
@@ -755,30 +855,30 @@ function IframeRenderer(props) {
|
|
|
755
855
|
a: void 0,
|
|
756
856
|
o: void 0
|
|
757
857
|
});
|
|
758
|
-
return _el$
|
|
858
|
+
return _el$142;
|
|
759
859
|
})();
|
|
760
860
|
}
|
|
761
861
|
function ImageRenderer(props) {
|
|
762
862
|
const params = props.component.params;
|
|
763
863
|
return (() => {
|
|
764
|
-
var _el$
|
|
765
|
-
web.insert(_el$
|
|
864
|
+
var _el$148 = web.getNextElement(_tmpl$32), _el$149 = _el$148.firstChild, _el$150 = _el$149.firstChild, _el$151 = _el$150.firstChild, _el$154 = _el$149.nextSibling, [_el$155, _co$32] = web.getNextMarker(_el$154.nextSibling);
|
|
865
|
+
web.insert(_el$148, web.createComponent(solidJs.Show, {
|
|
766
866
|
get when() {
|
|
767
867
|
return params.caption;
|
|
768
868
|
},
|
|
769
869
|
get children() {
|
|
770
|
-
var _el$
|
|
771
|
-
web.insert(_el$
|
|
772
|
-
return _el$
|
|
870
|
+
var _el$152 = web.getNextElement(_tmpl$31), _el$153 = _el$152.firstChild;
|
|
871
|
+
web.insert(_el$153, () => params.caption);
|
|
872
|
+
return _el$152;
|
|
773
873
|
}
|
|
774
|
-
}), _el$
|
|
874
|
+
}), _el$155, _co$32);
|
|
775
875
|
web.effect((_p$) => {
|
|
776
|
-
var _v$
|
|
777
|
-
_v$
|
|
778
|
-
_v$
|
|
779
|
-
_v$
|
|
780
|
-
_v$
|
|
781
|
-
_v$
|
|
876
|
+
var _v$23 = `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$24 = params.url, _v$25 = `View full size: ${params.alt || "image"}`, _v$26 = params.url, _v$27 = params.alt || "Image";
|
|
877
|
+
_v$23 !== _p$.e && web.className(_el$148, _p$.e = _v$23);
|
|
878
|
+
_v$24 !== _p$.t && web.setAttribute(_el$150, "href", _p$.t = _v$24);
|
|
879
|
+
_v$25 !== _p$.a && web.setAttribute(_el$150, "aria-label", _p$.a = _v$25);
|
|
880
|
+
_v$26 !== _p$.o && web.setAttribute(_el$151, "src", _p$.o = _v$26);
|
|
881
|
+
_v$27 !== _p$.i && web.setAttribute(_el$151, "alt", _p$.i = _v$27);
|
|
782
882
|
return _p$;
|
|
783
883
|
}, {
|
|
784
884
|
e: void 0,
|
|
@@ -787,30 +887,30 @@ function ImageRenderer(props) {
|
|
|
787
887
|
o: void 0,
|
|
788
888
|
i: void 0
|
|
789
889
|
});
|
|
790
|
-
return _el$
|
|
890
|
+
return _el$148;
|
|
791
891
|
})();
|
|
792
892
|
}
|
|
793
893
|
function LinkRenderer(props) {
|
|
794
894
|
const params = props.component.params;
|
|
795
895
|
return (() => {
|
|
796
|
-
var _el$
|
|
797
|
-
_el$
|
|
798
|
-
web.insert(_el$
|
|
799
|
-
web.insert(_el$
|
|
896
|
+
var _el$156 = web.getNextElement(_tmpl$34), _el$157 = _el$156.firstChild, _el$158 = _el$157.nextSibling, _el$159 = _el$158.firstChild, _el$161 = _el$159.nextSibling, [_el$162, _co$33] = web.getNextMarker(_el$161.nextSibling);
|
|
897
|
+
_el$156.$$click = (e) => e.stopPropagation();
|
|
898
|
+
web.insert(_el$159, () => params.label || params.url);
|
|
899
|
+
web.insert(_el$158, web.createComponent(solidJs.Show, {
|
|
800
900
|
get when() {
|
|
801
901
|
return params.description;
|
|
802
902
|
},
|
|
803
903
|
get children() {
|
|
804
|
-
var _el$
|
|
805
|
-
web.insert(_el$
|
|
806
|
-
return _el$
|
|
904
|
+
var _el$160 = web.getNextElement(_tmpl$33);
|
|
905
|
+
web.insert(_el$160, () => params.description);
|
|
906
|
+
return _el$160;
|
|
807
907
|
}
|
|
808
|
-
}), _el$
|
|
908
|
+
}), _el$162, _co$33);
|
|
809
909
|
web.effect((_p$) => {
|
|
810
|
-
var _v$
|
|
811
|
-
_v$
|
|
812
|
-
_v$
|
|
813
|
-
_v$
|
|
910
|
+
var _v$28 = params.url, _v$29 = `${params.label || "Link"}: ${params.description || params.url} (opens in new tab)`, _v$30 = `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 || ""}`;
|
|
911
|
+
_v$28 !== _p$.e && web.setAttribute(_el$156, "href", _p$.e = _v$28);
|
|
912
|
+
_v$29 !== _p$.t && web.setAttribute(_el$156, "aria-label", _p$.t = _v$29);
|
|
913
|
+
_v$30 !== _p$.a && web.className(_el$156, _p$.a = _v$30);
|
|
814
914
|
return _p$;
|
|
815
915
|
}, {
|
|
816
916
|
e: void 0,
|
|
@@ -818,7 +918,7 @@ function LinkRenderer(props) {
|
|
|
818
918
|
a: void 0
|
|
819
919
|
});
|
|
820
920
|
web.runHydrationEvents();
|
|
821
|
-
return _el$
|
|
921
|
+
return _el$156;
|
|
822
922
|
})();
|
|
823
923
|
}
|
|
824
924
|
function ComponentRenderer(props) {
|
|
@@ -832,12 +932,12 @@ function ComponentRenderer(props) {
|
|
|
832
932
|
details: validation$1.errors
|
|
833
933
|
});
|
|
834
934
|
return (() => {
|
|
835
|
-
var _el$
|
|
836
|
-
web.insert(_el$
|
|
935
|
+
var _el$163 = web.getNextElement(_tmpl$35), _el$164 = _el$163.firstChild, _el$165 = _el$164.nextSibling;
|
|
936
|
+
web.insert(_el$165, () => {
|
|
837
937
|
var _a2, _b;
|
|
838
938
|
return ((_b = (_a2 = validation$1.errors) == null ? void 0 : _a2[0]) == null ? void 0 : _b.message) || "Unknown validation error";
|
|
839
939
|
});
|
|
840
|
-
return _el$
|
|
940
|
+
return _el$163;
|
|
841
941
|
})();
|
|
842
942
|
}
|
|
843
943
|
return web.createComponent(GenerativeUIErrorBoundary.GenerativeUIErrorBoundary, {
|
|
@@ -1083,27 +1183,27 @@ function ActionRenderer(props) {
|
|
|
1083
1183
|
const isDisabled = () => params.disabled || params.action === "tool-call" && isExecuting();
|
|
1084
1184
|
if (params.type === "link" || params.action === "link") {
|
|
1085
1185
|
return (() => {
|
|
1086
|
-
var _el$
|
|
1087
|
-
_el$
|
|
1088
|
-
web.insert(_el$
|
|
1186
|
+
var _el$166 = web.getNextElement(_tmpl$37), _el$168 = _el$166.firstChild, [_el$169, _co$34] = web.getNextMarker(_el$168.nextSibling), _el$170 = _el$169.nextSibling, [_el$171, _co$35] = web.getNextMarker(_el$170.nextSibling);
|
|
1187
|
+
_el$166.$$click = handleClick;
|
|
1188
|
+
web.insert(_el$166, web.createComponent(solidJs.Show, {
|
|
1089
1189
|
get when() {
|
|
1090
1190
|
return params.icon;
|
|
1091
1191
|
},
|
|
1092
1192
|
get children() {
|
|
1093
|
-
var _el$
|
|
1094
|
-
web.insert(_el$
|
|
1095
|
-
return _el$
|
|
1193
|
+
var _el$167 = web.getNextElement(_tmpl$36);
|
|
1194
|
+
web.insert(_el$167, () => params.icon);
|
|
1195
|
+
return _el$167;
|
|
1096
1196
|
}
|
|
1097
|
-
}), _el$
|
|
1098
|
-
web.insert(_el$
|
|
1197
|
+
}), _el$169, _co$34);
|
|
1198
|
+
web.insert(_el$166, () => params.label, _el$171, _co$35);
|
|
1099
1199
|
web.effect((_p$) => {
|
|
1100
|
-
var _v$
|
|
1200
|
+
var _v$31 = params.url || "#", _v$32 = params.url ? "_blank" : void 0, _v$33 = params.ariaLabel || params.label, _v$34 = `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
|
|
1101
1201
|
${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"}
|
|
1102
1202
|
${params.className || ""}`;
|
|
1103
|
-
_v$
|
|
1104
|
-
_v$
|
|
1105
|
-
_v$
|
|
1106
|
-
_v$
|
|
1203
|
+
_v$31 !== _p$.e && web.setAttribute(_el$166, "href", _p$.e = _v$31);
|
|
1204
|
+
_v$32 !== _p$.t && web.setAttribute(_el$166, "target", _p$.t = _v$32);
|
|
1205
|
+
_v$33 !== _p$.a && web.setAttribute(_el$166, "aria-label", _p$.a = _v$33);
|
|
1206
|
+
_v$34 !== _p$.o && web.className(_el$166, _p$.o = _v$34);
|
|
1107
1207
|
return _p$;
|
|
1108
1208
|
}, {
|
|
1109
1209
|
e: void 0,
|
|
@@ -1112,42 +1212,42 @@ function ActionRenderer(props) {
|
|
|
1112
1212
|
o: void 0
|
|
1113
1213
|
});
|
|
1114
1214
|
web.runHydrationEvents();
|
|
1115
|
-
return _el$
|
|
1215
|
+
return _el$166;
|
|
1116
1216
|
})();
|
|
1117
1217
|
}
|
|
1118
1218
|
return (() => {
|
|
1119
|
-
var _el$
|
|
1120
|
-
_el$
|
|
1121
|
-
web.insert(_el$
|
|
1219
|
+
var _el$172 = web.getNextElement(_tmpl$39), _el$175 = _el$172.firstChild, [_el$176, _co$36] = web.getNextMarker(_el$175.nextSibling), _el$177 = _el$176.nextSibling, [_el$178, _co$37] = web.getNextMarker(_el$177.nextSibling), _el$179 = _el$178.nextSibling, [_el$180, _co$38] = web.getNextMarker(_el$179.nextSibling);
|
|
1220
|
+
_el$172.$$click = handleClick;
|
|
1221
|
+
web.insert(_el$172, web.createComponent(solidJs.Show, {
|
|
1122
1222
|
get when() {
|
|
1123
1223
|
return web.memo(() => !!isExecuting())() && params.action === "tool-call";
|
|
1124
1224
|
},
|
|
1125
1225
|
get children() {
|
|
1126
|
-
return web.getNextElement(_tmpl$
|
|
1226
|
+
return web.getNextElement(_tmpl$38);
|
|
1127
1227
|
}
|
|
1128
|
-
}), _el$
|
|
1129
|
-
web.insert(_el$
|
|
1228
|
+
}), _el$176, _co$36);
|
|
1229
|
+
web.insert(_el$172, web.createComponent(solidJs.Show, {
|
|
1130
1230
|
get when() {
|
|
1131
1231
|
return web.memo(() => !!params.icon)() && !(isExecuting() && params.action === "tool-call");
|
|
1132
1232
|
},
|
|
1133
1233
|
get children() {
|
|
1134
|
-
var _el$
|
|
1135
|
-
web.insert(_el$
|
|
1136
|
-
return _el$
|
|
1234
|
+
var _el$174 = web.getNextElement(_tmpl$36);
|
|
1235
|
+
web.insert(_el$174, () => params.icon);
|
|
1236
|
+
return _el$174;
|
|
1137
1237
|
}
|
|
1138
|
-
}), _el$
|
|
1139
|
-
web.insert(_el$
|
|
1238
|
+
}), _el$178, _co$37);
|
|
1239
|
+
web.insert(_el$172, () => params.label, _el$180, _co$38);
|
|
1140
1240
|
web.effect((_p$) => {
|
|
1141
|
-
var _v$
|
|
1241
|
+
var _v$35 = params.action === "submit" ? "submit" : "button", _v$36 = isDisabled(), _v$37 = isExecuting() && params.action === "tool-call", _v$38 = params.ariaLabel || params.label, _v$39 = `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
|
|
1142
1242
|
${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"}
|
|
1143
1243
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1144
1244
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1145
1245
|
${params.className || ""}`;
|
|
1146
|
-
_v$
|
|
1147
|
-
_v$
|
|
1148
|
-
_v$
|
|
1149
|
-
_v$
|
|
1150
|
-
_v$
|
|
1246
|
+
_v$35 !== _p$.e && web.setAttribute(_el$172, "type", _p$.e = _v$35);
|
|
1247
|
+
_v$36 !== _p$.t && web.setProperty(_el$172, "disabled", _p$.t = _v$36);
|
|
1248
|
+
_v$37 !== _p$.a && web.setAttribute(_el$172, "aria-busy", _p$.a = _v$37);
|
|
1249
|
+
_v$38 !== _p$.o && web.setAttribute(_el$172, "aria-label", _p$.o = _v$38);
|
|
1250
|
+
_v$39 !== _p$.i && web.className(_el$172, _p$.i = _v$39);
|
|
1151
1251
|
return _p$;
|
|
1152
1252
|
}, {
|
|
1153
1253
|
e: void 0,
|
|
@@ -1157,7 +1257,7 @@ function ActionRenderer(props) {
|
|
|
1157
1257
|
i: void 0
|
|
1158
1258
|
});
|
|
1159
1259
|
web.runHydrationEvents();
|
|
1160
|
-
return _el$
|
|
1260
|
+
return _el$172;
|
|
1161
1261
|
})();
|
|
1162
1262
|
}
|
|
1163
1263
|
function ErrorCardRenderer(props) {
|
|
@@ -1165,55 +1265,55 @@ function ErrorCardRenderer(props) {
|
|
|
1165
1265
|
return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
|
|
1166
1266
|
};
|
|
1167
1267
|
return (() => {
|
|
1168
|
-
var _el$
|
|
1169
|
-
web.insert(_el$
|
|
1268
|
+
var _el$181 = web.getNextElement(_tmpl$43), _el$204 = _el$181.firstChild, [_el$205, _co$44] = web.getNextMarker(_el$204.nextSibling), _el$182 = _el$205.nextSibling, _el$183 = _el$182.firstChild, _el$184 = _el$183.nextSibling, _el$185 = _el$184.firstChild, _el$186 = _el$185.firstChild, _el$187 = _el$186.nextSibling, [_el$188, _co$39] = web.getNextMarker(_el$187.nextSibling), _el$189 = _el$185.nextSibling, _el$198 = _el$189.nextSibling, [_el$199, _co$41] = web.getNextMarker(_el$198.nextSibling), _el$200 = _el$199.nextSibling, [_el$201, _co$42] = web.getNextMarker(_el$200.nextSibling), _el$202 = _el$201.nextSibling, [_el$203, _co$43] = web.getNextMarker(_el$202.nextSibling);
|
|
1269
|
+
web.insert(_el$181, web.createComponent(CopyButton, {
|
|
1170
1270
|
getText: getErrorText,
|
|
1171
1271
|
title: "Copy error details",
|
|
1172
1272
|
position: "top-right"
|
|
1173
|
-
}), _el$
|
|
1174
|
-
web.insert(_el$
|
|
1175
|
-
web.insert(_el$
|
|
1176
|
-
web.insert(_el$
|
|
1273
|
+
}), _el$205, _co$44);
|
|
1274
|
+
web.insert(_el$185, () => props.error.tool || "Unknown", _el$188, _co$39);
|
|
1275
|
+
web.insert(_el$189, () => props.error.message || "An error occurred during tool execution");
|
|
1276
|
+
web.insert(_el$184, web.createComponent(solidJs.Show, {
|
|
1177
1277
|
get when() {
|
|
1178
1278
|
return props.error.type;
|
|
1179
1279
|
},
|
|
1180
1280
|
get children() {
|
|
1181
|
-
var _el$
|
|
1182
|
-
web.insert(_el$
|
|
1183
|
-
return _el$
|
|
1281
|
+
var _el$190 = web.getNextElement(_tmpl$40), _el$191 = _el$190.firstChild, _el$192 = _el$191.nextSibling, [_el$193, _co$40] = web.getNextMarker(_el$192.nextSibling);
|
|
1282
|
+
web.insert(_el$190, () => props.error.type, _el$193, _co$40);
|
|
1283
|
+
return _el$190;
|
|
1184
1284
|
}
|
|
1185
|
-
}), _el$
|
|
1186
|
-
web.insert(_el$
|
|
1285
|
+
}), _el$199, _co$41);
|
|
1286
|
+
web.insert(_el$184, web.createComponent(solidJs.Show, {
|
|
1187
1287
|
get when() {
|
|
1188
1288
|
var _a;
|
|
1189
1289
|
return (_a = props.error.suggestions) == null ? void 0 : _a.length;
|
|
1190
1290
|
},
|
|
1191
1291
|
get children() {
|
|
1192
|
-
var _el$
|
|
1193
|
-
web.insert(_el$
|
|
1292
|
+
var _el$194 = web.getNextElement(_tmpl$41), _el$195 = _el$194.firstChild, _el$196 = _el$195.nextSibling;
|
|
1293
|
+
web.insert(_el$196, web.createComponent(solidJs.For, {
|
|
1194
1294
|
get each() {
|
|
1195
1295
|
return props.error.suggestions;
|
|
1196
1296
|
},
|
|
1197
1297
|
children: (suggestion) => (() => {
|
|
1198
|
-
var _el$
|
|
1199
|
-
web.insert(_el$
|
|
1200
|
-
return _el$
|
|
1298
|
+
var _el$206 = web.getNextElement(_tmpl$44);
|
|
1299
|
+
web.insert(_el$206, suggestion);
|
|
1300
|
+
return _el$206;
|
|
1201
1301
|
})()
|
|
1202
1302
|
}));
|
|
1203
|
-
return _el$
|
|
1303
|
+
return _el$194;
|
|
1204
1304
|
}
|
|
1205
|
-
}), _el$
|
|
1206
|
-
web.insert(_el$
|
|
1305
|
+
}), _el$201, _co$42);
|
|
1306
|
+
web.insert(_el$184, web.createComponent(solidJs.Show, {
|
|
1207
1307
|
get when() {
|
|
1208
1308
|
return props.error.timestamp;
|
|
1209
1309
|
},
|
|
1210
1310
|
get children() {
|
|
1211
|
-
var _el$
|
|
1212
|
-
web.insert(_el$
|
|
1213
|
-
return _el$
|
|
1311
|
+
var _el$197 = web.getNextElement(_tmpl$42);
|
|
1312
|
+
web.insert(_el$197, () => new Date(props.error.timestamp).toLocaleString());
|
|
1313
|
+
return _el$197;
|
|
1214
1314
|
}
|
|
1215
|
-
}), _el$
|
|
1216
|
-
return _el$
|
|
1315
|
+
}), _el$203, _co$43);
|
|
1316
|
+
return _el$181;
|
|
1217
1317
|
})();
|
|
1218
1318
|
}
|
|
1219
1319
|
function isErrorResponse(content) {
|
|
@@ -1236,20 +1336,20 @@ function UIResourceHtmlRenderer(props) {
|
|
|
1236
1336
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
|
|
1237
1337
|
};
|
|
1238
1338
|
return (() => {
|
|
1239
|
-
var _el$
|
|
1240
|
-
web.insert(_el$
|
|
1339
|
+
var _el$207 = web.getNextElement(_tmpl$46), _el$211 = _el$207.firstChild, [_el$212, _co$45] = web.getNextMarker(_el$211.nextSibling), _el$210 = _el$212.nextSibling;
|
|
1340
|
+
web.insert(_el$207, web.createComponent(solidJs.Show, {
|
|
1241
1341
|
get when() {
|
|
1242
1342
|
var _a;
|
|
1243
1343
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
|
|
1244
1344
|
},
|
|
1245
1345
|
get children() {
|
|
1246
|
-
var _el$
|
|
1247
|
-
web.insert(_el$
|
|
1248
|
-
return _el$
|
|
1346
|
+
var _el$208 = web.getNextElement(_tmpl$45), _el$209 = _el$208.firstChild;
|
|
1347
|
+
web.insert(_el$209, resourceTitle);
|
|
1348
|
+
return _el$208;
|
|
1249
1349
|
}
|
|
1250
|
-
}), _el$
|
|
1251
|
-
web.effect(() => web.setProperty(_el$
|
|
1252
|
-
return _el$
|
|
1350
|
+
}), _el$212, _co$45);
|
|
1351
|
+
web.effect(() => web.setProperty(_el$210, "innerHTML", htmlContent()));
|
|
1352
|
+
return _el$207;
|
|
1253
1353
|
})();
|
|
1254
1354
|
}
|
|
1255
1355
|
const UIResourceRenderer = (props) => {
|
|
@@ -1329,24 +1429,24 @@ const UIResourceRenderer = (props) => {
|
|
|
1329
1429
|
return web.createComponent(RenderContext.RenderProvider, {
|
|
1330
1430
|
renderComponent,
|
|
1331
1431
|
get children() {
|
|
1332
|
-
var _el$
|
|
1333
|
-
web.insert(_el$
|
|
1432
|
+
var _el$213 = web.getNextElement(_tmpl$47), _el$214 = _el$213.firstChild, _el$215 = _el$214.nextSibling, [_el$216, _co$46] = web.getNextMarker(_el$215.nextSibling);
|
|
1433
|
+
web.insert(_el$214, web.createComponent(solidJs.For, {
|
|
1334
1434
|
get each() {
|
|
1335
1435
|
return layoutData.components;
|
|
1336
1436
|
},
|
|
1337
1437
|
children: (component) => (() => {
|
|
1338
|
-
var _el$
|
|
1339
|
-
web.insert(_el$
|
|
1438
|
+
var _el$217 = web.getNextElement(_tmpl$48);
|
|
1439
|
+
web.insert(_el$217, web.createComponent(ComponentRenderer, {
|
|
1340
1440
|
component,
|
|
1341
1441
|
get onError() {
|
|
1342
1442
|
return props.onError;
|
|
1343
1443
|
}
|
|
1344
1444
|
}));
|
|
1345
|
-
web.effect((_$p) => web.style(_el$
|
|
1346
|
-
return _el$
|
|
1445
|
+
web.effect((_$p) => web.style(_el$217, getGridStyleString(component), _$p));
|
|
1446
|
+
return _el$217;
|
|
1347
1447
|
})()
|
|
1348
1448
|
}));
|
|
1349
|
-
web.insert(_el$
|
|
1449
|
+
web.insert(_el$213, web.createComponent(solidJs.Show, {
|
|
1350
1450
|
get when() {
|
|
1351
1451
|
return shouldShowAutoFooter();
|
|
1352
1452
|
},
|
|
@@ -1357,17 +1457,17 @@ const UIResourceRenderer = (props) => {
|
|
|
1357
1457
|
}
|
|
1358
1458
|
});
|
|
1359
1459
|
}
|
|
1360
|
-
}), _el$
|
|
1460
|
+
}), _el$216, _co$46);
|
|
1361
1461
|
web.effect((_p$) => {
|
|
1362
|
-
var _v$
|
|
1363
|
-
_v$
|
|
1364
|
-
_p$.t = web.style(_el$
|
|
1462
|
+
var _v$40 = `w-full ${props.class || ""}`, _v$41 = gridContainerStyle();
|
|
1463
|
+
_v$40 !== _p$.e && web.className(_el$213, _p$.e = _v$40);
|
|
1464
|
+
_p$.t = web.style(_el$214, _v$41, _p$.t);
|
|
1365
1465
|
return _p$;
|
|
1366
1466
|
}, {
|
|
1367
1467
|
e: void 0,
|
|
1368
1468
|
t: void 0
|
|
1369
1469
|
});
|
|
1370
|
-
return _el$
|
|
1470
|
+
return _el$213;
|
|
1371
1471
|
}
|
|
1372
1472
|
});
|
|
1373
1473
|
};
|