structured-context-map-views 0.5.0 → 0.6.1

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.
@@ -1,4 +1,4 @@
1
- import { i as treeLinks, n as buildLandscape, o as filterAnnotations, r as buildTree, s as worstSeverity, t as buildXYPlot } from "./projection-CYShQhug.js";
1
+ import { i as treeLinks, n as buildLandscape, o as filterAnnotations, r as buildTree, s as worstSeverity, t as buildXYPlot } from "./projection-C-dATsdO.js";
2
2
  import { a as resolveRegions, i as resolveParameterValues } from "./definition-Cp1CCigh.js";
3
3
  import { createContext, useCallback, useContext, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -664,4 +664,4 @@ function ParameterControls({ definition, values, onChange }) {
664
664
  //#endregion
665
665
  export { SelectParameterInput as a, ParameterInput as i, useParameterControls as n, ToggleParameterInput as o, MultiSelectParameterInput as r, MapView as s, ParameterControls as t };
666
666
 
667
- //# sourceMappingURL=ParameterControls--sD0-okx.js.map
667
+ //# sourceMappingURL=ParameterControls-A1HJWyt9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ParameterControls--sD0-okx.js","names":["_Fragment"],"sources":["../src/layouts/annotations-context.ts","../src/layouts/NodeCard.tsx","../src/layouts/LandscapeLayout.tsx","../src/layouts/EdgeOverlay.tsx","../src/layouts/TreeLayout.tsx","../src/layouts/XYLayout.tsx","../src/layouts/MapView.tsx","../src/layouts/ParameterInputs.tsx","../src/layouts/useParameterControls.ts","../src/layouts/ParameterControls.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { AnnotationIndex } from '../core/annotations';\n\nconst NONE: AnnotationIndex = new Map();\n\n/** The annotations a map view shows, already narrowed by its validation settings. Read by node cards. */\nexport const AnnotationsContext = createContext<AnnotationIndex>(NONE);\n\nexport const useAnnotations = () => useContext(AnnotationsContext);\n","import type { SpaceNode } from 'structured-context/api';\nimport { type NodeAnnotation, type Severity, worstSeverity } from '../core/annotations';\nimport type { NodesConfig } from '../core/definition';\nimport { useAnnotations } from './annotations-context';\n\ntype Props = {\n node: SpaceNode;\n /** The node's subtree is rendered at another occurrence. */\n repeat: boolean;\n nodes: NodesConfig;\n onSelect?: (node: SpaceNode) => void;\n};\n\n/**\n * A clickable node, drawn as a card (title plus selected fields) or a compact shape with a\n * tooltip. Deliberately a `div` with button semantics rather than a `<button>`: hosts style\n * native form controls globally (Obsidian fixes button height and disables wrapping).\n */\nexport function NodeCard({ node, repeat, nodes, onSelect }: Props) {\n const select = () => onSelect?.(node);\n const annotations = useAnnotations().get(node.id);\n const label = `${node.resolvedType}: ${node.title}${repeat ? ' (shown in full elsewhere)' : ''}${annotationsLabel(annotations)}`;\n const onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n select();\n }\n };\n const border = repeat ? 'mv:border-dashed mv:border-muted/60 mv:opacity-75' : 'mv:border-edge';\n\n if (nodes.style === 'shape') {\n // 24px: the minimum target size for pointer input (WCAG 2.2 AA). The type's initial is the\n // visible cue; the full type and title are in the tooltip and accessible name.\n return (\n // biome-ignore lint/a11y/useSemanticElements: a native button inherits host button styles.\n <div\n role=\"button\"\n tabIndex={0}\n title={label}\n data-node-id={node.id}\n onClick={select}\n onKeyDown={onKeyDown}\n aria-label={label}\n className={`mv:relative mv:flex mv:size-6 mv:cursor-pointer mv:items-center mv:justify-center mv:rounded-full mv:border-2 mv:bg-card mv:text-[0.65rem] mv:font-semibold mv:uppercase mv:text-muted mv:hover:border-accent mv:focus-visible:outline-2 mv:focus-visible:outline-accent ${border}`}\n >\n <span aria-hidden=\"true\">{node.resolvedType.charAt(0)}</span>\n <AnnotationBadge annotations={annotations} />\n </div>\n );\n }\n\n const fields = nodes.fields\n .map((field) => [field, formatValue(node.schemaData[field])] as const)\n .filter(([, value]) => value !== undefined);\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: a native button inherits host button styles.\n <div\n role=\"button\"\n tabIndex={0}\n title={label}\n data-node-id={node.id}\n onClick={select}\n onKeyDown={onKeyDown}\n className={`mv:relative mv:w-44 mv:cursor-pointer mv:rounded-md mv:border mv:bg-card mv:px-2.5 mv:py-1.5 mv:text-left mv:shadow-sm mv:hover:border-accent mv:focus-visible:outline-2 mv:focus-visible:outline-accent ${border}`}\n >\n <span className=\"mv:block mv:text-[0.65rem] mv:uppercase mv:tracking-wide mv:text-muted\">\n {node.resolvedType}\n {repeat && ' · repeat'}\n </span>\n <span className=\"mv:block mv:text-sm mv:leading-snug\">{node.title}</span>\n {fields.length > 0 && (\n <dl className=\"mv:m-0 mv:mt-1 mv:text-xs mv:text-muted\">\n {fields.map(([field, value]) => (\n <div key={field} className=\"mv:flex mv:gap-1\">\n <dt className=\"mv:shrink-0\">{field}:</dt>\n <dd className=\"mv:m-0 mv:truncate mv:text-ink\">{value}</dd>\n </div>\n ))}\n </dl>\n )}\n <AnnotationBadge annotations={annotations} />\n </div>\n );\n}\n\nconst BADGE: Record<Severity, string> = {\n error: 'mv:bg-error',\n warning: 'mv:bg-warning',\n info: 'mv:bg-info',\n};\n\n/** A count of the node's validation results in the corner, coloured by the most serious. Decorative: the count is in the card's label. */\nfunction AnnotationBadge({ annotations }: { annotations: readonly NodeAnnotation[] | undefined }) {\n const worst = annotations && worstSeverity(annotations);\n if (!annotations || !worst) return null;\n return (\n <span\n aria-hidden=\"true\"\n className={`mv:absolute mv:-top-1.5 mv:-right-1.5 mv:flex mv:h-4 mv:min-w-4 mv:items-center mv:justify-center mv:rounded-full mv:px-1 mv:text-[0.6rem] mv:font-semibold mv:text-white ${BADGE[worst]}`}\n >\n {annotations.length}\n </span>\n );\n}\n\nfunction annotationsLabel(annotations: readonly NodeAnnotation[] | undefined): string {\n const worst = annotations && worstSeverity(annotations);\n if (!annotations || !worst) return '';\n return ` (${annotations.length} validation ${annotations.length === 1 ? 'result' : 'results'}, most serious: ${worst})`;\n}\n\nfunction formatValue(value: unknown): string | undefined {\n if (value === undefined || value === null || value === '') return undefined;\n if (Array.isArray(value)) return value.map(String).join(', ');\n if (typeof value === 'object') return JSON.stringify(value);\n return String(value);\n}\n","import { useMemo } from 'react';\nimport type { SpaceNode } from 'structured-context/api';\nimport type { LandscapeLayoutConfig, Orientation } from '../core/definition';\nimport { buildLandscape, type LandscapeOccurrence } from '../core/landscape';\nimport { NodeCard } from './NodeCard';\nimport type { LayoutProps } from './TreeLayout';\n\n/**\n * Nested containers following the layout's grouping levels; the last level is drawn as nodes.\n * Flexbox does the nesting and wrapping. Containment shows the grouping edges, so no connectors\n * are drawn. PROTOTYPE: `edges.show` has no effect here; other edges aren't drawn yet.\n */\nexport function LandscapeLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<LandscapeLayoutConfig>) {\n const { layout } = region;\n const landscape = useMemo(() => buildLandscape(graph, region.id, layout), [graph, region.id, layout]);\n const last = layout.group.length - 1;\n\n const breadcrumb = (occurrence: LandscapeOccurrence) => {\n const level = layout.group[occurrence.level];\n if (!level || !('type' in level) || level.intermediate !== 'breadcrumb') return null;\n const steps = occurrence.via.filter((step) => step.nodes.length > 0);\n if (steps.length === 0) return null;\n return (\n <span className=\"mv:block mv:max-w-44 mv:text-[0.65rem] mv:leading-tight mv:text-muted\">\n via {steps.map((step) => step.nodes.map((n) => n.title).join(', ')).join(' › ')}\n </span>\n );\n };\n\n const render = (occurrence: LandscapeOccurrence, direction: Orientation): React.ReactNode => {\n const repeat = occurrence.repeatOf !== undefined;\n const marker = { 'data-occurrence': `${instanceId}${occurrence.key}` };\n\n if (occurrence.item.kind === 'node' && occurrence.level === last) {\n return (\n <li key={occurrence.key} {...marker} className=\"mv:flex mv:flex-col mv:gap-0.5\">\n <NodeCard node={occurrence.item.node} repeat={repeat} nodes={region.nodes} onSelect={onNodeSelect} />\n {breadcrumb(occurrence)}\n </li>\n );\n }\n\n // Containers alternate direction with depth; a container of nodes wraps them.\n const inner: Orientation = direction === 'horizontal' ? 'vertical' : 'horizontal';\n const holdsNodes = occurrence.level + 1 === last;\n return (\n <li\n key={occurrence.key}\n {...marker}\n className={`mv:flex mv:flex-col mv:gap-2 mv:rounded-lg mv:border mv:bg-surface mv:p-2 ${repeat ? 'mv:border-dashed mv:border-muted/60' : 'mv:border-edge'}`}\n >\n {occurrence.item.kind === 'node' ? (\n <ContainerHeading node={occurrence.item.node} repeat={repeat} onSelect={onNodeSelect}>\n {breadcrumb(occurrence)}\n </ContainerHeading>\n ) : (\n <span className=\"mv:text-xs mv:font-semibold mv:text-muted\">\n {occurrence.item.field}: {occurrence.item.value === null ? '(none)' : displayValue(occurrence.item.value)}\n </span>\n )}\n <Items direction={holdsNodes ? 'wrap' : inner}>\n {occurrence.children.map((child) => render(child, inner))}\n </Items>\n </li>\n );\n };\n\n const top = layout.orientation;\n return (\n <div className=\"mv:w-max mv:min-w-full mv:p-4\">\n <Items direction={last === 0 ? 'wrap' : top}>\n {landscape.groups.map((group) => render(group, top))}\n {landscape.ungrouped.length > 0 && (\n <li className=\"mv:flex mv:flex-col mv:gap-2 mv:rounded-lg mv:border mv:border-dashed mv:border-edge mv:p-2\">\n <span className=\"mv:text-xs mv:font-semibold mv:text-muted\">Ungrouped</span>\n <Items direction=\"wrap\">{landscape.ungrouped.map((o) => render(o, top))}</Items>\n </li>\n )}\n </Items>\n </div>\n );\n}\n\nfunction Items({ direction, children }: { direction: Orientation | 'wrap'; children: React.ReactNode }) {\n const layout = {\n horizontal: 'mv:flex-row mv:items-start mv:gap-3',\n vertical: 'mv:flex-col mv:items-stretch mv:gap-2',\n wrap: 'mv:max-w-[36rem] mv:flex-row mv:flex-wrap mv:items-start mv:gap-2',\n }[direction];\n return <ul className={`mv:m-0 mv:flex mv:list-none mv:p-0 ${layout}`}>{children}</ul>;\n}\n\n/** A container's node: type and title, selectable like a card. */\nfunction ContainerHeading({\n node,\n repeat,\n onSelect,\n children,\n}: {\n node: SpaceNode;\n repeat: boolean;\n onSelect?: (node: SpaceNode) => void;\n children?: React.ReactNode;\n}) {\n const select = () => onSelect?.(node);\n return (\n // biome-ignore lint/a11y/useSemanticElements: a native button inherits host button styles.\n <div\n role=\"button\"\n tabIndex={0}\n title={`${node.resolvedType}: ${node.title}${repeat ? ' (also shown elsewhere)' : ''}`}\n onClick={select}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n select();\n }\n }}\n className=\"mv:cursor-pointer mv:rounded mv:px-1 mv:hover:text-accent mv:focus-visible:outline-2 mv:focus-visible:outline-accent\"\n >\n <span className=\"mv:block mv:text-[0.65rem] mv:uppercase mv:tracking-wide mv:text-muted\">\n {node.resolvedType}\n {repeat && ' · repeat'}\n </span>\n <span className=\"mv:block mv:text-sm mv:font-semibold mv:leading-snug\">{node.title}</span>\n {children}\n </div>\n );\n}\n\n/** Field values that are wikilinks show as the linked title. */\nfunction displayValue(value: string): string {\n return value.replace(/^\\[\\[([^\\]|]+)(\\|[^\\]]*)?\\]\\]$/, '$1');\n}\n","import { useLayoutEffect, useState } from 'react';\nimport type { Orientation } from '../core/definition';\n\n/**\n * A connector between two occurrences. `cross` links (e.g. extra parents) are drawn dashed.\n * `id` tells apart several links between the same occurrences; straight links between the same\n * pair are drawn side by side, `lane` apart (0: on the line between centres).\n */\nexport type Link = { from: string; to: string; kind?: 'tree' | 'cross'; id?: string; lane?: number };\n\ntype Props = {\n links: readonly Link[];\n /** Rendered element of each occurrence, by occurrence key. */\n elements: ReadonlyMap<string, HTMLElement>;\n /**\n * Positioned element the overlay covers; coordinates are relative to it. Passed as an element,\n * not a ref: the overlay sits inside it, and React runs a child's layout effects before\n * attaching the parent's ref.\n */\n container: HTMLElement | null;\n /** Curves leaving along the tree's orientation, or straight lines between centres (drawn under the nodes). */\n routing: Orientation | 'straight';\n};\n\ntype Drawn = { key: string; d: string; cross: boolean };\n\n/**\n * SVG layer drawing connectors between rendered occurrences.\n *\n * Measures occurrence elements after layout and redraws when the container or any occurrence\n * resizes, so it follows embedded panes that resize independently of the window, and reflows\n * such as late font loads. The SVG fills the container instead of being sized from it, so it\n * never holds the container open after the layout shrinks.\n */\nexport function EdgeOverlay({ links, elements, container, routing }: Props) {\n const [paths, setPaths] = useState<Drawn[]>([]);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n const measure = () => {\n const origin = container.getBoundingClientRect();\n const paths: Drawn[] = [];\n for (const { from, to, kind, id, lane = 0 } of links) {\n const a = elements.get(from)?.getBoundingClientRect();\n const b = elements.get(to)?.getBoundingClientRect();\n if (!a || !b) continue;\n paths.push({\n key: `${from}→${to}${id ?? ''}`,\n d: routing === 'straight' ? line(a, b, origin, lane) : connector(a, b, origin, routing),\n cross: kind === 'cross',\n });\n }\n setPaths(paths);\n };\n\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(container);\n for (const element of elements.values()) observer.observe(element);\n return () => observer.disconnect();\n }, [links, elements, container, routing]);\n\n return (\n <svg\n aria-hidden=\"true\"\n className=\"mv:pointer-events-none mv:absolute mv:inset-0 mv:h-full mv:w-full mv:overflow-visible\"\n >\n {paths.map(({ key, d, cross }) => (\n <path\n key={key}\n d={d}\n className={`mv:fill-none ${cross ? 'mv:stroke-accent/60' : 'mv:stroke-muted/50'}`}\n strokeWidth={1.5}\n strokeDasharray={cross ? '4 3' : undefined}\n />\n ))}\n </svg>\n );\n}\n\n/** Cubic curve from the parent's trailing edge to the child's leading edge. */\nfunction connector(a: DOMRect, b: DOMRect, origin: DOMRect, orientation: Orientation): string {\n if (orientation === 'vertical') {\n const x1 = a.left + a.width / 2 - origin.left;\n const y1 = a.bottom - origin.top;\n const x2 = b.left + b.width / 2 - origin.left;\n const y2 = b.top - origin.top;\n const my = (y1 + y2) / 2;\n return `M${x1},${y1} C${x1},${my} ${x2},${my} ${x2},${y2}`;\n }\n const x1 = a.right - origin.left;\n const y1 = a.top + a.height / 2 - origin.top;\n const x2 = b.left - origin.left;\n const y2 = b.top + b.height / 2 - origin.top;\n const mx = (x1 + x2) / 2;\n return `M${x1},${y1} C${mx},${y1} ${mx},${y2} ${x2},${y2}`;\n}\n\n/** Pixels between parallel straight links. */\nconst LANE_GAP = 6;\n\n/**\n * Straight line between centres, shifted sideways by its lane; the layout draws nodes over the\n * overlay to hide the ends. The shift is relative to a fixed orientation of the pair, so links in\n * opposite directions between the same nodes still separate.\n */\nfunction line(a: DOMRect, b: DOMRect, origin: DOMRect, lane: number): string {\n const x1 = a.left + a.width / 2 - origin.left;\n const y1 = a.top + a.height / 2 - origin.top;\n const x2 = b.left + b.width / 2 - origin.left;\n const y2 = b.top + b.height / 2 - origin.top;\n const flip = x1 < x2 || (x1 === x2 && y1 < y2) ? 1 : -1;\n const length = Math.hypot(x2 - x1, y2 - y1) || 1;\n const dx = (-(y2 - y1) / length) * lane * LANE_GAP * flip;\n const dy = ((x2 - x1) / length) * lane * LANE_GAP * flip;\n return `M${x1 + dx},${y1 + dy} L${x2 + dx},${y2 + dy}`;\n}\n","import { useCallback, useMemo, useRef, useState } from 'react';\nimport type { SpaceGraph, SpaceNode } from 'structured-context/api';\nimport type { LayoutConfig, Orientation, Region, TreeLayoutConfig } from '../core/definition';\nimport { buildTree, type TreeOccurrence, treeLinks } from '../core/tree';\nimport { EdgeOverlay } from './EdgeOverlay';\nimport { NodeCard } from './NodeCard';\n\nexport type LayoutProps<L extends LayoutConfig = LayoutConfig> = {\n graph: SpaceGraph;\n /** The region with parameter values applied, narrowed to the layout's own settings. */\n region: Region & { layout: L };\n /** Scopes occurrence ids when several map views render in one document. */\n instanceId: string;\n onNodeSelect?: (node: SpaceNode) => void;\n};\n\n/**\n * Tree over the schema's hierarchy. Flexbox does the branching; the SVG overlay draws connectors.\n */\nexport function TreeLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<TreeLayoutConfig>) {\n const { orientation, dag } = region.layout;\n const tree = useMemo(() => buildTree(graph, region.id, dag), [graph, region.id, dag]);\n const links = useMemo(() => (region.edges.show ? treeLinks(tree) : []), [tree, region.edges.show]);\n\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n // Filled by ref callbacks during commit, read by the overlay's layout effect afterwards.\n const elements = useRef(new Map<string, HTMLElement>()).current;\n const register = useCallback(\n (key: string) => (el: HTMLElement | null) => {\n if (el) elements.set(key, el);\n else elements.delete(key);\n },\n [elements],\n );\n\n const branch = (occurrence: TreeOccurrence) => (\n <li\n key={occurrence.key}\n className={`mv:flex mv:items-center ${orientation === 'vertical' ? 'mv:flex-col' : 'mv:flex-row'}`}\n >\n <div ref={register(occurrence.key)} data-occurrence={`${instanceId}${occurrence.key}`}>\n <NodeCard\n node={occurrence.node}\n repeat={occurrence.repeatOf !== undefined}\n nodes={region.nodes}\n onSelect={onNodeSelect}\n />\n </div>\n {occurrence.children.length > 0 && (\n <Branches orientation={orientation} nested>\n {occurrence.children.map(branch)}\n </Branches>\n )}\n </li>\n );\n\n return (\n <div ref={setContainer} className=\"mv:relative mv:w-max mv:min-w-full mv:p-4\">\n <Branches orientation={orientation}>{[...tree.roots, ...tree.orphans].map(branch)}</Branches>\n <EdgeOverlay links={links} elements={elements} container={container} routing={orientation} />\n </div>\n );\n}\n\nfunction Branches({\n orientation,\n nested = false,\n children,\n}: {\n orientation: Orientation;\n nested?: boolean;\n children: React.ReactNode;\n}) {\n // Siblings run across the main axis; nested branches leave a gap for connectors.\n const layout =\n orientation === 'vertical'\n ? `mv:flex-row mv:items-start mv:justify-center mv:gap-3 ${nested ? 'mv:pt-10' : ''}`\n : `mv:flex-col mv:items-start mv:justify-center mv:gap-2 ${nested ? 'mv:pl-14' : ''}`;\n return <ul className={`mv:m-0 mv:flex mv:list-none mv:p-0 ${layout}`}>{children}</ul>;\n}\n","import { useCallback, useMemo, useRef, useState } from 'react';\nimport type { AxisConfig, XYLayoutConfig } from '../core/definition';\nimport { buildXYPlot } from '../core/xy';\nimport { EdgeOverlay } from './EdgeOverlay';\nimport { NodeCard } from './NodeCard';\nimport type { LayoutProps } from './TreeLayout';\n\n/**\n * Nodes positioned by two numeric fields, with straight connectors between them. Positions are\n * percentages of the plot area, which fills the container (scrolling below a minimum size). Nodes that can't be\n * placed are listed under the plot with the reason.\n * PROTOTYPE: labels may overlap where nodes sit close together; no collision handling.\n */\nexport function XYLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<XYLayoutConfig>) {\n const { layout } = region;\n const plot = useMemo(() => buildXYPlot(graph, region.id, layout), [graph, region.id, layout]);\n // Relationship edges (flows, pipelines) are dashed, to tell them from the value chain.\n const links = useMemo(\n () =>\n region.edges.show\n ? plot.links.map(({ from, to, field, hierarchy, lane }) => ({\n from,\n to,\n id: field,\n lane,\n kind: hierarchy ? ('tree' as const) : ('cross' as const),\n }))\n : [],\n [plot, region.edges.show],\n );\n const shape = region.nodes.style === 'shape';\n\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const elements = useRef(new Map<string, HTMLElement>()).current;\n const register = useCallback(\n (key: string) => (el: HTMLElement | null) => {\n if (el) elements.set(key, el);\n else elements.delete(key);\n },\n [elements],\n );\n\n return (\n <div className=\"mv:box-border mv:flex mv:h-full mv:min-h-[28rem] mv:min-w-[36rem] mv:flex-col mv:gap-4 mv:p-4\">\n <div className=\"mv:grid mv:min-h-0 mv:flex-1 mv:grid-cols-[auto_1fr] mv:grid-rows-[1fr_auto] mv:gap-1\">\n <AxisTitle axis={layout.y} domain={plot.domains.y} vertical />\n <div ref={setContainer} className=\"mv:relative mv:border-b mv:border-l mv:border-edge\">\n {/* Before the nodes, so the opaque nodes cover the ends of the lines. */}\n <EdgeOverlay links={links} elements={elements} container={container} routing=\"straight\" />\n {/* Inset, so nodes at the ends of a domain stay inside the plot. */}\n <div className=\"mv:absolute mv:inset-8\">\n {plot.points.map((point) => (\n <div\n key={point.key}\n data-occurrence={`${instanceId}${point.key}`}\n className={`mv:absolute mv:flex mv:items-center mv:gap-1 ${shape ? 'mv:-translate-x-3 mv:translate-y-3' : 'mv:-translate-x-1/2 mv:translate-y-1/2'}`}\n style={{ left: `${point.x * 100}%`, bottom: `${point.y * 100}%` }}\n >\n <div ref={register(point.key)}>\n <NodeCard node={point.node} repeat={false} nodes={region.nodes} onSelect={onNodeSelect} />\n </div>\n {shape && (\n <span className=\"mv:whitespace-nowrap mv:rounded mv:bg-surface/80 mv:px-0.5 mv:text-xs\">\n {point.node.title}\n </span>\n )}\n </div>\n ))}\n </div>\n </div>\n <div />\n <AxisTitle axis={layout.x} domain={plot.domains.x} />\n </div>\n\n {plot.unplaced.length > 0 && (\n <section className=\"mv:flex mv:flex-col mv:gap-2\">\n <span className=\"mv:text-xs mv:font-semibold mv:text-muted\">Not plotted</span>\n <ul className=\"mv:m-0 mv:flex mv:list-none mv:flex-wrap mv:gap-3 mv:p-0\">\n {plot.unplaced.map(({ key, node, reasons }) => (\n <li key={key} data-occurrence={`${instanceId}${key}`} className=\"mv:flex mv:items-center mv:gap-1\">\n <NodeCard node={node} repeat={false} nodes={region.nodes} onSelect={onNodeSelect} />\n <span className=\"mv:text-xs\">\n {shape && `${node.title} `}\n <span className=\"mv:text-muted\">({reasons.join('; ')})</span>\n </span>\n </li>\n ))}\n </ul>\n </section>\n )}\n </div>\n );\n}\n\n/** Axis title with the values at each end, in drawing order. */\nfunction AxisTitle({\n axis,\n domain: [min, max],\n vertical = false,\n}: {\n axis: AxisConfig;\n domain: readonly [number, number];\n vertical?: boolean;\n}) {\n const [start, end] = axis.direction === 'descending' ? [max, min] : [min, max];\n return (\n <div\n className={`mv:flex mv:items-center mv:justify-between mv:gap-2 mv:text-xs mv:text-muted ${vertical ? 'mv:flex-col-reverse mv:py-8' : 'mv:px-8'}`}\n >\n <span>{format(start)}</span>\n <span className={`mv:font-semibold ${vertical ? 'mv:[writing-mode:vertical-rl] mv:rotate-180' : ''}`}>\n {axis.label ?? axis.field}\n </span>\n <span>{format(end)}</span>\n </div>\n );\n}\n\nfunction format(value: number): string {\n return Number.isInteger(value) ? String(value) : value.toPrecision(3).replace(/\\.?0+$/, '');\n}\n","import { useId, useMemo } from 'react';\nimport type { SpaceGraph, SpaceNode } from 'structured-context/api';\nimport { type AnnotationIndex, filterAnnotations } from '../core/annotations';\nimport { type MapViewDefinition, type ParameterValues, type Region, resolveRegions } from '../core/definition';\nimport { AnnotationsContext } from './annotations-context';\nimport { LandscapeLayout } from './LandscapeLayout';\nimport { type LayoutProps, TreeLayout } from './TreeLayout';\nimport { XYLayout } from './XYLayout';\n\ntype Props = {\n definition: MapViewDefinition;\n graph: SpaceGraph;\n /** Current parameter values (host-owned session state); missing values use defaults. */\n values?: ParameterValues;\n /**\n * Validation results by node (see `annotationsFrom`). Which of them show, and at what severity, is\n * the region's `nodes.validation` setting; with none supplied, nothing is drawn.\n */\n annotations?: AnnotationIndex;\n onNodeSelect?: (node: SpaceNode) => void;\n};\n\nconst EMPTY: AnnotationIndex = new Map();\n\n/** Renders a map view definition against a space. Sizes to its container and scrolls within it. */\nexport function MapView({ definition, graph, values, annotations, onNodeSelect }: Props) {\n const instanceId = useId();\n const regions = useMemo(() => resolveRegions(definition, values), [definition, values]);\n // PROTOTYPE: only the first region is rendered. Arranging several regions is undesigned (#8).\n const region = regions[0]!;\n const props = { graph, instanceId, onNodeSelect };\n const { validation, validationSources } = region.nodes;\n const visibleAnnotations = useMemo(\n () => (annotations ? filterAnnotations(annotations, validation, validationSources) : EMPTY),\n [annotations, validation, validationSources],\n );\n\n return (\n <AnnotationsContext.Provider value={visibleAnnotations}>\n <div className=\"mv:h-full mv:w-full mv:overflow-auto mv:bg-surface mv:text-ink\">{layoutFor(region, props)}</div>\n </AnnotationsContext.Provider>\n );\n}\n\nfunction layoutFor(region: Region, props: Omit<LayoutProps, 'region'>) {\n const { layout } = region;\n switch (layout.type) {\n case 'tree':\n return <TreeLayout {...props} region={{ ...region, layout }} />;\n case 'landscape':\n return <LandscapeLayout {...props} region={{ ...region, layout }} />;\n case 'xy':\n return <XYLayout {...props} region={{ ...region, layout }} />;\n }\n}\n","import { useId } from 'react';\nimport type { Parameter, ParameterControl } from '../core/definition';\n\ntype InputProps<Kind extends ParameterControl['kind']> = {\n parameter: Parameter & { control: Extract<ParameterControl, { kind: Kind }> };\n value: unknown;\n onChange: (value: unknown) => void;\n};\n\nconst same = (a: unknown, b: unknown) => JSON.stringify(a) === JSON.stringify(b);\n\n/** A checkbox for a boolean parameter, labelled with the parameter's title. */\nexport function ToggleParameterInput({ parameter, value, onChange }: InputProps<'toggle'>) {\n const id = useId();\n return (\n <>\n <input id={id} type=\"checkbox\" checked={value === true} onChange={(e) => onChange(e.target.checked)} />\n <label htmlFor={id}>{parameter.title}</label>\n </>\n );\n}\n\n/** A dropdown for a parameter with one of several options. */\nexport function SelectParameterInput({ parameter, value, onChange }: InputProps<'select'>) {\n const id = useId();\n return (\n <>\n <label htmlFor={id} className=\"mv:text-muted\">\n {parameter.title}\n </label>\n <select id={id} value={JSON.stringify(value)} onChange={(e) => onChange(JSON.parse(e.target.value))}>\n {parameter.control.options.map((option) => (\n <option key={JSON.stringify(option)} value={JSON.stringify(option)}>\n {String(option)}\n </option>\n ))}\n </select>\n </>\n );\n}\n\n/** A checkbox group for a parameter taking any subset of its options. */\nexport function MultiSelectParameterInput({ parameter, value, onChange }: InputProps<'multiselect'>) {\n const { options } = parameter.control;\n const selected = Array.isArray(value) ? value : [];\n return (\n <fieldset className=\"mv:m-0 mv:flex mv:flex-wrap mv:items-center mv:gap-2 mv:border-0 mv:p-0\">\n <legend className=\"mv:float-left mv:mr-1.5 mv:p-0 mv:text-muted\">{parameter.title}</legend>\n {options.map((option) => {\n const checked = selected.some((v) => same(v, option));\n return (\n <label key={JSON.stringify(option)} className=\"mv:flex mv:items-center mv:gap-1\">\n <input\n type=\"checkbox\"\n checked={checked}\n onChange={() =>\n // Keep the options' order rather than the order of clicks.\n onChange(options.filter((o) => (o === option ? !checked : selected.some((v) => same(v, o)))))\n }\n />\n {String(option)}\n </label>\n );\n })}\n </fieldset>\n );\n}\n\n/** The input matching a parameter's control kind. */\nexport function ParameterInput({\n parameter,\n value,\n onChange,\n}: Omit<InputProps<ParameterControl['kind']>, 'parameter'> & { parameter: Parameter }) {\n const { control } = parameter;\n switch (control.kind) {\n case 'toggle':\n return <ToggleParameterInput parameter={{ ...parameter, control }} value={value} onChange={onChange} />;\n case 'select':\n return <SelectParameterInput parameter={{ ...parameter, control }} value={value} onChange={onChange} />;\n case 'multiselect':\n return <MultiSelectParameterInput parameter={{ ...parameter, control }} value={value} onChange={onChange} />;\n }\n}\n","import { useMemo } from 'react';\nimport {\n type MapViewDefinition,\n type Parameter,\n type ParameterValues,\n resolveParameterValues,\n} from '../core/definition';\n\n/** One parameter with its current value and a setter, ready for a host to lay out. */\nexport type ParameterControlState = {\n parameter: Parameter;\n /** The value in effect: the host's value, else the default, matching what renders. */\n value: unknown;\n setValue: (value: unknown) => void;\n};\n\n/**\n * The state behind a map view's parameter controls, with no markup, for hosts that lay the controls\n * out themselves. Pair each entry with `ParameterInput`, or with one of the typed inputs.\n */\nexport function useParameterControls(\n definition: MapViewDefinition,\n values: ParameterValues,\n onChange: (name: string, value: unknown) => void,\n): ParameterControlState[] {\n const resolved = useMemo(() => resolveParameterValues(definition, values), [definition, values]);\n return definition.parameters.map((parameter) => ({\n parameter,\n value: resolved[parameter.name],\n setValue: (value) => onChange(parameter.name, value),\n }));\n}\n","import type { MapViewDefinition, ParameterValues } from '../core/definition';\nimport { ParameterInput } from './ParameterInputs';\nimport { useParameterControls } from './useParameterControls';\n\ntype Props = {\n definition: MapViewDefinition;\n /** Host-owned values; missing or stale ones show as the default, matching what renders. */\n values: ParameterValues;\n onChange: (name: string, value: unknown) => void;\n};\n\n/**\n * Default layout for a map view's parameter controls: a wrapping row. Hosts wanting their own layout\n * use `useParameterControls` with `ParameterInput` (or the typed inputs) instead.\n */\nexport function ParameterControls({ definition, values, onChange }: Props) {\n const controls = useParameterControls(definition, values, onChange);\n if (controls.length === 0) return null;\n return (\n <div className=\"mv:flex mv:flex-wrap mv:items-center mv:gap-x-4 mv:gap-y-2 mv:text-sm\">\n {controls.map(({ parameter, value, setValue }) => (\n <div key={parameter.name} className=\"mv:flex mv:items-center mv:gap-1.5\" title={parameter.description}>\n <ParameterInput parameter={parameter} value={value} onChange={setValue} />\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;AAMA,IAAa,qBAAqB,8BAA+B,IAH/B,IAG+B,CAAI;AAErE,IAAa,uBAAuB,WAAW,kBAAkB;;;;;;;;ACUjE,SAAgB,SAAS,EAAE,MAAM,QAAQ,OAAO,YAAmB;CACjE,MAAM,eAAe,WAAW,IAAI;CACpC,MAAM,cAAc,eAAe,CAAC,CAAC,IAAI,KAAK,EAAE;CAChD,MAAM,QAAQ,GAAG,KAAK,aAAa,IAAI,KAAK,QAAQ,SAAS,+BAA+B,KAAK,iBAAiB,WAAW;CAC7H,MAAM,aAAa,MAA2B;EAC5C,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;GACtC,EAAE,eAAe;GACjB,OAAO;EACT;CACF;CACA,MAAM,SAAS,SAAS,sDAAsD;CAE9E,IAAI,MAAM,UAAU,SAGlB,OAEE,qBAAC,OAAD;EACE,MAAK;EACL,UAAU;EACV,OAAO;EACP,gBAAc,KAAK;EACnB,SAAS;EACE;EACX,cAAY;EACZ,WAAW,4QAA4Q;EARzR,UAAA,CAUE,oBAAC,QAAD;GAAM,eAAY;GAAQ,UAAA,KAAK,aAAa,OAAO,CAAC;EAAQ,CAAA,GAC5D,oBAAC,iBAAD,EAA8B,YAAc,CAAA,CACzC;;CAIT,MAAM,SAAS,MAAM,OAClB,KAAK,UAAU,CAAC,OAAO,YAAY,KAAK,WAAW,MAAM,CAAC,CAAU,CAAC,CACrE,QAAQ,GAAG,WAAW,UAAU,KAAA,CAAS;CAE5C,OAEE,qBAAC,OAAD;EACE,MAAK;EACL,UAAU;EACV,OAAO;EACP,gBAAc,KAAK;EACnB,SAAS;EACE;EACX,WAAW,4MAA4M;EAPzN,UAAA;GASE,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACG,KAAK,cACL,UAAU,WACP;;GACN,oBAAC,QAAD;IAAM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KAAK,eAAe;EAC/C;EACA,OAAO,SAAS,UAAU;EAC1B,WAAW,UAAU,SAAS,UAAU,MAAM,KAAK;CACrD,EAAE;AACJ;;;;;;;AChBA,SAAgB,kBAAkB,EAAE,YAAY,QAAQ,YAAmB;CACzE,MAAM,WAAW,qBAAqB,YAAY,QAAQ,QAAQ;CAClE,IAAI,SAAS,WAAW,GAAG,OAAO;CAClC,OACE,oBAAC,OAAD;EAAK,WAAU;EACZ,UAAA,SAAS,KAAK,EAAE,WAAW,OAAO,eACjC,oBAAC,OAAD;GAA0B,WAAU;GAAqC,OAAO,UAAU;GACxF,UAAA,oBAAC,gBAAD;IAA2B;IAAkB;IAAO,UAAU;GAAW,CAAA;EACtE,GAFK,UAAU,IAEf,CACN;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"ParameterControls-A1HJWyt9.js","names":["_Fragment"],"sources":["../src/layouts/annotations-context.ts","../src/layouts/NodeCard.tsx","../src/layouts/LandscapeLayout.tsx","../src/layouts/EdgeOverlay.tsx","../src/layouts/TreeLayout.tsx","../src/layouts/XYLayout.tsx","../src/layouts/MapView.tsx","../src/layouts/ParameterInputs.tsx","../src/layouts/useParameterControls.ts","../src/layouts/ParameterControls.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { AnnotationIndex } from '../core/annotations';\n\nconst NONE: AnnotationIndex = new Map();\n\n/** The annotations a map view shows, already narrowed by its validation settings. Read by node cards. */\nexport const AnnotationsContext = createContext<AnnotationIndex>(NONE);\n\nexport const useAnnotations = () => useContext(AnnotationsContext);\n","import type { SpaceNode } from 'structured-context/api';\nimport { type NodeAnnotation, type Severity, worstSeverity } from '../core/annotations';\nimport type { NodesConfig } from '../core/definition';\nimport { useAnnotations } from './annotations-context';\n\ntype Props = {\n node: SpaceNode;\n /** The node's subtree is rendered at another occurrence. */\n repeat: boolean;\n nodes: NodesConfig;\n onSelect?: (node: SpaceNode) => void;\n};\n\n/**\n * A clickable node, drawn as a card (title plus selected fields) or a compact shape with a\n * tooltip. Deliberately a `div` with button semantics rather than a `<button>`: hosts style\n * native form controls globally (Obsidian fixes button height and disables wrapping).\n */\nexport function NodeCard({ node, repeat, nodes, onSelect }: Props) {\n const select = () => onSelect?.(node);\n const annotations = useAnnotations().get(node.id);\n const label = `${node.resolvedType}: ${node.title}${repeat ? ' (shown in full elsewhere)' : ''}${annotationsLabel(annotations)}`;\n const onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n select();\n }\n };\n const border = repeat ? 'mv:border-dashed mv:border-muted/60 mv:opacity-75' : 'mv:border-edge';\n\n if (nodes.style === 'shape') {\n // 24px: the minimum target size for pointer input (WCAG 2.2 AA). The type's initial is the\n // visible cue; the full type and title are in the tooltip and accessible name.\n return (\n // biome-ignore lint/a11y/useSemanticElements: a native button inherits host button styles.\n <div\n role=\"button\"\n tabIndex={0}\n title={label}\n data-node-id={node.id}\n onClick={select}\n onKeyDown={onKeyDown}\n aria-label={label}\n className={`mv:relative mv:flex mv:size-6 mv:cursor-pointer mv:items-center mv:justify-center mv:rounded-full mv:border-2 mv:bg-card mv:text-[0.65rem] mv:font-semibold mv:uppercase mv:text-muted mv:hover:border-accent mv:focus-visible:outline-2 mv:focus-visible:outline-accent ${border}`}\n >\n <span aria-hidden=\"true\">{node.resolvedType.charAt(0)}</span>\n <AnnotationBadge annotations={annotations} />\n </div>\n );\n }\n\n const fields = nodes.fields\n .map((field) => [field, formatValue(node.schemaData[field])] as const)\n .filter(([, value]) => value !== undefined);\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: a native button inherits host button styles.\n <div\n role=\"button\"\n tabIndex={0}\n title={label}\n data-node-id={node.id}\n onClick={select}\n onKeyDown={onKeyDown}\n className={`mv:relative mv:w-44 mv:cursor-pointer mv:rounded-md mv:border mv:bg-card mv:px-2.5 mv:py-1.5 mv:text-left mv:shadow-sm mv:hover:border-accent mv:focus-visible:outline-2 mv:focus-visible:outline-accent ${border}`}\n >\n <span className=\"mv:block mv:text-[0.65rem] mv:uppercase mv:tracking-wide mv:text-muted\">\n {node.resolvedType}\n {repeat && ' · repeat'}\n </span>\n <span className=\"mv:block mv:text-sm mv:leading-snug\">{node.title}</span>\n {fields.length > 0 && (\n <dl className=\"mv:m-0 mv:mt-1 mv:text-xs mv:text-muted\">\n {fields.map(([field, value]) => (\n <div key={field} className=\"mv:flex mv:gap-1\">\n <dt className=\"mv:shrink-0\">{field}:</dt>\n <dd className=\"mv:m-0 mv:truncate mv:text-ink\">{value}</dd>\n </div>\n ))}\n </dl>\n )}\n <AnnotationBadge annotations={annotations} />\n </div>\n );\n}\n\nconst BADGE: Record<Severity, string> = {\n error: 'mv:bg-error',\n warning: 'mv:bg-warning',\n info: 'mv:bg-info',\n};\n\n/** A count of the node's validation results in the corner, coloured by the most serious. Decorative: the count is in the card's label. */\nfunction AnnotationBadge({ annotations }: { annotations: readonly NodeAnnotation[] | undefined }) {\n const worst = annotations && worstSeverity(annotations);\n if (!annotations || !worst) return null;\n return (\n <span\n aria-hidden=\"true\"\n className={`mv:absolute mv:-top-1.5 mv:-right-1.5 mv:flex mv:h-4 mv:min-w-4 mv:items-center mv:justify-center mv:rounded-full mv:px-1 mv:text-[0.6rem] mv:font-semibold mv:text-white ${BADGE[worst]}`}\n >\n {annotations.length}\n </span>\n );\n}\n\nfunction annotationsLabel(annotations: readonly NodeAnnotation[] | undefined): string {\n const worst = annotations && worstSeverity(annotations);\n if (!annotations || !worst) return '';\n return ` (${annotations.length} validation ${annotations.length === 1 ? 'result' : 'results'}, most serious: ${worst})`;\n}\n\nfunction formatValue(value: unknown): string | undefined {\n if (value === undefined || value === null || value === '') return undefined;\n if (Array.isArray(value)) return value.map(String).join(', ');\n if (typeof value === 'object') return JSON.stringify(value);\n return String(value);\n}\n","import { useMemo } from 'react';\nimport type { SpaceNode } from 'structured-context/api';\nimport type { LandscapeLayoutConfig, Orientation } from '../core/definition';\nimport { buildLandscape, type LandscapeOccurrence } from '../core/landscape';\nimport { NodeCard } from './NodeCard';\nimport type { LayoutProps } from './TreeLayout';\n\n/**\n * Nested containers following the layout's grouping levels; the last level is drawn as nodes.\n * Flexbox does the nesting and wrapping. Containment shows the grouping edges, so no connectors\n * are drawn. PROTOTYPE: `edges.show` has no effect here; other edges aren't drawn yet.\n */\nexport function LandscapeLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<LandscapeLayoutConfig>) {\n const { layout } = region;\n const landscape = useMemo(() => buildLandscape(graph, region.id, layout), [graph, region.id, layout]);\n const last = layout.group.length - 1;\n\n const breadcrumb = (occurrence: LandscapeOccurrence) => {\n const level = layout.group[occurrence.level];\n if (!level || !('type' in level) || level.intermediate !== 'breadcrumb') return null;\n const steps = occurrence.via.filter((step) => step.nodes.length > 0);\n if (steps.length === 0) return null;\n return (\n <span className=\"mv:block mv:max-w-44 mv:text-[0.65rem] mv:leading-tight mv:text-muted\">\n via {steps.map((step) => step.nodes.map((n) => n.title).join(', ')).join(' › ')}\n </span>\n );\n };\n\n const render = (occurrence: LandscapeOccurrence, direction: Orientation): React.ReactNode => {\n const repeat = occurrence.repeatOf !== undefined;\n const marker = { 'data-occurrence': `${instanceId}${occurrence.key}` };\n\n if (occurrence.item.kind === 'node' && occurrence.level === last) {\n return (\n <li key={occurrence.key} {...marker} className=\"mv:flex mv:flex-col mv:gap-0.5\">\n <NodeCard node={occurrence.item.node} repeat={repeat} nodes={region.nodes} onSelect={onNodeSelect} />\n {breadcrumb(occurrence)}\n </li>\n );\n }\n\n // Containers alternate direction with depth; a container of nodes wraps them.\n const inner: Orientation = direction === 'horizontal' ? 'vertical' : 'horizontal';\n const holdsNodes = occurrence.level + 1 === last;\n return (\n <li\n key={occurrence.key}\n {...marker}\n className={`mv:flex mv:flex-col mv:gap-2 mv:rounded-lg mv:border mv:bg-surface mv:p-2 ${repeat ? 'mv:border-dashed mv:border-muted/60' : 'mv:border-edge'}`}\n >\n {occurrence.item.kind === 'node' ? (\n <ContainerHeading node={occurrence.item.node} repeat={repeat} onSelect={onNodeSelect}>\n {breadcrumb(occurrence)}\n </ContainerHeading>\n ) : (\n <span className=\"mv:text-xs mv:font-semibold mv:text-muted\">\n {occurrence.item.field}: {occurrence.item.value === null ? '(none)' : displayValue(occurrence.item.value)}\n </span>\n )}\n <Items direction={holdsNodes ? 'wrap' : inner}>\n {occurrence.children.map((child) => render(child, inner))}\n </Items>\n </li>\n );\n };\n\n const top = layout.orientation;\n return (\n <div className=\"mv:w-max mv:min-w-full mv:p-4\">\n <Items direction={last === 0 ? 'wrap' : top}>\n {landscape.groups.map((group) => render(group, top))}\n {landscape.ungrouped.length > 0 && (\n <li className=\"mv:flex mv:flex-col mv:gap-2 mv:rounded-lg mv:border mv:border-dashed mv:border-edge mv:p-2\">\n <span className=\"mv:text-xs mv:font-semibold mv:text-muted\">Ungrouped</span>\n <Items direction=\"wrap\">{landscape.ungrouped.map((o) => render(o, top))}</Items>\n </li>\n )}\n </Items>\n </div>\n );\n}\n\nfunction Items({ direction, children }: { direction: Orientation | 'wrap'; children: React.ReactNode }) {\n const layout = {\n horizontal: 'mv:flex-row mv:items-start mv:gap-3',\n vertical: 'mv:flex-col mv:items-stretch mv:gap-2',\n wrap: 'mv:max-w-[36rem] mv:flex-row mv:flex-wrap mv:items-start mv:gap-2',\n }[direction];\n return <ul className={`mv:m-0 mv:flex mv:list-none mv:p-0 ${layout}`}>{children}</ul>;\n}\n\n/** A container's node: type and title, selectable like a card. */\nfunction ContainerHeading({\n node,\n repeat,\n onSelect,\n children,\n}: {\n node: SpaceNode;\n repeat: boolean;\n onSelect?: (node: SpaceNode) => void;\n children?: React.ReactNode;\n}) {\n const select = () => onSelect?.(node);\n return (\n // biome-ignore lint/a11y/useSemanticElements: a native button inherits host button styles.\n <div\n role=\"button\"\n tabIndex={0}\n title={`${node.resolvedType}: ${node.title}${repeat ? ' (also shown elsewhere)' : ''}`}\n onClick={select}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n select();\n }\n }}\n className=\"mv:cursor-pointer mv:rounded mv:px-1 mv:hover:text-accent mv:focus-visible:outline-2 mv:focus-visible:outline-accent\"\n >\n <span className=\"mv:block mv:text-[0.65rem] mv:uppercase mv:tracking-wide mv:text-muted\">\n {node.resolvedType}\n {repeat && ' · repeat'}\n </span>\n <span className=\"mv:block mv:text-sm mv:font-semibold mv:leading-snug\">{node.title}</span>\n {children}\n </div>\n );\n}\n\n/** Field values that are wikilinks show as the linked title. */\nfunction displayValue(value: string): string {\n return value.replace(/^\\[\\[([^\\]|]+)(\\|[^\\]]*)?\\]\\]$/, '$1');\n}\n","import { useLayoutEffect, useState } from 'react';\nimport type { Orientation } from '../core/definition';\n\n/**\n * A connector between two occurrences. `cross` links (e.g. extra parents) are drawn dashed.\n * `id` tells apart several links between the same occurrences; straight links between the same\n * pair are drawn side by side, `lane` apart (0: on the line between centres).\n */\nexport type Link = { from: string; to: string; kind?: 'tree' | 'cross'; id?: string; lane?: number };\n\ntype Props = {\n links: readonly Link[];\n /** Rendered element of each occurrence, by occurrence key. */\n elements: ReadonlyMap<string, HTMLElement>;\n /**\n * Positioned element the overlay covers; coordinates are relative to it. Passed as an element,\n * not a ref: the overlay sits inside it, and React runs a child's layout effects before\n * attaching the parent's ref.\n */\n container: HTMLElement | null;\n /** Curves leaving along the tree's orientation, or straight lines between centres (drawn under the nodes). */\n routing: Orientation | 'straight';\n};\n\ntype Drawn = { key: string; d: string; cross: boolean };\n\n/**\n * SVG layer drawing connectors between rendered occurrences.\n *\n * Measures occurrence elements after layout and redraws when the container or any occurrence\n * resizes, so it follows embedded panes that resize independently of the window, and reflows\n * such as late font loads. The SVG fills the container instead of being sized from it, so it\n * never holds the container open after the layout shrinks.\n */\nexport function EdgeOverlay({ links, elements, container, routing }: Props) {\n const [paths, setPaths] = useState<Drawn[]>([]);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n const measure = () => {\n const origin = container.getBoundingClientRect();\n const paths: Drawn[] = [];\n for (const { from, to, kind, id, lane = 0 } of links) {\n const a = elements.get(from)?.getBoundingClientRect();\n const b = elements.get(to)?.getBoundingClientRect();\n if (!a || !b) continue;\n paths.push({\n key: `${from}→${to}${id ?? ''}`,\n d: routing === 'straight' ? line(a, b, origin, lane) : connector(a, b, origin, routing),\n cross: kind === 'cross',\n });\n }\n setPaths(paths);\n };\n\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(container);\n for (const element of elements.values()) observer.observe(element);\n return () => observer.disconnect();\n }, [links, elements, container, routing]);\n\n return (\n <svg\n aria-hidden=\"true\"\n className=\"mv:pointer-events-none mv:absolute mv:inset-0 mv:h-full mv:w-full mv:overflow-visible\"\n >\n {paths.map(({ key, d, cross }) => (\n <path\n key={key}\n d={d}\n className={`mv:fill-none ${cross ? 'mv:stroke-accent/60' : 'mv:stroke-muted/50'}`}\n strokeWidth={1.5}\n strokeDasharray={cross ? '4 3' : undefined}\n />\n ))}\n </svg>\n );\n}\n\n/** Cubic curve from the parent's trailing edge to the child's leading edge. */\nfunction connector(a: DOMRect, b: DOMRect, origin: DOMRect, orientation: Orientation): string {\n if (orientation === 'vertical') {\n const x1 = a.left + a.width / 2 - origin.left;\n const y1 = a.bottom - origin.top;\n const x2 = b.left + b.width / 2 - origin.left;\n const y2 = b.top - origin.top;\n const my = (y1 + y2) / 2;\n return `M${x1},${y1} C${x1},${my} ${x2},${my} ${x2},${y2}`;\n }\n const x1 = a.right - origin.left;\n const y1 = a.top + a.height / 2 - origin.top;\n const x2 = b.left - origin.left;\n const y2 = b.top + b.height / 2 - origin.top;\n const mx = (x1 + x2) / 2;\n return `M${x1},${y1} C${mx},${y1} ${mx},${y2} ${x2},${y2}`;\n}\n\n/** Pixels between parallel straight links. */\nconst LANE_GAP = 6;\n\n/**\n * Straight line between centres, shifted sideways by its lane; the layout draws nodes over the\n * overlay to hide the ends. The shift is relative to a fixed orientation of the pair, so links in\n * opposite directions between the same nodes still separate.\n */\nfunction line(a: DOMRect, b: DOMRect, origin: DOMRect, lane: number): string {\n const x1 = a.left + a.width / 2 - origin.left;\n const y1 = a.top + a.height / 2 - origin.top;\n const x2 = b.left + b.width / 2 - origin.left;\n const y2 = b.top + b.height / 2 - origin.top;\n const flip = x1 < x2 || (x1 === x2 && y1 < y2) ? 1 : -1;\n const length = Math.hypot(x2 - x1, y2 - y1) || 1;\n const dx = (-(y2 - y1) / length) * lane * LANE_GAP * flip;\n const dy = ((x2 - x1) / length) * lane * LANE_GAP * flip;\n return `M${x1 + dx},${y1 + dy} L${x2 + dx},${y2 + dy}`;\n}\n","import { useCallback, useMemo, useRef, useState } from 'react';\nimport type { SpaceGraph, SpaceNode } from 'structured-context/api';\nimport type { LayoutConfig, Orientation, Region, TreeLayoutConfig } from '../core/definition';\nimport { buildTree, type TreeOccurrence, treeLinks } from '../core/tree';\nimport { EdgeOverlay } from './EdgeOverlay';\nimport { NodeCard } from './NodeCard';\n\nexport type LayoutProps<L extends LayoutConfig = LayoutConfig> = {\n graph: SpaceGraph;\n /** The region with parameter values applied, narrowed to the layout's own settings. */\n region: Region & { layout: L };\n /** Scopes occurrence ids when several map views render in one document. */\n instanceId: string;\n onNodeSelect?: (node: SpaceNode) => void;\n};\n\n/**\n * Tree over the schema's hierarchy. Flexbox does the branching; the SVG overlay draws connectors.\n */\nexport function TreeLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<TreeLayoutConfig>) {\n const { orientation, dag } = region.layout;\n const tree = useMemo(() => buildTree(graph, region.id, dag), [graph, region.id, dag]);\n const links = useMemo(() => (region.edges.show ? treeLinks(tree) : []), [tree, region.edges.show]);\n\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n // Filled by ref callbacks during commit, read by the overlay's layout effect afterwards.\n const elements = useRef(new Map<string, HTMLElement>()).current;\n const register = useCallback(\n (key: string) => (el: HTMLElement | null) => {\n if (el) elements.set(key, el);\n else elements.delete(key);\n },\n [elements],\n );\n\n const branch = (occurrence: TreeOccurrence) => (\n <li\n key={occurrence.key}\n className={`mv:flex mv:items-center ${orientation === 'vertical' ? 'mv:flex-col' : 'mv:flex-row'}`}\n >\n <div ref={register(occurrence.key)} data-occurrence={`${instanceId}${occurrence.key}`}>\n <NodeCard\n node={occurrence.node}\n repeat={occurrence.repeatOf !== undefined}\n nodes={region.nodes}\n onSelect={onNodeSelect}\n />\n </div>\n {occurrence.children.length > 0 && (\n <Branches orientation={orientation} nested>\n {occurrence.children.map(branch)}\n </Branches>\n )}\n </li>\n );\n\n return (\n <div ref={setContainer} className=\"mv:relative mv:w-max mv:min-w-full mv:p-4\">\n <Branches orientation={orientation}>{[...tree.roots, ...tree.orphans].map(branch)}</Branches>\n <EdgeOverlay links={links} elements={elements} container={container} routing={orientation} />\n </div>\n );\n}\n\nfunction Branches({\n orientation,\n nested = false,\n children,\n}: {\n orientation: Orientation;\n nested?: boolean;\n children: React.ReactNode;\n}) {\n // Siblings run across the main axis; nested branches leave a gap for connectors.\n const layout =\n orientation === 'vertical'\n ? `mv:flex-row mv:items-start mv:justify-center mv:gap-3 ${nested ? 'mv:pt-10' : ''}`\n : `mv:flex-col mv:items-start mv:justify-center mv:gap-2 ${nested ? 'mv:pl-14' : ''}`;\n return <ul className={`mv:m-0 mv:flex mv:list-none mv:p-0 ${layout}`}>{children}</ul>;\n}\n","import { useCallback, useMemo, useRef, useState } from 'react';\nimport type { AxisConfig, XYLayoutConfig } from '../core/definition';\nimport { buildXYPlot } from '../core/xy';\nimport { EdgeOverlay } from './EdgeOverlay';\nimport { NodeCard } from './NodeCard';\nimport type { LayoutProps } from './TreeLayout';\n\n/**\n * Nodes positioned by two numeric fields, with straight connectors between them. Positions are\n * percentages of the plot area, which fills the container (scrolling below a minimum size). Nodes that can't be\n * placed are listed under the plot with the reason.\n * PROTOTYPE: labels may overlap where nodes sit close together; no collision handling.\n */\nexport function XYLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<XYLayoutConfig>) {\n const { layout } = region;\n const plot = useMemo(() => buildXYPlot(graph, region.id, layout), [graph, region.id, layout]);\n // Relationship edges (flows, pipelines) are dashed, to tell them from the value chain.\n const links = useMemo(\n () =>\n region.edges.show\n ? plot.links.map(({ from, to, field, hierarchy, lane }) => ({\n from,\n to,\n id: field,\n lane,\n kind: hierarchy ? ('tree' as const) : ('cross' as const),\n }))\n : [],\n [plot, region.edges.show],\n );\n const shape = region.nodes.style === 'shape';\n\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const elements = useRef(new Map<string, HTMLElement>()).current;\n const register = useCallback(\n (key: string) => (el: HTMLElement | null) => {\n if (el) elements.set(key, el);\n else elements.delete(key);\n },\n [elements],\n );\n\n return (\n <div className=\"mv:box-border mv:flex mv:h-full mv:min-h-[28rem] mv:min-w-[36rem] mv:flex-col mv:gap-4 mv:p-4\">\n <div className=\"mv:grid mv:min-h-0 mv:flex-1 mv:grid-cols-[auto_1fr] mv:grid-rows-[1fr_auto] mv:gap-1\">\n <AxisTitle axis={layout.y} domain={plot.domains.y} vertical />\n <div ref={setContainer} className=\"mv:relative mv:border-b mv:border-l mv:border-edge\">\n {/* Before the nodes, so the opaque nodes cover the ends of the lines. */}\n <EdgeOverlay links={links} elements={elements} container={container} routing=\"straight\" />\n {/* Inset, so nodes at the ends of a domain stay inside the plot. */}\n <div className=\"mv:absolute mv:inset-8\">\n {plot.points.map((point) => (\n <div\n key={point.key}\n data-occurrence={`${instanceId}${point.key}`}\n className={`mv:absolute mv:flex mv:items-center mv:gap-1 ${shape ? 'mv:-translate-x-3 mv:translate-y-3' : 'mv:-translate-x-1/2 mv:translate-y-1/2'}`}\n style={{ left: `${point.x * 100}%`, bottom: `${point.y * 100}%` }}\n >\n <div ref={register(point.key)}>\n <NodeCard node={point.node} repeat={false} nodes={region.nodes} onSelect={onNodeSelect} />\n </div>\n {shape && (\n <span className=\"mv:whitespace-nowrap mv:rounded mv:bg-surface/80 mv:px-0.5 mv:text-xs\">\n {point.node.title}\n </span>\n )}\n </div>\n ))}\n </div>\n </div>\n <div />\n <AxisTitle axis={layout.x} domain={plot.domains.x} />\n </div>\n\n {plot.unplaced.length > 0 && (\n <section className=\"mv:flex mv:flex-col mv:gap-2\">\n <span className=\"mv:text-xs mv:font-semibold mv:text-muted\">Not plotted</span>\n <ul className=\"mv:m-0 mv:flex mv:list-none mv:flex-wrap mv:gap-3 mv:p-0\">\n {plot.unplaced.map(({ key, node, reasons }) => (\n <li key={key} data-occurrence={`${instanceId}${key}`} className=\"mv:flex mv:items-center mv:gap-1\">\n <NodeCard node={node} repeat={false} nodes={region.nodes} onSelect={onNodeSelect} />\n <span className=\"mv:text-xs\">\n {shape && `${node.title} `}\n <span className=\"mv:text-muted\">({reasons.join('; ')})</span>\n </span>\n </li>\n ))}\n </ul>\n </section>\n )}\n </div>\n );\n}\n\n/** Axis title with the values at each end, in drawing order. */\nfunction AxisTitle({\n axis,\n domain: [min, max],\n vertical = false,\n}: {\n axis: AxisConfig;\n domain: readonly [number, number];\n vertical?: boolean;\n}) {\n const [start, end] = axis.direction === 'descending' ? [max, min] : [min, max];\n return (\n <div\n className={`mv:flex mv:items-center mv:justify-between mv:gap-2 mv:text-xs mv:text-muted ${vertical ? 'mv:flex-col-reverse mv:py-8' : 'mv:px-8'}`}\n >\n <span>{format(start)}</span>\n <span className={`mv:font-semibold ${vertical ? 'mv:[writing-mode:vertical-rl] mv:rotate-180' : ''}`}>\n {axis.label ?? axis.field}\n </span>\n <span>{format(end)}</span>\n </div>\n );\n}\n\nfunction format(value: number): string {\n return Number.isInteger(value) ? String(value) : value.toPrecision(3).replace(/\\.?0+$/, '');\n}\n","import { useId, useMemo } from 'react';\nimport type { SpaceGraph, SpaceNode } from 'structured-context/api';\nimport { type AnnotationIndex, filterAnnotations } from '../core/annotations';\nimport { type MapViewDefinition, type ParameterValues, type Region, resolveRegions } from '../core/definition';\nimport { AnnotationsContext } from './annotations-context';\nimport { LandscapeLayout } from './LandscapeLayout';\nimport { type LayoutProps, TreeLayout } from './TreeLayout';\nimport { XYLayout } from './XYLayout';\n\ntype Props = {\n definition: MapViewDefinition;\n graph: SpaceGraph;\n /** Current parameter values (host-owned session state); missing values use defaults. */\n values?: ParameterValues;\n /**\n * Validation results by node (see `annotationsFrom`). Which of them show, and at what severity, is\n * the region's `nodes.validation` setting; with none supplied, nothing is drawn.\n */\n annotations?: AnnotationIndex;\n onNodeSelect?: (node: SpaceNode) => void;\n};\n\nconst EMPTY: AnnotationIndex = new Map();\n\n/** Renders a map view definition against a space. Sizes to its container and scrolls within it. */\nexport function MapView({ definition, graph, values, annotations, onNodeSelect }: Props) {\n const instanceId = useId();\n const regions = useMemo(() => resolveRegions(definition, values), [definition, values]);\n // PROTOTYPE: only the first region is rendered. Arranging several regions is undesigned (#8).\n const region = regions[0]!;\n const props = { graph, instanceId, onNodeSelect };\n const { validation, validationSources } = region.nodes;\n const visibleAnnotations = useMemo(\n () => (annotations ? filterAnnotations(annotations, validation, validationSources) : EMPTY),\n [annotations, validation, validationSources],\n );\n\n return (\n <AnnotationsContext.Provider value={visibleAnnotations}>\n <div className=\"mv:h-full mv:w-full mv:overflow-auto mv:bg-surface mv:text-ink\">{layoutFor(region, props)}</div>\n </AnnotationsContext.Provider>\n );\n}\n\nfunction layoutFor(region: Region, props: Omit<LayoutProps, 'region'>) {\n const { layout } = region;\n switch (layout.type) {\n case 'tree':\n return <TreeLayout {...props} region={{ ...region, layout }} />;\n case 'landscape':\n return <LandscapeLayout {...props} region={{ ...region, layout }} />;\n case 'xy':\n return <XYLayout {...props} region={{ ...region, layout }} />;\n }\n}\n","import { useId } from 'react';\nimport type { Parameter, ParameterControl } from '../core/definition';\n\ntype InputProps<Kind extends ParameterControl['kind']> = {\n parameter: Parameter & { control: Extract<ParameterControl, { kind: Kind }> };\n value: unknown;\n onChange: (value: unknown) => void;\n};\n\nconst same = (a: unknown, b: unknown) => JSON.stringify(a) === JSON.stringify(b);\n\n/** A checkbox for a boolean parameter, labelled with the parameter's title. */\nexport function ToggleParameterInput({ parameter, value, onChange }: InputProps<'toggle'>) {\n const id = useId();\n return (\n <>\n <input id={id} type=\"checkbox\" checked={value === true} onChange={(e) => onChange(e.target.checked)} />\n <label htmlFor={id}>{parameter.title}</label>\n </>\n );\n}\n\n/** A dropdown for a parameter with one of several options. */\nexport function SelectParameterInput({ parameter, value, onChange }: InputProps<'select'>) {\n const id = useId();\n return (\n <>\n <label htmlFor={id} className=\"mv:text-muted\">\n {parameter.title}\n </label>\n <select id={id} value={JSON.stringify(value)} onChange={(e) => onChange(JSON.parse(e.target.value))}>\n {parameter.control.options.map((option) => (\n <option key={JSON.stringify(option)} value={JSON.stringify(option)}>\n {String(option)}\n </option>\n ))}\n </select>\n </>\n );\n}\n\n/** A checkbox group for a parameter taking any subset of its options. */\nexport function MultiSelectParameterInput({ parameter, value, onChange }: InputProps<'multiselect'>) {\n const { options } = parameter.control;\n const selected = Array.isArray(value) ? value : [];\n return (\n <fieldset className=\"mv:m-0 mv:flex mv:flex-wrap mv:items-center mv:gap-2 mv:border-0 mv:p-0\">\n <legend className=\"mv:float-left mv:mr-1.5 mv:p-0 mv:text-muted\">{parameter.title}</legend>\n {options.map((option) => {\n const checked = selected.some((v) => same(v, option));\n return (\n <label key={JSON.stringify(option)} className=\"mv:flex mv:items-center mv:gap-1\">\n <input\n type=\"checkbox\"\n checked={checked}\n onChange={() =>\n // Keep the options' order rather than the order of clicks.\n onChange(options.filter((o) => (o === option ? !checked : selected.some((v) => same(v, o)))))\n }\n />\n {String(option)}\n </label>\n );\n })}\n </fieldset>\n );\n}\n\n/** The input matching a parameter's control kind. */\nexport function ParameterInput({\n parameter,\n value,\n onChange,\n}: Omit<InputProps<ParameterControl['kind']>, 'parameter'> & { parameter: Parameter }) {\n const { control } = parameter;\n switch (control.kind) {\n case 'toggle':\n return <ToggleParameterInput parameter={{ ...parameter, control }} value={value} onChange={onChange} />;\n case 'select':\n return <SelectParameterInput parameter={{ ...parameter, control }} value={value} onChange={onChange} />;\n case 'multiselect':\n return <MultiSelectParameterInput parameter={{ ...parameter, control }} value={value} onChange={onChange} />;\n }\n}\n","import { useMemo } from 'react';\nimport {\n type MapViewDefinition,\n type Parameter,\n type ParameterValues,\n resolveParameterValues,\n} from '../core/definition';\n\n/** One parameter with its current value and a setter, ready for a host to lay out. */\nexport type ParameterControlState = {\n parameter: Parameter;\n /** The value in effect: the host's value, else the default, matching what renders. */\n value: unknown;\n setValue: (value: unknown) => void;\n};\n\n/**\n * The state behind a map view's parameter controls, with no markup, for hosts that lay the controls\n * out themselves. Pair each entry with `ParameterInput`, or with one of the typed inputs.\n */\nexport function useParameterControls(\n definition: MapViewDefinition,\n values: ParameterValues,\n onChange: (name: string, value: unknown) => void,\n): ParameterControlState[] {\n const resolved = useMemo(() => resolveParameterValues(definition, values), [definition, values]);\n return definition.parameters.map((parameter) => ({\n parameter,\n value: resolved[parameter.name],\n setValue: (value) => onChange(parameter.name, value),\n }));\n}\n","import type { MapViewDefinition, ParameterValues } from '../core/definition';\nimport { ParameterInput } from './ParameterInputs';\nimport { useParameterControls } from './useParameterControls';\n\ntype Props = {\n definition: MapViewDefinition;\n /** Host-owned values; missing or stale ones show as the default, matching what renders. */\n values: ParameterValues;\n onChange: (name: string, value: unknown) => void;\n};\n\n/**\n * Default layout for a map view's parameter controls: a wrapping row. Hosts wanting their own layout\n * use `useParameterControls` with `ParameterInput` (or the typed inputs) instead.\n */\nexport function ParameterControls({ definition, values, onChange }: Props) {\n const controls = useParameterControls(definition, values, onChange);\n if (controls.length === 0) return null;\n return (\n <div className=\"mv:flex mv:flex-wrap mv:items-center mv:gap-x-4 mv:gap-y-2 mv:text-sm\">\n {controls.map(({ parameter, value, setValue }) => (\n <div key={parameter.name} className=\"mv:flex mv:items-center mv:gap-1.5\" title={parameter.description}>\n <ParameterInput parameter={parameter} value={value} onChange={setValue} />\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;AAMA,IAAa,qBAAqB,8BAA+B,IAH/B,IAG+B,CAAI;AAErE,IAAa,uBAAuB,WAAW,kBAAkB;;;;;;;;ACUjE,SAAgB,SAAS,EAAE,MAA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AAG,OAAO;CAClC,OACE,oBAAC,OAAD;EAAK,WAAU;EACZ,UAAA,SAAS,KAAK,EAAE,WAAW,OAAO,eACjC,oBAAC,OAAD;GAA0B,WAAU;GAAqC,OAAO,UAAU;GACxF,UAAA,oBAAC,gBAAD;IAA2B;IAAkB;IAAO,UAAU;GAAW,CAAA;EACtE,GAFK,UAAU,IAEf,CACN;CACE,CAAA;AAET"}
@@ -539,7 +539,7 @@
539
539
  --mv-color-error: #cf222e;
540
540
  --mv-color-warning: #9a6700;
541
541
  --mv-color-info: #0969da;
542
- --art-ground: #ffffff;
542
+ --viewer-ground: #ffffff;
543
543
  color-scheme: light;
544
544
  }
545
545
  @media (prefers-color-scheme: dark) {
@@ -553,7 +553,7 @@
553
553
  --mv-color-error: #f85149;
554
554
  --mv-color-warning: #d29922;
555
555
  --mv-color-info: #4493f8;
556
- --art-ground: #0d1117;
556
+ --viewer-ground: #0d1117;
557
557
  color-scheme: dark;
558
558
  }
559
559
  }
