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