@klarkxy/dsh-deep-view 0.0.0-stage → 0.2.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widget.js","names":["withUnit"],"sources":["../src/ui.tsx","../src/chart.tsx","../src/widget.tsx"],"sourcesContent":["// Migrated from deep-view/src/react/ui.js (Apache-2.0).\n// Small, host-neutral labels and SVG controls; no private color tokens.\nimport type { ReactNode } from 'react'\nexport type ViewT = (key: string, params?: Record<string, unknown>) => string\nexport const english: ViewT = (key, params) => key.replace(/\\{(\\w+)\\}/g, (_, name) => String(params?.[name] ?? `{${name}}`))\n\nexport function LineIcon({ paths }: { paths: string[] }) {\n return <svg width=\"15\" height=\"15\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">{paths.map((d, index) => <path key={index} d={d} />)}</svg>\n}\nexport const DotsIcon = () => <LineIcon paths={['M5 10h.01M10 10h.01M15 10h.01']} />\nexport const CheckIcon = () => <LineIcon paths={['M4.5 10.5l3.5 3.5 7.5-8']} />\nexport const CopyIcon = () => <LineIcon paths={['M8.5 7h6A1.5 1.5 0 0 1 16 8.5v6a1.5 1.5 0 0 1-1.5 1.5h-6A1.5 1.5 0 0 1 7 14.5v-6A1.5 1.5 0 0 1 8.5 7z', 'M4 12.5V5.5A1.5 1.5 0 0 1 5.5 4H13']} />\nexport const TableIcon = () => <LineIcon paths={['M4.5 4h11A1.5 1.5 0 0 1 17 5.5v9a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 3 14.5v-9A1.5 1.5 0 0 1 4.5 4z', 'M3 8.5h14M8 8.5V16']} />\nexport const InfoIcon = () => <LineIcon paths={['M10 3.5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13z', 'M10 9.25v4', 'M10 6.6h.01']} />\nexport const LinkIcon = () => <svg width=\"12\" height=\"12\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M8.5 11.5l3-3\" /><path d=\"M7 9.5L5.5 11a2.5 2.5 0 0 0 3.5 3.5L10.5 13\" /><path d=\"M13 10.5l1.5-1.5A2.5 2.5 0 0 0 11 5.5L9.5 7\" /></svg>\nexport const keyLetter = (index: number) => String.fromCharCode(65 + index)\nexport function Segmented({ label, value, className, children }: { label: string; value: number; className?: string; children: ReactNode }) {\n return <div className={className ? `dvui-seg ${className}` : 'dvui-seg'} role=\"group\" aria-label={label} data-active={value}>{children}</div>\n}\n","// Chart layout and interaction adapted from deep-view/src/react/chart.js (Apache-2.0).\n// SVG is responsive, keyboard navigable, and uses only official --dsw-* theme tokens.\nimport { Fragment, useId, useLayoutEffect, useRef, useState } from 'react'\nimport type { CSSProperties, KeyboardEvent } from 'react'\nimport { asText, resolve } from './core/index.js'\nimport type { ViewNode } from './contracts.ts'\nimport { english, type ViewT } from './ui.tsx'\n\nexport const PALETTE = [\n 'var(--dsw-alias-state-business-primary)', 'var(--dsw-alias-brand-primary)',\n 'var(--dsw-alias-state-success-primary)', 'var(--dsw-alias-state-warn-primary)',\n 'var(--dsw-alias-state-error-primary)',\n]\nconst colorAt = (index: number) => PALETTE[index % PALETTE.length]\nconst TICK = 10\nconst LABEL = 11\nconst textWidth = (text: unknown, size: number) => [...String(text)].reduce((sum, char) => sum + (char.charCodeAt(0) > 0x2e80 ? size : size * 0.58), 0)\nconst fit = (text: unknown, room: number, size: number) => {\n if (textWidth(text, size) <= room) return String(text)\n let out = ''\n for (const char of String(text)) {\n if (textWidth(`${out}${char}…`, size) > room) break\n out += char\n }\n return out === '' ? '' : `${out}…`\n}\nexport function formatNumber(value: number) {\n if (!Number.isFinite(value)) return asText(value)\n const abs = Math.abs(value)\n const digits = abs >= 100 ? 0 : abs >= 10 ? 1 : 2\n return Number(value.toFixed(digits)).toLocaleString('en-US', { maximumFractionDigits: digits })\n}\nconst withUnit = (value: number, unit: string) => unit ? (unit === '%' ? `${formatNumber(value)}%` : `${formatNumber(value)} ${unit}`) : formatNumber(value)\n\nexport function niceTicks(low: number, high: number) {\n let lo = low\n let hi = high\n if (lo === hi) { lo = Math.min(0, lo); hi = hi === 0 ? 1 : Math.max(0, hi) }\n if (lo === hi) hi = lo + 1\n const raw = (hi - lo) / 4\n const magnitude = 10 ** Math.floor(Math.log10(raw))\n const step = [1, 2, 2.5, 5, 10].map(scale => scale * magnitude).find(candidate => candidate >= raw)!\n const start = Math.floor(lo / step + 1e-9) * step\n const end = Math.ceil(hi / step - 1e-9) * step\n const ticks = []\n for (let value = start; value <= end + step / 2; value += step) ticks.push(Number(value.toPrecision(12)))\n return ticks\n}\n\nexport type ChartSeries = { name: string; color: string; values: number[] }\nexport type ChartData = { kind: string; categories: string[]; series: ChartSeries[]; unit: string }\nexport function chartData(node: ViewNode, lookup: (name: string) => unknown): ChartData {\n const categories = (Array.isArray(node.categories) ? node.categories : []).map(asText)\n const series = (Array.isArray(node.series) ? node.series : []).map((item, index) => ({\n name: typeof item?.name === 'string' ? item.name : '', color: colorAt(index),\n values: categories.map((_, at) => {\n const value = Number(resolve(Array.isArray(item?.values) ? item.values[at] : undefined, lookup, 0))\n return Number.isFinite(value) ? value : 0\n }),\n }))\n return { kind: node.kind ?? 'bar', categories, series, unit: typeof node.unit === 'string' ? node.unit : '' }\n}\nconst csvCell = (value: string) => /[\",\\n]/.test(value) ? `\"${value.replace(/\"/g, '\"\"')}\"` : value\nexport function chartCsv({ categories, series, unit }: ChartData, t: ViewT = english) {\n const head = ['', ...series.map((item, index) => item.name || (series.length === 1 ? unit || t('Value') : `${t('Series')} ${index + 1}`))]\n const rows = categories.map((label, at) => [label, ...series.map(item => String(item.values[at]))])\n return [head, ...rows].map(row => row.map(cell => csvCell(String(cell))).join(',')).join('\\n')\n}\n\ntype Point = { x: number; y: number }\ntype Hit = { x: number; y: number; w: number; h: number }\ntype Drawn = { parts: React.ReactNode[]; height: number; points: Point[]; hits: Hit[]; size?: number; values?: number[]; total?: number }\nfunction valueAxis(values: number[], zero: boolean) {\n const finite = values.length > 0 ? values : [0]\n const low = Math.min(...finite)\n const high = Math.max(...finite)\n if (zero) return niceTicks(Math.min(0, low), Math.max(0, high))\n const pad = (high - low) * 0.1 || Math.abs(high) * 0.1 || 1\n return niceTicks(low - pad, high + pad)\n}\nfunction columns({ categories, series, unit, kind }: ChartData, width: number, active: number | null, shown: boolean[]): Drawn {\n const visible = series.filter((_, index) => shown[index])\n const ticks = valueAxis(visible.flatMap(item => item.values), kind !== 'line')\n const lo = ticks[0]\n const hi = ticks.at(-1)!\n const left = Math.ceil(Math.max(...ticks.map(tick => textWidth(withUnit(tick, unit), TICK)))) + 10\n const top = 8\n const height = 220\n const bottom = 24\n const plot = { x: left, y: top, w: Math.max(40, width - left - 4), h: height - top - bottom }\n const y = (value: number) => plot.y + plot.h - ((value - lo) / (hi - lo)) * plot.h\n const band = plot.w / categories.length\n const parts: React.ReactNode[] = []\n for (const tick of ticks) {\n parts.push(<line key={`g${tick}`} className=\"dvui-chart-grid\" x1={plot.x} x2={plot.x + plot.w} y1={y(tick)} y2={y(tick)} />)\n parts.push(<text key={`t${tick}`} className=\"dvui-chart-tick\" x={plot.x - 8} y={y(tick) + 3} textAnchor=\"end\">{withUnit(tick, unit)}</text>)\n }\n const points: Point[] = []\n categories.forEach((label, at) => {\n const cx = plot.x + band * at + band / 2\n parts.push(<text key={`c${at}`} className=\"dvui-chart-label\" x={cx} y={height - 7} textAnchor=\"middle\">{fit(label, band - 4, LABEL)}</text>)\n points.push({ x: cx, y: y(Math.max(...visible.map(item => item.values[at]), lo)) })\n })\n if (kind === 'bar') {\n const group = band * 0.72\n const gap = visible.length > 1 ? 2 : 0\n const barW = Math.max(2, (group - gap * (visible.length - 1)) / visible.length)\n const zero = y(Math.max(lo, Math.min(0, hi)))\n categories.forEach((_, at) => visible.forEach((item, row) => {\n const value = item.values[at]\n const x = plot.x + band * at + (band - group) / 2 + row * (barW + gap)\n const top2 = Math.min(y(value), zero)\n const tall = Math.max(1, Math.abs(y(value) - zero))\n const r = Math.min(4, barW / 2, tall)\n const d = value >= 0\n ? `M${x},${top2 + tall}V${top2 + r}q0,-${r} ${r},-${r}h${barW - 2 * r}q${r},0 ${r},${r}V${top2 + tall}z`\n : `M${x},${top2}V${top2 + tall - r}q0,${r} ${r},${r}h${barW - 2 * r}q${r},0 ${r},-${r}V${top2}z`\n parts.push(<path key={`b${at}-${row}`} className=\"dvui-chart-mark\" data-dim={active !== null && active !== at ? '' : undefined} d={d} style={{ fill: item.color }} />)\n }))\n } else {\n const xs = categories.map((_, at) => plot.x + band * at + band / 2)\n visible.forEach((item, row) => {\n const line = item.values.map((value, at) => `${at === 0 ? 'M' : 'L'}${xs[at]},${y(value)}`).join('')\n if (kind === 'area') {\n const base = y(Math.max(lo, Math.min(0, hi)))\n parts.push(<path key={`a${row}`} className=\"dvui-chart-area\" d={`${line}L${xs.at(-1)},${base}L${xs[0]},${base}z`} style={{ fill: item.color }} />)\n }\n parts.push(<path key={`l${row}`} className=\"dvui-chart-line\" d={line} style={{ stroke: item.color }} />)\n item.values.forEach((value, at) => parts.push(<circle key={`p${row}-${at}`} className=\"dvui-chart-dot\" cx={xs[at]} cy={y(value)} r={active === at ? 4 : 2.5} style={{ fill: item.color }} />))\n })\n if (active !== null) parts.unshift(<line key=\"guide\" className=\"dvui-chart-guide\" x1={xs[active]} x2={xs[active]} y1={plot.y} y2={plot.y + plot.h} />)\n }\n return { parts, height, points, hits: categories.map((_, at) => ({ x: plot.x + band * at, y: plot.y, w: band, h: plot.h })) }\n}\nfunction rows({ categories, series, unit }: ChartData, width: number, active: number | null, shown: boolean[]): Drawn {\n const visible = series.filter((_, index) => shown[index])\n const ticks = valueAxis(visible.flatMap(item => item.values), true)\n const lo = ticks[0]\n const hi = ticks.at(-1)!\n const labelW = Math.min(width * 0.38, Math.ceil(Math.max(...categories.map(label => textWidth(label, LABEL)))) + 10)\n const valueW = Math.ceil(Math.max(...visible.flatMap(item => item.values).map(value => textWidth(withUnit(value, unit), LABEL)))) + 10\n const barH = 14\n const rowH = 10 + visible.length * barH + (visible.length - 1) * 2\n const top = 4\n const height = top + rowH * categories.length + 22\n const plot = { x: labelW, y: top, w: Math.max(40, width - labelW - valueW), h: rowH * categories.length }\n const x = (value: number) => plot.x + ((value - lo) / (hi - lo)) * plot.w\n const parts: React.ReactNode[] = []\n for (const tick of ticks) {\n parts.push(<line key={`g${tick}`} className=\"dvui-chart-grid\" x1={x(tick)} x2={x(tick)} y1={plot.y} y2={plot.y + plot.h} />)\n parts.push(<text key={`t${tick}`} className=\"dvui-chart-tick\" x={x(tick)} y={height - 6} textAnchor=\"middle\">{withUnit(tick, unit)}</text>)\n }\n const points: Point[] = []\n const zero = x(Math.max(lo, Math.min(0, hi)))\n categories.forEach((label, at) => {\n const rowY = plot.y + rowH * at + 5\n parts.push(<text key={`c${at}`} className=\"dvui-chart-label\" x={labelW - 10} y={rowY + (rowH - 10) / 2 + 4} textAnchor=\"end\">{fit(label, labelW - 12, LABEL)}</text>)\n visible.forEach((item, row) => {\n const value = item.values[at]\n const by = rowY + row * (barH + 2)\n const left = Math.min(x(value), zero)\n const long = Math.max(1, Math.abs(x(value) - zero))\n parts.push(<rect key={`b${at}-${row}`} className=\"dvui-chart-mark\" data-dim={active !== null && active !== at ? '' : undefined} x={left} y={by} width={long} height={barH} rx={Math.min(4, long / 2)} style={{ fill: item.color }} />)\n parts.push(<text key={`v${at}-${row}`} className=\"dvui-chart-value\" x={left + long + 6} y={by + barH - 3}>{withUnit(value, unit)}</text>)\n })\n points.push({ x: Math.max(...visible.map(item => x(item.values[at])), zero), y: rowY })\n })\n return { parts, height, points, hits: categories.map((_, at) => ({ x: 0, y: plot.y + rowH * at, w: width, h: rowH })) }\n}\nfunction donut({ categories, series }: ChartData, width: number, active: number | null, hover: (at: number) => void): Drawn {\n const values = (series[0]?.values ?? []).map(value => Math.max(0, value))\n const total = values.reduce((sum, value) => sum + value, 0)\n const size = Math.min(180, Math.max(120, width * 0.42))\n const r = size / 2\n const inner = r * 0.62\n const cx = r\n const cy = r\n const parts: React.ReactNode[] = []\n const points: Point[] = []\n let angle = -Math.PI / 2\n values.forEach((value, at) => {\n const sweep = total > 0 ? (value / total) * Math.PI * 2 : 0\n const end = angle + sweep\n const mid = angle + sweep / 2\n points.push({ x: cx + Math.cos(mid) * (r - (r - inner) / 2), y: cy + Math.sin(mid) * (r - (r - inner) / 2) })\n if (sweep > 0) {\n const large = sweep > Math.PI ? 1 : 0\n const full = sweep >= Math.PI * 2 - 1e-6\n const p = (radius: number, theta: number) => `${cx + Math.cos(theta) * radius},${cy + Math.sin(theta) * radius}`\n const d = full\n ? `M${p(r, angle)}A${r},${r} 0 1 1 ${p(r, angle + Math.PI)}A${r},${r} 0 1 1 ${p(r, angle)}M${p(inner, angle)}A${inner},${inner} 0 1 0 ${p(inner, angle + Math.PI)}A${inner},${inner} 0 1 0 ${p(inner, angle)}z`\n : `M${p(r, angle)}A${r},${r} 0 ${large} 1 ${p(r, end)}L${p(inner, end)}A${inner},${inner} 0 ${large} 0 ${p(inner, angle)}z`\n parts.push(<path key={`s${at}`} className=\"dvui-chart-mark\" data-dim={active !== null && active !== at ? '' : undefined} d={d} fillRule=\"evenodd\" style={{ fill: colorAt(at) }} onPointerEnter={() => hover(at)} />)\n }\n angle = end\n })\n return { parts, height: size, size, points, total, values, hits: [] }\n}\nfunction useWidth(box: React.RefObject<HTMLDivElement | null>, initial: number) {\n const [width, setWidth] = useState(initial)\n useLayoutEffect(() => {\n const node = box.current\n if (!node || typeof ResizeObserver !== 'function') return undefined\n const measure = () => { const next = Math.round(node.clientWidth); if (next > 0) setWidth(next) }\n measure()\n const observer = new ResizeObserver(measure)\n observer.observe(node)\n return () => observer.disconnect()\n }, [box])\n return width\n}\n\nexport type ChartHandle = { label: string | null; asTable: boolean; toggleTable(): void; copy(): void }\nexport function ChartTable({ data, t = english }: { data: ChartData; t?: ViewT }) {\n const { categories, series, unit } = data\n const heads = series.map((item, index) => item.name || (series.length === 1 ? unit || t('Value') : `${t('Series')} ${index + 1}`))\n return <div className=\"dvui-table\"><table><thead><tr><th scope=\"col\" />{heads.map((head, index) => <th key={index} scope=\"col\" className=\"dvui-num\">{head}</th>)}</tr></thead><tbody>{categories.map((label, at) => <tr key={`${at}-${label}`}><th scope=\"row\">{label}</th>{series.map((item, index) => <td key={index} className=\"dvui-num\">{withUnit(item.values[at], series.length === 1 && !item.name ? '' : unit)}</td>)}</tr>)}</tbody></table></div>\n}\nexport function WidgetChart({ node, lookup, registerChart, refreshCharts, t = english }: { node: ViewNode; lookup: (name: string) => unknown; registerChart?: (key: string, handle: ChartHandle) => (() => void) | void; refreshCharts?: () => void; t?: ViewT }) {\n const data = chartData(node, lookup)\n const { kind, categories, series, unit } = data\n const box = useRef<HTMLElement>(null)\n const width = useWidth(box as React.RefObject<HTMLDivElement | null>, 520)\n const [active, setActive] = useState<number | null>(null)\n const [hidden, setHidden] = useState<number[]>([])\n const [asTable, setAsTable] = useState(false)\n const [copied, setCopied] = useState(false)\n const labelId = useId()\n const menuKey = useId()\n const table = useRef(asTable)\n table.current = asTable\n const shown = series.map((_, index) => !hidden.includes(index))\n const label = typeof node.caption === 'string' && node.caption !== '' ? node.caption : t('Chart')\n const isDonut = kind === 'donut'\n const legendBeside = isDonut && width >= 360\n const drawn = isDonut ? donut(data, legendBeside ? width - 200 : width, active, setActive) : kind === 'hbar' ? rows(data, width, active, shown) : columns(data, width, active, shown)\n const svgWidth = isDonut ? drawn.size! : width\n const move = (event: KeyboardEvent<SVGSVGElement>) => {\n const keys: Record<string, number> = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 }\n if (event.key === 'Escape') { setActive(null); return }\n if (keys[event.key] === undefined) return\n event.preventDefault()\n setActive(current => current === null ? 0 : (current + keys[event.key] + categories.length) % categories.length)\n }\n const point = active === null ? null : drawn.points[active]\n const share = (at: number) => unit === '%' ? withUnit(drawn.values![at], unit) : `${withUnit(drawn.values![at], unit)} · ${drawn.total! > 0 ? Math.round((drawn.values![at] / drawn.total!) * 100) : 0}%`\n const tipRows = active === null || isDonut ? [] : series.filter((_, index) => shown[index]).map(item => ({ color: item.color, name: item.name, value: withUnit(item.values[active], unit) }))\n const copy = () => {\n void navigator.clipboard?.writeText(chartCsv(data, t)).then(() => { setCopied(true); setTimeout(() => setCopied(false), 1200) }).catch(() => {})\n }\n const toggleTable = () => { table.current = !table.current; setAsTable(table.current) }\n const action = useRef<ChartHandle>({ label: null, asTable: false, toggleTable, copy })\n action.current = { label: typeof node.caption === 'string' && node.caption !== '' ? node.caption : null, get asTable() { return table.current }, toggleTable, copy }\n useLayoutEffect(() => registerChart?.(menuKey, { get label() { return action.current.label }, get asTable() { return action.current.asTable }, toggleTable: () => action.current.toggleTable(), copy: () => action.current.copy() }), [registerChart, menuKey])\n useLayoutEffect(() => { refreshCharts?.() }, [refreshCharts, asTable, label])\n const legend = isDonut\n ? <div className=\"dvui-chart-legend dvui-chart-legend-list\">{categories.map((name, at) => <div key={`${at}-${name}`} className=\"dvui-chart-key\" data-dim={active !== null && active !== at ? '' : undefined} onPointerEnter={() => setActive(at)} onPointerLeave={() => setActive(null)}><i style={{ background: colorAt(at) }} /><span className=\"dvui-chart-key-name\">{name}</span><span className=\"dvui-chart-key-value\">{share(at)}</span></div>)}</div>\n : series.length > 1 ? <div className=\"dvui-chart-legend\">{series.map((item, index) => <button key={`${index}-${item.name}`} type=\"button\" className=\"dvui-chart-key\" aria-pressed={shown[index]} onClick={() => setHidden(before => before.includes(index) ? before.filter(item => item !== index) : shown.filter(Boolean).length > 1 ? [...before, index] : before)}><i style={{ background: item.color }} />{item.name || `${t('Series')} ${index + 1}`}</button>)}</div> : null\n const plot = <div className=\"dvui-chart-plot\" style={isDonut ? { width: svgWidth } : undefined}>\n <svg className=\"dvui-chart-svg\" width={svgWidth} height={drawn.height} viewBox={`0 0 ${svgWidth} ${drawn.height}`} role=\"img\" aria-labelledby={labelId} tabIndex={0} onKeyDown={move} onBlur={() => setActive(null)} onPointerLeave={() => setActive(null)}>\n {drawn.parts}\n {isDonut ? (active === null\n ? <text className=\"dvui-chart-center\" x={svgWidth / 2} y={drawn.height / 2 + 5} textAnchor=\"middle\">{unit === '%' ? '' : withUnit(drawn.total!, unit)}</text>\n : <Fragment><text className=\"dvui-chart-center-name\" x={svgWidth / 2} y={drawn.height / 2 - 4} textAnchor=\"middle\">{fit(categories[active], drawn.size! * 0.56, LABEL)}</text><text className=\"dvui-chart-center\" x={svgWidth / 2} y={drawn.height / 2 + 14} textAnchor=\"middle\">{share(active)}</text></Fragment>)\n : drawn.hits.map((hit, at) => <rect key={`h${at}`} className=\"dvui-chart-hit\" x={hit.x} y={hit.y} width={hit.w} height={hit.h} onPointerEnter={() => setActive(at)} />)}\n </svg>\n {point && !asTable && !isDonut ? <div className=\"dvui-chart-tip\" role=\"status\" style={{ left: point.x, top: point.y } as CSSProperties}><b>{categories[active!]}</b>{tipRows.map((row, index) => <span key={index}><i style={{ background: row.color }} />{row.name ? `${row.name} ` : ''}{row.value}</span>)}</div> : null}\n </div>\n return <figure ref={box} className=\"dvui-chart\" data-kind={kind}>\n <span id={labelId} hidden>{label}</span>\n {asTable ? <ChartTable data={data} t={t} /> : isDonut ? <div className={legendBeside ? 'dvui-chart-donut dvui-chart-donut-beside' : 'dvui-chart-donut'} onPointerLeave={() => setActive(null)}>{plot}{legend}</div> : <Fragment>{legend}{plot}</Fragment>}\n {copied ? <span className=\"dvui-chart-copied\" role=\"status\">{t('Copied')}</span> : null}\n {typeof node.caption === 'string' && node.caption !== '' ? <figcaption className=\"dvui-caption\">{node.caption}</figcaption> : null}\n </figure>\n}\n","// Widget composition adapted from deep-view/src/react/card.js (Apache-2.0).\n// DSH migration: html/PNG export/Bot persistence are excluded. Local controls\n// remain live; only a supplied onSubmit callback may deliver an answer.\nimport { Fragment, useCallback, useEffect, useId, useRef, useState } from 'react'\nimport type { ComponentType } from 'react'\nimport { asText, choiceValue, inputDefault, resolve, viewInputs, viewScope } from './core/index.js'\nimport type { ViewNode } from './contracts.ts'\nimport { WidgetChart, type ChartHandle } from './chart.tsx'\nimport { CheckIcon, CopyIcon, DotsIcon, InfoIcon, LinkIcon, Segmented, TableIcon, english, keyLetter, type ViewT } from './ui.tsx'\n\n// Structural twin of the official MarkdownLabels: the widget layer stays\n// runtime-neutral, and any component accepting this shape (the official\n// MarkdownText included) is assignable.\nexport type MarkdownProps = { text: string; streaming?: boolean; labels: ViewLabels; variant?: 'body' | 'compact' }\nexport type ViewLabels = {\n code: { copyLabel: string; copiedLabel: string; toolbarLabels?: { codeLabel: string; wrapLabel: string; unwrapLabel: string } }\n footnotes: string\n}\nexport type Answer = { id: string; action: string; values: Record<string, unknown> }\nexport type WidgetCardProps = {\n title?: string\n view: ViewNode\n onSubmit?: (action: string, values: Record<string, unknown>) => void\n onDismiss?: () => void\n busy?: boolean\n settled?: boolean\n answer?: Answer | null\n t?: ViewT\n labels?: ViewLabels\n Markdown?: ComponentType<MarkdownProps>\n localOnly?: boolean\n}\ntype Ctx = {\n values: Record<string, unknown>\n setInput(id: string, value: unknown): void\n lookup(name: string): unknown\n locked: boolean\n answerLocked: boolean\n busy: boolean\n settled: boolean\n answer?: Answer | null\n onSubmit?: (action: string, values: Record<string, unknown>) => void\n registerChart(key: string, handle: ChartHandle): (() => void) | void\n refreshCharts(): void\n}\nconst TONES = ['good', 'warn', 'bad']\nconst CALLOUT_TONES = ['info', 'good', 'warn', 'bad']\nconst optionsOf = (node: ViewNode) => (Array.isArray(node.options) ? node.options : []) as { label: string; value?: string | number | boolean; description?: string }[]\nconst fieldsOf = (node: ViewNode) => (Array.isArray(node.fields) ? node.fields : [])\nconst cellText = (value: unknown) => value === null || value === undefined ? '' : typeof value === 'object' ? JSON.stringify(value) : asText(value)\nconst NUMERIC_CELL = /^[-+]?[\\d.,]+\\s?(%|[a-zA-Z]{1,4})?$/\nfunction hasType(node: ViewNode, types: Set<string>): boolean {\n return types.has(node.type) || (Array.isArray(node.children) && node.children.some(child => hasType(child, types)))\n}\nconst answerValues = (answer: Answer | null | undefined, node: ViewNode) => answer != null && answer.action === node.id ? answer.values : undefined\nconst withUnit = (value: unknown, unit?: string) => `${asText(value)}${unit ? ` ${unit}` : ''}`\nconst grouped = (value: unknown) => typeof value === 'number' && Number.isFinite(value) ? value.toLocaleString('en-US', { maximumFractionDigits: 6 }) : asText(value)\nfunction FallbackMarkdown({ text }: MarkdownProps) { return <span>{text}</span> }\n\nfunction OptionsInput({ node, ctx, t }: { node: ViewNode; ctx: Ctx; t: ViewT }) {\n const [picked, setPicked] = useState<string[]>([])\n const options = optionsOf(node)\n const multi = node.multi === true\n const choose = (label: string) => {\n if (ctx.answerLocked) return\n if (multi) setPicked(current => current.includes(label) ? current.filter(item => item !== label) : [...current, label])\n else ctx.onSubmit?.(node.id!, { selected: [label] })\n }\n const onKey = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const index = event.key.toUpperCase().charCodeAt(0) - 65\n if (index >= 0 && index < options.length && !event.ctrlKey && !event.metaKey && !event.altKey) { event.preventDefault(); choose(options[index].label) }\n }\n return <Fragment>\n <div className=\"dvui-options\" role=\"group\" aria-label={t('Options')} onKeyDown={onKey}>{options.map((option, index) => {\n const selected = multi && picked.includes(option.label)\n return <button key={option.label} type=\"button\" className=\"dvui-option\" disabled={ctx.answerLocked} aria-pressed={multi ? selected : undefined} aria-keyshortcuts={keyLetter(index).toLowerCase()} onClick={() => choose(option.label)}>\n <span className=\"dvui-key\" aria-hidden=\"true\">{keyLetter(index)}</span>\n <span className=\"dvui-option-body\"><span className=\"dvui-option-label\">{option.label}</span>{option.description ? <span className=\"dvui-option-desc\">{option.description}</span> : null}</span>\n {selected ? <span className=\"dvui-check\"><CheckIcon /></span> : null}\n </button>\n })}</div>\n {multi ? <div className=\"dvui-actions\"><button type=\"button\" className=\"dvui-submit\" disabled={ctx.answerLocked || picked.length === 0} onClick={() => ctx.onSubmit?.(node.id!, { selected: picked })}>{t('Submit')}</button></div> : null}\n </Fragment>\n}\nfunction SettledOptions({ node, answer, t }: { node: ViewNode; answer?: Answer | null; t: ViewT }) {\n const selected = answerValues(answer, node)?.selected\n const chosen = Array.isArray(selected) ? selected : []\n return <div className=\"dvui-options\" role=\"group\" aria-label={t('Your answer')}>{optionsOf(node).map(option => <div key={option.label} className=\"dvui-option\"><span className=\"dvui-option-body\"><span className=\"dvui-option-label\">{option.label}</span>{option.description ? <span className=\"dvui-option-desc\">{option.description}</span> : null}</span>{chosen.includes(option.label) ? <span className=\"dvui-check\" role=\"img\" aria-label={t('Selected')}><CheckIcon /></span> : null}</div>)}</div>\n}\nfunction ConfirmInput({ node, ctx, t }: { node: ViewNode; ctx: Ctx; t: ViewT }) {\n return <div className=\"dvui-actions\"><button type=\"button\" className=\"dvui-button\" disabled={ctx.answerLocked} onClick={() => ctx.onSubmit?.(node.id!, { confirmed: false })}>{node.cancelLabel ?? t('Cancel')}</button><button type=\"button\" className=\"dvui-submit\" disabled={ctx.answerLocked} onClick={() => ctx.onSubmit?.(node.id!, { confirmed: true })}>{node.confirmLabel ?? t('Confirm')}</button></div>\n}\nfunction SettledConfirm({ node, answer, t }: { node: ViewNode; answer?: Answer | null; t: ViewT }) {\n const confirmed = answerValues(answer, node)?.confirmed\n if (typeof confirmed !== 'boolean') return <ConfirmInput node={node} ctx={{ answerLocked: true } as Ctx} t={t} />\n return <span className=\"dvui-badge\">{confirmed ? node.confirmLabel ?? t('Confirm') : node.cancelLabel ?? t('Cancel')}</span>\n}\nfunction FormInput({ node, ctx, t }: { node: ViewNode; ctx: Ctx; t: ViewT }) {\n const fields = fieldsOf(node)\n const [draft, setDraft] = useState<Record<string, string>>({})\n const submit = () => { if (!ctx.answerLocked) ctx.onSubmit?.(node.id!, { fields: Object.fromEntries(fields.map(field => [field.id, draft[field.id] ?? ''])) }) }\n return <form className=\"dvui-form\" onSubmit={event => { event.preventDefault(); submit() }}>{fields.map(field => <label key={field.id} className=\"dvui-field\"><span className=\"dvui-field-label\">{field.label}</span><input className=\"dvui-input\" type=\"text\" value={draft[field.id] ?? ''} autoComplete=\"off\" spellCheck={false} readOnly={ctx.answerLocked} aria-label={field.label} placeholder={field.placeholder} onChange={event => setDraft(current => ({ ...current, [field.id]: event.target.value }))} /></label>)}<div className=\"dvui-actions\"><button type=\"submit\" className=\"dvui-submit\" disabled={ctx.answerLocked}>{node.submitLabel ?? t('Submit')}</button></div></form>\n}\nfunction SettledForm({ node, answer }: { node: ViewNode; answer?: Answer | null }) {\n const fields = answerValues(answer, node)?.fields\n const values = fields !== null && typeof fields === 'object' ? fields as Record<string, unknown> : {}\n return <div className=\"dvui-form\">{fieldsOf(node).map(field => <label key={field.id} className=\"dvui-field\"><span className=\"dvui-field-label\">{field.label}</span><input className=\"dvui-input\" value={String(values[field.id] ?? '')} disabled readOnly aria-label={field.label} /></label>)}</div>\n}\nfunction WidgetTable({ node, lookup }: { node: ViewNode; lookup: (name: string) => unknown }) {\n const columns = Array.isArray(node.columns) ? node.columns : []\n const rows = (Array.isArray(node.rows) ? node.rows : []).map(row => (Array.isArray(row) ? row : []).map(cell => resolve(cell, lookup, '')))\n const numeric = columns.map((_, index) => {\n const cells = rows.map(row => row[index]).filter(cell => cell !== undefined && cell !== '')\n return cells.length > 0 && cells.every(cell => typeof cell === 'number' || (typeof cell === 'string' && NUMERIC_CELL.test(cell.trim())))\n })\n return <div className=\"dvui-table\"><table><thead><tr>{columns.map((column, index) => <th key={column.key ?? index} scope=\"col\" className={numeric[index] ? 'dvui-num' : undefined}>{column.label}</th>)}</tr></thead><tbody>{rows.map((row, rowIndex) => <tr key={rowIndex}>{columns.map((column, index) => <td key={column.key ?? index} className={numeric[index] ? 'dvui-num' : undefined}>{cellText(row[index])}</td>)}</tr>)}</tbody></table></div>\n}\nfunction WidgetProgress({ node, lookup, t }: { node: ViewNode; lookup: (name: string) => unknown; t: ViewT }) {\n let percent: number\n if (node.percent !== undefined) percent = Number(resolve(node.percent, lookup, 0))\n else {\n const max = Number(resolve(node.max, lookup, 0))\n percent = max > 0 ? (Number(resolve(node.value, lookup, 0)) / max) * 100 : 0\n }\n percent = Math.max(0, Math.min(100, Number.isFinite(percent) ? percent : 0))\n const tone = resolve(node.tone, lookup)\n const right = node.valueLabel !== undefined ? asText(resolve(node.valueLabel, lookup, '')) : `${Math.round(percent)}%`\n return <div className=\"dvui-progress\" data-tone={TONES.includes(String(tone)) ? String(tone) : undefined}><span className=\"dvui-progress-label\"><span>{node.label}</span><span>{right}</span></span><div className=\"dvui-progress-track\" role=\"progressbar\" aria-valuenow={Math.round(percent)} aria-valuemin={0} aria-valuemax={100} aria-label={node.label ?? t('Progress')} aria-valuetext={right}><div className=\"dvui-progress-fill\" style={{ width: `${percent}%` }} /></div></div>\n}\nfunction WidgetMetric({ node, lookup }: { node: ViewNode; lookup: (name: string) => unknown }) {\n const tone = resolve(node.tone, lookup)\n const caption = node.caption === undefined ? '' : asText(resolve(node.caption, lookup, ''))\n return <div className=\"dvui-metric\" data-tone={TONES.includes(String(tone)) ? String(tone) : undefined}><span className=\"dvui-metric-label\">{node.label}</span><span className=\"dvui-metric-value\">{asText(resolve(node.value, lookup, '—'))}</span>{caption !== '' ? <span className=\"dvui-caption\">{caption}</span> : null}</div>\n}\nfunction WidgetCallout({ node, lookup, Markdown, labels }: { node: ViewNode; lookup: (name: string) => unknown; Markdown: ComponentType<MarkdownProps>; labels: ViewLabels }) {\n const tone = resolve(node.tone, lookup)\n return <div className=\"dvui-callout\" data-tone={CALLOUT_TONES.includes(String(tone)) ? String(tone) : 'info'}><span className=\"dvui-callout-icon\" aria-hidden=\"true\"><InfoIcon /></span><div><Markdown text={asText(resolve(node.text, lookup, ''))} labels={labels} variant=\"compact\" /></div></div>\n}\nfunction WidgetSources({ node, t }: { node: ViewNode; t: ViewT }) {\n return <div className=\"dvui-sources\" role=\"list\" aria-label={t('Sources')}>{(node.items ?? []).map((item, index) => <a key={`${item.url}-${index}`} role=\"listitem\" className=\"dvui-source\" href={item.url} target=\"_blank\" rel=\"noopener noreferrer\" title={item.url}><LinkIcon />{item.label}</a>)}</div>\n}\nfunction InputHead({ id, label, value }: { id: string; label?: string; value?: string }) {\n return <div className=\"dvui-input-head\"><label htmlFor={id} className=\"dvui-input-label\">{label}</label>{value !== undefined ? <output htmlFor={id} className=\"dvui-input-value\">{value}</output> : null}</div>\n}\nconst numericBound = (bound: unknown) => typeof bound === 'number' && Number.isFinite(bound) ? bound : typeof bound === 'string' && bound.trim() !== '' && Number.isFinite(Number(bound)) ? Number(bound) : undefined\nfunction SliderInput({ node, ctx }: { node: ViewNode; ctx: Ctx }) {\n const id = useId()\n const value = Number(ctx.values[node.id!])\n // Validation guarantees numeric min/max; resolve any stray non-numeric bound defensively.\n const min = numericBound(resolve(node.min, ctx.lookup, undefined))\n const max = numericBound(resolve(node.max, ctx.lookup, undefined))\n const percent = min !== undefined && max !== undefined && max > min ? ((value - min) / (max - min)) * 100 : 0\n return <div className=\"dvui-input-row\"><InputHead id={id} label={node.label} value={withUnit(grouped(value), node.unit)} /><input id={id} type=\"range\" className=\"dvui-range\" min={min} max={max} step={node.step ?? 'any'} value={value} disabled={ctx.locked} style={{ '--_dvui-fill': `${percent}%` } as React.CSSProperties} onChange={event => ctx.setInput(node.id!, Number(event.target.value))} /></div>\n}\nfunction NumberInput({ node, ctx }: { node: ViewNode; ctx: Ctx }) {\n const id = useId()\n const [draft, setDraft] = useState<string | null>(null)\n const value = ctx.values[node.id!]\n const min = numericBound(resolve(node.min, ctx.lookup, undefined))\n const max = numericBound(resolve(node.max, ctx.lookup, undefined))\n return <div className=\"dvui-input-row\"><InputHead id={id} label={node.label} /><span className=\"dvui-number\"><input id={id} className=\"dvui-input\" type=\"number\" inputMode=\"decimal\" value={draft ?? asText(value)} min={min} max={max} step={node.step ?? 'any'} disabled={ctx.locked} onChange={event => {\n const raw = event.target.value\n setDraft(raw)\n const next = Number(raw)\n if (raw.trim() === '' || !Number.isFinite(next) || (min !== undefined && next < min) || (max !== undefined && next > max)) return\n ctx.setInput(node.id!, next)\n }} onBlur={() => setDraft(null)} />{node.unit ? <span className=\"dvui-unit\">{node.unit}</span> : null}</span></div>\n}\nfunction ChoiceInput({ node, ctx }: { node: ViewNode; ctx: Ctx }) {\n const labelId = useId()\n const options = optionsOf(node)\n const current = ctx.values[node.id!]\n const side = options.length <= 4 && options.every(option => [...option.label].length <= 14)\n return <div className=\"dvui-input-row\"><span className=\"dvui-input-label\" id={labelId}>{node.label}</span>{side\n ? <Segmented label={node.label ?? ''} value={options.findIndex(option => choiceValue(option) === current)} className=\"dvui-choice-seg\">{options.map(option => <button key={option.label} type=\"button\" aria-pressed={choiceValue(option) === current} disabled={ctx.locked} onClick={() => ctx.setInput(node.id!, choiceValue(option))}>{option.label}</button>)}</Segmented>\n : <div className=\"dvui-radios\" role=\"radiogroup\" aria-labelledby={labelId}>{options.map(option => <button key={option.label} type=\"button\" role=\"radio\" className=\"dvui-radio\" aria-checked={choiceValue(option) === current} disabled={ctx.locked} onClick={() => ctx.setInput(node.id!, choiceValue(option))}><span className=\"dvui-radio-dot\" aria-hidden=\"true\" />{option.label}</button>)}</div>}</div>\n}\nfunction ToggleInput({ node, ctx }: { node: ViewNode; ctx: Ctx }) {\n const on = ctx.values[node.id!] === true\n return <div className=\"dvui-toggle\"><span className=\"dvui-input-label\">{node.label}</span><button type=\"button\" role=\"switch\" className=\"dvui-switch\" aria-checked={on} aria-label={node.label} disabled={ctx.locked} onClick={() => ctx.setInput(node.id!, !on)}><span className=\"dvui-switch-knob\" aria-hidden=\"true\" /></button></div>\n}\nfunction WidgetNode({ node, ctx, Markdown, labels, t }: { node: ViewNode; ctx: Ctx; Markdown: ComponentType<MarkdownProps>; labels: ViewLabels; t: ViewT }) {\n const { lookup } = ctx\n switch (node.type) {\n case 'stack': case 'row': return <div className={node.type === 'row' ? 'dvui-row' : 'dvui-stack'}>{(node.children ?? []).map((child, index) => <WidgetNode key={child.id ?? `${child.type}-${index}`} node={child} ctx={ctx} Markdown={Markdown} labels={labels} t={t} />)}</div>\n case 'text': {\n const text = <Markdown text={asText(resolve(node.text, lookup, ''))} labels={labels} variant=\"compact\" />\n return node.tone === 'muted' ? <div className=\"dvui-muted\">{text}</div> : text\n }\n case 'metric': return <WidgetMetric node={node} lookup={lookup} />\n case 'table': return <WidgetTable node={node} lookup={lookup} />\n case 'chart': return <WidgetChart node={node} lookup={lookup} registerChart={ctx.registerChart} refreshCharts={ctx.refreshCharts} t={t} />\n case 'progress': return <WidgetProgress node={node} lookup={lookup} t={t} />\n case 'callout': return <WidgetCallout node={node} lookup={lookup} Markdown={Markdown} labels={labels} />\n case 'sources': return <WidgetSources node={node} t={t} />\n case 'slider': return <SliderInput node={node} ctx={ctx} />\n case 'number': return <NumberInput node={node} ctx={ctx} />\n case 'choice': return <ChoiceInput node={node} ctx={ctx} />\n case 'toggle': return <ToggleInput node={node} ctx={ctx} />\n case 'submit': return ctx.settled ? null : <div className=\"dvui-actions\"><button type=\"button\" className=\"dvui-submit\" disabled={ctx.answerLocked} onClick={() => ctx.onSubmit?.(node.id!, {})}>{node.label || t('Send')}</button></div>\n case 'options': return ctx.settled ? <SettledOptions node={node} answer={ctx.answer} t={t} /> : <OptionsInput node={node} ctx={ctx} t={t} />\n case 'confirm': return ctx.settled ? <SettledConfirm node={node} answer={ctx.answer} t={t} /> : <ConfirmInput node={node} ctx={ctx} t={t} />\n case 'form': return ctx.settled ? <SettledForm node={node} answer={ctx.answer} /> : <FormInput node={node} ctx={ctx} t={t} />\n default: return null\n }\n}\nexport function WidgetView({ view, onSubmit, settled = false, answer = null, busy = false, registerChart, refreshCharts, t = english, labels = { code: { copyLabel: 'Copy', copiedLabel: 'Copied' }, footnotes: 'Footnotes' }, Markdown = FallbackMarkdown }: Omit<WidgetCardProps, 'title'> & { registerChart: Ctx['registerChart']; refreshCharts: () => void }) {\n const inputs = viewInputs(view) as ViewNode[]\n const [values, setValues] = useState<Record<string, unknown>>(() => Object.fromEntries(inputs.map(node => [node.id, inputDefault(node)])))\n const sent = answer?.values?.inputs\n const current = settled && sent !== null && typeof sent === 'object' ? { ...values, ...sent } : values\n const submit = (action: string, extra: Record<string, unknown>) => onSubmit?.(action, inputs.length > 0 ? { ...extra, inputs: current } : extra)\n const ctx: Ctx = {\n onSubmit: submit, settled, answer, busy, lookup: viewScope(view, current), values: current, locked: settled || busy, answerLocked: settled || busy || onSubmit === undefined,\n setInput: (id, value) => setValues(before => ({ ...before, [id]: value })), registerChart, refreshCharts,\n }\n return <WidgetNode node={view} ctx={ctx} Markdown={Markdown} labels={labels} t={t} />\n}\nfunction useChartHandles() {\n const [, bump] = useState(0)\n const charts = useRef(new Map<string, ChartHandle>())\n const refreshCharts = useCallback(() => bump(value => value + 1), [])\n const registerChart = useCallback((key: string, handle: ChartHandle) => {\n charts.current.set(key, handle)\n refreshCharts()\n return () => { charts.current.delete(key); refreshCharts() }\n }, [refreshCharts])\n return { charts: [...charts.current.values()], registerChart, refreshCharts }\n}\nfunction ViewMenu({ charts, t }: { charts: ChartHandle[]; t: ViewT }) {\n const [open, setOpen] = useState(false)\n const root = useRef<HTMLDivElement>(null)\n useEffect(() => {\n if (!open) return undefined\n const away = (event: PointerEvent) => { if (!root.current?.contains(event.target as Node)) setOpen(false) }\n const key = (event: KeyboardEvent) => { if (event.key === 'Escape') setOpen(false) }\n document.addEventListener('pointerdown', away, true)\n document.addEventListener('keydown', key)\n return () => { document.removeEventListener('pointerdown', away, true); document.removeEventListener('keydown', key) }\n }, [open])\n return <div ref={root} className=\"dvui-tools\" data-open={open ? '' : undefined}><button type=\"button\" className=\"dvui-more\" aria-label={t('Chart options')} aria-haspopup=\"menu\" aria-expanded={open} onClick={() => setOpen(value => !value)}><DotsIcon /></button>{open ? <div className=\"dvui-menu\" role=\"menu\">{charts.map((chart, index) => <Fragment key={`${chart.label}-${index}`}>{charts.length > 1 ? <div className=\"dvui-menu-label\">{chart.label ?? t('Chart {n}', { n: index + 1 })}</div> : null}<button type=\"button\" role=\"menuitem\" onClick={() => { setOpen(false); chart.toggleTable() }}><TableIcon />{chart.asTable ? t('View as chart') : t('View as table')}</button><button type=\"button\" role=\"menuitem\" onClick={() => { setOpen(false); chart.copy() }}><CopyIcon />{t('Copy data')}</button></Fragment>)}</div> : null}</div>\n}\nexport function WidgetCard({ title = '', view, onSubmit, onDismiss, busy = false, settled = false, answer = null, t = english, labels, Markdown, localOnly = false }: WidgetCardProps) {\n const titleId = useId()\n const { charts, registerChart, refreshCharts } = useChartHandles()\n const framed = hasType(view, new Set(['slider', 'number', 'choice', 'toggle', 'options', 'confirm', 'form', 'submit']))\n return <div className={`dvui-view ${framed ? 'dvui-framed' : 'dvui-bare'}${settled ? ' dvui-settled' : ''}`} role=\"group\" aria-labelledby={title ? titleId : undefined} aria-label={title ? undefined : t('View')} aria-busy={busy || undefined}>\n {title || onDismiss || charts.length > 0 ? <div className=\"dvui-head\"><p className=\"dvui-title\" id={titleId}>{title}</p>{charts.length > 0 ? <ViewMenu charts={charts} t={t} /> : null}{onDismiss ? <button type=\"button\" className=\"dvui-dismiss\" aria-label={t('Dismiss view')} onClick={onDismiss} disabled={busy}>×</button> : null}</div> : null}\n <div className=\"dvui-body\"><WidgetView view={view} onSubmit={onSubmit} settled={settled} answer={answer} busy={busy} registerChart={registerChart} refreshCharts={refreshCharts} t={t} labels={labels} Markdown={Markdown} /></div>\n {localOnly && hasType(view, new Set(['options', 'confirm', 'form', 'submit'])) ? <p className=\"dvui-local-note\" role=\"note\">{t('Local preview only; this card does not send an answer.')}</p> : null}\n </div>\n}\n"],"mappings":";;;;AAIA,MAAa,WAAkB,KAAK,WAAW,IAAI,QAAQ,eAAe,GAAG,SAAS,OAAO,SAAS,SAAS,IAAI,KAAK,EAAE,CAAC;AAE3H,SAAgB,SAAS,EAAE,SAA8B;CACvD,OAAO,oBAAC,OAAD;EAAK,OAAM;EAAK,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EAAU;EAAW;EAAW;EAAQ;CAAQ,CAAC,CAAC;CACtH,OAAO,qBAAC,OAAD;EAAK,WAAW,aAAa,SAAS,gBAAgB,cAAc,UAAU,kBAAkB;EAAM,MAAK;EAAQ,mBAAiB,QAAQ,UAAU,KAAA;EAAW,cAAY,QAAQ,KAAA,IAAY,EAAE,MAAM;EAAG,aAAW,QAAQ,KAAA;EAA/N,UAAA;GACJ,SAAS,aAAa,OAAO,SAAS,IAAI,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KAA2B,oBAAC,KAAD;MAAG,WAAU;MAAa,IAAI;MAAU,UAAA;KAAS,CAAA;KAAE,OAAO,SAAS,IAAI,oBAAC,UAAD;MAAkB;MAAW;KAAI,CAAA,IAAI;KAAM,YAAY,oBAAC,UAAD;MAAQ,MAAK;MAAS,WAAU;MAAe,cAAY,EAAE,cAAc;MAAG,SAAS;MAAW,UAAU;MAAM,UAAA;KAAS,CAAA,IAAI;IAAU;GAAI,CAAA,IAAA;GACjV,oBAAC,OAAD;IAAK,WAAU;IAAY,UAAA,oBAAC,YAAD;KAAkB;KAAgB;KAAmB;KAAiB;KAAc;KAAqB;KAA8B;KAAkB;KAAW;KAAkB;IAAW,CAAA;GAAM,CAAA;GACjO,aAAa,QAAQ,sBAAM,IAAI,IAAI;IAAC;IAAW;IAAW;IAAQ;GAAQ,CAAC,CAAC,IAAI,oBAAC,KAAD;IAAG,WAAU;IAAkB,MAAK;IAAQ,UAAA,EAAE,wDAAwD;GAAK,CAAA,IAAI;EAC7L;;AACP"}
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Deep View reply cards",
4
+ "description": "Charts, metrics, tables and safe local inputs in replies, with validated answers to show_view cards."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Deep View 回复卡片",
4
+ "description": "在回复中展示图表、指标、表格和安全联动的本地输入;show_view 可接收已校验的用户回答。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,154 @@
1
1
  {
2
2
  "name": "@klarkxy/dsh-deep-view",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Declarative reply cards with charts, safe formulas, local inputs and validated show_view answers.",
5
+ "icon": "./icon.svg",
6
+ "license": "Apache-2.0",
7
+ "type": "module",
8
+ "engines": {
9
+ "node": ">=22",
10
+ "dsh": ">=0.2.1-rc.1"
11
+ },
12
+ "main": "./lib/index.js",
13
+ "types": "./lib/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./lib/index.d.ts",
17
+ "import": "./lib/index.js",
18
+ "default": "./lib/index.js"
19
+ },
20
+ "./client": {
21
+ "default": "./lib/client.js"
22
+ },
23
+ "./contracts": {
24
+ "types": "./lib/contracts.d.ts",
25
+ "import": "./lib/contracts.js",
26
+ "default": "./lib/contracts.js"
27
+ },
28
+ "./core": {
29
+ "types": "./lib/core.d.ts",
30
+ "import": "./lib/core.js",
31
+ "default": "./lib/core.js"
32
+ },
33
+ "./answer-text": {
34
+ "types": "./lib/answer-text.d.ts",
35
+ "import": "./lib/answer-text.js",
36
+ "default": "./lib/answer-text.js"
37
+ },
38
+ "./answers": {
39
+ "types": "./lib/answers.d.ts",
40
+ "import": "./lib/answers.js",
41
+ "default": "./lib/answers.js"
42
+ },
43
+ "./widget": {
44
+ "types": "./lib/widget.d.ts",
45
+ "import": "./lib/widget.js",
46
+ "default": "./lib/widget.js"
47
+ },
48
+ "./copy": {
49
+ "types": "./lib/copy.d.ts",
50
+ "import": "./lib/copy.js",
51
+ "default": "./lib/copy.js"
52
+ },
53
+ "./icon": "./icon.svg",
54
+ "./package.json": "./package.json",
55
+ "./locale/*.json": "./locale/*.json"
56
+ },
57
+ "files": [
58
+ "lib",
59
+ "icon.svg",
60
+ "locale/*.json",
61
+ "cordis.patch.yml",
62
+ "README.md",
63
+ "docs/README.zh-CN.md",
64
+ "LICENSE",
65
+ "NOTICE"
66
+ ],
67
+ "dsh": {
68
+ "bundle": {
69
+ "patch": "./cordis.patch.yml"
70
+ },
71
+ "client": {
72
+ "platform": "web",
73
+ "inject": [
74
+ "@deepseek-ai/dsh-client-connection",
75
+ "@deepseek-ai/dsh-client-locale",
76
+ "@deepseek-ai/dsh-client-ui-slots",
77
+ "@deepseek-ai/dsh-client-ui-session",
78
+ "@deepseek-ai/dsh-client-ui-conversation",
79
+ "@deepseek-ai/dsh-client-ui-chat",
80
+ "@deepseek-ai/dsh-client-ui-primitives"
81
+ ]
82
+ }
83
+ },
84
+ "scripts": {
85
+ "build": "tsdown && node ../../scripts/editor-plugins/wrap-client.mjs @klarkxy/dsh-deep-view",
86
+ "typecheck": "tsc --noEmit -p tsconfig.json",
87
+ "test": "vitest run --root ../.. --config vitest.editor-plugins.config.ts --maxWorkers=2 plugins/dsh-deep-view/src"
88
+ },
89
+ "dependencies": {
90
+ "@klarkxy/dsh-plugin-kit": "0.8.0"
91
+ },
92
+ "peerDependencies": {
93
+ "@deepseek-ai/cordis": ">=4.0.4",
94
+ "@deepseek-ai/dsh-agent": ">=0.2.1-rc.1",
95
+ "@deepseek-ai/dsh-llm": ">=0.2.1-rc.1",
96
+ "@deepseek-ai/dsh-session": ">=0.2.1-rc.1",
97
+ "@deepseek-ai/dsh-tools": ">=0.2.1-rc.1"
98
+ },
99
+ "peerDependenciesMeta": {
100
+ "@deepseek-ai/cordis": {
101
+ "optional": true
102
+ },
103
+ "@deepseek-ai/dsh-agent": {
104
+ "optional": true
105
+ },
106
+ "@deepseek-ai/dsh-llm": {
107
+ "optional": true
108
+ },
109
+ "@deepseek-ai/dsh-session": {
110
+ "optional": true
111
+ },
112
+ "@deepseek-ai/dsh-tools": {
113
+ "optional": true
114
+ }
115
+ },
116
+ "devDependencies": {
117
+ "@deepseek-ai/cordis": "4.1.0",
118
+ "@deepseek-ai/dsh-agent": "0.2.2-rc.1",
119
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.1",
120
+ "@deepseek-ai/dsh-session": "0.2.2-rc.1",
121
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.1",
122
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.1",
123
+ "react": "^18.2.0",
124
+ "react-dom": "^18.2.0",
125
+ "@types/react": "18.3.31",
126
+ "@types/react-dom": "^18.3.0",
127
+ "jsdom": "29.1.1",
128
+ "@types/jsdom": "28.0.3"
129
+ },
130
+ "keywords": [
131
+ "dsh",
132
+ "dsh-plugin",
133
+ "deepseek-harness-plugin",
134
+ "charts",
135
+ "widgets",
136
+ "markdown"
137
+ ],
138
+ "repository": {
139
+ "type": "git",
140
+ "url": "git+https://github.com/klarkxy/dsh-plugins.git",
141
+ "directory": "plugins/dsh-deep-view"
142
+ },
143
+ "homepage": "https://klarkxy.github.io/dsh-plugins/plugins/deep-view/",
144
+ "bugs": {
145
+ "url": "https://github.com/klarkxy/dsh-plugins/issues"
146
+ },
147
+ "publishConfig": {
148
+ "access": "public",
149
+ "registry": "https://registry.npmjs.org/"
150
+ },
151
+ "dshRelease": {
152
+ "contentHash": "9d8a49647bf01ffd956e64939ed159b56812d7c372a78bf5e44affc1b27eee62"
153
+ }
154
+ }