@seed-ship/mcp-ui-solid 5.3.1 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -0
- package/dist/components/StreamingUIRenderer.cjs +106 -90
- package/dist/components/StreamingUIRenderer.cjs.map +1 -1
- package/dist/components/StreamingUIRenderer.d.ts +7 -0
- package/dist/components/StreamingUIRenderer.d.ts.map +1 -1
- package/dist/components/StreamingUIRenderer.js +107 -91
- package/dist/components/StreamingUIRenderer.js.map +1 -1
- package/dist/components/UIResourceRenderer.cjs +101 -82
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts +23 -0
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +102 -83
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-ui-spec/dist/schemas.cjs +493 -0
- package/dist/mcp-ui-spec/dist/schemas.cjs.map +1 -0
- package/dist/mcp-ui-spec/dist/schemas.js +493 -0
- package/dist/mcp-ui-spec/dist/schemas.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.cjs +118 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +118 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.cjs +10 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +10 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.cjs +8 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +9 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.cjs +122 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +122 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +139 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.cjs +105 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +106 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs +3229 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +3230 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js.map +1 -0
- package/dist/services/validation.cjs +70 -152
- package/dist/services/validation.cjs.map +1 -1
- package/dist/services/validation.d.ts.map +1 -1
- package/dist/services/validation.js +70 -152
- package/dist/services/validation.js.map +1 -1
- package/dist/utils/logger.cjs +26 -4
- package/dist/utils/logger.cjs.map +1 -1
- package/dist/utils/logger.d.ts +30 -3
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +27 -5
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/perf.cjs +34 -0
- package/dist/utils/perf.cjs.map +1 -0
- package/dist/utils/perf.d.ts +19 -0
- package/dist/utils/perf.d.ts.map +1 -0
- package/dist/utils/perf.js +34 -0
- package/dist/utils/perf.js.map +1 -0
- package/package.json +3 -2
- package/src/components/StreamingUIRenderer.tsx +54 -2
- package/src/components/UIResourceRenderer.errorMode.test.tsx +95 -0
- package/src/components/UIResourceRenderer.tsx +72 -4
- package/src/index.ts +7 -0
- package/src/services/validation.spec-migration.test.ts +207 -0
- package/src/services/validation.ts +132 -178
- package/src/utils/logger.test.ts +130 -0
- package/src/utils/logger.ts +60 -7
- package/src/utils/perf.test.ts +59 -0
- package/src/utils/perf.ts +50 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Component } from 'solid-js';
|
|
6
6
|
import type { UIComponent, UILayout, RendererError } from '../types';
|
|
7
|
+
/**
|
|
8
|
+
* How `<UIResourceRenderer>` reacts when `validateComponent()` rejects a
|
|
9
|
+
* component (v5.4.0).
|
|
10
|
+
*
|
|
11
|
+
* - `'block'` : full-slot red error card (default — backward compatible)
|
|
12
|
+
* - `'inline-warn'` : compact yellow chip in the slot, tooltip carries the
|
|
13
|
+
* error message — keeps the surrounding layout clean
|
|
14
|
+
* (e.g. inside a chat message)
|
|
15
|
+
* - `'silent'` : render nothing in the slot; `onError` still fires so the
|
|
16
|
+
* consumer can log/alert
|
|
17
|
+
*
|
|
18
|
+
* Runtime errors caught by `<GenerativeUIErrorBoundary>` are NOT affected by
|
|
19
|
+
* this prop — they always show the boundary's fallback UI.
|
|
20
|
+
*/
|
|
21
|
+
export type ValidationErrorMode = 'block' | 'inline-warn' | 'silent';
|
|
7
22
|
/**
|
|
8
23
|
* Props for UIResourceRenderer
|
|
9
24
|
*/
|
|
@@ -24,6 +39,14 @@ export interface UIResourceRendererProps {
|
|
|
24
39
|
* Custom CSS class
|
|
25
40
|
*/
|
|
26
41
|
class?: string;
|
|
42
|
+
/**
|
|
43
|
+
* How to react when a component fails `validateComponent()` (v5.4.0).
|
|
44
|
+
* Defaults to `'block'` (replaces the slot with a red error card —
|
|
45
|
+
* the pre-v5.4.0 behavior).
|
|
46
|
+
*
|
|
47
|
+
* @see ValidationErrorMode
|
|
48
|
+
*/
|
|
49
|
+
errorMode?: ValidationErrorMode;
|
|
27
50
|
}
|
|
28
51
|
/**
|
|
29
52
|
* Smart cell value renderer that handles markdown links and other formats
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UIResourceRenderer.d.ts","sourceRoot":"","sources":["../../src/components/UIResourceRenderer.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"UIResourceRenderer.d.ts","sourceRoot":"","sources":["../../src/components/UIResourceRenderer.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,SAAS,EAA8D,MAAM,UAAU,CAAA;AAEhG,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAA0B,MAAM,UAAU,CAAA;AAK5F;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,aAAa,GAAG,QAAQ,CAAA;AA8DpE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,OAAO,EAAE,WAAW,GAAG,QAAQ,CAAA;IAE/B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IAExC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,mBAAmB,CAAA;CAChC;AAiJD;;GAEG;AACH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAYlE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CA4ElD;AA2iCD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,uBAAuB,CA6GjE,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { delegateEvents, createComponent, getNextElement, template, getNextMarker, insert, effect, style, className, setProperty, setAttribute, runHydrationEvents, memo, isServer, use, addEventListener, classList, setStyleProperty } from "solid-js/web";
|
|
2
2
|
import purify from "../node_modules/.pnpm/dompurify@3.4.1/node_modules/dompurify/dist/purify.es.js";
|
|
3
|
-
import { createMemo, For, Show, createSignal, createEffect } from "solid-js";
|
|
3
|
+
import { createMemo, For, Show, onMount, createSignal, createEffect } from "solid-js";
|
|
4
4
|
import { validateComponent, getIframeSandbox, DEFAULT_RESOURCE_LIMITS } from "../services/validation.js";
|
|
5
5
|
import { GenerativeUIErrorBoundary } from "./GenerativeUIErrorBoundary.js";
|
|
6
|
+
import { markRenderStart, markRenderEnd } from "../utils/perf.js";
|
|
6
7
|
import { GridRenderer } from "./GridRenderer.js";
|
|
7
8
|
import { FooterRenderer } from "./FooterRenderer.js";
|
|
8
9
|
import { CarouselRenderer } from "./CarouselRenderer.js";
|
|
@@ -19,7 +20,7 @@ import { useExpanded, ExpandableWrapper } from "./ExpandableWrapper.js";
|
|
|
19
20
|
import { RenderProvider } from "./RenderContext.js";
|
|
20
21
|
import { useAction } from "../hooks/useAction.js";
|
|
21
22
|
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(`<button type=button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm"aria-label="Clear search">×`), _tmpl$20 = /* @__PURE__ */ template(`<div class="relative mb-3"><span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none text-sm">🔍</span><input type=text class="w-full max-w-xs min-w-[200px] pl-8 pr-8 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 outline-none"><!$><!/>`), _tmpl$21 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$22 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$23 = /* @__PURE__ */ template(`<select class="ml-2 px-1 py-0.5 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300">`), _tmpl$24 = /* @__PURE__ */ template(`<span class=text-gray-400>/ page`), _tmpl$25 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span><!$><!/>–<!$><!/> / <!$><!/></span><div class="flex items-center gap-2"><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">◀</button><span><!$><!/> / <!$><!/></span><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">▶</button><!$><!/>`), _tmpl$26 = /* @__PURE__ */ template(`<div><!$><!/><div class=p-4><!$><!/><!$><!/><div class=overflow-x-auto role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-100 dark:bg-gray-900 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/>`), _tmpl$27 = /* @__PURE__ */ template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-100 dark:bg-gray-900 cursor-pointer select-none hover:bg-gray-200 dark:hover:bg-gray-800 transition-colors"><span class="inline-flex items-center gap-1"><!$><!/><span class="text-[10px] leading-none">`), _tmpl$28 = /* @__PURE__ */ template(`<option>`), _tmpl$29 = /* @__PURE__ */ template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$30 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$31 = /* @__PURE__ */ template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$32 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$33 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$34 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$35 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$36 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"loading=lazy>`, true, false, false), _tmpl$37 = /* @__PURE__ */ template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$38 = /* @__PURE__ */ template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$39 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$40 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$41 = /* @__PURE__ */ template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$42 = /* @__PURE__ */ template(`<span aria-hidden=true>`), _tmpl$43 = /* @__PURE__ */ template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$44 = /* @__PURE__ */ template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$45 = /* @__PURE__ */ template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$46 = /* @__PURE__ */ template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$48 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$49 = /* @__PURE__ */ template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$50 = /* @__PURE__ */ template(`<li>`), _tmpl$51 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$52 = /* @__PURE__ */ template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$53 = /* @__PURE__ */ template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$54 = /* @__PURE__ */ template(`<div>`);
|
|
23
|
+
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(`<button type=button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm"aria-label="Clear search">×`), _tmpl$20 = /* @__PURE__ */ template(`<div class="relative mb-3"><span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none text-sm">🔍</span><input type=text class="w-full max-w-xs min-w-[200px] pl-8 pr-8 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 outline-none"><!$><!/>`), _tmpl$21 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$22 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$23 = /* @__PURE__ */ template(`<select class="ml-2 px-1 py-0.5 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300">`), _tmpl$24 = /* @__PURE__ */ template(`<span class=text-gray-400>/ page`), _tmpl$25 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span><!$><!/>–<!$><!/> / <!$><!/></span><div class="flex items-center gap-2"><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">◀</button><span><!$><!/> / <!$><!/></span><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">▶</button><!$><!/>`), _tmpl$26 = /* @__PURE__ */ template(`<div><!$><!/><div class=p-4><!$><!/><!$><!/><div class=overflow-x-auto role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-100 dark:bg-gray-900 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/>`), _tmpl$27 = /* @__PURE__ */ template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-100 dark:bg-gray-900 cursor-pointer select-none hover:bg-gray-200 dark:hover:bg-gray-800 transition-colors"><span class="inline-flex items-center gap-1"><!$><!/><span class="text-[10px] leading-none">`), _tmpl$28 = /* @__PURE__ */ template(`<option>`), _tmpl$29 = /* @__PURE__ */ template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$30 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$31 = /* @__PURE__ */ template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$32 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$33 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$34 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$35 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$36 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"loading=lazy>`, true, false, false), _tmpl$37 = /* @__PURE__ */ template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$38 = /* @__PURE__ */ template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$39 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$40 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$41 = /* @__PURE__ */ template(`<div class="inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 text-xs text-yellow-800 dark:text-yellow-200"role=alert aria-label="Component validation warning"><svg xmlns=http://www.w3.org/2000/svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1=12 y1=9 x2=12 y2=13></line><line x1=12 y1=17 x2=12.01 y2=17></line></svg><span>Invalid <!$><!/>`), _tmpl$42 = /* @__PURE__ */ template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$43 = /* @__PURE__ */ template(`<span aria-hidden=true>`), _tmpl$44 = /* @__PURE__ */ template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$45 = /* @__PURE__ */ template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$46 = /* @__PURE__ */ template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$48 = /* @__PURE__ */ template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$49 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$50 = /* @__PURE__ */ template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$51 = /* @__PURE__ */ template(`<li>`), _tmpl$52 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$53 = /* @__PURE__ */ template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$54 = /* @__PURE__ */ template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$55 = /* @__PURE__ */ template(`<div>`);
|
|
23
24
|
function CopyButton(props) {
|
|
24
25
|
const [copied, setCopied] = createSignal(false);
|
|
25
26
|
const handleCopy = async () => {
|
|
@@ -1052,7 +1053,9 @@ function LinkRenderer(props) {
|
|
|
1052
1053
|
})();
|
|
1053
1054
|
}
|
|
1054
1055
|
function ComponentRenderer(props) {
|
|
1055
|
-
var _a;
|
|
1056
|
+
var _a, _b, _c;
|
|
1057
|
+
markRenderStart(props.component.id);
|
|
1058
|
+
onMount(() => markRenderEnd(props.component.id));
|
|
1056
1059
|
const validation = validateComponent(props.component);
|
|
1057
1060
|
if (!validation.valid) {
|
|
1058
1061
|
(_a = props.onError) == null ? void 0 : _a.call(props, {
|
|
@@ -1061,13 +1064,23 @@ function ComponentRenderer(props) {
|
|
|
1061
1064
|
componentId: props.component.id,
|
|
1062
1065
|
details: validation.errors
|
|
1063
1066
|
});
|
|
1067
|
+
const mode = props.errorMode ?? "block";
|
|
1068
|
+
const firstError = ((_c = (_b = validation.errors) == null ? void 0 : _b[0]) == null ? void 0 : _c.message) || "Unknown validation error";
|
|
1069
|
+
if (mode === "silent") {
|
|
1070
|
+
return null;
|
|
1071
|
+
}
|
|
1072
|
+
if (mode === "inline-warn") {
|
|
1073
|
+
return (() => {
|
|
1074
|
+
var _el$183 = getNextElement(_tmpl$41), _el$184 = _el$183.firstChild, _el$185 = _el$184.nextSibling, _el$186 = _el$185.firstChild, _el$187 = _el$186.nextSibling, [_el$188, _co$40] = getNextMarker(_el$187.nextSibling);
|
|
1075
|
+
setAttribute(_el$183, "title", firstError);
|
|
1076
|
+
insert(_el$185, () => props.component.type, _el$188, _co$40);
|
|
1077
|
+
return _el$183;
|
|
1078
|
+
})();
|
|
1079
|
+
}
|
|
1064
1080
|
return (() => {
|
|
1065
|
-
var _el$
|
|
1066
|
-
insert(_el$
|
|
1067
|
-
|
|
1068
|
-
return ((_b = (_a2 = validation.errors) == null ? void 0 : _a2[0]) == null ? void 0 : _b.message) || "Unknown validation error";
|
|
1069
|
-
});
|
|
1070
|
-
return _el$183;
|
|
1081
|
+
var _el$189 = getNextElement(_tmpl$42), _el$190 = _el$189.firstChild, _el$191 = _el$190.nextSibling;
|
|
1082
|
+
insert(_el$191, firstError);
|
|
1083
|
+
return _el$189;
|
|
1071
1084
|
})();
|
|
1072
1085
|
}
|
|
1073
1086
|
return createComponent(GenerativeUIErrorBoundary, {
|
|
@@ -1313,27 +1326,27 @@ function ActionRenderer(props) {
|
|
|
1313
1326
|
const isDisabled = () => params.disabled || params.action === "tool-call" && isExecuting();
|
|
1314
1327
|
if (params.type === "link" || params.action === "link") {
|
|
1315
1328
|
return (() => {
|
|
1316
|
-
var _el$
|
|
1317
|
-
_el$
|
|
1318
|
-
insert(_el$
|
|
1329
|
+
var _el$192 = getNextElement(_tmpl$44), _el$194 = _el$192.firstChild, [_el$195, _co$41] = getNextMarker(_el$194.nextSibling), _el$196 = _el$195.nextSibling, [_el$197, _co$42] = getNextMarker(_el$196.nextSibling);
|
|
1330
|
+
_el$192.$$click = handleClick;
|
|
1331
|
+
insert(_el$192, createComponent(Show, {
|
|
1319
1332
|
get when() {
|
|
1320
1333
|
return params.icon;
|
|
1321
1334
|
},
|
|
1322
1335
|
get children() {
|
|
1323
|
-
var _el$
|
|
1324
|
-
insert(_el$
|
|
1325
|
-
return _el$
|
|
1336
|
+
var _el$193 = getNextElement(_tmpl$43);
|
|
1337
|
+
insert(_el$193, () => params.icon);
|
|
1338
|
+
return _el$193;
|
|
1326
1339
|
}
|
|
1327
|
-
}), _el$
|
|
1328
|
-
insert(_el$
|
|
1340
|
+
}), _el$195, _co$41);
|
|
1341
|
+
insert(_el$192, () => params.label, _el$197, _co$42);
|
|
1329
1342
|
effect((_p$) => {
|
|
1330
1343
|
var _v$32 = params.url || "#", _v$33 = params.url ? "_blank" : void 0, _v$34 = params.ariaLabel || params.label, _v$35 = `inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
|
|
1331
1344
|
${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"}
|
|
1332
1345
|
${params.className || ""}`;
|
|
1333
|
-
_v$32 !== _p$.e && setAttribute(_el$
|
|
1334
|
-
_v$33 !== _p$.t && setAttribute(_el$
|
|
1335
|
-
_v$34 !== _p$.a && setAttribute(_el$
|
|
1336
|
-
_v$35 !== _p$.o && className(_el$
|
|
1346
|
+
_v$32 !== _p$.e && setAttribute(_el$192, "href", _p$.e = _v$32);
|
|
1347
|
+
_v$33 !== _p$.t && setAttribute(_el$192, "target", _p$.t = _v$33);
|
|
1348
|
+
_v$34 !== _p$.a && setAttribute(_el$192, "aria-label", _p$.a = _v$34);
|
|
1349
|
+
_v$35 !== _p$.o && className(_el$192, _p$.o = _v$35);
|
|
1337
1350
|
return _p$;
|
|
1338
1351
|
}, {
|
|
1339
1352
|
e: void 0,
|
|
@@ -1342,42 +1355,42 @@ function ActionRenderer(props) {
|
|
|
1342
1355
|
o: void 0
|
|
1343
1356
|
});
|
|
1344
1357
|
runHydrationEvents();
|
|
1345
|
-
return _el$
|
|
1358
|
+
return _el$192;
|
|
1346
1359
|
})();
|
|
1347
1360
|
}
|
|
1348
1361
|
return (() => {
|
|
1349
|
-
var _el$
|
|
1350
|
-
_el$
|
|
1351
|
-
insert(_el$
|
|
1362
|
+
var _el$198 = getNextElement(_tmpl$46), _el$201 = _el$198.firstChild, [_el$202, _co$43] = getNextMarker(_el$201.nextSibling), _el$203 = _el$202.nextSibling, [_el$204, _co$44] = getNextMarker(_el$203.nextSibling), _el$205 = _el$204.nextSibling, [_el$206, _co$45] = getNextMarker(_el$205.nextSibling);
|
|
1363
|
+
_el$198.$$click = handleClick;
|
|
1364
|
+
insert(_el$198, createComponent(Show, {
|
|
1352
1365
|
get when() {
|
|
1353
1366
|
return memo(() => !!isExecuting())() && params.action === "tool-call";
|
|
1354
1367
|
},
|
|
1355
1368
|
get children() {
|
|
1356
|
-
return getNextElement(_tmpl$
|
|
1369
|
+
return getNextElement(_tmpl$45);
|
|
1357
1370
|
}
|
|
1358
|
-
}), _el$
|
|
1359
|
-
insert(_el$
|
|
1371
|
+
}), _el$202, _co$43);
|
|
1372
|
+
insert(_el$198, createComponent(Show, {
|
|
1360
1373
|
get when() {
|
|
1361
1374
|
return memo(() => !!params.icon)() && !(isExecuting() && params.action === "tool-call");
|
|
1362
1375
|
},
|
|
1363
1376
|
get children() {
|
|
1364
|
-
var _el$
|
|
1365
|
-
insert(_el$
|
|
1366
|
-
return _el$
|
|
1377
|
+
var _el$200 = getNextElement(_tmpl$43);
|
|
1378
|
+
insert(_el$200, () => params.icon);
|
|
1379
|
+
return _el$200;
|
|
1367
1380
|
}
|
|
1368
|
-
}), _el$
|
|
1369
|
-
insert(_el$
|
|
1381
|
+
}), _el$204, _co$44);
|
|
1382
|
+
insert(_el$198, () => params.label, _el$206, _co$45);
|
|
1370
1383
|
effect((_p$) => {
|
|
1371
1384
|
var _v$36 = params.action === "submit" ? "submit" : "button", _v$37 = isDisabled(), _v$38 = isExecuting() && params.action === "tool-call", _v$39 = params.ariaLabel || params.label, _v$40 = `inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
|
|
1372
1385
|
${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"}
|
|
1373
1386
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1374
1387
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1375
1388
|
${params.className || ""}`;
|
|
1376
|
-
_v$36 !== _p$.e && setAttribute(_el$
|
|
1377
|
-
_v$37 !== _p$.t && setProperty(_el$
|
|
1378
|
-
_v$38 !== _p$.a && setAttribute(_el$
|
|
1379
|
-
_v$39 !== _p$.o && setAttribute(_el$
|
|
1380
|
-
_v$40 !== _p$.i && className(_el$
|
|
1389
|
+
_v$36 !== _p$.e && setAttribute(_el$198, "type", _p$.e = _v$36);
|
|
1390
|
+
_v$37 !== _p$.t && setProperty(_el$198, "disabled", _p$.t = _v$37);
|
|
1391
|
+
_v$38 !== _p$.a && setAttribute(_el$198, "aria-busy", _p$.a = _v$38);
|
|
1392
|
+
_v$39 !== _p$.o && setAttribute(_el$198, "aria-label", _p$.o = _v$39);
|
|
1393
|
+
_v$40 !== _p$.i && className(_el$198, _p$.i = _v$40);
|
|
1381
1394
|
return _p$;
|
|
1382
1395
|
}, {
|
|
1383
1396
|
e: void 0,
|
|
@@ -1387,7 +1400,7 @@ function ActionRenderer(props) {
|
|
|
1387
1400
|
i: void 0
|
|
1388
1401
|
});
|
|
1389
1402
|
runHydrationEvents();
|
|
1390
|
-
return _el$
|
|
1403
|
+
return _el$198;
|
|
1391
1404
|
})();
|
|
1392
1405
|
}
|
|
1393
1406
|
function ErrorCardRenderer(props) {
|
|
@@ -1395,55 +1408,55 @@ function ErrorCardRenderer(props) {
|
|
|
1395
1408
|
return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
|
|
1396
1409
|
};
|
|
1397
1410
|
return (() => {
|
|
1398
|
-
var _el$
|
|
1399
|
-
insert(_el$
|
|
1411
|
+
var _el$207 = getNextElement(_tmpl$50), _el$230 = _el$207.firstChild, [_el$231, _co$51] = getNextMarker(_el$230.nextSibling), _el$208 = _el$231.nextSibling, _el$209 = _el$208.firstChild, _el$210 = _el$209.nextSibling, _el$211 = _el$210.firstChild, _el$212 = _el$211.firstChild, _el$213 = _el$212.nextSibling, [_el$214, _co$46] = getNextMarker(_el$213.nextSibling), _el$215 = _el$211.nextSibling, _el$224 = _el$215.nextSibling, [_el$225, _co$48] = getNextMarker(_el$224.nextSibling), _el$226 = _el$225.nextSibling, [_el$227, _co$49] = getNextMarker(_el$226.nextSibling), _el$228 = _el$227.nextSibling, [_el$229, _co$50] = getNextMarker(_el$228.nextSibling);
|
|
1412
|
+
insert(_el$207, createComponent(CopyButton, {
|
|
1400
1413
|
getText: getErrorText,
|
|
1401
1414
|
title: "Copy error details",
|
|
1402
1415
|
position: "top-right"
|
|
1403
|
-
}), _el$
|
|
1404
|
-
insert(_el$
|
|
1405
|
-
insert(_el$
|
|
1406
|
-
insert(_el$
|
|
1416
|
+
}), _el$231, _co$51);
|
|
1417
|
+
insert(_el$211, () => props.error.tool || "Unknown", _el$214, _co$46);
|
|
1418
|
+
insert(_el$215, () => props.error.message || "An error occurred during tool execution");
|
|
1419
|
+
insert(_el$210, createComponent(Show, {
|
|
1407
1420
|
get when() {
|
|
1408
1421
|
return props.error.type;
|
|
1409
1422
|
},
|
|
1410
1423
|
get children() {
|
|
1411
|
-
var _el$
|
|
1412
|
-
insert(_el$
|
|
1413
|
-
return _el$
|
|
1424
|
+
var _el$216 = getNextElement(_tmpl$47), _el$217 = _el$216.firstChild, _el$218 = _el$217.nextSibling, [_el$219, _co$47] = getNextMarker(_el$218.nextSibling);
|
|
1425
|
+
insert(_el$216, () => props.error.type, _el$219, _co$47);
|
|
1426
|
+
return _el$216;
|
|
1414
1427
|
}
|
|
1415
|
-
}), _el$
|
|
1416
|
-
insert(_el$
|
|
1428
|
+
}), _el$225, _co$48);
|
|
1429
|
+
insert(_el$210, createComponent(Show, {
|
|
1417
1430
|
get when() {
|
|
1418
1431
|
var _a;
|
|
1419
1432
|
return (_a = props.error.suggestions) == null ? void 0 : _a.length;
|
|
1420
1433
|
},
|
|
1421
1434
|
get children() {
|
|
1422
|
-
var _el$
|
|
1423
|
-
insert(_el$
|
|
1435
|
+
var _el$220 = getNextElement(_tmpl$48), _el$221 = _el$220.firstChild, _el$222 = _el$221.nextSibling;
|
|
1436
|
+
insert(_el$222, createComponent(For, {
|
|
1424
1437
|
get each() {
|
|
1425
1438
|
return props.error.suggestions;
|
|
1426
1439
|
},
|
|
1427
1440
|
children: (suggestion) => (() => {
|
|
1428
|
-
var _el$
|
|
1429
|
-
insert(_el$
|
|
1430
|
-
return _el$
|
|
1441
|
+
var _el$232 = getNextElement(_tmpl$51);
|
|
1442
|
+
insert(_el$232, suggestion);
|
|
1443
|
+
return _el$232;
|
|
1431
1444
|
})()
|
|
1432
1445
|
}));
|
|
1433
|
-
return _el$
|
|
1446
|
+
return _el$220;
|
|
1434
1447
|
}
|
|
1435
|
-
}), _el$
|
|
1436
|
-
insert(_el$
|
|
1448
|
+
}), _el$227, _co$49);
|
|
1449
|
+
insert(_el$210, createComponent(Show, {
|
|
1437
1450
|
get when() {
|
|
1438
1451
|
return props.error.timestamp;
|
|
1439
1452
|
},
|
|
1440
1453
|
get children() {
|
|
1441
|
-
var _el$
|
|
1442
|
-
insert(_el$
|
|
1443
|
-
return _el$
|
|
1454
|
+
var _el$223 = getNextElement(_tmpl$49);
|
|
1455
|
+
insert(_el$223, () => new Date(props.error.timestamp).toLocaleString());
|
|
1456
|
+
return _el$223;
|
|
1444
1457
|
}
|
|
1445
|
-
}), _el$
|
|
1446
|
-
return _el$
|
|
1458
|
+
}), _el$229, _co$50);
|
|
1459
|
+
return _el$207;
|
|
1447
1460
|
})();
|
|
1448
1461
|
}
|
|
1449
1462
|
function isErrorResponse(content) {
|
|
@@ -1466,20 +1479,20 @@ function UIResourceHtmlRenderer(props) {
|
|
|
1466
1479
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
|
|
1467
1480
|
};
|
|
1468
1481
|
return (() => {
|
|
1469
|
-
var _el$
|
|
1470
|
-
insert(_el$
|
|
1482
|
+
var _el$233 = getNextElement(_tmpl$53), _el$237 = _el$233.firstChild, [_el$238, _co$52] = getNextMarker(_el$237.nextSibling), _el$236 = _el$238.nextSibling;
|
|
1483
|
+
insert(_el$233, createComponent(Show, {
|
|
1471
1484
|
get when() {
|
|
1472
1485
|
var _a;
|
|
1473
1486
|
return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
|
|
1474
1487
|
},
|
|
1475
1488
|
get children() {
|
|
1476
|
-
var _el$
|
|
1477
|
-
insert(_el$
|
|
1478
|
-
return _el$
|
|
1489
|
+
var _el$234 = getNextElement(_tmpl$52), _el$235 = _el$234.firstChild;
|
|
1490
|
+
insert(_el$235, resourceTitle);
|
|
1491
|
+
return _el$234;
|
|
1479
1492
|
}
|
|
1480
|
-
}), _el$
|
|
1481
|
-
effect(() => setProperty(_el$
|
|
1482
|
-
return _el$
|
|
1493
|
+
}), _el$238, _co$52);
|
|
1494
|
+
effect(() => setProperty(_el$236, "innerHTML", htmlContent()));
|
|
1495
|
+
return _el$233;
|
|
1483
1496
|
})();
|
|
1484
1497
|
}
|
|
1485
1498
|
const UIResourceRenderer = (props) => {
|
|
@@ -1554,29 +1567,35 @@ const UIResourceRenderer = (props) => {
|
|
|
1554
1567
|
const layoutData = layout();
|
|
1555
1568
|
const renderComponent = (component, onError) => createComponent(ComponentRenderer, {
|
|
1556
1569
|
component,
|
|
1557
|
-
onError
|
|
1570
|
+
onError,
|
|
1571
|
+
get errorMode() {
|
|
1572
|
+
return props.errorMode;
|
|
1573
|
+
}
|
|
1558
1574
|
});
|
|
1559
1575
|
return createComponent(RenderProvider, {
|
|
1560
1576
|
renderComponent,
|
|
1561
1577
|
get children() {
|
|
1562
|
-
var _el$
|
|
1563
|
-
insert(_el$
|
|
1578
|
+
var _el$239 = getNextElement(_tmpl$54), _el$240 = _el$239.firstChild, _el$241 = _el$240.nextSibling, [_el$242, _co$53] = getNextMarker(_el$241.nextSibling);
|
|
1579
|
+
insert(_el$240, createComponent(For, {
|
|
1564
1580
|
get each() {
|
|
1565
1581
|
return layoutData.components;
|
|
1566
1582
|
},
|
|
1567
1583
|
children: (component) => (() => {
|
|
1568
|
-
var _el$
|
|
1569
|
-
insert(_el$
|
|
1584
|
+
var _el$243 = getNextElement(_tmpl$55);
|
|
1585
|
+
insert(_el$243, createComponent(ComponentRenderer, {
|
|
1570
1586
|
component,
|
|
1571
1587
|
get onError() {
|
|
1572
1588
|
return props.onError;
|
|
1589
|
+
},
|
|
1590
|
+
get errorMode() {
|
|
1591
|
+
return props.errorMode;
|
|
1573
1592
|
}
|
|
1574
1593
|
}));
|
|
1575
|
-
effect((_$p) => style(_el$
|
|
1576
|
-
return _el$
|
|
1594
|
+
effect((_$p) => style(_el$243, getGridStyleString(component), _$p));
|
|
1595
|
+
return _el$243;
|
|
1577
1596
|
})()
|
|
1578
1597
|
}));
|
|
1579
|
-
insert(_el$
|
|
1598
|
+
insert(_el$239, createComponent(Show, {
|
|
1580
1599
|
get when() {
|
|
1581
1600
|
return shouldShowAutoFooter();
|
|
1582
1601
|
},
|
|
@@ -1587,17 +1606,17 @@ const UIResourceRenderer = (props) => {
|
|
|
1587
1606
|
}
|
|
1588
1607
|
});
|
|
1589
1608
|
}
|
|
1590
|
-
}), _el$
|
|
1609
|
+
}), _el$242, _co$53);
|
|
1591
1610
|
effect((_p$) => {
|
|
1592
1611
|
var _v$41 = `w-full ${props.class || ""}`, _v$42 = gridContainerStyle();
|
|
1593
|
-
_v$41 !== _p$.e && className(_el$
|
|
1594
|
-
_p$.t = style(_el$
|
|
1612
|
+
_v$41 !== _p$.e && className(_el$239, _p$.e = _v$41);
|
|
1613
|
+
_p$.t = style(_el$240, _v$42, _p$.t);
|
|
1595
1614
|
return _p$;
|
|
1596
1615
|
}, {
|
|
1597
1616
|
e: void 0,
|
|
1598
1617
|
t: void 0
|
|
1599
1618
|
});
|
|
1600
|
-
return _el$
|
|
1619
|
+
return _el$239;
|
|
1601
1620
|
}
|
|
1602
1621
|
});
|
|
1603
1622
|
};
|