@seed-ship/mcp-ui-solid 2.2.10 → 2.3.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/dist/components/ArtifactRenderer.cjs +4 -3
- package/dist/components/ArtifactRenderer.cjs.map +1 -1
- package/dist/components/ArtifactRenderer.js +4 -3
- package/dist/components/ArtifactRenderer.js.map +1 -1
- package/dist/components/CodeBlockRenderer.cjs +6 -1
- package/dist/components/CodeBlockRenderer.cjs.map +1 -1
- package/dist/components/CodeBlockRenderer.d.ts.map +1 -1
- package/dist/components/CodeBlockRenderer.js +6 -1
- package/dist/components/CodeBlockRenderer.js.map +1 -1
- package/dist/components/UIResourceRenderer.cjs +29 -27
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.js +30 -28
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/validation.cjs +176 -18
- package/dist/services/validation.cjs.map +1 -1
- package/dist/services/validation.d.ts +21 -0
- package/dist/services/validation.d.ts.map +1 -1
- package/dist/services/validation.js +176 -18
- package/dist/services/validation.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/ArtifactRenderer.tsx +3 -3
- package/src/components/CodeBlockRenderer.tsx +7 -1
- package/src/components/UIResourceRenderer.tsx +2 -2
- package/src/index.ts +2 -0
- package/src/services/index.ts +2 -0
- package/src/services/validation.test.ts +158 -1
- package/src/services/validation.ts +221 -19
- package/src/types/index.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { delegateEvents, createComponent, getNextElement, template, getNextMarker, insert, effect, style, className, setProperty, setAttribute, runHydrationEvents, memo, isServer, use, setStyleProperty } from "solid-js/web";
|
|
2
2
|
import purify from "../node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/dist/purify.es.js";
|
|
3
3
|
import { createMemo, For, Show, createSignal, createEffect } from "solid-js";
|
|
4
|
-
import { validateComponent, DEFAULT_RESOURCE_LIMITS } from "../services/validation.js";
|
|
4
|
+
import { validateComponent, getIframeSandbox, DEFAULT_RESOURCE_LIMITS } from "../services/validation.js";
|
|
5
5
|
import { GenerativeUIErrorBoundary } from "./GenerativeUIErrorBoundary.js";
|
|
6
6
|
import { GridRenderer } from "./GridRenderer.js";
|
|
7
7
|
import { FooterRenderer } from "./FooterRenderer.js";
|
|
@@ -19,7 +19,7 @@ import { ExpandableWrapper } from "./ExpandableWrapper.js";
|
|
|
19
19
|
import { RenderProvider } from "./RenderContext.js";
|
|
20
20
|
import { useAction } from "../hooks/useAction.js";
|
|
21
21
|
import { marked as k } from "../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.js";
|
|
22
|
-
var _tmpl$ = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ template(`<button>`), _tmpl$3 = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ template(`<div class="p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700"><p class="text-red-500 dark:text-red-400 text-sm">Invalid chart data: missing data.datasets`), _tmpl$5 = /* @__PURE__ */ template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$6 = /* @__PURE__ */ template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$7 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__PURE__ */ template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$9 = /* @__PURE__ */ template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$0 = /* @__PURE__ */ template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ template(`<tr>`), _tmpl$10 = /* @__PURE__ */ template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$11 = /* @__PURE__ */ template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Copy TSV`), _tmpl$13 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download CSV`), _tmpl$14 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download JSON`), _tmpl$15 = /* @__PURE__ */ template(`<div class="absolute right-0 mt-1 w-36 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm"><!$><!/><!$><!/><!$><!/>`), _tmpl$16 = /* @__PURE__ */ template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"title="Export table"aria-label="Export table"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$17 = /* @__PURE__ */ template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$18 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$20 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group"><!$><!/><div class=p-4><!$><!/><div class=overflow-x-auto role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-50 dark:bg-gray-900/50 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/>`), _tmpl$21 = /* @__PURE__ */ template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-50 dark:bg-gray-900/50">`), _tmpl$22 = /* @__PURE__ */ template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$23 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$24 = /* @__PURE__ */ template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$25 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$26 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$27 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$28 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$29 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"sandbox="allow-scripts allow-same-origin allow-popups allow-forms"loading=lazy>`, true, false, false), _tmpl$30 = /* @__PURE__ */ template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$31 = /* @__PURE__ */ template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$32 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$33 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$34 = /* @__PURE__ */ template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$35 = /* @__PURE__ */ template(`<span aria-hidden=true>`), _tmpl$36 = /* @__PURE__ */ template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$37 = /* @__PURE__ */ template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$38 = /* @__PURE__ */ template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$39 = /* @__PURE__ */ template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$40 = /* @__PURE__ */ template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$41 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$42 = /* @__PURE__ */ template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$43 = /* @__PURE__ */ template(`<li>`), _tmpl$44 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$45 = /* @__PURE__ */ template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$46 = /* @__PURE__ */ template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<div>`);
|
|
22
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ template(`<button>`), _tmpl$3 = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ template(`<div class="p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700"><p class="text-red-500 dark:text-red-400 text-sm">Invalid chart data: missing data.datasets`), _tmpl$5 = /* @__PURE__ */ template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$6 = /* @__PURE__ */ template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$7 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__PURE__ */ template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$9 = /* @__PURE__ */ template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$0 = /* @__PURE__ */ template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ template(`<tr>`), _tmpl$10 = /* @__PURE__ */ template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$11 = /* @__PURE__ */ template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Copy TSV`), _tmpl$13 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download CSV`), _tmpl$14 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download JSON`), _tmpl$15 = /* @__PURE__ */ template(`<div class="absolute right-0 mt-1 w-36 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm"><!$><!/><!$><!/><!$><!/>`), _tmpl$16 = /* @__PURE__ */ template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"title="Export table"aria-label="Export table"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$17 = /* @__PURE__ */ template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$18 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$20 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group"><!$><!/><div class=p-4><!$><!/><div class=overflow-x-auto role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-50 dark:bg-gray-900/50 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/>`), _tmpl$21 = /* @__PURE__ */ template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-50 dark:bg-gray-900/50">`), _tmpl$22 = /* @__PURE__ */ template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$23 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$24 = /* @__PURE__ */ template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$25 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$26 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$27 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$28 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$29 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"loading=lazy>`, true, false, false), _tmpl$30 = /* @__PURE__ */ template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$31 = /* @__PURE__ */ template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$32 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$33 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$34 = /* @__PURE__ */ template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$35 = /* @__PURE__ */ template(`<span aria-hidden=true>`), _tmpl$36 = /* @__PURE__ */ template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$37 = /* @__PURE__ */ template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$38 = /* @__PURE__ */ template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$39 = /* @__PURE__ */ template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$40 = /* @__PURE__ */ template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$41 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$42 = /* @__PURE__ */ template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$43 = /* @__PURE__ */ template(`<li>`), _tmpl$44 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$45 = /* @__PURE__ */ template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$46 = /* @__PURE__ */ template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<div>`);
|
|
23
23
|
function CopyButton(props) {
|
|
24
24
|
const [copied, setCopied] = createSignal(false);
|
|
25
25
|
const handleCopy = async () => {
|
|
@@ -741,15 +741,17 @@ function IframeRenderer(props) {
|
|
|
741
741
|
}
|
|
742
742
|
}), _el$120, _co$24);
|
|
743
743
|
effect((_p$) => {
|
|
744
|
-
var _v$14 = params.url, _v$15 = params.title || "Embedded content", _v$16 = `height: ${params.height || "400px"}; min-height: 300px
|
|
744
|
+
var _v$14 = params.url, _v$15 = params.title || "Embedded content", _v$16 = `height: ${params.height || "400px"}; min-height: 300px;`, _v$17 = getIframeSandbox(params.url);
|
|
745
745
|
_v$14 !== _p$.e && setAttribute(_el$118, "src", _p$.e = _v$14);
|
|
746
746
|
_v$15 !== _p$.t && setAttribute(_el$118, "title", _p$.t = _v$15);
|
|
747
747
|
_p$.a = style(_el$118, _v$16, _p$.a);
|
|
748
|
+
_v$17 !== _p$.o && setAttribute(_el$118, "sandbox", _p$.o = _v$17);
|
|
748
749
|
return _p$;
|
|
749
750
|
}, {
|
|
750
751
|
e: void 0,
|
|
751
752
|
t: void 0,
|
|
752
|
-
a: void 0
|
|
753
|
+
a: void 0,
|
|
754
|
+
o: void 0
|
|
753
755
|
});
|
|
754
756
|
return _el$115;
|
|
755
757
|
})();
|
|
@@ -769,12 +771,12 @@ function ImageRenderer(props) {
|
|
|
769
771
|
}
|
|
770
772
|
}), _el$128, _co$25);
|
|
771
773
|
effect((_p$) => {
|
|
772
|
-
var _v$
|
|
773
|
-
_v$
|
|
774
|
-
_v$
|
|
775
|
-
_v$
|
|
776
|
-
_v$
|
|
777
|
-
_v$
|
|
774
|
+
var _v$18 = `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$19 = params.url, _v$20 = `View full size: ${params.alt || "image"}`, _v$21 = params.url, _v$22 = params.alt || "Image";
|
|
775
|
+
_v$18 !== _p$.e && className(_el$121, _p$.e = _v$18);
|
|
776
|
+
_v$19 !== _p$.t && setAttribute(_el$123, "href", _p$.t = _v$19);
|
|
777
|
+
_v$20 !== _p$.a && setAttribute(_el$123, "aria-label", _p$.a = _v$20);
|
|
778
|
+
_v$21 !== _p$.o && setAttribute(_el$124, "src", _p$.o = _v$21);
|
|
779
|
+
_v$22 !== _p$.i && setAttribute(_el$124, "alt", _p$.i = _v$22);
|
|
778
780
|
return _p$;
|
|
779
781
|
}, {
|
|
780
782
|
e: void 0,
|
|
@@ -803,10 +805,10 @@ function LinkRenderer(props) {
|
|
|
803
805
|
}
|
|
804
806
|
}), _el$135, _co$26);
|
|
805
807
|
effect((_p$) => {
|
|
806
|
-
var _v$
|
|
807
|
-
_v$
|
|
808
|
-
_v$
|
|
809
|
-
_v$
|
|
808
|
+
var _v$23 = params.url, _v$24 = `${params.label || "Link"}: ${params.description || params.url} (opens in new tab)`, _v$25 = `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 || ""}`;
|
|
809
|
+
_v$23 !== _p$.e && setAttribute(_el$129, "href", _p$.e = _v$23);
|
|
810
|
+
_v$24 !== _p$.t && setAttribute(_el$129, "aria-label", _p$.t = _v$24);
|
|
811
|
+
_v$25 !== _p$.a && className(_el$129, _p$.a = _v$25);
|
|
810
812
|
return _p$;
|
|
811
813
|
}, {
|
|
812
814
|
e: void 0,
|
|
@@ -1093,13 +1095,13 @@ function ActionRenderer(props) {
|
|
|
1093
1095
|
}), _el$142, _co$27);
|
|
1094
1096
|
insert(_el$139, () => params.label, _el$144, _co$28);
|
|
1095
1097
|
effect((_p$) => {
|
|
1096
|
-
var _v$
|
|
1098
|
+
var _v$26 = params.url || "#", _v$27 = params.url ? "_blank" : void 0, _v$28 = params.ariaLabel || params.label, _v$29 = `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
|
|
1097
1099
|
${params.variant === "primary" ? "bg-blue-600 text-white hover:bg-blue-700" : params.variant === "outline" ? "border border-gray-300 text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800" : "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300"}
|
|
1098
1100
|
${params.className || ""}`;
|
|
1099
|
-
_v$
|
|
1100
|
-
_v$
|
|
1101
|
-
_v$
|
|
1102
|
-
_v$
|
|
1101
|
+
_v$26 !== _p$.e && setAttribute(_el$139, "href", _p$.e = _v$26);
|
|
1102
|
+
_v$27 !== _p$.t && setAttribute(_el$139, "target", _p$.t = _v$27);
|
|
1103
|
+
_v$28 !== _p$.a && setAttribute(_el$139, "aria-label", _p$.a = _v$28);
|
|
1104
|
+
_v$29 !== _p$.o && className(_el$139, _p$.o = _v$29);
|
|
1103
1105
|
return _p$;
|
|
1104
1106
|
}, {
|
|
1105
1107
|
e: void 0,
|
|
@@ -1134,16 +1136,16 @@ function ActionRenderer(props) {
|
|
|
1134
1136
|
}), _el$151, _co$30);
|
|
1135
1137
|
insert(_el$145, () => params.label, _el$153, _co$31);
|
|
1136
1138
|
effect((_p$) => {
|
|
1137
|
-
var _v$
|
|
1139
|
+
var _v$30 = params.action === "submit" ? "submit" : "button", _v$31 = isDisabled(), _v$32 = isExecuting() && params.action === "tool-call", _v$33 = params.ariaLabel || params.label, _v$34 = `inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
|
|
1138
1140
|
${params.variant === "primary" ? "bg-blue-600 text-white hover:bg-blue-700 shadow-sm" : params.variant === "secondary" ? "bg-gray-100 text-gray-900 hover:bg-gray-200 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600" : params.variant === "outline" ? "border border-gray-300 text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800" : params.variant === "danger" ? "bg-red-600 text-white hover:bg-red-700" : "bg-transparent text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-800"}
|
|
1139
1141
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1140
1142
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1141
1143
|
${params.className || ""}`;
|
|
1142
|
-
_v$
|
|
1143
|
-
_v$
|
|
1144
|
-
_v$
|
|
1145
|
-
_v$
|
|
1146
|
-
_v$
|
|
1144
|
+
_v$30 !== _p$.e && setAttribute(_el$145, "type", _p$.e = _v$30);
|
|
1145
|
+
_v$31 !== _p$.t && setProperty(_el$145, "disabled", _p$.t = _v$31);
|
|
1146
|
+
_v$32 !== _p$.a && setAttribute(_el$145, "aria-busy", _p$.a = _v$32);
|
|
1147
|
+
_v$33 !== _p$.o && setAttribute(_el$145, "aria-label", _p$.o = _v$33);
|
|
1148
|
+
_v$34 !== _p$.i && className(_el$145, _p$.i = _v$34);
|
|
1147
1149
|
return _p$;
|
|
1148
1150
|
}, {
|
|
1149
1151
|
e: void 0,
|
|
@@ -1355,9 +1357,9 @@ const UIResourceRenderer = (props) => {
|
|
|
1355
1357
|
}
|
|
1356
1358
|
}), _el$189, _co$39);
|
|
1357
1359
|
effect((_p$) => {
|
|
1358
|
-
var _v$
|
|
1359
|
-
_v$
|
|
1360
|
-
_p$.t = style(_el$187, _v$
|
|
1360
|
+
var _v$35 = `w-full ${props.class || ""}`, _v$36 = gridContainerStyle();
|
|
1361
|
+
_v$35 !== _p$.e && className(_el$186, _p$.e = _v$35);
|
|
1362
|
+
_p$.t = style(_el$187, _v$36, _p$.t);
|
|
1361
1363
|
return _p$;
|
|
1362
1364
|
}, {
|
|
1363
1365
|
e: void 0,
|