@seed-ship/mcp-ui-solid 6.6.0 → 6.7.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 +62 -0
- package/dist/adapters/index.d.ts +2 -1
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/macro-run.cjs +226 -0
- package/dist/adapters/macro-run.cjs.map +1 -0
- package/dist/adapters/macro-run.d.ts +65 -0
- package/dist/adapters/macro-run.d.ts.map +1 -0
- package/dist/adapters/macro-run.js +226 -0
- package/dist/adapters/macro-run.js.map +1 -0
- package/dist/adapters.cjs +3 -0
- package/dist/adapters.cjs.map +1 -1
- package/dist/adapters.d.cts +2 -1
- package/dist/adapters.d.ts +2 -1
- package/dist/adapters.js +4 -1
- package/dist/adapters.js.map +1 -1
- package/dist/components/ActionGroupRenderer.cjs +12 -3
- package/dist/components/ActionGroupRenderer.cjs.map +1 -1
- package/dist/components/ActionGroupRenderer.d.ts.map +1 -1
- package/dist/components/ActionGroupRenderer.js +12 -3
- package/dist/components/ActionGroupRenderer.js.map +1 -1
- package/dist/components/UIResourceRenderer.cjs +22 -15
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +22 -15
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/context/MCPActionContext.cjs +4 -1
- package/dist/context/MCPActionContext.cjs.map +1 -1
- package/dist/context/MCPActionContext.d.ts +13 -1
- package/dist/context/MCPActionContext.d.ts.map +1 -1
- package/dist/context/MCPActionContext.js +4 -1
- package/dist/context/MCPActionContext.js.map +1 -1
- package/dist/mcp-ui-spec/dist/schemas.cjs +250 -1
- package/dist/mcp-ui-spec/dist/schemas.cjs.map +1 -1
- package/dist/mcp-ui-spec/dist/schemas.js +251 -2
- package/dist/mcp-ui-spec/dist/schemas.js.map +1 -1
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs +2 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs.map +1 -1
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +2 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js.map +1 -1
- package/package.json +2 -2
- package/src/adapters/index.ts +4 -5
- package/src/adapters/macro-run.test.ts +293 -0
- package/src/adapters/macro-run.ts +362 -0
- package/src/components/ActionGroupRenderer.test.tsx +1 -0
- package/src/components/ActionGroupRenderer.tsx +19 -4
- package/src/components/ActionSubmit.test.tsx +188 -0
- package/src/components/UIResourceRenderer.tsx +19 -6
- package/src/context/MCPActionContext.tsx +17 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"macro-run.js","sources":["../../src/adapters/macro-run.ts"],"sourcesContent":["/**\n * MacroRun adapters — `MacroRunV1` / `MacroInterrogationV1` → MCP-UI render\n * primitives.\n *\n * @since v6.7.0 (MacroRun Phase 2 — contract consolidated in deposium_MCPs\n * `docs/2026/briefs/2026-05-22-macro-run-runtime-contract-consolidation.md`)\n *\n * ## Opt-in, pure\n *\n * Published under the dedicated subpath `@seed-ship/mcp-ui-solid/adapters` —\n * never imported by the core renderer path. Every function here is a **pure\n * function**: same input → same output, no `fetch`, no SSE listener, no\n * persistence, no global state, no clock, no randomness.\n *\n * ## Scope boundary\n *\n * These adapters only translate the agnostic `MacroRunV1` contract (defined\n * in `@seed-ship/mcp-ui-spec`) into existing MCP-UI primitives — a\n * `ScratchpadState` and a `ChatPromptConfig`. They do NOT:\n *\n * - emit or consume any SSE event (a `macro_run_snapshot` producer is a\n * separate, later goal on the producing runtime repo);\n * - perform any fetch, persistence or resume;\n * - know anything about a specific runtime, host, corpus or domain;\n * - touch the `action:'submit'` executors, nor mix MacroRun with the\n * existing tool-call action path.\n *\n * The host owns all of the above — it feeds a `MacroRunV1` snapshot in and\n * decides where to render the result.\n */\n\nimport type { MacroRunV1, MacroStepV1, MacroInterrogationV1 } from '@seed-ship/mcp-ui-spec';\nimport type {\n ScratchpadState,\n ScratchpadSection,\n ChatPromptConfig,\n ChoiceOption,\n ConfirmPromptConfig,\n AgentCardContent,\n SplitStepperContent,\n ElicitationRequestedSchema,\n FormPromptConfig,\n} from '../types/chat-bus';\nimport { elicitationToPromptConfig } from '../services/chat-bus';\n\n// ─── Status mappings ─────────────────────────────────────────\n\n/**\n * Run status → top-level `ScratchpadState` status. `aborted` and `failed`\n * both surface as `error` (an aborted run is additionally non-retryable —\n * see `buildError`).\n */\nconst RUN_STATUS_TO_SCRATCHPAD: Record<MacroRunV1['status'], ScratchpadState['status']> = {\n pending: 'loading',\n running: 'processing',\n awaiting_input: 'waiting_human',\n completed: 'complete',\n failed: 'error',\n aborted: 'error',\n};\n\n/** Run status → `AgentCardContent` status, used when the run carries no agent. */\nfunction runStatusToAgentStatus(status: MacroRunV1['status']): AgentCardContent['status'] {\n switch (status) {\n case 'pending':\n return 'idle';\n case 'running':\n return 'running';\n case 'awaiting_input':\n return 'waiting';\n case 'completed':\n return 'done';\n case 'failed':\n case 'aborted':\n return 'error';\n }\n}\n\n/**\n * Step status → stepper status. The MCP-UI stepper primitive renders\n * `failed` as `error`; every other value passes through unchanged.\n */\nfunction stepToStepperStatus(\n status: MacroStepV1['status']\n): 'pending' | 'active' | 'done' | 'skipped' | 'error' {\n return status === 'failed' ? 'error' : status;\n}\n\n// ─── Section builders ────────────────────────────────────────\n\ninterface StepperSectionContent {\n steps: Array<{\n id: string;\n label: string;\n status: 'pending' | 'active' | 'done' | 'skipped' | 'error';\n summary?: string;\n duration_ms?: number;\n }>;\n orientation: 'horizontal' | 'vertical';\n}\n\nfunction buildAgentCard(run: MacroRunV1): AgentCardContent {\n const agent = run.agent;\n const card: AgentCardContent = {\n agentId: agent?.id ?? run.macroId,\n name: agent?.name ?? run.macroName ?? run.macroId,\n status: agent?.status ?? runStatusToAgentStatus(run.status),\n };\n if (agent?.avatar) card.avatar = agent.avatar;\n if (agent?.capabilities) card.capabilities = agent.capabilities;\n if (agent?.currentStep) card.currentStep = agent.currentStep;\n return card;\n}\n\nfunction buildStepperContent(steps: MacroStepV1[]): StepperSectionContent {\n return {\n orientation: 'horizontal',\n steps: steps.map((step) => {\n const out: StepperSectionContent['steps'][number] = {\n id: step.id,\n label: step.label,\n status: stepToStepperStatus(step.status),\n };\n if (step.summary) out.summary = step.summary;\n if (typeof step.durationMs === 'number') out.duration_ms = step.durationMs;\n return out;\n }),\n };\n}\n\n/** Collapse a set of sub-step statuses into a single parallel-lane status. */\nfunction laneStatus(subSteps: MacroStepV1[]): 'done' | 'active' | 'pending' | 'error' {\n if (subSteps.some((s) => s.status === 'failed')) return 'error';\n if (subSteps.some((s) => s.status === 'active')) return 'active';\n if (subSteps.length > 0 && subSteps.every((s) => s.status === 'done' || s.status === 'skipped'))\n return 'done';\n return 'pending';\n}\n\n/**\n * Build a `split_stepper` content from steps that carry `parallel` branches.\n * Each top-level step becomes a lane: a step with `parallel` sub-steps shows\n * those sub-steps; a step without falls back to a single-step lane.\n */\nfunction buildSplitStepperContent(steps: MacroStepV1[]): SplitStepperContent {\n return {\n agents: steps.map((step) => {\n const subSteps = step.parallel && step.parallel.length > 0 ? step.parallel : [step];\n return {\n id: step.id,\n name: step.label,\n status: laneStatus(subSteps),\n steps: subSteps.map((sub) => ({\n id: sub.id,\n label: sub.label,\n status: stepToStepperStatus(sub.status),\n })),\n };\n }),\n };\n}\n\n/** Component `type` → the closest `ScratchpadSection` type for a result. */\nfunction resultSectionType(componentType: unknown): ScratchpadSection['type'] {\n switch (componentType) {\n case 'chart':\n return 'chart';\n case 'map':\n return 'map';\n case 'table':\n return 'data_preview';\n default:\n return 'data';\n }\n}\n\nfunction buildError(run: MacroRunV1): ScratchpadState['error'] | undefined {\n if (run.status !== 'failed' && run.status !== 'aborted') return undefined;\n const aborted = run.status === 'aborted';\n if (run.error) {\n const err: NonNullable<ScratchpadState['error']> = {\n message: run.error.message,\n // An aborted run is never retryable, regardless of the producer flag.\n retryable: aborted ? false : (run.error.retryable ?? false),\n };\n if (run.error.code) err.code = run.error.code;\n return err;\n }\n return {\n message: aborted ? 'Macro run aborted.' : 'Macro run failed.',\n retryable: false,\n };\n}\n\n// ─── macroRunToScratchpadState ───────────────────────────────\n\n/**\n * Convert a `MacroRunV1` snapshot into a `ScratchpadState`.\n *\n * Sections produced, in order:\n * 1. `agent_card` — always (derived from `run.agent`, or from the macro\n * identity when the run carries no agent, e.g. a non-interactive macro).\n * 2. `stepper` — when the run has steps and none carry `parallel` branches.\n * `split_stepper` instead when any step carries `parallel` (future model).\n * 3. `prompt` — when `run.pendingInterrogation` is set; its content is the\n * `ChatPromptConfig` produced by {@link macroInterrogationToChatPromptConfig}.\n * 4. one section per `run.results` entry (`chart` / `map` / `data_preview` /\n * `data`, by component type). Optional — the adapter works without results.\n *\n * Pure: no fetch, no SSE, no persistence. The host owns all wiring.\n */\nexport function macroRunToScratchpadState(run: MacroRunV1): ScratchpadState {\n const sections: ScratchpadSection[] = [];\n\n // 1. Agent card — always present.\n sections.push({\n id: 'macro-agent',\n title: 'Agent',\n type: 'agent_card',\n content: buildAgentCard(run),\n editable: false,\n source: 'agent',\n });\n\n // 2. Stepper / split_stepper — when there are steps.\n if (run.steps.length > 0) {\n const hasParallel = run.steps.some((s) => Array.isArray(s.parallel) && s.parallel.length > 0);\n sections.push(\n hasParallel\n ? {\n id: 'macro-split-stepper',\n title: 'Progress',\n type: 'split_stepper',\n content: buildSplitStepperContent(run.steps),\n editable: false,\n source: 'agent',\n }\n : {\n id: 'macro-stepper',\n title: 'Progress',\n type: 'stepper',\n content: buildStepperContent(run.steps),\n editable: false,\n source: 'agent',\n }\n );\n }\n\n // 3. Pending interrogation → a `prompt` section.\n if (run.pendingInterrogation) {\n sections.push({\n id: 'macro-prompt',\n title: run.pendingInterrogation.title,\n type: 'prompt',\n content: macroInterrogationToChatPromptConfig(run.pendingInterrogation),\n editable: false,\n source: 'agent',\n });\n }\n\n // 4. Result components → one section each (results are optional). A result\n // is a `UIComponent`-shaped object — passthrough, read loosely (the spec\n // validates the run envelope, the renderer validates each component).\n const results = run.results ?? [];\n results.forEach((component, index) => {\n sections.push({\n id: `macro-result-${String(component?.id ?? index)}`,\n title: 'Result',\n type: resultSectionType(component?.type),\n content: component,\n editable: false,\n source: 'agent',\n });\n });\n\n const state: ScratchpadState = {\n id: run.runId,\n title: run.title ?? run.macroName ?? run.macroId,\n sections,\n filters: {},\n agentMessages: [],\n status: RUN_STATUS_TO_SCRATCHPAD[run.status],\n };\n\n const error = buildError(run);\n if (error) state.error = error;\n\n return state;\n}\n\n// ─── macroInterrogationToChatPromptConfig ────────────────────\n\nfunction isElicitationSchema(value: unknown): value is ElicitationRequestedSchema {\n if (typeof value !== 'object' || value === null) return false;\n const v = value as { type?: unknown; properties?: unknown };\n return v.type === 'object' && typeof v.properties === 'object' && v.properties !== null;\n}\n\n/**\n * Convert a `MacroInterrogationV1` into a `ChatPromptConfig`.\n *\n * - `choice` → `{ type: 'choice' }` (vertical layout).\n * - `confirm` → `{ type: 'confirm' }`.\n * - `form` → `{ type: 'form' }` (the opaque `fields` are passed through).\n * - `elicitation` → routed through the existing `elicitationToPromptConfig()`\n * helper. If the interrogation carries no usable elicitation JSON Schema,\n * it degrades to a `confirm` prompt rather than throwing.\n *\n * Always returns a `ChatPromptConfig` — never an `ElicitationEvent` — so the\n * host has a single entry point. Usable standalone or via\n * {@link macroRunToScratchpadState} (which calls it for an embedded\n * `pendingInterrogation`).\n */\nexport function macroInterrogationToChatPromptConfig(q: MacroInterrogationV1): ChatPromptConfig {\n switch (q.kind) {\n case 'choice': {\n const options: ChoiceOption[] = (q.options ?? []).map((o) => {\n const opt: ChoiceOption = { value: o.value, label: o.label };\n if (o.icon) opt.icon = o.icon;\n if (o.description) opt.description = o.description;\n if (o.metadata) opt.metadata = o.metadata;\n return opt;\n });\n return {\n type: 'choice',\n title: q.title,\n config: { options, layout: 'vertical' },\n };\n }\n\n case 'confirm': {\n const config: ConfirmPromptConfig = {};\n if (q.message) config.message = q.message;\n if (q.confirm?.confirmLabel) config.confirmLabel = q.confirm.confirmLabel;\n if (q.confirm?.cancelLabel) config.cancelLabel = q.confirm.cancelLabel;\n if (q.confirm?.variant) config.variant = q.confirm.variant;\n return { type: 'confirm', title: q.title, config };\n }\n\n case 'form':\n return {\n type: 'form',\n title: q.title,\n config: { fields: (q.fields ?? []) as FormPromptConfig['fields'] },\n };\n\n case 'elicitation': {\n if (isElicitationSchema(q.elicitationSchema)) {\n return elicitationToPromptConfig({\n message: q.message ?? q.title,\n requestedSchema: q.elicitationSchema,\n });\n }\n // No usable schema — degrade gracefully instead of crashing.\n return {\n type: 'confirm',\n title: q.title,\n config: { message: q.message ?? 'Please confirm to continue.' },\n };\n }\n }\n}\n"],"names":[],"mappings":";AAoDA,MAAM,2BAAoF;AAAA,EACxF,SAAS;AAAA,EACT,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AACX;AAGA,SAAS,uBAAuB,QAA0D;AACxF,UAAQ,QAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,EAAA;AAEb;AAMA,SAAS,oBACP,QACqD;AACrD,SAAO,WAAW,WAAW,UAAU;AACzC;AAeA,SAAS,eAAe,KAAmC;AACzD,QAAM,QAAQ,IAAI;AAClB,QAAM,OAAyB;AAAA,IAC7B,UAAS,+BAAO,OAAM,IAAI;AAAA,IAC1B,OAAM,+BAAO,SAAQ,IAAI,aAAa,IAAI;AAAA,IAC1C,SAAQ,+BAAO,WAAU,uBAAuB,IAAI,MAAM;AAAA,EAAA;AAE5D,MAAI,+BAAO,OAAQ,MAAK,SAAS,MAAM;AACvC,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,EAAE,SAAU,KAAI,WAAW,EAAE;AACjC,eAAO;AAAA,MACT,CAAC;AACD,aAAO;AAAA,QACL,MAAM;AAAA,QACN,OAAO,EAAE;AAAA,QACT,QAAQ,EAAE,SAAS,QAAQ,WAAA;AAAA,MAAW;AAAA,IAE1C;AAAA,IAEA,KAAK,WAAW;AACd,YAAM,SAA8B,CAAA;AACpC,UAAI,EAAE,QAAS,QAAO,UAAU,EAAE;AAClC,WAAI,OAAE,YAAF,mBAAW,aAAc,QAAO,eAAe,EAAE,QAAQ;AAC7D,WAAI,OAAE,YAAF,mBAAW,YAAa,QAAO,cAAc,EAAE,QAAQ;AAC3D,WAAI,OAAE,YAAF,mBAAW,QAAS,QAAO,UAAU,EAAE,QAAQ;AACnD,aAAO,EAAE,MAAM,WAAW,OAAO,EAAE,OAAO,OAAA;AAAA,IAC5C;AAAA,IAEA,KAAK;AACH,aAAO;AAAA,QACL,MAAM;AAAA,QACN,OAAO,EAAE;AAAA,QACT,QAAQ,EAAE,QAAS,EAAE,UAAU,CAAA,EAAC;AAAA,MAAiC;AAAA,IAGrE,KAAK,eAAe;AAClB,UAAI,oBAAoB,EAAE,iBAAiB,GAAG;AAC5C,eAAO,0BAA0B;AAAA,UAC/B,SAAS,EAAE,WAAW,EAAE;AAAA,UACxB,iBAAiB,EAAE;AAAA,QAAA,CACpB;AAAA,MACH;AAEA,aAAO;AAAA,QACL,MAAM;AAAA,QACN,OAAO,EAAE;AAAA,QACT,QAAQ,EAAE,SAAS,EAAE,WAAW,8BAAA;AAAA,MAA8B;AAAA,IAElE;AAAA,EAAA;AAEJ;"}
|
package/dist/adapters.cjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const connector = require("./adapters/connector.cjs");
|
|
4
|
+
const macroRun = require("./adapters/macro-run.cjs");
|
|
4
5
|
exports.connectorActionsToActionGroup = connector.connectorActionsToActionGroup;
|
|
5
6
|
exports.connectorResultToUILayout = connector.connectorResultToUILayout;
|
|
7
|
+
exports.macroInterrogationToChatPromptConfig = macroRun.macroInterrogationToChatPromptConfig;
|
|
8
|
+
exports.macroRunToScratchpadState = macroRun.macroRunToScratchpadState;
|
|
6
9
|
//# sourceMappingURL=adapters.cjs.map
|
package/dist/adapters.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"adapters.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/adapters.d.cts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* // → <UIResourceRenderer content={layout} />
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
export { connectorResultToUILayout, connectorActionsToActionGroup
|
|
16
|
+
export { connectorResultToUILayout, connectorActionsToActionGroup } from './connector';
|
|
17
17
|
export type { ConnectorResultToUILayoutOptions, ConnectorActionsToActionGroupOptions, } from './connector';
|
|
18
|
+
export { macroRunToScratchpadState, macroInterrogationToChatPromptConfig } from './macro-run';
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/adapters.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* // → <UIResourceRenderer content={layout} />
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
export { connectorResultToUILayout, connectorActionsToActionGroup
|
|
16
|
+
export { connectorResultToUILayout, connectorActionsToActionGroup } from './connector';
|
|
17
17
|
export type { ConnectorResultToUILayoutOptions, ConnectorActionsToActionGroupOptions, } from './connector';
|
|
18
|
+
export { macroRunToScratchpadState, macroInterrogationToChatPromptConfig } from './macro-run';
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/adapters.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { connectorActionsToActionGroup, connectorResultToUILayout } from "./adapters/connector.js";
|
|
2
|
+
import { macroInterrogationToChatPromptConfig, macroRunToScratchpadState } from "./adapters/macro-run.js";
|
|
2
3
|
export {
|
|
3
4
|
connectorActionsToActionGroup,
|
|
4
|
-
connectorResultToUILayout
|
|
5
|
+
connectorResultToUILayout,
|
|
6
|
+
macroInterrogationToChatPromptConfig,
|
|
7
|
+
macroRunToScratchpadState
|
|
5
8
|
};
|
|
6
9
|
//# sourceMappingURL=adapters.js.map
|
package/dist/adapters.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"adapters.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -7,18 +7,27 @@ var _tmpl$ = /* @__PURE__ */ web.template(`<span class=text-current>`), _tmpl$2
|
|
|
7
7
|
const ActionButton = (props) => {
|
|
8
8
|
const {
|
|
9
9
|
execute,
|
|
10
|
+
executeAction,
|
|
10
11
|
isExecuting
|
|
11
12
|
} = useAction.useAction();
|
|
13
|
+
const isExecutable = () => props.action.action === "tool-call" || props.action.action === "submit";
|
|
12
14
|
const handleClick = async (e) => {
|
|
13
15
|
if (props.action.disabled) return;
|
|
14
16
|
if (props.action.action === "tool-call" && props.action.toolName) {
|
|
15
17
|
e.preventDefault();
|
|
16
18
|
await execute(props.action.toolName, props.action.params || {});
|
|
19
|
+
} else if (props.action.action === "submit") {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
await executeAction({
|
|
22
|
+
action: "submit",
|
|
23
|
+
toolName: props.action.toolName || "submit",
|
|
24
|
+
params: props.action.params || {}
|
|
25
|
+
});
|
|
17
26
|
} else if (props.action.action === "link" && props.action.url) {
|
|
18
27
|
window.open(props.action.url, "_blank", "noopener,noreferrer");
|
|
19
28
|
}
|
|
20
29
|
};
|
|
21
|
-
const isDisabled = () => props.action.disabled ||
|
|
30
|
+
const isDisabled = () => props.action.disabled || isExecutable() && isExecuting();
|
|
22
31
|
const variantClass = () => {
|
|
23
32
|
switch (props.action.variant) {
|
|
24
33
|
case "primary":
|
|
@@ -76,7 +85,7 @@ const ActionButton = (props) => {
|
|
|
76
85
|
_el$7.$$click = handleClick;
|
|
77
86
|
web.insert(_el$7, web.createComponent(solidJs.Show, {
|
|
78
87
|
get when() {
|
|
79
|
-
return web.memo(() => !!isExecuting())() &&
|
|
88
|
+
return web.memo(() => !!isExecuting())() && isExecutable();
|
|
80
89
|
},
|
|
81
90
|
get children() {
|
|
82
91
|
return web.getNextElement(_tmpl$3);
|
|
@@ -84,7 +93,7 @@ const ActionButton = (props) => {
|
|
|
84
93
|
}), _el$1, _co$3);
|
|
85
94
|
web.insert(_el$7, web.createComponent(solidJs.Show, {
|
|
86
95
|
get when() {
|
|
87
|
-
return web.memo(() => !!props.action.icon)() && !(isExecuting() &&
|
|
96
|
+
return web.memo(() => !!props.action.icon)() && !(isExecuting() && isExecutable());
|
|
88
97
|
},
|
|
89
98
|
get children() {
|
|
90
99
|
var _el$9 = web.getNextElement(_tmpl$);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionGroupRenderer.cjs","sources":["../../src/components/ActionGroupRenderer.tsx"],"sourcesContent":["/**\n * ActionGroupRenderer - Group of actions with layout options\n * Sprint 3: UX Improvements\n */\n\nimport { Component, For, Show } from 'solid-js'\nimport type { UIComponent, ActionGroupParams, ActionComponentParams } from '../types'\nimport { useAction } from '../hooks/useAction'\n\nexport interface ActionGroupRendererProps {\n /**\n * UIComponent with action-group params (for declarative use)\n */\n component?: UIComponent\n\n /**\n * Direct action group params (alternative to component)\n */\n params?: ActionGroupParams\n}\n\n/**\n * Render a single action button with variants and click handling\n */\nconst ActionButton: Component<{\n action: ActionComponentParams\n index: number\n}> = (props) => {\n const { execute, isExecuting } = useAction()\n\n const handleClick = async (e: MouseEvent) => {\n if (props.action.disabled) return\n\n if (props.action.action === 'tool-call' && props.action.toolName) {\n e.preventDefault()\n await execute(props.action.toolName, props.action.params || {})\n } else if (props.action.action === 'link' && props.action.url) {\n window.open(props.action.url, '_blank', 'noopener,noreferrer')\n }\n }\n\n const isDisabled = () =>\n props.action.disabled || (props.action.action === 'tool-call' && isExecuting())\n\n const variantClass = () => {\n switch (props.action.variant) {\n case 'primary':\n return 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500'\n case 'secondary':\n return 'bg-gray-200 text-gray-800 hover:bg-gray-300 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 focus:ring-gray-500'\n case 'outline':\n return 'border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-gray-500'\n case 'ghost':\n return 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-gray-500'\n case 'danger':\n return 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500'\n default:\n return 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500'\n }\n }\n\n const sizeClass = () => {\n switch (props.action.size) {\n case 'sm':\n return 'px-2 py-1 text-xs'\n case 'lg':\n return 'px-6 py-3 text-base'\n default:\n return 'px-4 py-2 text-sm'\n }\n }\n\n // Render as link if it's a link action\n if (props.action.type === 'link' || (props.action.action === 'link' && props.action.url)) {\n return (\n <a\n href={props.action.url || '#'}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class={`inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${variantClass()} ${sizeClass()} ${\n isDisabled() ? 'opacity-50 cursor-not-allowed pointer-events-none' : ''\n }`}\n >\n <Show when={props.action.icon}>\n <span class=\"text-current\">{props.action.icon}</span>\n </Show>\n {props.action.label}\n </a>\n )\n }\n\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={isDisabled()}\n class={`inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${variantClass()} ${sizeClass()} ${\n isDisabled() ? 'opacity-50 cursor-not-allowed' : ''\n }`}\n >\n <Show when={isExecuting() && props.action.action === 'tool-call'}>\n <span class=\"animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full\" />\n </Show>\n <Show when={props.action.icon && !(isExecuting() && props.action.action === 'tool-call')}>\n <span class=\"text-current\">{props.action.icon}</span>\n </Show>\n {props.action.label}\n </button>\n )\n}\n\n/**\n * Action group component for rendering multiple actions with consistent layout\n *\n * @example\n * ```tsx\n * const actionGroup: UIComponent = {\n * id: 'form-actions',\n * type: 'action-group',\n * position: { colStart: 1, colSpan: 12 },\n * params: {\n * layout: 'end',\n * gap: 'md',\n * actions: [\n * { label: 'Cancel', variant: 'outline', action: 'link', url: '/back' },\n * { label: 'Save', variant: 'primary', action: 'tool-call', toolName: 'save' },\n * ],\n * },\n * }\n * <ActionGroupRenderer component={actionGroup} />\n * ```\n */\nexport const ActionGroupRenderer: Component<ActionGroupRendererProps> = (props) => {\n const params = () => props.params || (props.component?.params as ActionGroupParams) || { actions: [] }\n\n const layoutClass = () => {\n switch (params()?.layout) {\n case 'vertical':\n return 'flex flex-col'\n case 'space-between':\n return 'flex justify-between'\n case 'end':\n return 'flex justify-end'\n case 'center':\n return 'flex justify-center'\n default: // horizontal\n return 'flex'\n }\n }\n\n const gapClass = () => {\n switch (params()?.gap) {\n case 'none':\n return 'gap-0'\n case 'sm':\n return 'gap-1'\n case 'lg':\n return 'gap-4'\n default: // md\n return 'gap-2'\n }\n }\n\n return (\n <div\n class={`${layoutClass()} ${gapClass()} ${params()?.fullWidth ? 'w-full' : ''}`}\n role=\"group\"\n aria-label={params()?.label || 'Action group'}\n >\n <For each={params()?.actions || []}>\n {(action, index) => <ActionButton action={action} index={index()} />}\n </For>\n </div>\n )\n}\n"],"names":["ActionButton","props","execute","isExecuting","useAction","handleClick","e","action","disabled","toolName","preventDefault","params","url","window","open","isDisabled","variantClass","variant","sizeClass","size","type","_el$","_$getNextElement","_tmpl$2","_el$3","firstChild","_el$4","_co$","_$getNextMarker","nextSibling","_el$5","_el$6","_co$2","_$insert","_$createComponent","Show","when","icon","children","_el$2","_tmpl$","label","_$effect","_p$","_v$","_v$2","_$setAttribute","t","_$className","undefined","_el$7","_tmpl$4","_el$0","_el$1","_co$3","_el$10","_el$11","_co$4","_el$12","_el$13","_co$5","$$click","_$memo","_tmpl$3","_el$9","_v$3","_v$4","_$setProperty","_$runHydrationEvents","ActionGroupRenderer","component","actions","layoutClass","layout","gapClass","gap","_el$14","_tmpl$5","For","each","index","_v$5","fullWidth","_v$6","_$delegateEvents"],"mappings":";;;;;;AAwBA,MAAMA,eAGAC,CAAAA,UAAU;AACd,QAAM;AAAA,IAAEC;AAAAA,IAASC;AAAAA,EAAAA,IAAgBC,oBAAAA;AAEjC,QAAMC,cAAc,OAAOC,MAAkB;AAC3C,QAAIL,MAAMM,OAAOC,SAAU;AAE3B,QAAIP,MAAMM,OAAOA,WAAW,eAAeN,MAAMM,OAAOE,UAAU;AAChEH,QAAEI,eAAAA;AACF,YAAMR,QAAQD,MAAMM,OAAOE,UAAUR,MAAMM,OAAOI,UAAU,EAAE;AAAA,IAChE,WAAWV,MAAMM,OAAOA,WAAW,UAAUN,MAAMM,OAAOK,KAAK;AAC7DC,aAAOC,KAAKb,MAAMM,OAAOK,KAAK,UAAU,qBAAqB;AAAA,IAC/D;AAAA,EACF;AAEA,QAAMG,aAAaA,MACjBd,MAAMM,OAAOC,YAAaP,MAAMM,OAAOA,WAAW,eAAeJ,YAAAA;AAEnE,QAAMa,eAAeA,MAAM;AACzB,YAAQf,MAAMM,OAAOU,SAAAA;AAAAA,MACnB,KAAK;AACH,eAAO;AAAA,MACT,KAAK;AACH,eAAO;AAAA,MACT,KAAK;AACH,eAAO;AAAA,MACT,KAAK;AACH,eAAO;AAAA,MACT,KAAK;AACH,eAAO;AAAA,MACT;AACE,eAAO;AAAA,IAAA;AAAA,EAEb;AAEA,QAAMC,YAAYA,MAAM;AACtB,YAA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/B,QAAQyE,UAAK9C,IAAAA,gBAAMlC,cAAY;AAAA,QAACO;AAAAA,QAAc,IAAEyE,QAAK;AAAA,iBAAEA,MAAAA;AAAAA,QAAO;AAAA,MAAA,CAAA;AAAA,IAAA,CAAI,CAAA;AAAAtC,QAAAA,OAAAC,CAAAA,QAAA;;AAAA,UAAAsC,OAL/D,GAAGT,YAAAA,CAAa,IAAIE,UAAU,MAAI/D,YAAAA,MAAAA,mBAAUuE,aAAY,WAAW,EAAE,IAAEC,SAElExE,YAAAA,MAAAA,mBAAU8B,UAAS;AAAcwC,eAAAtC,IAAArC,KAAA0C,IAAAA,UAAA4B,QAAAjC,IAAArC,IAAA2E,IAAA;AAAAE,eAAAxC,IAAAI,KAAAD,IAAAA,aAAA8B,QAAA,cAAAjC,IAAAI,IAAAoC,IAAA;AAAA,aAAAxC;AAAAA,IAAA,GAAA;AAAA,MAAArC,GAAA2C;AAAAA,MAAAF,GAAAE;AAAAA,IAAAA,CAAA;AAAA,WAAA2B;AAAAA,EAAA,GAAA;AAOnD;AAACQ,IAAAA,eAAA,CAAA,OAAA,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"ActionGroupRenderer.cjs","sources":["../../src/components/ActionGroupRenderer.tsx"],"sourcesContent":["/**\n * ActionGroupRenderer - Group of actions with layout options\n * Sprint 3: UX Improvements\n */\n\nimport { Component, For, Show } from 'solid-js'\nimport type { UIComponent, ActionGroupParams, ActionComponentParams } from '../types'\nimport { useAction } from '../hooks/useAction'\n\nexport interface ActionGroupRendererProps {\n /**\n * UIComponent with action-group params (for declarative use)\n */\n component?: UIComponent\n\n /**\n * Direct action group params (alternative to component)\n */\n params?: ActionGroupParams\n}\n\n/**\n * Render a single action button with variants and click handling\n */\nconst ActionButton: Component<{\n action: ActionComponentParams\n index: number\n}> = (props) => {\n const { execute, executeAction, isExecuting } = useAction()\n\n // tool-call and submit both go through the host executor — they show a\n // loading state and gate disabled while running. link does neither.\n const isExecutable = () =>\n props.action.action === 'tool-call' || props.action.action === 'submit'\n\n const handleClick = async (e: MouseEvent) => {\n if (props.action.disabled) return\n\n if (props.action.action === 'tool-call' && props.action.toolName) {\n e.preventDefault()\n await execute(props.action.toolName, props.action.params || {})\n } else if (props.action.action === 'submit') {\n // submit is NOT a tool call — route it through the executor with the\n // `action: 'submit'` kind preserved so the host can POST to\n // params.submit_url etc. Works without a surrounding <form>.\n e.preventDefault()\n await executeAction({\n action: 'submit',\n toolName: props.action.toolName || 'submit',\n params: props.action.params || {},\n })\n } else if (props.action.action === 'link' && props.action.url) {\n window.open(props.action.url, '_blank', 'noopener,noreferrer')\n }\n }\n\n const isDisabled = () =>\n props.action.disabled || (isExecutable() && isExecuting())\n\n const variantClass = () => {\n switch (props.action.variant) {\n case 'primary':\n return 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500'\n case 'secondary':\n return 'bg-gray-200 text-gray-800 hover:bg-gray-300 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 focus:ring-gray-500'\n case 'outline':\n return 'border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-gray-500'\n case 'ghost':\n return 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-gray-500'\n case 'danger':\n return 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500'\n default:\n return 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500'\n }\n }\n\n const sizeClass = () => {\n switch (props.action.size) {\n case 'sm':\n return 'px-2 py-1 text-xs'\n case 'lg':\n return 'px-6 py-3 text-base'\n default:\n return 'px-4 py-2 text-sm'\n }\n }\n\n // Render as link if it's a link action\n if (props.action.type === 'link' || (props.action.action === 'link' && props.action.url)) {\n return (\n <a\n href={props.action.url || '#'}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class={`inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${variantClass()} ${sizeClass()} ${\n isDisabled() ? 'opacity-50 cursor-not-allowed pointer-events-none' : ''\n }`}\n >\n <Show when={props.action.icon}>\n <span class=\"text-current\">{props.action.icon}</span>\n </Show>\n {props.action.label}\n </a>\n )\n }\n\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={isDisabled()}\n class={`inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${variantClass()} ${sizeClass()} ${\n isDisabled() ? 'opacity-50 cursor-not-allowed' : ''\n }`}\n >\n <Show when={isExecuting() && isExecutable()}>\n <span class=\"animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full\" />\n </Show>\n <Show when={props.action.icon && !(isExecuting() && isExecutable())}>\n <span class=\"text-current\">{props.action.icon}</span>\n </Show>\n {props.action.label}\n </button>\n )\n}\n\n/**\n * Action group component for rendering multiple actions with consistent layout\n *\n * @example\n * ```tsx\n * const actionGroup: UIComponent = {\n * id: 'form-actions',\n * type: 'action-group',\n * position: { colStart: 1, colSpan: 12 },\n * params: {\n * layout: 'end',\n * gap: 'md',\n * actions: [\n * { label: 'Cancel', variant: 'outline', action: 'link', url: '/back' },\n * { label: 'Save', variant: 'primary', action: 'tool-call', toolName: 'save' },\n * ],\n * },\n * }\n * <ActionGroupRenderer component={actionGroup} />\n * ```\n */\nexport const ActionGroupRenderer: Component<ActionGroupRendererProps> = (props) => {\n const params = () => props.params || (props.component?.params as ActionGroupParams) || { actions: [] }\n\n const layoutClass = () => {\n switch (params()?.layout) {\n case 'vertical':\n return 'flex flex-col'\n case 'space-between':\n return 'flex justify-between'\n case 'end':\n return 'flex justify-end'\n case 'center':\n return 'flex justify-center'\n default: // horizontal\n return 'flex'\n }\n }\n\n const gapClass = () => {\n switch (params()?.gap) {\n case 'none':\n return 'gap-0'\n case 'sm':\n return 'gap-1'\n case 'lg':\n return 'gap-4'\n default: // md\n return 'gap-2'\n }\n }\n\n return (\n <div\n class={`${layoutClass()} ${gapClass()} ${params()?.fullWidth ? 'w-full' : ''}`}\n role=\"group\"\n aria-label={params()?.label || 'Action group'}\n >\n <For each={params()?.actions || []}>\n {(action, index) => <ActionButton action={action} index={index()} />}\n </For>\n </div>\n )\n}\n"],"names":["ActionButton","props","execute","executeAction","isExecuting","useAction","isExecutable","action","handleClick","e","disabled","toolName","preventDefault","params","url","window","open","isDisabled","variantClass","variant","sizeClass","size","type","_el$","_$getNextElement","_tmpl$2","_el$3","firstChild","_el$4","_co$","_$getNextMarker","nextSibling","_el$5","_el$6","_co$2","_$insert","_$createComponent","Show","when","icon","children","_el$2","_tmpl$","label","_$effect","_p$","_v$","_v$2","_$setAttribute","t","_$className","undefined","_el$7","_tmpl$4","_el$0","_el$1","_co$3","_el$10","_el$11","_co$4","_el$12","_el$13","_co$5","$$click","_$memo","_tmpl$3","_el$9","_v$3","_v$4","_$setProperty","_$runHydrationEvents","ActionGroupRenderer","component","actions","layoutClass","layout","gapClass","gap","_el$14","_tmpl$5","For","each","index","_v$5","fullWidth","_v$6","_$delegateEvents"],"mappings":";;;;;;AAwBA,MAAMA,eAGAC,CAAAA,UAAU;AACd,QAAM;AAAA,IAAEC;AAAAA,IAASC;AAAAA,IAAeC;AAAAA,EAAAA,IAAgBC,oBAAAA;AAIhD,QAAMC,eAAeA,MACnBL,MAAMM,OAAOA,WAAW,eAAeN,MAAMM,OAAOA,WAAW;AAEjE,QAAMC,cAAc,OAAOC,MAAkB;AAC3C,QAAIR,MAAMM,OAAOG,SAAU;AAE3B,QAAIT,MAAMM,OAAOA,WAAW,eAAeN,MAAMM,OAAOI,UAAU;AAChEF,QAAEG,eAAAA;AACF,YAAMV,QAAQD,MAAMM,OAAOI,UAAUV,MAAMM,OAAOM,UAAU,EAAE;AAAA,IAChE,WAAWZ,MAAMM,OAAOA,WAAW,UAAU;AAI3CE,QAAEG,eAAAA;AACF,YAAMT,cAAc;AAAA,QAClBI,QAAQ;AAAA,QACRI,UAAUV,MAAMM,OAAOI,YAAY;AAAA,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
1
|
-
{"version":3,"file":"ActionGroupRenderer.d.ts","sourceRoot":"","sources":["../../src/components/ActionGroupRenderer.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAa,MAAM,UAAU,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAyB,MAAM,UAAU,CAAA;AAGrF,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,SAAS,CAAC,EAAE,WAAW,CAAA;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC3B;
|
|
1
|
+
{"version":3,"file":"ActionGroupRenderer.d.ts","sourceRoot":"","sources":["../../src/components/ActionGroupRenderer.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAa,MAAM,UAAU,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAyB,MAAM,UAAU,CAAA;AAGrF,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,SAAS,CAAC,EAAE,WAAW,CAAA;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC3B;AA2GD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC,wBAAwB,CA0CnE,CAAA"}
|
|
@@ -5,18 +5,27 @@ var _tmpl$ = /* @__PURE__ */ template(`<span class=text-current>`), _tmpl$2 = /*
|
|
|
5
5
|
const ActionButton = (props) => {
|
|
6
6
|
const {
|
|
7
7
|
execute,
|
|
8
|
+
executeAction,
|
|
8
9
|
isExecuting
|
|
9
10
|
} = useAction();
|
|
11
|
+
const isExecutable = () => props.action.action === "tool-call" || props.action.action === "submit";
|
|
10
12
|
const handleClick = async (e) => {
|
|
11
13
|
if (props.action.disabled) return;
|
|
12
14
|
if (props.action.action === "tool-call" && props.action.toolName) {
|
|
13
15
|
e.preventDefault();
|
|
14
16
|
await execute(props.action.toolName, props.action.params || {});
|
|
17
|
+
} else if (props.action.action === "submit") {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
await executeAction({
|
|
20
|
+
action: "submit",
|
|
21
|
+
toolName: props.action.toolName || "submit",
|
|
22
|
+
params: props.action.params || {}
|
|
23
|
+
});
|
|
15
24
|
} else if (props.action.action === "link" && props.action.url) {
|
|
16
25
|
window.open(props.action.url, "_blank", "noopener,noreferrer");
|
|
17
26
|
}
|
|
18
27
|
};
|
|
19
|
-
const isDisabled = () => props.action.disabled ||
|
|
28
|
+
const isDisabled = () => props.action.disabled || isExecutable() && isExecuting();
|
|
20
29
|
const variantClass = () => {
|
|
21
30
|
switch (props.action.variant) {
|
|
22
31
|
case "primary":
|
|
@@ -74,7 +83,7 @@ const ActionButton = (props) => {
|
|
|
74
83
|
_el$7.$$click = handleClick;
|
|
75
84
|
insert(_el$7, createComponent(Show, {
|
|
76
85
|
get when() {
|
|
77
|
-
return memo(() => !!isExecuting())() &&
|
|
86
|
+
return memo(() => !!isExecuting())() && isExecutable();
|
|
78
87
|
},
|
|
79
88
|
get children() {
|
|
80
89
|
return getNextElement(_tmpl$3);
|
|
@@ -82,7 +91,7 @@ const ActionButton = (props) => {
|
|
|
82
91
|
}), _el$1, _co$3);
|
|
83
92
|
insert(_el$7, createComponent(Show, {
|
|
84
93
|
get when() {
|
|
85
|
-
return memo(() => !!props.action.icon)() && !(isExecuting() &&
|
|
94
|
+
return memo(() => !!props.action.icon)() && !(isExecuting() && isExecutable());
|
|
86
95
|
},
|
|
87
96
|
get children() {
|
|
88
97
|
var _el$9 = getNextElement(_tmpl$);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionGroupRenderer.js","sources":["../../src/components/ActionGroupRenderer.tsx"],"sourcesContent":["/**\n * ActionGroupRenderer - Group of actions with layout options\n * Sprint 3: UX Improvements\n */\n\nimport { Component, For, Show } from 'solid-js'\nimport type { UIComponent, ActionGroupParams, ActionComponentParams } from '../types'\nimport { useAction } from '../hooks/useAction'\n\nexport interface ActionGroupRendererProps {\n /**\n * UIComponent with action-group params (for declarative use)\n */\n component?: UIComponent\n\n /**\n * Direct action group params (alternative to component)\n */\n params?: ActionGroupParams\n}\n\n/**\n * Render a single action button with variants and click handling\n */\nconst ActionButton: Component<{\n action: ActionComponentParams\n index: number\n}> = (props) => {\n const { execute, isExecuting } = useAction()\n\n const handleClick = async (e: MouseEvent) => {\n if (props.action.disabled) return\n\n if (props.action.action === 'tool-call' && props.action.toolName) {\n e.preventDefault()\n await execute(props.action.toolName, props.action.params || {})\n } else if (props.action.action === 'link' && props.action.url) {\n window.open(props.action.url, '_blank', 'noopener,noreferrer')\n }\n }\n\n const isDisabled = () =>\n props.action.disabled || (props.action.action === 'tool-call' && isExecuting())\n\n const variantClass = () => {\n switch (props.action.variant) {\n case 'primary':\n return 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500'\n case 'secondary':\n return 'bg-gray-200 text-gray-800 hover:bg-gray-300 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 focus:ring-gray-500'\n case 'outline':\n return 'border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-gray-500'\n case 'ghost':\n return 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-gray-500'\n case 'danger':\n return 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500'\n default:\n return 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500'\n }\n }\n\n const sizeClass = () => {\n switch (props.action.size) {\n case 'sm':\n return 'px-2 py-1 text-xs'\n case 'lg':\n return 'px-6 py-3 text-base'\n default:\n return 'px-4 py-2 text-sm'\n }\n }\n\n // Render as link if it's a link action\n if (props.action.type === 'link' || (props.action.action === 'link' && props.action.url)) {\n return (\n <a\n href={props.action.url || '#'}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class={`inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${variantClass()} ${sizeClass()} ${\n isDisabled() ? 'opacity-50 cursor-not-allowed pointer-events-none' : ''\n }`}\n >\n <Show when={props.action.icon}>\n <span class=\"text-current\">{props.action.icon}</span>\n </Show>\n {props.action.label}\n </a>\n )\n }\n\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={isDisabled()}\n class={`inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${variantClass()} ${sizeClass()} ${\n isDisabled() ? 'opacity-50 cursor-not-allowed' : ''\n }`}\n >\n <Show when={isExecuting() && props.action.action === 'tool-call'}>\n <span class=\"animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full\" />\n </Show>\n <Show when={props.action.icon && !(isExecuting() && props.action.action === 'tool-call')}>\n <span class=\"text-current\">{props.action.icon}</span>\n </Show>\n {props.action.label}\n </button>\n )\n}\n\n/**\n * Action group component for rendering multiple actions with consistent layout\n *\n * @example\n * ```tsx\n * const actionGroup: UIComponent = {\n * id: 'form-actions',\n * type: 'action-group',\n * position: { colStart: 1, colSpan: 12 },\n * params: {\n * layout: 'end',\n * gap: 'md',\n * actions: [\n * { label: 'Cancel', variant: 'outline', action: 'link', url: '/back' },\n * { label: 'Save', variant: 'primary', action: 'tool-call', toolName: 'save' },\n * ],\n * },\n * }\n * <ActionGroupRenderer component={actionGroup} />\n * ```\n */\nexport const ActionGroupRenderer: Component<ActionGroupRendererProps> = (props) => {\n const params = () => props.params || (props.component?.params as ActionGroupParams) || { actions: [] }\n\n const layoutClass = () => {\n switch (params()?.layout) {\n case 'vertical':\n return 'flex flex-col'\n case 'space-between':\n return 'flex justify-between'\n case 'end':\n return 'flex justify-end'\n case 'center':\n return 'flex justify-center'\n default: // horizontal\n return 'flex'\n }\n }\n\n const gapClass = () => {\n switch (params()?.gap) {\n case 'none':\n return 'gap-0'\n case 'sm':\n return 'gap-1'\n case 'lg':\n return 'gap-4'\n default: // md\n return 'gap-2'\n }\n }\n\n return (\n <div\n class={`${layoutClass()} ${gapClass()} ${params()?.fullWidth ? 'w-full' : ''}`}\n role=\"group\"\n aria-label={params()?.label || 'Action group'}\n >\n <For each={params()?.actions || []}>\n {(action, index) => <ActionButton action={action} index={index()} />}\n </For>\n </div>\n )\n}\n"],"names":["ActionButton","props","execute","isExecuting","useAction","handleClick","e","action","disabled","toolName","preventDefault","params","url","window","open","isDisabled","variantClass","variant","sizeClass","size","type","_el$","_$getNextElement","_tmpl$2","_el$3","firstChild","_el$4","_co$","_$getNextMarker","nextSibling","_el$5","_el$6","_co$2","_$insert","_$createComponent","Show","when","icon","children","_el$2","_tmpl$","label","_$effect","_p$","_v$","_v$2","_$setAttribute","t","_$className","undefined","_el$7","_tmpl$4","_el$0","_el$1","_co$3","_el$10","_el$11","_co$4","_el$12","_el$13","_co$5","$$click","_$memo","_tmpl$3","_el$9","_v$3","_v$4","_$setProperty","_$runHydrationEvents","ActionGroupRenderer","component","actions","layoutClass","layout","gapClass","gap","_el$14","_tmpl$5","For","each","index","_v$5","fullWidth","_v$6","_$delegateEvents"],"mappings":";;;;AAwBA,MAAMA,eAGAC,CAAAA,UAAU;AACd,QAAM;AAAA,IAAEC;AAAAA,IAASC;AAAAA,EAAAA,IAAgBC,UAAAA;AAEjC,QAAMC,cAAc,OAAOC,MAAkB;AAC3C,QAAIL,MAAMM,OAAOC,SAAU;AAE3B,QAAIP,MAAMM,OAAOA,WAAW,eAAeN,MAAMM,OAAOE,UAAU;AAChEH,QAAEI,eAAAA;AACF,YAAMR,QAAQD,MAAMM,OAAOE,UAAUR,MAAMM,OAAOI,UAAU,EAAE;AAAA,IAChE,WAAWV,MAAMM,OAAOA,WAAW,UAAUN,MAAMM,OAAOK,KAAK;AAC7DC,aAAOC,KAAKb,MAAMM,OAAOK,KAAK,UAAU,qBAAqB;AAAA,IAC/D;AAAA,EACF;AAEA,QAAMG,aAAaA,MACjBd,MAAMM,OAAOC,YA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BAMK4C,KAAG;AAAA,MAAA,IAACC,OAAI;;AAAA,iBAAEpE,YAAAA,MAAAA,mBAAU4D,YAAW,CAAA;AAAA,MAAE;AAAA,MAAAjC,UAC/BA,CAAC/B,QAAQyE,UAAK9C,gBAAMlC,cAAY;AAAA,QAACO;AAAAA,QAAc,IAAEyE,QAAK;AAAA,iBAAEA,MAAAA;AAAAA,QAAO;AAAA,MAAA,CAAA;AAAA,IAAA,CAAI,CAAA;AAAAtC,WAAAC,CAAAA,QAAA;;AAAA,UAAAsC,OAL/D,GAAGT,YAAAA,CAAa,IAAIE,UAAU,MAAI/D,YAAAA,MAAAA,mBAAUuE,aAAY,WAAW,EAAE,IAAEC,SAElExE,YAAAA,MAAAA,mBAAU8B,UAAS;AAAcwC,eAAAtC,IAAArC,KAAA0C,UAAA4B,QAAAjC,IAAArC,IAAA2E,IAAA;AAAAE,eAAAxC,IAAAI,KAAAD,aAAA8B,QAAA,cAAAjC,IAAAI,IAAAoC,IAAA;AAAA,aAAAxC;AAAAA,IAAA,GAAA;AAAA,MAAArC,GAAA2C;AAAAA,MAAAF,GAAAE;AAAAA,IAAAA,CAAA;AAAA,WAAA2B;AAAAA,EAAA,GAAA;AAOnD;AAACQ,eAAA,CAAA,OAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"ActionGroupRenderer.js","sources":["../../src/components/ActionGroupRenderer.tsx"],"sourcesContent":["/**\n * ActionGroupRenderer - Group of actions with layout options\n * Sprint 3: UX Improvements\n */\n\nimport { Component, For, Show } from 'solid-js'\nimport type { UIComponent, ActionGroupParams, ActionComponentParams } from '../types'\nimport { useAction } from '../hooks/useAction'\n\nexport interface ActionGroupRendererProps {\n /**\n * UIComponent with action-group params (for declarative use)\n */\n component?: UIComponent\n\n /**\n * Direct action group params (alternative to component)\n */\n params?: ActionGroupParams\n}\n\n/**\n * Render a single action button with variants and click handling\n */\nconst ActionButton: Component<{\n action: ActionComponentParams\n index: number\n}> = (props) => {\n const { execute, executeAction, isExecuting } = useAction()\n\n // tool-call and submit both go through the host executor — they show a\n // loading state and gate disabled while running. link does neither.\n const isExecutable = () =>\n props.action.action === 'tool-call' || props.action.action === 'submit'\n\n const handleClick = async (e: MouseEvent) => {\n if (props.action.disabled) return\n\n if (props.action.action === 'tool-call' && props.action.toolName) {\n e.preventDefault()\n await execute(props.action.toolName, props.action.params || {})\n } else if (props.action.action === 'submit') {\n // submit is NOT a tool call — route it through the executor with the\n // `action: 'submit'` kind preserved so the host can POST to\n // params.submit_url etc. Works without a surrounding <form>.\n e.preventDefault()\n await executeAction({\n action: 'submit',\n toolName: props.action.toolName || 'submit',\n params: props.action.params || {},\n })\n } else if (props.action.action === 'link' && props.action.url) {\n window.open(props.action.url, '_blank', 'noopener,noreferrer')\n }\n }\n\n const isDisabled = () =>\n props.action.disabled || (isExecutable() && isExecuting())\n\n const variantClass = () => {\n switch (props.action.variant) {\n case 'primary':\n return 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500'\n case 'secondary':\n return 'bg-gray-200 text-gray-800 hover:bg-gray-300 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 focus:ring-gray-500'\n case 'outline':\n return 'border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-gray-500'\n case 'ghost':\n return 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-gray-500'\n case 'danger':\n return 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500'\n default:\n return 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500'\n }\n }\n\n const sizeClass = () => {\n switch (props.action.size) {\n case 'sm':\n return 'px-2 py-1 text-xs'\n case 'lg':\n return 'px-6 py-3 text-base'\n default:\n return 'px-4 py-2 text-sm'\n }\n }\n\n // Render as link if it's a link action\n if (props.action.type === 'link' || (props.action.action === 'link' && props.action.url)) {\n return (\n <a\n href={props.action.url || '#'}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class={`inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${variantClass()} ${sizeClass()} ${\n isDisabled() ? 'opacity-50 cursor-not-allowed pointer-events-none' : ''\n }`}\n >\n <Show when={props.action.icon}>\n <span class=\"text-current\">{props.action.icon}</span>\n </Show>\n {props.action.label}\n </a>\n )\n }\n\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={isDisabled()}\n class={`inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${variantClass()} ${sizeClass()} ${\n isDisabled() ? 'opacity-50 cursor-not-allowed' : ''\n }`}\n >\n <Show when={isExecuting() && isExecutable()}>\n <span class=\"animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full\" />\n </Show>\n <Show when={props.action.icon && !(isExecuting() && isExecutable())}>\n <span class=\"text-current\">{props.action.icon}</span>\n </Show>\n {props.action.label}\n </button>\n )\n}\n\n/**\n * Action group component for rendering multiple actions with consistent layout\n *\n * @example\n * ```tsx\n * const actionGroup: UIComponent = {\n * id: 'form-actions',\n * type: 'action-group',\n * position: { colStart: 1, colSpan: 12 },\n * params: {\n * layout: 'end',\n * gap: 'md',\n * actions: [\n * { label: 'Cancel', variant: 'outline', action: 'link', url: '/back' },\n * { label: 'Save', variant: 'primary', action: 'tool-call', toolName: 'save' },\n * ],\n * },\n * }\n * <ActionGroupRenderer component={actionGroup} />\n * ```\n */\nexport const ActionGroupRenderer: Component<ActionGroupRendererProps> = (props) => {\n const params = () => props.params || (props.component?.params as ActionGroupParams) || { actions: [] }\n\n const layoutClass = () => {\n switch (params()?.layout) {\n case 'vertical':\n return 'flex flex-col'\n case 'space-between':\n return 'flex justify-between'\n case 'end':\n return 'flex justify-end'\n case 'center':\n return 'flex justify-center'\n default: // horizontal\n return 'flex'\n }\n }\n\n const gapClass = () => {\n switch (params()?.gap) {\n case 'none':\n return 'gap-0'\n case 'sm':\n return 'gap-1'\n case 'lg':\n return 'gap-4'\n default: // md\n return 'gap-2'\n }\n }\n\n return (\n <div\n class={`${layoutClass()} ${gapClass()} ${params()?.fullWidth ? 'w-full' : ''}`}\n role=\"group\"\n aria-label={params()?.label || 'Action group'}\n >\n <For each={params()?.actions || []}>\n {(action, index) => <ActionButton action={action} index={index()} />}\n </For>\n </div>\n )\n}\n"],"names":["ActionButton","props","execute","executeAction","isExecuting","useAction","isExecutable","action","handleClick","e","disabled","toolName","preventDefault","params","url","window","open","isDisabled","variantClass","variant","sizeClass","size","type","_el$","_$getNextElement","_tmpl$2","_el$3","firstChild","_el$4","_co$","_$getNextMarker","nextSibling","_el$5","_el$6","_co$2","_$insert","_$createComponent","Show","when","icon","children","_el$2","_tmpl$","label","_$effect","_p$","_v$","_v$2","_$setAttribute","t","_$className","undefined","_el$7","_tmpl$4","_el$0","_el$1","_co$3","_el$10","_el$11","_co$4","_el$12","_el$13","_co$5","$$click","_$memo","_tmpl$3","_el$9","_v$3","_v$4","_$setProperty","_$runHydrationEvents","ActionGroupRenderer","component","actions","layoutClass","layout","gapClass","gap","_el$14","_tmpl$5","For","each","index","_v$5","fullWidth","_v$6","_$delegateEvents"],"mappings":";;;;AAwBA,MAAMA,eAGAC,CAAAA,UAAU;AACd,QAAM;AAAA,IAAEC;AAAAA,IAASC;AAAAA,IAAeC;AAAAA,EAAAA,IAAgBC,UAAAA;AAIhD,QAAMC,eAAeA,MACnBL,MAAMM,OAAOA,WAAW,eAAeN,MAAMM,OAAOA,WAAW;AAEjE,QAAMC,cAAc,OAAOC,MAAkB;AAC3C,QAAIR,MAAMM,OAAOG,SAAU;AAE3B,QAAIT,MAAMM,OAAOA,WAAW,eAAeN,MAAMM,OAAOI,UAAU;AAChEF,QAAEG,eAAAA;AACF,YAAMV,QAAQD,MAAMM,OAAOI,UAAUV,MAAMM,OAAOM,UAAU,EAAE;AAAA,IAChE,WAAWZ,MAAMM,OAAOA,WAAW,UAAU;AAI3CE,QAAEG,eAA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AAEA,QAAMC,WAAWA,MAAM;;AACrB,aAAQ/D,YAAAA,MAAAA,mBAAUgE,KAAAA;AAAAA,MAChB,KAAK;AACH,eAAO;AAAA,MACT,KAAK;AACH,eAAO;AAAA,MACT,KAAK;AACH,eAAO;AAAA,MACT;AACE,eAAO;AAAA,IAAA;AAAA,EAEb;AAEA,UAAA,MAAA;AAAA,QAAAC,SAAAtD,eAAAuD,OAAA;AAAA5C,WAAA2C,QAAA1C,gBAMK4C,KAAG;AAAA,MAAA,IAACC,OAAI;;AAAA,iBAAEpE,YAAAA,MAAAA,mBAAU4D,YAAW,CAAA;AAAA,MAAE;AAAA,MAAAjC,UAC/BA,CAACjC,QAAQ2E,UAAK9C,gBAAMpC,cAAY;AAAA,QAACO;AAAAA,QAAc,IAAE2E,QAAK;AAAA,iBAAEA,MAAAA;AAAAA,QAAO;AAAA,MAAA,CAAA;AAAA,IAAA,CAAI,CAAA;AAAAtC,WAAAC,CAAAA,QAAA;;AAAA,UAAAsC,OAL/D,GAAGT,YAAAA,CAAa,IAAIE,UAAU,MAAI/D,YAAAA,MAAAA,mBAAUuE,aAAY,WAAW,EAAE,IAAEC,SAElExE,YAAAA,MAAAA,mBAAU8B,UAAS;AAAcwC,eAAAtC,IAAApC,KAAAyC,UAAA4B,QAAAjC,IAAApC,IAAA0E,IAAA;AAAAE,eAAAxC,IAAAI,KAAAD,aAAA8B,QAAA,cAAAjC,IAAAI,IAAAoC,IAAA;AAAA,aAAAxC;AAAAA,IAAA,GAAA;AAAA,MAAApC,GAAA0C;AAAAA,MAAAF,GAAAE;AAAAA,IAAAA,CAAA;AAAA,WAAA2B;AAAAA,EAAA,GAAA;AAOnD;AAACQ,eAAA,CAAA,OAAA,CAAA;"}
|
|
@@ -28,7 +28,7 @@ const PortalDropdownMenu = require("./PortalDropdownMenu.cjs");
|
|
|
28
28
|
const RenderContext = require("./RenderContext.cjs");
|
|
29
29
|
const useAction = require("../hooks/useAction.cjs");
|
|
30
30
|
const marked_esm = require("../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.cjs");
|
|
31
|
-
var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700"><p class="text-red-500 dark:text-red-400 text-sm">Invalid chart data: missing data.datasets`), _tmpl$5 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$6 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$7 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$9 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$0 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$10 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$11 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Copy TSV`), _tmpl$13 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download CSV`), _tmpl$14 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download JSON`), _tmpl$15 = /* @__PURE__ */ web.template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"title="Export table"aria-label="Export table"aria-haspopup=menu><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$16 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$17 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3 flex-shrink-0"><!$><!/><!$><!/>`), _tmpl$18 = /* @__PURE__ */ web.template(`<button type=button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm"aria-label="Clear search">×`), _tmpl$19 = /* @__PURE__ */ web.template(`<div class="relative mb-3"><span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none text-sm">🔍</span><input type=text class="w-full max-w-xs min-w-[200px] pl-8 pr-8 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 outline-none"><!$><!/>`), _tmpl$20 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$21 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$22 = /* @__PURE__ */ web.template(`<select class="ml-2 px-1 py-0.5 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300">`), _tmpl$23 = /* @__PURE__ */ web.template(`<span class=text-gray-400>/ page`), _tmpl$24 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span><!$><!/>–<!$><!/> / <!$><!/></span><div class="flex items-center gap-2"><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">◀</button><span><!$><!/> / <!$><!/></span><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">▶</button><!$><!/>`), _tmpl$25 = /* @__PURE__ */ web.template(`<div><!$><!/><div><!$><!/><!$><!/><div role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-100 dark:bg-gray-900 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/>`), _tmpl$26 = /* @__PURE__ */ web.template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-100 dark:bg-gray-900 cursor-pointer select-none hover:bg-gray-200 dark:hover:bg-gray-800 transition-colors"><span class="inline-flex items-center gap-1"><!$><!/><span class="text-[10px] leading-none">`), _tmpl$27 = /* @__PURE__ */ web.template(`<option>`), _tmpl$28 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$29 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$30 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$31 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$32 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$33 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$34 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$35 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"loading=lazy>`, true, false, false), _tmpl$36 = /* @__PURE__ */ web.template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$37 = /* @__PURE__ */ web.template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$38 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$39 = /* @__PURE__ */ web.template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$40 = /* @__PURE__ */ web.template(`<div class="inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 text-xs text-yellow-800 dark:text-yellow-200"role=alert aria-label="Component validation warning"><svg xmlns=http://www.w3.org/2000/svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1=12 y1=9 x2=12 y2=13></line><line x1=12 y1=17 x2=12.01 y2=17></line></svg><span>Invalid <!$><!/>`), _tmpl$41 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$42 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$43 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$44 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$45 = /* @__PURE__ */ web.template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$46 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$47 = /* @__PURE__ */ web.template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$48 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$49 = /* @__PURE__ */ web.template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$50 = /* @__PURE__ */ web.template(`<li>`), _tmpl$51 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$52 = /* @__PURE__ */ web.template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$53 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$54 = /* @__PURE__ */ web.template(`<div>`);
|
|
31
|
+
var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700"><p class="text-red-500 dark:text-red-400 text-sm">Invalid chart data: missing data.datasets`), _tmpl$5 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$6 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$7 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$9 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$0 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$10 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$11 = /* @__PURE__ */ web.template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Copy TSV`), _tmpl$13 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download CSV`), _tmpl$14 = /* @__PURE__ */ web.template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download JSON`), _tmpl$15 = /* @__PURE__ */ web.template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"title="Export table"aria-label="Export table"aria-haspopup=menu><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$16 = /* @__PURE__ */ web.template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$17 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3 flex-shrink-0"><!$><!/><!$><!/>`), _tmpl$18 = /* @__PURE__ */ web.template(`<button type=button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm"aria-label="Clear search">×`), _tmpl$19 = /* @__PURE__ */ web.template(`<div class="relative mb-3"><span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none text-sm">🔍</span><input type=text class="w-full max-w-xs min-w-[200px] pl-8 pr-8 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 outline-none"><!$><!/>`), _tmpl$20 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$21 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$22 = /* @__PURE__ */ web.template(`<select class="ml-2 px-1 py-0.5 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300">`), _tmpl$23 = /* @__PURE__ */ web.template(`<span class=text-gray-400>/ page`), _tmpl$24 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span><!$><!/>–<!$><!/> / <!$><!/></span><div class="flex items-center gap-2"><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">◀</button><span><!$><!/> / <!$><!/></span><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">▶</button><!$><!/>`), _tmpl$25 = /* @__PURE__ */ web.template(`<div><!$><!/><div><!$><!/><!$><!/><div role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-100 dark:bg-gray-900 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/>`), _tmpl$26 = /* @__PURE__ */ web.template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-100 dark:bg-gray-900 cursor-pointer select-none hover:bg-gray-200 dark:hover:bg-gray-800 transition-colors"><span class="inline-flex items-center gap-1"><!$><!/><span class="text-[10px] leading-none">`), _tmpl$27 = /* @__PURE__ */ web.template(`<option>`), _tmpl$28 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$29 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$30 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$31 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$32 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$33 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$34 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$35 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"loading=lazy>`, true, false, false), _tmpl$36 = /* @__PURE__ */ web.template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$37 = /* @__PURE__ */ web.template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$38 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$39 = /* @__PURE__ */ web.template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$40 = /* @__PURE__ */ web.template(`<div class="inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 text-xs text-yellow-800 dark:text-yellow-200"role=alert aria-label="Component validation warning"><svg xmlns=http://www.w3.org/2000/svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1=12 y1=9 x2=12 y2=13></line><line x1=12 y1=17 x2=12.01 y2=17></line></svg><span>Invalid <!$><!/>`), _tmpl$41 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$42 = /* @__PURE__ */ web.template(`<span aria-hidden=true>`), _tmpl$43 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$44 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$45 = /* @__PURE__ */ web.template(`<button type=button><!$><!/><!$><!/><!$><!/>`), _tmpl$46 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$47 = /* @__PURE__ */ web.template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$48 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$49 = /* @__PURE__ */ web.template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$50 = /* @__PURE__ */ web.template(`<li>`), _tmpl$51 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$52 = /* @__PURE__ */ web.template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$53 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$54 = /* @__PURE__ */ web.template(`<div>`);
|
|
32
32
|
function CopyButton(props) {
|
|
33
33
|
const [copied, setCopied] = solidJs.createSignal(false);
|
|
34
34
|
const handleCopy = async () => {
|
|
@@ -1468,9 +1468,11 @@ function ActionRenderer(props) {
|
|
|
1468
1468
|
const params = props.component.params;
|
|
1469
1469
|
const {
|
|
1470
1470
|
execute,
|
|
1471
|
+
executeAction,
|
|
1471
1472
|
isExecuting
|
|
1472
1473
|
} = useAction.useAction();
|
|
1473
1474
|
const telemetry = MCPUITelemetryContext.useTelemetry();
|
|
1475
|
+
const isExecutable = () => params.action === "tool-call" || params.action === "submit";
|
|
1474
1476
|
function dispatchTelemetry() {
|
|
1475
1477
|
if (!telemetry) return;
|
|
1476
1478
|
const actionName = params.toolName ?? params.action ?? "unknown";
|
|
@@ -1487,9 +1489,16 @@ function ActionRenderer(props) {
|
|
|
1487
1489
|
if (params.action === "tool-call" && params.toolName) {
|
|
1488
1490
|
e.preventDefault();
|
|
1489
1491
|
await execute(params.toolName, params.params || {});
|
|
1492
|
+
} else if (params.action === "submit") {
|
|
1493
|
+
e.preventDefault();
|
|
1494
|
+
await executeAction({
|
|
1495
|
+
action: "submit",
|
|
1496
|
+
toolName: params.toolName || "submit",
|
|
1497
|
+
params: params.params || {}
|
|
1498
|
+
});
|
|
1490
1499
|
}
|
|
1491
1500
|
};
|
|
1492
|
-
const isDisabled = () => params.disabled ||
|
|
1501
|
+
const isDisabled = () => params.disabled || isExecutable() && isExecuting();
|
|
1493
1502
|
if (params.type === "link" || params.action === "link") {
|
|
1494
1503
|
return (() => {
|
|
1495
1504
|
var _el$185 = web.getNextElement(_tmpl$43), _el$187 = _el$185.firstChild, [_el$188, _co$38] = web.getNextMarker(_el$187.nextSibling), _el$189 = _el$188.nextSibling, [_el$190, _co$39] = web.getNextMarker(_el$189.nextSibling);
|
|
@@ -1529,7 +1538,7 @@ function ActionRenderer(props) {
|
|
|
1529
1538
|
_el$191.$$click = handleClick;
|
|
1530
1539
|
web.insert(_el$191, web.createComponent(solidJs.Show, {
|
|
1531
1540
|
get when() {
|
|
1532
|
-
return web.memo(() => !!isExecuting())() &&
|
|
1541
|
+
return web.memo(() => !!isExecuting())() && isExecutable();
|
|
1533
1542
|
},
|
|
1534
1543
|
get children() {
|
|
1535
1544
|
return web.getNextElement(_tmpl$44);
|
|
@@ -1537,7 +1546,7 @@ function ActionRenderer(props) {
|
|
|
1537
1546
|
}), _el$195, _co$40);
|
|
1538
1547
|
web.insert(_el$191, web.createComponent(solidJs.Show, {
|
|
1539
1548
|
get when() {
|
|
1540
|
-
return web.memo(() => !!params.icon)() && !(isExecuting() &&
|
|
1549
|
+
return web.memo(() => !!params.icon)() && !(isExecuting() && isExecutable());
|
|
1541
1550
|
},
|
|
1542
1551
|
get children() {
|
|
1543
1552
|
var _el$193 = web.getNextElement(_tmpl$42);
|
|
@@ -1547,23 +1556,21 @@ function ActionRenderer(props) {
|
|
|
1547
1556
|
}), _el$197, _co$41);
|
|
1548
1557
|
web.insert(_el$191, () => params.label, _el$199, _co$42);
|
|
1549
1558
|
web.effect((_p$) => {
|
|
1550
|
-
var _v$38 =
|
|
1559
|
+
var _v$38 = isDisabled(), _v$39 = isExecuting() && isExecutable(), _v$40 = params.ariaLabel || params.label, _v$41 = `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
|
|
1551
1560
|
${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"}
|
|
1552
1561
|
${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
|
|
1553
1562
|
${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
|
|
1554
1563
|
${params.className || ""}`;
|
|
1555
|
-
_v$38 !== _p$.e && web.
|
|
1556
|
-
_v$39 !== _p$.t && web.
|
|
1557
|
-
_v$40 !== _p$.a && web.setAttribute(_el$191, "aria-
|
|
1558
|
-
_v$41 !== _p$.o && web.
|
|
1559
|
-
_v$42 !== _p$.i && web.className(_el$191, _p$.i = _v$42);
|
|
1564
|
+
_v$38 !== _p$.e && web.setProperty(_el$191, "disabled", _p$.e = _v$38);
|
|
1565
|
+
_v$39 !== _p$.t && web.setAttribute(_el$191, "aria-busy", _p$.t = _v$39);
|
|
1566
|
+
_v$40 !== _p$.a && web.setAttribute(_el$191, "aria-label", _p$.a = _v$40);
|
|
1567
|
+
_v$41 !== _p$.o && web.className(_el$191, _p$.o = _v$41);
|
|
1560
1568
|
return _p$;
|
|
1561
1569
|
}, {
|
|
1562
1570
|
e: void 0,
|
|
1563
1571
|
t: void 0,
|
|
1564
1572
|
a: void 0,
|
|
1565
|
-
o: void 0
|
|
1566
|
-
i: void 0
|
|
1573
|
+
o: void 0
|
|
1567
1574
|
});
|
|
1568
1575
|
web.runHydrationEvents();
|
|
1569
1576
|
return _el$191;
|
|
@@ -1790,9 +1797,9 @@ const UIResourceRenderer = (props) => {
|
|
|
1790
1797
|
}
|
|
1791
1798
|
}));
|
|
1792
1799
|
web.effect((_p$) => {
|
|
1793
|
-
var _v$
|
|
1794
|
-
_p$.e = web.style(_el$236, _v$
|
|
1795
|
-
_v$
|
|
1800
|
+
var _v$42 = getGridStyleString(component), _v$43 = stableKey.getUiResourceStableKey(component);
|
|
1801
|
+
_p$.e = web.style(_el$236, _v$42, _p$.e);
|
|
1802
|
+
_v$43 !== _p$.t && web.setAttribute(_el$236, "data-mcp-ui-component-id", _p$.t = _v$43);
|
|
1796
1803
|
return _p$;
|
|
1797
1804
|
}, {
|
|
1798
1805
|
e: void 0,
|