@seed-ship/mcp-ui-solid 5.3.1 → 5.4.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 +38 -0
- package/dist/components/StreamingUIRenderer.cjs +106 -90
- package/dist/components/StreamingUIRenderer.cjs.map +1 -1
- package/dist/components/StreamingUIRenderer.d.ts +7 -0
- package/dist/components/StreamingUIRenderer.d.ts.map +1 -1
- package/dist/components/StreamingUIRenderer.js +107 -91
- package/dist/components/StreamingUIRenderer.js.map +1 -1
- package/dist/components/UIResourceRenderer.cjs +101 -82
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts +23 -0
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +102 -83
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/logger.cjs +26 -4
- package/dist/utils/logger.cjs.map +1 -1
- package/dist/utils/logger.d.ts +30 -3
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +27 -5
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/perf.cjs +34 -0
- package/dist/utils/perf.cjs.map +1 -0
- package/dist/utils/perf.d.ts +19 -0
- package/dist/utils/perf.d.ts.map +1 -0
- package/dist/utils/perf.js +34 -0
- package/dist/utils/perf.js.map +1 -0
- package/package.json +1 -1
- package/src/components/StreamingUIRenderer.tsx +54 -2
- package/src/components/UIResourceRenderer.errorMode.test.tsx +95 -0
- package/src/components/UIResourceRenderer.tsx +72 -4
- package/src/index.ts +7 -0
- package/src/utils/logger.test.ts +130 -0
- package/src/utils/logger.ts +60 -7
- package/src/utils/perf.test.ts +59 -0
- package/src/utils/perf.ts +50 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -5,6 +5,7 @@ const purify_es = require("../node_modules/.pnpm/dompurify@3.4.1/node_modules/do
|
|
|
5
5
|
const solidJs = require("solid-js");
|
|
6
6
|
const validation = require("../services/validation.cjs");
|
|
7
7
|
const GenerativeUIErrorBoundary = require("./GenerativeUIErrorBoundary.cjs");
|
|
8
|
+
const perf = require("../utils/perf.cjs");
|
|
8
9
|
const GridRenderer = require("./GridRenderer.cjs");
|
|
9
10
|
const FooterRenderer = require("./FooterRenderer.cjs");
|
|
10
11
|
const CarouselRenderer = require("./CarouselRenderer.cjs");
|
|
@@ -21,7 +22,7 @@ const ExpandableWrapper = require("./ExpandableWrapper.cjs");
|
|
|
21
22
|
const RenderContext = require("./RenderContext.cjs");
|
|
22
23
|
const useAction = require("../hooks/useAction.cjs");
|
|
23
24
|
const marked_esm = require("../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.cjs");
|
|
24
|
-
var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700"><p class="text-red-500 dark:text-red-400 text-sm">Invalid chart data: missing data.datasets`), _tmpl$5 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$6 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$7 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$9 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$0 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$10 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$11 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Copy TSV`), _tmpl$13 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download CSV`), _tmpl$14 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download JSON`), _tmpl$15 = /* @__PURE__ */ web.template(`<div class="absolute right-0 mt-1 w-36 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm"><!$><!/><!$><!/><!$><!/>`), _tmpl$16 = /* @__PURE__ */ web.template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"title="Export table"aria-label="Export table"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$17 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$18 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ web.template(`<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 class=p-4><!$><!/><!$><!/><div class=overflow-x-auto role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-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="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>`);
|
|
25
|
+
var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700"><p class="text-red-500 dark:text-red-400 text-sm">Invalid chart data: missing data.datasets`), _tmpl$5 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$6 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$7 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$9 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$0 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$10 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$11 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Copy TSV`), _tmpl$13 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download CSV`), _tmpl$14 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download JSON`), _tmpl$15 = /* @__PURE__ */ web.template(`<div class="absolute right-0 mt-1 w-36 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm"><!$><!/><!$><!/><!$><!/>`), _tmpl$16 = /* @__PURE__ */ web.template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"title="Export table"aria-label="Export table"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$17 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$18 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ web.template(`<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 class=p-4><!$><!/><!$><!/><div class=overflow-x-auto role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-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>`);
|
|
25
26
|
function CopyButton(props) {
|
|
26
27
|
const [copied, setCopied] = solidJs.createSignal(false);
|
|
27
28
|
const handleCopy = async () => {
|
|
@@ -1054,7 +1055,9 @@ function LinkRenderer(props) {
|
|
|
1054
1055
|
})();
|
|
1055
1056
|
}
|
|
1056
1057
|
function ComponentRenderer(props) {
|
|
1057
|
-
var _a;
|
|
1058
|
+
var _a, _b, _c;
|
|
1059
|
+
perf.markRenderStart(props.component.id);
|
|
1060
|
+
solidJs.onMount(() => perf.markRenderEnd(props.component.id));
|
|
1058
1061
|
const validation$1 = validation.validateComponent(props.component);
|
|
1059
1062
|
if (!validation$1.valid) {
|
|
1060
1063
|
(_a = props.onError) == null ? void 0 : _a.call(props, {
|
|
@@ -1063,13 +1066,23 @@ function ComponentRenderer(props) {
|
|
|
1063
1066
|
componentId: props.component.id,
|
|
1064
1067
|
details: validation$1.errors
|
|
1065
1068
|
});
|
|
1069
|
+
const mode = props.errorMode ?? "block";
|
|
1070
|
+
const firstError = ((_c = (_b = validation$1.errors) == null ? void 0 : _b[0]) == null ? void 0 : _c.message) || "Unknown validation error";
|
|
1071
|
+
if (mode === "silent") {
|
|
1072
|
+
return null;
|
|
1073
|
+
}
|
|
1074
|
+
if (mode === "inline-warn") {
|
|
1075
|
+
return (() => {
|
|
1076
|
+
var _el$183 = web.getNextElement(_tmpl$41), _el$184 = _el$183.firstChild, _el$185 = _el$184.nextSibling, _el$186 = _el$185.firstChild, _el$187 = _el$186.nextSibling, [_el$188, _co$40] = web.getNextMarker(_el$187.nextSibling);
|
|
1077
|
+
web.setAttribute(_el$183, "title", firstError);
|
|
1078
|
+
web.insert(_el$185, () => props.component.type, _el$188, _co$40);
|
|
1079
|
+
return _el$183;
|
|
1080
|
+
})();
|
|
1081
|
+
}
|
|
1066
1082
|
return (() => {
|
|
1067
|
-
var _el$
|
|
1068
|
-
web.insert(_el$
|
|
1069
|
-
|
|
1070
|
-
return ((_b = (_a2 = validation$1.errors) == null ? void 0 : _a2[0]) == null ? void 0 : _b.message) || "Unknown validation error";
|
|
1071
|
-
});
|
|
1072
|
-
return _el$183;
|
|
1083
|
+
var _el$189 = web.getNextElement(_tmpl$42), _el$190 = _el$189.firstChild, _el$191 = _el$190.nextSibling;
|
|
1084
|
+
web.insert(_el$191, firstError);
|
|
1085
|
+
return _el$189;
|
|
1073
1086
|
})();
|
|
1074
1087
|
}
|
|
1075
1088
|
return web.createComponent(GenerativeUIErrorBoundary.GenerativeUIErrorBoundary, {
|
|
@@ -1315,27 +1328,27 @@ function ActionRenderer(props) {
|
|
|
1315
1328
|
const isDisabled = () => params.disabled || params.action === "tool-call" && isExecuting();
|
|
1316
1329
|
if (params.type === "link" || params.action === "link") {
|
|
1317
1330
|
return (() => {
|
|
1318
|
-
var _el$
|
|
1319
|
-
_el$
|
|
1320
|
-
web.insert(_el$
|
|
1331
|
+
var _el$192 = web.getNextElement(_tmpl$44), _el$194 = _el$192.firstChild, [_el$195, _co$41] = web.getNextMarker(_el$194.nextSibling), _el$196 = _el$195.nextSibling, [_el$197, _co$42] = web.getNextMarker(_el$196.nextSibling);
|
|
1332
|
+
_el$192.$$click = handleClick;
|
|
1333
|
+
web.insert(_el$192, web.createComponent(solidJs.Show, {
|
|
1321
1334
|
get when() {
|
|
1322
1335
|
return params.icon;
|
|
1323
1336
|
},
|
|
1324
1337
|
get children() {
|
|
1325
|
-
var _el$
|
|
1326
|
-
web.insert(_el$
|
|
1327
|
-
return _el$
|
|
1338
|
+
var _el$193 = web.getNextElement(_tmpl$43);
|
|
1339
|
+
web.insert(_el$193, () => params.icon);
|
|
1340
|
+
return _el$193;
|
|
1328
1341
|
}
|
|
1329
|
-
}), _el$
|
|
1330
|
-
web.insert(_el$
|
|
1342
|
+
}), _el$195, _co$41);
|
|
1343
|
+
web.insert(_el$192, () => params.label, _el$197, _co$42);
|
|
1331
1344
|
web.effect((_p$) => {
|
|
1332
1345
|
var _v$32 = params.url || "#", _v$33 = params.url ? "_blank" : void 0, _v$34 = params.ariaLabel || params.label, _v$35 = `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
|
|
1333
1346
|
${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"}
|
|
1334
1347
|
${params.className || ""}`;
|
|
1335
|
-
_v$32 !== _p$.e && web.setAttribute(_el$
|
|
1336
|
-
_v$33 !== _p$.t && web.setAttribute(_el$
|
|
1337
|
-
_v$34 !== _p$.a && web.setAttribute(_el$
|
|
1338
|
-
_v$35 !== _p$.o && web.className(_el$
|
|
1348
|
+
_v$32 !== _p$.e && web.setAttribute(_el$192, "href", _p$.e = _v$32);
|
|
1349
|
+
_v$33 !== _p$.t && web.setAttribute(_el$192, "target", _p$.t = _v$33);
|
|
1350
|
+
_v$34 !== _p$.a && web.setAttribute(_el$192, "aria-label", _p$.a = _v$34);
|
|
1351
|
+
_v$35 !== _p$.o && web.className(_el$192, _p$.o = _v$35);
|
|
1339
1352
|
return _p$;
|
|
1340
1353
|
}, {
|
|
1341
1354
|
e: void 0,
|
|
@@ -1344,42 +1357,42 @@ function ActionRenderer(props) {
|
|
|
1344
1357
|
o: void 0
|
|
1345
1358
|
});
|
|
1346
1359
|
web.runHydrationEvents();
|
|
1347
|
-
return _el$
|
|
1360
|
+
return _el$192;
|
|
1348
1361
|
})();
|
|
1349
1362
|
}
|
|
1350
1363
|
return (() => {
|
|
1351
|
-
var _el$
|
|
1352
|
-
_el$
|
|
1353
|
-
web.insert(_el$
|
|
1364
|
+
var _el$198 = web.getNextElement(_tmpl$46), _el$201 = _el$198.firstChild, [_el$202, _co$43] = web.getNextMarker(_el$201.nextSibling), _el$203 = _el$202.nextSibling, [_el$204, _co$44] = web.getNextMarker(_el$203.nextSibling), _el$205 = _el$204.nextSibling, [_el$206, _co$45] = web.getNextMarker(_el$205.nextSibling);
|
|
1365
|
+
_el$198.$$click = handleClick;
|
|
1366
|
+
web.insert(_el$198, web.createComponent(solidJs.Show, {
|
|
1354
1367
|
get when() {
|
|
1355
1368
|
return web.memo(() => !!isExecuting())() && params.action === "tool-call";
|
|
1356
1369
|
},
|
|
1357
1370
|
get children() {
|
|
1358
|
-
return web.getNextElement(_tmpl$
|
|
1371
|
+
return web.getNextElement(_tmpl$45);
|
|
1359
1372
|
}
|
|
1360
|
-
}), _el$
|
|
1361
|
-
web.insert(_el$
|
|
1373
|
+
}), _el$202, _co$43);
|
|
1374
|
+
web.insert(_el$198, web.createComponent(solidJs.Show, {
|
|
1362
1375
|
get when() {
|
|
1363
1376
|
return web.memo(() => !!params.icon)() && !(isExecuting() && params.action === "tool-call");
|
|
1364
1377
|
},
|
|
1365
1378
|
get children() {
|
|
1366
|
-
var _el$
|
|
1367
|
-
web.insert(_el$
|
|
1368
|
-
return _el$
|
|
1379
|
+
var _el$200 = web.getNextElement(_tmpl$43);
|
|
1380
|
+
web.insert(_el$200, () => params.icon);
|
|
1381
|
+
return _el$200;
|
|
1369
1382
|
}
|
|
1370
|
-
}), _el$
|
|
1371
|
-
web.insert(_el$
|
|
1383
|
+
}), _el$204, _co$44);
|
|
1384
|
+
web.insert(_el$198, () => params.label, _el$206, _co$45);
|
|
1372
1385
|
web.effect((_p$) => {
|
|
1373
1386
|
var _v$36 = params.action === "submit" ? "submit" : "button", _v$37 = isDisabled(), _v$38 = isExecuting() && params.action === "tool-call", _v$39 = params.ariaLabel || params.label, _v$40 = `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
|
|
1374
1387
|
${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"}
|
|
1375
1388
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1376
1389
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1377
1390
|
${params.className || ""}`;
|
|
1378
|
-
_v$36 !== _p$.e && web.setAttribute(_el$
|
|
1379
|
-
_v$37 !== _p$.t && web.setProperty(_el$
|
|
1380
|
-
_v$38 !== _p$.a && web.setAttribute(_el$
|
|
1381
|
-
_v$39 !== _p$.o && web.setAttribute(_el$
|
|
1382
|
-
_v$40 !== _p$.i && web.className(_el$
|
|
1391
|
+
_v$36 !== _p$.e && web.setAttribute(_el$198, "type", _p$.e = _v$36);
|
|
1392
|
+
_v$37 !== _p$.t && web.setProperty(_el$198, "disabled", _p$.t = _v$37);
|
|
1393
|
+
_v$38 !== _p$.a && web.setAttribute(_el$198, "aria-busy", _p$.a = _v$38);
|
|
1394
|
+
_v$39 !== _p$.o && web.setAttribute(_el$198, "aria-label", _p$.o = _v$39);
|
|
1395
|
+
_v$40 !== _p$.i && web.className(_el$198, _p$.i = _v$40);
|
|
1383
1396
|
return _p$;
|
|
1384
1397
|
}, {
|
|
1385
1398
|
e: void 0,
|
|
@@ -1389,7 +1402,7 @@ function ActionRenderer(props) {
|
|
|
1389
1402
|
i: void 0
|
|
1390
1403
|
});
|
|
1391
1404
|
web.runHydrationEvents();
|
|
1392
|
-
return _el$
|
|
1405
|
+
return _el$198;
|
|
1393
1406
|
})();
|
|
1394
1407
|
}
|
|
1395
1408
|
function ErrorCardRenderer(props) {
|
|
@@ -1397,55 +1410,55 @@ function ErrorCardRenderer(props) {
|
|
|
1397
1410
|
return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
|
|
1398
1411
|
};
|
|
1399
1412
|
return (() => {
|
|
1400
|
-
var _el$
|
|
1401
|
-
web.insert(_el$
|
|
1413
|
+
var _el$207 = web.getNextElement(_tmpl$50), _el$230 = _el$207.firstChild, [_el$231, _co$51] = web.getNextMarker(_el$230.nextSibling), _el$208 = _el$231.nextSibling, _el$209 = _el$208.firstChild, _el$210 = _el$209.nextSibling, _el$211 = _el$210.firstChild, _el$212 = _el$211.firstChild, _el$213 = _el$212.nextSibling, [_el$214, _co$46] = web.getNextMarker(_el$213.nextSibling), _el$215 = _el$211.nextSibling, _el$224 = _el$215.nextSibling, [_el$225, _co$48] = web.getNextMarker(_el$224.nextSibling), _el$226 = _el$225.nextSibling, [_el$227, _co$49] = web.getNextMarker(_el$226.nextSibling), _el$228 = _el$227.nextSibling, [_el$229, _co$50] = web.getNextMarker(_el$228.nextSibling);
|
|
1414
|
+
web.insert(_el$207, web.createComponent(CopyButton, {
|
|
1402
1415
|
getText: getErrorText,
|
|
1403
1416
|
title: "Copy error details",
|
|
1404
1417
|
position: "top-right"
|
|
1405
|
-
}), _el$
|
|
1406
|
-
web.insert(_el$
|
|
1407
|
-
web.insert(_el$
|
|
1408
|
-
web.insert(_el$
|
|
1418
|
+
}), _el$231, _co$51);
|
|
1419
|
+
web.insert(_el$211, () => props.error.tool || "Unknown", _el$214, _co$46);
|
|
1420
|
+
web.insert(_el$215, () => props.error.message || "An error occurred during tool execution");
|
|
1421
|
+
web.insert(_el$210, web.createComponent(solidJs.Show, {
|
|
1409
1422
|
get when() {
|
|
1410
1423
|
return props.error.type;
|
|
1411
1424
|
},
|
|
1412
1425
|
get children() {
|
|
1413
|
-
var _el$
|
|
1414
|
-
web.insert(_el$
|
|
1415
|
-
return _el$
|
|
1426
|
+
var _el$216 = web.getNextElement(_tmpl$47), _el$217 = _el$216.firstChild, _el$218 = _el$217.nextSibling, [_el$219, _co$47] = web.getNextMarker(_el$218.nextSibling);
|
|
1427
|
+
web.insert(_el$216, () => props.error.type, _el$219, _co$47);
|
|
1428
|
+
return _el$216;
|
|
1416
1429
|
}
|
|
1417
|
-
}), _el$
|
|
1418
|
-
web.insert(_el$
|
|
1430
|
+
}), _el$225, _co$48);
|
|
1431
|
+
web.insert(_el$210, web.createComponent(solidJs.Show, {
|
|
1419
1432
|
get when() {
|
|
1420
1433
|
var _a;
|
|
1421
1434
|
return (_a = props.error.suggestions) == null ? void 0 : _a.length;
|
|
1422
1435
|
},
|
|
1423
1436
|
get children() {
|
|
1424
|
-
var _el$
|
|
1425
|
-
web.insert(_el$
|
|
1437
|
+
var _el$220 = web.getNextElement(_tmpl$48), _el$221 = _el$220.firstChild, _el$222 = _el$221.nextSibling;
|
|
1438
|
+
web.insert(_el$222, web.createComponent(solidJs.For, {
|
|
1426
1439
|
get each() {
|
|
1427
1440
|
return props.error.suggestions;
|
|
1428
1441
|
},
|
|
1429
1442
|
children: (suggestion) => (() => {
|
|
1430
|
-
var _el$
|
|
1431
|
-
web.insert(_el$
|
|
1432
|
-
return _el$
|
|
1443
|
+
var _el$232 = web.getNextElement(_tmpl$51);
|
|
1444
|
+
web.insert(_el$232, suggestion);
|
|
1445
|
+
return _el$232;
|
|
1433
1446
|
})()
|
|
1434
1447
|
}));
|
|
1435
|
-
return _el$
|
|
1448
|
+
return _el$220;
|
|
1436
1449
|
}
|
|
1437
|
-
}), _el$
|
|
1438
|
-
web.insert(_el$
|
|
1450
|
+
}), _el$227, _co$49);
|
|
1451
|
+
web.insert(_el$210, web.createComponent(solidJs.Show, {
|
|
1439
1452
|
get when() {
|
|
1440
1453
|
return props.error.timestamp;
|
|
1441
1454
|
},
|
|
1442
1455
|
get children() {
|
|
1443
|
-
var _el$
|
|
1444
|
-
web.insert(_el$
|
|
1445
|
-
return _el$
|
|
1456
|
+
var _el$223 = web.getNextElement(_tmpl$49);
|
|
1457
|
+
web.insert(_el$223, () => new Date(props.error.timestamp).toLocaleString());
|
|
1458
|
+
return _el$223;
|
|
1446
1459
|
}
|
|
1447
|
-
}), _el$
|
|
1448
|
-
return _el$
|
|
1460
|
+
}), _el$229, _co$50);
|
|
1461
|
+
return _el$207;
|
|
1449
1462
|
})();
|
|
1450
1463
|
}
|
|
1451
1464
|
function isErrorResponse(content) {
|
|
@@ -1468,20 +1481,20 @@ function UIResourceHtmlRenderer(props) {
|
|
|
1468
1481
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
|
|
1469
1482
|
};
|
|
1470
1483
|
return (() => {
|
|
1471
|
-
var _el$
|
|
1472
|
-
web.insert(_el$
|
|
1484
|
+
var _el$233 = web.getNextElement(_tmpl$53), _el$237 = _el$233.firstChild, [_el$238, _co$52] = web.getNextMarker(_el$237.nextSibling), _el$236 = _el$238.nextSibling;
|
|
1485
|
+
web.insert(_el$233, web.createComponent(solidJs.Show, {
|
|
1473
1486
|
get when() {
|
|
1474
1487
|
var _a;
|
|
1475
1488
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
|
|
1476
1489
|
},
|
|
1477
1490
|
get children() {
|
|
1478
|
-
var _el$
|
|
1479
|
-
web.insert(_el$
|
|
1480
|
-
return _el$
|
|
1491
|
+
var _el$234 = web.getNextElement(_tmpl$52), _el$235 = _el$234.firstChild;
|
|
1492
|
+
web.insert(_el$235, resourceTitle);
|
|
1493
|
+
return _el$234;
|
|
1481
1494
|
}
|
|
1482
|
-
}), _el$
|
|
1483
|
-
web.effect(() => web.setProperty(_el$
|
|
1484
|
-
return _el$
|
|
1495
|
+
}), _el$238, _co$52);
|
|
1496
|
+
web.effect(() => web.setProperty(_el$236, "innerHTML", htmlContent()));
|
|
1497
|
+
return _el$233;
|
|
1485
1498
|
})();
|
|
1486
1499
|
}
|
|
1487
1500
|
const UIResourceRenderer = (props) => {
|
|
@@ -1556,29 +1569,35 @@ const UIResourceRenderer = (props) => {
|
|
|
1556
1569
|
const layoutData = layout();
|
|
1557
1570
|
const renderComponent = (component, onError) => web.createComponent(ComponentRenderer, {
|
|
1558
1571
|
component,
|
|
1559
|
-
onError
|
|
1572
|
+
onError,
|
|
1573
|
+
get errorMode() {
|
|
1574
|
+
return props.errorMode;
|
|
1575
|
+
}
|
|
1560
1576
|
});
|
|
1561
1577
|
return web.createComponent(RenderContext.RenderProvider, {
|
|
1562
1578
|
renderComponent,
|
|
1563
1579
|
get children() {
|
|
1564
|
-
var _el$
|
|
1565
|
-
web.insert(_el$
|
|
1580
|
+
var _el$239 = web.getNextElement(_tmpl$54), _el$240 = _el$239.firstChild, _el$241 = _el$240.nextSibling, [_el$242, _co$53] = web.getNextMarker(_el$241.nextSibling);
|
|
1581
|
+
web.insert(_el$240, web.createComponent(solidJs.For, {
|
|
1566
1582
|
get each() {
|
|
1567
1583
|
return layoutData.components;
|
|
1568
1584
|
},
|
|
1569
1585
|
children: (component) => (() => {
|
|
1570
|
-
var _el$
|
|
1571
|
-
web.insert(_el$
|
|
1586
|
+
var _el$243 = web.getNextElement(_tmpl$55);
|
|
1587
|
+
web.insert(_el$243, web.createComponent(ComponentRenderer, {
|
|
1572
1588
|
component,
|
|
1573
1589
|
get onError() {
|
|
1574
1590
|
return props.onError;
|
|
1591
|
+
},
|
|
1592
|
+
get errorMode() {
|
|
1593
|
+
return props.errorMode;
|
|
1575
1594
|
}
|
|
1576
1595
|
}));
|
|
1577
|
-
web.effect((_$p) => web.style(_el$
|
|
1578
|
-
return _el$
|
|
1596
|
+
web.effect((_$p) => web.style(_el$243, getGridStyleString(component), _$p));
|
|
1597
|
+
return _el$243;
|
|
1579
1598
|
})()
|
|
1580
1599
|
}));
|
|
1581
|
-
web.insert(_el$
|
|
1600
|
+
web.insert(_el$239, web.createComponent(solidJs.Show, {
|
|
1582
1601
|
get when() {
|
|
1583
1602
|
return shouldShowAutoFooter();
|
|
1584
1603
|
},
|
|
@@ -1589,17 +1608,17 @@ const UIResourceRenderer = (props) => {
|
|
|
1589
1608
|
}
|
|
1590
1609
|
});
|
|
1591
1610
|
}
|
|
1592
|
-
}), _el$
|
|
1611
|
+
}), _el$242, _co$53);
|
|
1593
1612
|
web.effect((_p$) => {
|
|
1594
1613
|
var _v$41 = `w-full ${props.class || ""}`, _v$42 = gridContainerStyle();
|
|
1595
|
-
_v$41 !== _p$.e && web.className(_el$
|
|
1596
|
-
_p$.t = web.style(_el$
|
|
1614
|
+
_v$41 !== _p$.e && web.className(_el$239, _p$.e = _v$41);
|
|
1615
|
+
_p$.t = web.style(_el$240, _v$42, _p$.t);
|
|
1597
1616
|
return _p$;
|
|
1598
1617
|
}, {
|
|
1599
1618
|
e: void 0,
|
|
1600
1619
|
t: void 0
|
|
1601
1620
|
});
|
|
1602
|
-
return _el$
|
|
1621
|
+
return _el$239;
|
|
1603
1622
|
}
|
|
1604
1623
|
});
|
|
1605
1624
|
};
|