@@ -567,35 +567,35 @@
567
567
  --mv-color-error: #f85149;
568
568
  --mv-color-warning: #d29922;
569
569
  --mv-color-info: #4493f8;
570
- --art-ground: #0d1117;
570
+ --viewer-ground: #0d1117;
571
571
  color-scheme: dark;
572
572
  }
573
- body { background: var(--art-ground); color: var(--mv-color-ink); }
574
- .art-root { display: flex; flex-direction: column; height: 100vh; }
575
- .art-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; padding: 0.5rem 1rem; border-bottom: 1px solid var(--mv-color-edge); }
576
- .art-body { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; }
577
- .art-map { flex: 1 1 24rem; min-width: 0; min-height: 50vh; }
578
- .art-panel { flex: 0 1 20rem; max-height: 100%; overflow: auto; padding: 0.75rem 1rem; border-left: 1px solid var(--mv-color-edge); }
579
- .art-panel h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
580
- .art-panel h3 { margin: 1rem 0 0.4rem; padding-top: 0.6rem; border-top: 1px solid var(--mv-color-edge); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mv-color-muted); }
581
- .art-panel section + section { margin-top: 1rem; }
582
- .art-close { float: right; border: 0; background: none; color: inherit; font-size: 1.25rem; cursor: pointer; }
583
- .art-type { margin: 0; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mv-color-muted); }
584
- .art-muted { color: var(--mv-color-muted); }
585
- .art-message { padding: 1rem; }
586
- .art-results { margin: 0; padding: 0; list-style: none; }
587
- .art-results li { margin-bottom: 0.6rem; }
588
- .art-severity { font-weight: 600; }
589
- .art-error { color: var(--mv-color-error); }
590
- .art-warning { color: var(--mv-color-warning); }
591
- .art-info { color: var(--mv-color-info); }
592
- .art-fields { margin: 0 0 0.75rem; }
593
- .art-fields div { margin-bottom: 0.4rem; }
594
- .art-fields dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mv-color-muted); }
595
- .art-fields dd { margin: 0; overflow-wrap: anywhere; }
596
- .art-content { white-space: pre-wrap; overflow-wrap: anywhere; }
573
+ body { background: var(--viewer-ground); color: var(--mv-color-ink); }
574
+ .viewer-root { display: flex; flex-direction: column; height: 100vh; }
575
+ .viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; padding: 0.5rem 1rem; border-bottom: 1px solid var(--mv-color-edge); }
576
+ .viewer-body { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; }
577
+ .viewer-map { flex: 1 1 24rem; min-width: 0; min-height: 50vh; }
578
+ .viewer-panel { flex: 0 1 20rem; max-height: 100%; overflow: auto; padding: 0.75rem 1rem; border-left: 1px solid var(--mv-color-edge); }
579
+ .viewer-panel h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
580
+ .viewer-panel h3 { margin: 1rem 0 0.4rem; padding-top: 0.6rem; border-top: 1px solid var(--mv-color-edge); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mv-color-muted); }
581
+ .viewer-panel section + section { margin-top: 1rem; }
582
+ .viewer-close { float: right; border: 0; background: none; color: inherit; font-size: 1.25rem; cursor: pointer; }
583
+ .viewer-type { margin: 0; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mv-color-muted); }
584
+ .viewer-muted { color: var(--mv-color-muted); }
585
+ .viewer-message { padding: 1rem; }
586
+ .viewer-results { margin: 0; padding: 0; list-style: none; }
587
+ .viewer-results li { margin-bottom: 0.6rem; }
588
+ .viewer-severity { font-weight: 600; }
589
+ .viewer-error { color: var(--mv-color-error); }
590
+ .viewer-warning { color: var(--mv-color-warning); }
591
+ .viewer-info { color: var(--mv-color-info); }
592
+ .viewer-fields { margin: 0 0 0.75rem; }
593
+ .viewer-fields div { margin-bottom: 0.4rem; }
594
+ .viewer-fields dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mv-color-muted); }
595
+ .viewer-fields dd { margin: 0; overflow-wrap: anywhere; }
596
+ .viewer-content { white-space: pre-wrap; overflow-wrap: anywhere; }
597
597
 
