@seed-ship/mcp-ui-solid 2.2.8 → 2.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/UIResourceRenderer.cjs +313 -302
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +313 -302
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/services/validation.cjs +12 -0
- package/dist/services/validation.cjs.map +1 -1
- package/dist/services/validation.d.ts.map +1 -1
- package/dist/services/validation.js +12 -0
- package/dist/services/validation.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChartRenderer.test.tsx +43 -0
- package/src/components/UIResourceRenderer.tsx +59 -49
- package/src/services/validation.test.ts +40 -2
- package/src/services/validation.ts +16 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -21,7 +21,7 @@ const ExpandableWrapper = require("./ExpandableWrapper.cjs");
|
|
|
21
21
|
const RenderContext = require("./RenderContext.cjs");
|
|
22
22
|
const useAction = require("../hooks/useAction.cjs");
|
|
23
23
|
const marked_esm = require("../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.cjs");
|
|
24
|
-
var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="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$5 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$6 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$7 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$8 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$9 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$0 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$1 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$10 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$11 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Copy TSV`), _tmpl$12 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download CSV`), _tmpl$13 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download JSON`), _tmpl$14 = /* @__PURE__ */ web.template(`<div class="absolute right-0 mt-1 w-36 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm"><!$><!/><!$><!/><!$><!/>`), _tmpl$15 = /* @__PURE__ */ web.template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"title="Export table"aria-label="Export table"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$16 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$17 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$18 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$19 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group"><!$><!/><div class=p-4><!$><!/><div class=overflow-x-auto role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-50 dark:bg-gray-900/50 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/>`), _tmpl$20 = /* @__PURE__ */ web.template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-50 dark:bg-gray-900/50">`), _tmpl$21 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$22 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$23 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$24 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$25 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$26 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$27 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$28 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"sandbox="allow-scripts allow-same-origin allow-popups allow-forms"loading=lazy>`, true, false, false), _tmpl$29 = /* @__PURE__ */ web.template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$30 = /* @__PURE__ */ web.template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$31 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$32 = /* @__PURE__ */ web.template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$33 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$34 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$35 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$36 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$37 = /* @__PURE__ */ web.template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$38 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$39 = /* @__PURE__ */ web.template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$40 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$41 = /* @__PURE__ */ web.template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$42 = /* @__PURE__ */ web.template(`<li>`), _tmpl$43 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$44 = /* @__PURE__ */ web.template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$45 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$46 = /* @__PURE__ */ web.template(`<div>`);
|
|
24
|
+
var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700"><p class="text-red-500 dark:text-red-400 text-sm">Invalid chart data: missing data.datasets`), _tmpl$5 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$6 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$7 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$9 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$0 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$10 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$11 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Copy TSV`), _tmpl$13 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download CSV`), _tmpl$14 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download JSON`), _tmpl$15 = /* @__PURE__ */ web.template(`<div class="absolute right-0 mt-1 w-36 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm"><!$><!/><!$><!/><!$><!/>`), _tmpl$16 = /* @__PURE__ */ web.template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"title="Export table"aria-label="Export table"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$17 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$18 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$20 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group"><!$><!/><div class=p-4><!$><!/><div class=overflow-x-auto role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-50 dark:bg-gray-900/50 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/>`), _tmpl$21 = /* @__PURE__ */ web.template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-50 dark:bg-gray-900/50">`), _tmpl$22 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$23 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$24 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$25 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$26 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$27 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$28 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$29 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"sandbox="allow-scripts allow-same-origin allow-popups allow-forms"loading=lazy>`, true, false, false), _tmpl$30 = /* @__PURE__ */ web.template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$31 = /* @__PURE__ */ web.template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$32 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$33 = /* @__PURE__ */ web.template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$34 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$35 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$36 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$37 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$38 = /* @__PURE__ */ web.template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$39 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$40 = /* @__PURE__ */ web.template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$41 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$42 = /* @__PURE__ */ web.template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$43 = /* @__PURE__ */ web.template(`<li>`), _tmpl$44 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$45 = /* @__PURE__ */ web.template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$46 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$47 = /* @__PURE__ */ web.template(`<div>`);
|
|
25
25
|
function CopyButton(props) {
|
|
26
26
|
const [copied, setCopied] = solidJs.createSignal(false);
|
|
27
27
|
const handleCopy = async () => {
|
|
@@ -64,15 +64,19 @@ function CopyButton(props) {
|
|
|
64
64
|
})();
|
|
65
65
|
}
|
|
66
66
|
function ChartRenderer(props) {
|
|
67
|
+
var _a, _b;
|
|
67
68
|
const [useNative, setUseNative] = solidJs.createSignal(false);
|
|
68
69
|
const [iframeUrl, setIframeUrl] = solidJs.createSignal();
|
|
69
70
|
const [isLoading, setIsLoading] = solidJs.createSignal(true);
|
|
70
71
|
const [error, setError] = solidJs.createSignal();
|
|
71
72
|
const params = () => props.component.params;
|
|
72
73
|
const rendererPref = () => {
|
|
73
|
-
var
|
|
74
|
-
return ((
|
|
74
|
+
var _a2;
|
|
75
|
+
return ((_a2 = params()) == null ? void 0 : _a2.renderer) || "auto";
|
|
75
76
|
};
|
|
77
|
+
if (!((_b = (_a = params()) == null ? void 0 : _a.data) == null ? void 0 : _b.datasets)) {
|
|
78
|
+
return web.getNextElement(_tmpl$4);
|
|
79
|
+
}
|
|
76
80
|
solidJs.createEffect(async () => {
|
|
77
81
|
const pref = rendererPref();
|
|
78
82
|
if (pref === "iframe") {
|
|
@@ -115,87 +119,94 @@ function ChartRenderer(props) {
|
|
|
115
119
|
setIframeUrl(url);
|
|
116
120
|
setIsLoading(false);
|
|
117
121
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
get when() {
|
|
145
|
-
return error();
|
|
146
|
-
},
|
|
147
|
-
get children() {
|
|
148
|
-
var _el$6 = web.getNextElement(_tmpl$5), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling;
|
|
149
|
-
web.insert(_el$9, error);
|
|
150
|
-
return _el$6;
|
|
151
|
-
}
|
|
152
|
-
}), _el$17, _co$3);
|
|
153
|
-
web.insert(_el$4, web.createComponent(solidJs.Show, {
|
|
154
|
-
get when() {
|
|
155
|
-
return web.memo(() => !!iframeUrl())() && !error();
|
|
156
|
-
},
|
|
157
|
-
get children() {
|
|
158
|
-
var _el$0 = web.getNextElement(_tmpl$7), _el$12 = _el$0.firstChild, [_el$13, _co$] = web.getNextMarker(_el$12.nextSibling), _el$10 = _el$13.nextSibling, _el$11 = _el$10.firstChild;
|
|
159
|
-
web.insert(_el$0, web.createComponent(solidJs.Show, {
|
|
122
|
+
return web.createComponent(solidJs.Show, {
|
|
123
|
+
get when() {
|
|
124
|
+
return useNative();
|
|
125
|
+
},
|
|
126
|
+
get fallback() {
|
|
127
|
+
return (() => {
|
|
128
|
+
var _el$5 = web.getNextElement(_tmpl$9), _el$15 = _el$5.firstChild, [_el$16, _co$2] = web.getNextMarker(_el$15.nextSibling), _el$17 = _el$16.nextSibling, [_el$18, _co$3] = web.getNextMarker(_el$17.nextSibling), _el$19 = _el$18.nextSibling, [_el$20, _co$4] = web.getNextMarker(_el$19.nextSibling);
|
|
129
|
+
web.insert(_el$5, web.createComponent(solidJs.Show, {
|
|
130
|
+
get when() {
|
|
131
|
+
return isLoading();
|
|
132
|
+
},
|
|
133
|
+
get children() {
|
|
134
|
+
return web.getNextElement(_tmpl$5);
|
|
135
|
+
}
|
|
136
|
+
}), _el$16, _co$2);
|
|
137
|
+
web.insert(_el$5, web.createComponent(solidJs.Show, {
|
|
138
|
+
get when() {
|
|
139
|
+
return error();
|
|
140
|
+
},
|
|
141
|
+
get children() {
|
|
142
|
+
var _el$7 = web.getNextElement(_tmpl$6), _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
|
|
143
|
+
web.insert(_el$0, error);
|
|
144
|
+
return _el$7;
|
|
145
|
+
}
|
|
146
|
+
}), _el$18, _co$3);
|
|
147
|
+
web.insert(_el$5, web.createComponent(solidJs.Show, {
|
|
160
148
|
get when() {
|
|
161
|
-
|
|
162
|
-
return (_a = params()) == null ? void 0 : _a.title;
|
|
149
|
+
return web.memo(() => !!iframeUrl())() && !error();
|
|
163
150
|
},
|
|
164
151
|
get children() {
|
|
165
|
-
var _el$1 = web.getNextElement(_tmpl$
|
|
166
|
-
web.insert(_el$1, (
|
|
167
|
-
|
|
168
|
-
|
|
152
|
+
var _el$1 = web.getNextElement(_tmpl$8), _el$13 = _el$1.firstChild, [_el$14, _co$] = web.getNextMarker(_el$13.nextSibling), _el$11 = _el$14.nextSibling, _el$12 = _el$11.firstChild;
|
|
153
|
+
web.insert(_el$1, web.createComponent(solidJs.Show, {
|
|
154
|
+
get when() {
|
|
155
|
+
var _a2;
|
|
156
|
+
return (_a2 = params()) == null ? void 0 : _a2.title;
|
|
157
|
+
},
|
|
158
|
+
get children() {
|
|
159
|
+
var _el$10 = web.getNextElement(_tmpl$7);
|
|
160
|
+
web.insert(_el$10, () => {
|
|
161
|
+
var _a2;
|
|
162
|
+
return (_a2 = params()) == null ? void 0 : _a2.title;
|
|
163
|
+
});
|
|
164
|
+
return _el$10;
|
|
165
|
+
}
|
|
166
|
+
}), _el$14, _co$);
|
|
167
|
+
_el$12.addEventListener("error", () => {
|
|
168
|
+
var _a2;
|
|
169
|
+
setError("Failed to load chart");
|
|
170
|
+
(_a2 = props.onError) == null ? void 0 : _a2.call(props, {
|
|
171
|
+
type: "render",
|
|
172
|
+
message: "Chart rendering failed",
|
|
173
|
+
componentId: props.component.id
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
web.effect((_p$) => {
|
|
177
|
+
var _a2, _b2, _c, _d;
|
|
178
|
+
var _v$3 = ((_a2 = params()) == null ? void 0 : _a2.title) ? `Chart: ${(_b2 = params()) == null ? void 0 : _b2.title}` : "Chart visualization", _v$4 = iframeUrl(), _v$5 = ((_c = params()) == null ? void 0 : _c.title) ? `Chart: ${(_d = params()) == null ? void 0 : _d.title}` : "Chart visualization";
|
|
179
|
+
_v$3 !== _p$.e && web.setAttribute(_el$11, "aria-label", _p$.e = _v$3);
|
|
180
|
+
_v$4 !== _p$.t && web.setAttribute(_el$12, "src", _p$.t = _v$4);
|
|
181
|
+
_v$5 !== _p$.a && web.setAttribute(_el$12, "alt", _p$.a = _v$5);
|
|
182
|
+
return _p$;
|
|
183
|
+
}, {
|
|
184
|
+
e: void 0,
|
|
185
|
+
t: void 0,
|
|
186
|
+
a: void 0
|
|
169
187
|
});
|
|
170
188
|
return _el$1;
|
|
171
189
|
}
|
|
172
|
-
}), _el$
|
|
173
|
-
_el$
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
190
|
+
}), _el$20, _co$4);
|
|
191
|
+
return _el$5;
|
|
192
|
+
})();
|
|
193
|
+
},
|
|
194
|
+
get children() {
|
|
195
|
+
return web.createComponent(ChartJSRenderer.ChartJSRenderer, {
|
|
196
|
+
get component() {
|
|
197
|
+
return props.component;
|
|
198
|
+
},
|
|
199
|
+
onError: (err) => {
|
|
200
|
+
var _a2;
|
|
201
|
+
return (_a2 = props.onError) == null ? void 0 : _a2.call(props, {
|
|
177
202
|
type: "render",
|
|
178
|
-
message:
|
|
203
|
+
message: err.message,
|
|
179
204
|
componentId: props.component.id
|
|
180
205
|
});
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
_v$3 !== _p$.e && web.setAttribute(_el$10, "aria-label", _p$.e = _v$3);
|
|
186
|
-
_v$4 !== _p$.t && web.setAttribute(_el$11, "src", _p$.t = _v$4);
|
|
187
|
-
_v$5 !== _p$.a && web.setAttribute(_el$11, "alt", _p$.a = _v$5);
|
|
188
|
-
return _p$;
|
|
189
|
-
}, {
|
|
190
|
-
e: void 0,
|
|
191
|
-
t: void 0,
|
|
192
|
-
a: void 0
|
|
193
|
-
});
|
|
194
|
-
return _el$0;
|
|
195
|
-
}
|
|
196
|
-
}), _el$19, _co$4);
|
|
197
|
-
return _el$4;
|
|
198
|
-
})();
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
});
|
|
199
210
|
}
|
|
200
211
|
function renderCellValue(value) {
|
|
201
212
|
if (value === null || value === void 0) {
|
|
@@ -372,28 +383,28 @@ ${dataRows}`;
|
|
|
372
383
|
};
|
|
373
384
|
const tableId = `table-${Math.random().toString(36).slice(2, 9)}`;
|
|
374
385
|
const StandardTableBody = () => (() => {
|
|
375
|
-
var _el$
|
|
376
|
-
web.insert(_el$
|
|
386
|
+
var _el$21 = web.getNextElement(_tmpl$0);
|
|
387
|
+
web.insert(_el$21, web.createComponent(solidJs.For, {
|
|
377
388
|
get each() {
|
|
378
389
|
return tableParams.rows.slice(0, validation.DEFAULT_RESOURCE_LIMITS.maxTableRows);
|
|
379
390
|
},
|
|
380
391
|
children: (row, i) => (() => {
|
|
381
|
-
var _el$
|
|
382
|
-
web.insert(_el$
|
|
392
|
+
var _el$22 = web.getNextElement(_tmpl$1);
|
|
393
|
+
web.insert(_el$22, web.createComponent(solidJs.For, {
|
|
383
394
|
get each() {
|
|
384
395
|
return tableParams.columns;
|
|
385
396
|
},
|
|
386
397
|
children: (column) => (() => {
|
|
387
|
-
var _el$
|
|
388
|
-
web.effect(() => web.setProperty(_el$
|
|
389
|
-
return _el$
|
|
398
|
+
var _el$23 = web.getNextElement(_tmpl$10), _el$24 = _el$23.firstChild;
|
|
399
|
+
web.effect(() => web.setProperty(_el$24, "innerHTML", renderCellValue(row[column.key])));
|
|
400
|
+
return _el$23;
|
|
390
401
|
})()
|
|
391
402
|
}));
|
|
392
|
-
web.effect(() => web.className(_el$
|
|
393
|
-
return _el$
|
|
403
|
+
web.effect(() => web.className(_el$22, `hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors ${i() % 2 === 0 ? "bg-white dark:bg-gray-800" : "bg-gray-50/30 dark:bg-gray-800/50"}`));
|
|
404
|
+
return _el$22;
|
|
394
405
|
})()
|
|
395
406
|
}));
|
|
396
|
-
return _el$
|
|
407
|
+
return _el$21;
|
|
397
408
|
})();
|
|
398
409
|
const VirtualizedTableBody = () => {
|
|
399
410
|
const v = virtualizer();
|
|
@@ -403,39 +414,39 @@ ${dataRows}`;
|
|
|
403
414
|
const opts = virtualizeOpts();
|
|
404
415
|
const rowHeight = opts.rowHeight ?? 48;
|
|
405
416
|
return (() => {
|
|
406
|
-
var _el$
|
|
407
|
-
web.setStyleProperty(_el$
|
|
408
|
-
web.insert(_el$
|
|
417
|
+
var _el$25 = web.getNextElement(_tmpl$11);
|
|
418
|
+
web.setStyleProperty(_el$25, "height", `${totalSize}px`);
|
|
419
|
+
web.insert(_el$25, web.createComponent(solidJs.For, {
|
|
409
420
|
each: items,
|
|
410
421
|
children: (virtualRow) => {
|
|
411
422
|
const row = tableParams.rows[virtualRow.index];
|
|
412
423
|
return (() => {
|
|
413
|
-
var _el$
|
|
414
|
-
web.setStyleProperty(_el$
|
|
415
|
-
web.insert(_el$
|
|
424
|
+
var _el$26 = web.getNextElement(_tmpl$1);
|
|
425
|
+
web.setStyleProperty(_el$26, "height", `${rowHeight}px`);
|
|
426
|
+
web.insert(_el$26, web.createComponent(solidJs.For, {
|
|
416
427
|
get each() {
|
|
417
428
|
return tableParams.columns;
|
|
418
429
|
},
|
|
419
430
|
children: (column) => (() => {
|
|
420
|
-
var _el$
|
|
421
|
-
web.effect(() => web.setProperty(_el$
|
|
422
|
-
return _el$
|
|
431
|
+
var _el$27 = web.getNextElement(_tmpl$10), _el$28 = _el$27.firstChild;
|
|
432
|
+
web.effect(() => web.setProperty(_el$28, "innerHTML", renderCellValue(row[column.key])));
|
|
433
|
+
return _el$27;
|
|
423
434
|
})()
|
|
424
435
|
}));
|
|
425
436
|
web.effect((_p$) => {
|
|
426
437
|
var _v$6 = `hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors absolute left-0 right-0 ${virtualRow.index % 2 === 0 ? "bg-white dark:bg-gray-800" : "bg-gray-50/30 dark:bg-gray-800/50"}`, _v$7 = `translateY(${virtualRow.start}px)`;
|
|
427
|
-
_v$6 !== _p$.e && web.className(_el$
|
|
428
|
-
_v$7 !== _p$.t && web.setStyleProperty(_el$
|
|
438
|
+
_v$6 !== _p$.e && web.className(_el$26, _p$.e = _v$6);
|
|
439
|
+
_v$7 !== _p$.t && web.setStyleProperty(_el$26, "transform", _p$.t = _v$7);
|
|
429
440
|
return _p$;
|
|
430
441
|
}, {
|
|
431
442
|
e: void 0,
|
|
432
443
|
t: void 0
|
|
433
444
|
});
|
|
434
|
-
return _el$
|
|
445
|
+
return _el$26;
|
|
435
446
|
})();
|
|
436
447
|
}
|
|
437
448
|
}));
|
|
438
|
-
return _el$
|
|
449
|
+
return _el$25;
|
|
439
450
|
})();
|
|
440
451
|
};
|
|
441
452
|
return web.createComponent(ExpandableWrapper.ExpandableWrapper, {
|
|
@@ -447,8 +458,8 @@ ${dataRows}`;
|
|
|
447
458
|
},
|
|
448
459
|
copyLabel: "Copy table (TSV)",
|
|
449
460
|
get children() {
|
|
450
|
-
var _el$
|
|
451
|
-
web.insert(_el$
|
|
461
|
+
var _el$29 = web.getNextElement(_tmpl$20), _el$78 = _el$29.firstChild, [_el$79, _co$16] = web.getNextMarker(_el$78.nextSibling), _el$44 = _el$79.nextSibling, _el$74 = _el$44.firstChild, [_el$75, _co$14] = web.getNextMarker(_el$74.nextSibling), _el$55 = _el$75.nextSibling, _el$56 = _el$55.firstChild, _el$57 = _el$56.firstChild, _el$58 = _el$57.firstChild, _el$59 = _el$57.nextSibling, [_el$60, _co$10] = web.getNextMarker(_el$59.nextSibling), _el$76 = _el$55.nextSibling, [_el$77, _co$15] = web.getNextMarker(_el$76.nextSibling);
|
|
462
|
+
web.insert(_el$29, web.createComponent(solidJs.Show, {
|
|
452
463
|
when: exportable,
|
|
453
464
|
get fallback() {
|
|
454
465
|
return web.createComponent(CopyButton, {
|
|
@@ -458,95 +469,95 @@ ${dataRows}`;
|
|
|
458
469
|
});
|
|
459
470
|
},
|
|
460
471
|
get children() {
|
|
461
|
-
var _el$
|
|
462
|
-
_el$
|
|
463
|
-
web.insert(_el$
|
|
472
|
+
var _el$30 = web.getNextElement(_tmpl$16), _el$31 = _el$30.firstChild, _el$42 = _el$31.nextSibling, [_el$43, _co$8] = web.getNextMarker(_el$42.nextSibling);
|
|
473
|
+
_el$31.$$click = () => setShowExportMenu(!showExportMenu());
|
|
474
|
+
web.insert(_el$30, web.createComponent(solidJs.Show, {
|
|
464
475
|
get when() {
|
|
465
476
|
return showExportMenu();
|
|
466
477
|
},
|
|
467
478
|
get children() {
|
|
468
|
-
var _el$
|
|
469
|
-
web.insert(_el$
|
|
479
|
+
var _el$32 = web.getNextElement(_tmpl$15), _el$36 = _el$32.firstChild, [_el$37, _co$5] = web.getNextMarker(_el$36.nextSibling), _el$38 = _el$37.nextSibling, [_el$39, _co$6] = web.getNextMarker(_el$38.nextSibling), _el$40 = _el$39.nextSibling, [_el$41, _co$7] = web.getNextMarker(_el$40.nextSibling);
|
|
480
|
+
web.insert(_el$32, web.createComponent(solidJs.Show, {
|
|
470
481
|
get when() {
|
|
471
482
|
return exportFormats.includes("tsv");
|
|
472
483
|
},
|
|
473
484
|
get children() {
|
|
474
|
-
var _el$
|
|
475
|
-
_el$
|
|
485
|
+
var _el$33 = web.getNextElement(_tmpl$12);
|
|
486
|
+
_el$33.$$click = () => handleExport("tsv");
|
|
476
487
|
web.runHydrationEvents();
|
|
477
|
-
return _el$
|
|
488
|
+
return _el$33;
|
|
478
489
|
}
|
|
479
|
-
}), _el$
|
|
480
|
-
web.insert(_el$
|
|
490
|
+
}), _el$37, _co$5);
|
|
491
|
+
web.insert(_el$32, web.createComponent(solidJs.Show, {
|
|
481
492
|
get when() {
|
|
482
493
|
return exportFormats.includes("csv");
|
|
483
494
|
},
|
|
484
495
|
get children() {
|
|
485
|
-
var _el$
|
|
486
|
-
_el$
|
|
496
|
+
var _el$34 = web.getNextElement(_tmpl$13);
|
|
497
|
+
_el$34.$$click = () => handleExport("csv");
|
|
487
498
|
web.runHydrationEvents();
|
|
488
|
-
return _el$
|
|
499
|
+
return _el$34;
|
|
489
500
|
}
|
|
490
|
-
}), _el$
|
|
491
|
-
web.insert(_el$
|
|
501
|
+
}), _el$39, _co$6);
|
|
502
|
+
web.insert(_el$32, web.createComponent(solidJs.Show, {
|
|
492
503
|
get when() {
|
|
493
504
|
return exportFormats.includes("json");
|
|
494
505
|
},
|
|
495
506
|
get children() {
|
|
496
|
-
var _el$
|
|
497
|
-
_el$
|
|
507
|
+
var _el$35 = web.getNextElement(_tmpl$14);
|
|
508
|
+
_el$35.$$click = () => handleExport("json");
|
|
498
509
|
web.runHydrationEvents();
|
|
499
|
-
return _el$
|
|
510
|
+
return _el$35;
|
|
500
511
|
}
|
|
501
|
-
}), _el$
|
|
502
|
-
return _el$
|
|
512
|
+
}), _el$41, _co$7);
|
|
513
|
+
return _el$32;
|
|
503
514
|
}
|
|
504
|
-
}), _el$
|
|
515
|
+
}), _el$43, _co$8);
|
|
505
516
|
web.runHydrationEvents();
|
|
506
|
-
return _el$
|
|
517
|
+
return _el$30;
|
|
507
518
|
}
|
|
508
|
-
}), _el$
|
|
509
|
-
web.insert(_el$
|
|
519
|
+
}), _el$79, _co$16);
|
|
520
|
+
web.insert(_el$44, web.createComponent(solidJs.Show, {
|
|
510
521
|
get when() {
|
|
511
522
|
return tableParams.title;
|
|
512
523
|
},
|
|
513
524
|
get children() {
|
|
514
|
-
var _el$
|
|
515
|
-
web.setAttribute(_el$
|
|
516
|
-
web.insert(_el$
|
|
517
|
-
web.insert(_el$
|
|
525
|
+
var _el$45 = web.getNextElement(_tmpl$18), _el$51 = _el$45.firstChild, [_el$52, _co$0] = web.getNextMarker(_el$51.nextSibling), _el$53 = _el$52.nextSibling, [_el$54, _co$1] = web.getNextMarker(_el$53.nextSibling);
|
|
526
|
+
web.setAttribute(_el$45, "id", `${tableId}-title`);
|
|
527
|
+
web.insert(_el$45, () => tableParams.title, _el$52, _co$0);
|
|
528
|
+
web.insert(_el$45, web.createComponent(solidJs.Show, {
|
|
518
529
|
get when() {
|
|
519
530
|
return isVirtualizing();
|
|
520
531
|
},
|
|
521
532
|
get children() {
|
|
522
|
-
var _el$
|
|
523
|
-
_el$
|
|
524
|
-
web.insert(_el$
|
|
533
|
+
var _el$46 = web.getNextElement(_tmpl$17), _el$47 = _el$46.firstChild, _el$49 = _el$47.nextSibling, [_el$50, _co$9] = web.getNextMarker(_el$49.nextSibling);
|
|
534
|
+
_el$50.nextSibling;
|
|
535
|
+
web.insert(_el$46, () => {
|
|
525
536
|
var _a;
|
|
526
537
|
return (_a = tableParams.rows) == null ? void 0 : _a.length;
|
|
527
|
-
}, _el$
|
|
528
|
-
return _el$
|
|
538
|
+
}, _el$50, _co$9);
|
|
539
|
+
return _el$46;
|
|
529
540
|
}
|
|
530
|
-
}), _el$
|
|
531
|
-
return _el$
|
|
541
|
+
}), _el$54, _co$1);
|
|
542
|
+
return _el$45;
|
|
532
543
|
}
|
|
533
|
-
}), _el$
|
|
544
|
+
}), _el$75, _co$14);
|
|
534
545
|
var _ref$ = scrollContainerRef;
|
|
535
|
-
typeof _ref$ === "function" ? web.use(_ref$, _el$
|
|
536
|
-
web.insert(_el$
|
|
546
|
+
typeof _ref$ === "function" ? web.use(_ref$, _el$55) : scrollContainerRef = _el$55;
|
|
547
|
+
web.insert(_el$58, web.createComponent(solidJs.For, {
|
|
537
548
|
get each() {
|
|
538
549
|
return tableParams.columns;
|
|
539
550
|
},
|
|
540
551
|
children: (column) => (() => {
|
|
541
|
-
var _el$
|
|
542
|
-
web.insert(_el$
|
|
543
|
-
web.effect((_$p) => web.style(_el$
|
|
552
|
+
var _el$80 = web.getNextElement(_tmpl$21);
|
|
553
|
+
web.insert(_el$80, () => column.label);
|
|
554
|
+
web.effect((_$p) => web.style(_el$80, column.width ? {
|
|
544
555
|
width: column.width
|
|
545
556
|
} : {}, _$p));
|
|
546
|
-
return _el$
|
|
557
|
+
return _el$80;
|
|
547
558
|
})()
|
|
548
559
|
}));
|
|
549
|
-
web.insert(_el$
|
|
560
|
+
web.insert(_el$56, web.createComponent(solidJs.Show, {
|
|
550
561
|
get when() {
|
|
551
562
|
return isVirtualizing();
|
|
552
563
|
},
|
|
@@ -556,34 +567,34 @@ ${dataRows}`;
|
|
|
556
567
|
get children() {
|
|
557
568
|
return web.createComponent(VirtualizedTableBody, {});
|
|
558
569
|
}
|
|
559
|
-
}), _el$
|
|
560
|
-
web.insert(_el$
|
|
570
|
+
}), _el$60, _co$10);
|
|
571
|
+
web.insert(_el$44, web.createComponent(solidJs.Show, {
|
|
561
572
|
get when() {
|
|
562
573
|
return tableParams.pagination;
|
|
563
574
|
},
|
|
564
575
|
get children() {
|
|
565
|
-
var _el$
|
|
566
|
-
web.insert(_el$
|
|
567
|
-
web.insert(_el$
|
|
568
|
-
web.insert(_el$
|
|
569
|
-
return _el$
|
|
576
|
+
var _el$61 = web.getNextElement(_tmpl$19), _el$62 = _el$61.firstChild, _el$63 = _el$62.firstChild, _el$68 = _el$63.nextSibling, [_el$69, _co$11] = web.getNextMarker(_el$68.nextSibling), _el$64 = _el$69.nextSibling, _el$70 = _el$64.nextSibling, [_el$71, _co$12] = web.getNextMarker(_el$70.nextSibling), _el$66 = _el$71.nextSibling, _el$72 = _el$66.nextSibling, [_el$73, _co$13] = web.getNextMarker(_el$72.nextSibling);
|
|
577
|
+
web.insert(_el$62, () => tableParams.pagination.currentPage * tableParams.pagination.pageSize + 1, _el$69, _co$11);
|
|
578
|
+
web.insert(_el$62, () => Math.min((tableParams.pagination.currentPage + 1) * tableParams.pagination.pageSize, tableParams.pagination.totalRows), _el$71, _co$12);
|
|
579
|
+
web.insert(_el$62, () => tableParams.pagination.totalRows, _el$73, _co$13);
|
|
580
|
+
return _el$61;
|
|
570
581
|
}
|
|
571
|
-
}), _el$
|
|
582
|
+
}), _el$77, _co$15);
|
|
572
583
|
web.effect((_p$) => {
|
|
573
584
|
var _v$8 = isVirtualizing() ? {
|
|
574
585
|
"max-height": "500px",
|
|
575
586
|
"overflow-y": "auto"
|
|
576
587
|
} : {}, _v$9 = tableParams.title || "Data table", _v$0 = tableParams.title ? `${tableId}-title` : void 0;
|
|
577
|
-
_p$.e = web.style(_el$
|
|
578
|
-
_v$9 !== _p$.t && web.setAttribute(_el$
|
|
579
|
-
_v$0 !== _p$.a && web.setAttribute(_el$
|
|
588
|
+
_p$.e = web.style(_el$55, _v$8, _p$.e);
|
|
589
|
+
_v$9 !== _p$.t && web.setAttribute(_el$55, "aria-label", _p$.t = _v$9);
|
|
590
|
+
_v$0 !== _p$.a && web.setAttribute(_el$56, "aria-labelledby", _p$.a = _v$0);
|
|
580
591
|
return _p$;
|
|
581
592
|
}, {
|
|
582
593
|
e: void 0,
|
|
583
594
|
t: void 0,
|
|
584
595
|
a: void 0
|
|
585
596
|
});
|
|
586
|
-
return _el$
|
|
597
|
+
return _el$29;
|
|
587
598
|
}
|
|
588
599
|
});
|
|
589
600
|
}
|
|
@@ -596,51 +607,51 @@ function MetricRenderer(props) {
|
|
|
596
607
|
return `${title}: ${value}${unit ? " " + unit : ""}`;
|
|
597
608
|
};
|
|
598
609
|
return (() => {
|
|
599
|
-
var _el$
|
|
600
|
-
web.insert(_el$
|
|
610
|
+
var _el$81 = web.getNextElement(_tmpl$25), _el$103 = _el$81.firstChild, [_el$104, _co$22] = web.getNextMarker(_el$103.nextSibling), _el$82 = _el$104.nextSibling, _el$83 = _el$82.firstChild, _el$84 = _el$83.firstChild, _el$85 = _el$84.nextSibling, _el$86 = _el$85.firstChild, _el$88 = _el$86.nextSibling, [_el$89, _co$17] = web.getNextMarker(_el$88.nextSibling), _el$99 = _el$83.nextSibling, [_el$100, _co$20] = web.getNextMarker(_el$99.nextSibling), _el$101 = _el$100.nextSibling, [_el$102, _co$21] = web.getNextMarker(_el$101.nextSibling);
|
|
611
|
+
web.insert(_el$81, web.createComponent(CopyButton, {
|
|
601
612
|
getText: getMetricText,
|
|
602
613
|
title: "Copy metric",
|
|
603
614
|
position: "top-right"
|
|
604
|
-
}), _el$
|
|
605
|
-
web.insert(_el$
|
|
606
|
-
web.insert(_el$
|
|
607
|
-
web.insert(_el$
|
|
615
|
+
}), _el$104, _co$22);
|
|
616
|
+
web.insert(_el$84, () => metricParams.title);
|
|
617
|
+
web.insert(_el$86, () => metricParams.value);
|
|
618
|
+
web.insert(_el$85, web.createComponent(solidJs.Show, {
|
|
608
619
|
get when() {
|
|
609
620
|
return metricParams.unit;
|
|
610
621
|
},
|
|
611
622
|
get children() {
|
|
612
|
-
var _el$
|
|
613
|
-
web.insert(_el$
|
|
614
|
-
return _el$
|
|
623
|
+
var _el$87 = web.getNextElement(_tmpl$22);
|
|
624
|
+
web.insert(_el$87, () => metricParams.unit);
|
|
625
|
+
return _el$87;
|
|
615
626
|
}
|
|
616
|
-
}), _el$
|
|
617
|
-
web.insert(_el$
|
|
627
|
+
}), _el$89, _co$17);
|
|
628
|
+
web.insert(_el$82, web.createComponent(solidJs.Show, {
|
|
618
629
|
get when() {
|
|
619
630
|
return metricParams.trend;
|
|
620
631
|
},
|
|
621
632
|
get children() {
|
|
622
|
-
var _el$
|
|
623
|
-
_el$
|
|
624
|
-
web.insert(_el$
|
|
633
|
+
var _el$90 = web.getNextElement(_tmpl$23), _el$91 = _el$90.firstChild, _el$94 = _el$91.firstChild, [_el$95, _co$18] = web.getNextMarker(_el$94.nextSibling), _el$92 = _el$95.nextSibling, _el$96 = _el$92.nextSibling, [_el$97, _co$19] = web.getNextMarker(_el$96.nextSibling);
|
|
634
|
+
_el$97.nextSibling;
|
|
635
|
+
web.insert(_el$91, (() => {
|
|
625
636
|
var _c$ = web.memo(() => metricParams.trend.direction === "up");
|
|
626
637
|
return () => _c$() ? "�" : metricParams.trend.direction === "down" ? "�" : "�";
|
|
627
|
-
})(), _el$
|
|
628
|
-
web.insert(_el$
|
|
629
|
-
web.effect(() => web.className(_el$
|
|
630
|
-
return _el$
|
|
638
|
+
})(), _el$95, _co$18);
|
|
639
|
+
web.insert(_el$91, () => Math.abs(metricParams.trend.value), _el$97, _co$19);
|
|
640
|
+
web.effect(() => web.className(_el$91, `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"}`));
|
|
641
|
+
return _el$90;
|
|
631
642
|
}
|
|
632
|
-
}), _el$
|
|
633
|
-
web.insert(_el$
|
|
643
|
+
}), _el$100, _co$20);
|
|
644
|
+
web.insert(_el$82, web.createComponent(solidJs.Show, {
|
|
634
645
|
get when() {
|
|
635
646
|
return metricParams.subtitle;
|
|
636
647
|
},
|
|
637
648
|
get children() {
|
|
638
|
-
var _el$
|
|
639
|
-
web.insert(_el$
|
|
640
|
-
return _el$
|
|
649
|
+
var _el$98 = web.getNextElement(_tmpl$24);
|
|
650
|
+
web.insert(_el$98, () => metricParams.subtitle);
|
|
651
|
+
return _el$98;
|
|
641
652
|
}
|
|
642
|
-
}), _el$
|
|
643
|
-
return _el$
|
|
653
|
+
}), _el$102, _co$21);
|
|
654
|
+
return _el$81;
|
|
644
655
|
})();
|
|
645
656
|
}
|
|
646
657
|
function extractImageFromMarkdown(content) {
|
|
@@ -681,91 +692,91 @@ function TextRenderer(props) {
|
|
|
681
692
|
},
|
|
682
693
|
get fallback() {
|
|
683
694
|
return (() => {
|
|
684
|
-
var _el$
|
|
685
|
-
web.insert(_el$
|
|
695
|
+
var _el$105 = web.getNextElement(_tmpl$26), _el$107 = _el$105.firstChild, [_el$108, _co$23] = web.getNextMarker(_el$107.nextSibling), _el$106 = _el$108.nextSibling;
|
|
696
|
+
web.insert(_el$105, web.createComponent(CopyButton, {
|
|
686
697
|
getText: getTextContent,
|
|
687
698
|
title: "Copy text",
|
|
688
699
|
position: "top-right"
|
|
689
|
-
}), _el$
|
|
700
|
+
}), _el$108, _co$23);
|
|
690
701
|
web.effect((_p$) => {
|
|
691
702
|
var _v$1 = `prose prose-sm dark:prose-invert max-w-none ${textParams.className || ""}`, _v$10 = htmlContent();
|
|
692
|
-
_v$1 !== _p$.e && web.className(_el$
|
|
693
|
-
_v$10 !== _p$.t && web.setProperty(_el$
|
|
703
|
+
_v$1 !== _p$.e && web.className(_el$106, _p$.e = _v$1);
|
|
704
|
+
_v$10 !== _p$.t && web.setProperty(_el$106, "innerHTML", _p$.t = _v$10);
|
|
694
705
|
return _p$;
|
|
695
706
|
}, {
|
|
696
707
|
e: void 0,
|
|
697
708
|
t: void 0
|
|
698
709
|
});
|
|
699
|
-
return _el$
|
|
710
|
+
return _el$105;
|
|
700
711
|
})();
|
|
701
712
|
},
|
|
702
713
|
children: (data) => (() => {
|
|
703
|
-
var _el$
|
|
704
|
-
web.insert(_el$
|
|
714
|
+
var _el$109 = web.getNextElement(_tmpl$27), _el$110 = _el$109.firstChild, _el$111 = _el$110.firstChild, _el$112 = _el$111.firstChild, _el$113 = _el$110.nextSibling, _el$114 = _el$113.firstChild;
|
|
715
|
+
web.insert(_el$114, () => data().credit);
|
|
705
716
|
web.effect((_p$) => {
|
|
706
717
|
var _v$11 = data().linkUrl, _v$12 = data().imageUrl, _v$13 = data().alt;
|
|
707
|
-
_v$11 !== _p$.e && web.setAttribute(_el$
|
|
708
|
-
_v$12 !== _p$.t && web.setAttribute(_el$
|
|
709
|
-
_v$13 !== _p$.a && web.setAttribute(_el$
|
|
718
|
+
_v$11 !== _p$.e && web.setAttribute(_el$111, "href", _p$.e = _v$11);
|
|
719
|
+
_v$12 !== _p$.t && web.setAttribute(_el$112, "src", _p$.t = _v$12);
|
|
720
|
+
_v$13 !== _p$.a && web.setAttribute(_el$112, "alt", _p$.a = _v$13);
|
|
710
721
|
return _p$;
|
|
711
722
|
}, {
|
|
712
723
|
e: void 0,
|
|
713
724
|
t: void 0,
|
|
714
725
|
a: void 0
|
|
715
726
|
});
|
|
716
|
-
return _el$
|
|
727
|
+
return _el$109;
|
|
717
728
|
})()
|
|
718
729
|
});
|
|
719
730
|
}
|
|
720
731
|
function IframeRenderer(props) {
|
|
721
732
|
const params = props.component.params;
|
|
722
733
|
return (() => {
|
|
723
|
-
var _el$
|
|
724
|
-
web.insert(_el$
|
|
734
|
+
var _el$115 = web.getNextElement(_tmpl$29), _el$119 = _el$115.firstChild, [_el$120, _co$24] = web.getNextMarker(_el$119.nextSibling), _el$118 = _el$120.nextSibling;
|
|
735
|
+
web.insert(_el$115, web.createComponent(solidJs.Show, {
|
|
725
736
|
get when() {
|
|
726
737
|
return params.title;
|
|
727
738
|
},
|
|
728
739
|
get children() {
|
|
729
|
-
var _el$
|
|
730
|
-
web.insert(_el$
|
|
731
|
-
return _el$
|
|
740
|
+
var _el$116 = web.getNextElement(_tmpl$28), _el$117 = _el$116.firstChild;
|
|
741
|
+
web.insert(_el$117, () => params.title);
|
|
742
|
+
return _el$116;
|
|
732
743
|
}
|
|
733
|
-
}), _el$
|
|
744
|
+
}), _el$120, _co$24);
|
|
734
745
|
web.effect((_p$) => {
|
|
735
746
|
var _v$14 = params.url, _v$15 = params.title || "Embedded content", _v$16 = `height: ${params.height || "400px"}; min-height: 300px;`;
|
|
736
|
-
_v$14 !== _p$.e && web.setAttribute(_el$
|
|
737
|
-
_v$15 !== _p$.t && web.setAttribute(_el$
|
|
738
|
-
_p$.a = web.style(_el$
|
|
747
|
+
_v$14 !== _p$.e && web.setAttribute(_el$118, "src", _p$.e = _v$14);
|
|
748
|
+
_v$15 !== _p$.t && web.setAttribute(_el$118, "title", _p$.t = _v$15);
|
|
749
|
+
_p$.a = web.style(_el$118, _v$16, _p$.a);
|
|
739
750
|
return _p$;
|
|
740
751
|
}, {
|
|
741
752
|
e: void 0,
|
|
742
753
|
t: void 0,
|
|
743
754
|
a: void 0
|
|
744
755
|
});
|
|
745
|
-
return _el$
|
|
756
|
+
return _el$115;
|
|
746
757
|
})();
|
|
747
758
|
}
|
|
748
759
|
function ImageRenderer(props) {
|
|
749
760
|
const params = props.component.params;
|
|
750
761
|
return (() => {
|
|
751
|
-
var _el$
|
|
752
|
-
web.insert(_el$
|
|
762
|
+
var _el$121 = web.getNextElement(_tmpl$31), _el$122 = _el$121.firstChild, _el$123 = _el$122.firstChild, _el$124 = _el$123.firstChild, _el$127 = _el$122.nextSibling, [_el$128, _co$25] = web.getNextMarker(_el$127.nextSibling);
|
|
763
|
+
web.insert(_el$121, web.createComponent(solidJs.Show, {
|
|
753
764
|
get when() {
|
|
754
765
|
return params.caption;
|
|
755
766
|
},
|
|
756
767
|
get children() {
|
|
757
|
-
var _el$
|
|
758
|
-
web.insert(_el$
|
|
759
|
-
return _el$
|
|
768
|
+
var _el$125 = web.getNextElement(_tmpl$30), _el$126 = _el$125.firstChild;
|
|
769
|
+
web.insert(_el$126, () => params.caption);
|
|
770
|
+
return _el$125;
|
|
760
771
|
}
|
|
761
|
-
}), _el$
|
|
772
|
+
}), _el$128, _co$25);
|
|
762
773
|
web.effect((_p$) => {
|
|
763
774
|
var _v$17 = `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$18 = params.url, _v$19 = `View full size: ${params.alt || "image"}`, _v$20 = params.url, _v$21 = params.alt || "Image";
|
|
764
|
-
_v$17 !== _p$.e && web.className(_el$
|
|
765
|
-
_v$18 !== _p$.t && web.setAttribute(_el$
|
|
766
|
-
_v$19 !== _p$.a && web.setAttribute(_el$
|
|
767
|
-
_v$20 !== _p$.o && web.setAttribute(_el$
|
|
768
|
-
_v$21 !== _p$.i && web.setAttribute(_el$
|
|
775
|
+
_v$17 !== _p$.e && web.className(_el$121, _p$.e = _v$17);
|
|
776
|
+
_v$18 !== _p$.t && web.setAttribute(_el$123, "href", _p$.t = _v$18);
|
|
777
|
+
_v$19 !== _p$.a && web.setAttribute(_el$123, "aria-label", _p$.a = _v$19);
|
|
778
|
+
_v$20 !== _p$.o && web.setAttribute(_el$124, "src", _p$.o = _v$20);
|
|
779
|
+
_v$21 !== _p$.i && web.setAttribute(_el$124, "alt", _p$.i = _v$21);
|
|
769
780
|
return _p$;
|
|
770
781
|
}, {
|
|
771
782
|
e: void 0,
|
|
@@ -774,30 +785,30 @@ function ImageRenderer(props) {
|
|
|
774
785
|
o: void 0,
|
|
775
786
|
i: void 0
|
|
776
787
|
});
|
|
777
|
-
return _el$
|
|
788
|
+
return _el$121;
|
|
778
789
|
})();
|
|
779
790
|
}
|
|
780
791
|
function LinkRenderer(props) {
|
|
781
792
|
const params = props.component.params;
|
|
782
793
|
return (() => {
|
|
783
|
-
var _el$
|
|
784
|
-
_el$
|
|
785
|
-
web.insert(_el$
|
|
786
|
-
web.insert(_el$
|
|
794
|
+
var _el$129 = web.getNextElement(_tmpl$33), _el$130 = _el$129.firstChild, _el$131 = _el$130.nextSibling, _el$132 = _el$131.firstChild, _el$134 = _el$132.nextSibling, [_el$135, _co$26] = web.getNextMarker(_el$134.nextSibling);
|
|
795
|
+
_el$129.$$click = (e) => e.stopPropagation();
|
|
796
|
+
web.insert(_el$132, () => params.label || params.url);
|
|
797
|
+
web.insert(_el$131, web.createComponent(solidJs.Show, {
|
|
787
798
|
get when() {
|
|
788
799
|
return params.description;
|
|
789
800
|
},
|
|
790
801
|
get children() {
|
|
791
|
-
var _el$
|
|
792
|
-
web.insert(_el$
|
|
793
|
-
return _el$
|
|
802
|
+
var _el$133 = web.getNextElement(_tmpl$32);
|
|
803
|
+
web.insert(_el$133, () => params.description);
|
|
804
|
+
return _el$133;
|
|
794
805
|
}
|
|
795
|
-
}), _el$
|
|
806
|
+
}), _el$135, _co$26);
|
|
796
807
|
web.effect((_p$) => {
|
|
797
808
|
var _v$22 = params.url, _v$23 = `${params.label || "Link"}: ${params.description || params.url} (opens in new tab)`, _v$24 = `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 || ""}`;
|
|
798
|
-
_v$22 !== _p$.e && web.setAttribute(_el$
|
|
799
|
-
_v$23 !== _p$.t && web.setAttribute(_el$
|
|
800
|
-
_v$24 !== _p$.a && web.className(_el$
|
|
809
|
+
_v$22 !== _p$.e && web.setAttribute(_el$129, "href", _p$.e = _v$22);
|
|
810
|
+
_v$23 !== _p$.t && web.setAttribute(_el$129, "aria-label", _p$.t = _v$23);
|
|
811
|
+
_v$24 !== _p$.a && web.className(_el$129, _p$.a = _v$24);
|
|
801
812
|
return _p$;
|
|
802
813
|
}, {
|
|
803
814
|
e: void 0,
|
|
@@ -805,7 +816,7 @@ function LinkRenderer(props) {
|
|
|
805
816
|
a: void 0
|
|
806
817
|
});
|
|
807
818
|
web.runHydrationEvents();
|
|
808
|
-
return _el$
|
|
819
|
+
return _el$129;
|
|
809
820
|
})();
|
|
810
821
|
}
|
|
811
822
|
function ComponentRenderer(props) {
|
|
@@ -819,12 +830,12 @@ function ComponentRenderer(props) {
|
|
|
819
830
|
details: validation$1.errors
|
|
820
831
|
});
|
|
821
832
|
return (() => {
|
|
822
|
-
var _el$
|
|
823
|
-
web.insert(_el$
|
|
833
|
+
var _el$136 = web.getNextElement(_tmpl$34), _el$137 = _el$136.firstChild, _el$138 = _el$137.nextSibling;
|
|
834
|
+
web.insert(_el$138, () => {
|
|
824
835
|
var _a2, _b;
|
|
825
836
|
return ((_b = (_a2 = validation$1.errors) == null ? void 0 : _a2[0]) == null ? void 0 : _b.message) || "Unknown validation error";
|
|
826
837
|
});
|
|
827
|
-
return _el$
|
|
838
|
+
return _el$136;
|
|
828
839
|
})();
|
|
829
840
|
}
|
|
830
841
|
return web.createComponent(GenerativeUIErrorBoundary.GenerativeUIErrorBoundary, {
|
|
@@ -1070,27 +1081,27 @@ function ActionRenderer(props) {
|
|
|
1070
1081
|
const isDisabled = () => params.disabled || params.action === "tool-call" && isExecuting();
|
|
1071
1082
|
if (params.type === "link" || params.action === "link") {
|
|
1072
1083
|
return (() => {
|
|
1073
|
-
var _el$
|
|
1074
|
-
_el$
|
|
1075
|
-
web.insert(_el$
|
|
1084
|
+
var _el$139 = web.getNextElement(_tmpl$36), _el$141 = _el$139.firstChild, [_el$142, _co$27] = web.getNextMarker(_el$141.nextSibling), _el$143 = _el$142.nextSibling, [_el$144, _co$28] = web.getNextMarker(_el$143.nextSibling);
|
|
1085
|
+
_el$139.$$click = handleClick;
|
|
1086
|
+
web.insert(_el$139, web.createComponent(solidJs.Show, {
|
|
1076
1087
|
get when() {
|
|
1077
1088
|
return params.icon;
|
|
1078
1089
|
},
|
|
1079
1090
|
get children() {
|
|
1080
|
-
var _el$
|
|
1081
|
-
web.insert(_el$
|
|
1082
|
-
return _el$
|
|
1091
|
+
var _el$140 = web.getNextElement(_tmpl$35);
|
|
1092
|
+
web.insert(_el$140, () => params.icon);
|
|
1093
|
+
return _el$140;
|
|
1083
1094
|
}
|
|
1084
|
-
}), _el$
|
|
1085
|
-
web.insert(_el$
|
|
1095
|
+
}), _el$142, _co$27);
|
|
1096
|
+
web.insert(_el$139, () => params.label, _el$144, _co$28);
|
|
1086
1097
|
web.effect((_p$) => {
|
|
1087
1098
|
var _v$25 = params.url || "#", _v$26 = params.url ? "_blank" : void 0, _v$27 = params.ariaLabel || params.label, _v$28 = `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
|
|
1088
1099
|
${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"}
|
|
1089
1100
|
${params.className || ""}`;
|
|
1090
|
-
_v$25 !== _p$.e && web.setAttribute(_el$
|
|
1091
|
-
_v$26 !== _p$.t && web.setAttribute(_el$
|
|
1092
|
-
_v$27 !== _p$.a && web.setAttribute(_el$
|
|
1093
|
-
_v$28 !== _p$.o && web.className(_el$
|
|
1101
|
+
_v$25 !== _p$.e && web.setAttribute(_el$139, "href", _p$.e = _v$25);
|
|
1102
|
+
_v$26 !== _p$.t && web.setAttribute(_el$139, "target", _p$.t = _v$26);
|
|
1103
|
+
_v$27 !== _p$.a && web.setAttribute(_el$139, "aria-label", _p$.a = _v$27);
|
|
1104
|
+
_v$28 !== _p$.o && web.className(_el$139, _p$.o = _v$28);
|
|
1094
1105
|
return _p$;
|
|
1095
1106
|
}, {
|
|
1096
1107
|
e: void 0,
|
|
@@ -1099,42 +1110,42 @@ function ActionRenderer(props) {
|
|
|
1099
1110
|
o: void 0
|
|
1100
1111
|
});
|
|
1101
1112
|
web.runHydrationEvents();
|
|
1102
|
-
return _el$
|
|
1113
|
+
return _el$139;
|
|
1103
1114
|
})();
|
|
1104
1115
|
}
|
|
1105
1116
|
return (() => {
|
|
1106
|
-
var _el$
|
|
1107
|
-
_el$
|
|
1108
|
-
web.insert(_el$
|
|
1117
|
+
var _el$145 = web.getNextElement(_tmpl$38), _el$148 = _el$145.firstChild, [_el$149, _co$29] = web.getNextMarker(_el$148.nextSibling), _el$150 = _el$149.nextSibling, [_el$151, _co$30] = web.getNextMarker(_el$150.nextSibling), _el$152 = _el$151.nextSibling, [_el$153, _co$31] = web.getNextMarker(_el$152.nextSibling);
|
|
1118
|
+
_el$145.$$click = handleClick;
|
|
1119
|
+
web.insert(_el$145, web.createComponent(solidJs.Show, {
|
|
1109
1120
|
get when() {
|
|
1110
1121
|
return web.memo(() => !!isExecuting())() && params.action === "tool-call";
|
|
1111
1122
|
},
|
|
1112
1123
|
get children() {
|
|
1113
|
-
return web.getNextElement(_tmpl$
|
|
1124
|
+
return web.getNextElement(_tmpl$37);
|
|
1114
1125
|
}
|
|
1115
|
-
}), _el$
|
|
1116
|
-
web.insert(_el$
|
|
1126
|
+
}), _el$149, _co$29);
|
|
1127
|
+
web.insert(_el$145, web.createComponent(solidJs.Show, {
|
|
1117
1128
|
get when() {
|
|
1118
1129
|
return web.memo(() => !!params.icon)() && !(isExecuting() && params.action === "tool-call");
|
|
1119
1130
|
},
|
|
1120
1131
|
get children() {
|
|
1121
|
-
var _el$
|
|
1122
|
-
web.insert(_el$
|
|
1123
|
-
return _el$
|
|
1132
|
+
var _el$147 = web.getNextElement(_tmpl$35);
|
|
1133
|
+
web.insert(_el$147, () => params.icon);
|
|
1134
|
+
return _el$147;
|
|
1124
1135
|
}
|
|
1125
|
-
}), _el$
|
|
1126
|
-
web.insert(_el$
|
|
1136
|
+
}), _el$151, _co$30);
|
|
1137
|
+
web.insert(_el$145, () => params.label, _el$153, _co$31);
|
|
1127
1138
|
web.effect((_p$) => {
|
|
1128
1139
|
var _v$29 = params.action === "submit" ? "submit" : "button", _v$30 = isDisabled(), _v$31 = isExecuting() && params.action === "tool-call", _v$32 = params.ariaLabel || params.label, _v$33 = `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
|
|
1129
1140
|
${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"}
|
|
1130
1141
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1131
1142
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1132
1143
|
${params.className || ""}`;
|
|
1133
|
-
_v$29 !== _p$.e && web.setAttribute(_el$
|
|
1134
|
-
_v$30 !== _p$.t && web.setProperty(_el$
|
|
1135
|
-
_v$31 !== _p$.a && web.setAttribute(_el$
|
|
1136
|
-
_v$32 !== _p$.o && web.setAttribute(_el$
|
|
1137
|
-
_v$33 !== _p$.i && web.className(_el$
|
|
1144
|
+
_v$29 !== _p$.e && web.setAttribute(_el$145, "type", _p$.e = _v$29);
|
|
1145
|
+
_v$30 !== _p$.t && web.setProperty(_el$145, "disabled", _p$.t = _v$30);
|
|
1146
|
+
_v$31 !== _p$.a && web.setAttribute(_el$145, "aria-busy", _p$.a = _v$31);
|
|
1147
|
+
_v$32 !== _p$.o && web.setAttribute(_el$145, "aria-label", _p$.o = _v$32);
|
|
1148
|
+
_v$33 !== _p$.i && web.className(_el$145, _p$.i = _v$33);
|
|
1138
1149
|
return _p$;
|
|
1139
1150
|
}, {
|
|
1140
1151
|
e: void 0,
|
|
@@ -1144,7 +1155,7 @@ function ActionRenderer(props) {
|
|
|
1144
1155
|
i: void 0
|
|
1145
1156
|
});
|
|
1146
1157
|
web.runHydrationEvents();
|
|
1147
|
-
return _el$
|
|
1158
|
+
return _el$145;
|
|
1148
1159
|
})();
|
|
1149
1160
|
}
|
|
1150
1161
|
function ErrorCardRenderer(props) {
|
|
@@ -1152,55 +1163,55 @@ function ErrorCardRenderer(props) {
|
|
|
1152
1163
|
return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
|
|
1153
1164
|
};
|
|
1154
1165
|
return (() => {
|
|
1155
|
-
var _el$
|
|
1156
|
-
web.insert(_el$
|
|
1166
|
+
var _el$154 = web.getNextElement(_tmpl$42), _el$177 = _el$154.firstChild, [_el$178, _co$37] = web.getNextMarker(_el$177.nextSibling), _el$155 = _el$178.nextSibling, _el$156 = _el$155.firstChild, _el$157 = _el$156.nextSibling, _el$158 = _el$157.firstChild, _el$159 = _el$158.firstChild, _el$160 = _el$159.nextSibling, [_el$161, _co$32] = web.getNextMarker(_el$160.nextSibling), _el$162 = _el$158.nextSibling, _el$171 = _el$162.nextSibling, [_el$172, _co$34] = web.getNextMarker(_el$171.nextSibling), _el$173 = _el$172.nextSibling, [_el$174, _co$35] = web.getNextMarker(_el$173.nextSibling), _el$175 = _el$174.nextSibling, [_el$176, _co$36] = web.getNextMarker(_el$175.nextSibling);
|
|
1167
|
+
web.insert(_el$154, web.createComponent(CopyButton, {
|
|
1157
1168
|
getText: getErrorText,
|
|
1158
1169
|
title: "Copy error details",
|
|
1159
1170
|
position: "top-right"
|
|
1160
|
-
}), _el$
|
|
1161
|
-
web.insert(_el$
|
|
1162
|
-
web.insert(_el$
|
|
1163
|
-
web.insert(_el$
|
|
1171
|
+
}), _el$178, _co$37);
|
|
1172
|
+
web.insert(_el$158, () => props.error.tool || "Unknown", _el$161, _co$32);
|
|
1173
|
+
web.insert(_el$162, () => props.error.message || "An error occurred during tool execution");
|
|
1174
|
+
web.insert(_el$157, web.createComponent(solidJs.Show, {
|
|
1164
1175
|
get when() {
|
|
1165
1176
|
return props.error.type;
|
|
1166
1177
|
},
|
|
1167
1178
|
get children() {
|
|
1168
|
-
var _el$
|
|
1169
|
-
web.insert(_el$
|
|
1170
|
-
return _el$
|
|
1179
|
+
var _el$163 = web.getNextElement(_tmpl$39), _el$164 = _el$163.firstChild, _el$165 = _el$164.nextSibling, [_el$166, _co$33] = web.getNextMarker(_el$165.nextSibling);
|
|
1180
|
+
web.insert(_el$163, () => props.error.type, _el$166, _co$33);
|
|
1181
|
+
return _el$163;
|
|
1171
1182
|
}
|
|
1172
|
-
}), _el$
|
|
1173
|
-
web.insert(_el$
|
|
1183
|
+
}), _el$172, _co$34);
|
|
1184
|
+
web.insert(_el$157, web.createComponent(solidJs.Show, {
|
|
1174
1185
|
get when() {
|
|
1175
1186
|
var _a;
|
|
1176
1187
|
return (_a = props.error.suggestions) == null ? void 0 : _a.length;
|
|
1177
1188
|
},
|
|
1178
1189
|
get children() {
|
|
1179
|
-
var _el$
|
|
1180
|
-
web.insert(_el$
|
|
1190
|
+
var _el$167 = web.getNextElement(_tmpl$40), _el$168 = _el$167.firstChild, _el$169 = _el$168.nextSibling;
|
|
1191
|
+
web.insert(_el$169, web.createComponent(solidJs.For, {
|
|
1181
1192
|
get each() {
|
|
1182
1193
|
return props.error.suggestions;
|
|
1183
1194
|
},
|
|
1184
1195
|
children: (suggestion) => (() => {
|
|
1185
|
-
var _el$
|
|
1186
|
-
web.insert(_el$
|
|
1187
|
-
return _el$
|
|
1196
|
+
var _el$179 = web.getNextElement(_tmpl$43);
|
|
1197
|
+
web.insert(_el$179, suggestion);
|
|
1198
|
+
return _el$179;
|
|
1188
1199
|
})()
|
|
1189
1200
|
}));
|
|
1190
|
-
return _el$
|
|
1201
|
+
return _el$167;
|
|
1191
1202
|
}
|
|
1192
|
-
}), _el$
|
|
1193
|
-
web.insert(_el$
|
|
1203
|
+
}), _el$174, _co$35);
|
|
1204
|
+
web.insert(_el$157, web.createComponent(solidJs.Show, {
|
|
1194
1205
|
get when() {
|
|
1195
1206
|
return props.error.timestamp;
|
|
1196
1207
|
},
|
|
1197
1208
|
get children() {
|
|
1198
|
-
var _el$
|
|
1199
|
-
web.insert(_el$
|
|
1200
|
-
return _el$
|
|
1209
|
+
var _el$170 = web.getNextElement(_tmpl$41);
|
|
1210
|
+
web.insert(_el$170, () => new Date(props.error.timestamp).toLocaleString());
|
|
1211
|
+
return _el$170;
|
|
1201
1212
|
}
|
|
1202
|
-
}), _el$
|
|
1203
|
-
return _el$
|
|
1213
|
+
}), _el$176, _co$36);
|
|
1214
|
+
return _el$154;
|
|
1204
1215
|
})();
|
|
1205
1216
|
}
|
|
1206
1217
|
function isErrorResponse(content) {
|
|
@@ -1223,20 +1234,20 @@ function UIResourceHtmlRenderer(props) {
|
|
|
1223
1234
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
|
|
1224
1235
|
};
|
|
1225
1236
|
return (() => {
|
|
1226
|
-
var _el$
|
|
1227
|
-
web.insert(_el$
|
|
1237
|
+
var _el$180 = web.getNextElement(_tmpl$45), _el$184 = _el$180.firstChild, [_el$185, _co$38] = web.getNextMarker(_el$184.nextSibling), _el$183 = _el$185.nextSibling;
|
|
1238
|
+
web.insert(_el$180, web.createComponent(solidJs.Show, {
|
|
1228
1239
|
get when() {
|
|
1229
1240
|
var _a;
|
|
1230
1241
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
|
|
1231
1242
|
},
|
|
1232
1243
|
get children() {
|
|
1233
|
-
var _el$
|
|
1234
|
-
web.insert(_el$
|
|
1235
|
-
return _el$
|
|
1244
|
+
var _el$181 = web.getNextElement(_tmpl$44), _el$182 = _el$181.firstChild;
|
|
1245
|
+
web.insert(_el$182, resourceTitle);
|
|
1246
|
+
return _el$181;
|
|
1236
1247
|
}
|
|
1237
|
-
}), _el$
|
|
1238
|
-
web.effect(() => web.setProperty(_el$
|
|
1239
|
-
return _el$
|
|
1248
|
+
}), _el$185, _co$38);
|
|
1249
|
+
web.effect(() => web.setProperty(_el$183, "innerHTML", htmlContent()));
|
|
1250
|
+
return _el$180;
|
|
1240
1251
|
})();
|
|
1241
1252
|
}
|
|
1242
1253
|
const UIResourceRenderer = (props) => {
|
|
@@ -1316,24 +1327,24 @@ const UIResourceRenderer = (props) => {
|
|
|
1316
1327
|
return web.createComponent(RenderContext.RenderProvider, {
|
|
1317
1328
|
renderComponent,
|
|
1318
1329
|
get children() {
|
|
1319
|
-
var _el$
|
|
1320
|
-
web.insert(_el$
|
|
1330
|
+
var _el$186 = web.getNextElement(_tmpl$46), _el$187 = _el$186.firstChild, _el$188 = _el$187.nextSibling, [_el$189, _co$39] = web.getNextMarker(_el$188.nextSibling);
|
|
1331
|
+
web.insert(_el$187, web.createComponent(solidJs.For, {
|
|
1321
1332
|
get each() {
|
|
1322
1333
|
return layoutData.components;
|
|
1323
1334
|
},
|
|
1324
1335
|
children: (component) => (() => {
|
|
1325
|
-
var _el$
|
|
1326
|
-
web.insert(_el$
|
|
1336
|
+
var _el$190 = web.getNextElement(_tmpl$47);
|
|
1337
|
+
web.insert(_el$190, web.createComponent(ComponentRenderer, {
|
|
1327
1338
|
component,
|
|
1328
1339
|
get onError() {
|
|
1329
1340
|
return props.onError;
|
|
1330
1341
|
}
|
|
1331
1342
|
}));
|
|
1332
|
-
web.effect((_$p) => web.style(_el$
|
|
1333
|
-
return _el$
|
|
1343
|
+
web.effect((_$p) => web.style(_el$190, getGridStyleString(component), _$p));
|
|
1344
|
+
return _el$190;
|
|
1334
1345
|
})()
|
|
1335
1346
|
}));
|
|
1336
|
-
web.insert(_el$
|
|
1347
|
+
web.insert(_el$186, web.createComponent(solidJs.Show, {
|
|
1337
1348
|
get when() {
|
|
1338
1349
|
return shouldShowAutoFooter();
|
|
1339
1350
|
},
|
|
@@ -1344,17 +1355,17 @@ const UIResourceRenderer = (props) => {
|
|
|
1344
1355
|
}
|
|
1345
1356
|
});
|
|
1346
1357
|
}
|
|
1347
|
-
}), _el$
|
|
1358
|
+
}), _el$189, _co$39);
|
|
1348
1359
|
web.effect((_p$) => {
|
|
1349
1360
|
var _v$34 = `w-full ${props.class || ""}`, _v$35 = gridContainerStyle();
|
|
1350
|
-
_v$34 !== _p$.e && web.className(_el$
|
|
1351
|
-
_p$.t = web.style(_el$
|
|
1361
|
+
_v$34 !== _p$.e && web.className(_el$186, _p$.e = _v$34);
|
|
1362
|
+
_p$.t = web.style(_el$187, _v$35, _p$.t);
|
|
1352
1363
|
return _p$;
|
|
1353
1364
|
}, {
|
|
1354
1365
|
e: void 0,
|
|
1355
1366
|
t: void 0
|
|
1356
1367
|
});
|
|
1357
|
-
return _el$
|
|
1368
|
+
return _el$186;
|
|
1358
1369
|
}
|
|
1359
1370
|
});
|
|
1360
1371
|
};
|