@seed-ship/mcp-ui-solid 4.3.6 → 4.3.8
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 +264 -238
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts +6 -0
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +264 -238
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/package.json +1 -1
- package/src/components/UIResourceRenderer.tsx +76 -55
- 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 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(`<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 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 cursor-pointer select-none hover:bg-gray-100 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(`<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><!$><!/><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 () => {
|
|
@@ -206,6 +206,17 @@ function ChartRenderer(props) {
|
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
+
function highlightQuery(html, query) {
|
|
210
|
+
const q = query.trim();
|
|
211
|
+
if (!q) return html;
|
|
212
|
+
const escaped = q.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
213
|
+
const regex = new RegExp(`(${escaped})`, "gi");
|
|
214
|
+
return html.replace(/(<[^>]+>)|([^<]+)/g, (_m, tag, text) => {
|
|
215
|
+
if (tag) return tag;
|
|
216
|
+
if (!text) return "";
|
|
217
|
+
return text.replace(regex, '<mark class="bg-yellow-200 dark:bg-[#222F49] text-inherit rounded px-0.5">$1</mark>');
|
|
218
|
+
});
|
|
219
|
+
}
|
|
209
220
|
function renderCellValue(value) {
|
|
210
221
|
if (value === null || value === void 0) {
|
|
211
222
|
return "-";
|
|
@@ -280,7 +291,6 @@ function TableRenderer(props) {
|
|
|
280
291
|
setSortDir("asc");
|
|
281
292
|
}
|
|
282
293
|
setClientPage(0);
|
|
283
|
-
setProgressivePages(1);
|
|
284
294
|
};
|
|
285
295
|
const sortedRows = createMemo(() => {
|
|
286
296
|
var _a;
|
|
@@ -321,7 +331,6 @@ function TableRenderer(props) {
|
|
|
321
331
|
searchTimer = setTimeout(() => {
|
|
322
332
|
setDebouncedQuery(value);
|
|
323
333
|
setClientPage(0);
|
|
324
|
-
setProgressivePages(1);
|
|
325
334
|
}, 200);
|
|
326
335
|
};
|
|
327
336
|
const normalize = (s) => s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
@@ -336,28 +345,45 @@ function TableRenderer(props) {
|
|
|
336
345
|
}));
|
|
337
346
|
});
|
|
338
347
|
const isExpanded = useExpanded();
|
|
339
|
-
const
|
|
340
|
-
const
|
|
341
|
-
const
|
|
348
|
+
const defaultPageSize = () => tableParams.pageSize ?? 25;
|
|
349
|
+
const chatDefault = () => tableParams.chatPageSize ?? Math.min(10, defaultPageSize());
|
|
350
|
+
const [userPageSize, setUserPageSize] = createSignal(null);
|
|
351
|
+
const clientPageSize = () => {
|
|
352
|
+
const ups = userPageSize();
|
|
353
|
+
if (ups !== null) return ups;
|
|
354
|
+
return isExpanded() ? defaultPageSize() : chatDefault();
|
|
355
|
+
};
|
|
356
|
+
const showAll = () => userPageSize() === 0;
|
|
342
357
|
const hasServerPagination = () => !!tableParams.pagination;
|
|
343
|
-
const
|
|
344
|
-
const needsClientPagination = () => !hasServerPagination() && clientPageSize() > 0 && filteredRows().length > clientPageSize();
|
|
358
|
+
const needsClientPagination = () => !hasServerPagination() && !showAll() && clientPageSize() > 0 && filteredRows().length > clientPageSize();
|
|
345
359
|
const [clientPage, setClientPage] = createSignal(tableParams.initialPage ?? 0);
|
|
346
|
-
const [progressivePages, setProgressivePages] = createSignal(1);
|
|
347
360
|
const clientTotalPages = () => needsClientPagination() ? Math.ceil(filteredRows().length / clientPageSize()) : 1;
|
|
348
361
|
const clientVisibleRows = createMemo(() => {
|
|
349
|
-
if (!needsClientPagination()) return filteredRows();
|
|
350
|
-
if (isProgressiveMode()) {
|
|
351
|
-
return filteredRows().slice(0, progressivePages() * clientPageSize());
|
|
352
|
-
}
|
|
362
|
+
if (showAll() || !needsClientPagination()) return filteredRows();
|
|
353
363
|
const start = clientPage() * clientPageSize();
|
|
354
364
|
return filteredRows().slice(start, start + clientPageSize());
|
|
355
365
|
});
|
|
356
|
-
const clientRangeStart = () => needsClientPagination() ?
|
|
357
|
-
const clientRangeEnd = () => needsClientPagination() ?
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
|
|
366
|
+
const clientRangeStart = () => needsClientPagination() ? clientPage() * clientPageSize() + 1 : 1;
|
|
367
|
+
const clientRangeEnd = () => needsClientPagination() ? Math.min((clientPage() + 1) * clientPageSize(), filteredRows().length) : filteredRows().length;
|
|
368
|
+
const pageSizeOptions = () => {
|
|
369
|
+
const total = filteredRows().length;
|
|
370
|
+
const opts = [];
|
|
371
|
+
for (const n of [10, 30, 60, 100]) {
|
|
372
|
+
if (n < total) opts.push({
|
|
373
|
+
value: n,
|
|
374
|
+
label: String(n)
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
opts.push({
|
|
378
|
+
value: 0,
|
|
379
|
+
label: "All"
|
|
380
|
+
});
|
|
381
|
+
return opts;
|
|
382
|
+
};
|
|
383
|
+
const handlePageSizeChange = (val) => {
|
|
384
|
+
setUserPageSize(val === 0 ? 0 : val);
|
|
385
|
+
setClientPage(0);
|
|
386
|
+
};
|
|
361
387
|
const [virtualizer, setVirtualizer] = createSignal(null);
|
|
362
388
|
const [isVirtualizing, setIsVirtualizing] = createSignal(false);
|
|
363
389
|
const shouldVirtualize = createMemo(() => {
|
|
@@ -489,7 +515,7 @@ ${dataRows}`;
|
|
|
489
515
|
},
|
|
490
516
|
children: (column) => (() => {
|
|
491
517
|
var _el$23 = getNextElement(_tmpl$10), _el$24 = _el$23.firstChild;
|
|
492
|
-
effect(() => setProperty(_el$24, "innerHTML", renderCellValue(row[column.key])));
|
|
518
|
+
effect(() => setProperty(_el$24, "innerHTML", highlightQuery(renderCellValue(row[column.key]), debouncedQuery())));
|
|
493
519
|
return _el$23;
|
|
494
520
|
})()
|
|
495
521
|
}));
|
|
@@ -522,7 +548,7 @@ ${dataRows}`;
|
|
|
522
548
|
},
|
|
523
549
|
children: (column) => (() => {
|
|
524
550
|
var _el$27 = getNextElement(_tmpl$10), _el$28 = _el$27.firstChild;
|
|
525
|
-
effect(() => setProperty(_el$28, "innerHTML", renderCellValue(row[column.key])));
|
|
551
|
+
effect(() => setProperty(_el$28, "innerHTML", highlightQuery(renderCellValue(row[column.key]), debouncedQuery())));
|
|
526
552
|
return _el$27;
|
|
527
553
|
})()
|
|
528
554
|
}));
|
|
@@ -551,7 +577,7 @@ ${dataRows}`;
|
|
|
551
577
|
},
|
|
552
578
|
copyLabel: "Copy table (CSV)",
|
|
553
579
|
get children() {
|
|
554
|
-
var _el$29 = getNextElement(_tmpl$26), _el$
|
|
580
|
+
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
581
|
insert(_el$29, createComponent(Show, {
|
|
556
582
|
when: exportable,
|
|
557
583
|
get fallback() {
|
|
@@ -609,7 +635,7 @@ ${dataRows}`;
|
|
|
609
635
|
runHydrationEvents();
|
|
610
636
|
return _el$30;
|
|
611
637
|
}
|
|
612
|
-
}), _el$
|
|
638
|
+
}), _el$121, _co$28);
|
|
613
639
|
insert(_el$44, createComponent(Show, {
|
|
614
640
|
get when() {
|
|
615
641
|
return tableParams.title;
|
|
@@ -634,7 +660,7 @@ ${dataRows}`;
|
|
|
634
660
|
}), _el$54, _co$1);
|
|
635
661
|
return _el$45;
|
|
636
662
|
}
|
|
637
|
-
}), _el$
|
|
663
|
+
}), _el$113, _co$24);
|
|
638
664
|
insert(_el$44, createComponent(Show, {
|
|
639
665
|
get when() {
|
|
640
666
|
return isSearchable();
|
|
@@ -675,7 +701,7 @@ ${dataRows}`;
|
|
|
675
701
|
}
|
|
676
702
|
})];
|
|
677
703
|
}
|
|
678
|
-
}), _el$
|
|
704
|
+
}), _el$115, _co$25);
|
|
679
705
|
var _ref$ = scrollContainerRef;
|
|
680
706
|
typeof _ref$ === "function" ? use(_ref$, _el$70) : scrollContainerRef = _el$70;
|
|
681
707
|
insert(_el$73, createComponent(For, {
|
|
@@ -683,27 +709,27 @@ ${dataRows}`;
|
|
|
683
709
|
return tableParams.columns;
|
|
684
710
|
},
|
|
685
711
|
children: (column) => (() => {
|
|
686
|
-
var _el$
|
|
687
|
-
addEventListener(_el$
|
|
688
|
-
insert(_el$
|
|
689
|
-
insert(_el$
|
|
712
|
+
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;
|
|
713
|
+
addEventListener(_el$122, "click", () => handleSort(column.key));
|
|
714
|
+
insert(_el$123, () => column.label, _el$126, _co$29);
|
|
715
|
+
insert(_el$124, () => sortIndicator(column.key));
|
|
690
716
|
effect((_p$) => {
|
|
691
|
-
var _v$
|
|
717
|
+
var _v$12 = column.width ? {
|
|
692
718
|
width: column.width
|
|
693
|
-
} : {}, _v$
|
|
719
|
+
} : {}, _v$13 = `Sort by ${column.label}`, _v$14 = {
|
|
694
720
|
"opacity-30": sortKey() !== column.key,
|
|
695
721
|
"opacity-100 text-blue-600 dark:text-blue-400": sortKey() === column.key
|
|
696
722
|
};
|
|
697
|
-
_p$.e = style(_el$
|
|
698
|
-
_v$
|
|
699
|
-
_p$.a = classList(_el$
|
|
723
|
+
_p$.e = style(_el$122, _v$12, _p$.e);
|
|
724
|
+
_v$13 !== _p$.t && setAttribute(_el$122, "title", _p$.t = _v$13);
|
|
725
|
+
_p$.a = classList(_el$124, _v$14, _p$.a);
|
|
700
726
|
return _p$;
|
|
701
727
|
}, {
|
|
702
728
|
e: void 0,
|
|
703
729
|
t: void 0,
|
|
704
730
|
a: void 0
|
|
705
731
|
});
|
|
706
|
-
return _el$
|
|
732
|
+
return _el$122;
|
|
707
733
|
})()
|
|
708
734
|
}));
|
|
709
735
|
insert(_el$71, createComponent(Show, {
|
|
@@ -728,24 +754,48 @@ ${dataRows}`;
|
|
|
728
754
|
insert(_el$77, () => tableParams.pagination.totalRows, _el$88, _co$17);
|
|
729
755
|
return _el$76;
|
|
730
756
|
}
|
|
731
|
-
}), _el$
|
|
757
|
+
}), _el$117, _co$26);
|
|
732
758
|
insert(_el$44, createComponent(Show, {
|
|
733
759
|
get when() {
|
|
734
|
-
return
|
|
760
|
+
return needsClientPagination();
|
|
735
761
|
},
|
|
736
762
|
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$
|
|
763
|
+
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);
|
|
764
|
+
insert(_el$90, clientRangeStart, _el$94, _co$18);
|
|
765
|
+
insert(_el$90, clientRangeEnd, _el$96, _co$19);
|
|
766
|
+
insert(_el$90, () => filteredRows().length.toLocaleString("fr-FR"), _el$98, _co$20);
|
|
767
|
+
_el$100.$$click = () => setClientPage((p) => p - 1);
|
|
768
|
+
insert(_el$101, () => clientPage() + 1, _el$104, _co$21);
|
|
769
|
+
insert(_el$101, clientTotalPages, _el$106, _co$22);
|
|
770
|
+
_el$107.$$click = () => setClientPage((p) => p + 1);
|
|
771
|
+
insert(_el$99, createComponent(Show, {
|
|
772
|
+
get when() {
|
|
773
|
+
return memo(() => !!isExpanded())() && filteredRows().length > 10;
|
|
774
|
+
},
|
|
775
|
+
get children() {
|
|
776
|
+
return [(() => {
|
|
777
|
+
var _el$108 = getNextElement(_tmpl$23);
|
|
778
|
+
_el$108.addEventListener("change", (e) => handlePageSizeChange(Number(e.currentTarget.value)));
|
|
779
|
+
insert(_el$108, createComponent(For, {
|
|
780
|
+
get each() {
|
|
781
|
+
return pageSizeOptions();
|
|
782
|
+
},
|
|
783
|
+
children: (opt) => (() => {
|
|
784
|
+
var _el$127 = getNextElement(_tmpl$28);
|
|
785
|
+
insert(_el$127, () => opt.label);
|
|
786
|
+
effect(() => setProperty(_el$127, "value", opt.value));
|
|
787
|
+
return _el$127;
|
|
788
|
+
})()
|
|
789
|
+
}));
|
|
790
|
+
effect(() => setProperty(_el$108, "value", clientPageSize()));
|
|
791
|
+
return _el$108;
|
|
792
|
+
})(), getNextElement(_tmpl$24)];
|
|
793
|
+
}
|
|
794
|
+
}), _el$111, _co$23);
|
|
745
795
|
effect((_p$) => {
|
|
746
796
|
var _v$8 = clientPage() === 0, _v$9 = clientPage() >= clientTotalPages() - 1;
|
|
747
|
-
_v$8 !== _p$.e && setProperty(_el$
|
|
748
|
-
_v$9 !== _p$.t && setProperty(_el$
|
|
797
|
+
_v$8 !== _p$.e && setProperty(_el$100, "disabled", _p$.e = _v$8);
|
|
798
|
+
_v$9 !== _p$.t && setProperty(_el$107, "disabled", _p$.t = _v$9);
|
|
749
799
|
return _p$;
|
|
750
800
|
}, {
|
|
751
801
|
e: void 0,
|
|
@@ -754,50 +804,25 @@ ${dataRows}`;
|
|
|
754
804
|
runHydrationEvents();
|
|
755
805
|
return _el$89;
|
|
756
806
|
}
|
|
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);
|
|
807
|
+
}), _el$119, _co$27);
|
|
785
808
|
effect((_p$) => {
|
|
786
|
-
var _v$0 = isVirtualizing() ? {
|
|
809
|
+
var _v$0 = `relative w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group ${isExpanded() ? "" : "h-full"}`, _v$1 = isVirtualizing() ? {
|
|
787
810
|
"max-height": "500px",
|
|
788
811
|
"overflow-y": "auto"
|
|
789
|
-
} : clientVisibleRows().length > 8 ? {
|
|
790
|
-
"max-height":
|
|
812
|
+
} : !isExpanded() && clientVisibleRows().length > 8 ? {
|
|
813
|
+
"max-height": "400px",
|
|
791
814
|
"overflow-y": "auto"
|
|
792
|
-
} : {}, _v$
|
|
793
|
-
_p$.e
|
|
794
|
-
|
|
795
|
-
_v$10 !== _p$.a && setAttribute(_el$
|
|
815
|
+
} : {}, _v$10 = tableParams.title || "Data table", _v$11 = tableParams.title ? `${tableId}-title` : void 0;
|
|
816
|
+
_v$0 !== _p$.e && className(_el$29, _p$.e = _v$0);
|
|
817
|
+
_p$.t = style(_el$70, _v$1, _p$.t);
|
|
818
|
+
_v$10 !== _p$.a && setAttribute(_el$70, "aria-label", _p$.a = _v$10);
|
|
819
|
+
_v$11 !== _p$.o && setAttribute(_el$71, "aria-labelledby", _p$.o = _v$11);
|
|
796
820
|
return _p$;
|
|
797
821
|
}, {
|
|
798
822
|
e: void 0,
|
|
799
823
|
t: void 0,
|
|
800
|
-
a: void 0
|
|
824
|
+
a: void 0,
|
|
825
|
+
o: void 0
|
|
801
826
|
});
|
|
802
827
|
return _el$29;
|
|
803
828
|
}
|
|
@@ -812,51 +837,51 @@ function MetricRenderer(props) {
|
|
|
812
837
|
return `${title}: ${value}${unit ? " " + unit : ""}`;
|
|
813
838
|
};
|
|
814
839
|
return (() => {
|
|
815
|
-
var _el$
|
|
816
|
-
insert(_el$
|
|
840
|
+
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);
|
|
841
|
+
insert(_el$128, createComponent(CopyButton, {
|
|
817
842
|
getText: getMetricText,
|
|
818
843
|
title: "Copy metric",
|
|
819
844
|
position: "top-right"
|
|
820
|
-
}), _el$
|
|
821
|
-
insert(_el$
|
|
822
|
-
insert(_el$
|
|
823
|
-
insert(_el$
|
|
845
|
+
}), _el$151, _co$35);
|
|
846
|
+
insert(_el$131, () => metricParams.title);
|
|
847
|
+
insert(_el$133, () => metricParams.value);
|
|
848
|
+
insert(_el$132, createComponent(Show, {
|
|
824
849
|
get when() {
|
|
825
850
|
return metricParams.unit;
|
|
826
851
|
},
|
|
827
852
|
get children() {
|
|
828
|
-
var _el$
|
|
829
|
-
insert(_el$
|
|
830
|
-
return _el$
|
|
853
|
+
var _el$134 = getNextElement(_tmpl$29);
|
|
854
|
+
insert(_el$134, () => metricParams.unit);
|
|
855
|
+
return _el$134;
|
|
831
856
|
}
|
|
832
|
-
}), _el$
|
|
833
|
-
insert(_el$
|
|
857
|
+
}), _el$136, _co$30);
|
|
858
|
+
insert(_el$129, createComponent(Show, {
|
|
834
859
|
get when() {
|
|
835
860
|
return metricParams.trend;
|
|
836
861
|
},
|
|
837
862
|
get children() {
|
|
838
|
-
var _el$
|
|
839
|
-
_el$
|
|
840
|
-
insert(_el$
|
|
863
|
+
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);
|
|
864
|
+
_el$144.nextSibling;
|
|
865
|
+
insert(_el$138, (() => {
|
|
841
866
|
var _c$ = memo(() => metricParams.trend.direction === "up");
|
|
842
867
|
return () => _c$() ? "�" : metricParams.trend.direction === "down" ? "�" : "�";
|
|
843
|
-
})(), _el$
|
|
844
|
-
insert(_el$
|
|
845
|
-
effect(() => className(_el$
|
|
846
|
-
return _el$
|
|
868
|
+
})(), _el$142, _co$31);
|
|
869
|
+
insert(_el$138, () => Math.abs(metricParams.trend.value), _el$144, _co$32);
|
|
870
|
+
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"}`));
|
|
871
|
+
return _el$137;
|
|
847
872
|
}
|
|
848
|
-
}), _el$
|
|
849
|
-
insert(_el$
|
|
873
|
+
}), _el$147, _co$33);
|
|
874
|
+
insert(_el$129, createComponent(Show, {
|
|
850
875
|
get when() {
|
|
851
876
|
return metricParams.subtitle;
|
|
852
877
|
},
|
|
853
878
|
get children() {
|
|
854
|
-
var _el$
|
|
855
|
-
insert(_el$
|
|
856
|
-
return _el$
|
|
879
|
+
var _el$145 = getNextElement(_tmpl$31);
|
|
880
|
+
insert(_el$145, () => metricParams.subtitle);
|
|
881
|
+
return _el$145;
|
|
857
882
|
}
|
|
858
|
-
}), _el$
|
|
859
|
-
return _el$
|
|
883
|
+
}), _el$149, _co$34);
|
|
884
|
+
return _el$128;
|
|
860
885
|
})();
|
|
861
886
|
}
|
|
862
887
|
function extractImageFromMarkdown(content) {
|
|
@@ -897,62 +922,62 @@ function TextRenderer(props) {
|
|
|
897
922
|
},
|
|
898
923
|
get fallback() {
|
|
899
924
|
return (() => {
|
|
900
|
-
var _el$
|
|
901
|
-
insert(_el$
|
|
925
|
+
var _el$152 = getNextElement(_tmpl$33), _el$154 = _el$152.firstChild, [_el$155, _co$36] = getNextMarker(_el$154.nextSibling), _el$153 = _el$155.nextSibling;
|
|
926
|
+
insert(_el$152, createComponent(CopyButton, {
|
|
902
927
|
getText: getTextContent,
|
|
903
928
|
title: "Copy text",
|
|
904
929
|
position: "top-right"
|
|
905
|
-
}), _el$
|
|
930
|
+
}), _el$155, _co$36);
|
|
906
931
|
effect((_p$) => {
|
|
907
|
-
var _v$
|
|
908
|
-
_v$
|
|
909
|
-
_v$
|
|
932
|
+
var _v$15 = `prose prose-sm dark:prose-invert max-w-none ${textParams.className || ""}`, _v$16 = htmlContent();
|
|
933
|
+
_v$15 !== _p$.e && className(_el$153, _p$.e = _v$15);
|
|
934
|
+
_v$16 !== _p$.t && setProperty(_el$153, "innerHTML", _p$.t = _v$16);
|
|
910
935
|
return _p$;
|
|
911
936
|
}, {
|
|
912
937
|
e: void 0,
|
|
913
938
|
t: void 0
|
|
914
939
|
});
|
|
915
|
-
return _el$
|
|
940
|
+
return _el$152;
|
|
916
941
|
})();
|
|
917
942
|
},
|
|
918
943
|
children: (data) => (() => {
|
|
919
|
-
var _el$
|
|
920
|
-
insert(_el$
|
|
944
|
+
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;
|
|
945
|
+
insert(_el$161, () => data().credit);
|
|
921
946
|
effect((_p$) => {
|
|
922
|
-
var _v$
|
|
923
|
-
_v$
|
|
924
|
-
_v$
|
|
925
|
-
_v$
|
|
947
|
+
var _v$17 = data().linkUrl, _v$18 = data().imageUrl, _v$19 = data().alt;
|
|
948
|
+
_v$17 !== _p$.e && setAttribute(_el$158, "href", _p$.e = _v$17);
|
|
949
|
+
_v$18 !== _p$.t && setAttribute(_el$159, "src", _p$.t = _v$18);
|
|
950
|
+
_v$19 !== _p$.a && setAttribute(_el$159, "alt", _p$.a = _v$19);
|
|
926
951
|
return _p$;
|
|
927
952
|
}, {
|
|
928
953
|
e: void 0,
|
|
929
954
|
t: void 0,
|
|
930
955
|
a: void 0
|
|
931
956
|
});
|
|
932
|
-
return _el$
|
|
957
|
+
return _el$156;
|
|
933
958
|
})()
|
|
934
959
|
});
|
|
935
960
|
}
|
|
936
961
|
function IframeRenderer(props) {
|
|
937
962
|
const params = props.component.params;
|
|
938
963
|
return (() => {
|
|
939
|
-
var _el$
|
|
940
|
-
insert(_el$
|
|
964
|
+
var _el$162 = getNextElement(_tmpl$36), _el$166 = _el$162.firstChild, [_el$167, _co$37] = getNextMarker(_el$166.nextSibling), _el$165 = _el$167.nextSibling;
|
|
965
|
+
insert(_el$162, createComponent(Show, {
|
|
941
966
|
get when() {
|
|
942
967
|
return params.title;
|
|
943
968
|
},
|
|
944
969
|
get children() {
|
|
945
|
-
var _el$
|
|
946
|
-
insert(_el$
|
|
947
|
-
return _el$
|
|
970
|
+
var _el$163 = getNextElement(_tmpl$35), _el$164 = _el$163.firstChild;
|
|
971
|
+
insert(_el$164, () => params.title);
|
|
972
|
+
return _el$163;
|
|
948
973
|
}
|
|
949
|
-
}), _el$
|
|
974
|
+
}), _el$167, _co$37);
|
|
950
975
|
effect((_p$) => {
|
|
951
|
-
var _v$
|
|
952
|
-
_v$
|
|
953
|
-
_v$
|
|
954
|
-
_p$.a = style(_el$
|
|
955
|
-
_v$
|
|
976
|
+
var _v$20 = params.url, _v$21 = params.title || "Embedded content", _v$22 = `height: ${params.height || "400px"}; min-height: 300px;`, _v$23 = getIframeSandbox(params.url);
|
|
977
|
+
_v$20 !== _p$.e && setAttribute(_el$165, "src", _p$.e = _v$20);
|
|
978
|
+
_v$21 !== _p$.t && setAttribute(_el$165, "title", _p$.t = _v$21);
|
|
979
|
+
_p$.a = style(_el$165, _v$22, _p$.a);
|
|
980
|
+
_v$23 !== _p$.o && setAttribute(_el$165, "sandbox", _p$.o = _v$23);
|
|
956
981
|
return _p$;
|
|
957
982
|
}, {
|
|
958
983
|
e: void 0,
|
|
@@ -960,30 +985,30 @@ function IframeRenderer(props) {
|
|
|
960
985
|
a: void 0,
|
|
961
986
|
o: void 0
|
|
962
987
|
});
|
|
963
|
-
return _el$
|
|
988
|
+
return _el$162;
|
|
964
989
|
})();
|
|
965
990
|
}
|
|
966
991
|
function ImageRenderer(props) {
|
|
967
992
|
const params = props.component.params;
|
|
968
993
|
return (() => {
|
|
969
|
-
var _el$
|
|
970
|
-
insert(_el$
|
|
994
|
+
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);
|
|
995
|
+
insert(_el$168, createComponent(Show, {
|
|
971
996
|
get when() {
|
|
972
997
|
return params.caption;
|
|
973
998
|
},
|
|
974
999
|
get children() {
|
|
975
|
-
var _el$
|
|
976
|
-
insert(_el$
|
|
977
|
-
return _el$
|
|
1000
|
+
var _el$172 = getNextElement(_tmpl$37), _el$173 = _el$172.firstChild;
|
|
1001
|
+
insert(_el$173, () => params.caption);
|
|
1002
|
+
return _el$172;
|
|
978
1003
|
}
|
|
979
|
-
}), _el$
|
|
1004
|
+
}), _el$175, _co$38);
|
|
980
1005
|
effect((_p$) => {
|
|
981
|
-
var _v$
|
|
982
|
-
_v$
|
|
983
|
-
_v$
|
|
984
|
-
_v$
|
|
985
|
-
_v$
|
|
986
|
-
_v$
|
|
1006
|
+
var _v$24 = `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$25 = params.url, _v$26 = `View full size: ${params.alt || "image"}`, _v$27 = params.url, _v$28 = params.alt || "Image";
|
|
1007
|
+
_v$24 !== _p$.e && className(_el$168, _p$.e = _v$24);
|
|
1008
|
+
_v$25 !== _p$.t && setAttribute(_el$170, "href", _p$.t = _v$25);
|
|
1009
|
+
_v$26 !== _p$.a && setAttribute(_el$170, "aria-label", _p$.a = _v$26);
|
|
1010
|
+
_v$27 !== _p$.o && setAttribute(_el$171, "src", _p$.o = _v$27);
|
|
1011
|
+
_v$28 !== _p$.i && setAttribute(_el$171, "alt", _p$.i = _v$28);
|
|
987
1012
|
return _p$;
|
|
988
1013
|
}, {
|
|
989
1014
|
e: void 0,
|
|
@@ -992,30 +1017,30 @@ function ImageRenderer(props) {
|
|
|
992
1017
|
o: void 0,
|
|
993
1018
|
i: void 0
|
|
994
1019
|
});
|
|
995
|
-
return _el$
|
|
1020
|
+
return _el$168;
|
|
996
1021
|
})();
|
|
997
1022
|
}
|
|
998
1023
|
function LinkRenderer(props) {
|
|
999
1024
|
const params = props.component.params;
|
|
1000
1025
|
return (() => {
|
|
1001
|
-
var _el$
|
|
1002
|
-
_el$
|
|
1003
|
-
insert(_el$
|
|
1004
|
-
insert(_el$
|
|
1026
|
+
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);
|
|
1027
|
+
_el$176.$$click = (e) => e.stopPropagation();
|
|
1028
|
+
insert(_el$179, () => params.label || params.url);
|
|
1029
|
+
insert(_el$178, createComponent(Show, {
|
|
1005
1030
|
get when() {
|
|
1006
1031
|
return params.description;
|
|
1007
1032
|
},
|
|
1008
1033
|
get children() {
|
|
1009
|
-
var _el$
|
|
1010
|
-
insert(_el$
|
|
1011
|
-
return _el$
|
|
1034
|
+
var _el$180 = getNextElement(_tmpl$39);
|
|
1035
|
+
insert(_el$180, () => params.description);
|
|
1036
|
+
return _el$180;
|
|
1012
1037
|
}
|
|
1013
|
-
}), _el$
|
|
1038
|
+
}), _el$182, _co$39);
|
|
1014
1039
|
effect((_p$) => {
|
|
1015
|
-
var _v$
|
|
1016
|
-
_v$
|
|
1017
|
-
_v$
|
|
1018
|
-
_v$
|
|
1040
|
+
var _v$29 = params.url, _v$30 = `${params.label || "Link"}: ${params.description || params.url} (opens in new tab)`, _v$31 = `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 || ""}`;
|
|
1041
|
+
_v$29 !== _p$.e && setAttribute(_el$176, "href", _p$.e = _v$29);
|
|
1042
|
+
_v$30 !== _p$.t && setAttribute(_el$176, "aria-label", _p$.t = _v$30);
|
|
1043
|
+
_v$31 !== _p$.a && className(_el$176, _p$.a = _v$31);
|
|
1019
1044
|
return _p$;
|
|
1020
1045
|
}, {
|
|
1021
1046
|
e: void 0,
|
|
@@ -1023,7 +1048,7 @@ function LinkRenderer(props) {
|
|
|
1023
1048
|
a: void 0
|
|
1024
1049
|
});
|
|
1025
1050
|
runHydrationEvents();
|
|
1026
|
-
return _el$
|
|
1051
|
+
return _el$176;
|
|
1027
1052
|
})();
|
|
1028
1053
|
}
|
|
1029
1054
|
function ComponentRenderer(props) {
|
|
@@ -1037,12 +1062,12 @@ function ComponentRenderer(props) {
|
|
|
1037
1062
|
details: validation.errors
|
|
1038
1063
|
});
|
|
1039
1064
|
return (() => {
|
|
1040
|
-
var _el$
|
|
1041
|
-
insert(_el$
|
|
1065
|
+
var _el$183 = getNextElement(_tmpl$41), _el$184 = _el$183.firstChild, _el$185 = _el$184.nextSibling;
|
|
1066
|
+
insert(_el$185, () => {
|
|
1042
1067
|
var _a2, _b;
|
|
1043
1068
|
return ((_b = (_a2 = validation.errors) == null ? void 0 : _a2[0]) == null ? void 0 : _b.message) || "Unknown validation error";
|
|
1044
1069
|
});
|
|
1045
|
-
return _el$
|
|
1070
|
+
return _el$183;
|
|
1046
1071
|
})();
|
|
1047
1072
|
}
|
|
1048
1073
|
return createComponent(GenerativeUIErrorBoundary, {
|
|
@@ -1288,27 +1313,27 @@ function ActionRenderer(props) {
|
|
|
1288
1313
|
const isDisabled = () => params.disabled || params.action === "tool-call" && isExecuting();
|
|
1289
1314
|
if (params.type === "link" || params.action === "link") {
|
|
1290
1315
|
return (() => {
|
|
1291
|
-
var _el$
|
|
1292
|
-
_el$
|
|
1293
|
-
insert(_el$
|
|
1316
|
+
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);
|
|
1317
|
+
_el$186.$$click = handleClick;
|
|
1318
|
+
insert(_el$186, createComponent(Show, {
|
|
1294
1319
|
get when() {
|
|
1295
1320
|
return params.icon;
|
|
1296
1321
|
},
|
|
1297
1322
|
get children() {
|
|
1298
|
-
var _el$
|
|
1299
|
-
insert(_el$
|
|
1300
|
-
return _el$
|
|
1323
|
+
var _el$187 = getNextElement(_tmpl$42);
|
|
1324
|
+
insert(_el$187, () => params.icon);
|
|
1325
|
+
return _el$187;
|
|
1301
1326
|
}
|
|
1302
|
-
}), _el$
|
|
1303
|
-
insert(_el$
|
|
1327
|
+
}), _el$189, _co$40);
|
|
1328
|
+
insert(_el$186, () => params.label, _el$191, _co$41);
|
|
1304
1329
|
effect((_p$) => {
|
|
1305
|
-
var _v$
|
|
1330
|
+
var _v$32 = params.url || "#", _v$33 = params.url ? "_blank" : void 0, _v$34 = params.ariaLabel || params.label, _v$35 = `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
1331
|
${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
1332
|
${params.className || ""}`;
|
|
1308
|
-
_v$
|
|
1309
|
-
_v$
|
|
1310
|
-
_v$
|
|
1311
|
-
_v$
|
|
1333
|
+
_v$32 !== _p$.e && setAttribute(_el$186, "href", _p$.e = _v$32);
|
|
1334
|
+
_v$33 !== _p$.t && setAttribute(_el$186, "target", _p$.t = _v$33);
|
|
1335
|
+
_v$34 !== _p$.a && setAttribute(_el$186, "aria-label", _p$.a = _v$34);
|
|
1336
|
+
_v$35 !== _p$.o && className(_el$186, _p$.o = _v$35);
|
|
1312
1337
|
return _p$;
|
|
1313
1338
|
}, {
|
|
1314
1339
|
e: void 0,
|
|
@@ -1317,42 +1342,42 @@ function ActionRenderer(props) {
|
|
|
1317
1342
|
o: void 0
|
|
1318
1343
|
});
|
|
1319
1344
|
runHydrationEvents();
|
|
1320
|
-
return _el$
|
|
1345
|
+
return _el$186;
|
|
1321
1346
|
})();
|
|
1322
1347
|
}
|
|
1323
1348
|
return (() => {
|
|
1324
|
-
var _el$
|
|
1325
|
-
_el$
|
|
1326
|
-
insert(_el$
|
|
1349
|
+
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);
|
|
1350
|
+
_el$192.$$click = handleClick;
|
|
1351
|
+
insert(_el$192, createComponent(Show, {
|
|
1327
1352
|
get when() {
|
|
1328
1353
|
return memo(() => !!isExecuting())() && params.action === "tool-call";
|
|
1329
1354
|
},
|
|
1330
1355
|
get children() {
|
|
1331
|
-
return getNextElement(_tmpl$
|
|
1356
|
+
return getNextElement(_tmpl$44);
|
|
1332
1357
|
}
|
|
1333
|
-
}), _el$
|
|
1334
|
-
insert(_el$
|
|
1358
|
+
}), _el$196, _co$42);
|
|
1359
|
+
insert(_el$192, createComponent(Show, {
|
|
1335
1360
|
get when() {
|
|
1336
1361
|
return memo(() => !!params.icon)() && !(isExecuting() && params.action === "tool-call");
|
|
1337
1362
|
},
|
|
1338
1363
|
get children() {
|
|
1339
|
-
var _el$
|
|
1340
|
-
insert(_el$
|
|
1341
|
-
return _el$
|
|
1364
|
+
var _el$194 = getNextElement(_tmpl$42);
|
|
1365
|
+
insert(_el$194, () => params.icon);
|
|
1366
|
+
return _el$194;
|
|
1342
1367
|
}
|
|
1343
|
-
}), _el$
|
|
1344
|
-
insert(_el$
|
|
1368
|
+
}), _el$198, _co$43);
|
|
1369
|
+
insert(_el$192, () => params.label, _el$200, _co$44);
|
|
1345
1370
|
effect((_p$) => {
|
|
1346
|
-
var _v$
|
|
1371
|
+
var _v$36 = params.action === "submit" ? "submit" : "button", _v$37 = isDisabled(), _v$38 = isExecuting() && params.action === "tool-call", _v$39 = params.ariaLabel || params.label, _v$40 = `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
1372
|
${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
1373
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1349
1374
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1350
1375
|
${params.className || ""}`;
|
|
1351
|
-
_v$
|
|
1352
|
-
_v$
|
|
1353
|
-
_v$
|
|
1354
|
-
_v$
|
|
1355
|
-
_v$
|
|
1376
|
+
_v$36 !== _p$.e && setAttribute(_el$192, "type", _p$.e = _v$36);
|
|
1377
|
+
_v$37 !== _p$.t && setProperty(_el$192, "disabled", _p$.t = _v$37);
|
|
1378
|
+
_v$38 !== _p$.a && setAttribute(_el$192, "aria-busy", _p$.a = _v$38);
|
|
1379
|
+
_v$39 !== _p$.o && setAttribute(_el$192, "aria-label", _p$.o = _v$39);
|
|
1380
|
+
_v$40 !== _p$.i && className(_el$192, _p$.i = _v$40);
|
|
1356
1381
|
return _p$;
|
|
1357
1382
|
}, {
|
|
1358
1383
|
e: void 0,
|
|
@@ -1362,7 +1387,7 @@ function ActionRenderer(props) {
|
|
|
1362
1387
|
i: void 0
|
|
1363
1388
|
});
|
|
1364
1389
|
runHydrationEvents();
|
|
1365
|
-
return _el$
|
|
1390
|
+
return _el$192;
|
|
1366
1391
|
})();
|
|
1367
1392
|
}
|
|
1368
1393
|
function ErrorCardRenderer(props) {
|
|
@@ -1370,55 +1395,55 @@ function ErrorCardRenderer(props) {
|
|
|
1370
1395
|
return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
|
|
1371
1396
|
};
|
|
1372
1397
|
return (() => {
|
|
1373
|
-
var _el$
|
|
1374
|
-
insert(_el$
|
|
1398
|
+
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);
|
|
1399
|
+
insert(_el$201, createComponent(CopyButton, {
|
|
1375
1400
|
getText: getErrorText,
|
|
1376
1401
|
title: "Copy error details",
|
|
1377
1402
|
position: "top-right"
|
|
1378
|
-
}), _el$
|
|
1379
|
-
insert(_el$
|
|
1380
|
-
insert(_el$
|
|
1381
|
-
insert(_el$
|
|
1403
|
+
}), _el$225, _co$50);
|
|
1404
|
+
insert(_el$205, () => props.error.tool || "Unknown", _el$208, _co$45);
|
|
1405
|
+
insert(_el$209, () => props.error.message || "An error occurred during tool execution");
|
|
1406
|
+
insert(_el$204, createComponent(Show, {
|
|
1382
1407
|
get when() {
|
|
1383
1408
|
return props.error.type;
|
|
1384
1409
|
},
|
|
1385
1410
|
get children() {
|
|
1386
|
-
var _el$
|
|
1387
|
-
insert(_el$
|
|
1388
|
-
return _el$
|
|
1411
|
+
var _el$210 = getNextElement(_tmpl$46), _el$211 = _el$210.firstChild, _el$212 = _el$211.nextSibling, [_el$213, _co$46] = getNextMarker(_el$212.nextSibling);
|
|
1412
|
+
insert(_el$210, () => props.error.type, _el$213, _co$46);
|
|
1413
|
+
return _el$210;
|
|
1389
1414
|
}
|
|
1390
|
-
}), _el$
|
|
1391
|
-
insert(_el$
|
|
1415
|
+
}), _el$219, _co$47);
|
|
1416
|
+
insert(_el$204, createComponent(Show, {
|
|
1392
1417
|
get when() {
|
|
1393
1418
|
var _a;
|
|
1394
1419
|
return (_a = props.error.suggestions) == null ? void 0 : _a.length;
|
|
1395
1420
|
},
|
|
1396
1421
|
get children() {
|
|
1397
|
-
var _el$
|
|
1398
|
-
insert(_el$
|
|
1422
|
+
var _el$214 = getNextElement(_tmpl$47), _el$215 = _el$214.firstChild, _el$216 = _el$215.nextSibling;
|
|
1423
|
+
insert(_el$216, createComponent(For, {
|
|
1399
1424
|
get each() {
|
|
1400
1425
|
return props.error.suggestions;
|
|
1401
1426
|
},
|
|
1402
1427
|
children: (suggestion) => (() => {
|
|
1403
|
-
var _el$
|
|
1404
|
-
insert(_el$
|
|
1405
|
-
return _el$
|
|
1428
|
+
var _el$226 = getNextElement(_tmpl$50);
|
|
1429
|
+
insert(_el$226, suggestion);
|
|
1430
|
+
return _el$226;
|
|
1406
1431
|
})()
|
|
1407
1432
|
}));
|
|
1408
|
-
return _el$
|
|
1433
|
+
return _el$214;
|
|
1409
1434
|
}
|
|
1410
|
-
}), _el$
|
|
1411
|
-
insert(_el$
|
|
1435
|
+
}), _el$221, _co$48);
|
|
1436
|
+
insert(_el$204, createComponent(Show, {
|
|
1412
1437
|
get when() {
|
|
1413
1438
|
return props.error.timestamp;
|
|
1414
1439
|
},
|
|
1415
1440
|
get children() {
|
|
1416
|
-
var _el$
|
|
1417
|
-
insert(_el$
|
|
1418
|
-
return _el$
|
|
1441
|
+
var _el$217 = getNextElement(_tmpl$48);
|
|
1442
|
+
insert(_el$217, () => new Date(props.error.timestamp).toLocaleString());
|
|
1443
|
+
return _el$217;
|
|
1419
1444
|
}
|
|
1420
|
-
}), _el$
|
|
1421
|
-
return _el$
|
|
1445
|
+
}), _el$223, _co$49);
|
|
1446
|
+
return _el$201;
|
|
1422
1447
|
})();
|
|
1423
1448
|
}
|
|
1424
1449
|
function isErrorResponse(content) {
|
|
@@ -1441,20 +1466,20 @@ function UIResourceHtmlRenderer(props) {
|
|
|
1441
1466
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
|
|
1442
1467
|
};
|
|
1443
1468
|
return (() => {
|
|
1444
|
-
var _el$
|
|
1445
|
-
insert(_el$
|
|
1469
|
+
var _el$227 = getNextElement(_tmpl$52), _el$231 = _el$227.firstChild, [_el$232, _co$51] = getNextMarker(_el$231.nextSibling), _el$230 = _el$232.nextSibling;
|
|
1470
|
+
insert(_el$227, createComponent(Show, {
|
|
1446
1471
|
get when() {
|
|
1447
1472
|
var _a;
|
|
1448
1473
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
|
|
1449
1474
|
},
|
|
1450
1475
|
get children() {
|
|
1451
|
-
var _el$
|
|
1452
|
-
insert(_el$
|
|
1453
|
-
return _el$
|
|
1476
|
+
var _el$228 = getNextElement(_tmpl$51), _el$229 = _el$228.firstChild;
|
|
1477
|
+
insert(_el$229, resourceTitle);
|
|
1478
|
+
return _el$228;
|
|
1454
1479
|
}
|
|
1455
|
-
}), _el$
|
|
1456
|
-
effect(() => setProperty(_el$
|
|
1457
|
-
return _el$
|
|
1480
|
+
}), _el$232, _co$51);
|
|
1481
|
+
effect(() => setProperty(_el$230, "innerHTML", htmlContent()));
|
|
1482
|
+
return _el$227;
|
|
1458
1483
|
})();
|
|
1459
1484
|
}
|
|
1460
1485
|
const UIResourceRenderer = (props) => {
|
|
@@ -1534,24 +1559,24 @@ const UIResourceRenderer = (props) => {
|
|
|
1534
1559
|
return createComponent(RenderProvider, {
|
|
1535
1560
|
renderComponent,
|
|
1536
1561
|
get children() {
|
|
1537
|
-
var _el$
|
|
1538
|
-
insert(_el$
|
|
1562
|
+
var _el$233 = getNextElement(_tmpl$53), _el$234 = _el$233.firstChild, _el$235 = _el$234.nextSibling, [_el$236, _co$52] = getNextMarker(_el$235.nextSibling);
|
|
1563
|
+
insert(_el$234, createComponent(For, {
|
|
1539
1564
|
get each() {
|
|
1540
1565
|
return layoutData.components;
|
|
1541
1566
|
},
|
|
1542
1567
|
children: (component) => (() => {
|
|
1543
|
-
var _el$
|
|
1544
|
-
insert(_el$
|
|
1568
|
+
var _el$237 = getNextElement(_tmpl$54);
|
|
1569
|
+
insert(_el$237, createComponent(ComponentRenderer, {
|
|
1545
1570
|
component,
|
|
1546
1571
|
get onError() {
|
|
1547
1572
|
return props.onError;
|
|
1548
1573
|
}
|
|
1549
1574
|
}));
|
|
1550
|
-
effect((_$p) => style(_el$
|
|
1551
|
-
return _el$
|
|
1575
|
+
effect((_$p) => style(_el$237, getGridStyleString(component), _$p));
|
|
1576
|
+
return _el$237;
|
|
1552
1577
|
})()
|
|
1553
1578
|
}));
|
|
1554
|
-
insert(_el$
|
|
1579
|
+
insert(_el$233, createComponent(Show, {
|
|
1555
1580
|
get when() {
|
|
1556
1581
|
return shouldShowAutoFooter();
|
|
1557
1582
|
},
|
|
@@ -1562,23 +1587,24 @@ const UIResourceRenderer = (props) => {
|
|
|
1562
1587
|
}
|
|
1563
1588
|
});
|
|
1564
1589
|
}
|
|
1565
|
-
}), _el$
|
|
1590
|
+
}), _el$236, _co$52);
|
|
1566
1591
|
effect((_p$) => {
|
|
1567
|
-
var _v$
|
|
1568
|
-
_v$
|
|
1569
|
-
_p$.t = style(_el$
|
|
1592
|
+
var _v$41 = `w-full ${props.class || ""}`, _v$42 = gridContainerStyle();
|
|
1593
|
+
_v$41 !== _p$.e && className(_el$233, _p$.e = _v$41);
|
|
1594
|
+
_p$.t = style(_el$234, _v$42, _p$.t);
|
|
1570
1595
|
return _p$;
|
|
1571
1596
|
}, {
|
|
1572
1597
|
e: void 0,
|
|
1573
1598
|
t: void 0
|
|
1574
1599
|
});
|
|
1575
|
-
return _el$
|
|
1600
|
+
return _el$233;
|
|
1576
1601
|
}
|
|
1577
1602
|
});
|
|
1578
1603
|
};
|
|
1579
1604
|
delegateEvents(["click", "input"]);
|
|
1580
1605
|
export {
|
|
1581
1606
|
UIResourceRenderer,
|
|
1607
|
+
highlightQuery,
|
|
1582
1608
|
renderCellValue
|
|
1583
1609
|
};
|
|
1584
1610
|
//# sourceMappingURL=UIResourceRenderer.js.map
|