@seed-ship/mcp-ui-solid 4.3.2 → 4.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/components/ExpandableWrapper.cjs +9 -1
- package/dist/components/ExpandableWrapper.cjs.map +1 -1
- package/dist/components/ExpandableWrapper.d.ts +3 -1
- package/dist/components/ExpandableWrapper.d.ts.map +1 -1
- package/dist/components/ExpandableWrapper.js +11 -3
- package/dist/components/ExpandableWrapper.js.map +1 -1
- package/dist/components/UIResourceRenderer.cjs +278 -209
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +279 -210
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
- package/src/components/ExpandableWrapper.tsx +10 -2
- package/src/components/UIResourceRenderer.tsx +78 -14
- package/src/index.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -15,11 +15,11 @@ import { ImageGalleryRenderer } from "./ImageGalleryRenderer.js";
|
|
|
15
15
|
import { VideoRenderer } from "./VideoRenderer.js";
|
|
16
16
|
import { CodeBlockRenderer } from "./CodeBlockRenderer.js";
|
|
17
17
|
import { MapRenderer } from "./MapRenderer.js";
|
|
18
|
-
import { ExpandableWrapper } from "./ExpandableWrapper.js";
|
|
18
|
+
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(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$20 = /* @__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$21 = /* @__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$22 = /* @__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$23 = /* @__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$24 = /* @__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$25 = /* @__PURE__ */ template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$26 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$27 = /* @__PURE__ */ template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$28 = /* @__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$29 = /* @__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$30 = /* @__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$31 = /* @__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$32 = /* @__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$33 = /* @__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$34 = /* @__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$35 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$36 = /* @__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$37 = /* @__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$38 = /* @__PURE__ */ template(`<span aria-hidden=true>`), _tmpl$39 = /* @__PURE__ */ template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$40 = /* @__PURE__ */ template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$41 = /* @__PURE__ */ template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$42 = /* @__PURE__ */ template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$43 = /* @__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$44 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$45 = /* @__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$46 = /* @__PURE__ */ template(`<li>`), _tmpl$47 = /* @__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$48 = /* @__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$49 = /* @__PURE__ */ template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$50 = /* @__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 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>`);
|
|
23
23
|
function CopyButton(props) {
|
|
24
24
|
const [copied, setCopied] = createSignal(false);
|
|
25
25
|
const handleCopy = async () => {
|
|
@@ -310,25 +310,53 @@ function TableRenderer(props) {
|
|
|
310
310
|
if (sortKey() !== key) return "↕";
|
|
311
311
|
return sortDir() === "asc" ? "↑" : "↓";
|
|
312
312
|
};
|
|
313
|
-
const
|
|
313
|
+
const [searchQuery, setSearchQuery] = createSignal("");
|
|
314
|
+
const [debouncedQuery, setDebouncedQuery] = createSignal("");
|
|
315
|
+
let searchTimer = null;
|
|
316
|
+
const isSearchable = () => tableParams.searchable === true || tableParams.searchable !== false && allRows().length > 10;
|
|
317
|
+
const searchPlaceholder = () => tableParams.searchPlaceholder || "Rechercher dans le tableau...";
|
|
318
|
+
const handleSearch = (value) => {
|
|
319
|
+
setSearchQuery(value);
|
|
320
|
+
if (searchTimer) clearTimeout(searchTimer);
|
|
321
|
+
searchTimer = setTimeout(() => {
|
|
322
|
+
setDebouncedQuery(value);
|
|
323
|
+
setClientPage(0);
|
|
324
|
+
setProgressivePages(1);
|
|
325
|
+
}, 200);
|
|
326
|
+
};
|
|
327
|
+
const normalize = (s) => s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
328
|
+
const filteredRows = createMemo(() => {
|
|
329
|
+
const q = normalize(debouncedQuery());
|
|
330
|
+
if (!q) return sortedRows();
|
|
331
|
+
const cols = columns();
|
|
332
|
+
return sortedRows().filter((row) => cols.some((col) => {
|
|
333
|
+
const val = row[col.key];
|
|
334
|
+
if (val == null) return false;
|
|
335
|
+
return normalize(String(val)).includes(q);
|
|
336
|
+
}));
|
|
337
|
+
});
|
|
338
|
+
const isExpanded = useExpanded();
|
|
339
|
+
const fullPageSize = () => tableParams.pageSize ?? 25;
|
|
340
|
+
const chatPageSize = () => tableParams.chatPageSize ?? Math.min(10, fullPageSize());
|
|
341
|
+
const clientPageSize = () => isExpanded() ? fullPageSize() : chatPageSize();
|
|
314
342
|
const hasServerPagination = () => !!tableParams.pagination;
|
|
315
343
|
const isProgressiveMode = () => !!tableParams.showAllLabel;
|
|
316
|
-
const needsClientPagination = () => !hasServerPagination() && clientPageSize() > 0 &&
|
|
344
|
+
const needsClientPagination = () => !hasServerPagination() && clientPageSize() > 0 && filteredRows().length > clientPageSize();
|
|
317
345
|
const [clientPage, setClientPage] = createSignal(tableParams.initialPage ?? 0);
|
|
318
346
|
const [progressivePages, setProgressivePages] = createSignal(1);
|
|
319
|
-
const clientTotalPages = () => needsClientPagination() ? Math.ceil(
|
|
347
|
+
const clientTotalPages = () => needsClientPagination() ? Math.ceil(filteredRows().length / clientPageSize()) : 1;
|
|
320
348
|
const clientVisibleRows = createMemo(() => {
|
|
321
|
-
if (!needsClientPagination()) return
|
|
349
|
+
if (!needsClientPagination()) return filteredRows();
|
|
322
350
|
if (isProgressiveMode()) {
|
|
323
|
-
return
|
|
351
|
+
return filteredRows().slice(0, progressivePages() * clientPageSize());
|
|
324
352
|
}
|
|
325
353
|
const start = clientPage() * clientPageSize();
|
|
326
|
-
return
|
|
354
|
+
return filteredRows().slice(start, start + clientPageSize());
|
|
327
355
|
});
|
|
328
356
|
const clientRangeStart = () => needsClientPagination() ? isProgressiveMode() ? 1 : clientPage() * clientPageSize() + 1 : 1;
|
|
329
|
-
const clientRangeEnd = () => needsClientPagination() ? isProgressiveMode() ? Math.min(progressivePages() * clientPageSize(),
|
|
357
|
+
const clientRangeEnd = () => needsClientPagination() ? isProgressiveMode() ? Math.min(progressivePages() * clientPageSize(), filteredRows().length) : Math.min((clientPage() + 1) * clientPageSize(), filteredRows().length) : filteredRows().length;
|
|
330
358
|
const progressiveHasMore = () => isProgressiveMode() && needsClientPagination() && progressivePages() < clientTotalPages();
|
|
331
|
-
const progressiveRemaining = () =>
|
|
359
|
+
const progressiveRemaining = () => filteredRows().length - progressivePages() * clientPageSize();
|
|
332
360
|
const showMoreLabel = () => tableParams.showAllLabel || "Show more";
|
|
333
361
|
const [virtualizer, setVirtualizer] = createSignal(null);
|
|
334
362
|
const [isVirtualizing, setIsVirtualizing] = createSignal(false);
|
|
@@ -523,7 +551,7 @@ ${dataRows}`;
|
|
|
523
551
|
},
|
|
524
552
|
copyLabel: "Copy table (TSV)",
|
|
525
553
|
get children() {
|
|
526
|
-
var _el$29 = getNextElement(_tmpl$
|
|
554
|
+
var _el$29 = getNextElement(_tmpl$26), _el$142 = _el$29.firstChild, [_el$143, _co$35] = getNextMarker(_el$142.nextSibling), _el$44 = _el$143.nextSibling, _el$132 = _el$44.firstChild, [_el$133, _co$30] = getNextMarker(_el$132.nextSibling), _el$134 = _el$133.nextSibling, [_el$135, _co$31] = getNextMarker(_el$134.nextSibling), _el$70 = _el$135.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$136 = _el$70.nextSibling, [_el$137, _co$32] = getNextMarker(_el$136.nextSibling), _el$138 = _el$137.nextSibling, [_el$139, _co$33] = getNextMarker(_el$138.nextSibling), _el$140 = _el$139.nextSibling, [_el$141, _co$34] = getNextMarker(_el$140.nextSibling);
|
|
527
555
|
insert(_el$29, createComponent(Show, {
|
|
528
556
|
when: exportable,
|
|
529
557
|
get fallback() {
|
|
@@ -581,7 +609,7 @@ ${dataRows}`;
|
|
|
581
609
|
runHydrationEvents();
|
|
582
610
|
return _el$30;
|
|
583
611
|
}
|
|
584
|
-
}), _el$
|
|
612
|
+
}), _el$143, _co$35);
|
|
585
613
|
insert(_el$44, createComponent(Show, {
|
|
586
614
|
get when() {
|
|
587
615
|
return tableParams.title;
|
|
@@ -606,18 +634,59 @@ ${dataRows}`;
|
|
|
606
634
|
}), _el$54, _co$1);
|
|
607
635
|
return _el$45;
|
|
608
636
|
}
|
|
609
|
-
}), _el$
|
|
637
|
+
}), _el$133, _co$30);
|
|
638
|
+
insert(_el$44, createComponent(Show, {
|
|
639
|
+
get when() {
|
|
640
|
+
return isSearchable();
|
|
641
|
+
},
|
|
642
|
+
get children() {
|
|
643
|
+
return [(() => {
|
|
644
|
+
var _el$55 = getNextElement(_tmpl$20), _el$56 = _el$55.firstChild, _el$57 = _el$56.nextSibling, _el$59 = _el$57.nextSibling, [_el$60, _co$10] = getNextMarker(_el$59.nextSibling);
|
|
645
|
+
_el$57.$$input = (e) => handleSearch(e.currentTarget.value);
|
|
646
|
+
insert(_el$55, createComponent(Show, {
|
|
647
|
+
get when() {
|
|
648
|
+
return searchQuery();
|
|
649
|
+
},
|
|
650
|
+
get children() {
|
|
651
|
+
var _el$58 = getNextElement(_tmpl$19);
|
|
652
|
+
_el$58.$$click = () => {
|
|
653
|
+
handleSearch("");
|
|
654
|
+
setSearchQuery("");
|
|
655
|
+
setDebouncedQuery("");
|
|
656
|
+
};
|
|
657
|
+
runHydrationEvents();
|
|
658
|
+
return _el$58;
|
|
659
|
+
}
|
|
660
|
+
}), _el$60, _co$10);
|
|
661
|
+
effect(() => setAttribute(_el$57, "placeholder", searchPlaceholder()));
|
|
662
|
+
effect(() => setProperty(_el$57, "value", searchQuery()));
|
|
663
|
+
runHydrationEvents();
|
|
664
|
+
return _el$55;
|
|
665
|
+
})(), createComponent(Show, {
|
|
666
|
+
get when() {
|
|
667
|
+
return memo(() => !!debouncedQuery())() && filteredRows().length !== sortedRows().length;
|
|
668
|
+
},
|
|
669
|
+
get children() {
|
|
670
|
+
var _el$61 = getNextElement(_tmpl$21), _el$64 = _el$61.firstChild, [_el$65, _co$11] = getNextMarker(_el$64.nextSibling), _el$62 = _el$65.nextSibling, _el$66 = _el$62.nextSibling, [_el$67, _co$12] = getNextMarker(_el$66.nextSibling), _el$63 = _el$67.nextSibling, _el$68 = _el$63.nextSibling, [_el$69, _co$13] = getNextMarker(_el$68.nextSibling);
|
|
671
|
+
insert(_el$61, () => filteredRows().length, _el$65, _co$11);
|
|
672
|
+
insert(_el$61, () => filteredRows().length !== 1 ? "s" : "", _el$67, _co$12);
|
|
673
|
+
insert(_el$61, () => sortedRows().length, _el$69, _co$13);
|
|
674
|
+
return _el$61;
|
|
675
|
+
}
|
|
676
|
+
})];
|
|
677
|
+
}
|
|
678
|
+
}), _el$135, _co$31);
|
|
610
679
|
var _ref$ = scrollContainerRef;
|
|
611
|
-
typeof _ref$ === "function" ? use(_ref$, _el$
|
|
612
|
-
insert(_el$
|
|
680
|
+
typeof _ref$ === "function" ? use(_ref$, _el$70) : scrollContainerRef = _el$70;
|
|
681
|
+
insert(_el$73, createComponent(For, {
|
|
613
682
|
get each() {
|
|
614
683
|
return tableParams.columns;
|
|
615
684
|
},
|
|
616
685
|
children: (column) => (() => {
|
|
617
|
-
var _el$
|
|
618
|
-
addEventListener(_el$
|
|
619
|
-
insert(_el$
|
|
620
|
-
insert(_el$
|
|
686
|
+
var _el$144 = getNextElement(_tmpl$27), _el$145 = _el$144.firstChild, _el$147 = _el$145.firstChild, [_el$148, _co$36] = getNextMarker(_el$147.nextSibling), _el$146 = _el$148.nextSibling;
|
|
687
|
+
addEventListener(_el$144, "click", () => handleSort(column.key));
|
|
688
|
+
insert(_el$145, () => column.label, _el$148, _co$36);
|
|
689
|
+
insert(_el$146, () => sortIndicator(column.key));
|
|
621
690
|
effect((_p$) => {
|
|
622
691
|
var _v$11 = column.width ? {
|
|
623
692
|
width: column.width
|
|
@@ -625,19 +694,19 @@ ${dataRows}`;
|
|
|
625
694
|
"opacity-30": sortKey() !== column.key,
|
|
626
695
|
"opacity-100 text-blue-600 dark:text-blue-400": sortKey() === column.key
|
|
627
696
|
};
|
|
628
|
-
_p$.e = style(_el$
|
|
629
|
-
_v$12 !== _p$.t && setAttribute(_el$
|
|
630
|
-
_p$.a = classList(_el$
|
|
697
|
+
_p$.e = style(_el$144, _v$11, _p$.e);
|
|
698
|
+
_v$12 !== _p$.t && setAttribute(_el$144, "title", _p$.t = _v$12);
|
|
699
|
+
_p$.a = classList(_el$146, _v$13, _p$.a);
|
|
631
700
|
return _p$;
|
|
632
701
|
}, {
|
|
633
702
|
e: void 0,
|
|
634
703
|
t: void 0,
|
|
635
704
|
a: void 0
|
|
636
705
|
});
|
|
637
|
-
return _el$
|
|
706
|
+
return _el$144;
|
|
638
707
|
})()
|
|
639
708
|
}));
|
|
640
|
-
insert(_el$
|
|
709
|
+
insert(_el$71, createComponent(Show, {
|
|
641
710
|
get when() {
|
|
642
711
|
return isVirtualizing();
|
|
643
712
|
},
|
|
@@ -647,80 +716,80 @@ ${dataRows}`;
|
|
|
647
716
|
get children() {
|
|
648
717
|
return createComponent(VirtualizedTableBody, {});
|
|
649
718
|
}
|
|
650
|
-
}), _el$
|
|
719
|
+
}), _el$75, _co$14);
|
|
651
720
|
insert(_el$44, createComponent(Show, {
|
|
652
721
|
get when() {
|
|
653
722
|
return tableParams.pagination;
|
|
654
723
|
},
|
|
655
724
|
get children() {
|
|
656
|
-
var _el$
|
|
657
|
-
insert(_el$
|
|
658
|
-
insert(_el$
|
|
659
|
-
insert(_el$
|
|
660
|
-
return _el$
|
|
725
|
+
var _el$76 = getNextElement(_tmpl$22), _el$77 = _el$76.firstChild, _el$78 = _el$77.firstChild, _el$83 = _el$78.nextSibling, [_el$84, _co$15] = getNextMarker(_el$83.nextSibling), _el$79 = _el$84.nextSibling, _el$85 = _el$79.nextSibling, [_el$86, _co$16] = getNextMarker(_el$85.nextSibling), _el$81 = _el$86.nextSibling, _el$87 = _el$81.nextSibling, [_el$88, _co$17] = getNextMarker(_el$87.nextSibling);
|
|
726
|
+
insert(_el$77, () => tableParams.pagination.currentPage * tableParams.pagination.pageSize + 1, _el$84, _co$15);
|
|
727
|
+
insert(_el$77, () => Math.min((tableParams.pagination.currentPage + 1) * tableParams.pagination.pageSize, tableParams.pagination.totalRows), _el$86, _co$16);
|
|
728
|
+
insert(_el$77, () => tableParams.pagination.totalRows, _el$88, _co$17);
|
|
729
|
+
return _el$76;
|
|
661
730
|
}
|
|
662
|
-
}), _el$
|
|
731
|
+
}), _el$137, _co$32);
|
|
663
732
|
insert(_el$44, createComponent(Show, {
|
|
664
733
|
get when() {
|
|
665
734
|
return memo(() => !!needsClientPagination())() && !isProgressiveMode();
|
|
666
735
|
},
|
|
667
736
|
get children() {
|
|
668
|
-
var _el$
|
|
669
|
-
insert(_el$
|
|
670
|
-
insert(_el$
|
|
671
|
-
insert(_el$
|
|
672
|
-
_el$
|
|
673
|
-
insert(_el$
|
|
674
|
-
insert(_el$
|
|
675
|
-
_el$
|
|
737
|
+
var _el$89 = getNextElement(_tmpl$23), _el$90 = _el$89.firstChild, _el$91 = _el$90.firstChild, _el$94 = _el$91.nextSibling, [_el$95, _co$18] = getNextMarker(_el$94.nextSibling), _el$92 = _el$95.nextSibling, _el$96 = _el$92.nextSibling, [_el$97, _co$19] = getNextMarker(_el$96.nextSibling), _el$93 = _el$97.nextSibling, _el$98 = _el$93.nextSibling, [_el$99, _co$20] = getNextMarker(_el$98.nextSibling), _el$100 = _el$90.nextSibling, _el$101 = _el$100.firstChild, _el$102 = _el$101.nextSibling, _el$103 = _el$102.firstChild, _el$105 = _el$103.nextSibling, [_el$106, _co$21] = getNextMarker(_el$105.nextSibling), _el$104 = _el$106.nextSibling, _el$107 = _el$104.nextSibling, [_el$108, _co$22] = getNextMarker(_el$107.nextSibling), _el$109 = _el$102.nextSibling;
|
|
738
|
+
insert(_el$90, clientRangeStart, _el$95, _co$18);
|
|
739
|
+
insert(_el$90, clientRangeEnd, _el$97, _co$19);
|
|
740
|
+
insert(_el$90, () => filteredRows().length.toLocaleString("fr-FR"), _el$99, _co$20);
|
|
741
|
+
_el$101.$$click = () => setClientPage((p) => p - 1);
|
|
742
|
+
insert(_el$102, () => clientPage() + 1, _el$106, _co$21);
|
|
743
|
+
insert(_el$102, clientTotalPages, _el$108, _co$22);
|
|
744
|
+
_el$109.$$click = () => setClientPage((p) => p + 1);
|
|
676
745
|
effect((_p$) => {
|
|
677
746
|
var _v$8 = clientPage() === 0, _v$9 = clientPage() >= clientTotalPages() - 1;
|
|
678
|
-
_v$8 !== _p$.e && setProperty(_el$
|
|
679
|
-
_v$9 !== _p$.t && setProperty(_el$
|
|
747
|
+
_v$8 !== _p$.e && setProperty(_el$101, "disabled", _p$.e = _v$8);
|
|
748
|
+
_v$9 !== _p$.t && setProperty(_el$109, "disabled", _p$.t = _v$9);
|
|
680
749
|
return _p$;
|
|
681
750
|
}, {
|
|
682
751
|
e: void 0,
|
|
683
752
|
t: void 0
|
|
684
753
|
});
|
|
685
754
|
runHydrationEvents();
|
|
686
|
-
return _el$
|
|
755
|
+
return _el$89;
|
|
687
756
|
}
|
|
688
|
-
}), _el$
|
|
757
|
+
}), _el$139, _co$33);
|
|
689
758
|
insert(_el$44, createComponent(Show, {
|
|
690
759
|
get when() {
|
|
691
760
|
return memo(() => !!needsClientPagination())() && isProgressiveMode();
|
|
692
761
|
},
|
|
693
762
|
get children() {
|
|
694
|
-
var _el$
|
|
695
|
-
insert(_el$
|
|
696
|
-
insert(_el$
|
|
697
|
-
insert(_el$
|
|
698
|
-
insert(_el$
|
|
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, {
|
|
699
768
|
get when() {
|
|
700
769
|
return progressiveHasMore();
|
|
701
770
|
},
|
|
702
771
|
get children() {
|
|
703
|
-
var _el$
|
|
704
|
-
_el$
|
|
705
|
-
_el$
|
|
706
|
-
insert(_el$
|
|
707
|
-
insert(_el$
|
|
708
|
-
insert(_el$
|
|
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);
|
|
709
778
|
runHydrationEvents();
|
|
710
|
-
return _el$
|
|
779
|
+
return _el$120;
|
|
711
780
|
}
|
|
712
|
-
}), _el$
|
|
713
|
-
return _el$
|
|
781
|
+
}), _el$131, _co$29);
|
|
782
|
+
return _el$110;
|
|
714
783
|
}
|
|
715
|
-
}), _el$
|
|
784
|
+
}), _el$141, _co$34);
|
|
716
785
|
effect((_p$) => {
|
|
717
786
|
var _v$0 = isVirtualizing() ? {
|
|
718
787
|
"max-height": "500px",
|
|
719
788
|
"overflow-y": "auto"
|
|
720
789
|
} : {}, _v$1 = tableParams.title || "Data table", _v$10 = tableParams.title ? `${tableId}-title` : void 0;
|
|
721
|
-
_p$.e = style(_el$
|
|
722
|
-
_v$1 !== _p$.t && setAttribute(_el$
|
|
723
|
-
_v$10 !== _p$.a && setAttribute(_el$
|
|
790
|
+
_p$.e = style(_el$70, _v$0, _p$.e);
|
|
791
|
+
_v$1 !== _p$.t && setAttribute(_el$70, "aria-label", _p$.t = _v$1);
|
|
792
|
+
_v$10 !== _p$.a && setAttribute(_el$71, "aria-labelledby", _p$.a = _v$10);
|
|
724
793
|
return _p$;
|
|
725
794
|
}, {
|
|
726
795
|
e: void 0,
|
|
@@ -740,51 +809,51 @@ function MetricRenderer(props) {
|
|
|
740
809
|
return `${title}: ${value}${unit ? " " + unit : ""}`;
|
|
741
810
|
};
|
|
742
811
|
return (() => {
|
|
743
|
-
var _el$
|
|
744
|
-
insert(_el$
|
|
812
|
+
var _el$149 = getNextElement(_tmpl$31), _el$171 = _el$149.firstChild, [_el$172, _co$42] = getNextMarker(_el$171.nextSibling), _el$150 = _el$172.nextSibling, _el$151 = _el$150.firstChild, _el$152 = _el$151.firstChild, _el$153 = _el$152.nextSibling, _el$154 = _el$153.firstChild, _el$156 = _el$154.nextSibling, [_el$157, _co$37] = getNextMarker(_el$156.nextSibling), _el$167 = _el$151.nextSibling, [_el$168, _co$40] = getNextMarker(_el$167.nextSibling), _el$169 = _el$168.nextSibling, [_el$170, _co$41] = getNextMarker(_el$169.nextSibling);
|
|
813
|
+
insert(_el$149, createComponent(CopyButton, {
|
|
745
814
|
getText: getMetricText,
|
|
746
815
|
title: "Copy metric",
|
|
747
816
|
position: "top-right"
|
|
748
|
-
}), _el$
|
|
749
|
-
insert(_el$
|
|
750
|
-
insert(_el$
|
|
751
|
-
insert(_el$
|
|
817
|
+
}), _el$172, _co$42);
|
|
818
|
+
insert(_el$152, () => metricParams.title);
|
|
819
|
+
insert(_el$154, () => metricParams.value);
|
|
820
|
+
insert(_el$153, createComponent(Show, {
|
|
752
821
|
get when() {
|
|
753
822
|
return metricParams.unit;
|
|
754
823
|
},
|
|
755
824
|
get children() {
|
|
756
|
-
var _el$
|
|
757
|
-
insert(_el$
|
|
758
|
-
return _el$
|
|
825
|
+
var _el$155 = getNextElement(_tmpl$28);
|
|
826
|
+
insert(_el$155, () => metricParams.unit);
|
|
827
|
+
return _el$155;
|
|
759
828
|
}
|
|
760
|
-
}), _el$
|
|
761
|
-
insert(_el$
|
|
829
|
+
}), _el$157, _co$37);
|
|
830
|
+
insert(_el$150, createComponent(Show, {
|
|
762
831
|
get when() {
|
|
763
832
|
return metricParams.trend;
|
|
764
833
|
},
|
|
765
834
|
get children() {
|
|
766
|
-
var _el$
|
|
767
|
-
_el$
|
|
768
|
-
insert(_el$
|
|
835
|
+
var _el$158 = getNextElement(_tmpl$29), _el$159 = _el$158.firstChild, _el$162 = _el$159.firstChild, [_el$163, _co$38] = getNextMarker(_el$162.nextSibling), _el$160 = _el$163.nextSibling, _el$164 = _el$160.nextSibling, [_el$165, _co$39] = getNextMarker(_el$164.nextSibling);
|
|
836
|
+
_el$165.nextSibling;
|
|
837
|
+
insert(_el$159, (() => {
|
|
769
838
|
var _c$ = memo(() => metricParams.trend.direction === "up");
|
|
770
839
|
return () => _c$() ? "�" : metricParams.trend.direction === "down" ? "�" : "�";
|
|
771
|
-
})(), _el$
|
|
772
|
-
insert(_el$
|
|
773
|
-
effect(() => className(_el$
|
|
774
|
-
return _el$
|
|
840
|
+
})(), _el$163, _co$38);
|
|
841
|
+
insert(_el$159, () => Math.abs(metricParams.trend.value), _el$165, _co$39);
|
|
842
|
+
effect(() => className(_el$159, `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"}`));
|
|
843
|
+
return _el$158;
|
|
775
844
|
}
|
|
776
|
-
}), _el$
|
|
777
|
-
insert(_el$
|
|
845
|
+
}), _el$168, _co$40);
|
|
846
|
+
insert(_el$150, createComponent(Show, {
|
|
778
847
|
get when() {
|
|
779
848
|
return metricParams.subtitle;
|
|
780
849
|
},
|
|
781
850
|
get children() {
|
|
782
|
-
var _el$
|
|
783
|
-
insert(_el$
|
|
784
|
-
return _el$
|
|
851
|
+
var _el$166 = getNextElement(_tmpl$30);
|
|
852
|
+
insert(_el$166, () => metricParams.subtitle);
|
|
853
|
+
return _el$166;
|
|
785
854
|
}
|
|
786
|
-
}), _el$
|
|
787
|
-
return _el$
|
|
855
|
+
}), _el$170, _co$41);
|
|
856
|
+
return _el$149;
|
|
788
857
|
})();
|
|
789
858
|
}
|
|
790
859
|
function extractImageFromMarkdown(content) {
|
|
@@ -825,62 +894,62 @@ function TextRenderer(props) {
|
|
|
825
894
|
},
|
|
826
895
|
get fallback() {
|
|
827
896
|
return (() => {
|
|
828
|
-
var _el$
|
|
829
|
-
insert(_el$
|
|
897
|
+
var _el$173 = getNextElement(_tmpl$32), _el$175 = _el$173.firstChild, [_el$176, _co$43] = getNextMarker(_el$175.nextSibling), _el$174 = _el$176.nextSibling;
|
|
898
|
+
insert(_el$173, createComponent(CopyButton, {
|
|
830
899
|
getText: getTextContent,
|
|
831
900
|
title: "Copy text",
|
|
832
901
|
position: "top-right"
|
|
833
|
-
}), _el$
|
|
902
|
+
}), _el$176, _co$43);
|
|
834
903
|
effect((_p$) => {
|
|
835
904
|
var _v$14 = `prose prose-sm dark:prose-invert max-w-none ${textParams.className || ""}`, _v$15 = htmlContent();
|
|
836
|
-
_v$14 !== _p$.e && className(_el$
|
|
837
|
-
_v$15 !== _p$.t && setProperty(_el$
|
|
905
|
+
_v$14 !== _p$.e && className(_el$174, _p$.e = _v$14);
|
|
906
|
+
_v$15 !== _p$.t && setProperty(_el$174, "innerHTML", _p$.t = _v$15);
|
|
838
907
|
return _p$;
|
|
839
908
|
}, {
|
|
840
909
|
e: void 0,
|
|
841
910
|
t: void 0
|
|
842
911
|
});
|
|
843
|
-
return _el$
|
|
912
|
+
return _el$173;
|
|
844
913
|
})();
|
|
845
914
|
},
|
|
846
915
|
children: (data) => (() => {
|
|
847
|
-
var _el$
|
|
848
|
-
insert(_el$
|
|
916
|
+
var _el$177 = getNextElement(_tmpl$33), _el$178 = _el$177.firstChild, _el$179 = _el$178.firstChild, _el$180 = _el$179.firstChild, _el$181 = _el$178.nextSibling, _el$182 = _el$181.firstChild;
|
|
917
|
+
insert(_el$182, () => data().credit);
|
|
849
918
|
effect((_p$) => {
|
|
850
919
|
var _v$16 = data().linkUrl, _v$17 = data().imageUrl, _v$18 = data().alt;
|
|
851
|
-
_v$16 !== _p$.e && setAttribute(_el$
|
|
852
|
-
_v$17 !== _p$.t && setAttribute(_el$
|
|
853
|
-
_v$18 !== _p$.a && setAttribute(_el$
|
|
920
|
+
_v$16 !== _p$.e && setAttribute(_el$179, "href", _p$.e = _v$16);
|
|
921
|
+
_v$17 !== _p$.t && setAttribute(_el$180, "src", _p$.t = _v$17);
|
|
922
|
+
_v$18 !== _p$.a && setAttribute(_el$180, "alt", _p$.a = _v$18);
|
|
854
923
|
return _p$;
|
|
855
924
|
}, {
|
|
856
925
|
e: void 0,
|
|
857
926
|
t: void 0,
|
|
858
927
|
a: void 0
|
|
859
928
|
});
|
|
860
|
-
return _el$
|
|
929
|
+
return _el$177;
|
|
861
930
|
})()
|
|
862
931
|
});
|
|
863
932
|
}
|
|
864
933
|
function IframeRenderer(props) {
|
|
865
934
|
const params = props.component.params;
|
|
866
935
|
return (() => {
|
|
867
|
-
var _el$
|
|
868
|
-
insert(_el$
|
|
936
|
+
var _el$183 = getNextElement(_tmpl$35), _el$187 = _el$183.firstChild, [_el$188, _co$44] = getNextMarker(_el$187.nextSibling), _el$186 = _el$188.nextSibling;
|
|
937
|
+
insert(_el$183, createComponent(Show, {
|
|
869
938
|
get when() {
|
|
870
939
|
return params.title;
|
|
871
940
|
},
|
|
872
941
|
get children() {
|
|
873
|
-
var _el$
|
|
874
|
-
insert(_el$
|
|
875
|
-
return _el$
|
|
942
|
+
var _el$184 = getNextElement(_tmpl$34), _el$185 = _el$184.firstChild;
|
|
943
|
+
insert(_el$185, () => params.title);
|
|
944
|
+
return _el$184;
|
|
876
945
|
}
|
|
877
|
-
}), _el$
|
|
946
|
+
}), _el$188, _co$44);
|
|
878
947
|
effect((_p$) => {
|
|
879
948
|
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);
|
|
880
|
-
_v$19 !== _p$.e && setAttribute(_el$
|
|
881
|
-
_v$20 !== _p$.t && setAttribute(_el$
|
|
882
|
-
_p$.a = style(_el$
|
|
883
|
-
_v$22 !== _p$.o && setAttribute(_el$
|
|
949
|
+
_v$19 !== _p$.e && setAttribute(_el$186, "src", _p$.e = _v$19);
|
|
950
|
+
_v$20 !== _p$.t && setAttribute(_el$186, "title", _p$.t = _v$20);
|
|
951
|
+
_p$.a = style(_el$186, _v$21, _p$.a);
|
|
952
|
+
_v$22 !== _p$.o && setAttribute(_el$186, "sandbox", _p$.o = _v$22);
|
|
884
953
|
return _p$;
|
|
885
954
|
}, {
|
|
886
955
|
e: void 0,
|
|
@@ -888,30 +957,30 @@ function IframeRenderer(props) {
|
|
|
888
957
|
a: void 0,
|
|
889
958
|
o: void 0
|
|
890
959
|
});
|
|
891
|
-
return _el$
|
|
960
|
+
return _el$183;
|
|
892
961
|
})();
|
|
893
962
|
}
|
|
894
963
|
function ImageRenderer(props) {
|
|
895
964
|
const params = props.component.params;
|
|
896
965
|
return (() => {
|
|
897
|
-
var _el$
|
|
898
|
-
insert(_el$
|
|
966
|
+
var _el$189 = getNextElement(_tmpl$37), _el$190 = _el$189.firstChild, _el$191 = _el$190.firstChild, _el$192 = _el$191.firstChild, _el$195 = _el$190.nextSibling, [_el$196, _co$45] = getNextMarker(_el$195.nextSibling);
|
|
967
|
+
insert(_el$189, createComponent(Show, {
|
|
899
968
|
get when() {
|
|
900
969
|
return params.caption;
|
|
901
970
|
},
|
|
902
971
|
get children() {
|
|
903
|
-
var _el$
|
|
904
|
-
insert(_el$
|
|
905
|
-
return _el$
|
|
972
|
+
var _el$193 = getNextElement(_tmpl$36), _el$194 = _el$193.firstChild;
|
|
973
|
+
insert(_el$194, () => params.caption);
|
|
974
|
+
return _el$193;
|
|
906
975
|
}
|
|
907
|
-
}), _el$
|
|
976
|
+
}), _el$196, _co$45);
|
|
908
977
|
effect((_p$) => {
|
|
909
978
|
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";
|
|
910
|
-
_v$23 !== _p$.e && className(_el$
|
|
911
|
-
_v$24 !== _p$.t && setAttribute(_el$
|
|
912
|
-
_v$25 !== _p$.a && setAttribute(_el$
|
|
913
|
-
_v$26 !== _p$.o && setAttribute(_el$
|
|
914
|
-
_v$27 !== _p$.i && setAttribute(_el$
|
|
979
|
+
_v$23 !== _p$.e && className(_el$189, _p$.e = _v$23);
|
|
980
|
+
_v$24 !== _p$.t && setAttribute(_el$191, "href", _p$.t = _v$24);
|
|
981
|
+
_v$25 !== _p$.a && setAttribute(_el$191, "aria-label", _p$.a = _v$25);
|
|
982
|
+
_v$26 !== _p$.o && setAttribute(_el$192, "src", _p$.o = _v$26);
|
|
983
|
+
_v$27 !== _p$.i && setAttribute(_el$192, "alt", _p$.i = _v$27);
|
|
915
984
|
return _p$;
|
|
916
985
|
}, {
|
|
917
986
|
e: void 0,
|
|
@@ -920,30 +989,30 @@ function ImageRenderer(props) {
|
|
|
920
989
|
o: void 0,
|
|
921
990
|
i: void 0
|
|
922
991
|
});
|
|
923
|
-
return _el$
|
|
992
|
+
return _el$189;
|
|
924
993
|
})();
|
|
925
994
|
}
|
|
926
995
|
function LinkRenderer(props) {
|
|
927
996
|
const params = props.component.params;
|
|
928
997
|
return (() => {
|
|
929
|
-
var _el$
|
|
930
|
-
_el$
|
|
931
|
-
insert(_el$
|
|
932
|
-
insert(_el$
|
|
998
|
+
var _el$197 = getNextElement(_tmpl$39), _el$198 = _el$197.firstChild, _el$199 = _el$198.nextSibling, _el$200 = _el$199.firstChild, _el$202 = _el$200.nextSibling, [_el$203, _co$46] = getNextMarker(_el$202.nextSibling);
|
|
999
|
+
_el$197.$$click = (e) => e.stopPropagation();
|
|
1000
|
+
insert(_el$200, () => params.label || params.url);
|
|
1001
|
+
insert(_el$199, createComponent(Show, {
|
|
933
1002
|
get when() {
|
|
934
1003
|
return params.description;
|
|
935
1004
|
},
|
|
936
1005
|
get children() {
|
|
937
|
-
var _el$
|
|
938
|
-
insert(_el$
|
|
939
|
-
return _el$
|
|
1006
|
+
var _el$201 = getNextElement(_tmpl$38);
|
|
1007
|
+
insert(_el$201, () => params.description);
|
|
1008
|
+
return _el$201;
|
|
940
1009
|
}
|
|
941
|
-
}), _el$
|
|
1010
|
+
}), _el$203, _co$46);
|
|
942
1011
|
effect((_p$) => {
|
|
943
1012
|
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 || ""}`;
|
|
944
|
-
_v$28 !== _p$.e && setAttribute(_el$
|
|
945
|
-
_v$29 !== _p$.t && setAttribute(_el$
|
|
946
|
-
_v$30 !== _p$.a && className(_el$
|
|
1013
|
+
_v$28 !== _p$.e && setAttribute(_el$197, "href", _p$.e = _v$28);
|
|
1014
|
+
_v$29 !== _p$.t && setAttribute(_el$197, "aria-label", _p$.t = _v$29);
|
|
1015
|
+
_v$30 !== _p$.a && className(_el$197, _p$.a = _v$30);
|
|
947
1016
|
return _p$;
|
|
948
1017
|
}, {
|
|
949
1018
|
e: void 0,
|
|
@@ -951,7 +1020,7 @@ function LinkRenderer(props) {
|
|
|
951
1020
|
a: void 0
|
|
952
1021
|
});
|
|
953
1022
|
runHydrationEvents();
|
|
954
|
-
return _el$
|
|
1023
|
+
return _el$197;
|
|
955
1024
|
})();
|
|
956
1025
|
}
|
|
957
1026
|
function ComponentRenderer(props) {
|
|
@@ -965,12 +1034,12 @@ function ComponentRenderer(props) {
|
|
|
965
1034
|
details: validation.errors
|
|
966
1035
|
});
|
|
967
1036
|
return (() => {
|
|
968
|
-
var _el$
|
|
969
|
-
insert(_el$
|
|
1037
|
+
var _el$204 = getNextElement(_tmpl$40), _el$205 = _el$204.firstChild, _el$206 = _el$205.nextSibling;
|
|
1038
|
+
insert(_el$206, () => {
|
|
970
1039
|
var _a2, _b;
|
|
971
1040
|
return ((_b = (_a2 = validation.errors) == null ? void 0 : _a2[0]) == null ? void 0 : _b.message) || "Unknown validation error";
|
|
972
1041
|
});
|
|
973
|
-
return _el$
|
|
1042
|
+
return _el$204;
|
|
974
1043
|
})();
|
|
975
1044
|
}
|
|
976
1045
|
return createComponent(GenerativeUIErrorBoundary, {
|
|
@@ -1216,27 +1285,27 @@ function ActionRenderer(props) {
|
|
|
1216
1285
|
const isDisabled = () => params.disabled || params.action === "tool-call" && isExecuting();
|
|
1217
1286
|
if (params.type === "link" || params.action === "link") {
|
|
1218
1287
|
return (() => {
|
|
1219
|
-
var _el$
|
|
1220
|
-
_el$
|
|
1221
|
-
insert(_el$
|
|
1288
|
+
var _el$207 = getNextElement(_tmpl$42), _el$209 = _el$207.firstChild, [_el$210, _co$47] = getNextMarker(_el$209.nextSibling), _el$211 = _el$210.nextSibling, [_el$212, _co$48] = getNextMarker(_el$211.nextSibling);
|
|
1289
|
+
_el$207.$$click = handleClick;
|
|
1290
|
+
insert(_el$207, createComponent(Show, {
|
|
1222
1291
|
get when() {
|
|
1223
1292
|
return params.icon;
|
|
1224
1293
|
},
|
|
1225
1294
|
get children() {
|
|
1226
|
-
var _el$
|
|
1227
|
-
insert(_el$
|
|
1228
|
-
return _el$
|
|
1295
|
+
var _el$208 = getNextElement(_tmpl$41);
|
|
1296
|
+
insert(_el$208, () => params.icon);
|
|
1297
|
+
return _el$208;
|
|
1229
1298
|
}
|
|
1230
|
-
}), _el$
|
|
1231
|
-
insert(_el$
|
|
1299
|
+
}), _el$210, _co$47);
|
|
1300
|
+
insert(_el$207, () => params.label, _el$212, _co$48);
|
|
1232
1301
|
effect((_p$) => {
|
|
1233
1302
|
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
|
|
1234
1303
|
${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"}
|
|
1235
1304
|
${params.className || ""}`;
|
|
1236
|
-
_v$31 !== _p$.e && setAttribute(_el$
|
|
1237
|
-
_v$32 !== _p$.t && setAttribute(_el$
|
|
1238
|
-
_v$33 !== _p$.a && setAttribute(_el$
|
|
1239
|
-
_v$34 !== _p$.o && className(_el$
|
|
1305
|
+
_v$31 !== _p$.e && setAttribute(_el$207, "href", _p$.e = _v$31);
|
|
1306
|
+
_v$32 !== _p$.t && setAttribute(_el$207, "target", _p$.t = _v$32);
|
|
1307
|
+
_v$33 !== _p$.a && setAttribute(_el$207, "aria-label", _p$.a = _v$33);
|
|
1308
|
+
_v$34 !== _p$.o && className(_el$207, _p$.o = _v$34);
|
|
1240
1309
|
return _p$;
|
|
1241
1310
|
}, {
|
|
1242
1311
|
e: void 0,
|
|
@@ -1245,42 +1314,42 @@ function ActionRenderer(props) {
|
|
|
1245
1314
|
o: void 0
|
|
1246
1315
|
});
|
|
1247
1316
|
runHydrationEvents();
|
|
1248
|
-
return _el$
|
|
1317
|
+
return _el$207;
|
|
1249
1318
|
})();
|
|
1250
1319
|
}
|
|
1251
1320
|
return (() => {
|
|
1252
|
-
var _el$
|
|
1253
|
-
_el$
|
|
1254
|
-
insert(_el$
|
|
1321
|
+
var _el$213 = getNextElement(_tmpl$44), _el$216 = _el$213.firstChild, [_el$217, _co$49] = getNextMarker(_el$216.nextSibling), _el$218 = _el$217.nextSibling, [_el$219, _co$50] = getNextMarker(_el$218.nextSibling), _el$220 = _el$219.nextSibling, [_el$221, _co$51] = getNextMarker(_el$220.nextSibling);
|
|
1322
|
+
_el$213.$$click = handleClick;
|
|
1323
|
+
insert(_el$213, createComponent(Show, {
|
|
1255
1324
|
get when() {
|
|
1256
1325
|
return memo(() => !!isExecuting())() && params.action === "tool-call";
|
|
1257
1326
|
},
|
|
1258
1327
|
get children() {
|
|
1259
|
-
return getNextElement(_tmpl$
|
|
1328
|
+
return getNextElement(_tmpl$43);
|
|
1260
1329
|
}
|
|
1261
|
-
}), _el$
|
|
1262
|
-
insert(_el$
|
|
1330
|
+
}), _el$217, _co$49);
|
|
1331
|
+
insert(_el$213, createComponent(Show, {
|
|
1263
1332
|
get when() {
|
|
1264
1333
|
return memo(() => !!params.icon)() && !(isExecuting() && params.action === "tool-call");
|
|
1265
1334
|
},
|
|
1266
1335
|
get children() {
|
|
1267
|
-
var _el$
|
|
1268
|
-
insert(_el$
|
|
1269
|
-
return _el$
|
|
1336
|
+
var _el$215 = getNextElement(_tmpl$41);
|
|
1337
|
+
insert(_el$215, () => params.icon);
|
|
1338
|
+
return _el$215;
|
|
1270
1339
|
}
|
|
1271
|
-
}), _el$
|
|
1272
|
-
insert(_el$
|
|
1340
|
+
}), _el$219, _co$50);
|
|
1341
|
+
insert(_el$213, () => params.label, _el$221, _co$51);
|
|
1273
1342
|
effect((_p$) => {
|
|
1274
1343
|
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
|
|
1275
1344
|
${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"}
|
|
1276
1345
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1277
1346
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1278
1347
|
${params.className || ""}`;
|
|
1279
|
-
_v$35 !== _p$.e && setAttribute(_el$
|
|
1280
|
-
_v$36 !== _p$.t && setProperty(_el$
|
|
1281
|
-
_v$37 !== _p$.a && setAttribute(_el$
|
|
1282
|
-
_v$38 !== _p$.o && setAttribute(_el$
|
|
1283
|
-
_v$39 !== _p$.i && className(_el$
|
|
1348
|
+
_v$35 !== _p$.e && setAttribute(_el$213, "type", _p$.e = _v$35);
|
|
1349
|
+
_v$36 !== _p$.t && setProperty(_el$213, "disabled", _p$.t = _v$36);
|
|
1350
|
+
_v$37 !== _p$.a && setAttribute(_el$213, "aria-busy", _p$.a = _v$37);
|
|
1351
|
+
_v$38 !== _p$.o && setAttribute(_el$213, "aria-label", _p$.o = _v$38);
|
|
1352
|
+
_v$39 !== _p$.i && className(_el$213, _p$.i = _v$39);
|
|
1284
1353
|
return _p$;
|
|
1285
1354
|
}, {
|
|
1286
1355
|
e: void 0,
|
|
@@ -1290,7 +1359,7 @@ function ActionRenderer(props) {
|
|
|
1290
1359
|
i: void 0
|
|
1291
1360
|
});
|
|
1292
1361
|
runHydrationEvents();
|
|
1293
|
-
return _el$
|
|
1362
|
+
return _el$213;
|
|
1294
1363
|
})();
|
|
1295
1364
|
}
|
|
1296
1365
|
function ErrorCardRenderer(props) {
|
|
@@ -1298,55 +1367,55 @@ function ErrorCardRenderer(props) {
|
|
|
1298
1367
|
return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
|
|
1299
1368
|
};
|
|
1300
1369
|
return (() => {
|
|
1301
|
-
var _el$
|
|
1302
|
-
insert(_el$
|
|
1370
|
+
var _el$222 = getNextElement(_tmpl$48), _el$245 = _el$222.firstChild, [_el$246, _co$57] = getNextMarker(_el$245.nextSibling), _el$223 = _el$246.nextSibling, _el$224 = _el$223.firstChild, _el$225 = _el$224.nextSibling, _el$226 = _el$225.firstChild, _el$227 = _el$226.firstChild, _el$228 = _el$227.nextSibling, [_el$229, _co$52] = getNextMarker(_el$228.nextSibling), _el$230 = _el$226.nextSibling, _el$239 = _el$230.nextSibling, [_el$240, _co$54] = getNextMarker(_el$239.nextSibling), _el$241 = _el$240.nextSibling, [_el$242, _co$55] = getNextMarker(_el$241.nextSibling), _el$243 = _el$242.nextSibling, [_el$244, _co$56] = getNextMarker(_el$243.nextSibling);
|
|
1371
|
+
insert(_el$222, createComponent(CopyButton, {
|
|
1303
1372
|
getText: getErrorText,
|
|
1304
1373
|
title: "Copy error details",
|
|
1305
1374
|
position: "top-right"
|
|
1306
|
-
}), _el$
|
|
1307
|
-
insert(_el$
|
|
1308
|
-
insert(_el$
|
|
1309
|
-
insert(_el$
|
|
1375
|
+
}), _el$246, _co$57);
|
|
1376
|
+
insert(_el$226, () => props.error.tool || "Unknown", _el$229, _co$52);
|
|
1377
|
+
insert(_el$230, () => props.error.message || "An error occurred during tool execution");
|
|
1378
|
+
insert(_el$225, createComponent(Show, {
|
|
1310
1379
|
get when() {
|
|
1311
1380
|
return props.error.type;
|
|
1312
1381
|
},
|
|
1313
1382
|
get children() {
|
|
1314
|
-
var _el$
|
|
1315
|
-
insert(_el$
|
|
1316
|
-
return _el$
|
|
1383
|
+
var _el$231 = getNextElement(_tmpl$45), _el$232 = _el$231.firstChild, _el$233 = _el$232.nextSibling, [_el$234, _co$53] = getNextMarker(_el$233.nextSibling);
|
|
1384
|
+
insert(_el$231, () => props.error.type, _el$234, _co$53);
|
|
1385
|
+
return _el$231;
|
|
1317
1386
|
}
|
|
1318
|
-
}), _el$
|
|
1319
|
-
insert(_el$
|
|
1387
|
+
}), _el$240, _co$54);
|
|
1388
|
+
insert(_el$225, createComponent(Show, {
|
|
1320
1389
|
get when() {
|
|
1321
1390
|
var _a;
|
|
1322
1391
|
return (_a = props.error.suggestions) == null ? void 0 : _a.length;
|
|
1323
1392
|
},
|
|
1324
1393
|
get children() {
|
|
1325
|
-
var _el$
|
|
1326
|
-
insert(_el$
|
|
1394
|
+
var _el$235 = getNextElement(_tmpl$46), _el$236 = _el$235.firstChild, _el$237 = _el$236.nextSibling;
|
|
1395
|
+
insert(_el$237, createComponent(For, {
|
|
1327
1396
|
get each() {
|
|
1328
1397
|
return props.error.suggestions;
|
|
1329
1398
|
},
|
|
1330
1399
|
children: (suggestion) => (() => {
|
|
1331
|
-
var _el$
|
|
1332
|
-
insert(_el$
|
|
1333
|
-
return _el$
|
|
1400
|
+
var _el$247 = getNextElement(_tmpl$49);
|
|
1401
|
+
insert(_el$247, suggestion);
|
|
1402
|
+
return _el$247;
|
|
1334
1403
|
})()
|
|
1335
1404
|
}));
|
|
1336
|
-
return _el$
|
|
1405
|
+
return _el$235;
|
|
1337
1406
|
}
|
|
1338
|
-
}), _el$
|
|
1339
|
-
insert(_el$
|
|
1407
|
+
}), _el$242, _co$55);
|
|
1408
|
+
insert(_el$225, createComponent(Show, {
|
|
1340
1409
|
get when() {
|
|
1341
1410
|
return props.error.timestamp;
|
|
1342
1411
|
},
|
|
1343
1412
|
get children() {
|
|
1344
|
-
var _el$
|
|
1345
|
-
insert(_el$
|
|
1346
|
-
return _el$
|
|
1413
|
+
var _el$238 = getNextElement(_tmpl$47);
|
|
1414
|
+
insert(_el$238, () => new Date(props.error.timestamp).toLocaleString());
|
|
1415
|
+
return _el$238;
|
|
1347
1416
|
}
|
|
1348
|
-
}), _el$
|
|
1349
|
-
return _el$
|
|
1417
|
+
}), _el$244, _co$56);
|
|
1418
|
+
return _el$222;
|
|
1350
1419
|
})();
|
|
1351
1420
|
}
|
|
1352
1421
|
function isErrorResponse(content) {
|
|
@@ -1369,20 +1438,20 @@ function UIResourceHtmlRenderer(props) {
|
|
|
1369
1438
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
|
|
1370
1439
|
};
|
|
1371
1440
|
return (() => {
|
|
1372
|
-
var _el$
|
|
1373
|
-
insert(_el$
|
|
1441
|
+
var _el$248 = getNextElement(_tmpl$51), _el$252 = _el$248.firstChild, [_el$253, _co$58] = getNextMarker(_el$252.nextSibling), _el$251 = _el$253.nextSibling;
|
|
1442
|
+
insert(_el$248, createComponent(Show, {
|
|
1374
1443
|
get when() {
|
|
1375
1444
|
var _a;
|
|
1376
1445
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
|
|
1377
1446
|
},
|
|
1378
1447
|
get children() {
|
|
1379
|
-
var _el$
|
|
1380
|
-
insert(_el$
|
|
1381
|
-
return _el$
|
|
1448
|
+
var _el$249 = getNextElement(_tmpl$50), _el$250 = _el$249.firstChild;
|
|
1449
|
+
insert(_el$250, resourceTitle);
|
|
1450
|
+
return _el$249;
|
|
1382
1451
|
}
|
|
1383
|
-
}), _el$
|
|
1384
|
-
effect(() => setProperty(_el$
|
|
1385
|
-
return _el$
|
|
1452
|
+
}), _el$253, _co$58);
|
|
1453
|
+
effect(() => setProperty(_el$251, "innerHTML", htmlContent()));
|
|
1454
|
+
return _el$248;
|
|
1386
1455
|
})();
|
|
1387
1456
|
}
|
|
1388
1457
|
const UIResourceRenderer = (props) => {
|
|
@@ -1462,24 +1531,24 @@ const UIResourceRenderer = (props) => {
|
|
|
1462
1531
|
return createComponent(RenderProvider, {
|
|
1463
1532
|
renderComponent,
|
|
1464
1533
|
get children() {
|
|
1465
|
-
var _el$
|
|
1466
|
-
insert(_el$
|
|
1534
|
+
var _el$254 = getNextElement(_tmpl$52), _el$255 = _el$254.firstChild, _el$256 = _el$255.nextSibling, [_el$257, _co$59] = getNextMarker(_el$256.nextSibling);
|
|
1535
|
+
insert(_el$255, createComponent(For, {
|
|
1467
1536
|
get each() {
|
|
1468
1537
|
return layoutData.components;
|
|
1469
1538
|
},
|
|
1470
1539
|
children: (component) => (() => {
|
|
1471
|
-
var _el$
|
|
1472
|
-
insert(_el$
|
|
1540
|
+
var _el$258 = getNextElement(_tmpl$53);
|
|
1541
|
+
insert(_el$258, createComponent(ComponentRenderer, {
|
|
1473
1542
|
component,
|
|
1474
1543
|
get onError() {
|
|
1475
1544
|
return props.onError;
|
|
1476
1545
|
}
|
|
1477
1546
|
}));
|
|
1478
|
-
effect((_$p) => style(_el$
|
|
1479
|
-
return _el$
|
|
1547
|
+
effect((_$p) => style(_el$258, getGridStyleString(component), _$p));
|
|
1548
|
+
return _el$258;
|
|
1480
1549
|
})()
|
|
1481
1550
|
}));
|
|
1482
|
-
insert(_el$
|
|
1551
|
+
insert(_el$254, createComponent(Show, {
|
|
1483
1552
|
get when() {
|
|
1484
1553
|
return shouldShowAutoFooter();
|
|
1485
1554
|
},
|
|
@@ -1490,21 +1559,21 @@ const UIResourceRenderer = (props) => {
|
|
|
1490
1559
|
}
|
|
1491
1560
|
});
|
|
1492
1561
|
}
|
|
1493
|
-
}), _el$
|
|
1562
|
+
}), _el$257, _co$59);
|
|
1494
1563
|
effect((_p$) => {
|
|
1495
1564
|
var _v$40 = `w-full ${props.class || ""}`, _v$41 = gridContainerStyle();
|
|
1496
|
-
_v$40 !== _p$.e && className(_el$
|
|
1497
|
-
_p$.t = style(_el$
|
|
1565
|
+
_v$40 !== _p$.e && className(_el$254, _p$.e = _v$40);
|
|
1566
|
+
_p$.t = style(_el$255, _v$41, _p$.t);
|
|
1498
1567
|
return _p$;
|
|
1499
1568
|
}, {
|
|
1500
1569
|
e: void 0,
|
|
1501
1570
|
t: void 0
|
|
1502
1571
|
});
|
|
1503
|
-
return _el$
|
|
1572
|
+
return _el$254;
|
|
1504
1573
|
}
|
|
1505
1574
|
});
|
|
1506
1575
|
};
|
|
1507
|
-
delegateEvents(["click"]);
|
|
1576
|
+
delegateEvents(["click", "input"]);
|
|
1508
1577
|
export {
|
|
1509
1578
|
UIResourceRenderer,
|
|
1510
1579
|
renderCellValue
|