598
598
  </style>
599
599
  <div id="root"></div>
600
- <script type="importmap">{"imports":{"structured-context/browser":"https://cdn.jsdelivr.net/npm/structured-context@0.22.1/dist/browser.js/+esm","react":"https://cdn.jsdelivr.net/npm/react@19.3.0/+esm","react/jsx-runtime":"https://cdn.jsdelivr.net/npm/react@19.3.0/jsx-runtime/+esm","react-dom":"https://cdn.jsdelivr.net/npm/react-dom@19.3.0/+esm","react-dom/client":"https://cdn.jsdelivr.net/npm/react-dom@19.3.0/client/+esm","ajv/dist/2020":"https://cdn.jsdelivr.net/npm/ajv@8.20.0/dist/2020.js/+esm","json5":"https://cdn.jsdelivr.net/npm/json5@2.2.3/+esm","https://cdn.jsdelivr.net/npm/react@%5E19.3.0/+esm":"https://cdn.jsdelivr.net/npm/react@19.3.0/+esm"}}</script>
601
- <script type="module" src="https://cdn.jsdelivr.net/npm/structured-context-map-views@0.5.0/dist/artifact.js"></script>
600
+ <script type="importmap">{"imports":{"structured-context/browser":"https://cdn.jsdelivr.net/npm/structured-context@0.24.0/dist/browser.js/+esm","react":"https://cdn.jsdelivr.net/npm/react@19.3.0/+esm","react/jsx-runtime":"https://cdn.jsdelivr.net/npm/react@19.3.0/jsx-runtime/+esm","react-dom":"https://cdn.jsdelivr.net/npm/react-dom@19.3.0/+esm","react-dom/client":"https://cdn.jsdelivr.net/npm/react-dom@19.3.0/client/+esm","ajv/dist/2020":"https://cdn.jsdelivr.net/npm/ajv@8.20.0/dist/2020.js/+esm","json5":"https://cdn.jsdelivr.net/npm/json5@2.2.3/+esm","https://cdn.jsdelivr.net/npm/react@%5E19.3.0/+esm":"https://cdn.jsdelivr.net/npm/react@19.3.0/+esm"}}</script>
601
+ <script type="module" src="https://cdn.jsdelivr.net/npm/structured-context-map-views@0.6.1/dist/artifact.js"></script>