@seed-ship/mcp-ui-solid 2.1.2 → 2.2.3
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/ChartJSRenderer.cjs +79 -36
- package/dist/components/ChartJSRenderer.cjs.map +1 -1
- package/dist/components/ChartJSRenderer.d.ts.map +1 -1
- package/dist/components/ChartJSRenderer.js +80 -37
- package/dist/components/ChartJSRenderer.js.map +1 -1
- package/dist/components/CodeBlockRenderer.cjs +79 -56
- package/dist/components/CodeBlockRenderer.cjs.map +1 -1
- package/dist/components/CodeBlockRenderer.d.ts.map +1 -1
- package/dist/components/CodeBlockRenderer.js +80 -57
- package/dist/components/CodeBlockRenderer.js.map +1 -1
- package/dist/components/ExpandableWrapper.cjs +136 -0
- package/dist/components/ExpandableWrapper.cjs.map +1 -0
- package/dist/components/ExpandableWrapper.d.ts +31 -0
- package/dist/components/ExpandableWrapper.d.ts.map +1 -0
- package/dist/components/ExpandableWrapper.js +136 -0
- package/dist/components/ExpandableWrapper.js.map +1 -0
- package/dist/components/UIResourceRenderer.cjs +369 -242
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts +4 -0
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +370 -243
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/{dompurify@3.3.0 → dompurify@3.3.3}/node_modules/dompurify/dist/purify.es.cjs +19 -4
- package/dist/node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/dist/purify.es.cjs.map +1 -0
- package/dist/node_modules/.pnpm/{dompurify@3.3.0 → dompurify@3.3.3}/node_modules/dompurify/dist/purify.es.js +19 -4
- package/dist/node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/dist/purify.es.js.map +1 -0
- package/dist/services/component-registry.cjs.map +1 -1
- package/dist/services/component-registry.d.ts +1 -0
- package/dist/services/component-registry.d.ts.map +1 -1
- package/dist/services/component-registry.js.map +1 -1
- package/dist/services/validation.cjs +29 -5
- package/dist/services/validation.cjs.map +1 -1
- package/dist/services/validation.d.ts.map +1 -1
- package/dist/services/validation.js +29 -5
- package/dist/services/validation.js.map +1 -1
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types.d.cts +17 -0
- package/dist/types.d.ts +17 -0
- package/package.json +4 -4
- package/src/components/ChartJSRenderer.tsx +71 -42
- package/src/components/CodeBlockRenderer.tsx +33 -14
- package/src/components/ExpandableWrapper.test.tsx +229 -0
- package/src/components/ExpandableWrapper.tsx +201 -0
- package/src/components/UIResourceRenderer.tsx +165 -62
- package/src/components/renderCellValue.test.ts +122 -0
- package/src/index.ts +2 -0
- package/src/services/component-registry.test.ts +81 -0
- package/src/services/component-registry.ts +3 -2
- package/src/services/validation.test.ts +134 -0
- package/src/services/validation.ts +21 -5
- package/src/types/index.ts +17 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.cjs.map +0 -1
- package/dist/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const web = require("solid-js/web");
|
|
4
|
-
const purify_es = require("../node_modules/.pnpm/dompurify@3.3.
|
|
4
|
+
const purify_es = require("../node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/dist/purify.es.cjs");
|
|
5
5
|
const solidJs = require("solid-js");
|
|
6
6
|
const validation = require("../services/validation.cjs");
|
|
7
7
|
const GenerativeUIErrorBoundary = require("./GenerativeUIErrorBoundary.cjs");
|
|
@@ -17,10 +17,11 @@ const ImageGalleryRenderer = require("./ImageGalleryRenderer.cjs");
|
|
|
17
17
|
const VideoRenderer = require("./VideoRenderer.cjs");
|
|
18
18
|
const CodeBlockRenderer = require("./CodeBlockRenderer.cjs");
|
|
19
19
|
const MapRenderer = require("./MapRenderer.cjs");
|
|
20
|
+
const ExpandableWrapper = require("./ExpandableWrapper.cjs");
|
|
20
21
|
const RenderContext = require("./RenderContext.cjs");
|
|
21
22
|
const useAction = require("../hooks/useAction.cjs");
|
|
22
23
|
const marked_esm = require("../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.cjs");
|
|
23
|
-
var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$5 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$6 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$7 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$8 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$9 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$0 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$1 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$10 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$11 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$12 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$13 = /* @__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$14 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group"><!$><!/><div class=p-4><!$><!/><div class=overflow-x-auto role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-50 dark:bg-gray-900/50 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/>`), _tmpl$15 = /* @__PURE__ */ web.template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-50 dark:bg-gray-900/50">`), _tmpl$16 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$17 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$18 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$19 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 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$20 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$21 = /* @__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$22 = /* @__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$23 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"sandbox="allow-scripts allow-same-origin allow-popups allow-forms"loading=lazy>`, true, false, false), _tmpl$24 = /* @__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$25 = /* @__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$26 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$27 = /* @__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$28 = /* @__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$29 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$30 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$31 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$32 = /* @__PURE__ */ web.template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$33 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$34 = /* @__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$35 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$36 = /* @__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$37 = /* @__PURE__ */ web.template(`<li>`), _tmpl$38 = /* @__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$39 = /* @__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$40 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$41 = /* @__PURE__ */ web.template(`<div>`);
|
|
24
|
+
var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$5 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$6 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$7 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$8 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$9 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$0 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$1 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$10 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$11 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Copy TSV`), _tmpl$12 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download CSV`), _tmpl$13 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download JSON`), _tmpl$14 = /* @__PURE__ */ web.template(`<div class="absolute right-0 mt-1 w-36 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm"><!$><!/><!$><!/><!$><!/>`), _tmpl$15 = /* @__PURE__ */ web.template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"title="Export table"aria-label="Export table"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$16 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$17 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3"><!$><!/><!$><!/>`), _tmpl$18 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$19 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group"><!$><!/><div class=p-4><!$><!/><div class=overflow-x-auto role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-50 dark:bg-gray-900/50 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/>`), _tmpl$20 = /* @__PURE__ */ web.template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-50 dark:bg-gray-900/50">`), _tmpl$21 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$22 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$23 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$24 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$25 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$26 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$27 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$28 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"sandbox="allow-scripts allow-same-origin allow-popups allow-forms"loading=lazy>`, true, false, false), _tmpl$29 = /* @__PURE__ */ web.template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$30 = /* @__PURE__ */ web.template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$31 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$32 = /* @__PURE__ */ web.template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$33 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$34 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$35 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$36 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$37 = /* @__PURE__ */ web.template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$38 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$39 = /* @__PURE__ */ web.template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$40 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$41 = /* @__PURE__ */ web.template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$42 = /* @__PURE__ */ web.template(`<li>`), _tmpl$43 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$44 = /* @__PURE__ */ web.template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$45 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$46 = /* @__PURE__ */ web.template(`<div>`);
|
|
24
25
|
function CopyButton(props) {
|
|
25
26
|
const [copied, setCopied] = solidJs.createSignal(false);
|
|
26
27
|
const handleCopy = async () => {
|
|
@@ -232,6 +233,14 @@ function renderCellValue(value) {
|
|
|
232
233
|
ADD_ATTR: ["target", "rel"]
|
|
233
234
|
});
|
|
234
235
|
}
|
|
236
|
+
const hasHtml = /<[a-z][\s\S]*>/i.test(strValue);
|
|
237
|
+
if (hasHtml) {
|
|
238
|
+
return purify_es.sanitize(strValue, {
|
|
239
|
+
ALLOWED_TAGS: ["a", "strong", "em", "b", "i", "code", "span", "br"],
|
|
240
|
+
ALLOWED_ATTR: ["href", "target", "rel", "class", "data-citation-page", "data-citation-source", "title"],
|
|
241
|
+
ADD_ATTR: ["target", "rel"]
|
|
242
|
+
});
|
|
243
|
+
}
|
|
235
244
|
const hasMarkdown = /[*_`[\]#]/.test(strValue);
|
|
236
245
|
if (hasMarkdown) {
|
|
237
246
|
const parsed = marked_esm.marked.parse(strValue, {
|
|
@@ -241,7 +250,7 @@ function renderCellValue(value) {
|
|
|
241
250
|
ADD_ATTR: ["target", "rel"]
|
|
242
251
|
});
|
|
243
252
|
}
|
|
244
|
-
return strValue;
|
|
253
|
+
return purify_es.sanitize(strValue);
|
|
245
254
|
}
|
|
246
255
|
function TableRenderer(props) {
|
|
247
256
|
const tableParams = props.component.params;
|
|
@@ -293,19 +302,74 @@ function TableRenderer(props) {
|
|
|
293
302
|
setIsVirtualizing(false);
|
|
294
303
|
}
|
|
295
304
|
});
|
|
305
|
+
const getCellValue = (row, key) => {
|
|
306
|
+
const value = row[key];
|
|
307
|
+
if (value === null || value === void 0) return "";
|
|
308
|
+
if (typeof value === "object") return value.name || value.label || JSON.stringify(value);
|
|
309
|
+
return String(value);
|
|
310
|
+
};
|
|
296
311
|
const getTableText = () => {
|
|
297
312
|
const columns = tableParams.columns || [];
|
|
298
313
|
const rows = tableParams.rows || [];
|
|
299
314
|
const header = columns.map((c) => c.label).join(" ");
|
|
300
|
-
const dataRows = rows.map((row) => columns.map((c) =>
|
|
301
|
-
const value = row[c.key];
|
|
302
|
-
if (value === null || value === void 0) return "";
|
|
303
|
-
if (typeof value === "object") return value.name || value.label || JSON.stringify(value);
|
|
304
|
-
return String(value);
|
|
305
|
-
}).join(" ")).join("\n");
|
|
315
|
+
const dataRows = rows.map((row) => columns.map((c) => getCellValue(row, c.key)).join(" ")).join("\n");
|
|
306
316
|
return `${header}
|
|
307
317
|
${dataRows}`;
|
|
308
318
|
};
|
|
319
|
+
const getTableCSV = () => {
|
|
320
|
+
const columns = tableParams.columns || [];
|
|
321
|
+
const rows = tableParams.rows || [];
|
|
322
|
+
const escapeCSV = (val) => {
|
|
323
|
+
if (val.includes(",") || val.includes('"') || val.includes("\n")) {
|
|
324
|
+
return `"${val.replace(/"/g, '""')}"`;
|
|
325
|
+
}
|
|
326
|
+
return val;
|
|
327
|
+
};
|
|
328
|
+
const header = columns.map((c) => escapeCSV(c.label)).join(",");
|
|
329
|
+
const dataRows = rows.map((row) => columns.map((c) => escapeCSV(getCellValue(row, c.key))).join(",")).join("\n");
|
|
330
|
+
return `${header}
|
|
331
|
+
${dataRows}`;
|
|
332
|
+
};
|
|
333
|
+
const getTableJSON = () => {
|
|
334
|
+
const columns = tableParams.columns || [];
|
|
335
|
+
const rows = tableParams.rows || [];
|
|
336
|
+
return JSON.stringify({
|
|
337
|
+
columns: columns.map((c) => ({
|
|
338
|
+
key: c.key,
|
|
339
|
+
label: c.label
|
|
340
|
+
})),
|
|
341
|
+
rows
|
|
342
|
+
}, null, 2);
|
|
343
|
+
};
|
|
344
|
+
const downloadFile = (content, filename, mimeType) => {
|
|
345
|
+
const blob = new Blob([content], {
|
|
346
|
+
type: mimeType
|
|
347
|
+
});
|
|
348
|
+
const url = URL.createObjectURL(blob);
|
|
349
|
+
const a = document.createElement("a");
|
|
350
|
+
a.href = url;
|
|
351
|
+
a.download = filename;
|
|
352
|
+
a.click();
|
|
353
|
+
URL.revokeObjectURL(url);
|
|
354
|
+
};
|
|
355
|
+
const exportable = tableParams.exportable;
|
|
356
|
+
const exportFormats = typeof exportable === "object" && (exportable == null ? void 0 : exportable.formats) ? exportable.formats : ["csv", "tsv", "json"];
|
|
357
|
+
const exportFilename = typeof exportable === "object" && (exportable == null ? void 0 : exportable.filename) || `table-${Math.random().toString(36).slice(2, 9)}`;
|
|
358
|
+
const [showExportMenu, setShowExportMenu] = solidJs.createSignal(false);
|
|
359
|
+
const handleExport = (format) => {
|
|
360
|
+
setShowExportMenu(false);
|
|
361
|
+
switch (format) {
|
|
362
|
+
case "tsv":
|
|
363
|
+
navigator.clipboard.writeText(getTableText());
|
|
364
|
+
break;
|
|
365
|
+
case "csv":
|
|
366
|
+
downloadFile(getTableCSV(), `${exportFilename}.csv`, "text/csv");
|
|
367
|
+
break;
|
|
368
|
+
case "json":
|
|
369
|
+
downloadFile(getTableJSON(), `${exportFilename}.json`, "application/json");
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
};
|
|
309
373
|
const tableId = `table-${Math.random().toString(36).slice(2, 9)}`;
|
|
310
374
|
const StandardTableBody = () => (() => {
|
|
311
375
|
var _el$20 = web.getNextElement(_tmpl$9);
|
|
@@ -374,92 +438,154 @@ ${dataRows}`;
|
|
|
374
438
|
return _el$24;
|
|
375
439
|
})();
|
|
376
440
|
};
|
|
377
|
-
return (
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
return (
|
|
402
|
-
},
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
441
|
+
return web.createComponent(ExpandableWrapper.ExpandableWrapper, {
|
|
442
|
+
get title() {
|
|
443
|
+
return tableParams.title || "Table";
|
|
444
|
+
},
|
|
445
|
+
get copyData() {
|
|
446
|
+
return getTableText();
|
|
447
|
+
},
|
|
448
|
+
copyLabel: "Copy table (TSV)",
|
|
449
|
+
get children() {
|
|
450
|
+
var _el$28 = web.getNextElement(_tmpl$19), _el$77 = _el$28.firstChild, [_el$78, _co$16] = web.getNextMarker(_el$77.nextSibling), _el$43 = _el$78.nextSibling, _el$73 = _el$43.firstChild, [_el$74, _co$14] = web.getNextMarker(_el$73.nextSibling), _el$54 = _el$74.nextSibling, _el$55 = _el$54.firstChild, _el$56 = _el$55.firstChild, _el$57 = _el$56.firstChild, _el$58 = _el$56.nextSibling, [_el$59, _co$10] = web.getNextMarker(_el$58.nextSibling), _el$75 = _el$54.nextSibling, [_el$76, _co$15] = web.getNextMarker(_el$75.nextSibling);
|
|
451
|
+
web.insert(_el$28, web.createComponent(solidJs.Show, {
|
|
452
|
+
when: exportable,
|
|
453
|
+
get fallback() {
|
|
454
|
+
return web.createComponent(CopyButton, {
|
|
455
|
+
getText: getTableText,
|
|
456
|
+
title: "Copy table data",
|
|
457
|
+
position: "top-right"
|
|
458
|
+
});
|
|
459
|
+
},
|
|
460
|
+
get children() {
|
|
461
|
+
var _el$29 = web.getNextElement(_tmpl$15), _el$30 = _el$29.firstChild, _el$41 = _el$30.nextSibling, [_el$42, _co$8] = web.getNextMarker(_el$41.nextSibling);
|
|
462
|
+
_el$30.$$click = () => setShowExportMenu(!showExportMenu());
|
|
463
|
+
web.insert(_el$29, web.createComponent(solidJs.Show, {
|
|
464
|
+
get when() {
|
|
465
|
+
return showExportMenu();
|
|
466
|
+
},
|
|
467
|
+
get children() {
|
|
468
|
+
var _el$31 = web.getNextElement(_tmpl$14), _el$35 = _el$31.firstChild, [_el$36, _co$5] = web.getNextMarker(_el$35.nextSibling), _el$37 = _el$36.nextSibling, [_el$38, _co$6] = web.getNextMarker(_el$37.nextSibling), _el$39 = _el$38.nextSibling, [_el$40, _co$7] = web.getNextMarker(_el$39.nextSibling);
|
|
469
|
+
web.insert(_el$31, web.createComponent(solidJs.Show, {
|
|
470
|
+
get when() {
|
|
471
|
+
return exportFormats.includes("tsv");
|
|
472
|
+
},
|
|
473
|
+
get children() {
|
|
474
|
+
var _el$32 = web.getNextElement(_tmpl$11);
|
|
475
|
+
_el$32.$$click = () => handleExport("tsv");
|
|
476
|
+
web.runHydrationEvents();
|
|
477
|
+
return _el$32;
|
|
478
|
+
}
|
|
479
|
+
}), _el$36, _co$5);
|
|
480
|
+
web.insert(_el$31, web.createComponent(solidJs.Show, {
|
|
481
|
+
get when() {
|
|
482
|
+
return exportFormats.includes("csv");
|
|
483
|
+
},
|
|
484
|
+
get children() {
|
|
485
|
+
var _el$33 = web.getNextElement(_tmpl$12);
|
|
486
|
+
_el$33.$$click = () => handleExport("csv");
|
|
487
|
+
web.runHydrationEvents();
|
|
488
|
+
return _el$33;
|
|
489
|
+
}
|
|
490
|
+
}), _el$38, _co$6);
|
|
491
|
+
web.insert(_el$31, web.createComponent(solidJs.Show, {
|
|
492
|
+
get when() {
|
|
493
|
+
return exportFormats.includes("json");
|
|
494
|
+
},
|
|
495
|
+
get children() {
|
|
496
|
+
var _el$34 = web.getNextElement(_tmpl$13);
|
|
497
|
+
_el$34.$$click = () => handleExport("json");
|
|
498
|
+
web.runHydrationEvents();
|
|
499
|
+
return _el$34;
|
|
500
|
+
}
|
|
501
|
+
}), _el$40, _co$7);
|
|
502
|
+
return _el$31;
|
|
503
|
+
}
|
|
504
|
+
}), _el$42, _co$8);
|
|
505
|
+
web.runHydrationEvents();
|
|
506
|
+
return _el$29;
|
|
507
|
+
}
|
|
508
|
+
}), _el$78, _co$16);
|
|
509
|
+
web.insert(_el$43, web.createComponent(solidJs.Show, {
|
|
510
|
+
get when() {
|
|
511
|
+
return tableParams.title;
|
|
512
|
+
},
|
|
513
|
+
get children() {
|
|
514
|
+
var _el$44 = web.getNextElement(_tmpl$17), _el$50 = _el$44.firstChild, [_el$51, _co$0] = web.getNextMarker(_el$50.nextSibling), _el$52 = _el$51.nextSibling, [_el$53, _co$1] = web.getNextMarker(_el$52.nextSibling);
|
|
515
|
+
web.setAttribute(_el$44, "id", `${tableId}-title`);
|
|
516
|
+
web.insert(_el$44, () => tableParams.title, _el$51, _co$0);
|
|
517
|
+
web.insert(_el$44, web.createComponent(solidJs.Show, {
|
|
518
|
+
get when() {
|
|
519
|
+
return isVirtualizing();
|
|
520
|
+
},
|
|
521
|
+
get children() {
|
|
522
|
+
var _el$45 = web.getNextElement(_tmpl$16), _el$46 = _el$45.firstChild, _el$48 = _el$46.nextSibling, [_el$49, _co$9] = web.getNextMarker(_el$48.nextSibling);
|
|
523
|
+
_el$49.nextSibling;
|
|
524
|
+
web.insert(_el$45, () => {
|
|
525
|
+
var _a;
|
|
526
|
+
return (_a = tableParams.rows) == null ? void 0 : _a.length;
|
|
527
|
+
}, _el$49, _co$9);
|
|
528
|
+
return _el$45;
|
|
529
|
+
}
|
|
530
|
+
}), _el$53, _co$1);
|
|
531
|
+
return _el$44;
|
|
532
|
+
}
|
|
533
|
+
}), _el$74, _co$14);
|
|
534
|
+
var _ref$ = scrollContainerRef;
|
|
535
|
+
typeof _ref$ === "function" ? web.use(_ref$, _el$54) : scrollContainerRef = _el$54;
|
|
536
|
+
web.insert(_el$57, web.createComponent(solidJs.For, {
|
|
537
|
+
get each() {
|
|
538
|
+
return tableParams.columns;
|
|
539
|
+
},
|
|
540
|
+
children: (column) => (() => {
|
|
541
|
+
var _el$79 = web.getNextElement(_tmpl$20);
|
|
542
|
+
web.insert(_el$79, () => column.label);
|
|
543
|
+
web.effect((_$p) => web.style(_el$79, column.width ? {
|
|
544
|
+
width: column.width
|
|
545
|
+
} : {}, _$p));
|
|
546
|
+
return _el$79;
|
|
547
|
+
})()
|
|
548
|
+
}));
|
|
549
|
+
web.insert(_el$55, web.createComponent(solidJs.Show, {
|
|
550
|
+
get when() {
|
|
551
|
+
return isVirtualizing();
|
|
552
|
+
},
|
|
553
|
+
get fallback() {
|
|
554
|
+
return web.createComponent(StandardTableBody, {});
|
|
555
|
+
},
|
|
556
|
+
get children() {
|
|
557
|
+
return web.createComponent(VirtualizedTableBody, {});
|
|
558
|
+
}
|
|
559
|
+
}), _el$59, _co$10);
|
|
560
|
+
web.insert(_el$43, web.createComponent(solidJs.Show, {
|
|
561
|
+
get when() {
|
|
562
|
+
return tableParams.pagination;
|
|
563
|
+
},
|
|
564
|
+
get children() {
|
|
565
|
+
var _el$60 = web.getNextElement(_tmpl$18), _el$61 = _el$60.firstChild, _el$62 = _el$61.firstChild, _el$67 = _el$62.nextSibling, [_el$68, _co$11] = web.getNextMarker(_el$67.nextSibling), _el$63 = _el$68.nextSibling, _el$69 = _el$63.nextSibling, [_el$70, _co$12] = web.getNextMarker(_el$69.nextSibling), _el$65 = _el$70.nextSibling, _el$71 = _el$65.nextSibling, [_el$72, _co$13] = web.getNextMarker(_el$71.nextSibling);
|
|
566
|
+
web.insert(_el$61, () => tableParams.pagination.currentPage * tableParams.pagination.pageSize + 1, _el$68, _co$11);
|
|
567
|
+
web.insert(_el$61, () => Math.min((tableParams.pagination.currentPage + 1) * tableParams.pagination.pageSize, tableParams.pagination.totalRows), _el$70, _co$12);
|
|
568
|
+
web.insert(_el$61, () => tableParams.pagination.totalRows, _el$72, _co$13);
|
|
569
|
+
return _el$60;
|
|
570
|
+
}
|
|
571
|
+
}), _el$76, _co$15);
|
|
572
|
+
web.effect((_p$) => {
|
|
573
|
+
var _v$8 = isVirtualizing() ? {
|
|
574
|
+
"max-height": "500px",
|
|
575
|
+
"overflow-y": "auto"
|
|
576
|
+
} : {}, _v$9 = tableParams.title || "Data table", _v$0 = tableParams.title ? `${tableId}-title` : void 0;
|
|
577
|
+
_p$.e = web.style(_el$54, _v$8, _p$.e);
|
|
578
|
+
_v$9 !== _p$.t && web.setAttribute(_el$54, "aria-label", _p$.t = _v$9);
|
|
579
|
+
_v$0 !== _p$.a && web.setAttribute(_el$55, "aria-labelledby", _p$.a = _v$0);
|
|
580
|
+
return _p$;
|
|
581
|
+
}, {
|
|
582
|
+
e: void 0,
|
|
583
|
+
t: void 0,
|
|
584
|
+
a: void 0
|
|
585
|
+
});
|
|
586
|
+
return _el$28;
|
|
587
|
+
}
|
|
588
|
+
});
|
|
463
589
|
}
|
|
464
590
|
function MetricRenderer(props) {
|
|
465
591
|
const metricParams = props.component.params;
|
|
@@ -470,51 +596,51 @@ function MetricRenderer(props) {
|
|
|
470
596
|
return `${title}: ${value}${unit ? " " + unit : ""}`;
|
|
471
597
|
};
|
|
472
598
|
return (() => {
|
|
473
|
-
var _el$
|
|
474
|
-
web.insert(_el$
|
|
599
|
+
var _el$80 = web.getNextElement(_tmpl$24), _el$102 = _el$80.firstChild, [_el$103, _co$22] = web.getNextMarker(_el$102.nextSibling), _el$81 = _el$103.nextSibling, _el$82 = _el$81.firstChild, _el$83 = _el$82.firstChild, _el$84 = _el$83.nextSibling, _el$85 = _el$84.firstChild, _el$87 = _el$85.nextSibling, [_el$88, _co$17] = web.getNextMarker(_el$87.nextSibling), _el$98 = _el$82.nextSibling, [_el$99, _co$20] = web.getNextMarker(_el$98.nextSibling), _el$100 = _el$99.nextSibling, [_el$101, _co$21] = web.getNextMarker(_el$100.nextSibling);
|
|
600
|
+
web.insert(_el$80, web.createComponent(CopyButton, {
|
|
475
601
|
getText: getMetricText,
|
|
476
602
|
title: "Copy metric",
|
|
477
603
|
position: "top-right"
|
|
478
|
-
}), _el$
|
|
479
|
-
web.insert(_el$
|
|
480
|
-
web.insert(_el$
|
|
481
|
-
web.insert(_el$
|
|
604
|
+
}), _el$103, _co$22);
|
|
605
|
+
web.insert(_el$83, () => metricParams.title);
|
|
606
|
+
web.insert(_el$85, () => metricParams.value);
|
|
607
|
+
web.insert(_el$84, web.createComponent(solidJs.Show, {
|
|
482
608
|
get when() {
|
|
483
609
|
return metricParams.unit;
|
|
484
610
|
},
|
|
485
611
|
get children() {
|
|
486
|
-
var _el$
|
|
487
|
-
web.insert(_el$
|
|
488
|
-
return _el$
|
|
612
|
+
var _el$86 = web.getNextElement(_tmpl$21);
|
|
613
|
+
web.insert(_el$86, () => metricParams.unit);
|
|
614
|
+
return _el$86;
|
|
489
615
|
}
|
|
490
|
-
}), _el$
|
|
491
|
-
web.insert(_el$
|
|
616
|
+
}), _el$88, _co$17);
|
|
617
|
+
web.insert(_el$81, web.createComponent(solidJs.Show, {
|
|
492
618
|
get when() {
|
|
493
619
|
return metricParams.trend;
|
|
494
620
|
},
|
|
495
621
|
get children() {
|
|
496
|
-
var _el$
|
|
497
|
-
_el$
|
|
498
|
-
web.insert(_el$
|
|
622
|
+
var _el$89 = web.getNextElement(_tmpl$22), _el$90 = _el$89.firstChild, _el$93 = _el$90.firstChild, [_el$94, _co$18] = web.getNextMarker(_el$93.nextSibling), _el$91 = _el$94.nextSibling, _el$95 = _el$91.nextSibling, [_el$96, _co$19] = web.getNextMarker(_el$95.nextSibling);
|
|
623
|
+
_el$96.nextSibling;
|
|
624
|
+
web.insert(_el$90, (() => {
|
|
499
625
|
var _c$ = web.memo(() => metricParams.trend.direction === "up");
|
|
500
626
|
return () => _c$() ? "�" : metricParams.trend.direction === "down" ? "�" : "�";
|
|
501
|
-
})(), _el$
|
|
502
|
-
web.insert(_el$
|
|
503
|
-
web.effect(() => web.className(_el$
|
|
504
|
-
return _el$
|
|
627
|
+
})(), _el$94, _co$18);
|
|
628
|
+
web.insert(_el$90, () => Math.abs(metricParams.trend.value), _el$96, _co$19);
|
|
629
|
+
web.effect(() => web.className(_el$90, `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"}`));
|
|
630
|
+
return _el$89;
|
|
505
631
|
}
|
|
506
|
-
}), _el$
|
|
507
|
-
web.insert(_el$
|
|
632
|
+
}), _el$99, _co$20);
|
|
633
|
+
web.insert(_el$81, web.createComponent(solidJs.Show, {
|
|
508
634
|
get when() {
|
|
509
635
|
return metricParams.subtitle;
|
|
510
636
|
},
|
|
511
637
|
get children() {
|
|
512
|
-
var _el$
|
|
513
|
-
web.insert(_el$
|
|
514
|
-
return _el$
|
|
638
|
+
var _el$97 = web.getNextElement(_tmpl$23);
|
|
639
|
+
web.insert(_el$97, () => metricParams.subtitle);
|
|
640
|
+
return _el$97;
|
|
515
641
|
}
|
|
516
|
-
}), _el$
|
|
517
|
-
return _el$
|
|
642
|
+
}), _el$101, _co$21);
|
|
643
|
+
return _el$80;
|
|
518
644
|
})();
|
|
519
645
|
}
|
|
520
646
|
function extractImageFromMarkdown(content) {
|
|
@@ -555,91 +681,91 @@ function TextRenderer(props) {
|
|
|
555
681
|
},
|
|
556
682
|
get fallback() {
|
|
557
683
|
return (() => {
|
|
558
|
-
var _el$
|
|
559
|
-
web.insert(_el$
|
|
684
|
+
var _el$104 = web.getNextElement(_tmpl$25), _el$106 = _el$104.firstChild, [_el$107, _co$23] = web.getNextMarker(_el$106.nextSibling), _el$105 = _el$107.nextSibling;
|
|
685
|
+
web.insert(_el$104, web.createComponent(CopyButton, {
|
|
560
686
|
getText: getTextContent,
|
|
561
687
|
title: "Copy text",
|
|
562
688
|
position: "top-right"
|
|
563
|
-
}), _el$
|
|
689
|
+
}), _el$107, _co$23);
|
|
564
690
|
web.effect((_p$) => {
|
|
565
691
|
var _v$1 = `prose prose-sm dark:prose-invert max-w-none ${textParams.className || ""}`, _v$10 = htmlContent();
|
|
566
|
-
_v$1 !== _p$.e && web.className(_el$
|
|
567
|
-
_v$10 !== _p$.t && web.setProperty(_el$
|
|
692
|
+
_v$1 !== _p$.e && web.className(_el$105, _p$.e = _v$1);
|
|
693
|
+
_v$10 !== _p$.t && web.setProperty(_el$105, "innerHTML", _p$.t = _v$10);
|
|
568
694
|
return _p$;
|
|
569
695
|
}, {
|
|
570
696
|
e: void 0,
|
|
571
697
|
t: void 0
|
|
572
698
|
});
|
|
573
|
-
return _el$
|
|
699
|
+
return _el$104;
|
|
574
700
|
})();
|
|
575
701
|
},
|
|
576
702
|
children: (data) => (() => {
|
|
577
|
-
var _el$
|
|
578
|
-
web.insert(_el$
|
|
703
|
+
var _el$108 = web.getNextElement(_tmpl$26), _el$109 = _el$108.firstChild, _el$110 = _el$109.firstChild, _el$111 = _el$110.firstChild, _el$112 = _el$109.nextSibling, _el$113 = _el$112.firstChild;
|
|
704
|
+
web.insert(_el$113, () => data().credit);
|
|
579
705
|
web.effect((_p$) => {
|
|
580
706
|
var _v$11 = data().linkUrl, _v$12 = data().imageUrl, _v$13 = data().alt;
|
|
581
|
-
_v$11 !== _p$.e && web.setAttribute(_el$
|
|
582
|
-
_v$12 !== _p$.t && web.setAttribute(_el$
|
|
583
|
-
_v$13 !== _p$.a && web.setAttribute(_el$
|
|
707
|
+
_v$11 !== _p$.e && web.setAttribute(_el$110, "href", _p$.e = _v$11);
|
|
708
|
+
_v$12 !== _p$.t && web.setAttribute(_el$111, "src", _p$.t = _v$12);
|
|
709
|
+
_v$13 !== _p$.a && web.setAttribute(_el$111, "alt", _p$.a = _v$13);
|
|
584
710
|
return _p$;
|
|
585
711
|
}, {
|
|
586
712
|
e: void 0,
|
|
587
713
|
t: void 0,
|
|
588
714
|
a: void 0
|
|
589
715
|
});
|
|
590
|
-
return _el$
|
|
716
|
+
return _el$108;
|
|
591
717
|
})()
|
|
592
718
|
});
|
|
593
719
|
}
|
|
594
720
|
function IframeRenderer(props) {
|
|
595
721
|
const params = props.component.params;
|
|
596
722
|
return (() => {
|
|
597
|
-
var _el$
|
|
598
|
-
web.insert(_el$
|
|
723
|
+
var _el$114 = web.getNextElement(_tmpl$28), _el$118 = _el$114.firstChild, [_el$119, _co$24] = web.getNextMarker(_el$118.nextSibling), _el$117 = _el$119.nextSibling;
|
|
724
|
+
web.insert(_el$114, web.createComponent(solidJs.Show, {
|
|
599
725
|
get when() {
|
|
600
726
|
return params.title;
|
|
601
727
|
},
|
|
602
728
|
get children() {
|
|
603
|
-
var _el$
|
|
604
|
-
web.insert(_el$
|
|
605
|
-
return _el$
|
|
729
|
+
var _el$115 = web.getNextElement(_tmpl$27), _el$116 = _el$115.firstChild;
|
|
730
|
+
web.insert(_el$116, () => params.title);
|
|
731
|
+
return _el$115;
|
|
606
732
|
}
|
|
607
|
-
}), _el$
|
|
733
|
+
}), _el$119, _co$24);
|
|
608
734
|
web.effect((_p$) => {
|
|
609
735
|
var _v$14 = params.url, _v$15 = params.title || "Embedded content", _v$16 = `height: ${params.height || "400px"}; min-height: 300px;`;
|
|
610
|
-
_v$14 !== _p$.e && web.setAttribute(_el$
|
|
611
|
-
_v$15 !== _p$.t && web.setAttribute(_el$
|
|
612
|
-
_p$.a = web.style(_el$
|
|
736
|
+
_v$14 !== _p$.e && web.setAttribute(_el$117, "src", _p$.e = _v$14);
|
|
737
|
+
_v$15 !== _p$.t && web.setAttribute(_el$117, "title", _p$.t = _v$15);
|
|
738
|
+
_p$.a = web.style(_el$117, _v$16, _p$.a);
|
|
613
739
|
return _p$;
|
|
614
740
|
}, {
|
|
615
741
|
e: void 0,
|
|
616
742
|
t: void 0,
|
|
617
743
|
a: void 0
|
|
618
744
|
});
|
|
619
|
-
return _el$
|
|
745
|
+
return _el$114;
|
|
620
746
|
})();
|
|
621
747
|
}
|
|
622
748
|
function ImageRenderer(props) {
|
|
623
749
|
const params = props.component.params;
|
|
624
750
|
return (() => {
|
|
625
|
-
var _el$
|
|
626
|
-
web.insert(_el$
|
|
751
|
+
var _el$120 = web.getNextElement(_tmpl$30), _el$121 = _el$120.firstChild, _el$122 = _el$121.firstChild, _el$123 = _el$122.firstChild, _el$126 = _el$121.nextSibling, [_el$127, _co$25] = web.getNextMarker(_el$126.nextSibling);
|
|
752
|
+
web.insert(_el$120, web.createComponent(solidJs.Show, {
|
|
627
753
|
get when() {
|
|
628
754
|
return params.caption;
|
|
629
755
|
},
|
|
630
756
|
get children() {
|
|
631
|
-
var _el$
|
|
632
|
-
web.insert(_el$
|
|
633
|
-
return _el$
|
|
757
|
+
var _el$124 = web.getNextElement(_tmpl$29), _el$125 = _el$124.firstChild;
|
|
758
|
+
web.insert(_el$125, () => params.caption);
|
|
759
|
+
return _el$124;
|
|
634
760
|
}
|
|
635
|
-
}), _el$
|
|
761
|
+
}), _el$127, _co$25);
|
|
636
762
|
web.effect((_p$) => {
|
|
637
763
|
var _v$17 = `w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col ${params.className || ""}`, _v$18 = params.url, _v$19 = `View full size: ${params.alt || "image"}`, _v$20 = params.url, _v$21 = params.alt || "Image";
|
|
638
|
-
_v$17 !== _p$.e && web.className(_el$
|
|
639
|
-
_v$18 !== _p$.t && web.setAttribute(_el$
|
|
640
|
-
_v$19 !== _p$.a && web.setAttribute(_el$
|
|
641
|
-
_v$20 !== _p$.o && web.setAttribute(_el$
|
|
642
|
-
_v$21 !== _p$.i && web.setAttribute(_el$
|
|
764
|
+
_v$17 !== _p$.e && web.className(_el$120, _p$.e = _v$17);
|
|
765
|
+
_v$18 !== _p$.t && web.setAttribute(_el$122, "href", _p$.t = _v$18);
|
|
766
|
+
_v$19 !== _p$.a && web.setAttribute(_el$122, "aria-label", _p$.a = _v$19);
|
|
767
|
+
_v$20 !== _p$.o && web.setAttribute(_el$123, "src", _p$.o = _v$20);
|
|
768
|
+
_v$21 !== _p$.i && web.setAttribute(_el$123, "alt", _p$.i = _v$21);
|
|
643
769
|
return _p$;
|
|
644
770
|
}, {
|
|
645
771
|
e: void 0,
|
|
@@ -648,30 +774,30 @@ function ImageRenderer(props) {
|
|
|
648
774
|
o: void 0,
|
|
649
775
|
i: void 0
|
|
650
776
|
});
|
|
651
|
-
return _el$
|
|
777
|
+
return _el$120;
|
|
652
778
|
})();
|
|
653
779
|
}
|
|
654
780
|
function LinkRenderer(props) {
|
|
655
781
|
const params = props.component.params;
|
|
656
782
|
return (() => {
|
|
657
|
-
var _el$
|
|
658
|
-
_el$
|
|
659
|
-
web.insert(_el$
|
|
660
|
-
web.insert(_el$
|
|
783
|
+
var _el$128 = web.getNextElement(_tmpl$32), _el$129 = _el$128.firstChild, _el$130 = _el$129.nextSibling, _el$131 = _el$130.firstChild, _el$133 = _el$131.nextSibling, [_el$134, _co$26] = web.getNextMarker(_el$133.nextSibling);
|
|
784
|
+
_el$128.$$click = (e) => e.stopPropagation();
|
|
785
|
+
web.insert(_el$131, () => params.label || params.url);
|
|
786
|
+
web.insert(_el$130, web.createComponent(solidJs.Show, {
|
|
661
787
|
get when() {
|
|
662
788
|
return params.description;
|
|
663
789
|
},
|
|
664
790
|
get children() {
|
|
665
|
-
var _el$
|
|
666
|
-
web.insert(_el$
|
|
667
|
-
return _el$
|
|
791
|
+
var _el$132 = web.getNextElement(_tmpl$31);
|
|
792
|
+
web.insert(_el$132, () => params.description);
|
|
793
|
+
return _el$132;
|
|
668
794
|
}
|
|
669
|
-
}), _el$
|
|
795
|
+
}), _el$134, _co$26);
|
|
670
796
|
web.effect((_p$) => {
|
|
671
797
|
var _v$22 = params.url, _v$23 = `${params.label || "Link"}: ${params.description || params.url} (opens in new tab)`, _v$24 = `flex items-center gap-3 p-4 bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors group h-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${params.className || ""}`;
|
|
672
|
-
_v$22 !== _p$.e && web.setAttribute(_el$
|
|
673
|
-
_v$23 !== _p$.t && web.setAttribute(_el$
|
|
674
|
-
_v$24 !== _p$.a && web.className(_el$
|
|
798
|
+
_v$22 !== _p$.e && web.setAttribute(_el$128, "href", _p$.e = _v$22);
|
|
799
|
+
_v$23 !== _p$.t && web.setAttribute(_el$128, "aria-label", _p$.t = _v$23);
|
|
800
|
+
_v$24 !== _p$.a && web.className(_el$128, _p$.a = _v$24);
|
|
675
801
|
return _p$;
|
|
676
802
|
}, {
|
|
677
803
|
e: void 0,
|
|
@@ -679,7 +805,7 @@ function LinkRenderer(props) {
|
|
|
679
805
|
a: void 0
|
|
680
806
|
});
|
|
681
807
|
web.runHydrationEvents();
|
|
682
|
-
return _el$
|
|
808
|
+
return _el$128;
|
|
683
809
|
})();
|
|
684
810
|
}
|
|
685
811
|
function ComponentRenderer(props) {
|
|
@@ -693,12 +819,12 @@ function ComponentRenderer(props) {
|
|
|
693
819
|
details: validation$1.errors
|
|
694
820
|
});
|
|
695
821
|
return (() => {
|
|
696
|
-
var _el$
|
|
697
|
-
web.insert(_el$
|
|
822
|
+
var _el$135 = web.getNextElement(_tmpl$33), _el$136 = _el$135.firstChild, _el$137 = _el$136.nextSibling;
|
|
823
|
+
web.insert(_el$137, () => {
|
|
698
824
|
var _a2, _b;
|
|
699
825
|
return ((_b = (_a2 = validation$1.errors) == null ? void 0 : _a2[0]) == null ? void 0 : _b.message) || "Unknown validation error";
|
|
700
826
|
});
|
|
701
|
-
return _el$
|
|
827
|
+
return _el$135;
|
|
702
828
|
})();
|
|
703
829
|
}
|
|
704
830
|
return web.createComponent(GenerativeUIErrorBoundary.GenerativeUIErrorBoundary, {
|
|
@@ -944,27 +1070,27 @@ function ActionRenderer(props) {
|
|
|
944
1070
|
const isDisabled = () => params.disabled || params.action === "tool-call" && isExecuting();
|
|
945
1071
|
if (params.type === "link" || params.action === "link") {
|
|
946
1072
|
return (() => {
|
|
947
|
-
var _el$
|
|
948
|
-
_el$
|
|
949
|
-
web.insert(_el$
|
|
1073
|
+
var _el$138 = web.getNextElement(_tmpl$35), _el$140 = _el$138.firstChild, [_el$141, _co$27] = web.getNextMarker(_el$140.nextSibling), _el$142 = _el$141.nextSibling, [_el$143, _co$28] = web.getNextMarker(_el$142.nextSibling);
|
|
1074
|
+
_el$138.$$click = handleClick;
|
|
1075
|
+
web.insert(_el$138, web.createComponent(solidJs.Show, {
|
|
950
1076
|
get when() {
|
|
951
1077
|
return params.icon;
|
|
952
1078
|
},
|
|
953
1079
|
get children() {
|
|
954
|
-
var _el$
|
|
955
|
-
web.insert(_el$
|
|
956
|
-
return _el$
|
|
1080
|
+
var _el$139 = web.getNextElement(_tmpl$34);
|
|
1081
|
+
web.insert(_el$139, () => params.icon);
|
|
1082
|
+
return _el$139;
|
|
957
1083
|
}
|
|
958
|
-
}), _el$
|
|
959
|
-
web.insert(_el$
|
|
1084
|
+
}), _el$141, _co$27);
|
|
1085
|
+
web.insert(_el$138, () => params.label, _el$143, _co$28);
|
|
960
1086
|
web.effect((_p$) => {
|
|
961
1087
|
var _v$25 = params.url || "#", _v$26 = params.url ? "_blank" : void 0, _v$27 = params.ariaLabel || params.label, _v$28 = `inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
|
|
962
1088
|
${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"}
|
|
963
1089
|
${params.className || ""}`;
|
|
964
|
-
_v$25 !== _p$.e && web.setAttribute(_el$
|
|
965
|
-
_v$26 !== _p$.t && web.setAttribute(_el$
|
|
966
|
-
_v$27 !== _p$.a && web.setAttribute(_el$
|
|
967
|
-
_v$28 !== _p$.o && web.className(_el$
|
|
1090
|
+
_v$25 !== _p$.e && web.setAttribute(_el$138, "href", _p$.e = _v$25);
|
|
1091
|
+
_v$26 !== _p$.t && web.setAttribute(_el$138, "target", _p$.t = _v$26);
|
|
1092
|
+
_v$27 !== _p$.a && web.setAttribute(_el$138, "aria-label", _p$.a = _v$27);
|
|
1093
|
+
_v$28 !== _p$.o && web.className(_el$138, _p$.o = _v$28);
|
|
968
1094
|
return _p$;
|
|
969
1095
|
}, {
|
|
970
1096
|
e: void 0,
|
|
@@ -973,42 +1099,42 @@ function ActionRenderer(props) {
|
|
|
973
1099
|
o: void 0
|
|
974
1100
|
});
|
|
975
1101
|
web.runHydrationEvents();
|
|
976
|
-
return _el$
|
|
1102
|
+
return _el$138;
|
|
977
1103
|
})();
|
|
978
1104
|
}
|
|
979
1105
|
return (() => {
|
|
980
|
-
var _el$
|
|
981
|
-
_el$
|
|
982
|
-
web.insert(_el$
|
|
1106
|
+
var _el$144 = web.getNextElement(_tmpl$37), _el$147 = _el$144.firstChild, [_el$148, _co$29] = web.getNextMarker(_el$147.nextSibling), _el$149 = _el$148.nextSibling, [_el$150, _co$30] = web.getNextMarker(_el$149.nextSibling), _el$151 = _el$150.nextSibling, [_el$152, _co$31] = web.getNextMarker(_el$151.nextSibling);
|
|
1107
|
+
_el$144.$$click = handleClick;
|
|
1108
|
+
web.insert(_el$144, web.createComponent(solidJs.Show, {
|
|
983
1109
|
get when() {
|
|
984
1110
|
return web.memo(() => !!isExecuting())() && params.action === "tool-call";
|
|
985
1111
|
},
|
|
986
1112
|
get children() {
|
|
987
|
-
return web.getNextElement(_tmpl$
|
|
1113
|
+
return web.getNextElement(_tmpl$36);
|
|
988
1114
|
}
|
|
989
|
-
}), _el$
|
|
990
|
-
web.insert(_el$
|
|
1115
|
+
}), _el$148, _co$29);
|
|
1116
|
+
web.insert(_el$144, web.createComponent(solidJs.Show, {
|
|
991
1117
|
get when() {
|
|
992
1118
|
return web.memo(() => !!params.icon)() && !(isExecuting() && params.action === "tool-call");
|
|
993
1119
|
},
|
|
994
1120
|
get children() {
|
|
995
|
-
var _el$
|
|
996
|
-
web.insert(_el$
|
|
997
|
-
return _el$
|
|
1121
|
+
var _el$146 = web.getNextElement(_tmpl$34);
|
|
1122
|
+
web.insert(_el$146, () => params.icon);
|
|
1123
|
+
return _el$146;
|
|
998
1124
|
}
|
|
999
|
-
}), _el$
|
|
1000
|
-
web.insert(_el$
|
|
1125
|
+
}), _el$150, _co$30);
|
|
1126
|
+
web.insert(_el$144, () => params.label, _el$152, _co$31);
|
|
1001
1127
|
web.effect((_p$) => {
|
|
1002
1128
|
var _v$29 = params.action === "submit" ? "submit" : "button", _v$30 = isDisabled(), _v$31 = isExecuting() && params.action === "tool-call", _v$32 = params.ariaLabel || params.label, _v$33 = `inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
|
|
1003
1129
|
${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"}
|
|
1004
1130
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1005
1131
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1006
1132
|
${params.className || ""}`;
|
|
1007
|
-
_v$29 !== _p$.e && web.setAttribute(_el$
|
|
1008
|
-
_v$30 !== _p$.t && web.setProperty(_el$
|
|
1009
|
-
_v$31 !== _p$.a && web.setAttribute(_el$
|
|
1010
|
-
_v$32 !== _p$.o && web.setAttribute(_el$
|
|
1011
|
-
_v$33 !== _p$.i && web.className(_el$
|
|
1133
|
+
_v$29 !== _p$.e && web.setAttribute(_el$144, "type", _p$.e = _v$29);
|
|
1134
|
+
_v$30 !== _p$.t && web.setProperty(_el$144, "disabled", _p$.t = _v$30);
|
|
1135
|
+
_v$31 !== _p$.a && web.setAttribute(_el$144, "aria-busy", _p$.a = _v$31);
|
|
1136
|
+
_v$32 !== _p$.o && web.setAttribute(_el$144, "aria-label", _p$.o = _v$32);
|
|
1137
|
+
_v$33 !== _p$.i && web.className(_el$144, _p$.i = _v$33);
|
|
1012
1138
|
return _p$;
|
|
1013
1139
|
}, {
|
|
1014
1140
|
e: void 0,
|
|
@@ -1018,7 +1144,7 @@ function ActionRenderer(props) {
|
|
|
1018
1144
|
i: void 0
|
|
1019
1145
|
});
|
|
1020
1146
|
web.runHydrationEvents();
|
|
1021
|
-
return _el$
|
|
1147
|
+
return _el$144;
|
|
1022
1148
|
})();
|
|
1023
1149
|
}
|
|
1024
1150
|
function ErrorCardRenderer(props) {
|
|
@@ -1026,55 +1152,55 @@ function ErrorCardRenderer(props) {
|
|
|
1026
1152
|
return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
|
|
1027
1153
|
};
|
|
1028
1154
|
return (() => {
|
|
1029
|
-
var _el$
|
|
1030
|
-
web.insert(_el$
|
|
1155
|
+
var _el$153 = web.getNextElement(_tmpl$41), _el$176 = _el$153.firstChild, [_el$177, _co$37] = web.getNextMarker(_el$176.nextSibling), _el$154 = _el$177.nextSibling, _el$155 = _el$154.firstChild, _el$156 = _el$155.nextSibling, _el$157 = _el$156.firstChild, _el$158 = _el$157.firstChild, _el$159 = _el$158.nextSibling, [_el$160, _co$32] = web.getNextMarker(_el$159.nextSibling), _el$161 = _el$157.nextSibling, _el$170 = _el$161.nextSibling, [_el$171, _co$34] = web.getNextMarker(_el$170.nextSibling), _el$172 = _el$171.nextSibling, [_el$173, _co$35] = web.getNextMarker(_el$172.nextSibling), _el$174 = _el$173.nextSibling, [_el$175, _co$36] = web.getNextMarker(_el$174.nextSibling);
|
|
1156
|
+
web.insert(_el$153, web.createComponent(CopyButton, {
|
|
1031
1157
|
getText: getErrorText,
|
|
1032
1158
|
title: "Copy error details",
|
|
1033
1159
|
position: "top-right"
|
|
1034
|
-
}), _el$
|
|
1035
|
-
web.insert(_el$
|
|
1036
|
-
web.insert(_el$
|
|
1037
|
-
web.insert(_el$
|
|
1160
|
+
}), _el$177, _co$37);
|
|
1161
|
+
web.insert(_el$157, () => props.error.tool || "Unknown", _el$160, _co$32);
|
|
1162
|
+
web.insert(_el$161, () => props.error.message || "An error occurred during tool execution");
|
|
1163
|
+
web.insert(_el$156, web.createComponent(solidJs.Show, {
|
|
1038
1164
|
get when() {
|
|
1039
1165
|
return props.error.type;
|
|
1040
1166
|
},
|
|
1041
1167
|
get children() {
|
|
1042
|
-
var _el$
|
|
1043
|
-
web.insert(_el$
|
|
1044
|
-
return _el$
|
|
1168
|
+
var _el$162 = web.getNextElement(_tmpl$38), _el$163 = _el$162.firstChild, _el$164 = _el$163.nextSibling, [_el$165, _co$33] = web.getNextMarker(_el$164.nextSibling);
|
|
1169
|
+
web.insert(_el$162, () => props.error.type, _el$165, _co$33);
|
|
1170
|
+
return _el$162;
|
|
1045
1171
|
}
|
|
1046
|
-
}), _el$
|
|
1047
|
-
web.insert(_el$
|
|
1172
|
+
}), _el$171, _co$34);
|
|
1173
|
+
web.insert(_el$156, web.createComponent(solidJs.Show, {
|
|
1048
1174
|
get when() {
|
|
1049
1175
|
var _a;
|
|
1050
1176
|
return (_a = props.error.suggestions) == null ? void 0 : _a.length;
|
|
1051
1177
|
},
|
|
1052
1178
|
get children() {
|
|
1053
|
-
var _el$
|
|
1054
|
-
web.insert(_el$
|
|
1179
|
+
var _el$166 = web.getNextElement(_tmpl$39), _el$167 = _el$166.firstChild, _el$168 = _el$167.nextSibling;
|
|
1180
|
+
web.insert(_el$168, web.createComponent(solidJs.For, {
|
|
1055
1181
|
get each() {
|
|
1056
1182
|
return props.error.suggestions;
|
|
1057
1183
|
},
|
|
1058
1184
|
children: (suggestion) => (() => {
|
|
1059
|
-
var _el$
|
|
1060
|
-
web.insert(_el$
|
|
1061
|
-
return _el$
|
|
1185
|
+
var _el$178 = web.getNextElement(_tmpl$42);
|
|
1186
|
+
web.insert(_el$178, suggestion);
|
|
1187
|
+
return _el$178;
|
|
1062
1188
|
})()
|
|
1063
1189
|
}));
|
|
1064
|
-
return _el$
|
|
1190
|
+
return _el$166;
|
|
1065
1191
|
}
|
|
1066
|
-
}), _el$
|
|
1067
|
-
web.insert(_el$
|
|
1192
|
+
}), _el$173, _co$35);
|
|
1193
|
+
web.insert(_el$156, web.createComponent(solidJs.Show, {
|
|
1068
1194
|
get when() {
|
|
1069
1195
|
return props.error.timestamp;
|
|
1070
1196
|
},
|
|
1071
1197
|
get children() {
|
|
1072
|
-
var _el$
|
|
1073
|
-
web.insert(_el$
|
|
1074
|
-
return _el$
|
|
1198
|
+
var _el$169 = web.getNextElement(_tmpl$40);
|
|
1199
|
+
web.insert(_el$169, () => new Date(props.error.timestamp).toLocaleString());
|
|
1200
|
+
return _el$169;
|
|
1075
1201
|
}
|
|
1076
|
-
}), _el$
|
|
1077
|
-
return _el$
|
|
1202
|
+
}), _el$175, _co$36);
|
|
1203
|
+
return _el$153;
|
|
1078
1204
|
})();
|
|
1079
1205
|
}
|
|
1080
1206
|
function isErrorResponse(content) {
|
|
@@ -1097,20 +1223,20 @@ function UIResourceHtmlRenderer(props) {
|
|
|
1097
1223
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
|
|
1098
1224
|
};
|
|
1099
1225
|
return (() => {
|
|
1100
|
-
var _el$
|
|
1101
|
-
web.insert(_el$
|
|
1226
|
+
var _el$179 = web.getNextElement(_tmpl$44), _el$183 = _el$179.firstChild, [_el$184, _co$38] = web.getNextMarker(_el$183.nextSibling), _el$182 = _el$184.nextSibling;
|
|
1227
|
+
web.insert(_el$179, web.createComponent(solidJs.Show, {
|
|
1102
1228
|
get when() {
|
|
1103
1229
|
var _a;
|
|
1104
1230
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
|
|
1105
1231
|
},
|
|
1106
1232
|
get children() {
|
|
1107
|
-
var _el$
|
|
1108
|
-
web.insert(_el$
|
|
1109
|
-
return _el$
|
|
1233
|
+
var _el$180 = web.getNextElement(_tmpl$43), _el$181 = _el$180.firstChild;
|
|
1234
|
+
web.insert(_el$181, resourceTitle);
|
|
1235
|
+
return _el$180;
|
|
1110
1236
|
}
|
|
1111
|
-
}), _el$
|
|
1112
|
-
web.effect(() => web.setProperty(_el$
|
|
1113
|
-
return _el$
|
|
1237
|
+
}), _el$184, _co$38);
|
|
1238
|
+
web.effect(() => web.setProperty(_el$182, "innerHTML", htmlContent()));
|
|
1239
|
+
return _el$179;
|
|
1114
1240
|
})();
|
|
1115
1241
|
}
|
|
1116
1242
|
const UIResourceRenderer = (props) => {
|
|
@@ -1190,24 +1316,24 @@ const UIResourceRenderer = (props) => {
|
|
|
1190
1316
|
return web.createComponent(RenderContext.RenderProvider, {
|
|
1191
1317
|
renderComponent,
|
|
1192
1318
|
get children() {
|
|
1193
|
-
var _el$
|
|
1194
|
-
web.insert(_el$
|
|
1319
|
+
var _el$185 = web.getNextElement(_tmpl$45), _el$186 = _el$185.firstChild, _el$187 = _el$186.nextSibling, [_el$188, _co$39] = web.getNextMarker(_el$187.nextSibling);
|
|
1320
|
+
web.insert(_el$186, web.createComponent(solidJs.For, {
|
|
1195
1321
|
get each() {
|
|
1196
1322
|
return layoutData.components;
|
|
1197
1323
|
},
|
|
1198
1324
|
children: (component) => (() => {
|
|
1199
|
-
var _el$
|
|
1200
|
-
web.insert(_el$
|
|
1325
|
+
var _el$189 = web.getNextElement(_tmpl$46);
|
|
1326
|
+
web.insert(_el$189, web.createComponent(ComponentRenderer, {
|
|
1201
1327
|
component,
|
|
1202
1328
|
get onError() {
|
|
1203
1329
|
return props.onError;
|
|
1204
1330
|
}
|
|
1205
1331
|
}));
|
|
1206
|
-
web.effect((_$p) => web.style(_el$
|
|
1207
|
-
return _el$
|
|
1332
|
+
web.effect((_$p) => web.style(_el$189, getGridStyleString(component), _$p));
|
|
1333
|
+
return _el$189;
|
|
1208
1334
|
})()
|
|
1209
1335
|
}));
|
|
1210
|
-
web.insert(_el$
|
|
1336
|
+
web.insert(_el$185, web.createComponent(solidJs.Show, {
|
|
1211
1337
|
get when() {
|
|
1212
1338
|
return shouldShowAutoFooter();
|
|
1213
1339
|
},
|
|
@@ -1218,20 +1344,21 @@ const UIResourceRenderer = (props) => {
|
|
|
1218
1344
|
}
|
|
1219
1345
|
});
|
|
1220
1346
|
}
|
|
1221
|
-
}), _el$
|
|
1347
|
+
}), _el$188, _co$39);
|
|
1222
1348
|
web.effect((_p$) => {
|
|
1223
1349
|
var _v$34 = `w-full ${props.class || ""}`, _v$35 = gridContainerStyle();
|
|
1224
|
-
_v$34 !== _p$.e && web.className(_el$
|
|
1225
|
-
_p$.t = web.style(_el$
|
|
1350
|
+
_v$34 !== _p$.e && web.className(_el$185, _p$.e = _v$34);
|
|
1351
|
+
_p$.t = web.style(_el$186, _v$35, _p$.t);
|
|
1226
1352
|
return _p$;
|
|
1227
1353
|
}, {
|
|
1228
1354
|
e: void 0,
|
|
1229
1355
|
t: void 0
|
|
1230
1356
|
});
|
|
1231
|
-
return _el$
|
|
1357
|
+
return _el$185;
|
|
1232
1358
|
}
|
|
1233
1359
|
});
|
|
1234
1360
|
};
|
|
1235
1361
|
web.delegateEvents(["click"]);
|
|
1236
1362
|
exports.UIResourceRenderer = UIResourceRenderer;
|
|
1363
|
+
exports.renderCellValue = renderCellValue;
|
|
1237
1364
|
//# sourceMappingURL=UIResourceRenderer.cjs.map
|