@seed-ship/mcp-ui-solid 6.3.1 → 6.5.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 +156 -0
- package/dist/components/GraphRenderer.cjs +30 -24
- package/dist/components/GraphRenderer.cjs.map +1 -1
- package/dist/components/GraphRenderer.d.ts.map +1 -1
- package/dist/components/GraphRenderer.js +30 -24
- package/dist/components/GraphRenderer.js.map +1 -1
- package/dist/components/PortalDropdownMenu.cjs +82 -0
- package/dist/components/PortalDropdownMenu.cjs.map +1 -0
- package/dist/components/PortalDropdownMenu.d.ts +56 -0
- package/dist/components/PortalDropdownMenu.d.ts.map +1 -0
- package/dist/components/PortalDropdownMenu.js +82 -0
- package/dist/components/PortalDropdownMenu.js.map +1 -0
- package/dist/components/UIResourceRenderer.cjs +297 -263
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts +20 -0
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +299 -265
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components.cjs +2 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +2 -0
- package/dist/components.d.ts +2 -0
- package/dist/components.js +2 -0
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/duplicate-mount-registry.cjs +27 -0
- package/dist/utils/duplicate-mount-registry.cjs.map +1 -0
- package/dist/utils/duplicate-mount-registry.d.ts +84 -0
- package/dist/utils/duplicate-mount-registry.d.ts.map +1 -0
- package/dist/utils/duplicate-mount-registry.js +27 -0
- package/dist/utils/duplicate-mount-registry.js.map +1 -0
- package/dist/utils/stable-key.cjs +41 -0
- package/dist/utils/stable-key.cjs.map +1 -0
- package/dist/utils/stable-key.d.ts +33 -0
- package/dist/utils/stable-key.d.ts.map +1 -0
- package/dist/utils/stable-key.js +41 -0
- package/dist/utils/stable-key.js.map +1 -0
- package/package.json +1 -1
- package/src/components/GraphRenderer.tsx +29 -20
- package/src/components/PortalDropdownMenu.test.tsx +113 -0
- package/src/components/PortalDropdownMenu.tsx +130 -0
- package/src/components/UIResourceRenderer.identity.test.tsx +161 -0
- package/src/components/UIResourceRenderer.tsx +85 -15
- package/src/components/index.ts +4 -0
- package/src/index.ts +10 -0
- package/src/utils/duplicate-mount-registry.test.ts +82 -0
- package/src/utils/duplicate-mount-registry.ts +113 -0
- package/src/utils/stable-key.test.ts +96 -0
- package/src/utils/stable-key.ts +91 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -6,6 +6,9 @@ const solidJs = require("solid-js");
|
|
|
6
6
|
const validation = require("../services/validation.cjs");
|
|
7
7
|
const GenerativeUIErrorBoundary = require("./GenerativeUIErrorBoundary.cjs");
|
|
8
8
|
const perf = require("../utils/perf.cjs");
|
|
9
|
+
const logger = require("../utils/logger.cjs");
|
|
10
|
+
const stableKey = require("../utils/stable-key.cjs");
|
|
11
|
+
const duplicateMountRegistry = require("../utils/duplicate-mount-registry.cjs");
|
|
9
12
|
const MCPUITelemetryContext = require("../context/MCPUITelemetryContext.cjs");
|
|
10
13
|
const GridRenderer = require("./GridRenderer.cjs");
|
|
11
14
|
const FooterRenderer = require("./FooterRenderer.cjs");
|
|
@@ -21,10 +24,11 @@ const CodeBlockRenderer = require("./CodeBlockRenderer.cjs");
|
|
|
21
24
|
const MapRenderer = require("./MapRenderer.cjs");
|
|
22
25
|
const GraphRenderer = require("./GraphRenderer.cjs");
|
|
23
26
|
const ExpandableWrapper = require("./ExpandableWrapper.cjs");
|
|
27
|
+
const PortalDropdownMenu = require("./PortalDropdownMenu.cjs");
|
|
24
28
|
const RenderContext = require("./RenderContext.cjs");
|
|
25
29
|
const useAction = require("../hooks/useAction.cjs");
|
|
26
30
|
const marked_esm = require("../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.cjs");
|
|
27
|
-
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 flex-shrink-0"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ web.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__ */ web.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__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$22 = /* @__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$23 = /* @__PURE__ */ web.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__ */ web.template(`<span class=text-gray-400>/ page`), _tmpl$25 = /* @__PURE__ */ web.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__ */ web.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__ */ 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-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__ */ web.template(`<option>`), _tmpl$29 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$30 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$31 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$32 = /* @__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$33 = /* @__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$34 = /* @__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$35 = /* @__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$36 = /* @__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"loading=lazy>`, true, false, false), _tmpl$37 = /* @__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$38 = /* @__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$39 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$40 = /* @__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$41 = /* @__PURE__ */ web.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__ */ 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$43 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$44 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$45 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$46 = /* @__PURE__ */ web.template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$47 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$48 = /* @__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$49 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$50 = /* @__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$51 = /* @__PURE__ */ web.template(`<li>`), _tmpl$52 = /* @__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$53 = /* @__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$54 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$55 = /* @__PURE__ */ web.template(`<div>`);
|
|
31
|
+
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-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__ */ 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 flex-shrink-0"><!$><!/><!$><!/>`), _tmpl$18 = /* @__PURE__ */ web.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__ */ web.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__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$21 = /* @__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$22 = /* @__PURE__ */ web.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__ */ web.template(`<span class=text-gray-400>/ page`), _tmpl$24 = /* @__PURE__ */ web.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__ */ web.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__ */ 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-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__ */ web.template(`<option>`), _tmpl$28 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$29 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$30 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$31 = /* @__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$32 = /* @__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$33 = /* @__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$34 = /* @__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$35 = /* @__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"loading=lazy>`, true, false, false), _tmpl$36 = /* @__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$37 = /* @__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$38 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$39 = /* @__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$40 = /* @__PURE__ */ web.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__ */ 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$42 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$43 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$44 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$45 = /* @__PURE__ */ web.template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$46 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$47 = /* @__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$48 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$49 = /* @__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$50 = /* @__PURE__ */ web.template(`<li>`), _tmpl$51 = /* @__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$52 = /* @__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$53 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$54 = /* @__PURE__ */ web.template(`<div>`);
|
|
28
32
|
function CopyButton(props) {
|
|
29
33
|
const [copied, setCopied] = solidJs.createSignal(false);
|
|
30
34
|
const handleCopy = async () => {
|
|
@@ -523,6 +527,7 @@ ${dataRows}`;
|
|
|
523
527
|
const exportFormats = typeof exportable === "object" && (exportable == null ? void 0 : exportable.formats) ? exportable.formats : ["csv", "json"];
|
|
524
528
|
const exportFilename = typeof exportable === "object" && (exportable == null ? void 0 : exportable.filename) || `table-${Math.random().toString(36).slice(2, 9)}`;
|
|
525
529
|
const [showExportMenu, setShowExportMenu] = solidJs.createSignal(false);
|
|
530
|
+
let exportTriggerRef;
|
|
526
531
|
const handleExport = (format) => {
|
|
527
532
|
setShowExportMenu(false);
|
|
528
533
|
switch (format) {
|
|
@@ -617,7 +622,7 @@ ${dataRows}`;
|
|
|
617
622
|
return props.toolbarVariant;
|
|
618
623
|
},
|
|
619
624
|
get children() {
|
|
620
|
-
var _el$29 = web.getNextElement(_tmpl$
|
|
625
|
+
var _el$29 = web.getNextElement(_tmpl$25), _el$113 = _el$29.firstChild, [_el$114, _co$25] = web.getNextMarker(_el$113.nextSibling), _el$37 = _el$114.nextSibling, _el$105 = _el$37.firstChild, [_el$106, _co$21] = web.getNextMarker(_el$105.nextSibling), _el$107 = _el$106.nextSibling, [_el$108, _co$22] = web.getNextMarker(_el$107.nextSibling), _el$63 = _el$108.nextSibling, _el$64 = _el$63.firstChild, _el$65 = _el$64.firstChild, _el$66 = _el$65.firstChild, _el$67 = _el$65.nextSibling, [_el$68, _co$11] = web.getNextMarker(_el$67.nextSibling), _el$109 = _el$63.nextSibling, [_el$110, _co$23] = web.getNextMarker(_el$109.nextSibling), _el$111 = _el$110.nextSibling, [_el$112, _co$24] = web.getNextMarker(_el$111.nextSibling);
|
|
621
626
|
web.insert(_el$29, web.createComponent(solidJs.Show, {
|
|
622
627
|
when: exportable,
|
|
623
628
|
get fallback() {
|
|
@@ -628,131 +633,133 @@ ${dataRows}`;
|
|
|
628
633
|
});
|
|
629
634
|
},
|
|
630
635
|
get children() {
|
|
631
|
-
var _el$30 = web.getNextElement(_tmpl$
|
|
636
|
+
var _el$30 = web.getNextElement(_tmpl$15), _el$31 = _el$30.firstChild, _el$35 = _el$31.nextSibling, [_el$36, _co$5] = web.getNextMarker(_el$35.nextSibling);
|
|
632
637
|
_el$31.$$click = () => setShowExportMenu(!showExportMenu());
|
|
633
|
-
|
|
634
|
-
|
|
638
|
+
var _ref$ = exportTriggerRef;
|
|
639
|
+
typeof _ref$ === "function" ? web.use(_ref$, _el$31) : exportTriggerRef = _el$31;
|
|
640
|
+
web.insert(_el$30, web.createComponent(PortalDropdownMenu.PortalDropdownMenu, {
|
|
641
|
+
get open() {
|
|
635
642
|
return showExportMenu();
|
|
636
643
|
},
|
|
644
|
+
onClose: () => setShowExportMenu(false),
|
|
645
|
+
trigger: exportTriggerRef,
|
|
646
|
+
width: 144,
|
|
637
647
|
get children() {
|
|
638
|
-
|
|
639
|
-
web.insert(_el$32, web.createComponent(solidJs.Show, {
|
|
648
|
+
return [web.createComponent(solidJs.Show, {
|
|
640
649
|
get when() {
|
|
641
650
|
return exportFormats.includes("tsv");
|
|
642
651
|
},
|
|
643
652
|
get children() {
|
|
644
|
-
var _el$
|
|
645
|
-
_el$
|
|
653
|
+
var _el$32 = web.getNextElement(_tmpl$12);
|
|
654
|
+
_el$32.$$click = () => handleExport("tsv");
|
|
646
655
|
web.runHydrationEvents();
|
|
647
|
-
return _el$
|
|
656
|
+
return _el$32;
|
|
648
657
|
}
|
|
649
|
-
}),
|
|
650
|
-
web.insert(_el$32, web.createComponent(solidJs.Show, {
|
|
658
|
+
}), web.createComponent(solidJs.Show, {
|
|
651
659
|
get when() {
|
|
652
660
|
return exportFormats.includes("csv");
|
|
653
661
|
},
|
|
654
662
|
get children() {
|
|
655
|
-
var _el$
|
|
656
|
-
_el$
|
|
663
|
+
var _el$33 = web.getNextElement(_tmpl$13);
|
|
664
|
+
_el$33.$$click = () => handleExport("csv");
|
|
657
665
|
web.runHydrationEvents();
|
|
658
|
-
return _el$
|
|
666
|
+
return _el$33;
|
|
659
667
|
}
|
|
660
|
-
}),
|
|
661
|
-
web.insert(_el$32, web.createComponent(solidJs.Show, {
|
|
668
|
+
}), web.createComponent(solidJs.Show, {
|
|
662
669
|
get when() {
|
|
663
670
|
return exportFormats.includes("json");
|
|
664
671
|
},
|
|
665
672
|
get children() {
|
|
666
|
-
var _el$
|
|
667
|
-
_el$
|
|
673
|
+
var _el$34 = web.getNextElement(_tmpl$14);
|
|
674
|
+
_el$34.$$click = () => handleExport("json");
|
|
668
675
|
web.runHydrationEvents();
|
|
669
|
-
return _el$
|
|
676
|
+
return _el$34;
|
|
670
677
|
}
|
|
671
|
-
})
|
|
672
|
-
return _el$32;
|
|
678
|
+
})];
|
|
673
679
|
}
|
|
674
|
-
}), _el$
|
|
680
|
+
}), _el$36, _co$5);
|
|
681
|
+
web.effect(() => web.setAttribute(_el$31, "aria-expanded", showExportMenu()));
|
|
675
682
|
web.runHydrationEvents();
|
|
676
683
|
return _el$30;
|
|
677
684
|
}
|
|
678
|
-
}), _el$
|
|
679
|
-
web.insert(_el$
|
|
685
|
+
}), _el$114, _co$25);
|
|
686
|
+
web.insert(_el$37, web.createComponent(solidJs.Show, {
|
|
680
687
|
get when() {
|
|
681
688
|
return tableParams.title;
|
|
682
689
|
},
|
|
683
690
|
get children() {
|
|
684
|
-
var _el$
|
|
685
|
-
web.setAttribute(_el$
|
|
686
|
-
web.insert(_el$
|
|
687
|
-
web.insert(_el$
|
|
691
|
+
var _el$38 = web.getNextElement(_tmpl$17), _el$44 = _el$38.firstChild, [_el$45, _co$7] = web.getNextMarker(_el$44.nextSibling), _el$46 = _el$45.nextSibling, [_el$47, _co$8] = web.getNextMarker(_el$46.nextSibling);
|
|
692
|
+
web.setAttribute(_el$38, "id", `${tableId}-title`);
|
|
693
|
+
web.insert(_el$38, () => tableParams.title, _el$45, _co$7);
|
|
694
|
+
web.insert(_el$38, web.createComponent(solidJs.Show, {
|
|
688
695
|
get when() {
|
|
689
696
|
return isVirtualizing();
|
|
690
697
|
},
|
|
691
698
|
get children() {
|
|
692
|
-
var _el$
|
|
693
|
-
_el$
|
|
694
|
-
web.insert(_el$
|
|
699
|
+
var _el$39 = web.getNextElement(_tmpl$16), _el$40 = _el$39.firstChild, _el$42 = _el$40.nextSibling, [_el$43, _co$6] = web.getNextMarker(_el$42.nextSibling);
|
|
700
|
+
_el$43.nextSibling;
|
|
701
|
+
web.insert(_el$39, () => {
|
|
695
702
|
var _a;
|
|
696
703
|
return (_a = tableParams.rows) == null ? void 0 : _a.length;
|
|
697
|
-
}, _el$
|
|
698
|
-
return _el$
|
|
704
|
+
}, _el$43, _co$6);
|
|
705
|
+
return _el$39;
|
|
699
706
|
}
|
|
700
|
-
}), _el$
|
|
701
|
-
return _el$
|
|
707
|
+
}), _el$47, _co$8);
|
|
708
|
+
return _el$38;
|
|
702
709
|
}
|
|
703
|
-
}), _el$
|
|
704
|
-
web.insert(_el$
|
|
710
|
+
}), _el$106, _co$21);
|
|
711
|
+
web.insert(_el$37, web.createComponent(solidJs.Show, {
|
|
705
712
|
get when() {
|
|
706
713
|
return isSearchable();
|
|
707
714
|
},
|
|
708
715
|
get children() {
|
|
709
716
|
return [(() => {
|
|
710
|
-
var _el$
|
|
711
|
-
_el$
|
|
712
|
-
web.insert(_el$
|
|
717
|
+
var _el$48 = web.getNextElement(_tmpl$19), _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling, _el$52 = _el$50.nextSibling, [_el$53, _co$9] = web.getNextMarker(_el$52.nextSibling);
|
|
718
|
+
_el$50.$$input = (e) => handleSearch(e.currentTarget.value);
|
|
719
|
+
web.insert(_el$48, web.createComponent(solidJs.Show, {
|
|
713
720
|
get when() {
|
|
714
721
|
return searchQuery();
|
|
715
722
|
},
|
|
716
723
|
get children() {
|
|
717
|
-
var _el$
|
|
718
|
-
_el$
|
|
724
|
+
var _el$51 = web.getNextElement(_tmpl$18);
|
|
725
|
+
_el$51.$$click = () => {
|
|
719
726
|
handleSearch("");
|
|
720
727
|
setSearchQuery("");
|
|
721
728
|
setDebouncedQuery("");
|
|
722
729
|
};
|
|
723
730
|
web.runHydrationEvents();
|
|
724
|
-
return _el$
|
|
731
|
+
return _el$51;
|
|
725
732
|
}
|
|
726
|
-
}), _el$
|
|
727
|
-
web.effect(() => web.setAttribute(_el$
|
|
728
|
-
web.effect(() => web.setProperty(_el$
|
|
733
|
+
}), _el$53, _co$9);
|
|
734
|
+
web.effect(() => web.setAttribute(_el$50, "placeholder", searchPlaceholder()));
|
|
735
|
+
web.effect(() => web.setProperty(_el$50, "value", searchQuery()));
|
|
729
736
|
web.runHydrationEvents();
|
|
730
|
-
return _el$
|
|
737
|
+
return _el$48;
|
|
731
738
|
})(), web.createComponent(solidJs.Show, {
|
|
732
739
|
get when() {
|
|
733
740
|
return web.memo(() => !!debouncedQuery())() && filteredRows().length !== sortedRows().length;
|
|
734
741
|
},
|
|
735
742
|
get children() {
|
|
736
|
-
var _el$
|
|
737
|
-
web.insert(_el$
|
|
738
|
-
web.insert(_el$
|
|
739
|
-
web.insert(_el$
|
|
740
|
-
return _el$
|
|
743
|
+
var _el$54 = web.getNextElement(_tmpl$20), _el$57 = _el$54.firstChild, [_el$58, _co$0] = web.getNextMarker(_el$57.nextSibling), _el$55 = _el$58.nextSibling, _el$59 = _el$55.nextSibling, [_el$60, _co$1] = web.getNextMarker(_el$59.nextSibling), _el$56 = _el$60.nextSibling, _el$61 = _el$56.nextSibling, [_el$62, _co$10] = web.getNextMarker(_el$61.nextSibling);
|
|
744
|
+
web.insert(_el$54, () => filteredRows().length, _el$58, _co$0);
|
|
745
|
+
web.insert(_el$54, () => filteredRows().length !== 1 ? "s" : "", _el$60, _co$1);
|
|
746
|
+
web.insert(_el$54, () => sortedRows().length, _el$62, _co$10);
|
|
747
|
+
return _el$54;
|
|
741
748
|
}
|
|
742
749
|
})];
|
|
743
750
|
}
|
|
744
|
-
}), _el$
|
|
745
|
-
var _ref$ = scrollContainerRef;
|
|
746
|
-
typeof _ref$ === "function" ? web.use(_ref
|
|
747
|
-
web.insert(_el$
|
|
751
|
+
}), _el$108, _co$22);
|
|
752
|
+
var _ref$2 = scrollContainerRef;
|
|
753
|
+
typeof _ref$2 === "function" ? web.use(_ref$2, _el$63) : scrollContainerRef = _el$63;
|
|
754
|
+
web.insert(_el$66, web.createComponent(solidJs.For, {
|
|
748
755
|
get each() {
|
|
749
756
|
return tableParams.columns;
|
|
750
757
|
},
|
|
751
758
|
children: (column) => (() => {
|
|
752
|
-
var _el$
|
|
753
|
-
web.addEventListener(_el$
|
|
754
|
-
web.insert(_el$
|
|
755
|
-
web.insert(_el$
|
|
759
|
+
var _el$115 = web.getNextElement(_tmpl$26), _el$116 = _el$115.firstChild, _el$118 = _el$116.firstChild, [_el$119, _co$26] = web.getNextMarker(_el$118.nextSibling), _el$117 = _el$119.nextSibling;
|
|
760
|
+
web.addEventListener(_el$115, "click", () => handleSort(column.key));
|
|
761
|
+
web.insert(_el$116, () => column.label, _el$119, _co$26);
|
|
762
|
+
web.insert(_el$117, () => sortIndicator(column.key));
|
|
756
763
|
web.effect((_p$) => {
|
|
757
764
|
var _v$14 = column.width ? {
|
|
758
765
|
width: column.width
|
|
@@ -760,19 +767,19 @@ ${dataRows}`;
|
|
|
760
767
|
"opacity-30": sortKey() !== column.key,
|
|
761
768
|
"opacity-100 text-blue-600 dark:text-blue-400": sortKey() === column.key
|
|
762
769
|
};
|
|
763
|
-
_p$.e = web.style(_el$
|
|
764
|
-
_v$15 !== _p$.t && web.setAttribute(_el$
|
|
765
|
-
_p$.a = web.classList(_el$
|
|
770
|
+
_p$.e = web.style(_el$115, _v$14, _p$.e);
|
|
771
|
+
_v$15 !== _p$.t && web.setAttribute(_el$115, "title", _p$.t = _v$15);
|
|
772
|
+
_p$.a = web.classList(_el$117, _v$16, _p$.a);
|
|
766
773
|
return _p$;
|
|
767
774
|
}, {
|
|
768
775
|
e: void 0,
|
|
769
776
|
t: void 0,
|
|
770
777
|
a: void 0
|
|
771
778
|
});
|
|
772
|
-
return _el$
|
|
779
|
+
return _el$115;
|
|
773
780
|
})()
|
|
774
781
|
}));
|
|
775
|
-
web.insert(_el$
|
|
782
|
+
web.insert(_el$64, web.createComponent(solidJs.Show, {
|
|
776
783
|
get when() {
|
|
777
784
|
return isVirtualizing();
|
|
778
785
|
},
|
|
@@ -782,69 +789,69 @@ ${dataRows}`;
|
|
|
782
789
|
get children() {
|
|
783
790
|
return web.createComponent(VirtualizedTableBody, {});
|
|
784
791
|
}
|
|
785
|
-
}), _el$
|
|
786
|
-
web.insert(_el$
|
|
792
|
+
}), _el$68, _co$11);
|
|
793
|
+
web.insert(_el$37, web.createComponent(solidJs.Show, {
|
|
787
794
|
get when() {
|
|
788
795
|
return tableParams.pagination;
|
|
789
796
|
},
|
|
790
797
|
get children() {
|
|
791
|
-
var _el$
|
|
792
|
-
web.insert(_el$
|
|
793
|
-
web.insert(_el$
|
|
794
|
-
web.insert(_el$
|
|
795
|
-
return _el$
|
|
798
|
+
var _el$69 = web.getNextElement(_tmpl$21), _el$70 = _el$69.firstChild, _el$71 = _el$70.firstChild, _el$76 = _el$71.nextSibling, [_el$77, _co$12] = web.getNextMarker(_el$76.nextSibling), _el$72 = _el$77.nextSibling, _el$78 = _el$72.nextSibling, [_el$79, _co$13] = web.getNextMarker(_el$78.nextSibling), _el$74 = _el$79.nextSibling, _el$80 = _el$74.nextSibling, [_el$81, _co$14] = web.getNextMarker(_el$80.nextSibling);
|
|
799
|
+
web.insert(_el$70, () => tableParams.pagination.currentPage * tableParams.pagination.pageSize + 1, _el$77, _co$12);
|
|
800
|
+
web.insert(_el$70, () => Math.min((tableParams.pagination.currentPage + 1) * tableParams.pagination.pageSize, tableParams.pagination.totalRows), _el$79, _co$13);
|
|
801
|
+
web.insert(_el$70, () => tableParams.pagination.totalRows, _el$81, _co$14);
|
|
802
|
+
return _el$69;
|
|
796
803
|
}
|
|
797
|
-
}), _el$
|
|
798
|
-
web.insert(_el$
|
|
804
|
+
}), _el$110, _co$23);
|
|
805
|
+
web.insert(_el$37, web.createComponent(solidJs.Show, {
|
|
799
806
|
get when() {
|
|
800
807
|
return needsClientPagination();
|
|
801
808
|
},
|
|
802
809
|
get children() {
|
|
803
|
-
var _el$
|
|
804
|
-
web.insert(_el$
|
|
805
|
-
web.insert(_el$
|
|
806
|
-
web.insert(_el$
|
|
807
|
-
_el$
|
|
808
|
-
web.insert(_el$
|
|
809
|
-
web.insert(_el$
|
|
810
|
-
_el$
|
|
811
|
-
web.insert(_el$
|
|
810
|
+
var _el$82 = web.getNextElement(_tmpl$24), _el$83 = _el$82.firstChild, _el$86 = _el$83.firstChild, [_el$87, _co$15] = web.getNextMarker(_el$86.nextSibling), _el$84 = _el$87.nextSibling, _el$88 = _el$84.nextSibling, [_el$89, _co$16] = web.getNextMarker(_el$88.nextSibling), _el$85 = _el$89.nextSibling, _el$90 = _el$85.nextSibling, [_el$91, _co$17] = web.getNextMarker(_el$90.nextSibling), _el$92 = _el$83.nextSibling, _el$93 = _el$92.firstChild, _el$94 = _el$93.nextSibling, _el$96 = _el$94.firstChild, [_el$97, _co$18] = web.getNextMarker(_el$96.nextSibling), _el$95 = _el$97.nextSibling, _el$98 = _el$95.nextSibling, [_el$99, _co$19] = web.getNextMarker(_el$98.nextSibling), _el$100 = _el$94.nextSibling, _el$103 = _el$100.nextSibling, [_el$104, _co$20] = web.getNextMarker(_el$103.nextSibling);
|
|
811
|
+
web.insert(_el$83, clientRangeStart, _el$87, _co$15);
|
|
812
|
+
web.insert(_el$83, clientRangeEnd, _el$89, _co$16);
|
|
813
|
+
web.insert(_el$83, () => filteredRows().length.toLocaleString("fr-FR"), _el$91, _co$17);
|
|
814
|
+
_el$93.$$click = () => setClientPage((p) => p - 1);
|
|
815
|
+
web.insert(_el$94, () => clientPage() + 1, _el$97, _co$18);
|
|
816
|
+
web.insert(_el$94, clientTotalPages, _el$99, _co$19);
|
|
817
|
+
_el$100.$$click = () => setClientPage((p) => p + 1);
|
|
818
|
+
web.insert(_el$92, web.createComponent(solidJs.Show, {
|
|
812
819
|
get when() {
|
|
813
820
|
return web.memo(() => !!isExpanded())() && filteredRows().length > 10;
|
|
814
821
|
},
|
|
815
822
|
get children() {
|
|
816
823
|
return [(() => {
|
|
817
|
-
var _el$
|
|
818
|
-
_el$
|
|
819
|
-
web.insert(_el$
|
|
824
|
+
var _el$101 = web.getNextElement(_tmpl$22);
|
|
825
|
+
_el$101.addEventListener("change", (e) => handlePageSizeChange(Number(e.currentTarget.value)));
|
|
826
|
+
web.insert(_el$101, web.createComponent(solidJs.For, {
|
|
820
827
|
get each() {
|
|
821
828
|
return pageSizeOptions();
|
|
822
829
|
},
|
|
823
830
|
children: (opt) => (() => {
|
|
824
|
-
var _el$
|
|
825
|
-
web.insert(_el$
|
|
826
|
-
web.effect(() => web.setProperty(_el$
|
|
827
|
-
return _el$
|
|
831
|
+
var _el$120 = web.getNextElement(_tmpl$27);
|
|
832
|
+
web.insert(_el$120, () => opt.label);
|
|
833
|
+
web.effect(() => web.setProperty(_el$120, "value", opt.value));
|
|
834
|
+
return _el$120;
|
|
828
835
|
})()
|
|
829
836
|
}));
|
|
830
|
-
web.effect(() => web.setProperty(_el$
|
|
831
|
-
return _el$
|
|
832
|
-
})(), web.getNextElement(_tmpl$
|
|
837
|
+
web.effect(() => web.setProperty(_el$101, "value", clientPageSize()));
|
|
838
|
+
return _el$101;
|
|
839
|
+
})(), web.getNextElement(_tmpl$23)];
|
|
833
840
|
}
|
|
834
|
-
}), _el$
|
|
841
|
+
}), _el$104, _co$20);
|
|
835
842
|
web.effect((_p$) => {
|
|
836
843
|
var _v$8 = clientPage() === 0, _v$9 = clientPage() >= clientTotalPages() - 1;
|
|
837
|
-
_v$8 !== _p$.e && web.setProperty(_el$
|
|
838
|
-
_v$9 !== _p$.t && web.setProperty(_el$
|
|
844
|
+
_v$8 !== _p$.e && web.setProperty(_el$93, "disabled", _p$.e = _v$8);
|
|
845
|
+
_v$9 !== _p$.t && web.setProperty(_el$100, "disabled", _p$.t = _v$9);
|
|
839
846
|
return _p$;
|
|
840
847
|
}, {
|
|
841
848
|
e: void 0,
|
|
842
849
|
t: void 0
|
|
843
850
|
});
|
|
844
851
|
web.runHydrationEvents();
|
|
845
|
-
return _el$
|
|
852
|
+
return _el$82;
|
|
846
853
|
}
|
|
847
|
-
}), _el$
|
|
854
|
+
}), _el$112, _co$24);
|
|
848
855
|
web.effect((_p$) => {
|
|
849
856
|
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 = (
|
|
850
857
|
// v6.1.0 — when expanded, the scroll container fills the
|
|
@@ -877,11 +884,11 @@ ${dataRows}`;
|
|
|
877
884
|
})()
|
|
878
885
|
), _v$12 = tableParams.title || "Data table", _v$13 = tableParams.title ? `${tableId}-title` : void 0;
|
|
879
886
|
_v$0 !== _p$.e && web.className(_el$29, _p$.e = _v$0);
|
|
880
|
-
_v$1 !== _p$.t && web.className(_el$
|
|
881
|
-
_v$10 !== _p$.a && web.className(_el$
|
|
882
|
-
_p$.o = web.style(_el$
|
|
883
|
-
_v$12 !== _p$.i && web.setAttribute(_el$
|
|
884
|
-
_v$13 !== _p$.n && web.setAttribute(_el$
|
|
887
|
+
_v$1 !== _p$.t && web.className(_el$37, _p$.t = _v$1);
|
|
888
|
+
_v$10 !== _p$.a && web.className(_el$63, _p$.a = _v$10);
|
|
889
|
+
_p$.o = web.style(_el$63, _v$11, _p$.o);
|
|
890
|
+
_v$12 !== _p$.i && web.setAttribute(_el$63, "aria-label", _p$.i = _v$12);
|
|
891
|
+
_v$13 !== _p$.n && web.setAttribute(_el$64, "aria-labelledby", _p$.n = _v$13);
|
|
885
892
|
return _p$;
|
|
886
893
|
}, {
|
|
887
894
|
e: void 0,
|
|
@@ -904,51 +911,51 @@ function MetricRenderer(props) {
|
|
|
904
911
|
return `${title}: ${value}${unit ? " " + unit : ""}`;
|
|
905
912
|
};
|
|
906
913
|
return (() => {
|
|
907
|
-
var _el$
|
|
908
|
-
web.insert(_el$
|
|
914
|
+
var _el$121 = web.getNextElement(_tmpl$31), _el$143 = _el$121.firstChild, [_el$144, _co$32] = web.getNextMarker(_el$143.nextSibling), _el$122 = _el$144.nextSibling, _el$123 = _el$122.firstChild, _el$124 = _el$123.firstChild, _el$125 = _el$124.nextSibling, _el$126 = _el$125.firstChild, _el$128 = _el$126.nextSibling, [_el$129, _co$27] = web.getNextMarker(_el$128.nextSibling), _el$139 = _el$123.nextSibling, [_el$140, _co$30] = web.getNextMarker(_el$139.nextSibling), _el$141 = _el$140.nextSibling, [_el$142, _co$31] = web.getNextMarker(_el$141.nextSibling);
|
|
915
|
+
web.insert(_el$121, web.createComponent(CopyButton, {
|
|
909
916
|
getText: getMetricText,
|
|
910
917
|
title: "Copy metric",
|
|
911
918
|
position: "top-right"
|
|
912
|
-
}), _el$
|
|
913
|
-
web.insert(_el$
|
|
914
|
-
web.insert(_el$
|
|
915
|
-
web.insert(_el$
|
|
919
|
+
}), _el$144, _co$32);
|
|
920
|
+
web.insert(_el$124, () => metricParams.title);
|
|
921
|
+
web.insert(_el$126, () => metricParams.value);
|
|
922
|
+
web.insert(_el$125, web.createComponent(solidJs.Show, {
|
|
916
923
|
get when() {
|
|
917
924
|
return metricParams.unit;
|
|
918
925
|
},
|
|
919
926
|
get children() {
|
|
920
|
-
var _el$
|
|
921
|
-
web.insert(_el$
|
|
922
|
-
return _el$
|
|
927
|
+
var _el$127 = web.getNextElement(_tmpl$28);
|
|
928
|
+
web.insert(_el$127, () => metricParams.unit);
|
|
929
|
+
return _el$127;
|
|
923
930
|
}
|
|
924
|
-
}), _el$
|
|
925
|
-
web.insert(_el$
|
|
931
|
+
}), _el$129, _co$27);
|
|
932
|
+
web.insert(_el$122, web.createComponent(solidJs.Show, {
|
|
926
933
|
get when() {
|
|
927
934
|
return metricParams.trend;
|
|
928
935
|
},
|
|
929
936
|
get children() {
|
|
930
|
-
var _el$
|
|
931
|
-
_el$
|
|
932
|
-
web.insert(_el$
|
|
937
|
+
var _el$130 = web.getNextElement(_tmpl$29), _el$131 = _el$130.firstChild, _el$134 = _el$131.firstChild, [_el$135, _co$28] = web.getNextMarker(_el$134.nextSibling), _el$132 = _el$135.nextSibling, _el$136 = _el$132.nextSibling, [_el$137, _co$29] = web.getNextMarker(_el$136.nextSibling);
|
|
938
|
+
_el$137.nextSibling;
|
|
939
|
+
web.insert(_el$131, (() => {
|
|
933
940
|
var _c$ = web.memo(() => metricParams.trend.direction === "up");
|
|
934
941
|
return () => _c$() ? "�" : metricParams.trend.direction === "down" ? "�" : "�";
|
|
935
|
-
})(), _el$
|
|
936
|
-
web.insert(_el$
|
|
937
|
-
web.effect(() => web.className(_el$
|
|
938
|
-
return _el$
|
|
942
|
+
})(), _el$135, _co$28);
|
|
943
|
+
web.insert(_el$131, () => Math.abs(metricParams.trend.value), _el$137, _co$29);
|
|
944
|
+
web.effect(() => web.className(_el$131, `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"}`));
|
|
945
|
+
return _el$130;
|
|
939
946
|
}
|
|
940
|
-
}), _el$
|
|
941
|
-
web.insert(_el$
|
|
947
|
+
}), _el$140, _co$30);
|
|
948
|
+
web.insert(_el$122, web.createComponent(solidJs.Show, {
|
|
942
949
|
get when() {
|
|
943
950
|
return metricParams.subtitle;
|
|
944
951
|
},
|
|
945
952
|
get children() {
|
|
946
|
-
var _el$
|
|
947
|
-
web.insert(_el$
|
|
948
|
-
return _el$
|
|
953
|
+
var _el$138 = web.getNextElement(_tmpl$30);
|
|
954
|
+
web.insert(_el$138, () => metricParams.subtitle);
|
|
955
|
+
return _el$138;
|
|
949
956
|
}
|
|
950
|
-
}), _el$
|
|
951
|
-
return _el$
|
|
957
|
+
}), _el$142, _co$31);
|
|
958
|
+
return _el$121;
|
|
952
959
|
})();
|
|
953
960
|
}
|
|
954
961
|
function extractImageFromMarkdown(content) {
|
|
@@ -989,62 +996,62 @@ function TextRenderer(props) {
|
|
|
989
996
|
},
|
|
990
997
|
get fallback() {
|
|
991
998
|
return (() => {
|
|
992
|
-
var _el$
|
|
993
|
-
web.insert(_el$
|
|
999
|
+
var _el$145 = web.getNextElement(_tmpl$32), _el$147 = _el$145.firstChild, [_el$148, _co$33] = web.getNextMarker(_el$147.nextSibling), _el$146 = _el$148.nextSibling;
|
|
1000
|
+
web.insert(_el$145, web.createComponent(CopyButton, {
|
|
994
1001
|
getText: getTextContent,
|
|
995
1002
|
title: "Copy text",
|
|
996
1003
|
position: "top-right"
|
|
997
|
-
}), _el$
|
|
1004
|
+
}), _el$148, _co$33);
|
|
998
1005
|
web.effect((_p$) => {
|
|
999
1006
|
var _v$17 = `prose prose-sm dark:prose-invert max-w-none ${textParams.className || ""}`, _v$18 = htmlContent();
|
|
1000
|
-
_v$17 !== _p$.e && web.className(_el$
|
|
1001
|
-
_v$18 !== _p$.t && web.setProperty(_el$
|
|
1007
|
+
_v$17 !== _p$.e && web.className(_el$146, _p$.e = _v$17);
|
|
1008
|
+
_v$18 !== _p$.t && web.setProperty(_el$146, "innerHTML", _p$.t = _v$18);
|
|
1002
1009
|
return _p$;
|
|
1003
1010
|
}, {
|
|
1004
1011
|
e: void 0,
|
|
1005
1012
|
t: void 0
|
|
1006
1013
|
});
|
|
1007
|
-
return _el$
|
|
1014
|
+
return _el$145;
|
|
1008
1015
|
})();
|
|
1009
1016
|
},
|
|
1010
1017
|
children: (data) => (() => {
|
|
1011
|
-
var _el$
|
|
1012
|
-
web.insert(_el$
|
|
1018
|
+
var _el$149 = web.getNextElement(_tmpl$33), _el$150 = _el$149.firstChild, _el$151 = _el$150.firstChild, _el$152 = _el$151.firstChild, _el$153 = _el$150.nextSibling, _el$154 = _el$153.firstChild;
|
|
1019
|
+
web.insert(_el$154, () => data().credit);
|
|
1013
1020
|
web.effect((_p$) => {
|
|
1014
1021
|
var _v$19 = data().linkUrl, _v$20 = data().imageUrl, _v$21 = data().alt;
|
|
1015
|
-
_v$19 !== _p$.e && web.setAttribute(_el$
|
|
1016
|
-
_v$20 !== _p$.t && web.setAttribute(_el$
|
|
1017
|
-
_v$21 !== _p$.a && web.setAttribute(_el$
|
|
1022
|
+
_v$19 !== _p$.e && web.setAttribute(_el$151, "href", _p$.e = _v$19);
|
|
1023
|
+
_v$20 !== _p$.t && web.setAttribute(_el$152, "src", _p$.t = _v$20);
|
|
1024
|
+
_v$21 !== _p$.a && web.setAttribute(_el$152, "alt", _p$.a = _v$21);
|
|
1018
1025
|
return _p$;
|
|
1019
1026
|
}, {
|
|
1020
1027
|
e: void 0,
|
|
1021
1028
|
t: void 0,
|
|
1022
1029
|
a: void 0
|
|
1023
1030
|
});
|
|
1024
|
-
return _el$
|
|
1031
|
+
return _el$149;
|
|
1025
1032
|
})()
|
|
1026
1033
|
});
|
|
1027
1034
|
}
|
|
1028
1035
|
function IframeRenderer(props) {
|
|
1029
1036
|
const params = props.component.params;
|
|
1030
1037
|
return (() => {
|
|
1031
|
-
var _el$
|
|
1032
|
-
web.insert(_el$
|
|
1038
|
+
var _el$155 = web.getNextElement(_tmpl$35), _el$159 = _el$155.firstChild, [_el$160, _co$34] = web.getNextMarker(_el$159.nextSibling), _el$158 = _el$160.nextSibling;
|
|
1039
|
+
web.insert(_el$155, web.createComponent(solidJs.Show, {
|
|
1033
1040
|
get when() {
|
|
1034
1041
|
return params.title;
|
|
1035
1042
|
},
|
|
1036
1043
|
get children() {
|
|
1037
|
-
var _el$
|
|
1038
|
-
web.insert(_el$
|
|
1039
|
-
return _el$
|
|
1044
|
+
var _el$156 = web.getNextElement(_tmpl$34), _el$157 = _el$156.firstChild;
|
|
1045
|
+
web.insert(_el$157, () => params.title);
|
|
1046
|
+
return _el$156;
|
|
1040
1047
|
}
|
|
1041
|
-
}), _el$
|
|
1048
|
+
}), _el$160, _co$34);
|
|
1042
1049
|
web.effect((_p$) => {
|
|
1043
1050
|
var _v$22 = params.url, _v$23 = params.title || "Embedded content", _v$24 = `height: ${params.height || "400px"}; min-height: 300px;`, _v$25 = validation.getIframeSandbox(params.url);
|
|
1044
|
-
_v$22 !== _p$.e && web.setAttribute(_el$
|
|
1045
|
-
_v$23 !== _p$.t && web.setAttribute(_el$
|
|
1046
|
-
_p$.a = web.style(_el$
|
|
1047
|
-
_v$25 !== _p$.o && web.setAttribute(_el$
|
|
1051
|
+
_v$22 !== _p$.e && web.setAttribute(_el$158, "src", _p$.e = _v$22);
|
|
1052
|
+
_v$23 !== _p$.t && web.setAttribute(_el$158, "title", _p$.t = _v$23);
|
|
1053
|
+
_p$.a = web.style(_el$158, _v$24, _p$.a);
|
|
1054
|
+
_v$25 !== _p$.o && web.setAttribute(_el$158, "sandbox", _p$.o = _v$25);
|
|
1048
1055
|
return _p$;
|
|
1049
1056
|
}, {
|
|
1050
1057
|
e: void 0,
|
|
@@ -1052,30 +1059,30 @@ function IframeRenderer(props) {
|
|
|
1052
1059
|
a: void 0,
|
|
1053
1060
|
o: void 0
|
|
1054
1061
|
});
|
|
1055
|
-
return _el$
|
|
1062
|
+
return _el$155;
|
|
1056
1063
|
})();
|
|
1057
1064
|
}
|
|
1058
1065
|
function ImageRenderer(props) {
|
|
1059
1066
|
const params = props.component.params;
|
|
1060
1067
|
return (() => {
|
|
1061
|
-
var _el$
|
|
1062
|
-
web.insert(_el$
|
|
1068
|
+
var _el$161 = web.getNextElement(_tmpl$37), _el$162 = _el$161.firstChild, _el$163 = _el$162.firstChild, _el$164 = _el$163.firstChild, _el$167 = _el$162.nextSibling, [_el$168, _co$35] = web.getNextMarker(_el$167.nextSibling);
|
|
1069
|
+
web.insert(_el$161, web.createComponent(solidJs.Show, {
|
|
1063
1070
|
get when() {
|
|
1064
1071
|
return params.caption;
|
|
1065
1072
|
},
|
|
1066
1073
|
get children() {
|
|
1067
|
-
var _el$
|
|
1068
|
-
web.insert(_el$
|
|
1069
|
-
return _el$
|
|
1074
|
+
var _el$165 = web.getNextElement(_tmpl$36), _el$166 = _el$165.firstChild;
|
|
1075
|
+
web.insert(_el$166, () => params.caption);
|
|
1076
|
+
return _el$165;
|
|
1070
1077
|
}
|
|
1071
|
-
}), _el$
|
|
1078
|
+
}), _el$168, _co$35);
|
|
1072
1079
|
web.effect((_p$) => {
|
|
1073
1080
|
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";
|
|
1074
|
-
_v$26 !== _p$.e && web.className(_el$
|
|
1075
|
-
_v$27 !== _p$.t && web.setAttribute(_el$
|
|
1076
|
-
_v$28 !== _p$.a && web.setAttribute(_el$
|
|
1077
|
-
_v$29 !== _p$.o && web.setAttribute(_el$
|
|
1078
|
-
_v$30 !== _p$.i && web.setAttribute(_el$
|
|
1081
|
+
_v$26 !== _p$.e && web.className(_el$161, _p$.e = _v$26);
|
|
1082
|
+
_v$27 !== _p$.t && web.setAttribute(_el$163, "href", _p$.t = _v$27);
|
|
1083
|
+
_v$28 !== _p$.a && web.setAttribute(_el$163, "aria-label", _p$.a = _v$28);
|
|
1084
|
+
_v$29 !== _p$.o && web.setAttribute(_el$164, "src", _p$.o = _v$29);
|
|
1085
|
+
_v$30 !== _p$.i && web.setAttribute(_el$164, "alt", _p$.i = _v$30);
|
|
1079
1086
|
return _p$;
|
|
1080
1087
|
}, {
|
|
1081
1088
|
e: void 0,
|
|
@@ -1084,30 +1091,30 @@ function ImageRenderer(props) {
|
|
|
1084
1091
|
o: void 0,
|
|
1085
1092
|
i: void 0
|
|
1086
1093
|
});
|
|
1087
|
-
return _el$
|
|
1094
|
+
return _el$161;
|
|
1088
1095
|
})();
|
|
1089
1096
|
}
|
|
1090
1097
|
function LinkRenderer(props) {
|
|
1091
1098
|
const params = props.component.params;
|
|
1092
1099
|
return (() => {
|
|
1093
|
-
var _el$
|
|
1094
|
-
_el$
|
|
1095
|
-
web.insert(_el$
|
|
1096
|
-
web.insert(_el$
|
|
1100
|
+
var _el$169 = web.getNextElement(_tmpl$39), _el$170 = _el$169.firstChild, _el$171 = _el$170.nextSibling, _el$172 = _el$171.firstChild, _el$174 = _el$172.nextSibling, [_el$175, _co$36] = web.getNextMarker(_el$174.nextSibling);
|
|
1101
|
+
_el$169.$$click = (e) => e.stopPropagation();
|
|
1102
|
+
web.insert(_el$172, () => params.label || params.url);
|
|
1103
|
+
web.insert(_el$171, web.createComponent(solidJs.Show, {
|
|
1097
1104
|
get when() {
|
|
1098
1105
|
return params.description;
|
|
1099
1106
|
},
|
|
1100
1107
|
get children() {
|
|
1101
|
-
var _el$
|
|
1102
|
-
web.insert(_el$
|
|
1103
|
-
return _el$
|
|
1108
|
+
var _el$173 = web.getNextElement(_tmpl$38);
|
|
1109
|
+
web.insert(_el$173, () => params.description);
|
|
1110
|
+
return _el$173;
|
|
1104
1111
|
}
|
|
1105
|
-
}), _el$
|
|
1112
|
+
}), _el$175, _co$36);
|
|
1106
1113
|
web.effect((_p$) => {
|
|
1107
1114
|
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 || ""}`;
|
|
1108
|
-
_v$31 !== _p$.e && web.setAttribute(_el$
|
|
1109
|
-
_v$32 !== _p$.t && web.setAttribute(_el$
|
|
1110
|
-
_v$33 !== _p$.a && web.className(_el$
|
|
1115
|
+
_v$31 !== _p$.e && web.setAttribute(_el$169, "href", _p$.e = _v$31);
|
|
1116
|
+
_v$32 !== _p$.t && web.setAttribute(_el$169, "aria-label", _p$.t = _v$32);
|
|
1117
|
+
_v$33 !== _p$.a && web.className(_el$169, _p$.a = _v$33);
|
|
1111
1118
|
return _p$;
|
|
1112
1119
|
}, {
|
|
1113
1120
|
e: void 0,
|
|
@@ -1115,7 +1122,7 @@ function LinkRenderer(props) {
|
|
|
1115
1122
|
a: void 0
|
|
1116
1123
|
});
|
|
1117
1124
|
web.runHydrationEvents();
|
|
1118
|
-
return _el$
|
|
1125
|
+
return _el$169;
|
|
1119
1126
|
})();
|
|
1120
1127
|
}
|
|
1121
1128
|
function ComponentRenderer(props) {
|
|
@@ -1182,16 +1189,16 @@ function ComponentRenderer(props) {
|
|
|
1182
1189
|
}
|
|
1183
1190
|
if (mode === "inline-warn") {
|
|
1184
1191
|
return (() => {
|
|
1185
|
-
var _el$
|
|
1186
|
-
web.setAttribute(_el$
|
|
1187
|
-
web.insert(_el$
|
|
1188
|
-
return _el$
|
|
1192
|
+
var _el$176 = web.getNextElement(_tmpl$40), _el$177 = _el$176.firstChild, _el$178 = _el$177.nextSibling, _el$179 = _el$178.firstChild, _el$180 = _el$179.nextSibling, [_el$181, _co$37] = web.getNextMarker(_el$180.nextSibling);
|
|
1193
|
+
web.setAttribute(_el$176, "title", firstError);
|
|
1194
|
+
web.insert(_el$178, () => props.component.type, _el$181, _co$37);
|
|
1195
|
+
return _el$176;
|
|
1189
1196
|
})();
|
|
1190
1197
|
}
|
|
1191
1198
|
return (() => {
|
|
1192
|
-
var _el$
|
|
1193
|
-
web.insert(_el$
|
|
1194
|
-
return _el$
|
|
1199
|
+
var _el$182 = web.getNextElement(_tmpl$41), _el$183 = _el$182.firstChild, _el$184 = _el$183.nextSibling;
|
|
1200
|
+
web.insert(_el$184, firstError);
|
|
1201
|
+
return _el$182;
|
|
1195
1202
|
})();
|
|
1196
1203
|
}
|
|
1197
1204
|
return web.createComponent(GenerativeUIErrorBoundary.GenerativeUIErrorBoundary, {
|
|
@@ -1485,27 +1492,27 @@ function ActionRenderer(props) {
|
|
|
1485
1492
|
const isDisabled = () => params.disabled || params.action === "tool-call" && isExecuting();
|
|
1486
1493
|
if (params.type === "link" || params.action === "link") {
|
|
1487
1494
|
return (() => {
|
|
1488
|
-
var _el$
|
|
1489
|
-
_el$
|
|
1490
|
-
web.insert(_el$
|
|
1495
|
+
var _el$185 = web.getNextElement(_tmpl$43), _el$187 = _el$185.firstChild, [_el$188, _co$38] = web.getNextMarker(_el$187.nextSibling), _el$189 = _el$188.nextSibling, [_el$190, _co$39] = web.getNextMarker(_el$189.nextSibling);
|
|
1496
|
+
_el$185.$$click = handleClick;
|
|
1497
|
+
web.insert(_el$185, web.createComponent(solidJs.Show, {
|
|
1491
1498
|
get when() {
|
|
1492
1499
|
return params.icon;
|
|
1493
1500
|
},
|
|
1494
1501
|
get children() {
|
|
1495
|
-
var _el$
|
|
1496
|
-
web.insert(_el$
|
|
1497
|
-
return _el$
|
|
1502
|
+
var _el$186 = web.getNextElement(_tmpl$42);
|
|
1503
|
+
web.insert(_el$186, () => params.icon);
|
|
1504
|
+
return _el$186;
|
|
1498
1505
|
}
|
|
1499
|
-
}), _el$
|
|
1500
|
-
web.insert(_el$
|
|
1506
|
+
}), _el$188, _co$38);
|
|
1507
|
+
web.insert(_el$185, () => params.label, _el$190, _co$39);
|
|
1501
1508
|
web.effect((_p$) => {
|
|
1502
1509
|
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
|
|
1503
1510
|
${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"}
|
|
1504
1511
|
${params.className || ""}`;
|
|
1505
|
-
_v$34 !== _p$.e && web.setAttribute(_el$
|
|
1506
|
-
_v$35 !== _p$.t && web.setAttribute(_el$
|
|
1507
|
-
_v$36 !== _p$.a && web.setAttribute(_el$
|
|
1508
|
-
_v$37 !== _p$.o && web.className(_el$
|
|
1512
|
+
_v$34 !== _p$.e && web.setAttribute(_el$185, "href", _p$.e = _v$34);
|
|
1513
|
+
_v$35 !== _p$.t && web.setAttribute(_el$185, "target", _p$.t = _v$35);
|
|
1514
|
+
_v$36 !== _p$.a && web.setAttribute(_el$185, "aria-label", _p$.a = _v$36);
|
|
1515
|
+
_v$37 !== _p$.o && web.className(_el$185, _p$.o = _v$37);
|
|
1509
1516
|
return _p$;
|
|
1510
1517
|
}, {
|
|
1511
1518
|
e: void 0,
|
|
@@ -1514,42 +1521,42 @@ function ActionRenderer(props) {
|
|
|
1514
1521
|
o: void 0
|
|
1515
1522
|
});
|
|
1516
1523
|
web.runHydrationEvents();
|
|
1517
|
-
return _el$
|
|
1524
|
+
return _el$185;
|
|
1518
1525
|
})();
|
|
1519
1526
|
}
|
|
1520
1527
|
return (() => {
|
|
1521
|
-
var _el$
|
|
1522
|
-
_el$
|
|
1523
|
-
web.insert(_el$
|
|
1528
|
+
var _el$191 = web.getNextElement(_tmpl$45), _el$194 = _el$191.firstChild, [_el$195, _co$40] = web.getNextMarker(_el$194.nextSibling), _el$196 = _el$195.nextSibling, [_el$197, _co$41] = web.getNextMarker(_el$196.nextSibling), _el$198 = _el$197.nextSibling, [_el$199, _co$42] = web.getNextMarker(_el$198.nextSibling);
|
|
1529
|
+
_el$191.$$click = handleClick;
|
|
1530
|
+
web.insert(_el$191, web.createComponent(solidJs.Show, {
|
|
1524
1531
|
get when() {
|
|
1525
1532
|
return web.memo(() => !!isExecuting())() && params.action === "tool-call";
|
|
1526
1533
|
},
|
|
1527
1534
|
get children() {
|
|
1528
|
-
return web.getNextElement(_tmpl$
|
|
1535
|
+
return web.getNextElement(_tmpl$44);
|
|
1529
1536
|
}
|
|
1530
|
-
}), _el$
|
|
1531
|
-
web.insert(_el$
|
|
1537
|
+
}), _el$195, _co$40);
|
|
1538
|
+
web.insert(_el$191, web.createComponent(solidJs.Show, {
|
|
1532
1539
|
get when() {
|
|
1533
1540
|
return web.memo(() => !!params.icon)() && !(isExecuting() && params.action === "tool-call");
|
|
1534
1541
|
},
|
|
1535
1542
|
get children() {
|
|
1536
|
-
var _el$
|
|
1537
|
-
web.insert(_el$
|
|
1538
|
-
return _el$
|
|
1543
|
+
var _el$193 = web.getNextElement(_tmpl$42);
|
|
1544
|
+
web.insert(_el$193, () => params.icon);
|
|
1545
|
+
return _el$193;
|
|
1539
1546
|
}
|
|
1540
|
-
}), _el$
|
|
1541
|
-
web.insert(_el$
|
|
1547
|
+
}), _el$197, _co$41);
|
|
1548
|
+
web.insert(_el$191, () => params.label, _el$199, _co$42);
|
|
1542
1549
|
web.effect((_p$) => {
|
|
1543
1550
|
var _v$38 = params.action === "submit" ? "submit" : "button", _v$39 = isDisabled(), _v$40 = isExecuting() && params.action === "tool-call", _v$41 = params.ariaLabel || params.label, _v$42 = `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
|
|
1544
1551
|
${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"}
|
|
1545
1552
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1546
1553
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1547
1554
|
${params.className || ""}`;
|
|
1548
|
-
_v$38 !== _p$.e && web.setAttribute(_el$
|
|
1549
|
-
_v$39 !== _p$.t && web.setProperty(_el$
|
|
1550
|
-
_v$40 !== _p$.a && web.setAttribute(_el$
|
|
1551
|
-
_v$41 !== _p$.o && web.setAttribute(_el$
|
|
1552
|
-
_v$42 !== _p$.i && web.className(_el$
|
|
1555
|
+
_v$38 !== _p$.e && web.setAttribute(_el$191, "type", _p$.e = _v$38);
|
|
1556
|
+
_v$39 !== _p$.t && web.setProperty(_el$191, "disabled", _p$.t = _v$39);
|
|
1557
|
+
_v$40 !== _p$.a && web.setAttribute(_el$191, "aria-busy", _p$.a = _v$40);
|
|
1558
|
+
_v$41 !== _p$.o && web.setAttribute(_el$191, "aria-label", _p$.o = _v$41);
|
|
1559
|
+
_v$42 !== _p$.i && web.className(_el$191, _p$.i = _v$42);
|
|
1553
1560
|
return _p$;
|
|
1554
1561
|
}, {
|
|
1555
1562
|
e: void 0,
|
|
@@ -1559,7 +1566,7 @@ function ActionRenderer(props) {
|
|
|
1559
1566
|
i: void 0
|
|
1560
1567
|
});
|
|
1561
1568
|
web.runHydrationEvents();
|
|
1562
|
-
return _el$
|
|
1569
|
+
return _el$191;
|
|
1563
1570
|
})();
|
|
1564
1571
|
}
|
|
1565
1572
|
function ErrorCardRenderer(props) {
|
|
@@ -1567,55 +1574,55 @@ function ErrorCardRenderer(props) {
|
|
|
1567
1574
|
return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
|
|
1568
1575
|
};
|
|
1569
1576
|
return (() => {
|
|
1570
|
-
var _el$
|
|
1571
|
-
web.insert(_el$
|
|
1577
|
+
var _el$200 = web.getNextElement(_tmpl$49), _el$223 = _el$200.firstChild, [_el$224, _co$48] = web.getNextMarker(_el$223.nextSibling), _el$201 = _el$224.nextSibling, _el$202 = _el$201.firstChild, _el$203 = _el$202.nextSibling, _el$204 = _el$203.firstChild, _el$205 = _el$204.firstChild, _el$206 = _el$205.nextSibling, [_el$207, _co$43] = web.getNextMarker(_el$206.nextSibling), _el$208 = _el$204.nextSibling, _el$217 = _el$208.nextSibling, [_el$218, _co$45] = web.getNextMarker(_el$217.nextSibling), _el$219 = _el$218.nextSibling, [_el$220, _co$46] = web.getNextMarker(_el$219.nextSibling), _el$221 = _el$220.nextSibling, [_el$222, _co$47] = web.getNextMarker(_el$221.nextSibling);
|
|
1578
|
+
web.insert(_el$200, web.createComponent(CopyButton, {
|
|
1572
1579
|
getText: getErrorText,
|
|
1573
1580
|
title: "Copy error details",
|
|
1574
1581
|
position: "top-right"
|
|
1575
|
-
}), _el$
|
|
1576
|
-
web.insert(_el$
|
|
1577
|
-
web.insert(_el$
|
|
1578
|
-
web.insert(_el$
|
|
1582
|
+
}), _el$224, _co$48);
|
|
1583
|
+
web.insert(_el$204, () => props.error.tool || "Unknown", _el$207, _co$43);
|
|
1584
|
+
web.insert(_el$208, () => props.error.message || "An error occurred during tool execution");
|
|
1585
|
+
web.insert(_el$203, web.createComponent(solidJs.Show, {
|
|
1579
1586
|
get when() {
|
|
1580
1587
|
return props.error.type;
|
|
1581
1588
|
},
|
|
1582
1589
|
get children() {
|
|
1583
|
-
var _el$
|
|
1584
|
-
web.insert(_el$
|
|
1585
|
-
return _el$
|
|
1590
|
+
var _el$209 = web.getNextElement(_tmpl$46), _el$210 = _el$209.firstChild, _el$211 = _el$210.nextSibling, [_el$212, _co$44] = web.getNextMarker(_el$211.nextSibling);
|
|
1591
|
+
web.insert(_el$209, () => props.error.type, _el$212, _co$44);
|
|
1592
|
+
return _el$209;
|
|
1586
1593
|
}
|
|
1587
|
-
}), _el$
|
|
1588
|
-
web.insert(_el$
|
|
1594
|
+
}), _el$218, _co$45);
|
|
1595
|
+
web.insert(_el$203, web.createComponent(solidJs.Show, {
|
|
1589
1596
|
get when() {
|
|
1590
1597
|
var _a;
|
|
1591
1598
|
return (_a = props.error.suggestions) == null ? void 0 : _a.length;
|
|
1592
1599
|
},
|
|
1593
1600
|
get children() {
|
|
1594
|
-
var _el$
|
|
1595
|
-
web.insert(_el$
|
|
1601
|
+
var _el$213 = web.getNextElement(_tmpl$47), _el$214 = _el$213.firstChild, _el$215 = _el$214.nextSibling;
|
|
1602
|
+
web.insert(_el$215, web.createComponent(solidJs.For, {
|
|
1596
1603
|
get each() {
|
|
1597
1604
|
return props.error.suggestions;
|
|
1598
1605
|
},
|
|
1599
1606
|
children: (suggestion) => (() => {
|
|
1600
|
-
var _el$
|
|
1601
|
-
web.insert(_el$
|
|
1602
|
-
return _el$
|
|
1607
|
+
var _el$225 = web.getNextElement(_tmpl$50);
|
|
1608
|
+
web.insert(_el$225, suggestion);
|
|
1609
|
+
return _el$225;
|
|
1603
1610
|
})()
|
|
1604
1611
|
}));
|
|
1605
|
-
return _el$
|
|
1612
|
+
return _el$213;
|
|
1606
1613
|
}
|
|
1607
|
-
}), _el$
|
|
1608
|
-
web.insert(_el$
|
|
1614
|
+
}), _el$220, _co$46);
|
|
1615
|
+
web.insert(_el$203, web.createComponent(solidJs.Show, {
|
|
1609
1616
|
get when() {
|
|
1610
1617
|
return props.error.timestamp;
|
|
1611
1618
|
},
|
|
1612
1619
|
get children() {
|
|
1613
|
-
var _el$
|
|
1614
|
-
web.insert(_el$
|
|
1615
|
-
return _el$
|
|
1620
|
+
var _el$216 = web.getNextElement(_tmpl$48);
|
|
1621
|
+
web.insert(_el$216, () => new Date(props.error.timestamp).toLocaleString());
|
|
1622
|
+
return _el$216;
|
|
1616
1623
|
}
|
|
1617
|
-
}), _el$
|
|
1618
|
-
return _el$
|
|
1624
|
+
}), _el$222, _co$47);
|
|
1625
|
+
return _el$200;
|
|
1619
1626
|
})();
|
|
1620
1627
|
}
|
|
1621
1628
|
function isErrorResponse(content) {
|
|
@@ -1638,20 +1645,20 @@ function UIResourceHtmlRenderer(props) {
|
|
|
1638
1645
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
|
|
1639
1646
|
};
|
|
1640
1647
|
return (() => {
|
|
1641
|
-
var _el$
|
|
1642
|
-
web.insert(_el$
|
|
1648
|
+
var _el$226 = web.getNextElement(_tmpl$52), _el$230 = _el$226.firstChild, [_el$231, _co$49] = web.getNextMarker(_el$230.nextSibling), _el$229 = _el$231.nextSibling;
|
|
1649
|
+
web.insert(_el$226, web.createComponent(solidJs.Show, {
|
|
1643
1650
|
get when() {
|
|
1644
1651
|
var _a;
|
|
1645
1652
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
|
|
1646
1653
|
},
|
|
1647
1654
|
get children() {
|
|
1648
|
-
var _el$
|
|
1649
|
-
web.insert(_el$
|
|
1650
|
-
return _el$
|
|
1655
|
+
var _el$227 = web.getNextElement(_tmpl$51), _el$228 = _el$227.firstChild;
|
|
1656
|
+
web.insert(_el$228, resourceTitle);
|
|
1657
|
+
return _el$227;
|
|
1651
1658
|
}
|
|
1652
|
-
}), _el$
|
|
1653
|
-
web.effect(() => web.setProperty(_el$
|
|
1654
|
-
return _el$
|
|
1659
|
+
}), _el$231, _co$49);
|
|
1660
|
+
web.effect(() => web.setProperty(_el$229, "innerHTML", htmlContent()));
|
|
1661
|
+
return _el$226;
|
|
1655
1662
|
})();
|
|
1656
1663
|
}
|
|
1657
1664
|
const UIResourceRenderer = (props) => {
|
|
@@ -1724,6 +1731,23 @@ const UIResourceRenderer = (props) => {
|
|
|
1724
1731
|
};
|
|
1725
1732
|
});
|
|
1726
1733
|
const layoutData = layout();
|
|
1734
|
+
const isLayoutContent = !("type" in props.content) || props.content.type === "composite";
|
|
1735
|
+
const outerKey = solidJs.createMemo(() => stableKey.getUiResourceStableKey(props.content));
|
|
1736
|
+
solidJs.onMount(() => {
|
|
1737
|
+
var _a, _b;
|
|
1738
|
+
const key = outerKey();
|
|
1739
|
+
const info = duplicateMountRegistry._registerMount(key);
|
|
1740
|
+
if (info.count > 1) {
|
|
1741
|
+
(_a = props.onMountDuplicate) == null ? void 0 : _a.call(props, info);
|
|
1742
|
+
(_b = duplicateMountRegistry.getDuplicateMountReporter()) == null ? void 0 : _b(info);
|
|
1743
|
+
if (logger.isDebugEnabled() || props.debugDuplicateMounts) {
|
|
1744
|
+
console.warn("[mcp-ui] duplicate UIResourceRenderer mount", info);
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
});
|
|
1748
|
+
solidJs.onCleanup(() => {
|
|
1749
|
+
duplicateMountRegistry._unregisterMount(outerKey());
|
|
1750
|
+
});
|
|
1727
1751
|
const renderComponent = (component, onError) => web.createComponent(ComponentRenderer, {
|
|
1728
1752
|
component,
|
|
1729
1753
|
onError,
|
|
@@ -1737,14 +1761,23 @@ const UIResourceRenderer = (props) => {
|
|
|
1737
1761
|
return web.createComponent(RenderContext.RenderProvider, {
|
|
1738
1762
|
renderComponent,
|
|
1739
1763
|
get children() {
|
|
1740
|
-
var _el$
|
|
1741
|
-
web.
|
|
1764
|
+
var _el$232 = web.getNextElement(_tmpl$53), _el$233 = _el$232.firstChild, _el$234 = _el$233.nextSibling, [_el$235, _co$50] = web.getNextMarker(_el$234.nextSibling);
|
|
1765
|
+
web.spread(_el$232, web.mergeProps({
|
|
1766
|
+
get ["class"]() {
|
|
1767
|
+
return `w-full ${props.class || ""}`;
|
|
1768
|
+
}
|
|
1769
|
+
}, () => isLayoutContent ? {
|
|
1770
|
+
"data-mcp-ui-layout-id": outerKey()
|
|
1771
|
+
} : {
|
|
1772
|
+
"data-mcp-ui-component-id": outerKey()
|
|
1773
|
+
}), false, true);
|
|
1774
|
+
web.insert(_el$233, web.createComponent(solidJs.For, {
|
|
1742
1775
|
get each() {
|
|
1743
1776
|
return layoutData.components;
|
|
1744
1777
|
},
|
|
1745
1778
|
children: (component) => (() => {
|
|
1746
|
-
var _el$
|
|
1747
|
-
web.insert(_el$
|
|
1779
|
+
var _el$236 = web.getNextElement(_tmpl$54);
|
|
1780
|
+
web.insert(_el$236, web.createComponent(ComponentRenderer, {
|
|
1748
1781
|
component,
|
|
1749
1782
|
get onError() {
|
|
1750
1783
|
return props.onError;
|
|
@@ -1756,11 +1789,19 @@ const UIResourceRenderer = (props) => {
|
|
|
1756
1789
|
return props.toolbarVariant;
|
|
1757
1790
|
}
|
|
1758
1791
|
}));
|
|
1759
|
-
web.effect((
|
|
1760
|
-
|
|
1792
|
+
web.effect((_p$) => {
|
|
1793
|
+
var _v$43 = getGridStyleString(component), _v$44 = stableKey.getUiResourceStableKey(component);
|
|
1794
|
+
_p$.e = web.style(_el$236, _v$43, _p$.e);
|
|
1795
|
+
_v$44 !== _p$.t && web.setAttribute(_el$236, "data-mcp-ui-component-id", _p$.t = _v$44);
|
|
1796
|
+
return _p$;
|
|
1797
|
+
}, {
|
|
1798
|
+
e: void 0,
|
|
1799
|
+
t: void 0
|
|
1800
|
+
});
|
|
1801
|
+
return _el$236;
|
|
1761
1802
|
})()
|
|
1762
1803
|
}));
|
|
1763
|
-
web.insert(_el$
|
|
1804
|
+
web.insert(_el$232, web.createComponent(solidJs.Show, {
|
|
1764
1805
|
get when() {
|
|
1765
1806
|
return shouldShowAutoFooter();
|
|
1766
1807
|
},
|
|
@@ -1771,17 +1812,10 @@ const UIResourceRenderer = (props) => {
|
|
|
1771
1812
|
}
|
|
1772
1813
|
});
|
|
1773
1814
|
}
|
|
1774
|
-
}), _el$
|
|
1775
|
-
web.effect((
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
_p$.t = web.style(_el$240, _v$44, _p$.t);
|
|
1779
|
-
return _p$;
|
|
1780
|
-
}, {
|
|
1781
|
-
e: void 0,
|
|
1782
|
-
t: void 0
|
|
1783
|
-
});
|
|
1784
|
-
return _el$239;
|
|
1815
|
+
}), _el$235, _co$50);
|
|
1816
|
+
web.effect((_$p) => web.style(_el$233, gridContainerStyle(), _$p));
|
|
1817
|
+
web.runHydrationEvents();
|
|
1818
|
+
return _el$232;
|
|
1785
1819
|
}
|
|
1786
1820
|
});
|
|
1787
1821
|
};
|