@seed-ship/mcp-ui-solid 6.12.0 → 6.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/dist/components/UIResourceRenderer.cjs +343 -297
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts +19 -0
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +343 -297
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/services/component-registry.cjs +19 -6
- package/dist/services/component-registry.cjs.map +1 -1
- package/dist/services/component-registry.d.ts.map +1 -1
- package/dist/services/component-registry.js +19 -6
- package/dist/services/component-registry.js.map +1 -1
- package/dist/types/index.d.ts +54 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types.d.cts +54 -1
- package/dist/types.d.ts +54 -1
- package/package.json +1 -1
- package/src/components/ChartRenderer.quickchart.test.tsx +66 -0
- package/src/components/UIResourceRenderer.tsx +79 -7
- package/src/services/component-registry.ts +19 -6
- package/src/types/graph-types.test.ts +42 -0
- package/src/types/index.ts +58 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -16,6 +16,8 @@ import { FormRenderer } from "./FormRenderer.js";
|
|
|
16
16
|
import { ModalRenderer } from "./ModalRenderer.js";
|
|
17
17
|
import { ActionGroupRenderer } from "./ActionGroupRenderer.js";
|
|
18
18
|
import { isChartJSAvailable, ChartJSRenderer } from "./ChartJSRenderer.js";
|
|
19
|
+
import { DegradedFallback } from "./DegradedFallback.js";
|
|
20
|
+
import { chartToDegradedTable } from "../utils/degraded-projections.js";
|
|
19
21
|
import { ImageGalleryRenderer } from "./ImageGalleryRenderer.js";
|
|
20
22
|
import { VideoRenderer } from "./VideoRenderer.js";
|
|
21
23
|
import { CodeBlockRenderer } from "./CodeBlockRenderer.js";
|
|
@@ -26,7 +28,7 @@ import { PortalDropdownMenu } from "./PortalDropdownMenu.js";
|
|
|
26
28
|
import { RenderProvider } from "./RenderContext.js";
|
|
27
29
|
import { useAction } from "../hooks/useAction.js";
|
|
28
30
|
import { marked as k } from "../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.js";
|
|
29
|
-
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-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"aria-haspopup=menu><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__ */ template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$17 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3 flex-shrink-0"><!$><!/><!$><!/>`), _tmpl$18 = /* @__PURE__ */ template(`<button type=button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm"aria-label="Clear search">×`), _tmpl$19 = /* @__PURE__ */ template(`<div class="relative mb-3"><span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none text-sm">🔍</span><input type=text class="w-full max-w-xs min-w-[200px] pl-8 pr-8 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 outline-none"><!$><!/>`), _tmpl$20 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$21 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$22 = /* @__PURE__ */ template(`<select class="ml-2 px-1 py-0.5 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300">`), _tmpl$23 = /* @__PURE__ */ template(`<span class=text-gray-400>/ page`), _tmpl$24 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span><!$><!/>–<!$><!/> / <!$><!/></span><div class="flex items-center gap-2"><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">◀</button><span><!$><!/> / <!$><!/></span><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">▶</button><!$><!/>`), _tmpl$25 = /* @__PURE__ */ template(`<div><!$><!/><div><!$><!/><!$><!/><div role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-100 dark:bg-gray-900 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/>`), _tmpl$26 = /* @__PURE__ */ template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-100 dark:bg-gray-900 cursor-pointer select-none hover:bg-gray-200 dark:hover:bg-gray-800 transition-colors"><span class="inline-flex items-center gap-1"><!$><!/><span class="text-[10px] leading-none">`), _tmpl$27 = /* @__PURE__ */ template(`<option>`), _tmpl$28 = /* @__PURE__ */ template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$29 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$30 = /* @__PURE__ */ template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$31 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$32 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$33 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$34 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$35 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"loading=lazy>`, true, false, false), _tmpl$36 = /* @__PURE__ */ template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$37 = /* @__PURE__ */ template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$38 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$39 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$40 = /* @__PURE__ */ template(`<div class="inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 text-xs text-yellow-800 dark:text-yellow-200"role=alert aria-label="Component validation warning"><svg xmlns=http://www.w3.org/2000/svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1=12 y1=9 x2=12 y2=13></line><line x1=12 y1=17 x2=12.01 y2=17></line></svg><span>Invalid <!$><!/>`), _tmpl$41 = /* @__PURE__ */ template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$42 = /* @__PURE__ */ template(`<span aria-hidden=true>`), _tmpl$43 = /* @__PURE__ */ template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$44 = /* @__PURE__ */ template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$45 = /* @__PURE__ */ template(`<button type=button><!$><!/><!$><!/><!$><!/>`), _tmpl$46 = /* @__PURE__ */ template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$48 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$49 = /* @__PURE__ */ template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$50 = /* @__PURE__ */ template(`<li>`), _tmpl$51 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$52 = /* @__PURE__ */ template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$53 = /* @__PURE__ */ template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$54 = /* @__PURE__ */ template(`<div>`);
|
|
31
|
+
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=p-3>`), _tmpl$6 = /* @__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$7 = /* @__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$8 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$9 = /* @__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$0 = /* @__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$1 = /* @__PURE__ */ template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$10 = /* @__PURE__ */ template(`<tr>`), _tmpl$11 = /* @__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$12 = /* @__PURE__ */ template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _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">Copy TSV`), _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 CSV`), _tmpl$15 = /* @__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$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"aria-haspopup=menu><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 flex-shrink-0"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ template(`<button type=button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm"aria-label="Clear search">×`), _tmpl$20 = /* @__PURE__ */ template(`<div class="relative mb-3"><span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none text-sm">🔍</span><input type=text class="w-full max-w-xs min-w-[200px] pl-8 pr-8 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 outline-none"><!$><!/>`), _tmpl$21 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$22 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$23 = /* @__PURE__ */ template(`<select class="ml-2 px-1 py-0.5 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300">`), _tmpl$24 = /* @__PURE__ */ template(`<span class=text-gray-400>/ page`), _tmpl$25 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span><!$><!/>–<!$><!/> / <!$><!/></span><div class="flex items-center gap-2"><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">◀</button><span><!$><!/> / <!$><!/></span><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">▶</button><!$><!/>`), _tmpl$26 = /* @__PURE__ */ template(`<div><!$><!/><div><!$><!/><!$><!/><div role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-100 dark:bg-gray-900 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/>`), _tmpl$27 = /* @__PURE__ */ template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-100 dark:bg-gray-900 cursor-pointer select-none hover:bg-gray-200 dark:hover:bg-gray-800 transition-colors"><span class="inline-flex items-center gap-1"><!$><!/><span class="text-[10px] leading-none">`), _tmpl$28 = /* @__PURE__ */ template(`<option>`), _tmpl$29 = /* @__PURE__ */ template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$30 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$31 = /* @__PURE__ */ template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$32 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$33 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$34 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$35 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$36 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"loading=lazy>`, true, false, false), _tmpl$37 = /* @__PURE__ */ template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$38 = /* @__PURE__ */ template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$39 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$40 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$41 = /* @__PURE__ */ template(`<div class="inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 text-xs text-yellow-800 dark:text-yellow-200"role=alert aria-label="Component validation warning"><svg xmlns=http://www.w3.org/2000/svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1=12 y1=9 x2=12 y2=13></line><line x1=12 y1=17 x2=12.01 y2=17></line></svg><span>Invalid <!$><!/>`), _tmpl$42 = /* @__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$43 = /* @__PURE__ */ template(`<span aria-hidden=true>`), _tmpl$44 = /* @__PURE__ */ template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$45 = /* @__PURE__ */ template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$46 = /* @__PURE__ */ template(`<button type=button><!$><!/><!$><!/><!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$48 = /* @__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$49 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$50 = /* @__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$51 = /* @__PURE__ */ template(`<li>`), _tmpl$52 = /* @__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$53 = /* @__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$54 = /* @__PURE__ */ template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$55 = /* @__PURE__ */ template(`<div>`);
|
|
30
32
|
function CopyButton(props) {
|
|
31
33
|
const [copied, setCopied] = createSignal(false);
|
|
32
34
|
const handleCopy = async () => {
|
|
@@ -74,11 +76,26 @@ function ChartRenderer(props) {
|
|
|
74
76
|
const [iframeUrl, setIframeUrl] = createSignal();
|
|
75
77
|
const [isLoading, setIsLoading] = createSignal(true);
|
|
76
78
|
const [error, setError] = createSignal();
|
|
79
|
+
const [degraded, setDegraded] = createSignal(false);
|
|
80
|
+
const telemetry = useTelemetry();
|
|
77
81
|
const params = () => props.component.params;
|
|
78
82
|
const rendererPref = () => {
|
|
79
83
|
var _a2;
|
|
80
84
|
return ((_a2 = params()) == null ? void 0 : _a2.renderer) || "auto";
|
|
81
85
|
};
|
|
86
|
+
const allowQuickchart = () => props.allowQuickchartFallback === true;
|
|
87
|
+
const signalBlockedFallback = (reason) => {
|
|
88
|
+
setDegraded(true);
|
|
89
|
+
setIsLoading(false);
|
|
90
|
+
const message = `Chart degraded to a data table: ${reason}`;
|
|
91
|
+
telemetry == null ? void 0 : telemetry.dispatch({
|
|
92
|
+
type: "render:error",
|
|
93
|
+
errorMessage: message,
|
|
94
|
+
id: props.component.id ?? "",
|
|
95
|
+
componentType: "chart",
|
|
96
|
+
ts: Date.now()
|
|
97
|
+
});
|
|
98
|
+
};
|
|
82
99
|
if (!((_b = (_a = params()) == null ? void 0 : _a.data) == null ? void 0 : _b.datasets)) {
|
|
83
100
|
return getNextElement(_tmpl$4);
|
|
84
101
|
}
|
|
@@ -86,7 +103,11 @@ function ChartRenderer(props) {
|
|
|
86
103
|
const pref = rendererPref();
|
|
87
104
|
if (pref === "iframe") {
|
|
88
105
|
setUseNative(false);
|
|
89
|
-
|
|
106
|
+
if (allowQuickchart()) {
|
|
107
|
+
buildIframeUrl();
|
|
108
|
+
} else {
|
|
109
|
+
signalBlockedFallback("renderer: 'iframe' requires the external quickchart.io service; set allowQuickchartFallback on the host to enable it.");
|
|
110
|
+
}
|
|
90
111
|
} else if (pref === "native") {
|
|
91
112
|
const available = await isChartJSAvailable();
|
|
92
113
|
if (available) {
|
|
@@ -101,9 +122,12 @@ function ChartRenderer(props) {
|
|
|
101
122
|
if (available) {
|
|
102
123
|
setUseNative(true);
|
|
103
124
|
setIsLoading(false);
|
|
104
|
-
} else {
|
|
125
|
+
} else if (allowQuickchart()) {
|
|
105
126
|
setUseNative(false);
|
|
106
127
|
buildIframeUrl();
|
|
128
|
+
} else {
|
|
129
|
+
setUseNative(false);
|
|
130
|
+
signalBlockedFallback("Chart.js peer is not installed.");
|
|
107
131
|
}
|
|
108
132
|
}
|
|
109
133
|
});
|
|
@@ -130,46 +154,59 @@ function ChartRenderer(props) {
|
|
|
130
154
|
},
|
|
131
155
|
get fallback() {
|
|
132
156
|
return (() => {
|
|
133
|
-
var _el$5 = getNextElement(_tmpl$
|
|
157
|
+
var _el$5 = getNextElement(_tmpl$0), _el$16 = _el$5.firstChild, [_el$17, _co$2] = getNextMarker(_el$16.nextSibling), _el$18 = _el$17.nextSibling, [_el$19, _co$3] = getNextMarker(_el$18.nextSibling), _el$20 = _el$19.nextSibling, [_el$21, _co$4] = getNextMarker(_el$20.nextSibling), _el$22 = _el$21.nextSibling, [_el$23, _co$5] = getNextMarker(_el$22.nextSibling);
|
|
158
|
+
insert(_el$5, createComponent(Show, {
|
|
159
|
+
get when() {
|
|
160
|
+
return degraded();
|
|
161
|
+
},
|
|
162
|
+
get children() {
|
|
163
|
+
var _el$6 = getNextElement(_tmpl$5);
|
|
164
|
+
insert(_el$6, createComponent(DegradedFallback, mergeProps({
|
|
165
|
+
message: "Interactive chart unavailable — install the chart.js peer dependency, or set allowQuickchartFallback to use the external quickchart.io renderer.",
|
|
166
|
+
caption: "Showing the chart data as a table."
|
|
167
|
+
}, () => chartToDegradedTable(params() ?? {}))));
|
|
168
|
+
return _el$6;
|
|
169
|
+
}
|
|
170
|
+
}), _el$17, _co$2);
|
|
134
171
|
insert(_el$5, createComponent(Show, {
|
|
135
172
|
get when() {
|
|
136
173
|
return isLoading();
|
|
137
174
|
},
|
|
138
175
|
get children() {
|
|
139
|
-
return getNextElement(_tmpl$
|
|
176
|
+
return getNextElement(_tmpl$6);
|
|
140
177
|
}
|
|
141
|
-
}), _el$
|
|
178
|
+
}), _el$19, _co$3);
|
|
142
179
|
insert(_el$5, createComponent(Show, {
|
|
143
180
|
get when() {
|
|
144
181
|
return error();
|
|
145
182
|
},
|
|
146
183
|
get children() {
|
|
147
|
-
var _el$
|
|
148
|
-
insert(_el$
|
|
149
|
-
return _el$
|
|
184
|
+
var _el$8 = getNextElement(_tmpl$7), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling;
|
|
185
|
+
insert(_el$1, error);
|
|
186
|
+
return _el$8;
|
|
150
187
|
}
|
|
151
|
-
}), _el$
|
|
188
|
+
}), _el$21, _co$4);
|
|
152
189
|
insert(_el$5, createComponent(Show, {
|
|
153
190
|
get when() {
|
|
154
191
|
return memo(() => !!iframeUrl())() && !error();
|
|
155
192
|
},
|
|
156
193
|
get children() {
|
|
157
|
-
var _el$
|
|
158
|
-
insert(_el$
|
|
194
|
+
var _el$10 = getNextElement(_tmpl$9), _el$14 = _el$10.firstChild, [_el$15, _co$] = getNextMarker(_el$14.nextSibling), _el$12 = _el$15.nextSibling, _el$13 = _el$12.firstChild;
|
|
195
|
+
insert(_el$10, createComponent(Show, {
|
|
159
196
|
get when() {
|
|
160
197
|
var _a2;
|
|
161
198
|
return (_a2 = params()) == null ? void 0 : _a2.title;
|
|
162
199
|
},
|
|
163
200
|
get children() {
|
|
164
|
-
var _el$
|
|
165
|
-
insert(_el$
|
|
201
|
+
var _el$11 = getNextElement(_tmpl$8);
|
|
202
|
+
insert(_el$11, () => {
|
|
166
203
|
var _a2;
|
|
167
204
|
return (_a2 = params()) == null ? void 0 : _a2.title;
|
|
168
205
|
});
|
|
169
|
-
return _el$
|
|
206
|
+
return _el$11;
|
|
170
207
|
}
|
|
171
|
-
}), _el$
|
|
172
|
-
_el$
|
|
208
|
+
}), _el$15, _co$);
|
|
209
|
+
_el$13.addEventListener("error", () => {
|
|
173
210
|
var _a2;
|
|
174
211
|
setError("Failed to load chart");
|
|
175
212
|
(_a2 = props.onError) == null ? void 0 : _a2.call(props, {
|
|
@@ -181,18 +218,18 @@ function ChartRenderer(props) {
|
|
|
181
218
|
effect((_p$) => {
|
|
182
219
|
var _a2, _b2, _c, _d;
|
|
183
220
|
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";
|
|
184
|
-
_v$3 !== _p$.e && setAttribute(_el$
|
|
185
|
-
_v$4 !== _p$.t && setAttribute(_el$
|
|
186
|
-
_v$5 !== _p$.a && setAttribute(_el$
|
|
221
|
+
_v$3 !== _p$.e && setAttribute(_el$12, "aria-label", _p$.e = _v$3);
|
|
222
|
+
_v$4 !== _p$.t && setAttribute(_el$13, "src", _p$.t = _v$4);
|
|
223
|
+
_v$5 !== _p$.a && setAttribute(_el$13, "alt", _p$.a = _v$5);
|
|
187
224
|
return _p$;
|
|
188
225
|
}, {
|
|
189
226
|
e: void 0,
|
|
190
227
|
t: void 0,
|
|
191
228
|
a: void 0
|
|
192
229
|
});
|
|
193
|
-
return _el$
|
|
230
|
+
return _el$10;
|
|
194
231
|
}
|
|
195
|
-
}), _el$
|
|
232
|
+
}), _el$23, _co$5);
|
|
196
233
|
return _el$5;
|
|
197
234
|
})();
|
|
198
235
|
},
|
|
@@ -542,28 +579,28 @@ ${dataRows}`;
|
|
|
542
579
|
};
|
|
543
580
|
const tableId = `table-${Math.random().toString(36).slice(2, 9)}`;
|
|
544
581
|
const StandardTableBody = () => (() => {
|
|
545
|
-
var _el$
|
|
546
|
-
insert(_el$
|
|
582
|
+
var _el$24 = getNextElement(_tmpl$1);
|
|
583
|
+
insert(_el$24, createComponent(For, {
|
|
547
584
|
get each() {
|
|
548
585
|
return clientVisibleRows().slice(0, DEFAULT_RESOURCE_LIMITS.maxTableRows);
|
|
549
586
|
},
|
|
550
587
|
children: (row, i) => (() => {
|
|
551
|
-
var _el$
|
|
552
|
-
insert(_el$
|
|
588
|
+
var _el$25 = getNextElement(_tmpl$10);
|
|
589
|
+
insert(_el$25, createComponent(For, {
|
|
553
590
|
get each() {
|
|
554
591
|
return tableParams.columns;
|
|
555
592
|
},
|
|
556
593
|
children: (column) => (() => {
|
|
557
|
-
var _el$
|
|
558
|
-
effect(() => setProperty(_el$
|
|
559
|
-
return _el$
|
|
594
|
+
var _el$26 = getNextElement(_tmpl$11), _el$27 = _el$26.firstChild;
|
|
595
|
+
effect(() => setProperty(_el$27, "innerHTML", highlightQuery(renderCellValue(row[column.key], citationCtx), debouncedQuery())));
|
|
596
|
+
return _el$26;
|
|
560
597
|
})()
|
|
561
598
|
}));
|
|
562
|
-
effect(() => className(_el$
|
|
563
|
-
return _el$
|
|
599
|
+
effect(() => className(_el$25, `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"}`));
|
|
600
|
+
return _el$25;
|
|
564
601
|
})()
|
|
565
602
|
}));
|
|
566
|
-
return _el$
|
|
603
|
+
return _el$24;
|
|
567
604
|
})();
|
|
568
605
|
const VirtualizedTableBody = () => {
|
|
569
606
|
const v = virtualizer();
|
|
@@ -573,39 +610,39 @@ ${dataRows}`;
|
|
|
573
610
|
const opts = virtualizeOpts();
|
|
574
611
|
const rowHeight = opts.rowHeight ?? 48;
|
|
575
612
|
return (() => {
|
|
576
|
-
var _el$
|
|
577
|
-
setStyleProperty(_el$
|
|
578
|
-
insert(_el$
|
|
613
|
+
var _el$28 = getNextElement(_tmpl$12);
|
|
614
|
+
setStyleProperty(_el$28, "height", `${totalSize}px`);
|
|
615
|
+
insert(_el$28, createComponent(For, {
|
|
579
616
|
each: items,
|
|
580
617
|
children: (virtualRow) => {
|
|
581
618
|
const row = tableParams.rows[virtualRow.index];
|
|
582
619
|
return (() => {
|
|
583
|
-
var _el$
|
|
584
|
-
setStyleProperty(_el$
|
|
585
|
-
insert(_el$
|
|
620
|
+
var _el$29 = getNextElement(_tmpl$10);
|
|
621
|
+
setStyleProperty(_el$29, "height", `${rowHeight}px`);
|
|
622
|
+
insert(_el$29, createComponent(For, {
|
|
586
623
|
get each() {
|
|
587
624
|
return tableParams.columns;
|
|
588
625
|
},
|
|
589
626
|
children: (column) => (() => {
|
|
590
|
-
var _el$
|
|
591
|
-
effect(() => setProperty(_el$
|
|
592
|
-
return _el$
|
|
627
|
+
var _el$30 = getNextElement(_tmpl$11), _el$31 = _el$30.firstChild;
|
|
628
|
+
effect(() => setProperty(_el$31, "innerHTML", highlightQuery(renderCellValue(row[column.key], citationCtx), debouncedQuery())));
|
|
629
|
+
return _el$30;
|
|
593
630
|
})()
|
|
594
631
|
}));
|
|
595
632
|
effect((_p$) => {
|
|
596
633
|
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)`;
|
|
597
|
-
_v$6 !== _p$.e && className(_el$
|
|
598
|
-
_v$7 !== _p$.t && setStyleProperty(_el$
|
|
634
|
+
_v$6 !== _p$.e && className(_el$29, _p$.e = _v$6);
|
|
635
|
+
_v$7 !== _p$.t && setStyleProperty(_el$29, "transform", _p$.t = _v$7);
|
|
599
636
|
return _p$;
|
|
600
637
|
}, {
|
|
601
638
|
e: void 0,
|
|
602
639
|
t: void 0
|
|
603
640
|
});
|
|
604
|
-
return _el$
|
|
641
|
+
return _el$29;
|
|
605
642
|
})();
|
|
606
643
|
}
|
|
607
644
|
}));
|
|
608
|
-
return _el$
|
|
645
|
+
return _el$28;
|
|
609
646
|
})();
|
|
610
647
|
};
|
|
611
648
|
return createComponent(ExpandableWrapper, {
|
|
@@ -620,8 +657,8 @@ ${dataRows}`;
|
|
|
620
657
|
return props.toolbarVariant;
|
|
621
658
|
},
|
|
622
659
|
get children() {
|
|
623
|
-
var _el$
|
|
624
|
-
insert(_el$
|
|
660
|
+
var _el$32 = getNextElement(_tmpl$26), _el$116 = _el$32.firstChild, [_el$117, _co$26] = getNextMarker(_el$116.nextSibling), _el$40 = _el$117.nextSibling, _el$108 = _el$40.firstChild, [_el$109, _co$22] = getNextMarker(_el$108.nextSibling), _el$110 = _el$109.nextSibling, [_el$111, _co$23] = getNextMarker(_el$110.nextSibling), _el$66 = _el$111.nextSibling, _el$67 = _el$66.firstChild, _el$68 = _el$67.firstChild, _el$69 = _el$68.firstChild, _el$70 = _el$68.nextSibling, [_el$71, _co$12] = getNextMarker(_el$70.nextSibling), _el$112 = _el$66.nextSibling, [_el$113, _co$24] = getNextMarker(_el$112.nextSibling), _el$114 = _el$113.nextSibling, [_el$115, _co$25] = getNextMarker(_el$114.nextSibling);
|
|
661
|
+
insert(_el$32, createComponent(Show, {
|
|
625
662
|
when: exportable,
|
|
626
663
|
get fallback() {
|
|
627
664
|
return createComponent(CopyButton, {
|
|
@@ -631,11 +668,11 @@ ${dataRows}`;
|
|
|
631
668
|
});
|
|
632
669
|
},
|
|
633
670
|
get children() {
|
|
634
|
-
var _el$
|
|
635
|
-
_el$
|
|
671
|
+
var _el$33 = getNextElement(_tmpl$16), _el$34 = _el$33.firstChild, _el$38 = _el$34.nextSibling, [_el$39, _co$6] = getNextMarker(_el$38.nextSibling);
|
|
672
|
+
_el$34.$$click = () => setShowExportMenu(!showExportMenu());
|
|
636
673
|
var _ref$ = exportTriggerRef;
|
|
637
|
-
typeof _ref$ === "function" ? use(_ref$, _el$
|
|
638
|
-
insert(_el$
|
|
674
|
+
typeof _ref$ === "function" ? use(_ref$, _el$34) : exportTriggerRef = _el$34;
|
|
675
|
+
insert(_el$33, createComponent(PortalDropdownMenu, {
|
|
639
676
|
get open() {
|
|
640
677
|
return showExportMenu();
|
|
641
678
|
},
|
|
@@ -648,116 +685,116 @@ ${dataRows}`;
|
|
|
648
685
|
return exportFormats.includes("tsv");
|
|
649
686
|
},
|
|
650
687
|
get children() {
|
|
651
|
-
var _el$
|
|
652
|
-
_el$
|
|
688
|
+
var _el$35 = getNextElement(_tmpl$13);
|
|
689
|
+
_el$35.$$click = () => handleExport("tsv");
|
|
653
690
|
runHydrationEvents();
|
|
654
|
-
return _el$
|
|
691
|
+
return _el$35;
|
|
655
692
|
}
|
|
656
693
|
}), createComponent(Show, {
|
|
657
694
|
get when() {
|
|
658
695
|
return exportFormats.includes("csv");
|
|
659
696
|
},
|
|
660
697
|
get children() {
|
|
661
|
-
var _el$
|
|
662
|
-
_el$
|
|
698
|
+
var _el$36 = getNextElement(_tmpl$14);
|
|
699
|
+
_el$36.$$click = () => handleExport("csv");
|
|
663
700
|
runHydrationEvents();
|
|
664
|
-
return _el$
|
|
701
|
+
return _el$36;
|
|
665
702
|
}
|
|
666
703
|
}), createComponent(Show, {
|
|
667
704
|
get when() {
|
|
668
705
|
return exportFormats.includes("json");
|
|
669
706
|
},
|
|
670
707
|
get children() {
|
|
671
|
-
var _el$
|
|
672
|
-
_el$
|
|
708
|
+
var _el$37 = getNextElement(_tmpl$15);
|
|
709
|
+
_el$37.$$click = () => handleExport("json");
|
|
673
710
|
runHydrationEvents();
|
|
674
|
-
return _el$
|
|
711
|
+
return _el$37;
|
|
675
712
|
}
|
|
676
713
|
})];
|
|
677
714
|
}
|
|
678
|
-
}), _el$
|
|
679
|
-
effect(() => setAttribute(_el$
|
|
715
|
+
}), _el$39, _co$6);
|
|
716
|
+
effect(() => setAttribute(_el$34, "aria-expanded", showExportMenu()));
|
|
680
717
|
runHydrationEvents();
|
|
681
|
-
return _el$
|
|
718
|
+
return _el$33;
|
|
682
719
|
}
|
|
683
|
-
}), _el$
|
|
684
|
-
insert(_el$
|
|
720
|
+
}), _el$117, _co$26);
|
|
721
|
+
insert(_el$40, createComponent(Show, {
|
|
685
722
|
get when() {
|
|
686
723
|
return tableParams.title;
|
|
687
724
|
},
|
|
688
725
|
get children() {
|
|
689
|
-
var _el$
|
|
690
|
-
setAttribute(_el$
|
|
691
|
-
insert(_el$
|
|
692
|
-
insert(_el$
|
|
726
|
+
var _el$41 = getNextElement(_tmpl$18), _el$47 = _el$41.firstChild, [_el$48, _co$8] = getNextMarker(_el$47.nextSibling), _el$49 = _el$48.nextSibling, [_el$50, _co$9] = getNextMarker(_el$49.nextSibling);
|
|
727
|
+
setAttribute(_el$41, "id", `${tableId}-title`);
|
|
728
|
+
insert(_el$41, () => tableParams.title, _el$48, _co$8);
|
|
729
|
+
insert(_el$41, createComponent(Show, {
|
|
693
730
|
get when() {
|
|
694
731
|
return isVirtualizing();
|
|
695
732
|
},
|
|
696
733
|
get children() {
|
|
697
|
-
var _el$
|
|
698
|
-
_el$
|
|
699
|
-
insert(_el$
|
|
734
|
+
var _el$42 = getNextElement(_tmpl$17), _el$43 = _el$42.firstChild, _el$45 = _el$43.nextSibling, [_el$46, _co$7] = getNextMarker(_el$45.nextSibling);
|
|
735
|
+
_el$46.nextSibling;
|
|
736
|
+
insert(_el$42, () => {
|
|
700
737
|
var _a;
|
|
701
738
|
return (_a = tableParams.rows) == null ? void 0 : _a.length;
|
|
702
|
-
}, _el$
|
|
703
|
-
return _el$
|
|
739
|
+
}, _el$46, _co$7);
|
|
740
|
+
return _el$42;
|
|
704
741
|
}
|
|
705
|
-
}), _el$
|
|
706
|
-
return _el$
|
|
742
|
+
}), _el$50, _co$9);
|
|
743
|
+
return _el$41;
|
|
707
744
|
}
|
|
708
|
-
}), _el$
|
|
709
|
-
insert(_el$
|
|
745
|
+
}), _el$109, _co$22);
|
|
746
|
+
insert(_el$40, createComponent(Show, {
|
|
710
747
|
get when() {
|
|
711
748
|
return isSearchable();
|
|
712
749
|
},
|
|
713
750
|
get children() {
|
|
714
751
|
return [(() => {
|
|
715
|
-
var _el$
|
|
716
|
-
_el$
|
|
717
|
-
insert(_el$
|
|
752
|
+
var _el$51 = getNextElement(_tmpl$20), _el$52 = _el$51.firstChild, _el$53 = _el$52.nextSibling, _el$55 = _el$53.nextSibling, [_el$56, _co$0] = getNextMarker(_el$55.nextSibling);
|
|
753
|
+
_el$53.$$input = (e) => handleSearch(e.currentTarget.value);
|
|
754
|
+
insert(_el$51, createComponent(Show, {
|
|
718
755
|
get when() {
|
|
719
756
|
return searchQuery();
|
|
720
757
|
},
|
|
721
758
|
get children() {
|
|
722
|
-
var _el$
|
|
723
|
-
_el$
|
|
759
|
+
var _el$54 = getNextElement(_tmpl$19);
|
|
760
|
+
_el$54.$$click = () => {
|
|
724
761
|
handleSearch("");
|
|
725
762
|
setSearchQuery("");
|
|
726
763
|
setDebouncedQuery("");
|
|
727
764
|
};
|
|
728
765
|
runHydrationEvents();
|
|
729
|
-
return _el$
|
|
766
|
+
return _el$54;
|
|
730
767
|
}
|
|
731
|
-
}), _el$
|
|
732
|
-
effect(() => setAttribute(_el$
|
|
733
|
-
effect(() => setProperty(_el$
|
|
768
|
+
}), _el$56, _co$0);
|
|
769
|
+
effect(() => setAttribute(_el$53, "placeholder", searchPlaceholder()));
|
|
770
|
+
effect(() => setProperty(_el$53, "value", searchQuery()));
|
|
734
771
|
runHydrationEvents();
|
|
735
|
-
return _el$
|
|
772
|
+
return _el$51;
|
|
736
773
|
})(), createComponent(Show, {
|
|
737
774
|
get when() {
|
|
738
775
|
return memo(() => !!debouncedQuery())() && filteredRows().length !== sortedRows().length;
|
|
739
776
|
},
|
|
740
777
|
get children() {
|
|
741
|
-
var _el$
|
|
742
|
-
insert(_el$
|
|
743
|
-
insert(_el$
|
|
744
|
-
insert(_el$
|
|
745
|
-
return _el$
|
|
778
|
+
var _el$57 = getNextElement(_tmpl$21), _el$60 = _el$57.firstChild, [_el$61, _co$1] = getNextMarker(_el$60.nextSibling), _el$58 = _el$61.nextSibling, _el$62 = _el$58.nextSibling, [_el$63, _co$10] = getNextMarker(_el$62.nextSibling), _el$59 = _el$63.nextSibling, _el$64 = _el$59.nextSibling, [_el$65, _co$11] = getNextMarker(_el$64.nextSibling);
|
|
779
|
+
insert(_el$57, () => filteredRows().length, _el$61, _co$1);
|
|
780
|
+
insert(_el$57, () => filteredRows().length !== 1 ? "s" : "", _el$63, _co$10);
|
|
781
|
+
insert(_el$57, () => sortedRows().length, _el$65, _co$11);
|
|
782
|
+
return _el$57;
|
|
746
783
|
}
|
|
747
784
|
})];
|
|
748
785
|
}
|
|
749
|
-
}), _el$
|
|
786
|
+
}), _el$111, _co$23);
|
|
750
787
|
var _ref$2 = scrollContainerRef;
|
|
751
|
-
typeof _ref$2 === "function" ? use(_ref$2, _el$
|
|
752
|
-
insert(_el$
|
|
788
|
+
typeof _ref$2 === "function" ? use(_ref$2, _el$66) : scrollContainerRef = _el$66;
|
|
789
|
+
insert(_el$69, createComponent(For, {
|
|
753
790
|
get each() {
|
|
754
791
|
return tableParams.columns;
|
|
755
792
|
},
|
|
756
793
|
children: (column) => (() => {
|
|
757
|
-
var _el$
|
|
758
|
-
addEventListener(_el$
|
|
759
|
-
insert(_el$
|
|
760
|
-
insert(_el$
|
|
794
|
+
var _el$118 = getNextElement(_tmpl$27), _el$119 = _el$118.firstChild, _el$121 = _el$119.firstChild, [_el$122, _co$27] = getNextMarker(_el$121.nextSibling), _el$120 = _el$122.nextSibling;
|
|
795
|
+
addEventListener(_el$118, "click", () => handleSort(column.key));
|
|
796
|
+
insert(_el$119, () => column.label, _el$122, _co$27);
|
|
797
|
+
insert(_el$120, () => sortIndicator(column.key));
|
|
761
798
|
effect((_p$) => {
|
|
762
799
|
var _v$14 = column.width ? {
|
|
763
800
|
width: column.width
|
|
@@ -765,19 +802,19 @@ ${dataRows}`;
|
|
|
765
802
|
"opacity-30": sortKey() !== column.key,
|
|
766
803
|
"opacity-100 text-blue-600 dark:text-blue-400": sortKey() === column.key
|
|
767
804
|
};
|
|
768
|
-
_p$.e = style(_el$
|
|
769
|
-
_v$15 !== _p$.t && setAttribute(_el$
|
|
770
|
-
_p$.a = classList(_el$
|
|
805
|
+
_p$.e = style(_el$118, _v$14, _p$.e);
|
|
806
|
+
_v$15 !== _p$.t && setAttribute(_el$118, "title", _p$.t = _v$15);
|
|
807
|
+
_p$.a = classList(_el$120, _v$16, _p$.a);
|
|
771
808
|
return _p$;
|
|
772
809
|
}, {
|
|
773
810
|
e: void 0,
|
|
774
811
|
t: void 0,
|
|
775
812
|
a: void 0
|
|
776
813
|
});
|
|
777
|
-
return _el$
|
|
814
|
+
return _el$118;
|
|
778
815
|
})()
|
|
779
816
|
}));
|
|
780
|
-
insert(_el$
|
|
817
|
+
insert(_el$67, createComponent(Show, {
|
|
781
818
|
get when() {
|
|
782
819
|
return isVirtualizing();
|
|
783
820
|
},
|
|
@@ -787,69 +824,69 @@ ${dataRows}`;
|
|
|
787
824
|
get children() {
|
|
788
825
|
return createComponent(VirtualizedTableBody, {});
|
|
789
826
|
}
|
|
790
|
-
}), _el$
|
|
791
|
-
insert(_el$
|
|
827
|
+
}), _el$71, _co$12);
|
|
828
|
+
insert(_el$40, createComponent(Show, {
|
|
792
829
|
get when() {
|
|
793
830
|
return tableParams.pagination;
|
|
794
831
|
},
|
|
795
832
|
get children() {
|
|
796
|
-
var _el$
|
|
797
|
-
insert(_el$
|
|
798
|
-
insert(_el$
|
|
799
|
-
insert(_el$
|
|
800
|
-
return _el$
|
|
833
|
+
var _el$72 = getNextElement(_tmpl$22), _el$73 = _el$72.firstChild, _el$74 = _el$73.firstChild, _el$79 = _el$74.nextSibling, [_el$80, _co$13] = getNextMarker(_el$79.nextSibling), _el$75 = _el$80.nextSibling, _el$81 = _el$75.nextSibling, [_el$82, _co$14] = getNextMarker(_el$81.nextSibling), _el$77 = _el$82.nextSibling, _el$83 = _el$77.nextSibling, [_el$84, _co$15] = getNextMarker(_el$83.nextSibling);
|
|
834
|
+
insert(_el$73, () => tableParams.pagination.currentPage * tableParams.pagination.pageSize + 1, _el$80, _co$13);
|
|
835
|
+
insert(_el$73, () => Math.min((tableParams.pagination.currentPage + 1) * tableParams.pagination.pageSize, tableParams.pagination.totalRows), _el$82, _co$14);
|
|
836
|
+
insert(_el$73, () => tableParams.pagination.totalRows, _el$84, _co$15);
|
|
837
|
+
return _el$72;
|
|
801
838
|
}
|
|
802
|
-
}), _el$
|
|
803
|
-
insert(_el$
|
|
839
|
+
}), _el$113, _co$24);
|
|
840
|
+
insert(_el$40, createComponent(Show, {
|
|
804
841
|
get when() {
|
|
805
842
|
return needsClientPagination();
|
|
806
843
|
},
|
|
807
844
|
get children() {
|
|
808
|
-
var _el$
|
|
809
|
-
insert(_el$
|
|
810
|
-
insert(_el$
|
|
811
|
-
insert(_el$
|
|
812
|
-
_el$
|
|
813
|
-
insert(_el$
|
|
814
|
-
insert(_el$
|
|
815
|
-
_el$
|
|
816
|
-
insert(_el$
|
|
845
|
+
var _el$85 = getNextElement(_tmpl$25), _el$86 = _el$85.firstChild, _el$89 = _el$86.firstChild, [_el$90, _co$16] = getNextMarker(_el$89.nextSibling), _el$87 = _el$90.nextSibling, _el$91 = _el$87.nextSibling, [_el$92, _co$17] = getNextMarker(_el$91.nextSibling), _el$88 = _el$92.nextSibling, _el$93 = _el$88.nextSibling, [_el$94, _co$18] = getNextMarker(_el$93.nextSibling), _el$95 = _el$86.nextSibling, _el$96 = _el$95.firstChild, _el$97 = _el$96.nextSibling, _el$99 = _el$97.firstChild, [_el$100, _co$19] = getNextMarker(_el$99.nextSibling), _el$98 = _el$100.nextSibling, _el$101 = _el$98.nextSibling, [_el$102, _co$20] = getNextMarker(_el$101.nextSibling), _el$103 = _el$97.nextSibling, _el$106 = _el$103.nextSibling, [_el$107, _co$21] = getNextMarker(_el$106.nextSibling);
|
|
846
|
+
insert(_el$86, clientRangeStart, _el$90, _co$16);
|
|
847
|
+
insert(_el$86, clientRangeEnd, _el$92, _co$17);
|
|
848
|
+
insert(_el$86, () => filteredRows().length.toLocaleString("fr-FR"), _el$94, _co$18);
|
|
849
|
+
_el$96.$$click = () => setClientPage((p) => p - 1);
|
|
850
|
+
insert(_el$97, () => clientPage() + 1, _el$100, _co$19);
|
|
851
|
+
insert(_el$97, clientTotalPages, _el$102, _co$20);
|
|
852
|
+
_el$103.$$click = () => setClientPage((p) => p + 1);
|
|
853
|
+
insert(_el$95, createComponent(Show, {
|
|
817
854
|
get when() {
|
|
818
855
|
return memo(() => !!isExpanded())() && filteredRows().length > 10;
|
|
819
856
|
},
|
|
820
857
|
get children() {
|
|
821
858
|
return [(() => {
|
|
822
|
-
var _el$
|
|
823
|
-
_el$
|
|
824
|
-
insert(_el$
|
|
859
|
+
var _el$104 = getNextElement(_tmpl$23);
|
|
860
|
+
_el$104.addEventListener("change", (e) => handlePageSizeChange(Number(e.currentTarget.value)));
|
|
861
|
+
insert(_el$104, createComponent(For, {
|
|
825
862
|
get each() {
|
|
826
863
|
return pageSizeOptions();
|
|
827
864
|
},
|
|
828
865
|
children: (opt) => (() => {
|
|
829
|
-
var _el$
|
|
830
|
-
insert(_el$
|
|
831
|
-
effect(() => setProperty(_el$
|
|
832
|
-
return _el$
|
|
866
|
+
var _el$123 = getNextElement(_tmpl$28);
|
|
867
|
+
insert(_el$123, () => opt.label);
|
|
868
|
+
effect(() => setProperty(_el$123, "value", opt.value));
|
|
869
|
+
return _el$123;
|
|
833
870
|
})()
|
|
834
871
|
}));
|
|
835
|
-
effect(() => setProperty(_el$
|
|
836
|
-
return _el$
|
|
837
|
-
})(), getNextElement(_tmpl$
|
|
872
|
+
effect(() => setProperty(_el$104, "value", clientPageSize()));
|
|
873
|
+
return _el$104;
|
|
874
|
+
})(), getNextElement(_tmpl$24)];
|
|
838
875
|
}
|
|
839
|
-
}), _el$
|
|
876
|
+
}), _el$107, _co$21);
|
|
840
877
|
effect((_p$) => {
|
|
841
878
|
var _v$8 = clientPage() === 0, _v$9 = clientPage() >= clientTotalPages() - 1;
|
|
842
|
-
_v$8 !== _p$.e && setProperty(_el$
|
|
843
|
-
_v$9 !== _p$.t && setProperty(_el$
|
|
879
|
+
_v$8 !== _p$.e && setProperty(_el$96, "disabled", _p$.e = _v$8);
|
|
880
|
+
_v$9 !== _p$.t && setProperty(_el$103, "disabled", _p$.t = _v$9);
|
|
844
881
|
return _p$;
|
|
845
882
|
}, {
|
|
846
883
|
e: void 0,
|
|
847
884
|
t: void 0
|
|
848
885
|
});
|
|
849
886
|
runHydrationEvents();
|
|
850
|
-
return _el$
|
|
887
|
+
return _el$85;
|
|
851
888
|
}
|
|
852
|
-
}), _el$
|
|
889
|
+
}), _el$115, _co$25);
|
|
853
890
|
effect((_p$) => {
|
|
854
891
|
var _v$0 = `relative w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group ${isExpanded() ? "flex-1 min-h-0 flex flex-col" : "h-full"}`, _v$1 = `p-4 ${isExpanded() ? "flex-1 min-h-0 flex flex-col" : ""}`, _v$10 = `overflow-x-auto ${isExpanded() ? "flex-1 min-h-0" : ""}`, _v$11 = (
|
|
855
892
|
// v6.1.0 — when expanded, the scroll container fills the
|
|
@@ -881,12 +918,12 @@ ${dataRows}`;
|
|
|
881
918
|
return {};
|
|
882
919
|
})()
|
|
883
920
|
), _v$12 = tableParams.title || "Data table", _v$13 = tableParams.title ? `${tableId}-title` : void 0;
|
|
884
|
-
_v$0 !== _p$.e && className(_el$
|
|
885
|
-
_v$1 !== _p$.t && className(_el$
|
|
886
|
-
_v$10 !== _p$.a && className(_el$
|
|
887
|
-
_p$.o = style(_el$
|
|
888
|
-
_v$12 !== _p$.i && setAttribute(_el$
|
|
889
|
-
_v$13 !== _p$.n && setAttribute(_el$
|
|
921
|
+
_v$0 !== _p$.e && className(_el$32, _p$.e = _v$0);
|
|
922
|
+
_v$1 !== _p$.t && className(_el$40, _p$.t = _v$1);
|
|
923
|
+
_v$10 !== _p$.a && className(_el$66, _p$.a = _v$10);
|
|
924
|
+
_p$.o = style(_el$66, _v$11, _p$.o);
|
|
925
|
+
_v$12 !== _p$.i && setAttribute(_el$66, "aria-label", _p$.i = _v$12);
|
|
926
|
+
_v$13 !== _p$.n && setAttribute(_el$67, "aria-labelledby", _p$.n = _v$13);
|
|
890
927
|
return _p$;
|
|
891
928
|
}, {
|
|
892
929
|
e: void 0,
|
|
@@ -896,7 +933,7 @@ ${dataRows}`;
|
|
|
896
933
|
i: void 0,
|
|
897
934
|
n: void 0
|
|
898
935
|
});
|
|
899
|
-
return _el$
|
|
936
|
+
return _el$32;
|
|
900
937
|
}
|
|
901
938
|
});
|
|
902
939
|
}
|
|
@@ -909,51 +946,51 @@ function MetricRenderer(props) {
|
|
|
909
946
|
return `${title}: ${value}${unit ? " " + unit : ""}`;
|
|
910
947
|
};
|
|
911
948
|
return (() => {
|
|
912
|
-
var _el$
|
|
913
|
-
insert(_el$
|
|
949
|
+
var _el$124 = getNextElement(_tmpl$32), _el$146 = _el$124.firstChild, [_el$147, _co$33] = getNextMarker(_el$146.nextSibling), _el$125 = _el$147.nextSibling, _el$126 = _el$125.firstChild, _el$127 = _el$126.firstChild, _el$128 = _el$127.nextSibling, _el$129 = _el$128.firstChild, _el$131 = _el$129.nextSibling, [_el$132, _co$28] = getNextMarker(_el$131.nextSibling), _el$142 = _el$126.nextSibling, [_el$143, _co$31] = getNextMarker(_el$142.nextSibling), _el$144 = _el$143.nextSibling, [_el$145, _co$32] = getNextMarker(_el$144.nextSibling);
|
|
950
|
+
insert(_el$124, createComponent(CopyButton, {
|
|
914
951
|
getText: getMetricText,
|
|
915
952
|
title: "Copy metric",
|
|
916
953
|
position: "top-right"
|
|
917
|
-
}), _el$
|
|
918
|
-
insert(_el$
|
|
919
|
-
insert(_el$
|
|
920
|
-
insert(_el$
|
|
954
|
+
}), _el$147, _co$33);
|
|
955
|
+
insert(_el$127, () => metricParams.title);
|
|
956
|
+
insert(_el$129, () => metricParams.value);
|
|
957
|
+
insert(_el$128, createComponent(Show, {
|
|
921
958
|
get when() {
|
|
922
959
|
return metricParams.unit;
|
|
923
960
|
},
|
|
924
961
|
get children() {
|
|
925
|
-
var _el$
|
|
926
|
-
insert(_el$
|
|
927
|
-
return _el$
|
|
962
|
+
var _el$130 = getNextElement(_tmpl$29);
|
|
963
|
+
insert(_el$130, () => metricParams.unit);
|
|
964
|
+
return _el$130;
|
|
928
965
|
}
|
|
929
|
-
}), _el$
|
|
930
|
-
insert(_el$
|
|
966
|
+
}), _el$132, _co$28);
|
|
967
|
+
insert(_el$125, createComponent(Show, {
|
|
931
968
|
get when() {
|
|
932
969
|
return metricParams.trend;
|
|
933
970
|
},
|
|
934
971
|
get children() {
|
|
935
|
-
var _el$
|
|
936
|
-
_el$
|
|
937
|
-
insert(_el$
|
|
972
|
+
var _el$133 = getNextElement(_tmpl$30), _el$134 = _el$133.firstChild, _el$137 = _el$134.firstChild, [_el$138, _co$29] = getNextMarker(_el$137.nextSibling), _el$135 = _el$138.nextSibling, _el$139 = _el$135.nextSibling, [_el$140, _co$30] = getNextMarker(_el$139.nextSibling);
|
|
973
|
+
_el$140.nextSibling;
|
|
974
|
+
insert(_el$134, (() => {
|
|
938
975
|
var _c$ = memo(() => metricParams.trend.direction === "up");
|
|
939
976
|
return () => _c$() ? "�" : metricParams.trend.direction === "down" ? "�" : "�";
|
|
940
|
-
})(), _el$
|
|
941
|
-
insert(_el$
|
|
942
|
-
effect(() => className(_el$
|
|
943
|
-
return _el$
|
|
977
|
+
})(), _el$138, _co$29);
|
|
978
|
+
insert(_el$134, () => Math.abs(metricParams.trend.value), _el$140, _co$30);
|
|
979
|
+
effect(() => className(_el$134, `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"}`));
|
|
980
|
+
return _el$133;
|
|
944
981
|
}
|
|
945
|
-
}), _el$
|
|
946
|
-
insert(_el$
|
|
982
|
+
}), _el$143, _co$31);
|
|
983
|
+
insert(_el$125, createComponent(Show, {
|
|
947
984
|
get when() {
|
|
948
985
|
return metricParams.subtitle;
|
|
949
986
|
},
|
|
950
987
|
get children() {
|
|
951
|
-
var _el$
|
|
952
|
-
insert(_el$
|
|
953
|
-
return _el$
|
|
988
|
+
var _el$141 = getNextElement(_tmpl$31);
|
|
989
|
+
insert(_el$141, () => metricParams.subtitle);
|
|
990
|
+
return _el$141;
|
|
954
991
|
}
|
|
955
|
-
}), _el$
|
|
956
|
-
return _el$
|
|
992
|
+
}), _el$145, _co$32);
|
|
993
|
+
return _el$124;
|
|
957
994
|
})();
|
|
958
995
|
}
|
|
959
996
|
function extractImageFromMarkdown(content) {
|
|
@@ -994,62 +1031,62 @@ function TextRenderer(props) {
|
|
|
994
1031
|
},
|
|
995
1032
|
get fallback() {
|
|
996
1033
|
return (() => {
|
|
997
|
-
var _el$
|
|
998
|
-
insert(_el$
|
|
1034
|
+
var _el$148 = getNextElement(_tmpl$33), _el$150 = _el$148.firstChild, [_el$151, _co$34] = getNextMarker(_el$150.nextSibling), _el$149 = _el$151.nextSibling;
|
|
1035
|
+
insert(_el$148, createComponent(CopyButton, {
|
|
999
1036
|
getText: getTextContent,
|
|
1000
1037
|
title: "Copy text",
|
|
1001
1038
|
position: "top-right"
|
|
1002
|
-
}), _el$
|
|
1039
|
+
}), _el$151, _co$34);
|
|
1003
1040
|
effect((_p$) => {
|
|
1004
1041
|
var _v$17 = `prose prose-sm dark:prose-invert max-w-none ${textParams.className || ""}`, _v$18 = htmlContent();
|
|
1005
|
-
_v$17 !== _p$.e && className(_el$
|
|
1006
|
-
_v$18 !== _p$.t && setProperty(_el$
|
|
1042
|
+
_v$17 !== _p$.e && className(_el$149, _p$.e = _v$17);
|
|
1043
|
+
_v$18 !== _p$.t && setProperty(_el$149, "innerHTML", _p$.t = _v$18);
|
|
1007
1044
|
return _p$;
|
|
1008
1045
|
}, {
|
|
1009
1046
|
e: void 0,
|
|
1010
1047
|
t: void 0
|
|
1011
1048
|
});
|
|
1012
|
-
return _el$
|
|
1049
|
+
return _el$148;
|
|
1013
1050
|
})();
|
|
1014
1051
|
},
|
|
1015
1052
|
children: (data) => (() => {
|
|
1016
|
-
var _el$
|
|
1017
|
-
insert(_el$
|
|
1053
|
+
var _el$152 = getNextElement(_tmpl$34), _el$153 = _el$152.firstChild, _el$154 = _el$153.firstChild, _el$155 = _el$154.firstChild, _el$156 = _el$153.nextSibling, _el$157 = _el$156.firstChild;
|
|
1054
|
+
insert(_el$157, () => data().credit);
|
|
1018
1055
|
effect((_p$) => {
|
|
1019
1056
|
var _v$19 = data().linkUrl, _v$20 = data().imageUrl, _v$21 = data().alt;
|
|
1020
|
-
_v$19 !== _p$.e && setAttribute(_el$
|
|
1021
|
-
_v$20 !== _p$.t && setAttribute(_el$
|
|
1022
|
-
_v$21 !== _p$.a && setAttribute(_el$
|
|
1057
|
+
_v$19 !== _p$.e && setAttribute(_el$154, "href", _p$.e = _v$19);
|
|
1058
|
+
_v$20 !== _p$.t && setAttribute(_el$155, "src", _p$.t = _v$20);
|
|
1059
|
+
_v$21 !== _p$.a && setAttribute(_el$155, "alt", _p$.a = _v$21);
|
|
1023
1060
|
return _p$;
|
|
1024
1061
|
}, {
|
|
1025
1062
|
e: void 0,
|
|
1026
1063
|
t: void 0,
|
|
1027
1064
|
a: void 0
|
|
1028
1065
|
});
|
|
1029
|
-
return _el$
|
|
1066
|
+
return _el$152;
|
|
1030
1067
|
})()
|
|
1031
1068
|
});
|
|
1032
1069
|
}
|
|
1033
1070
|
function IframeRenderer(props) {
|
|
1034
1071
|
const params = props.component.params;
|
|
1035
1072
|
return (() => {
|
|
1036
|
-
var _el$
|
|
1037
|
-
insert(_el$
|
|
1073
|
+
var _el$158 = getNextElement(_tmpl$36), _el$162 = _el$158.firstChild, [_el$163, _co$35] = getNextMarker(_el$162.nextSibling), _el$161 = _el$163.nextSibling;
|
|
1074
|
+
insert(_el$158, createComponent(Show, {
|
|
1038
1075
|
get when() {
|
|
1039
1076
|
return params.title;
|
|
1040
1077
|
},
|
|
1041
1078
|
get children() {
|
|
1042
|
-
var _el$
|
|
1043
|
-
insert(_el$
|
|
1044
|
-
return _el$
|
|
1079
|
+
var _el$159 = getNextElement(_tmpl$35), _el$160 = _el$159.firstChild;
|
|
1080
|
+
insert(_el$160, () => params.title);
|
|
1081
|
+
return _el$159;
|
|
1045
1082
|
}
|
|
1046
|
-
}), _el$
|
|
1083
|
+
}), _el$163, _co$35);
|
|
1047
1084
|
effect((_p$) => {
|
|
1048
1085
|
var _v$22 = params.url, _v$23 = params.title || "Embedded content", _v$24 = `height: ${params.height || "400px"}; min-height: 300px;`, _v$25 = getIframeSandbox(params.url);
|
|
1049
|
-
_v$22 !== _p$.e && setAttribute(_el$
|
|
1050
|
-
_v$23 !== _p$.t && setAttribute(_el$
|
|
1051
|
-
_p$.a = style(_el$
|
|
1052
|
-
_v$25 !== _p$.o && setAttribute(_el$
|
|
1086
|
+
_v$22 !== _p$.e && setAttribute(_el$161, "src", _p$.e = _v$22);
|
|
1087
|
+
_v$23 !== _p$.t && setAttribute(_el$161, "title", _p$.t = _v$23);
|
|
1088
|
+
_p$.a = style(_el$161, _v$24, _p$.a);
|
|
1089
|
+
_v$25 !== _p$.o && setAttribute(_el$161, "sandbox", _p$.o = _v$25);
|
|
1053
1090
|
return _p$;
|
|
1054
1091
|
}, {
|
|
1055
1092
|
e: void 0,
|
|
@@ -1057,30 +1094,30 @@ function IframeRenderer(props) {
|
|
|
1057
1094
|
a: void 0,
|
|
1058
1095
|
o: void 0
|
|
1059
1096
|
});
|
|
1060
|
-
return _el$
|
|
1097
|
+
return _el$158;
|
|
1061
1098
|
})();
|
|
1062
1099
|
}
|
|
1063
1100
|
function ImageRenderer(props) {
|
|
1064
1101
|
const params = props.component.params;
|
|
1065
1102
|
return (() => {
|
|
1066
|
-
var _el$
|
|
1067
|
-
insert(_el$
|
|
1103
|
+
var _el$164 = getNextElement(_tmpl$38), _el$165 = _el$164.firstChild, _el$166 = _el$165.firstChild, _el$167 = _el$166.firstChild, _el$170 = _el$165.nextSibling, [_el$171, _co$36] = getNextMarker(_el$170.nextSibling);
|
|
1104
|
+
insert(_el$164, createComponent(Show, {
|
|
1068
1105
|
get when() {
|
|
1069
1106
|
return params.caption;
|
|
1070
1107
|
},
|
|
1071
1108
|
get children() {
|
|
1072
|
-
var _el$
|
|
1073
|
-
insert(_el$
|
|
1074
|
-
return _el$
|
|
1109
|
+
var _el$168 = getNextElement(_tmpl$37), _el$169 = _el$168.firstChild;
|
|
1110
|
+
insert(_el$169, () => params.caption);
|
|
1111
|
+
return _el$168;
|
|
1075
1112
|
}
|
|
1076
|
-
}), _el$
|
|
1113
|
+
}), _el$171, _co$36);
|
|
1077
1114
|
effect((_p$) => {
|
|
1078
1115
|
var _v$26 = `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$27 = params.url, _v$28 = `View full size: ${params.alt || "image"}`, _v$29 = params.url, _v$30 = params.alt || "Image";
|
|
1079
|
-
_v$26 !== _p$.e && className(_el$
|
|
1080
|
-
_v$27 !== _p$.t && setAttribute(_el$
|
|
1081
|
-
_v$28 !== _p$.a && setAttribute(_el$
|
|
1082
|
-
_v$29 !== _p$.o && setAttribute(_el$
|
|
1083
|
-
_v$30 !== _p$.i && setAttribute(_el$
|
|
1116
|
+
_v$26 !== _p$.e && className(_el$164, _p$.e = _v$26);
|
|
1117
|
+
_v$27 !== _p$.t && setAttribute(_el$166, "href", _p$.t = _v$27);
|
|
1118
|
+
_v$28 !== _p$.a && setAttribute(_el$166, "aria-label", _p$.a = _v$28);
|
|
1119
|
+
_v$29 !== _p$.o && setAttribute(_el$167, "src", _p$.o = _v$29);
|
|
1120
|
+
_v$30 !== _p$.i && setAttribute(_el$167, "alt", _p$.i = _v$30);
|
|
1084
1121
|
return _p$;
|
|
1085
1122
|
}, {
|
|
1086
1123
|
e: void 0,
|
|
@@ -1089,30 +1126,30 @@ function ImageRenderer(props) {
|
|
|
1089
1126
|
o: void 0,
|
|
1090
1127
|
i: void 0
|
|
1091
1128
|
});
|
|
1092
|
-
return _el$
|
|
1129
|
+
return _el$164;
|
|
1093
1130
|
})();
|
|
1094
1131
|
}
|
|
1095
1132
|
function LinkRenderer(props) {
|
|
1096
1133
|
const params = props.component.params;
|
|
1097
1134
|
return (() => {
|
|
1098
|
-
var _el$
|
|
1099
|
-
_el$
|
|
1100
|
-
insert(_el$
|
|
1101
|
-
insert(_el$
|
|
1135
|
+
var _el$172 = getNextElement(_tmpl$40), _el$173 = _el$172.firstChild, _el$174 = _el$173.nextSibling, _el$175 = _el$174.firstChild, _el$177 = _el$175.nextSibling, [_el$178, _co$37] = getNextMarker(_el$177.nextSibling);
|
|
1136
|
+
_el$172.$$click = (e) => e.stopPropagation();
|
|
1137
|
+
insert(_el$175, () => params.label || params.url);
|
|
1138
|
+
insert(_el$174, createComponent(Show, {
|
|
1102
1139
|
get when() {
|
|
1103
1140
|
return params.description;
|
|
1104
1141
|
},
|
|
1105
1142
|
get children() {
|
|
1106
|
-
var _el$
|
|
1107
|
-
insert(_el$
|
|
1108
|
-
return _el$
|
|
1143
|
+
var _el$176 = getNextElement(_tmpl$39);
|
|
1144
|
+
insert(_el$176, () => params.description);
|
|
1145
|
+
return _el$176;
|
|
1109
1146
|
}
|
|
1110
|
-
}), _el$
|
|
1147
|
+
}), _el$178, _co$37);
|
|
1111
1148
|
effect((_p$) => {
|
|
1112
1149
|
var _v$31 = params.url, _v$32 = `${params.label || "Link"}: ${params.description || params.url} (opens in new tab)`, _v$33 = `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 || ""}`;
|
|
1113
|
-
_v$31 !== _p$.e && setAttribute(_el$
|
|
1114
|
-
_v$32 !== _p$.t && setAttribute(_el$
|
|
1115
|
-
_v$33 !== _p$.a && className(_el$
|
|
1150
|
+
_v$31 !== _p$.e && setAttribute(_el$172, "href", _p$.e = _v$31);
|
|
1151
|
+
_v$32 !== _p$.t && setAttribute(_el$172, "aria-label", _p$.t = _v$32);
|
|
1152
|
+
_v$33 !== _p$.a && className(_el$172, _p$.a = _v$33);
|
|
1116
1153
|
return _p$;
|
|
1117
1154
|
}, {
|
|
1118
1155
|
e: void 0,
|
|
@@ -1120,7 +1157,7 @@ function LinkRenderer(props) {
|
|
|
1120
1157
|
a: void 0
|
|
1121
1158
|
});
|
|
1122
1159
|
runHydrationEvents();
|
|
1123
|
-
return _el$
|
|
1160
|
+
return _el$172;
|
|
1124
1161
|
})();
|
|
1125
1162
|
}
|
|
1126
1163
|
function ComponentRenderer(props) {
|
|
@@ -1187,16 +1224,16 @@ function ComponentRenderer(props) {
|
|
|
1187
1224
|
}
|
|
1188
1225
|
if (mode === "inline-warn") {
|
|
1189
1226
|
return (() => {
|
|
1190
|
-
var _el$
|
|
1191
|
-
setAttribute(_el$
|
|
1192
|
-
insert(_el$
|
|
1193
|
-
return _el$
|
|
1227
|
+
var _el$179 = getNextElement(_tmpl$41), _el$180 = _el$179.firstChild, _el$181 = _el$180.nextSibling, _el$182 = _el$181.firstChild, _el$183 = _el$182.nextSibling, [_el$184, _co$38] = getNextMarker(_el$183.nextSibling);
|
|
1228
|
+
setAttribute(_el$179, "title", firstError);
|
|
1229
|
+
insert(_el$181, () => props.component.type, _el$184, _co$38);
|
|
1230
|
+
return _el$179;
|
|
1194
1231
|
})();
|
|
1195
1232
|
}
|
|
1196
1233
|
return (() => {
|
|
1197
|
-
var _el$
|
|
1198
|
-
insert(_el$
|
|
1199
|
-
return _el$
|
|
1234
|
+
var _el$185 = getNextElement(_tmpl$42), _el$186 = _el$185.firstChild, _el$187 = _el$186.nextSibling;
|
|
1235
|
+
insert(_el$187, firstError);
|
|
1236
|
+
return _el$185;
|
|
1200
1237
|
})();
|
|
1201
1238
|
}
|
|
1202
1239
|
return createComponent(GenerativeUIErrorBoundary, {
|
|
@@ -1225,6 +1262,9 @@ function ComponentRenderer(props) {
|
|
|
1225
1262
|
},
|
|
1226
1263
|
get toolbarVariant() {
|
|
1227
1264
|
return props.toolbarVariant;
|
|
1265
|
+
},
|
|
1266
|
+
get allowQuickchartFallback() {
|
|
1267
|
+
return props.allowQuickchartFallback;
|
|
1228
1268
|
}
|
|
1229
1269
|
});
|
|
1230
1270
|
}
|
|
@@ -1499,27 +1539,27 @@ function ActionRenderer(props) {
|
|
|
1499
1539
|
const isDisabled = () => params.disabled || isExecutable() && isExecuting();
|
|
1500
1540
|
if (params.type === "link" || params.action === "link") {
|
|
1501
1541
|
return (() => {
|
|
1502
|
-
var _el$
|
|
1503
|
-
_el$
|
|
1504
|
-
insert(_el$
|
|
1542
|
+
var _el$188 = getNextElement(_tmpl$44), _el$190 = _el$188.firstChild, [_el$191, _co$39] = getNextMarker(_el$190.nextSibling), _el$192 = _el$191.nextSibling, [_el$193, _co$40] = getNextMarker(_el$192.nextSibling);
|
|
1543
|
+
_el$188.$$click = handleClick;
|
|
1544
|
+
insert(_el$188, createComponent(Show, {
|
|
1505
1545
|
get when() {
|
|
1506
1546
|
return params.icon;
|
|
1507
1547
|
},
|
|
1508
1548
|
get children() {
|
|
1509
|
-
var _el$
|
|
1510
|
-
insert(_el$
|
|
1511
|
-
return _el$
|
|
1549
|
+
var _el$189 = getNextElement(_tmpl$43);
|
|
1550
|
+
insert(_el$189, () => params.icon);
|
|
1551
|
+
return _el$189;
|
|
1512
1552
|
}
|
|
1513
|
-
}), _el$
|
|
1514
|
-
insert(_el$
|
|
1553
|
+
}), _el$191, _co$39);
|
|
1554
|
+
insert(_el$188, () => params.label, _el$193, _co$40);
|
|
1515
1555
|
effect((_p$) => {
|
|
1516
1556
|
var _v$34 = params.url || "#", _v$35 = params.url ? "_blank" : void 0, _v$36 = params.ariaLabel || params.label, _v$37 = `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
|
|
1517
1557
|
${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"}
|
|
1518
1558
|
${params.className || ""}`;
|
|
1519
|
-
_v$34 !== _p$.e && setAttribute(_el$
|
|
1520
|
-
_v$35 !== _p$.t && setAttribute(_el$
|
|
1521
|
-
_v$36 !== _p$.a && setAttribute(_el$
|
|
1522
|
-
_v$37 !== _p$.o && className(_el$
|
|
1559
|
+
_v$34 !== _p$.e && setAttribute(_el$188, "href", _p$.e = _v$34);
|
|
1560
|
+
_v$35 !== _p$.t && setAttribute(_el$188, "target", _p$.t = _v$35);
|
|
1561
|
+
_v$36 !== _p$.a && setAttribute(_el$188, "aria-label", _p$.a = _v$36);
|
|
1562
|
+
_v$37 !== _p$.o && className(_el$188, _p$.o = _v$37);
|
|
1523
1563
|
return _p$;
|
|
1524
1564
|
}, {
|
|
1525
1565
|
e: void 0,
|
|
@@ -1528,41 +1568,41 @@ function ActionRenderer(props) {
|
|
|
1528
1568
|
o: void 0
|
|
1529
1569
|
});
|
|
1530
1570
|
runHydrationEvents();
|
|
1531
|
-
return _el$
|
|
1571
|
+
return _el$188;
|
|
1532
1572
|
})();
|
|
1533
1573
|
}
|
|
1534
1574
|
return (() => {
|
|
1535
|
-
var _el$
|
|
1536
|
-
_el$
|
|
1537
|
-
insert(_el$
|
|
1575
|
+
var _el$194 = getNextElement(_tmpl$46), _el$197 = _el$194.firstChild, [_el$198, _co$41] = getNextMarker(_el$197.nextSibling), _el$199 = _el$198.nextSibling, [_el$200, _co$42] = getNextMarker(_el$199.nextSibling), _el$201 = _el$200.nextSibling, [_el$202, _co$43] = getNextMarker(_el$201.nextSibling);
|
|
1576
|
+
_el$194.$$click = handleClick;
|
|
1577
|
+
insert(_el$194, createComponent(Show, {
|
|
1538
1578
|
get when() {
|
|
1539
1579
|
return memo(() => !!isExecuting())() && isExecutable();
|
|
1540
1580
|
},
|
|
1541
1581
|
get children() {
|
|
1542
|
-
return getNextElement(_tmpl$
|
|
1582
|
+
return getNextElement(_tmpl$45);
|
|
1543
1583
|
}
|
|
1544
|
-
}), _el$
|
|
1545
|
-
insert(_el$
|
|
1584
|
+
}), _el$198, _co$41);
|
|
1585
|
+
insert(_el$194, createComponent(Show, {
|
|
1546
1586
|
get when() {
|
|
1547
1587
|
return memo(() => !!params.icon)() && !(isExecuting() && isExecutable());
|
|
1548
1588
|
},
|
|
1549
1589
|
get children() {
|
|
1550
|
-
var _el$
|
|
1551
|
-
insert(_el$
|
|
1552
|
-
return _el$
|
|
1590
|
+
var _el$196 = getNextElement(_tmpl$43);
|
|
1591
|
+
insert(_el$196, () => params.icon);
|
|
1592
|
+
return _el$196;
|
|
1553
1593
|
}
|
|
1554
|
-
}), _el$
|
|
1555
|
-
insert(_el$
|
|
1594
|
+
}), _el$200, _co$42);
|
|
1595
|
+
insert(_el$194, () => params.label, _el$202, _co$43);
|
|
1556
1596
|
effect((_p$) => {
|
|
1557
1597
|
var _v$38 = isDisabled(), _v$39 = isExecuting() && isExecutable(), _v$40 = params.ariaLabel || params.label, _v$41 = `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
|
|
1558
1598
|
${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"}
|
|
1559
1599
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1560
1600
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1561
1601
|
${params.className || ""}`;
|
|
1562
|
-
_v$38 !== _p$.e && setProperty(_el$
|
|
1563
|
-
_v$39 !== _p$.t && setAttribute(_el$
|
|
1564
|
-
_v$40 !== _p$.a && setAttribute(_el$
|
|
1565
|
-
_v$41 !== _p$.o && className(_el$
|
|
1602
|
+
_v$38 !== _p$.e && setProperty(_el$194, "disabled", _p$.e = _v$38);
|
|
1603
|
+
_v$39 !== _p$.t && setAttribute(_el$194, "aria-busy", _p$.t = _v$39);
|
|
1604
|
+
_v$40 !== _p$.a && setAttribute(_el$194, "aria-label", _p$.a = _v$40);
|
|
1605
|
+
_v$41 !== _p$.o && className(_el$194, _p$.o = _v$41);
|
|
1566
1606
|
return _p$;
|
|
1567
1607
|
}, {
|
|
1568
1608
|
e: void 0,
|
|
@@ -1571,7 +1611,7 @@ function ActionRenderer(props) {
|
|
|
1571
1611
|
o: void 0
|
|
1572
1612
|
});
|
|
1573
1613
|
runHydrationEvents();
|
|
1574
|
-
return _el$
|
|
1614
|
+
return _el$194;
|
|
1575
1615
|
})();
|
|
1576
1616
|
}
|
|
1577
1617
|
function ErrorCardRenderer(props) {
|
|
@@ -1579,55 +1619,55 @@ function ErrorCardRenderer(props) {
|
|
|
1579
1619
|
return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
|
|
1580
1620
|
};
|
|
1581
1621
|
return (() => {
|
|
1582
|
-
var _el$
|
|
1583
|
-
insert(_el$
|
|
1622
|
+
var _el$203 = getNextElement(_tmpl$50), _el$226 = _el$203.firstChild, [_el$227, _co$49] = getNextMarker(_el$226.nextSibling), _el$204 = _el$227.nextSibling, _el$205 = _el$204.firstChild, _el$206 = _el$205.nextSibling, _el$207 = _el$206.firstChild, _el$208 = _el$207.firstChild, _el$209 = _el$208.nextSibling, [_el$210, _co$44] = getNextMarker(_el$209.nextSibling), _el$211 = _el$207.nextSibling, _el$220 = _el$211.nextSibling, [_el$221, _co$46] = getNextMarker(_el$220.nextSibling), _el$222 = _el$221.nextSibling, [_el$223, _co$47] = getNextMarker(_el$222.nextSibling), _el$224 = _el$223.nextSibling, [_el$225, _co$48] = getNextMarker(_el$224.nextSibling);
|
|
1623
|
+
insert(_el$203, createComponent(CopyButton, {
|
|
1584
1624
|
getText: getErrorText,
|
|
1585
1625
|
title: "Copy error details",
|
|
1586
1626
|
position: "top-right"
|
|
1587
|
-
}), _el$
|
|
1588
|
-
insert(_el$
|
|
1589
|
-
insert(_el$
|
|
1590
|
-
insert(_el$
|
|
1627
|
+
}), _el$227, _co$49);
|
|
1628
|
+
insert(_el$207, () => props.error.tool || "Unknown", _el$210, _co$44);
|
|
1629
|
+
insert(_el$211, () => props.error.message || "An error occurred during tool execution");
|
|
1630
|
+
insert(_el$206, createComponent(Show, {
|
|
1591
1631
|
get when() {
|
|
1592
1632
|
return props.error.type;
|
|
1593
1633
|
},
|
|
1594
1634
|
get children() {
|
|
1595
|
-
var _el$
|
|
1596
|
-
insert(_el$
|
|
1597
|
-
return _el$
|
|
1635
|
+
var _el$212 = getNextElement(_tmpl$47), _el$213 = _el$212.firstChild, _el$214 = _el$213.nextSibling, [_el$215, _co$45] = getNextMarker(_el$214.nextSibling);
|
|
1636
|
+
insert(_el$212, () => props.error.type, _el$215, _co$45);
|
|
1637
|
+
return _el$212;
|
|
1598
1638
|
}
|
|
1599
|
-
}), _el$
|
|
1600
|
-
insert(_el$
|
|
1639
|
+
}), _el$221, _co$46);
|
|
1640
|
+
insert(_el$206, createComponent(Show, {
|
|
1601
1641
|
get when() {
|
|
1602
1642
|
var _a;
|
|
1603
1643
|
return (_a = props.error.suggestions) == null ? void 0 : _a.length;
|
|
1604
1644
|
},
|
|
1605
1645
|
get children() {
|
|
1606
|
-
var _el$
|
|
1607
|
-
insert(_el$
|
|
1646
|
+
var _el$216 = getNextElement(_tmpl$48), _el$217 = _el$216.firstChild, _el$218 = _el$217.nextSibling;
|
|
1647
|
+
insert(_el$218, createComponent(For, {
|
|
1608
1648
|
get each() {
|
|
1609
1649
|
return props.error.suggestions;
|
|
1610
1650
|
},
|
|
1611
1651
|
children: (suggestion) => (() => {
|
|
1612
|
-
var _el$
|
|
1613
|
-
insert(_el$
|
|
1614
|
-
return _el$
|
|
1652
|
+
var _el$228 = getNextElement(_tmpl$51);
|
|
1653
|
+
insert(_el$228, suggestion);
|
|
1654
|
+
return _el$228;
|
|
1615
1655
|
})()
|
|
1616
1656
|
}));
|
|
1617
|
-
return _el$
|
|
1657
|
+
return _el$216;
|
|
1618
1658
|
}
|
|
1619
|
-
}), _el$
|
|
1620
|
-
insert(_el$
|
|
1659
|
+
}), _el$223, _co$47);
|
|
1660
|
+
insert(_el$206, createComponent(Show, {
|
|
1621
1661
|
get when() {
|
|
1622
1662
|
return props.error.timestamp;
|
|
1623
1663
|
},
|
|
1624
1664
|
get children() {
|
|
1625
|
-
var _el$
|
|
1626
|
-
insert(_el$
|
|
1627
|
-
return _el$
|
|
1665
|
+
var _el$219 = getNextElement(_tmpl$49);
|
|
1666
|
+
insert(_el$219, () => new Date(props.error.timestamp).toLocaleString());
|
|
1667
|
+
return _el$219;
|
|
1628
1668
|
}
|
|
1629
|
-
}), _el$
|
|
1630
|
-
return _el$
|
|
1669
|
+
}), _el$225, _co$48);
|
|
1670
|
+
return _el$203;
|
|
1631
1671
|
})();
|
|
1632
1672
|
}
|
|
1633
1673
|
function isErrorResponse(content) {
|
|
@@ -1650,20 +1690,20 @@ function UIResourceHtmlRenderer(props) {
|
|
|
1650
1690
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
|
|
1651
1691
|
};
|
|
1652
1692
|
return (() => {
|
|
1653
|
-
var _el$
|
|
1654
|
-
insert(_el$
|
|
1693
|
+
var _el$229 = getNextElement(_tmpl$53), _el$233 = _el$229.firstChild, [_el$234, _co$50] = getNextMarker(_el$233.nextSibling), _el$232 = _el$234.nextSibling;
|
|
1694
|
+
insert(_el$229, createComponent(Show, {
|
|
1655
1695
|
get when() {
|
|
1656
1696
|
var _a;
|
|
1657
1697
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
|
|
1658
1698
|
},
|
|
1659
1699
|
get children() {
|
|
1660
|
-
var _el$
|
|
1661
|
-
insert(_el$
|
|
1662
|
-
return _el$
|
|
1700
|
+
var _el$230 = getNextElement(_tmpl$52), _el$231 = _el$230.firstChild;
|
|
1701
|
+
insert(_el$231, resourceTitle);
|
|
1702
|
+
return _el$230;
|
|
1663
1703
|
}
|
|
1664
|
-
}), _el$
|
|
1665
|
-
effect(() => setProperty(_el$
|
|
1666
|
-
return _el$
|
|
1704
|
+
}), _el$234, _co$50);
|
|
1705
|
+
effect(() => setProperty(_el$232, "innerHTML", htmlContent()));
|
|
1706
|
+
return _el$229;
|
|
1667
1707
|
})();
|
|
1668
1708
|
}
|
|
1669
1709
|
const UIResourceRenderer = (props) => {
|
|
@@ -1761,13 +1801,16 @@ const UIResourceRenderer = (props) => {
|
|
|
1761
1801
|
},
|
|
1762
1802
|
get toolbarVariant() {
|
|
1763
1803
|
return props.toolbarVariant;
|
|
1804
|
+
},
|
|
1805
|
+
get allowQuickchartFallback() {
|
|
1806
|
+
return props.allowQuickchartFallback;
|
|
1764
1807
|
}
|
|
1765
1808
|
});
|
|
1766
1809
|
return createComponent(RenderProvider, {
|
|
1767
1810
|
renderComponent,
|
|
1768
1811
|
get children() {
|
|
1769
|
-
var _el$
|
|
1770
|
-
spread(_el$
|
|
1812
|
+
var _el$235 = getNextElement(_tmpl$54), _el$236 = _el$235.firstChild, _el$237 = _el$236.nextSibling, [_el$238, _co$51] = getNextMarker(_el$237.nextSibling);
|
|
1813
|
+
spread(_el$235, mergeProps({
|
|
1771
1814
|
get ["class"]() {
|
|
1772
1815
|
return `w-full ${props.class || ""}`;
|
|
1773
1816
|
}
|
|
@@ -1776,13 +1819,13 @@ const UIResourceRenderer = (props) => {
|
|
|
1776
1819
|
} : {
|
|
1777
1820
|
"data-mcp-ui-component-id": outerKey()
|
|
1778
1821
|
}), false, true);
|
|
1779
|
-
insert(_el$
|
|
1822
|
+
insert(_el$236, createComponent(For, {
|
|
1780
1823
|
get each() {
|
|
1781
1824
|
return layoutData.components;
|
|
1782
1825
|
},
|
|
1783
1826
|
children: (component) => (() => {
|
|
1784
|
-
var _el$
|
|
1785
|
-
insert(_el$
|
|
1827
|
+
var _el$239 = getNextElement(_tmpl$55);
|
|
1828
|
+
insert(_el$239, createComponent(ComponentRenderer, {
|
|
1786
1829
|
component,
|
|
1787
1830
|
get onError() {
|
|
1788
1831
|
return props.onError;
|
|
@@ -1792,21 +1835,24 @@ const UIResourceRenderer = (props) => {
|
|
|
1792
1835
|
},
|
|
1793
1836
|
get toolbarVariant() {
|
|
1794
1837
|
return props.toolbarVariant;
|
|
1838
|
+
},
|
|
1839
|
+
get allowQuickchartFallback() {
|
|
1840
|
+
return props.allowQuickchartFallback;
|
|
1795
1841
|
}
|
|
1796
1842
|
}));
|
|
1797
1843
|
effect((_p$) => {
|
|
1798
1844
|
var _v$42 = getGridStyleString(component), _v$43 = getUiResourceStableKey(component);
|
|
1799
|
-
_p$.e = style(_el$
|
|
1800
|
-
_v$43 !== _p$.t && setAttribute(_el$
|
|
1845
|
+
_p$.e = style(_el$239, _v$42, _p$.e);
|
|
1846
|
+
_v$43 !== _p$.t && setAttribute(_el$239, "data-mcp-ui-component-id", _p$.t = _v$43);
|
|
1801
1847
|
return _p$;
|
|
1802
1848
|
}, {
|
|
1803
1849
|
e: void 0,
|
|
1804
1850
|
t: void 0
|
|
1805
1851
|
});
|
|
1806
|
-
return _el$
|
|
1852
|
+
return _el$239;
|
|
1807
1853
|
})()
|
|
1808
1854
|
}));
|
|
1809
|
-
insert(_el$
|
|
1855
|
+
insert(_el$235, createComponent(Show, {
|
|
1810
1856
|
get when() {
|
|
1811
1857
|
return shouldShowAutoFooter();
|
|
1812
1858
|
},
|
|
@@ -1817,10 +1863,10 @@ const UIResourceRenderer = (props) => {
|
|
|
1817
1863
|
}
|
|
1818
1864
|
});
|
|
1819
1865
|
}
|
|
1820
|
-
}), _el$
|
|
1821
|
-
effect((_$p) => style(_el$
|
|
1866
|
+
}), _el$238, _co$51);
|
|
1867
|
+
effect((_$p) => style(_el$236, gridContainerStyle(), _$p));
|
|
1822
1868
|
runHydrationEvents();
|
|
1823
|
-
return _el$
|
|
1869
|
+
return _el$235;
|
|
1824
1870
|
}
|
|
1825
1871
|
});
|
|
1826
1872
|
};
|