@seed-ship/mcp-ui-solid 4.3.5 → 4.3.7
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/UIResourceRenderer.cjs +234 -219
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +234 -219
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/package.json +1 -1
- package/src/components/UIResourceRenderer.tsx +57 -53
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -19,7 +19,7 @@ import { useExpanded, ExpandableWrapper } from "./ExpandableWrapper.js";
|
|
|
19
19
|
import { RenderProvider } from "./RenderContext.js";
|
|
20
20
|
import { useAction } from "../hooks/useAction.js";
|
|
21
21
|
import { marked as k } from "../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.js";
|
|
22
|
-
var _tmpl$ = /* @__PURE__ */ 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__ */ template(`<button>`), _tmpl$3 = /* @__PURE__ */ 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__ */ 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__ */ 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__ */ 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__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__PURE__ */ 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__ */ 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__ */ template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ template(`<tr>`), _tmpl$10 = /* @__PURE__ */ 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__ */ template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__PURE__ */ 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__ */ 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__ */ 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__ */ 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__ */ 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__ */ template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$18 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ 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"aria-label="Clear search">×`), _tmpl$20 = /* @__PURE__ */ 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 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$21 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$22 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$23 = /* @__PURE__ */ 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$24 = /* @__PURE__ */ template(`<button class="px-4 py-1.5 rounded-md bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 transition-colors"><!$><!/> (<!$><!/> suivant<!$><!/>)`), _tmpl$25 = /* @__PURE__ */ template(`<div class="mt-3 flex flex-col items-center gap-2 text-xs text-gray-500 dark:text-gray-400"><span><!$><!/>–<!$><!/> of <!$><!/></span><!$><!/>`), _tmpl$26 = /* @__PURE__ */ 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$27 = /* @__PURE__ */ 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$28 = /* @__PURE__ */ template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$29 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$30 = /* @__PURE__ */ template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$31 = /* @__PURE__ */ 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$32 = /* @__PURE__ */ 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$33 = /* @__PURE__ */ 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$34 = /* @__PURE__ */ 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$35 = /* @__PURE__ */ 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$36 = /* @__PURE__ */ 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$37 = /* @__PURE__ */ 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$38 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$39 = /* @__PURE__ */ 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$40 = /* @__PURE__ */ 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$41 = /* @__PURE__ */ template(`<span aria-hidden=true>`), _tmpl$42 = /* @__PURE__ */ template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$43 = /* @__PURE__ */ template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$44 = /* @__PURE__ */ template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$45 = /* @__PURE__ */ template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$46 = /* @__PURE__ */ 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$47 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$48 = /* @__PURE__ */ 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$49 = /* @__PURE__ */ template(`<li>`), _tmpl$50 = /* @__PURE__ */ 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$51 = /* @__PURE__ */ 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$52 = /* @__PURE__ */ template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$53 = /* @__PURE__ */ template(`<div>`);
|
|
22
|
+
var _tmpl$ = /* @__PURE__ */ 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__ */ template(`<button>`), _tmpl$3 = /* @__PURE__ */ 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__ */ 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__ */ 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__ */ 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__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__PURE__ */ 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__ */ 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__ */ template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ template(`<tr>`), _tmpl$10 = /* @__PURE__ */ 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__ */ template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__PURE__ */ 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__ */ 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__ */ 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__ */ 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__ */ 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__ */ template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$18 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ 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"aria-label="Clear search">×`), _tmpl$20 = /* @__PURE__ */ 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$21 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$22 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$23 = /* @__PURE__ */ 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">`), _tmpl$24 = /* @__PURE__ */ template(`<span class=text-gray-400>/ page`), _tmpl$25 = /* @__PURE__ */ 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 class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">◀</button><span><!$><!/> / <!$><!/></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">▶</button><!$><!/>`), _tmpl$26 = /* @__PURE__ */ 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-100 dark:bg-gray-900 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/>`), _tmpl$27 = /* @__PURE__ */ 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$28 = /* @__PURE__ */ template(`<option>`), _tmpl$29 = /* @__PURE__ */ template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$30 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$31 = /* @__PURE__ */ template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$32 = /* @__PURE__ */ 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$33 = /* @__PURE__ */ 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$34 = /* @__PURE__ */ 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$35 = /* @__PURE__ */ 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__ */ 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$37 = /* @__PURE__ */ 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__ */ 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__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$40 = /* @__PURE__ */ 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__ */ 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$42 = /* @__PURE__ */ template(`<span aria-hidden=true>`), _tmpl$43 = /* @__PURE__ */ template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$44 = /* @__PURE__ */ template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$45 = /* @__PURE__ */ template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$46 = /* @__PURE__ */ template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$47 = /* @__PURE__ */ 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$48 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$49 = /* @__PURE__ */ 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$50 = /* @__PURE__ */ template(`<li>`), _tmpl$51 = /* @__PURE__ */ 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$52 = /* @__PURE__ */ 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$53 = /* @__PURE__ */ template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$54 = /* @__PURE__ */ template(`<div>`);
|
|
23
23
|
function CopyButton(props) {
|
|
24
24
|
const [copied, setCopied] = createSignal(false);
|
|
25
25
|
const handleCopy = async () => {
|
|
@@ -280,7 +280,6 @@ function TableRenderer(props) {
|
|
|
280
280
|
setSortDir("asc");
|
|
281
281
|
}
|
|
282
282
|
setClientPage(0);
|
|
283
|
-
setProgressivePages(1);
|
|
284
283
|
};
|
|
285
284
|
const sortedRows = createMemo(() => {
|
|
286
285
|
var _a;
|
|
@@ -321,7 +320,6 @@ function TableRenderer(props) {
|
|
|
321
320
|
searchTimer = setTimeout(() => {
|
|
322
321
|
setDebouncedQuery(value);
|
|
323
322
|
setClientPage(0);
|
|
324
|
-
setProgressivePages(1);
|
|
325
323
|
}, 200);
|
|
326
324
|
};
|
|
327
325
|
const normalize = (s) => s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
@@ -336,28 +334,45 @@ function TableRenderer(props) {
|
|
|
336
334
|
}));
|
|
337
335
|
});
|
|
338
336
|
const isExpanded = useExpanded();
|
|
339
|
-
const
|
|
340
|
-
const
|
|
341
|
-
const
|
|
337
|
+
const defaultPageSize = () => tableParams.pageSize ?? 25;
|
|
338
|
+
const chatDefault = () => tableParams.chatPageSize ?? Math.min(10, defaultPageSize());
|
|
339
|
+
const [userPageSize, setUserPageSize] = createSignal(null);
|
|
340
|
+
const clientPageSize = () => {
|
|
341
|
+
const ups = userPageSize();
|
|
342
|
+
if (ups !== null) return ups;
|
|
343
|
+
return isExpanded() ? defaultPageSize() : chatDefault();
|
|
344
|
+
};
|
|
345
|
+
const showAll = () => userPageSize() === 0;
|
|
342
346
|
const hasServerPagination = () => !!tableParams.pagination;
|
|
343
|
-
const
|
|
344
|
-
const needsClientPagination = () => !hasServerPagination() && clientPageSize() > 0 && filteredRows().length > clientPageSize();
|
|
347
|
+
const needsClientPagination = () => !hasServerPagination() && !showAll() && clientPageSize() > 0 && filteredRows().length > clientPageSize();
|
|
345
348
|
const [clientPage, setClientPage] = createSignal(tableParams.initialPage ?? 0);
|
|
346
|
-
const [progressivePages, setProgressivePages] = createSignal(1);
|
|
347
349
|
const clientTotalPages = () => needsClientPagination() ? Math.ceil(filteredRows().length / clientPageSize()) : 1;
|
|
348
350
|
const clientVisibleRows = createMemo(() => {
|
|
349
|
-
if (!needsClientPagination()) return filteredRows();
|
|
350
|
-
if (isProgressiveMode()) {
|
|
351
|
-
return filteredRows().slice(0, progressivePages() * clientPageSize());
|
|
352
|
-
}
|
|
351
|
+
if (showAll() || !needsClientPagination()) return filteredRows();
|
|
353
352
|
const start = clientPage() * clientPageSize();
|
|
354
353
|
return filteredRows().slice(start, start + clientPageSize());
|
|
355
354
|
});
|
|
356
|
-
const clientRangeStart = () => needsClientPagination() ?
|
|
357
|
-
const clientRangeEnd = () => needsClientPagination() ?
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
|
|
355
|
+
const clientRangeStart = () => needsClientPagination() ? clientPage() * clientPageSize() + 1 : 1;
|
|
356
|
+
const clientRangeEnd = () => needsClientPagination() ? Math.min((clientPage() + 1) * clientPageSize(), filteredRows().length) : filteredRows().length;
|
|
357
|
+
const pageSizeOptions = () => {
|
|
358
|
+
const total = filteredRows().length;
|
|
359
|
+
const opts = [];
|
|
360
|
+
for (const n of [10, 30, 60, 100]) {
|
|
361
|
+
if (n < total) opts.push({
|
|
362
|
+
value: n,
|
|
363
|
+
label: String(n)
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
opts.push({
|
|
367
|
+
value: 0,
|
|
368
|
+
label: "All"
|
|
369
|
+
});
|
|
370
|
+
return opts;
|
|
371
|
+
};
|
|
372
|
+
const handlePageSizeChange = (val) => {
|
|
373
|
+
setUserPageSize(val === 0 ? 0 : val);
|
|
374
|
+
setClientPage(0);
|
|
375
|
+
};
|
|
361
376
|
const [virtualizer, setVirtualizer] = createSignal(null);
|
|
362
377
|
const [isVirtualizing, setIsVirtualizing] = createSignal(false);
|
|
363
378
|
const shouldVirtualize = createMemo(() => {
|
|
@@ -551,7 +566,7 @@ ${dataRows}`;
|
|
|
551
566
|
},
|
|
552
567
|
copyLabel: "Copy table (CSV)",
|
|
553
568
|
get children() {
|
|
554
|
-
var _el$29 = getNextElement(_tmpl$26), _el$
|
|
569
|
+
var _el$29 = getNextElement(_tmpl$26), _el$120 = _el$29.firstChild, [_el$121, _co$28] = getNextMarker(_el$120.nextSibling), _el$44 = _el$121.nextSibling, _el$112 = _el$44.firstChild, [_el$113, _co$24] = getNextMarker(_el$112.nextSibling), _el$114 = _el$113.nextSibling, [_el$115, _co$25] = getNextMarker(_el$114.nextSibling), _el$70 = _el$115.nextSibling, _el$71 = _el$70.firstChild, _el$72 = _el$71.firstChild, _el$73 = _el$72.firstChild, _el$74 = _el$72.nextSibling, [_el$75, _co$14] = getNextMarker(_el$74.nextSibling), _el$116 = _el$70.nextSibling, [_el$117, _co$26] = getNextMarker(_el$116.nextSibling), _el$118 = _el$117.nextSibling, [_el$119, _co$27] = getNextMarker(_el$118.nextSibling);
|
|
555
570
|
insert(_el$29, createComponent(Show, {
|
|
556
571
|
when: exportable,
|
|
557
572
|
get fallback() {
|
|
@@ -609,7 +624,7 @@ ${dataRows}`;
|
|
|
609
624
|
runHydrationEvents();
|
|
610
625
|
return _el$30;
|
|
611
626
|
}
|
|
612
|
-
}), _el$
|
|
627
|
+
}), _el$121, _co$28);
|
|
613
628
|
insert(_el$44, createComponent(Show, {
|
|
614
629
|
get when() {
|
|
615
630
|
return tableParams.title;
|
|
@@ -634,7 +649,7 @@ ${dataRows}`;
|
|
|
634
649
|
}), _el$54, _co$1);
|
|
635
650
|
return _el$45;
|
|
636
651
|
}
|
|
637
|
-
}), _el$
|
|
652
|
+
}), _el$113, _co$24);
|
|
638
653
|
insert(_el$44, createComponent(Show, {
|
|
639
654
|
get when() {
|
|
640
655
|
return isSearchable();
|
|
@@ -675,7 +690,7 @@ ${dataRows}`;
|
|
|
675
690
|
}
|
|
676
691
|
})];
|
|
677
692
|
}
|
|
678
|
-
}), _el$
|
|
693
|
+
}), _el$115, _co$25);
|
|
679
694
|
var _ref$ = scrollContainerRef;
|
|
680
695
|
typeof _ref$ === "function" ? use(_ref$, _el$70) : scrollContainerRef = _el$70;
|
|
681
696
|
insert(_el$73, createComponent(For, {
|
|
@@ -683,10 +698,10 @@ ${dataRows}`;
|
|
|
683
698
|
return tableParams.columns;
|
|
684
699
|
},
|
|
685
700
|
children: (column) => (() => {
|
|
686
|
-
var _el$
|
|
687
|
-
addEventListener(_el$
|
|
688
|
-
insert(_el$
|
|
689
|
-
insert(_el$
|
|
701
|
+
var _el$122 = getNextElement(_tmpl$27), _el$123 = _el$122.firstChild, _el$125 = _el$123.firstChild, [_el$126, _co$29] = getNextMarker(_el$125.nextSibling), _el$124 = _el$126.nextSibling;
|
|
702
|
+
addEventListener(_el$122, "click", () => handleSort(column.key));
|
|
703
|
+
insert(_el$123, () => column.label, _el$126, _co$29);
|
|
704
|
+
insert(_el$124, () => sortIndicator(column.key));
|
|
690
705
|
effect((_p$) => {
|
|
691
706
|
var _v$11 = column.width ? {
|
|
692
707
|
width: column.width
|
|
@@ -694,16 +709,16 @@ ${dataRows}`;
|
|
|
694
709
|
"opacity-30": sortKey() !== column.key,
|
|
695
710
|
"opacity-100 text-blue-600 dark:text-blue-400": sortKey() === column.key
|
|
696
711
|
};
|
|
697
|
-
_p$.e = style(_el$
|
|
698
|
-
_v$12 !== _p$.t && setAttribute(_el$
|
|
699
|
-
_p$.a = classList(_el$
|
|
712
|
+
_p$.e = style(_el$122, _v$11, _p$.e);
|
|
713
|
+
_v$12 !== _p$.t && setAttribute(_el$122, "title", _p$.t = _v$12);
|
|
714
|
+
_p$.a = classList(_el$124, _v$13, _p$.a);
|
|
700
715
|
return _p$;
|
|
701
716
|
}, {
|
|
702
717
|
e: void 0,
|
|
703
718
|
t: void 0,
|
|
704
719
|
a: void 0
|
|
705
720
|
});
|
|
706
|
-
return _el$
|
|
721
|
+
return _el$122;
|
|
707
722
|
})()
|
|
708
723
|
}));
|
|
709
724
|
insert(_el$71, createComponent(Show, {
|
|
@@ -728,24 +743,48 @@ ${dataRows}`;
|
|
|
728
743
|
insert(_el$77, () => tableParams.pagination.totalRows, _el$88, _co$17);
|
|
729
744
|
return _el$76;
|
|
730
745
|
}
|
|
731
|
-
}), _el$
|
|
746
|
+
}), _el$117, _co$26);
|
|
732
747
|
insert(_el$44, createComponent(Show, {
|
|
733
748
|
get when() {
|
|
734
|
-
return
|
|
749
|
+
return needsClientPagination();
|
|
735
750
|
},
|
|
736
751
|
get children() {
|
|
737
|
-
var _el$89 = getNextElement(_tmpl$
|
|
738
|
-
insert(_el$90, clientRangeStart, _el$
|
|
739
|
-
insert(_el$90, clientRangeEnd, _el$
|
|
740
|
-
insert(_el$90, () => filteredRows().length.toLocaleString("fr-FR"), _el$
|
|
741
|
-
_el$
|
|
742
|
-
insert(_el$
|
|
743
|
-
insert(_el$
|
|
744
|
-
_el$
|
|
752
|
+
var _el$89 = getNextElement(_tmpl$25), _el$90 = _el$89.firstChild, _el$93 = _el$90.firstChild, [_el$94, _co$18] = getNextMarker(_el$93.nextSibling), _el$91 = _el$94.nextSibling, _el$95 = _el$91.nextSibling, [_el$96, _co$19] = getNextMarker(_el$95.nextSibling), _el$92 = _el$96.nextSibling, _el$97 = _el$92.nextSibling, [_el$98, _co$20] = getNextMarker(_el$97.nextSibling), _el$99 = _el$90.nextSibling, _el$100 = _el$99.firstChild, _el$101 = _el$100.nextSibling, _el$103 = _el$101.firstChild, [_el$104, _co$21] = getNextMarker(_el$103.nextSibling), _el$102 = _el$104.nextSibling, _el$105 = _el$102.nextSibling, [_el$106, _co$22] = getNextMarker(_el$105.nextSibling), _el$107 = _el$101.nextSibling, _el$110 = _el$107.nextSibling, [_el$111, _co$23] = getNextMarker(_el$110.nextSibling);
|
|
753
|
+
insert(_el$90, clientRangeStart, _el$94, _co$18);
|
|
754
|
+
insert(_el$90, clientRangeEnd, _el$96, _co$19);
|
|
755
|
+
insert(_el$90, () => filteredRows().length.toLocaleString("fr-FR"), _el$98, _co$20);
|
|
756
|
+
_el$100.$$click = () => setClientPage((p) => p - 1);
|
|
757
|
+
insert(_el$101, () => clientPage() + 1, _el$104, _co$21);
|
|
758
|
+
insert(_el$101, clientTotalPages, _el$106, _co$22);
|
|
759
|
+
_el$107.$$click = () => setClientPage((p) => p + 1);
|
|
760
|
+
insert(_el$99, createComponent(Show, {
|
|
761
|
+
get when() {
|
|
762
|
+
return memo(() => !!isExpanded())() && filteredRows().length > 10;
|
|
763
|
+
},
|
|
764
|
+
get children() {
|
|
765
|
+
return [(() => {
|
|
766
|
+
var _el$108 = getNextElement(_tmpl$23);
|
|
767
|
+
_el$108.addEventListener("change", (e) => handlePageSizeChange(Number(e.currentTarget.value)));
|
|
768
|
+
insert(_el$108, createComponent(For, {
|
|
769
|
+
get each() {
|
|
770
|
+
return pageSizeOptions();
|
|
771
|
+
},
|
|
772
|
+
children: (opt) => (() => {
|
|
773
|
+
var _el$127 = getNextElement(_tmpl$28);
|
|
774
|
+
insert(_el$127, () => opt.label);
|
|
775
|
+
effect(() => setProperty(_el$127, "value", opt.value));
|
|
776
|
+
return _el$127;
|
|
777
|
+
})()
|
|
778
|
+
}));
|
|
779
|
+
effect(() => setProperty(_el$108, "value", clientPageSize()));
|
|
780
|
+
return _el$108;
|
|
781
|
+
})(), getNextElement(_tmpl$24)];
|
|
782
|
+
}
|
|
783
|
+
}), _el$111, _co$23);
|
|
745
784
|
effect((_p$) => {
|
|
746
785
|
var _v$8 = clientPage() === 0, _v$9 = clientPage() >= clientTotalPages() - 1;
|
|
747
|
-
_v$8 !== _p$.e && setProperty(_el$
|
|
748
|
-
_v$9 !== _p$.t && setProperty(_el$
|
|
786
|
+
_v$8 !== _p$.e && setProperty(_el$100, "disabled", _p$.e = _v$8);
|
|
787
|
+
_v$9 !== _p$.t && setProperty(_el$107, "disabled", _p$.t = _v$9);
|
|
749
788
|
return _p$;
|
|
750
789
|
}, {
|
|
751
790
|
e: void 0,
|
|
@@ -754,40 +793,16 @@ ${dataRows}`;
|
|
|
754
793
|
runHydrationEvents();
|
|
755
794
|
return _el$89;
|
|
756
795
|
}
|
|
757
|
-
}), _el$
|
|
758
|
-
insert(_el$44, createComponent(Show, {
|
|
759
|
-
get when() {
|
|
760
|
-
return memo(() => !!needsClientPagination())() && isProgressiveMode();
|
|
761
|
-
},
|
|
762
|
-
get children() {
|
|
763
|
-
var _el$110 = getNextElement(_tmpl$25), _el$111 = _el$110.firstChild, _el$114 = _el$111.firstChild, [_el$115, _co$23] = getNextMarker(_el$114.nextSibling), _el$112 = _el$115.nextSibling, _el$116 = _el$112.nextSibling, [_el$117, _co$24] = getNextMarker(_el$116.nextSibling), _el$113 = _el$117.nextSibling, _el$118 = _el$113.nextSibling, [_el$119, _co$25] = getNextMarker(_el$118.nextSibling), _el$130 = _el$111.nextSibling, [_el$131, _co$29] = getNextMarker(_el$130.nextSibling);
|
|
764
|
-
insert(_el$111, clientRangeStart, _el$115, _co$23);
|
|
765
|
-
insert(_el$111, clientRangeEnd, _el$117, _co$24);
|
|
766
|
-
insert(_el$111, () => filteredRows().length.toLocaleString("fr-FR"), _el$119, _co$25);
|
|
767
|
-
insert(_el$110, createComponent(Show, {
|
|
768
|
-
get when() {
|
|
769
|
-
return progressiveHasMore();
|
|
770
|
-
},
|
|
771
|
-
get children() {
|
|
772
|
-
var _el$120 = getNextElement(_tmpl$24), _el$124 = _el$120.firstChild, [_el$125, _co$26] = getNextMarker(_el$124.nextSibling), _el$121 = _el$125.nextSibling, _el$126 = _el$121.nextSibling, [_el$127, _co$27] = getNextMarker(_el$126.nextSibling), _el$122 = _el$127.nextSibling, _el$128 = _el$122.nextSibling, [_el$129, _co$28] = getNextMarker(_el$128.nextSibling);
|
|
773
|
-
_el$129.nextSibling;
|
|
774
|
-
_el$120.$$click = () => setProgressivePages((p) => p + 1);
|
|
775
|
-
insert(_el$120, showMoreLabel, _el$125, _co$26);
|
|
776
|
-
insert(_el$120, () => Math.min(progressiveRemaining(), clientPageSize()), _el$127, _co$27);
|
|
777
|
-
insert(_el$120, () => Math.min(progressiveRemaining(), clientPageSize()) > 1 ? "es" : "e", _el$129, _co$28);
|
|
778
|
-
runHydrationEvents();
|
|
779
|
-
return _el$120;
|
|
780
|
-
}
|
|
781
|
-
}), _el$131, _co$29);
|
|
782
|
-
return _el$110;
|
|
783
|
-
}
|
|
784
|
-
}), _el$141, _co$34);
|
|
796
|
+
}), _el$119, _co$27);
|
|
785
797
|
effect((_p$) => {
|
|
786
798
|
var _v$0 = isVirtualizing() ? {
|
|
787
799
|
"max-height": "500px",
|
|
788
800
|
"overflow-y": "auto"
|
|
789
801
|
} : clientVisibleRows().length > 8 ? {
|
|
790
|
-
"max-height": isExpanded() ? "
|
|
802
|
+
"max-height": isExpanded() ? "calc(100vh - 180px)" : "400px",
|
|
803
|
+
"overflow-y": "auto"
|
|
804
|
+
} : isExpanded() ? {
|
|
805
|
+
"max-height": "calc(100vh - 180px)",
|
|
791
806
|
"overflow-y": "auto"
|
|
792
807
|
} : {}, _v$1 = tableParams.title || "Data table", _v$10 = tableParams.title ? `${tableId}-title` : void 0;
|
|
793
808
|
_p$.e = style(_el$70, _v$0, _p$.e);
|
|
@@ -812,51 +827,51 @@ function MetricRenderer(props) {
|
|
|
812
827
|
return `${title}: ${value}${unit ? " " + unit : ""}`;
|
|
813
828
|
};
|
|
814
829
|
return (() => {
|
|
815
|
-
var _el$
|
|
816
|
-
insert(_el$
|
|
830
|
+
var _el$128 = getNextElement(_tmpl$32), _el$150 = _el$128.firstChild, [_el$151, _co$35] = getNextMarker(_el$150.nextSibling), _el$129 = _el$151.nextSibling, _el$130 = _el$129.firstChild, _el$131 = _el$130.firstChild, _el$132 = _el$131.nextSibling, _el$133 = _el$132.firstChild, _el$135 = _el$133.nextSibling, [_el$136, _co$30] = getNextMarker(_el$135.nextSibling), _el$146 = _el$130.nextSibling, [_el$147, _co$33] = getNextMarker(_el$146.nextSibling), _el$148 = _el$147.nextSibling, [_el$149, _co$34] = getNextMarker(_el$148.nextSibling);
|
|
831
|
+
insert(_el$128, createComponent(CopyButton, {
|
|
817
832
|
getText: getMetricText,
|
|
818
833
|
title: "Copy metric",
|
|
819
834
|
position: "top-right"
|
|
820
|
-
}), _el$
|
|
821
|
-
insert(_el$
|
|
822
|
-
insert(_el$
|
|
823
|
-
insert(_el$
|
|
835
|
+
}), _el$151, _co$35);
|
|
836
|
+
insert(_el$131, () => metricParams.title);
|
|
837
|
+
insert(_el$133, () => metricParams.value);
|
|
838
|
+
insert(_el$132, createComponent(Show, {
|
|
824
839
|
get when() {
|
|
825
840
|
return metricParams.unit;
|
|
826
841
|
},
|
|
827
842
|
get children() {
|
|
828
|
-
var _el$
|
|
829
|
-
insert(_el$
|
|
830
|
-
return _el$
|
|
843
|
+
var _el$134 = getNextElement(_tmpl$29);
|
|
844
|
+
insert(_el$134, () => metricParams.unit);
|
|
845
|
+
return _el$134;
|
|
831
846
|
}
|
|
832
|
-
}), _el$
|
|
833
|
-
insert(_el$
|
|
847
|
+
}), _el$136, _co$30);
|
|
848
|
+
insert(_el$129, createComponent(Show, {
|
|
834
849
|
get when() {
|
|
835
850
|
return metricParams.trend;
|
|
836
851
|
},
|
|
837
852
|
get children() {
|
|
838
|
-
var _el$
|
|
839
|
-
_el$
|
|
840
|
-
insert(_el$
|
|
853
|
+
var _el$137 = getNextElement(_tmpl$30), _el$138 = _el$137.firstChild, _el$141 = _el$138.firstChild, [_el$142, _co$31] = getNextMarker(_el$141.nextSibling), _el$139 = _el$142.nextSibling, _el$143 = _el$139.nextSibling, [_el$144, _co$32] = getNextMarker(_el$143.nextSibling);
|
|
854
|
+
_el$144.nextSibling;
|
|
855
|
+
insert(_el$138, (() => {
|
|
841
856
|
var _c$ = memo(() => metricParams.trend.direction === "up");
|
|
842
857
|
return () => _c$() ? "�" : metricParams.trend.direction === "down" ? "�" : "�";
|
|
843
|
-
})(), _el$
|
|
844
|
-
insert(_el$
|
|
845
|
-
effect(() => className(_el$
|
|
846
|
-
return _el$
|
|
858
|
+
})(), _el$142, _co$31);
|
|
859
|
+
insert(_el$138, () => Math.abs(metricParams.trend.value), _el$144, _co$32);
|
|
860
|
+
effect(() => className(_el$138, `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"}`));
|
|
861
|
+
return _el$137;
|
|
847
862
|
}
|
|
848
|
-
}), _el$
|
|
849
|
-
insert(_el$
|
|
863
|
+
}), _el$147, _co$33);
|
|
864
|
+
insert(_el$129, createComponent(Show, {
|
|
850
865
|
get when() {
|
|
851
866
|
return metricParams.subtitle;
|
|
852
867
|
},
|
|
853
868
|
get children() {
|
|
854
|
-
var _el$
|
|
855
|
-
insert(_el$
|
|
856
|
-
return _el$
|
|
869
|
+
var _el$145 = getNextElement(_tmpl$31);
|
|
870
|
+
insert(_el$145, () => metricParams.subtitle);
|
|
871
|
+
return _el$145;
|
|
857
872
|
}
|
|
858
|
-
}), _el$
|
|
859
|
-
return _el$
|
|
873
|
+
}), _el$149, _co$34);
|
|
874
|
+
return _el$128;
|
|
860
875
|
})();
|
|
861
876
|
}
|
|
862
877
|
function extractImageFromMarkdown(content) {
|
|
@@ -897,62 +912,62 @@ function TextRenderer(props) {
|
|
|
897
912
|
},
|
|
898
913
|
get fallback() {
|
|
899
914
|
return (() => {
|
|
900
|
-
var _el$
|
|
901
|
-
insert(_el$
|
|
915
|
+
var _el$152 = getNextElement(_tmpl$33), _el$154 = _el$152.firstChild, [_el$155, _co$36] = getNextMarker(_el$154.nextSibling), _el$153 = _el$155.nextSibling;
|
|
916
|
+
insert(_el$152, createComponent(CopyButton, {
|
|
902
917
|
getText: getTextContent,
|
|
903
918
|
title: "Copy text",
|
|
904
919
|
position: "top-right"
|
|
905
|
-
}), _el$
|
|
920
|
+
}), _el$155, _co$36);
|
|
906
921
|
effect((_p$) => {
|
|
907
922
|
var _v$14 = `prose prose-sm dark:prose-invert max-w-none ${textParams.className || ""}`, _v$15 = htmlContent();
|
|
908
|
-
_v$14 !== _p$.e && className(_el$
|
|
909
|
-
_v$15 !== _p$.t && setProperty(_el$
|
|
923
|
+
_v$14 !== _p$.e && className(_el$153, _p$.e = _v$14);
|
|
924
|
+
_v$15 !== _p$.t && setProperty(_el$153, "innerHTML", _p$.t = _v$15);
|
|
910
925
|
return _p$;
|
|
911
926
|
}, {
|
|
912
927
|
e: void 0,
|
|
913
928
|
t: void 0
|
|
914
929
|
});
|
|
915
|
-
return _el$
|
|
930
|
+
return _el$152;
|
|
916
931
|
})();
|
|
917
932
|
},
|
|
918
933
|
children: (data) => (() => {
|
|
919
|
-
var _el$
|
|
920
|
-
insert(_el$
|
|
934
|
+
var _el$156 = getNextElement(_tmpl$34), _el$157 = _el$156.firstChild, _el$158 = _el$157.firstChild, _el$159 = _el$158.firstChild, _el$160 = _el$157.nextSibling, _el$161 = _el$160.firstChild;
|
|
935
|
+
insert(_el$161, () => data().credit);
|
|
921
936
|
effect((_p$) => {
|
|
922
937
|
var _v$16 = data().linkUrl, _v$17 = data().imageUrl, _v$18 = data().alt;
|
|
923
|
-
_v$16 !== _p$.e && setAttribute(_el$
|
|
924
|
-
_v$17 !== _p$.t && setAttribute(_el$
|
|
925
|
-
_v$18 !== _p$.a && setAttribute(_el$
|
|
938
|
+
_v$16 !== _p$.e && setAttribute(_el$158, "href", _p$.e = _v$16);
|
|
939
|
+
_v$17 !== _p$.t && setAttribute(_el$159, "src", _p$.t = _v$17);
|
|
940
|
+
_v$18 !== _p$.a && setAttribute(_el$159, "alt", _p$.a = _v$18);
|
|
926
941
|
return _p$;
|
|
927
942
|
}, {
|
|
928
943
|
e: void 0,
|
|
929
944
|
t: void 0,
|
|
930
945
|
a: void 0
|
|
931
946
|
});
|
|
932
|
-
return _el$
|
|
947
|
+
return _el$156;
|
|
933
948
|
})()
|
|
934
949
|
});
|
|
935
950
|
}
|
|
936
951
|
function IframeRenderer(props) {
|
|
937
952
|
const params = props.component.params;
|
|
938
953
|
return (() => {
|
|
939
|
-
var _el$
|
|
940
|
-
insert(_el$
|
|
954
|
+
var _el$162 = getNextElement(_tmpl$36), _el$166 = _el$162.firstChild, [_el$167, _co$37] = getNextMarker(_el$166.nextSibling), _el$165 = _el$167.nextSibling;
|
|
955
|
+
insert(_el$162, createComponent(Show, {
|
|
941
956
|
get when() {
|
|
942
957
|
return params.title;
|
|
943
958
|
},
|
|
944
959
|
get children() {
|
|
945
|
-
var _el$
|
|
946
|
-
insert(_el$
|
|
947
|
-
return _el$
|
|
960
|
+
var _el$163 = getNextElement(_tmpl$35), _el$164 = _el$163.firstChild;
|
|
961
|
+
insert(_el$164, () => params.title);
|
|
962
|
+
return _el$163;
|
|
948
963
|
}
|
|
949
|
-
}), _el$
|
|
964
|
+
}), _el$167, _co$37);
|
|
950
965
|
effect((_p$) => {
|
|
951
966
|
var _v$19 = params.url, _v$20 = params.title || "Embedded content", _v$21 = `height: ${params.height || "400px"}; min-height: 300px;`, _v$22 = getIframeSandbox(params.url);
|
|
952
|
-
_v$19 !== _p$.e && setAttribute(_el$
|
|
953
|
-
_v$20 !== _p$.t && setAttribute(_el$
|
|
954
|
-
_p$.a = style(_el$
|
|
955
|
-
_v$22 !== _p$.o && setAttribute(_el$
|
|
967
|
+
_v$19 !== _p$.e && setAttribute(_el$165, "src", _p$.e = _v$19);
|
|
968
|
+
_v$20 !== _p$.t && setAttribute(_el$165, "title", _p$.t = _v$20);
|
|
969
|
+
_p$.a = style(_el$165, _v$21, _p$.a);
|
|
970
|
+
_v$22 !== _p$.o && setAttribute(_el$165, "sandbox", _p$.o = _v$22);
|
|
956
971
|
return _p$;
|
|
957
972
|
}, {
|
|
958
973
|
e: void 0,
|
|
@@ -960,30 +975,30 @@ function IframeRenderer(props) {
|
|
|
960
975
|
a: void 0,
|
|
961
976
|
o: void 0
|
|
962
977
|
});
|
|
963
|
-
return _el$
|
|
978
|
+
return _el$162;
|
|
964
979
|
})();
|
|
965
980
|
}
|
|
966
981
|
function ImageRenderer(props) {
|
|
967
982
|
const params = props.component.params;
|
|
968
983
|
return (() => {
|
|
969
|
-
var _el$
|
|
970
|
-
insert(_el$
|
|
984
|
+
var _el$168 = getNextElement(_tmpl$38), _el$169 = _el$168.firstChild, _el$170 = _el$169.firstChild, _el$171 = _el$170.firstChild, _el$174 = _el$169.nextSibling, [_el$175, _co$38] = getNextMarker(_el$174.nextSibling);
|
|
985
|
+
insert(_el$168, createComponent(Show, {
|
|
971
986
|
get when() {
|
|
972
987
|
return params.caption;
|
|
973
988
|
},
|
|
974
989
|
get children() {
|
|
975
|
-
var _el$
|
|
976
|
-
insert(_el$
|
|
977
|
-
return _el$
|
|
990
|
+
var _el$172 = getNextElement(_tmpl$37), _el$173 = _el$172.firstChild;
|
|
991
|
+
insert(_el$173, () => params.caption);
|
|
992
|
+
return _el$172;
|
|
978
993
|
}
|
|
979
|
-
}), _el$
|
|
994
|
+
}), _el$175, _co$38);
|
|
980
995
|
effect((_p$) => {
|
|
981
996
|
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";
|
|
982
|
-
_v$23 !== _p$.e && className(_el$
|
|
983
|
-
_v$24 !== _p$.t && setAttribute(_el$
|
|
984
|
-
_v$25 !== _p$.a && setAttribute(_el$
|
|
985
|
-
_v$26 !== _p$.o && setAttribute(_el$
|
|
986
|
-
_v$27 !== _p$.i && setAttribute(_el$
|
|
997
|
+
_v$23 !== _p$.e && className(_el$168, _p$.e = _v$23);
|
|
998
|
+
_v$24 !== _p$.t && setAttribute(_el$170, "href", _p$.t = _v$24);
|
|
999
|
+
_v$25 !== _p$.a && setAttribute(_el$170, "aria-label", _p$.a = _v$25);
|
|
1000
|
+
_v$26 !== _p$.o && setAttribute(_el$171, "src", _p$.o = _v$26);
|
|
1001
|
+
_v$27 !== _p$.i && setAttribute(_el$171, "alt", _p$.i = _v$27);
|
|
987
1002
|
return _p$;
|
|
988
1003
|
}, {
|
|
989
1004
|
e: void 0,
|
|
@@ -992,30 +1007,30 @@ function ImageRenderer(props) {
|
|
|
992
1007
|
o: void 0,
|
|
993
1008
|
i: void 0
|
|
994
1009
|
});
|
|
995
|
-
return _el$
|
|
1010
|
+
return _el$168;
|
|
996
1011
|
})();
|
|
997
1012
|
}
|
|
998
1013
|
function LinkRenderer(props) {
|
|
999
1014
|
const params = props.component.params;
|
|
1000
1015
|
return (() => {
|
|
1001
|
-
var _el$
|
|
1002
|
-
_el$
|
|
1003
|
-
insert(_el$
|
|
1004
|
-
insert(_el$
|
|
1016
|
+
var _el$176 = getNextElement(_tmpl$40), _el$177 = _el$176.firstChild, _el$178 = _el$177.nextSibling, _el$179 = _el$178.firstChild, _el$181 = _el$179.nextSibling, [_el$182, _co$39] = getNextMarker(_el$181.nextSibling);
|
|
1017
|
+
_el$176.$$click = (e) => e.stopPropagation();
|
|
1018
|
+
insert(_el$179, () => params.label || params.url);
|
|
1019
|
+
insert(_el$178, createComponent(Show, {
|
|
1005
1020
|
get when() {
|
|
1006
1021
|
return params.description;
|
|
1007
1022
|
},
|
|
1008
1023
|
get children() {
|
|
1009
|
-
var _el$
|
|
1010
|
-
insert(_el$
|
|
1011
|
-
return _el$
|
|
1024
|
+
var _el$180 = getNextElement(_tmpl$39);
|
|
1025
|
+
insert(_el$180, () => params.description);
|
|
1026
|
+
return _el$180;
|
|
1012
1027
|
}
|
|
1013
|
-
}), _el$
|
|
1028
|
+
}), _el$182, _co$39);
|
|
1014
1029
|
effect((_p$) => {
|
|
1015
1030
|
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 || ""}`;
|
|
1016
|
-
_v$28 !== _p$.e && setAttribute(_el$
|
|
1017
|
-
_v$29 !== _p$.t && setAttribute(_el$
|
|
1018
|
-
_v$30 !== _p$.a && className(_el$
|
|
1031
|
+
_v$28 !== _p$.e && setAttribute(_el$176, "href", _p$.e = _v$28);
|
|
1032
|
+
_v$29 !== _p$.t && setAttribute(_el$176, "aria-label", _p$.t = _v$29);
|
|
1033
|
+
_v$30 !== _p$.a && className(_el$176, _p$.a = _v$30);
|
|
1019
1034
|
return _p$;
|
|
1020
1035
|
}, {
|
|
1021
1036
|
e: void 0,
|
|
@@ -1023,7 +1038,7 @@ function LinkRenderer(props) {
|
|
|
1023
1038
|
a: void 0
|
|
1024
1039
|
});
|
|
1025
1040
|
runHydrationEvents();
|
|
1026
|
-
return _el$
|
|
1041
|
+
return _el$176;
|
|
1027
1042
|
})();
|
|
1028
1043
|
}
|
|
1029
1044
|
function ComponentRenderer(props) {
|
|
@@ -1037,12 +1052,12 @@ function ComponentRenderer(props) {
|
|
|
1037
1052
|
details: validation.errors
|
|
1038
1053
|
});
|
|
1039
1054
|
return (() => {
|
|
1040
|
-
var _el$
|
|
1041
|
-
insert(_el$
|
|
1055
|
+
var _el$183 = getNextElement(_tmpl$41), _el$184 = _el$183.firstChild, _el$185 = _el$184.nextSibling;
|
|
1056
|
+
insert(_el$185, () => {
|
|
1042
1057
|
var _a2, _b;
|
|
1043
1058
|
return ((_b = (_a2 = validation.errors) == null ? void 0 : _a2[0]) == null ? void 0 : _b.message) || "Unknown validation error";
|
|
1044
1059
|
});
|
|
1045
|
-
return _el$
|
|
1060
|
+
return _el$183;
|
|
1046
1061
|
})();
|
|
1047
1062
|
}
|
|
1048
1063
|
return createComponent(GenerativeUIErrorBoundary, {
|
|
@@ -1288,27 +1303,27 @@ function ActionRenderer(props) {
|
|
|
1288
1303
|
const isDisabled = () => params.disabled || params.action === "tool-call" && isExecuting();
|
|
1289
1304
|
if (params.type === "link" || params.action === "link") {
|
|
1290
1305
|
return (() => {
|
|
1291
|
-
var _el$
|
|
1292
|
-
_el$
|
|
1293
|
-
insert(_el$
|
|
1306
|
+
var _el$186 = getNextElement(_tmpl$43), _el$188 = _el$186.firstChild, [_el$189, _co$40] = getNextMarker(_el$188.nextSibling), _el$190 = _el$189.nextSibling, [_el$191, _co$41] = getNextMarker(_el$190.nextSibling);
|
|
1307
|
+
_el$186.$$click = handleClick;
|
|
1308
|
+
insert(_el$186, createComponent(Show, {
|
|
1294
1309
|
get when() {
|
|
1295
1310
|
return params.icon;
|
|
1296
1311
|
},
|
|
1297
1312
|
get children() {
|
|
1298
|
-
var _el$
|
|
1299
|
-
insert(_el$
|
|
1300
|
-
return _el$
|
|
1313
|
+
var _el$187 = getNextElement(_tmpl$42);
|
|
1314
|
+
insert(_el$187, () => params.icon);
|
|
1315
|
+
return _el$187;
|
|
1301
1316
|
}
|
|
1302
|
-
}), _el$
|
|
1303
|
-
insert(_el$
|
|
1317
|
+
}), _el$189, _co$40);
|
|
1318
|
+
insert(_el$186, () => params.label, _el$191, _co$41);
|
|
1304
1319
|
effect((_p$) => {
|
|
1305
1320
|
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
|
|
1306
1321
|
${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"}
|
|
1307
1322
|
${params.className || ""}`;
|
|
1308
|
-
_v$31 !== _p$.e && setAttribute(_el$
|
|
1309
|
-
_v$32 !== _p$.t && setAttribute(_el$
|
|
1310
|
-
_v$33 !== _p$.a && setAttribute(_el$
|
|
1311
|
-
_v$34 !== _p$.o && className(_el$
|
|
1323
|
+
_v$31 !== _p$.e && setAttribute(_el$186, "href", _p$.e = _v$31);
|
|
1324
|
+
_v$32 !== _p$.t && setAttribute(_el$186, "target", _p$.t = _v$32);
|
|
1325
|
+
_v$33 !== _p$.a && setAttribute(_el$186, "aria-label", _p$.a = _v$33);
|
|
1326
|
+
_v$34 !== _p$.o && className(_el$186, _p$.o = _v$34);
|
|
1312
1327
|
return _p$;
|
|
1313
1328
|
}, {
|
|
1314
1329
|
e: void 0,
|
|
@@ -1317,42 +1332,42 @@ function ActionRenderer(props) {
|
|
|
1317
1332
|
o: void 0
|
|
1318
1333
|
});
|
|
1319
1334
|
runHydrationEvents();
|
|
1320
|
-
return _el$
|
|
1335
|
+
return _el$186;
|
|
1321
1336
|
})();
|
|
1322
1337
|
}
|
|
1323
1338
|
return (() => {
|
|
1324
|
-
var _el$
|
|
1325
|
-
_el$
|
|
1326
|
-
insert(_el$
|
|
1339
|
+
var _el$192 = getNextElement(_tmpl$45), _el$195 = _el$192.firstChild, [_el$196, _co$42] = getNextMarker(_el$195.nextSibling), _el$197 = _el$196.nextSibling, [_el$198, _co$43] = getNextMarker(_el$197.nextSibling), _el$199 = _el$198.nextSibling, [_el$200, _co$44] = getNextMarker(_el$199.nextSibling);
|
|
1340
|
+
_el$192.$$click = handleClick;
|
|
1341
|
+
insert(_el$192, createComponent(Show, {
|
|
1327
1342
|
get when() {
|
|
1328
1343
|
return memo(() => !!isExecuting())() && params.action === "tool-call";
|
|
1329
1344
|
},
|
|
1330
1345
|
get children() {
|
|
1331
|
-
return getNextElement(_tmpl$
|
|
1346
|
+
return getNextElement(_tmpl$44);
|
|
1332
1347
|
}
|
|
1333
|
-
}), _el$
|
|
1334
|
-
insert(_el$
|
|
1348
|
+
}), _el$196, _co$42);
|
|
1349
|
+
insert(_el$192, createComponent(Show, {
|
|
1335
1350
|
get when() {
|
|
1336
1351
|
return memo(() => !!params.icon)() && !(isExecuting() && params.action === "tool-call");
|
|
1337
1352
|
},
|
|
1338
1353
|
get children() {
|
|
1339
|
-
var _el$
|
|
1340
|
-
insert(_el$
|
|
1341
|
-
return _el$
|
|
1354
|
+
var _el$194 = getNextElement(_tmpl$42);
|
|
1355
|
+
insert(_el$194, () => params.icon);
|
|
1356
|
+
return _el$194;
|
|
1342
1357
|
}
|
|
1343
|
-
}), _el$
|
|
1344
|
-
insert(_el$
|
|
1358
|
+
}), _el$198, _co$43);
|
|
1359
|
+
insert(_el$192, () => params.label, _el$200, _co$44);
|
|
1345
1360
|
effect((_p$) => {
|
|
1346
1361
|
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
|
|
1347
1362
|
${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"}
|
|
1348
1363
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1349
1364
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1350
1365
|
${params.className || ""}`;
|
|
1351
|
-
_v$35 !== _p$.e && setAttribute(_el$
|
|
1352
|
-
_v$36 !== _p$.t && setProperty(_el$
|
|
1353
|
-
_v$37 !== _p$.a && setAttribute(_el$
|
|
1354
|
-
_v$38 !== _p$.o && setAttribute(_el$
|
|
1355
|
-
_v$39 !== _p$.i && className(_el$
|
|
1366
|
+
_v$35 !== _p$.e && setAttribute(_el$192, "type", _p$.e = _v$35);
|
|
1367
|
+
_v$36 !== _p$.t && setProperty(_el$192, "disabled", _p$.t = _v$36);
|
|
1368
|
+
_v$37 !== _p$.a && setAttribute(_el$192, "aria-busy", _p$.a = _v$37);
|
|
1369
|
+
_v$38 !== _p$.o && setAttribute(_el$192, "aria-label", _p$.o = _v$38);
|
|
1370
|
+
_v$39 !== _p$.i && className(_el$192, _p$.i = _v$39);
|
|
1356
1371
|
return _p$;
|
|
1357
1372
|
}, {
|
|
1358
1373
|
e: void 0,
|
|
@@ -1362,7 +1377,7 @@ function ActionRenderer(props) {
|
|
|
1362
1377
|
i: void 0
|
|
1363
1378
|
});
|
|
1364
1379
|
runHydrationEvents();
|
|
1365
|
-
return _el$
|
|
1380
|
+
return _el$192;
|
|
1366
1381
|
})();
|
|
1367
1382
|
}
|
|
1368
1383
|
function ErrorCardRenderer(props) {
|
|
@@ -1370,55 +1385,55 @@ function ErrorCardRenderer(props) {
|
|
|
1370
1385
|
return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
|
|
1371
1386
|
};
|
|
1372
1387
|
return (() => {
|
|
1373
|
-
var _el$
|
|
1374
|
-
insert(_el$
|
|
1388
|
+
var _el$201 = getNextElement(_tmpl$49), _el$224 = _el$201.firstChild, [_el$225, _co$50] = getNextMarker(_el$224.nextSibling), _el$202 = _el$225.nextSibling, _el$203 = _el$202.firstChild, _el$204 = _el$203.nextSibling, _el$205 = _el$204.firstChild, _el$206 = _el$205.firstChild, _el$207 = _el$206.nextSibling, [_el$208, _co$45] = getNextMarker(_el$207.nextSibling), _el$209 = _el$205.nextSibling, _el$218 = _el$209.nextSibling, [_el$219, _co$47] = getNextMarker(_el$218.nextSibling), _el$220 = _el$219.nextSibling, [_el$221, _co$48] = getNextMarker(_el$220.nextSibling), _el$222 = _el$221.nextSibling, [_el$223, _co$49] = getNextMarker(_el$222.nextSibling);
|
|
1389
|
+
insert(_el$201, createComponent(CopyButton, {
|
|
1375
1390
|
getText: getErrorText,
|
|
1376
1391
|
title: "Copy error details",
|
|
1377
1392
|
position: "top-right"
|
|
1378
|
-
}), _el$
|
|
1379
|
-
insert(_el$
|
|
1380
|
-
insert(_el$
|
|
1381
|
-
insert(_el$
|
|
1393
|
+
}), _el$225, _co$50);
|
|
1394
|
+
insert(_el$205, () => props.error.tool || "Unknown", _el$208, _co$45);
|
|
1395
|
+
insert(_el$209, () => props.error.message || "An error occurred during tool execution");
|
|
1396
|
+
insert(_el$204, createComponent(Show, {
|
|
1382
1397
|
get when() {
|
|
1383
1398
|
return props.error.type;
|
|
1384
1399
|
},
|
|
1385
1400
|
get children() {
|
|
1386
|
-
var _el$
|
|
1387
|
-
insert(_el$
|
|
1388
|
-
return _el$
|
|
1401
|
+
var _el$210 = getNextElement(_tmpl$46), _el$211 = _el$210.firstChild, _el$212 = _el$211.nextSibling, [_el$213, _co$46] = getNextMarker(_el$212.nextSibling);
|
|
1402
|
+
insert(_el$210, () => props.error.type, _el$213, _co$46);
|
|
1403
|
+
return _el$210;
|
|
1389
1404
|
}
|
|
1390
|
-
}), _el$
|
|
1391
|
-
insert(_el$
|
|
1405
|
+
}), _el$219, _co$47);
|
|
1406
|
+
insert(_el$204, createComponent(Show, {
|
|
1392
1407
|
get when() {
|
|
1393
1408
|
var _a;
|
|
1394
1409
|
return (_a = props.error.suggestions) == null ? void 0 : _a.length;
|
|
1395
1410
|
},
|
|
1396
1411
|
get children() {
|
|
1397
|
-
var _el$
|
|
1398
|
-
insert(_el$
|
|
1412
|
+
var _el$214 = getNextElement(_tmpl$47), _el$215 = _el$214.firstChild, _el$216 = _el$215.nextSibling;
|
|
1413
|
+
insert(_el$216, createComponent(For, {
|
|
1399
1414
|
get each() {
|
|
1400
1415
|
return props.error.suggestions;
|
|
1401
1416
|
},
|
|
1402
1417
|
children: (suggestion) => (() => {
|
|
1403
|
-
var _el$
|
|
1404
|
-
insert(_el$
|
|
1405
|
-
return _el$
|
|
1418
|
+
var _el$226 = getNextElement(_tmpl$50);
|
|
1419
|
+
insert(_el$226, suggestion);
|
|
1420
|
+
return _el$226;
|
|
1406
1421
|
})()
|
|
1407
1422
|
}));
|
|
1408
|
-
return _el$
|
|
1423
|
+
return _el$214;
|
|
1409
1424
|
}
|
|
1410
|
-
}), _el$
|
|
1411
|
-
insert(_el$
|
|
1425
|
+
}), _el$221, _co$48);
|
|
1426
|
+
insert(_el$204, createComponent(Show, {
|
|
1412
1427
|
get when() {
|
|
1413
1428
|
return props.error.timestamp;
|
|
1414
1429
|
},
|
|
1415
1430
|
get children() {
|
|
1416
|
-
var _el$
|
|
1417
|
-
insert(_el$
|
|
1418
|
-
return _el$
|
|
1431
|
+
var _el$217 = getNextElement(_tmpl$48);
|
|
1432
|
+
insert(_el$217, () => new Date(props.error.timestamp).toLocaleString());
|
|
1433
|
+
return _el$217;
|
|
1419
1434
|
}
|
|
1420
|
-
}), _el$
|
|
1421
|
-
return _el$
|
|
1435
|
+
}), _el$223, _co$49);
|
|
1436
|
+
return _el$201;
|
|
1422
1437
|
})();
|
|
1423
1438
|
}
|
|
1424
1439
|
function isErrorResponse(content) {
|
|
@@ -1441,20 +1456,20 @@ function UIResourceHtmlRenderer(props) {
|
|
|
1441
1456
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
|
|
1442
1457
|
};
|
|
1443
1458
|
return (() => {
|
|
1444
|
-
var _el$
|
|
1445
|
-
insert(_el$
|
|
1459
|
+
var _el$227 = getNextElement(_tmpl$52), _el$231 = _el$227.firstChild, [_el$232, _co$51] = getNextMarker(_el$231.nextSibling), _el$230 = _el$232.nextSibling;
|
|
1460
|
+
insert(_el$227, createComponent(Show, {
|
|
1446
1461
|
get when() {
|
|
1447
1462
|
var _a;
|
|
1448
1463
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
|
|
1449
1464
|
},
|
|
1450
1465
|
get children() {
|
|
1451
|
-
var _el$
|
|
1452
|
-
insert(_el$
|
|
1453
|
-
return _el$
|
|
1466
|
+
var _el$228 = getNextElement(_tmpl$51), _el$229 = _el$228.firstChild;
|
|
1467
|
+
insert(_el$229, resourceTitle);
|
|
1468
|
+
return _el$228;
|
|
1454
1469
|
}
|
|
1455
|
-
}), _el$
|
|
1456
|
-
effect(() => setProperty(_el$
|
|
1457
|
-
return _el$
|
|
1470
|
+
}), _el$232, _co$51);
|
|
1471
|
+
effect(() => setProperty(_el$230, "innerHTML", htmlContent()));
|
|
1472
|
+
return _el$227;
|
|
1458
1473
|
})();
|
|
1459
1474
|
}
|
|
1460
1475
|
const UIResourceRenderer = (props) => {
|
|
@@ -1534,24 +1549,24 @@ const UIResourceRenderer = (props) => {
|
|
|
1534
1549
|
return createComponent(RenderProvider, {
|
|
1535
1550
|
renderComponent,
|
|
1536
1551
|
get children() {
|
|
1537
|
-
var _el$
|
|
1538
|
-
insert(_el$
|
|
1552
|
+
var _el$233 = getNextElement(_tmpl$53), _el$234 = _el$233.firstChild, _el$235 = _el$234.nextSibling, [_el$236, _co$52] = getNextMarker(_el$235.nextSibling);
|
|
1553
|
+
insert(_el$234, createComponent(For, {
|
|
1539
1554
|
get each() {
|
|
1540
1555
|
return layoutData.components;
|
|
1541
1556
|
},
|
|
1542
1557
|
children: (component) => (() => {
|
|
1543
|
-
var _el$
|
|
1544
|
-
insert(_el$
|
|
1558
|
+
var _el$237 = getNextElement(_tmpl$54);
|
|
1559
|
+
insert(_el$237, createComponent(ComponentRenderer, {
|
|
1545
1560
|
component,
|
|
1546
1561
|
get onError() {
|
|
1547
1562
|
return props.onError;
|
|
1548
1563
|
}
|
|
1549
1564
|
}));
|
|
1550
|
-
effect((_$p) => style(_el$
|
|
1551
|
-
return _el$
|
|
1565
|
+
effect((_$p) => style(_el$237, getGridStyleString(component), _$p));
|
|
1566
|
+
return _el$237;
|
|
1552
1567
|
})()
|
|
1553
1568
|
}));
|
|
1554
|
-
insert(_el$
|
|
1569
|
+
insert(_el$233, createComponent(Show, {
|
|
1555
1570
|
get when() {
|
|
1556
1571
|
return shouldShowAutoFooter();
|
|
1557
1572
|
},
|
|
@@ -1562,17 +1577,17 @@ const UIResourceRenderer = (props) => {
|
|
|
1562
1577
|
}
|
|
1563
1578
|
});
|
|
1564
1579
|
}
|
|
1565
|
-
}), _el$
|
|
1580
|
+
}), _el$236, _co$52);
|
|
1566
1581
|
effect((_p$) => {
|
|
1567
1582
|
var _v$40 = `w-full ${props.class || ""}`, _v$41 = gridContainerStyle();
|
|
1568
|
-
_v$40 !== _p$.e && className(_el$
|
|
1569
|
-
_p$.t = style(_el$
|
|
1583
|
+
_v$40 !== _p$.e && className(_el$233, _p$.e = _v$40);
|
|
1584
|
+
_p$.t = style(_el$234, _v$41, _p$.t);
|
|
1570
1585
|
return _p$;
|
|
1571
1586
|
}, {
|
|
1572
1587
|
e: void 0,
|
|
1573
1588
|
t: void 0
|
|
1574
1589
|
});
|
|
1575
|
-
return _el$
|
|
1590
|
+
return _el$233;
|
|
1576
1591
|
}
|
|
1577
1592
|
});
|
|
1578
1593
|
};
|