@niscorp/nova 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/dist/adapters/dom/components/index.cjs +4 -51
- package/dist/adapters/dom/components/index.cjs.map +1 -1
- package/dist/adapters/dom/index.cjs +22 -686
- package/dist/adapters/dom/index.cjs.map +1 -1
- package/dist/adapters/dom/index.js +3 -3
- package/dist/adapters/dom/server.cjs +14 -411
- package/dist/adapters/dom/server.cjs.map +1 -1
- package/dist/adapters/dom/server.js +3 -3
- package/dist/adapters/react/components/index.cjs +87 -562
- package/dist/adapters/react/components/index.cjs.map +1 -1
- package/dist/adapters/react/components/index.js +4 -4
- package/dist/adapters/react/index.cjs +97 -1815
- package/dist/adapters/react/index.cjs.map +1 -1
- package/dist/adapters/react/index.js +4 -4
- package/dist/adapters/tty/components/index.cjs +3 -44
- package/dist/adapters/tty/components/index.cjs.map +1 -1
- package/dist/adapters/tty/index.cjs +13 -5
- package/dist/adapters/tty/index.cjs.map +1 -1
- package/dist/adapters/tty/index.js +2 -2
- package/dist/adapters/vue/components/index.cjs +88 -639
- package/dist/adapters/vue/components/index.cjs.map +1 -1
- package/dist/adapters/vue/components/index.js +4 -4
- package/dist/adapters/vue/index.cjs +96 -962
- package/dist/adapters/vue/index.cjs.map +1 -1
- package/dist/adapters/vue/index.js +5 -5
- package/dist/agent/index.cjs +13 -151
- package/dist/agent/index.cjs.map +1 -1
- package/dist/chunk-5YQIAS4V.cjs +184 -0
- package/dist/chunk-5YQIAS4V.cjs.map +1 -0
- package/dist/{chunk-F2H7WP6R.js → chunk-7MATRNZZ.js} +5 -5
- package/dist/{chunk-F2H7WP6R.js.map → chunk-7MATRNZZ.js.map} +1 -1
- package/dist/chunk-AGEAMUQR.cjs +436 -0
- package/dist/chunk-AGEAMUQR.cjs.map +1 -0
- package/dist/chunk-D4PUWBN6.cjs +72 -0
- package/dist/chunk-D4PUWBN6.cjs.map +1 -0
- package/dist/chunk-ECFWPZGL.cjs +2117 -0
- package/dist/chunk-ECFWPZGL.cjs.map +1 -0
- package/dist/{chunk-VOD5JA4D.js → chunk-EG45GQOE.js} +3 -3
- package/dist/{chunk-VOD5JA4D.js.map → chunk-EG45GQOE.js.map} +1 -1
- package/dist/chunk-FSUMCJAR.cjs +646 -0
- package/dist/chunk-FSUMCJAR.cjs.map +1 -0
- package/dist/chunk-GV7UC3SS.cjs +33 -0
- package/dist/chunk-GV7UC3SS.cjs.map +1 -0
- package/dist/chunk-HYFNOF7Y.cjs +97 -0
- package/dist/chunk-HYFNOF7Y.cjs.map +1 -0
- package/dist/chunk-KOYRJXTI.cjs +123 -0
- package/dist/chunk-KOYRJXTI.cjs.map +1 -0
- package/dist/chunk-KW34ZKF5.cjs +12 -0
- package/dist/chunk-KW34ZKF5.cjs.map +1 -0
- package/dist/chunk-M3UFIUXK.cjs +318 -0
- package/dist/chunk-M3UFIUXK.cjs.map +1 -0
- package/dist/chunk-OE527MXF.cjs +49 -0
- package/dist/chunk-OE527MXF.cjs.map +1 -0
- package/dist/{chunk-DU2VIJAF.js → chunk-P5SJ3QXJ.js} +3 -3
- package/dist/{chunk-DU2VIJAF.js.map → chunk-P5SJ3QXJ.js.map} +1 -1
- package/dist/chunk-PBPUSZIQ.cjs +808 -0
- package/dist/chunk-PBPUSZIQ.cjs.map +1 -0
- package/dist/chunk-PMKWYOOX.cjs +64 -0
- package/dist/chunk-PMKWYOOX.cjs.map +1 -0
- package/dist/chunk-PNQY6OFB.cjs +132 -0
- package/dist/chunk-PNQY6OFB.cjs.map +1 -0
- package/dist/chunk-Q7SFCCGT.cjs +11 -0
- package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
- package/dist/{chunk-SVNK5NIK.js → chunk-QLFHYHJ2.js} +4 -4
- package/dist/{chunk-SVNK5NIK.js.map → chunk-QLFHYHJ2.js.map} +1 -1
- package/dist/{chunk-G4LSLLGI.js → chunk-RB4OMSPA.js} +5 -5
- package/dist/{chunk-G4LSLLGI.js.map → chunk-RB4OMSPA.js.map} +1 -1
- package/dist/chunk-UGG7MCX4.cjs +34 -0
- package/dist/chunk-UGG7MCX4.cjs.map +1 -0
- package/dist/chunk-WGZZKCJQ.cjs +157 -0
- package/dist/chunk-WGZZKCJQ.cjs.map +1 -0
- package/dist/{chunk-3JRTELLC.js → chunk-X5JTZ5LW.js} +3 -3
- package/dist/{chunk-3JRTELLC.js.map → chunk-X5JTZ5LW.js.map} +1 -1
- package/dist/{chunk-Y6XVPRYH.js → chunk-XUSKGJRI.js} +2 -2
- package/dist/chunk-XUSKGJRI.js.map +1 -0
- package/dist/chunk-Z7CS43ZT.cjs +808 -0
- package/dist/chunk-Z7CS43ZT.cjs.map +1 -0
- package/dist/chunk-ZYTWQZZC.cjs +623 -0
- package/dist/chunk-ZYTWQZZC.cjs.map +1 -0
- package/dist/devtools/index.cjs +13 -697
- package/dist/devtools/index.cjs.map +1 -1
- package/dist/devtools/index.js +2 -2
- package/dist/document/index.cjs +56 -301
- package/dist/document/index.cjs.map +1 -1
- package/dist/examples/index.cjs +6 -31
- package/dist/examples/index.cjs.map +1 -1
- package/dist/i18n/index.cjs +44 -292
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/index.cjs +335 -3954
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/migrations/index.cjs +7 -590
- package/dist/migrations/index.cjs.map +1 -1
- package/dist/reflect/index.cjs +85 -994
- package/dist/reflect/index.cjs.map +1 -1
- package/dist/reflect/index.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-Y6XVPRYH.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapters/vue/types.ts","../../../src/adapters/vue/context.ts","../../../src/layout/head.ts","../../../src/layout/adapter.ts","../../../src/shared/event-bus/scope-dispatch.ts","../../../src/shell/slot-names.ts","../../../src/shell/head.ts","../../../src/shell/view.ts","../../../src/document/place-head.ts","../../../src/document/head-keeper.ts","../../../src/document/shell-head.ts","../../../src/adapters/vue/head.ts","../../../src/adapters/vue/provider.ts","../../../src/adapters/vue/error-marker.ts","../../../src/adapters/vue/render-node.ts","../../../src/adapters/vue/render-tree.ts","../../../src/adapters/vue/error-boundary.ts","../../../src/adapters/primitive-props.ts","../../../src/adapters/vue/components/layout.ts","../../../src/adapters/vue/composables/context.ts","../../../src/adapters/vue/components/controls.ts","../../../src/adapters/vue/components/introspection.ts","../../../src/adapters/vue/composables/shell.ts","../../../src/adapters/vue/components/slots.ts","../../../src/adapters/vue/components/index.ts","../../../src/adapters/vue/nova.ts"],"names":["TAGS","defineComponent","inject","onMounted","watch","shallowRef","provide","h","createTextVNode","Fragment","onErrorCaptured","z","onBeforeUnmount","toValue"],"mappings":";;;;;;AAsCO,IAAM,eAAA,GAAkB,CAAC,KAAA,KAC9B,OAAO,UAAU,UAAA,IAAe,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU;;;ACQlE,IAAM,aAAA,mBAAsD,MAAA,CAAO,GAAA,CAAI,mCAAmC;AAC1G,IAAM,YAAA,mBAA8C,MAAA,CAAO,GAAA,CAAI,kCAAkC;;;ACjBjG,IAAM,SAAA,GAAY,WAAA;AAClB,IAAM,eAAA,GAAkB,YAAA;AACxB,IAAM,cAAA,GAAiB,WAAA;AACvB,IAAM,cAAA,GAAiB,WAAA;AACvB,IAAM,gBAAA,GAAmB,aAAA;AAmBzB,IAAM,SAAA,GAAY,CAAC,OAAA,KAAyE;AACjG,EAAA,MAAM,IAAA,GAAO,CAAC,IAAA,KAAqC;AACjD,IAAA,MAAM,KAAA,GAAQ,OAAO,OAAA,CAAQ,OAAA,CAAQ,UAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAC,GAAG,MAAM,GAAA,CAAI,WAAA,OAAkB,IAAI,CAAA,GAAI,CAAC,CAAA,CAAE,IAAA,GAAO,WAAA,EAAY;AACrH,IAAA,OAAO,KAAA,KAAU,MAAA,IAAa,KAAA,KAA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} from '@layout';\nimport type { NovaEvent } from '@shared/event-bus';\n\n// ═══════════════════════════════════════════════════════════\n// Dispatch / publish contracts exposed to rendered components\n// via provide/inject. Components never touch the shell directly.\n// ═══════════════════════════════════════════════════════════\n\nexport type NovaDispatch = (event: NovaEvent) => void;\nexport type NovaPublish = (channel: string, payload?: unknown) => void;\n\n// ═══════════════════════════════════════════════════════════\n// Framework-injected props. Layout `props` are spread on top; a node's\n// children arrive as the DEFAULT SLOT — an array of per-child vnodes keyed by\n// core's renderNodeKey, so a component can address them individually.\n// ═══════════════════════════════════════════════════════════\n\nexport type NovaModelBinding = {\n ref: string;\n path: string;\n};\n\nexport type NovaComponentProps = {\n novaModel?: NovaModelBinding;\n novaRef?: string;\n};\n\n// Any Vue component — a `defineComponent` result or a plain functional\n// component. A functional component with no declared `props` receives the\n// node's props, novaRef and novaModel all as props. A static `.meta` is picked\n// up by the registry (`register` / `registerAll`).\nexport type NovaComponent = Component & {\n meta?: ComponentMeta;\n};\n\n// The registry holds arbitrary values; the walker renders only what can be a\n// Vue component — a function (functional / constructor) or an options object.\nexport const isNovaComponent = (value: unknown): value is NovaComponent =>\n typeof value === 'function' || (typeof value === 'object' && value !== null);\n","import type { Component, InjectionKey } from 'vue';\nimport type { ActionDefinition } from '@action';\nimport type { ComponentRegistry } from '@layout';\nimport type { Shell } from '@shell';\nimport type { NovaComponent, NovaDispatch, NovaPublish } from './types';\n\n// ═══════════════════════════════════════════════════════════\n// Two injections, the twins of the React adapter's two contexts:\n// - NovaRenderKey: registry + dispatch + publish (+ optional slotWrapper /\n// fallback). Required to render a layout. Does NOT require a shell.\n// - NovaShellKey: the shell. Shell-aware composables need it.\n//\n// Keys are `Symbol.for`, not `Symbol()`: a CJS consumer loading the adapter\n// and its components subpath as two bundles gets two module copies, and a\n// private symbol per copy would make one's provide invisible to the other's\n// inject. A registered symbol is one identity however many copies load.\n//\n// Both values are GETTER objects over the provider's props, so a component\n// that injected once reads the provider's current registry / dispatch /\n// shell — a prop swap reaches every descendant without re-providing.\n// ═══════════════════════════════════════════════════════════\n\n// An app-supplied component that wraps each action instance's rendered content\n// at the ActionSlot seam (animation, gating, logging). It receives identity\n// only — these props — and the content as its default slot; all three are\n// undefined while the slot is empty or exiting. Nova owns no timing.\nexport type SlotWrapperProps = {\n canvasId?: string;\n instanceId?: string;\n action?: ActionDefinition;\n};\nexport type SlotWrapper = Component;\n\nexport type NovaRenderContextValue = {\n // unknown-typed: a shell's registry is untyped, and the walker narrows each\n // entry (isNovaComponent) rather than trusting a cast\n readonly registry: ComponentRegistry;\n readonly dispatch: NovaDispatch;\n readonly publish: NovaPublish;\n readonly slotWrapper?: SlotWrapper;\n // rendered for an unregistered component name — a permissive host supplies\n // one; strict consumers omit it and get a COMPONENT_NOT_FOUND marker\n readonly fallback?: NovaComponent;\n};\n\nexport type NovaShellSource = { readonly shell: Shell };\n\nexport const NovaRenderKey: InjectionKey<NovaRenderContextValue> = Symbol.for('@niscorp/nova/adapters/vue:render');\nexport const NovaShellKey: InjectionKey<NovaShellSource> = Symbol.for('@niscorp/nova/adapters/vue:shell');\n","// ═══════════════════════════════════════════════════════════\n// THE HEAD — `nova:head` is the document's <head>, as a node in a layout.\n//\n// A document has a part nobody sees on the screen: its title, the sentence\n// that describes it, the card shown where a link to it is pasted. That part\n// is written the way the rest of the screen is — a layout node, its children\n// bound to the action's data — and travels the way the rest does, in the\n// render tree.\n//\n// Its children are the elements a head holds, named as HTML names them:\n// `nova:title`, `nova:meta`, `nova:link`, `nova:script`. A child's props are\n// that element's ATTRIBUTES, written as given. Nova keeps no list of them, so\n// any `name`, `property` or `rel` there is — or will be — can be said without\n// nova learning it.\n//\n// Nothing here is drawn on the screen. No adapter builds an element for a head\n// or for anything in it, and no registry has to hold the names. Whoever writes\n// the document reads the elements off the tree (`headOf`) and writes them into\n// its <head>.\n//\n// WHAT A HEAD DOES NOT HOLD is what runs or styles: a script that executes, a\n// stylesheet, a <base>, an instruction to the browser (`http-equiv`), a handler\n// attribute. A layout is data, and data that reaches every page must not be\n// able to run. Those stay in the app's own index.html, which holds anything.\n//\n// This file holds no schema on purpose: a terminal that only reads a head off\n// the wire needs the names and the shape, and nothing to validate with.\n// ═══════════════════════════════════════════════════════════\n\n// Namespaced as a package's own in-layout components are (`loom:field`), so\n// none can be a name an app's kit already uses for something else.\nexport const HEAD_NAME = 'nova:head';\nexport const HEAD_TITLE_NAME = 'nova:title';\nexport const HEAD_META_NAME = 'nova:meta';\nexport const HEAD_LINK_NAME = 'nova:link';\nexport const HEAD_SCRIPT_NAME = 'nova:script';\n\n// The head and what it holds: the names a layout may use with no registry\n// entry behind them.\nexport const HEAD_NAMES: readonly string[] = [HEAD_NAME, HEAD_TITLE_NAME, HEAD_META_NAME, HEAD_LINK_NAME, HEAD_SCRIPT_NAME];\n\n// One element of a head, as data: what to write, wherever a head is written.\nexport type HeadElement = {\n tag: 'title' | 'meta' | 'link' | 'script';\n // as the layout gave them, in the order it gave them\n attributes: Record<string, string>;\n // a title's words; a script's data, as JSON\n text?: string;\n};\n\n// What two elements both say, when they say the same thing — the later one\n// then takes the earlier one's place. A document has one title, one <meta> of\n// a given name or property, one canonical address. Anything else stands beside\n// its like: two alternates, two data blocks.\nexport const headKeyOf = (element: Pick<HeadElement, 'tag' | 'attributes'>): string | undefined => {\n const said = (name: string): string | undefined => {\n const found = Object.entries(element.attributes).find(([key]) => key.toLowerCase() === name)?.[1].trim().toLowerCase();\n return found === undefined || found === '' ? undefined : found;\n };\n if (element.tag === 'title') return 'title';\n if (element.tag === 'meta') {\n const [name, property] = [said('name'), said('property')];\n if (name !== undefined) return `meta name ${name}`;\n return property === undefined ? undefined : `meta property ${property}`;\n }\n if (element.tag === 'link') return (said('rel') ?? '').split(/\\s+/).includes('canonical') ? 'link canonical' : undefined;\n return undefined;\n};\n","import type { RenderNode } from './types';\n\n// ═══════════════════════════════════════════════════════════\n// Adapter helpers — framework-agnostic pieces every adapter\n// (React, Vue, …) needs to render a RenderNode tree the same\n// way. See packages/nova/ADAPTER.md for the full contract.\n// ═══════════════════════════════════════════════════════════\n\n// Names of the props an adapter injects on rendered components:\n// `RenderNode.model` → NOVA_MODEL_PROP ({ ref, path }),\n// `RenderNode.ref` → NOVA_REF_PROP (string). Constants so all\n// adapters inject identically and components can rely on them.\nexport const NOVA_MODEL_PROP = 'novaModel';\nexport const NOVA_REF_PROP = 'novaRef';\n\n// Stable identity for a RenderNode within its sibling list.\n// Loop identity (stamped from LoopNode.key/index) wins over ref: a shared\n// `ref` across looped rows is an event-target id, not a list key.\nexport const renderNodeKey = (node: RenderNode, index: number): string => {\n if (node.key !== undefined) return `k:${node.key}`;\n if (node.type === 'component') {\n if (node.ref !== undefined) return `c:${node.ref}`;\n return `c:${node.name}:${index}`;\n }\n if (node.type === 'text') return `t:${index}`;\n if (node.type === 'fragment') return `f:${index}`;\n return `e:${node.code}:${index}`;\n};\n","import type { NovaEvent } from './schemas';\n\n// Wraps a dispatch function so every event passing through it gets stamped\n// with `origin` (the dispatching action instance's id) unless it already\n// carries one — a re-dispatch keeps its original origin. Adapters wrap the\n// dispatch they hand to an instance's rendered subtree with this, so the\n// runtime delivers UI events to that instance's own triggers only. This is\n// routing semantics: never reimplement it per adapter.\nexport const scopeDispatch = (\n dispatch: (event: NovaEvent) => void,\n origin: string,\n): ((event: NovaEvent) => void) => {\n return (event) => dispatch(event.origin === undefined ? { ...event, origin } : event);\n};\n","// ═══════════════════════════════════════════════════════════\n// Slot component name constants.\n//\n// Every framework adapter (React, future Vue/Svelte/etc.) must\n// register components under these names in its ComponentRegistry\n// to participate in shell/canvas layout rendering:\n//\n// CANVAS_SLOT_NAME — renders a canvas by id (props: canvasId?)\n// ACTION_SLOT_NAME — renders an action instance by id (props: instanceId?)\n//\n// The shell uses these names in its default layouts and when\n// flattening a render tree for non-React consumers (evaluators,\n// export, testing), so they are part of the package's public\n// contract — not React-only.\n// ═══════════════════════════════════════════════════════════\n\nexport const CANVAS_SLOT_NAME = 'CanvasSlot';\nexport const ACTION_SLOT_NAME = 'ActionSlot';\n","import { HEAD_LINK_NAME, HEAD_META_NAME, HEAD_NAME, HEAD_SCRIPT_NAME, HEAD_TITLE_NAME, headKeyOf } from '../layout/head';\nimport type { HeadElement } from '../layout/head';\nimport type { RenderNode } from '../layout';\nimport type { RenderApi } from './types';\nimport { ACTION_SLOT_NAME, CANVAS_SLOT_NAME } from './slot-names';\n\n// ═══════════════════════════════════════════════════════════\n// The head a screen has, read off its render tree.\n//\n// The frame is walked in the order it is drawn, into each canvas where its\n// slot stands and into each instance on it, and every `nova:head` it meets\n// gives its elements in turn. A screen can hold more than one head — the\n// shell's chrome says what holds on every screen, an action says its own, a\n// dialog opens over a page. An element that says the same thing as an earlier\n// one (the title, a <meta> of that name) takes its place; anything else stands\n// beside what came before.\n//\n// What a head may not hold is refused here, once, for every writer: the\n// element is left out and the reason is given. See ../layout/head.\n// ═══════════════════════════════════════════════════════════\n\nexport type ScreenHead = {\n // what the document's head is to hold, in the order the screen said it\n elements: HeadElement[];\n // the actions whose instances said any of it (none: only the shell's chrome did)\n actions: string[];\n // what a head held that it may not — left out, each with why\n refused: string[];\n};\n\ntype ComponentNode = Extract<RenderNode, { type: 'component' }>;\ntype Read = { element: HeadElement } | { refused: string } | undefined;\n\nconst ATTRIBUTE_NAME = /^[A-Za-z][A-Za-z0-9:._-]*$/;\n// a data block: a type no browser runs\nconst DATA_TYPE = /^application\\/([a-z0-9.-]+\\+)?json$/i;\n\n// A prop, as the attribute it is written as — or nothing, when it says nothing.\nconst written = (value: unknown): string | undefined => {\n if (typeof value === 'string') return value.trim() === '' ? undefined : value;\n if (typeof value === 'number') return String(value);\n return value === true ? '' : undefined;\n};\n\n// An element's attributes, from its props — or why it may not be written.\nconst attributesOf = (what: string, props: Record<string, unknown>, skip: readonly string[] = []): { attributes: Record<string, string> } | { refused: string } => {\n const attributes: Record<string, string> = {};\n for (const [name, value] of Object.entries(props)) {\n if (skip.includes(name)) continue;\n if (!ATTRIBUTE_NAME.test(name)) return { refused: `${what}: \"${name}\" is not an attribute’s name` };\n if (/^on/i.test(name)) return { refused: `${what}: \\`${name}\\` is a handler, and a layout does not run` };\n const text = written(value);\n if (text !== undefined) attributes[name] = text;\n }\n return { attributes };\n};\n\nconst has = (attributes: Record<string, string>, name: string): boolean => Object.keys(attributes).some((key) => key.toLowerCase() === name);\nconst valueOf = (attributes: Record<string, string>, name: string): string => Object.entries(attributes).find(([key]) => key.toLowerCase() === name)?.[1] ?? '';\n\nconst textOf = (nodes: readonly RenderNode[]): string =>\n nodes.map((node) => (node.type === 'text' ? node.value : node.type === 'fragment' ? textOf(node.children) : '')).join('');\n\nconst titleOf = (node: ComponentNode): Read => {\n const text = textOf(node.children).trim();\n return text === '' ? undefined : { element: { tag: 'title', attributes: {}, text } };\n};\n\nconst metaOf = (node: ComponentNode): Read => {\n const read = attributesOf(HEAD_META_NAME, node.props);\n if ('refused' in read) return read;\n if (has(read.attributes, 'http-equiv')) return { refused: `${HEAD_META_NAME}: \\`http-equiv\\` instructs the browser, and a layout does not` };\n // nothing to say yet: its value is not answered\n return has(read.attributes, 'content') ? { element: { tag: 'meta', attributes: read.attributes } } : undefined;\n};\n\nconst linkOf = (node: ComponentNode): Read => {\n const read = attributesOf(HEAD_LINK_NAME, node.props);\n if ('refused' in read) return read;\n if (valueOf(read.attributes, 'rel').toLowerCase().split(/\\s+/).includes('stylesheet')) return { refused: `${HEAD_LINK_NAME}: a stylesheet styles the page, and a layout does not` };\n return has(read.attributes, 'href') ? { element: { tag: 'link', attributes: read.attributes } } : undefined;\n};\n\nconst scriptOf = (node: ComponentNode): Read => {\n const read = attributesOf(HEAD_SCRIPT_NAME, node.props, ['data']);\n if ('refused' in read) return read;\n if (has(read.attributes, 'src')) return { refused: `${HEAD_SCRIPT_NAME}: a script with a \\`src\\` runs, and a layout does not` };\n const type = valueOf(read.attributes, 'type');\n if (!DATA_TYPE.test(type)) return { refused: `${HEAD_SCRIPT_NAME}: only a data block may be written (a JSON \\`type\\`), and \"${type}\" is not one` };\n const data = node.props['data'];\n if (data === undefined || data === null || data === '') return undefined;\n return { element: { tag: 'script', attributes: read.attributes, text: JSON.stringify(data) } };\n};\n\nconst READERS: Record<string, (node: ComponentNode) => Read> = {\n [HEAD_TITLE_NAME]: titleOf,\n [HEAD_META_NAME]: metaOf,\n [HEAD_LINK_NAME]: linkOf,\n [HEAD_SCRIPT_NAME]: scriptOf,\n};\n\nexport const isHeadNode = (node: RenderNode): boolean => node.type === 'component' && node.name === HEAD_NAME;\n\nexport const headOf = (api: Pick<RenderApi, 'frame' | 'canvasTree'>): ScreenHead | undefined => {\n let heads = 0;\n const said: { element: HeadElement; action: string | undefined }[] = [];\n const refused: string[] = [];\n // a canvas whose own tree names it again would never end\n const open = new Set<string>();\n\n const hold = (nodes: readonly RenderNode[], action: string | undefined): void => {\n for (const node of nodes) {\n if (node.type === 'fragment') {\n hold(node.children, action);\n continue;\n }\n if (node.type === 'error') {\n refused.push(`${HEAD_NAME}: ${node.message}`);\n continue;\n }\n // text between a head's elements is nothing\n if (node.type !== 'component') continue;\n const read = READERS[node.name];\n if (read === undefined) {\n refused.push(`${HEAD_NAME}: \"${node.name}\" is not something a head holds`);\n continue;\n }\n const found = read(node);\n if (found === undefined) continue;\n if ('refused' in found) {\n refused.push(found.refused);\n continue;\n }\n const key = headKeyOf(found.element);\n const earlier = key === undefined ? -1 : said.findIndex((other) => headKeyOf(other.element) === key);\n if (earlier >= 0) said.splice(earlier, 1);\n said.push({ element: found.element, action });\n }\n };\n\n const walk = (nodes: readonly RenderNode[], action: string | undefined): void => {\n for (const node of nodes) {\n if (node.type === 'fragment') {\n walk(node.children, action);\n continue;\n }\n if (node.type !== 'component') continue;\n if (node.name === HEAD_NAME) {\n heads += 1;\n hold(node.children, action);\n continue;\n }\n if (node.name === CANVAS_SLOT_NAME) {\n const canvasId = node.props['canvasId'];\n if (typeof canvasId !== 'string' || canvasId === '' || open.has(canvasId)) continue;\n open.add(canvasId);\n walk(api.canvasTree(canvasId), undefined);\n open.delete(canvasId);\n continue;\n }\n const definitionId = node.name === ACTION_SLOT_NAME ? node.props['definitionId'] : undefined;\n walk(node.children, typeof definitionId === 'string' ? definitionId : action);\n }\n };\n\n walk(api.frame(), undefined);\n if (heads === 0) return undefined;\n const actions = [...new Set(said.flatMap((one) => (one.action === undefined ? [] : [one.action])))];\n return { elements: said.map((one) => one.element), actions, refused };\n};\n","import type { RenderNode } from '../layout';\nimport type { RenderApi, Shell } from './types';\nimport { isHeadNode } from './head';\nimport { chainsInFlight } from './chains';\nimport { ACTION_SLOT_NAME } from './slot-names';\n\n// ═══════════════════════════════════════════════════════════\n// A shell, as something an adapter draws.\n//\n// Every adapter that draws a SERVED screen draws it through `RenderApi` — the\n// frame, a tree per canvas, events up, messages across — and has always been\n// handed one by a transport (moss's socket wire). A shell that lives in the\n// same process as its adapter is the other case that type was written for, and\n// this is it: the shell's own trees, read as they stand, and its own dispatch.\n// The DOM and TTY adapters draw a local shell through this exactly as they draw\n// a remote one; nothing about them knows the difference.\n//\n// It is also what makes a shell DRAWABLE AHEAD OF TIME. A build runs the app's\n// own boot, waits for the screen to be whole (`shellSettled`), and has an\n// adapter draw this view to markup; the browser runs the same boot and draws\n// the same view over that markup. Where the shell lives was never the\n// adapter's business.\n// ═══════════════════════════════════════════════════════════\n\nexport type ShellView = {\n api: RenderApi;\n // Called after the shell changed — coalesced, so a burst of changes (a press\n // that sets three keys) is one call. Returns the unsubscribe.\n subscribe: (listener: () => void) => () => void;\n};\n\n// NO VISIBLE CONTENT IS AN EMPTY TREE. A canvas whose layout renders nothing but\n// empty text and empty wrappers is handed to an adapter as `[]`, so an adapter\n// collapses the chrome around it on `length` alone, knowing nothing about node\n// shapes. An ActionSlot marker is a boundary, not content — what is inside it\n// decides — and a head is the document's, not something the screen shows.\n// One rule for a canvas that is served and one that is local, so a frame looks\n// the same over both.\nexport const hasVisibleContent = (nodes: readonly RenderNode[]): boolean =>\n nodes.some((node) => {\n if (node.type === 'text') return node.value !== '';\n if (node.type === 'fragment') return hasVisibleContent(node.children);\n if (node.type === 'component' && node.name === ACTION_SLOT_NAME) return hasVisibleContent(node.children);\n if (isHeadNode(node)) return false;\n return true;\n });\n\n// One canvas, as an adapter is handed it.\nexport const canvasTreeOf = (shell: Shell, canvasId: string): RenderNode[] => {\n const tree = shell.flattenRenderTree(shell.getCanvasRenderTree(canvasId));\n return hasVisibleContent(tree) ? tree : [];\n};\n\nexport const shellView = (shell: Shell): ShellView => ({\n api: {\n frame: () => shell.getShellRenderTree(),\n canvasTree: (canvasId) => canvasTreeOf(shell, canvasId),\n // An event that names no origin belongs to the canvas's ACTIVE instance — on\n // a card deck that is the only one drawn. One that names its own (an\n // adapter stamps it at the instance boundary, `scopeDispatch`) keeps it. A\n // canvas with nothing mounted dispatches unstamped.\n dispatch: (canvasId, event) => {\n const active = shell.getState().canvases[canvasId]?.active;\n shell.dispatch(event.origin === undefined && active !== undefined ? { ...event, origin: active.id } : event);\n },\n publish: (channel, payload) => shell.publish(channel, payload),\n },\n subscribe: (listener) => {\n let pending = false;\n let stopped = false;\n const changed = (): void => {\n if (pending || stopped) return;\n pending = true;\n queueMicrotask(() => {\n pending = false;\n if (!stopped) listener();\n });\n };\n const offState = shell.onStateChange(changed);\n const offData = shell.onDataChange(changed);\n return () => {\n stopped = true;\n offState();\n offData();\n };\n },\n});\n\n// A WAIT ON THE SHELL, shared by the two below. Resolves `true` once `isBusy`\n// answers no and still answers no a macrotask later — a mount can open another\n// action, which starts initializing in turn, so the question is asked again on\n// every change. Resolves `false` when `waitMs` runs out first, or `stopped`\n// says to give up.\ntype ShellWaitOptions = { waitMs?: number; stopped?: () => boolean };\n\nconst shellQuietWithin = async (shell: Shell, isBusy: () => boolean, options: ShellWaitOptions): Promise<boolean> => {\n const waitMs = options.waitMs ?? DEFAULT_SETTLE_WAIT_MS;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const deadline = new Promise<boolean>((resolve) => {\n timer = setTimeout(() => resolve(false), waitMs);\n });\n const quiet = (async (): Promise<boolean> => {\n for (;;) {\n if (options.stopped?.() === true) return false;\n if (!isBusy()) {\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n if (!isBusy()) return true;\n }\n await new Promise<void>((resolve) => {\n const off = shell.onStateChange(() => {\n off();\n resolve();\n });\n // a change that lands with no notification must not leave this waiting\n setTimeout(() => {\n off();\n resolve();\n }, 10);\n });\n }\n })();\n const settled = await Promise.race([quiet, deadline]);\n clearTimeout(timer);\n return settled;\n};\n\nconst isMounting = (shell: Shell): boolean =>\n Object.values(shell.getState().canvases).some((canvas) => canvas.stack.some((instance) => instance.status === 'initializing'));\n\n// THE FIRST SCREEN IS WHOLE. An instance is `initializing` until its mount hook\n// — the loads, and whatever they chain to — has been awaited, so \"nothing is\n// initializing\" is the shell saying its opening screen is complete.\n//\n// Resolves `false` when `waitMs` runs out first: the screen is then drawn as it\n// stands, with whatever is still loading drawn as loading. Default 300ms — a\n// page should not hang on one slow endpoint.\n//\n// It asks about MOUNTS and nothing else, on purpose. A page is read whenever it\n// is asked for — also while a call somebody pressed minutes ago is still out —\n// and that read must not wait on it. `shellIdle` is the wider question.\nexport const DEFAULT_SETTLE_WAIT_MS = 300;\n\nexport const shellSettled = (shell: Shell, options: { waitMs?: number; stopped?: () => boolean } = {}): Promise<boolean> =>\n shellQuietWithin(shell, () => isMounting(shell), options);\n\n// NOTHING THE SHELL STARTED IS STILL RUNNING. Nothing is mounting, and no chain\n// is in flight (./chains.ts): no trigger's steps, no message on its way to its\n// listeners, no hook a navigation started. It is what a check awaits after it\n// presses something — the call the press made has answered, what that chained\n// to has run, and an action a `pop` revealed has re-read itself — and what\n// anything that runs an action for somebody else awaits before it reads the\n// screen.\n//\n// It is about THIS shell's own work. A followed read's next body arrives when\n// somebody else writes, and is not waited for; neither is anything outside the\n// shell that an endpoint set going. A call that never answers holds it until\n// the call's own timeout fails it (30s by default), so `waitMs` is what bounds\n// the wait — it resolves `false` when that runs out, as `shellSettled` does.\nexport const shellIdle = (shell: Shell, options: { waitMs?: number; stopped?: () => boolean } = {}): Promise<boolean> =>\n shellQuietWithin(shell, () => isMounting(shell) || chainsInFlight(shell) > 0, options);\n","import { headKeyOf } from '../layout/head';\nimport type { HeadElement } from '../layout/head';\n\n// ═══════════════════════════════════════════════════════════\n// A screen's head, written into an HTML document.\n//\n// The document is the app's own `index.html` with a screen already drawn into\n// it. Its <head> is what holds on every page; the screen's head elements are\n// what this page says. An element that says the same thing as a tag the\n// document already has — its <title>, a <meta> of that name or property, its\n// canonical address — takes that tag's place, where it stood. Anything else is\n// added after what is there. Everything the screen does not speak of is left\n// exactly as it was: the icon, the viewport, the stylesheet.\n//\n// TWO THINGS ARE KEPT FOR THE PAGE ITSELF, which goes on living after the file\n// is read (./head-keeper). What was written is marked (`data-nova-head`), so\n// the page can tell the screen's elements from the document's own. And a tag\n// that gave up its place is kept, inert, in a <template data-nova-own>: when\n// the screen moves on to one that no longer says it, the document's own comes\n// back.\n//\n// WHERE the document lives is known to whoever writes the file: the site plus\n// the path it was drawn at. With a `site`, every path is given its own\n// canonical address, whether or not its screen has a head. That address is the\n// document's own for this path — unmarked, and it stays when the screen moves\n// on. A screen that says a canonical address itself is taken at its word.\n//\n// With nothing to write, the document comes back untouched.\n// ═══════════════════════════════════════════════════════════\n\nexport type HeadPlace = {\n // The address the site is served at (\"https://example.com\"). With it, each\n // path's canonical address is written.\n site?: string;\n // The path this document was drawn at.\n path?: string;\n};\n\nexport const HEAD_MARK = 'data-nova-head';\nexport const OWN_MARK = 'data-nova-own';\n\nconst escapeAttribute = (value: string): string => value.replace(/&/g, '&').replace(/\"/g, '"').replace(/</g, '<');\nconst escapeText = (value: string): string => value.replace(/&/g, '&').replace(/</g, '<');\n// Inside a <script>, the one thing that may not appear is the start of a tag.\n// The two separators end a line in a script though not in JSON, so they are\n// written as escapes too (named by code: the characters themselves would end\n// a line here as well).\nconst LINE_ENDS = [0x2028, 0x2029];\nconst escapeScript = (json: string): string =>\n LINE_ENDS.reduce((text, code) => text.split(String.fromCharCode(code)).join(`\\\\u${code.toString(16)}`), json.replace(/</g, '\\\\u003c'));\n\n// What stands in a head, read a tag at a time: comments and the bodies of\n// scripts, styles and templates are passed over whole, so a tag written inside\n// one is not mistaken for a tag.\nconst ATTRIBUTES = `((?:[^>\"']|\"[^\"]*\"|'[^']*')*)`;\nconst TAGS = new RegExp(`<!--[\\\\s\\\\S]*?-->|<(script|style|title|template)\\\\b${ATTRIBUTES}>([\\\\s\\\\S]*?)<\\\\/\\\\1\\\\s*>|<(meta|link)\\\\b${ATTRIBUTES}>`, 'gi');\nconst ATTRIBUTE = /([^\\s\"'=<>/]+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'=<>`]+)))?/g;\n\ntype Tag = { start: number; end: number; name: string; attributes: Record<string, string>; inner: string; text: string };\n\nconst attributesOf = (source: string): Record<string, string> => {\n const attributes: Record<string, string> = {};\n for (const match of source.matchAll(ATTRIBUTE)) {\n const name = match[1]?.toLowerCase();\n if (name === undefined || name in attributes) continue;\n attributes[name] = match[2] ?? match[3] ?? match[4] ?? '';\n }\n return attributes;\n};\n\nconst tagsOf = (section: string): Tag[] => {\n const tags: Tag[] = [];\n for (const match of section.matchAll(TAGS)) {\n const name = (match[1] ?? match[4])?.toLowerCase();\n if (name === undefined) continue;\n tags.push({ start: match.index, end: match.index + match[0].length, name, attributes: attributesOf(match[2] ?? match[5] ?? ''), inner: match[3] ?? '', text: match[0] });\n }\n return tags;\n};\n\n// What a tag in the document says, in the same terms as an element.\nconst keyOfTag = (tag: Tag): string | undefined =>\n tag.name === 'title' || tag.name === 'meta' || tag.name === 'link' ? headKeyOf({ tag: tag.name, attributes: tag.attributes }) : undefined;\n\n// An element, as the tag it is written as.\nconst markupOf = (element: HeadElement, marked: boolean): string => {\n const written = Object.entries(element.attributes).map(([name, value]) => (value === '' ? ` ${name}` : ` ${name}=\"${escapeAttribute(value)}\"`));\n const attributes = [...written, ...(marked ? [` ${HEAD_MARK}`] : [])].join('');\n if (element.tag === 'title') return `<title${attributes}>${escapeText(element.text ?? '')}</title>`;\n if (element.tag === 'script') return `<script${attributes}>${escapeScript(element.text ?? '')}</script>`;\n return `<${element.tag}${attributes}>`;\n};\n\n// Where the document lives, as elements: what a `site` and a path say.\nconst addressOf = (place: HeadPlace): HeadElement[] => {\n if (place.site === undefined || place.path === undefined) return [];\n const path = place.path.split(/[?#]/)[0] ?? '';\n const address = `${place.site.replace(/\\/+$/, '')}${path.startsWith('/') ? path : `/${path}`}`;\n return [\n { tag: 'link', attributes: { rel: 'canonical', href: address } },\n { tag: 'meta', attributes: { property: 'og:url', content: address } },\n ];\n};\n\nconst changed = (text: string, changes: readonly { start: number; end: number; text: string }[]): string =>\n [...changes].sort((a, b) => b.start - a.start).reduce((at, change) => `${at.slice(0, change.start)}${change.text}${at.slice(change.end)}`, text);\n\n// A head that was written before, put back as the document had it: what the\n// last screen said is taken out, and what the document gave up for it is given\n// back. A head never written comes back as it is.\nconst restored = (section: string): string =>\n changed(\n section,\n tagsOf(section).flatMap((tag) => {\n if (tag.name === 'template' && OWN_MARK in tag.attributes) return [{ start: tag.start, end: tag.end, text: tag.inner }];\n return HEAD_MARK in tag.attributes ? [{ start: tag.start, end: tag.end, text: '' }] : [];\n }),\n );\n\n// Elements, written into a head. `screen`: they are what a screen says — each\n// is marked, and a tag that gives up its place is kept for the page. Otherwise\n// they are the document's own from here on, and what they replace is gone.\nconst write = (section: string, elements: readonly HeadElement[], screen: boolean): string => {\n if (elements.length === 0) return section;\n const tags = tagsOf(section);\n const changes: { start: number; end: number; text: string }[] = [];\n const added: string[] = [];\n const own: string[] = [];\n for (const element of elements) {\n const key = headKeyOf(element);\n const [first, ...others] = key === undefined ? [] : tags.filter((tag) => keyOfTag(tag) === key);\n if (first === undefined) {\n added.push(markupOf(element, screen));\n continue;\n }\n changes.push({ start: first.start, end: first.end, text: markupOf(element, screen) });\n own.push(first.text);\n // said twice, the second would still say the old thing\n for (const other of others) {\n changes.push({ start: other.start, end: other.end, text: '' });\n own.push(other.text);\n }\n }\n if (screen && own.length > 0) added.push(`<template ${OWN_MARK}>${own.join('')}</template>`);\n\n const written = changed(section, changes);\n // What is added goes after the last thing in the head, a line each, indented\n // as that last thing is — or straight on, in a head written on one line.\n const tail = /\\s*$/.exec(written)?.[0] ?? '';\n const body = written.slice(0, written.length - tail.length);\n const indent = /(?:^|\\n)([ \\t]*)\\S[^\\n]*$/.exec(body)?.[1] ?? '';\n const lead = tail.includes('\\n') ? `\\n${indent}` : '';\n return `${body}${added.map((tag) => `${lead}${tag}`).join('')}${tail}`;\n};\n\nexport const placeHead = (html: string, elements: readonly HeadElement[] | undefined, place: HeadPlace = {}): string => {\n const opening = /<head\\b[^>]*>/i.exec(html);\n if (opening === null) return html;\n const from = opening.index + opening[0].length;\n const closing = html.slice(from).search(/<\\/head\\s*>/i);\n if (closing < 0) return html;\n // Where the document lives is the document's own, for this path: written\n // first and unmarked, so a screen that says an address of its own takes its\n // place — and gives it back.\n const located = write(restored(html.slice(from, from + closing)), addressOf(place), false);\n return `${html.slice(0, from)}${write(located, elements ?? [], true)}${html.slice(from + closing)}`;\n};\n","import { headKeyOf } from '../layout/head';\nimport type { HeadElement } from '../layout/head';\nimport { HEAD_MARK, OWN_MARK } from './place-head';\n\n// ═══════════════════════════════════════════════════════════\n// A page's <head>, kept on the screen.\n//\n// A drawn page arrives with its head written (`placeHead`). From then on the\n// shell is live and the screen moves without the page being fetched again, so\n// the head is kept on whatever the screen says now: its elements are put in\n// `document.head`, and taken out again when the screen stops saying them.\n//\n// THE DOCUMENT'S OWN TAGS GIVE WAY AND COME BACK. A tag the page was written\n// with — the title in index.html, its description — is taken out while the\n// screen says the same thing itself, and put back where it stood when the\n// screen no longer does. A drawn page has already given some up: they arrive\n// inert, in the <template data-nova-own> the writer left, and come back the\n// same way.\n//\n// A KEEPER THAT WAS NEVER HANDED AN ELEMENT NEVER WRITES. Two shells can share\n// a page (an inspector beside the app), and the one with nothing to say must\n// not touch what the other wrote — nor what the page arrived with.\n// ═══════════════════════════════════════════════════════════\n\nexport type HeadKeeper = (elements: readonly HeadElement[] | undefined) => void;\n\ntype Away = { key: string; node: Element; before: Node | null };\n\nconst TAGS = ['title', 'meta', 'link'];\n\n// What a tag standing in the page says, in the same terms as an element.\nconst keyOfNode = (node: Element): string | undefined => {\n const tag = TAGS.find((name) => name === node.tagName.toLowerCase());\n if (tag !== 'title' && tag !== 'meta' && tag !== 'link') return undefined;\n return headKeyOf({ tag, attributes: Object.fromEntries([...node.attributes].map((attribute) => [attribute.name, attribute.value])) });\n};\n\nexport const createHeadKeeper = (doc: Document): HeadKeeper => {\n // the screen's elements standing in the head\n let mine: Element[] = [];\n // the document's own tags that have given up their place\n let away: Away[] = [];\n let said: string | undefined;\n\n const built = (element: HeadElement): Element => {\n const node = doc.createElement(element.tag);\n for (const [name, value] of Object.entries(element.attributes)) node.setAttribute(name, value);\n node.setAttribute(HEAD_MARK, '');\n if (element.text !== undefined) node.textContent = element.text;\n return node;\n };\n\n // What the page arrived with: the elements a writer put there for the first\n // screen, and the tags that gave way to them.\n const adopt = (): void => {\n mine = [...doc.head.querySelectorAll(`[${HEAD_MARK}]`)];\n // the document's own window, not a global: a page's document is not always\n // the one the code was loaded in\n const view = doc.defaultView;\n for (const stash of doc.head.querySelectorAll(`template[${OWN_MARK}]`)) {\n if (view === null || !(stash instanceof view.HTMLTemplateElement)) continue;\n for (const child of [...stash.content.children]) {\n const key = keyOfNode(child);\n if (key !== undefined) away.push({ key, node: doc.importNode(child, true), before: null });\n }\n stash.remove();\n }\n };\n\n return (elements) => {\n const now = elements ?? [];\n const next = JSON.stringify(now);\n if (said === undefined) {\n if (now.length === 0) return;\n adopt();\n }\n if (next === said) return;\n said = next;\n\n for (const node of mine) node.remove();\n mine = now.map(built);\n const keys = new Set(now.flatMap((element) => headKeyOf(element) ?? []));\n\n // the document's own that now say what the screen says: out, each remembering where it stood\n for (const node of [...doc.head.children]) {\n const key = keyOfNode(node);\n if (key === undefined || !keys.has(key)) continue;\n away.push({ key, node, before: node.nextSibling });\n node.remove();\n }\n // Those the screen no longer says: back where each stood. The last to leave\n // goes back first — what stood after an earlier one may have left after it,\n // and has to be standing again for the earlier one to go in front of it.\n const [back, still] = [away.filter((gone) => !keys.has(gone.key)), away.filter((gone) => keys.has(gone.key))];\n for (const gone of [...back].reverse()) doc.head.insertBefore(gone.node, gone.before !== null && gone.before.parentNode === doc.head ? gone.before : null);\n away = still;\n\n doc.head.append(...mine);\n };\n};\n","import { headOf, shellView } from '../shell';\nimport type { Shell } from '../shell';\nimport { createHeadKeeper } from './head-keeper';\nimport type { HeadKeeper } from './head-keeper';\n\n// ═══════════════════════════════════════════════════════════\n// The page's head, for an adapter that draws a shell living in its own page\n// through a framework (react, vue).\n//\n// Such an adapter reads the shell's trees through its own subscriptions, so\n// there is no one render to read the head off: reading it means rendering the\n// shell's trees once more. That is worth doing only while a head is on the\n// screen. So a head node says when it arrives and when it goes (`enter`,\n// `leave`), and the shell is only read between the two.\n// ═══════════════════════════════════════════════════════════\n\nexport type ShellHead = {\n enter: () => void;\n leave: () => void;\n // follow the shell's changes; returns the stop\n watch: () => () => void;\n};\n\nexport const createShellHead = (shell: Shell): ShellHead => {\n const view = shellView(shell);\n let present = 0;\n let keep: HeadKeeper | undefined;\n let queued = false;\n // once a turn, however many heads came and went in it\n const read = (): void => {\n // nothing to keep where a screen is drawn to a string\n if (queued || typeof document === 'undefined') return;\n queued = true;\n queueMicrotask(() => {\n queued = false;\n keep ??= createHeadKeeper(document);\n keep(present > 0 ? headOf(view.api)?.elements : undefined);\n });\n };\n return {\n enter: () => {\n present += 1;\n read();\n },\n leave: () => {\n present -= 1;\n read();\n },\n watch: () =>\n view.subscribe(() => {\n if (present > 0) read();\n }),\n };\n};\n","import { defineComponent, inject, onMounted, provide, shallowRef, watch, type InjectionKey, type ShallowRef } from 'vue';\nimport type { Shell } from '@shell';\nimport { createShellHead, type ShellHead } from '../../document/shell-head';\n\n// ═══════════════════════════════════════════════════════════\n// A head node (`nova:head`), in Vue — the twin of the React adapter's.\n//\n// It draws nothing, and neither does anything it holds. Where the shell lives\n// in this page it says that it is on the screen, so the page's head is read\n// off the shell only while there is one to read (document/shell-head). Under a\n// served screen there is no shell here and nothing to say to: the terminal\n// keeps the head off the wire.\n//\n// Everything here starts in `onMounted`, which does not run where a screen is\n// drawn to a string — so none of it touches a document that is not a browser's.\n// ═══════════════════════════════════════════════════════════\n\n// `Symbol.for`, as the adapter's other keys are (./context).\nconst ShellHeadKey: InjectionKey<ShallowRef<ShellHead>> = Symbol.for('@niscorp/nova/adapters/vue:head');\n\nexport const HeadMark = defineComponent(\n () => {\n const head = inject(ShellHeadKey, undefined);\n onMounted(() => {\n if (head === undefined) return;\n // a swapped shell has another head: leave the one, enter the other\n watch(\n head,\n (current, _previous, onCleanup) => {\n current.enter();\n onCleanup(current.leave);\n },\n { immediate: true },\n );\n });\n return () => null;\n },\n { name: 'NovaHeadMark' },\n);\n\n// Called in a provider's setup: every head below it reports to this shell's,\n// and the shell is watched for as long as the provider stands.\nexport const provideShellHead = (shell: () => Shell): void => {\n let held = shell();\n const head = shallowRef(createShellHead(held));\n provide(ShellHeadKey, head);\n onMounted(() => {\n watch(\n shell,\n (next, _previous, onCleanup) => {\n if (next !== held) {\n held = next;\n head.value = createShellHead(next);\n }\n onCleanup(head.value.watch());\n },\n { immediate: true },\n );\n });\n};\n","import { defineComponent, h, provide } from 'vue';\nimport type { ComponentRegistry } from '@layout';\nimport type { Shell } from '@shell';\nimport { NovaRenderKey, NovaShellKey, type NovaRenderContextValue, type NovaShellSource, type SlotWrapper } from './context';\nimport { provideShellHead } from './head';\nimport type { NovaComponent, NovaDispatch, NovaPublish } from './types';\n\nconst noopDispatch: NovaDispatch = () => {};\nconst noopPublish: NovaPublish = () => {};\n\n// ═══════════════════════════════════════════════════════════\n// <NovaRenderProvider>\n//\n// The framework-agnostic renderer context. Pairs a component registry with a\n// dispatch and publish function. Works with no shell — dispatch and publish\n// default to no-ops so static layouts render without event infrastructure.\n// ═══════════════════════════════════════════════════════════\n\nexport type NovaRenderProviderProps = {\n registry: ComponentRegistry;\n dispatch?: NovaDispatch;\n publish?: NovaPublish;\n slotWrapper?: SlotWrapper;\n // renderer for unregistered component names; omit for strict error markers\n fallback?: NovaComponent;\n};\n\nexport const NovaRenderProvider = defineComponent(\n (props: NovaRenderProviderProps, { slots }) => {\n const value: NovaRenderContextValue = {\n get registry() {\n return props.registry;\n },\n get dispatch() {\n return props.dispatch ?? noopDispatch;\n },\n get publish() {\n return props.publish ?? noopPublish;\n },\n get slotWrapper() {\n return props.slotWrapper;\n },\n get fallback() {\n return props.fallback;\n },\n };\n provide(NovaRenderKey, value);\n return () => slots.default?.();\n },\n { name: 'NovaRenderProvider', props: ['registry', 'dispatch', 'publish', 'slotWrapper', 'fallback'] },\n);\n\n// ═══════════════════════════════════════════════════════════\n// <NovaShellProvider>\n//\n// <NovaRenderProvider> plus the shell. The registry defaults to\n// `shell.registry`; dispatch and publish go to the shell.\n// ═══════════════════════════════════════════════════════════\n\nexport type NovaShellProviderProps = {\n shell: Shell;\n registry?: ComponentRegistry;\n slotWrapper?: SlotWrapper;\n};\n\nexport const NovaShellProvider = defineComponent(\n (props: NovaShellProviderProps, { slots }) => {\n const source: NovaShellSource = {\n get shell() {\n return props.shell;\n },\n };\n provide(NovaShellKey, source);\n provideShellHead(() => props.shell);\n const dispatch: NovaDispatch = (event) => props.shell.dispatch(event);\n const publish: NovaPublish = (channel, payload) => props.shell.publish(channel, payload);\n return () =>\n h(\n NovaRenderProvider,\n { registry: props.registry ?? props.shell.registry, dispatch, publish, slotWrapper: props.slotWrapper },\n { default: () => slots.default?.() },\n );\n },\n { name: 'NovaShellProvider', props: ['shell', 'registry', 'slotWrapper'] },\n);\n","import { defineComponent, h } from 'vue';\n\nexport type ErrorMarkerProps = {\n code: string;\n message: string;\n};\n\n// Renders error RenderNodes surfaced by the renderer in lax mode.\n// Consumers can style via the `data-nova-error` attribute.\nexport const ErrorMarker = defineComponent(\n (props: ErrorMarkerProps) => () => h('span', { 'data-nova-error': props.code, role: 'alert' }, `[${props.code}] ${props.message}`),\n { name: 'NovaErrorMarker', props: ['code', 'message'] },\n);\n","import { Fragment, createTextVNode, defineComponent, h, inject, type VNode } from 'vue';\nimport { NOVA_MODEL_PROP, NOVA_REF_PROP, renderNodeKey, type RenderNode } from '@layout';\nimport { isHeadNode } from '@shell';\nimport { NovaRenderKey, type NovaRenderContextValue } from './context';\nimport { ErrorMarker } from './error-marker';\nimport { HeadMark } from './head';\nimport { RenderTree } from './render-tree';\nimport { isNovaComponent } from './types';\n\nexport type RenderNodeViewProps = {\n node: RenderNode;\n};\n\n// A node's children as the component's default slot: one keyed RenderNodeView\n// per child (not one RenderTree wrapper), so a component can address them\n// individually — a Grid wraps each in a weighted cell.\nconst childViews = (children: RenderNode[]): VNode[] =>\n children.map((child, i) => h(RenderNodeView, { node: child, key: renderNodeKey(child, i) }));\n\nconst renderNode = (ctx: NovaRenderContextValue, node: RenderNode): VNode => {\n if (node.type === 'text') return createTextVNode(node.value);\n if (node.type === 'fragment') return h(RenderTree, { nodes: node.children });\n if (node.type === 'error') return h(ErrorMarker, { code: node.code, message: node.message });\n\n // a head is the document's, not the screen's: nothing is drawn for it or for what it holds\n if (isHeadNode(node)) return h(HeadMark);\n\n // node.type === 'component' — an unknown name never throws\n const registered = ctx.registry.get(node.name)?.component;\n const component = isNovaComponent(registered) ? registered : ctx.fallback;\n if (component === undefined) return h(ErrorMarker, { code: 'COMPONENT_NOT_FOUND', message: node.name });\n const props: Record<string, unknown> = { ...node.props };\n if (node.model !== undefined) props[NOVA_MODEL_PROP] = { ref: node.model.ref, path: node.model.path };\n if (node.ref !== undefined) props[NOVA_REF_PROP] = node.ref;\n const { children } = node;\n if (children.length === 0) return h(component, props);\n if (!children.some(isHeadNode)) return h(component, props, { default: () => childViews(children) });\n // A head among them is not handed to the component — a kit that gives every\n // child a cell would give it an empty one. It stands beside the component.\n const shown = children.filter((child) => !isHeadNode(child));\n return h(Fragment, [\n shown.length === 0 ? h(component, props) : h(component, props, { default: () => childViews(shown) }),\n ...children.filter(isHeadNode).map((_head, i) => h(HeadMark, { key: `head:${i}` })),\n ]);\n};\n\nexport const RenderNodeView = defineComponent(\n (props: RenderNodeViewProps) => {\n const ctx = inject(NovaRenderKey, undefined);\n if (ctx === undefined) throw new Error('RenderNodeView must be used inside <NovaRenderProvider>');\n return () => renderNode(ctx, props.node);\n },\n { name: 'NovaRenderNode', props: ['node'] },\n);\n","import { defineComponent, h } from 'vue';\nimport { renderNodeKey, type RenderNode } from '@layout';\nimport { RenderNodeView } from './render-node';\n\nexport type RenderTreeProps = {\n nodes: RenderNode[];\n};\n\n// A fragment of keyed node views — list identity is core's renderNodeKey.\nexport const RenderTree = defineComponent(\n (props: RenderTreeProps) => () => props.nodes.map((node, i) => h(RenderNodeView, { node, key: renderNodeKey(node, i) })),\n { name: 'NovaRenderTree', props: ['nodes'] },\n);\n","import { defineComponent, h, onErrorCaptured, shallowRef, type VNodeChild } from 'vue';\n\n// ═══════════════════════════════════════════════════════════\n// Vue's error boundary is a hook, not a class: onErrorCaptured stops the\n// error propagating (return false) and swaps the subtree for a fallback.\n// ═══════════════════════════════════════════════════════════\n\nexport type NovaErrorBoundaryProps = {\n fallback?: (error: Error) => VNodeChild;\n onError?: (error: Error, info: string) => void;\n};\n\nexport const NovaErrorBoundary = defineComponent(\n (props: NovaErrorBoundaryProps, { slots }) => {\n const caught = shallowRef<Error | undefined>(undefined);\n onErrorCaptured((err, _instance, info) => {\n const error = err instanceof Error ? err : new Error(String(err));\n caught.value = error;\n props.onError?.(error, info);\n return false;\n });\n return () => {\n const error = caught.value;\n if (error === undefined) return slots.default?.();\n if (props.fallback !== undefined) return props.fallback(error);\n return h('div', { 'data-nova-error-boundary': 'true', role: 'alert' }, error.message);\n };\n },\n { name: 'NovaErrorBoundary', props: ['fallback', 'onError'] },\n);\n","import { z } from 'zod';\n\n// ═══════════════════════════════════════════════════════════\n// The headless primitive vocabulary's AUTHORING contracts — one Zod props\n// schema per primitive, framework-free, shared by every adapter kit that ships\n// the vocabulary (react, vue). A schema is what a layout node may set; the\n// kits differ in how they paint, never in what they accept, so the schema\n// lives once, here, and each kit's component carries it as its static `meta`.\n// ═══════════════════════════════════════════════════════════\n\n// ─── Stack ───\nexport const StackPropsSchema = z\n .object({\n direction: z\n .enum(['row', 'column'])\n .optional()\n .describe('Flex direction. Default: column.'),\n gap: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Gap between children in pixels. Default: 0.'),\n align: z\n .enum(['start', 'center', 'end', 'stretch'])\n .optional()\n .describe('Cross-axis alignment. Default: stretch.'),\n justify: z\n .enum(['start', 'center', 'end', 'between', 'around'])\n .optional()\n .describe('Main-axis justification. Default: start.'),\n padding: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Inner padding in pixels. Default: 0.'),\n wrap: z\n .boolean()\n .optional()\n .describe('Whether children wrap to a new line. Default: false.'),\n })\n .strict()\n .describe('Flex container that arranges children in a row or column.');\n\nexport type StackProps = z.infer<typeof StackPropsSchema>;\n\n// ─── Text ───\nexport const TextPropsSchema = z\n .object({\n as: z\n .enum(['span', 'p', 'h1', 'h2', 'h3', 'h4'])\n .optional()\n .describe('HTML element to render. Default: span.'),\n size: z\n .enum(['sm', 'md', 'lg', 'xl', '2xl'])\n .optional()\n .describe('Font size token. Default: md.'),\n weight: z\n .enum(['normal', 'medium', 'bold'])\n .optional()\n .describe('Font weight token. Default: normal.'),\n color: z\n .string()\n .optional()\n .describe('CSS color string (open set). Default: inherit.'),\n })\n .strict()\n .describe('Text element with semantic typography props.');\n\nexport type TextProps = z.infer<typeof TextPropsSchema>;\n\n// ─── Input ───\nexport const InputPropsSchema = z\n .object({\n type: z\n .enum(['text', 'number', 'email', 'password'])\n .optional()\n .describe('Input type. Default: text.'),\n placeholder: z\n .string()\n .optional()\n .describe('Placeholder text shown when empty.'),\n disabled: z\n .boolean()\n .optional()\n .describe('Whether the input is disabled. Default: false.'),\n value: z\n .string()\n .optional()\n .describe('Current value. Typically supplied via model binding.'),\n debounce: z\n .number()\n .optional()\n .describe('Milliseconds to coalesce keystrokes before dispatching ui:model. Default: 0 (every keystroke). Set it when the shell is remote to cut round-trips.'),\n })\n .strict()\n .describe('Text input bound to data via the `model` field on the layout node.');\n\nexport type InputProps = z.infer<typeof InputPropsSchema>;\n\n// ─── Button ───\nexport const ButtonPropsSchema = z\n .object({\n label: z\n .string()\n .optional()\n .describe('Button label. If absent, children are used.'),\n variant: z\n .enum(['primary', 'secondary', 'ghost'])\n .optional()\n .describe('Visual variant. Default: primary.'),\n disabled: z\n .boolean()\n .optional()\n .describe('Whether the button is disabled. Default: false.'),\n })\n .strict()\n .describe(\"Clickable button. Click events fire as `ui:click` with the layout node's ref.\");\n\nexport type ButtonProps = z.infer<typeof ButtonPropsSchema>;\n\n// ─── Box ───\nexport const BoxPropsSchema = z\n .object({\n padding: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Inner padding in pixels. Default: 0.'),\n background: z\n .string()\n .optional()\n .describe('CSS background color or value.'),\n border: z\n .boolean()\n .optional()\n .describe('Whether to show a 1px border. Default: false.'),\n radius: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Border radius in pixels. Default: 0.'),\n })\n .strict()\n .describe('Generic container with basic styling props. Use Stack for layout, Box for visual wrapping.');\n\nexport type BoxProps = z.infer<typeof BoxPropsSchema>;\n\n// ─── Panel ───\nexport const PanelPropsSchema = z\n .object({\n title: z.string().optional().describe('Optional header title.'),\n backRef: z.string().optional().describe('When set, the header grows a ← (before the title) that fires ui:click with this ref.'),\n closeRef: z.string().optional().describe('When set, the header grows a ✕ that fires ui:click with this ref.'),\n })\n .strict()\n .describe('A framed, elevated surface with an optional title.');\n\nexport type PanelProps = z.infer<typeof PanelPropsSchema>;\n\n// ─── JsonTree ───\nexport const JsonTreePropsSchema = z\n .object({\n value: z.unknown().optional().describe('The value to render.'),\n label: z.string().optional().describe('A name for the root node.'),\n })\n .strict()\n .describe('A collapsible view of any JSON value.');\n\nexport type JsonTreeProps = z.infer<typeof JsonTreePropsSchema>;\n\n// ─── CanvasSlot ───\nexport const CanvasSlotPropsSchema = z\n .object({\n canvasId: z\n .string()\n .optional()\n .describe('Id of the canvas to render. Usually bound from a loop, e.g. \"$.c.id\".'),\n })\n .strict()\n .describe('Renders a canvas by id, recursing into its actionLayout. Resolves to nothing when canvasId is missing.');\n\nexport type CanvasSlotProps = z.infer<typeof CanvasSlotPropsSchema>;\n\n// ─── ActionSlot ───\n// The AUTHORING contract: what a layout node may set on an ActionSlot —\n// instanceId only, strict. The identity props flattenRenderTree stamps on a\n// served marker (canvasId / definitionId) are runtime OUTPUT, never authored;\n// widening this schema would advertise them to the layout agent's palette.\nexport const ActionSlotPropsSchema = z\n .object({\n instanceId: z\n .string()\n .optional()\n .describe('Id of the action instance to render. Usually bound from canvas scope, e.g. \"$.active.id\" or \"$.i.id\".'),\n })\n .strict()\n .describe('Renders an action instance by id. Resolves to nothing when instanceId is missing.');\n\nexport type ActionSlotProps = z.infer<typeof ActionSlotPropsSchema>;\n\n","import { defineComponent, h } from 'vue';\nimport {\n BoxPropsSchema,\n StackPropsSchema,\n TextPropsSchema,\n type BoxProps,\n type StackProps,\n type TextProps,\n} from '../../primitive-props';\n\n// ═══════════════════════════════════════════════════════════\n// The layout primitives — Stack, Box, Text. Headless reference looks (inline\n// styles, as the React kit's); an app's kit is where its real look lives.\n// ═══════════════════════════════════════════════════════════\n\nexport { StackPropsSchema, type StackProps, BoxPropsSchema, type BoxProps, TextPropsSchema, type TextProps };\n\nconst px = (value: number | undefined): string => `${value ?? 0}px`;\n\n// ─── Stack ─────────────────────────────────────────────────\n\nconst ALIGN_MAP = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n stretch: 'stretch',\n} as const;\n\nconst JUSTIFY_MAP = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n between: 'space-between',\n around: 'space-around',\n} as const;\n\nexport const Stack = Object.assign(\n defineComponent(\n (props: StackProps, { slots }) =>\n () =>\n h(\n 'div',\n {\n style: {\n display: 'flex',\n flexDirection: props.direction ?? 'column',\n gap: px(props.gap),\n alignItems: ALIGN_MAP[props.align ?? 'stretch'],\n justifyContent: JUSTIFY_MAP[props.justify ?? 'start'],\n padding: px(props.padding),\n flexWrap: props.wrap === true ? 'wrap' : 'nowrap',\n },\n },\n slots.default?.(),\n ),\n { name: 'NovaStack', props: ['direction', 'gap', 'align', 'justify', 'padding', 'wrap'], inheritAttrs: false },\n ),\n { meta: { description: 'Flex container that arranges children in a row or column.', propsSchema: StackPropsSchema } },\n);\n\n// ─── Box ───────────────────────────────────────────────────\n\nexport const Box = Object.assign(\n defineComponent(\n (props: BoxProps, { slots }) =>\n () =>\n h(\n 'div',\n {\n style: {\n padding: px(props.padding),\n background: props.background ?? 'transparent',\n border: props.border === true ? '1px solid #e5e7eb' : 'none',\n borderRadius: px(props.radius),\n },\n },\n slots.default?.(),\n ),\n { name: 'NovaBox', props: ['padding', 'background', 'border', 'radius'], inheritAttrs: false },\n ),\n {\n meta: {\n description: 'Generic container with basic styling props. Use Stack for layout, Box for visual wrapping.',\n propsSchema: BoxPropsSchema,\n },\n },\n);\n\n// ─── Text ──────────────────────────────────────────────────\n\nconst SIZE_MAP = {\n sm: '12px',\n md: '14px',\n lg: '16px',\n xl: '20px',\n '2xl': '24px',\n} as const;\n\nconst WEIGHT_MAP = {\n normal: 400,\n medium: 500,\n bold: 700,\n} as const;\n\nexport const Text = Object.assign(\n defineComponent(\n (props: TextProps, { slots }) =>\n () =>\n h(\n props.as ?? 'span',\n {\n style: {\n fontSize: SIZE_MAP[props.size ?? 'md'],\n fontWeight: WEIGHT_MAP[props.weight ?? 'normal'],\n color: props.color ?? 'inherit',\n },\n },\n slots.default?.(),\n ),\n { name: 'NovaText', props: ['as', 'size', 'weight', 'color'], inheritAttrs: false },\n ),\n { meta: { description: 'Text element with semantic typography props.', propsSchema: TextPropsSchema } },\n);\n","import { inject } from 'vue';\nimport type { ComponentRegistry } from '@layout';\nimport type { Shell } from '@shell';\nimport { NovaRenderKey, NovaShellKey, type NovaRenderContextValue, type NovaShellSource, type SlotWrapper } from '../context';\nimport type { NovaDispatch, NovaPublish } from '../types';\n\n// ═══════════════════════════════════════════════════════════\n// The render-context composables. Call them in setup (or a functional\n// component's render). dispatch / publish come back as stable functions that\n// read the provider's CURRENT value on every call, so a provider whose\n// dispatch changes (a scoped slot, a swapped shell) is honoured without the\n// component re-running setup.\n// ═══════════════════════════════════════════════════════════\n\nconst renderContext = (caller: string): NovaRenderContextValue => {\n const ctx = inject(NovaRenderKey, undefined);\n if (ctx === undefined) throw new Error(`${caller} must be used inside <NovaRenderProvider>`);\n return ctx;\n};\n\nexport const useNovaDispatch = (): NovaDispatch => {\n const ctx = renderContext('useNovaDispatch');\n return (event) => ctx.dispatch(event);\n};\n\nexport const useNovaPublish = (): NovaPublish => {\n const ctx = renderContext('useNovaPublish');\n return (channel, payload) => ctx.publish(channel, payload);\n};\n\n// The component registry exposed via <NovaRenderProvider> — for components\n// that introspect or look up other registered components (agent tooling,\n// dev inspectors).\nexport const useNovaRegistry = (): ComponentRegistry => renderContext('useNovaRegistry').registry;\n\n// The optional app-supplied slotWrapper; undefined when none was provided (or\n// outside a provider). Never throws: a missing wrapper is the common case.\nexport const useSlotWrapper = (): SlotWrapper | undefined => inject(NovaRenderKey, undefined)?.slotWrapper;\n\n// The shell source — the subscribing composables read `.shell` inside a watch\n// so a swapped shell resubscribes.\nexport const useShellSource = (): NovaShellSource => {\n const source = inject(NovaShellKey, undefined);\n if (source === undefined) throw new Error('useShell must be used inside <NovaShellProvider>');\n return source;\n};\n\nexport const useShell = (): Shell => useShellSource().shell;\n","import { defineComponent, h, onBeforeUnmount, shallowRef, type CSSProperties } from 'vue';\nimport { ButtonPropsSchema, InputPropsSchema, type ButtonProps, type InputProps } from '../../primitive-props';\nimport { useNovaDispatch } from '../composables/context';\nimport type { NovaComponentProps } from '../types';\n\n// ═══════════════════════════════════════════════════════════\n// The interactive primitives — Button, Input. Interaction is ref + event:\n// a click fires `ui:click` carrying the node's ref (injected as `novaRef`); a\n// model-bound input fires `ui:model` carrying the binding's ref.\n// ═══════════════════════════════════════════════════════════\n\nexport { ButtonPropsSchema, type ButtonProps, InputPropsSchema, type InputProps };\n\n// ─── Button ────────────────────────────────────────────────\n\ntype Variant = 'primary' | 'secondary' | 'ghost';\n\nconst BASE_STYLE: CSSProperties = {\n borderRadius: '6px',\n fontSize: '14px',\n fontWeight: 500,\n transition: 'background-color 100ms',\n};\n\nconst buttonStyle = (variant: Variant, isDisabled: boolean, isHovered: boolean, isActive: boolean): CSSProperties => {\n const cursor = isDisabled ? 'not-allowed' : 'pointer';\n if (variant === 'primary') {\n return {\n ...BASE_STYLE,\n padding: '8px 16px',\n border: 'none',\n color: '#ffffff',\n cursor,\n background: isDisabled ? '#93c5fd' : isActive ? '#1e40af' : isHovered ? '#1d4ed8' : '#2563eb',\n };\n }\n if (variant === 'secondary') {\n return {\n ...BASE_STYLE,\n padding: '8px 16px',\n border: `1px solid ${isDisabled ? '#e5e7eb' : isHovered ? '#9ca3af' : '#d1d5db'}`,\n color: isDisabled ? '#9ca3af' : '#1f2937',\n cursor,\n background: isDisabled ? '#ffffff' : isActive ? '#e5e7eb' : isHovered ? '#f3f4f6' : '#ffffff',\n };\n }\n return {\n ...BASE_STYLE,\n padding: '8px 12px',\n border: 'none',\n color: isDisabled ? '#93c5fd' : '#2563eb',\n cursor,\n background: isDisabled ? 'transparent' : isActive ? '#dbeafe' : isHovered ? '#eff6ff' : 'transparent',\n };\n};\n\nexport const Button = Object.assign(\n defineComponent(\n (props: NovaComponentProps & ButtonProps, { slots }) => {\n const dispatch = useNovaDispatch();\n const isHovered = shallowRef(false);\n const isActive = shallowRef(false);\n const onClick = (): void => {\n if (props.disabled === true) return;\n if (props.novaRef === undefined) return;\n dispatch({ type: 'ui:click', ref: props.novaRef });\n };\n return () => {\n const isDisabled = props.disabled ?? false;\n return h(\n 'button',\n {\n type: 'button',\n disabled: isDisabled,\n style: buttonStyle(props.variant ?? 'primary', isDisabled, isHovered.value, isActive.value),\n onClick,\n onMouseenter: () => (isHovered.value = true),\n onMouseleave: () => {\n isHovered.value = false;\n isActive.value = false;\n },\n onMousedown: () => (isActive.value = true),\n onMouseup: () => (isActive.value = false),\n },\n props.label ?? slots.default?.(),\n );\n };\n },\n { name: 'NovaButton', props: ['label', 'variant', 'disabled', 'novaRef'], inheritAttrs: false },\n ),\n { meta: { description: \"Clickable button. Click events fire as `ui:click` with the layout node's ref.\", propsSchema: ButtonPropsSchema } },\n);\n\n// ─── Input ─────────────────────────────────────────────────\n//\n// Number inputs still dispatch a string payload; mutation ops parse on the\n// action side.\n//\n// Two remote round-trip obligations (ADAPTER.md §6), because the shell may be\n// authoritative over a socket:\n// - it holds a local draft while focused, so an async tree echo can't clobber\n// the value the user is mid-typing;\n// - it honours the layout's `debounce` prop, coalescing keystrokes before\n// they hit the wire, and flushes the pending value on blur.\n\nconst inputStyle = (isDisabled: boolean, isFocused: boolean, isHovered: boolean): CSSProperties => ({\n padding: '8px 12px',\n border: `1px solid ${isDisabled ? '#d1d5db' : isFocused ? '#2563eb' : isHovered ? '#9ca3af' : '#d1d5db'}`,\n borderRadius: '6px',\n fontSize: '14px',\n background: isDisabled ? '#f9fafb' : '#ffffff',\n color: isDisabled ? '#9ca3af' : 'inherit',\n cursor: isDisabled ? 'not-allowed' : 'text',\n minWidth: '240px',\n outline: 'none',\n boxShadow: isFocused ? '0 0 0 3px rgba(37, 99, 235, 0.15)' : 'none',\n transition: 'border-color 150ms, box-shadow 150ms',\n});\n\nexport const Input = Object.assign(\n defineComponent(\n (props: NovaComponentProps & InputProps) => {\n const dispatch = useNovaDispatch();\n const isHovered = shallowRef(false);\n // `draft` is the local editing value; `null` means \"not editing — the\n // server value is authoritative\". While focused the draft wins.\n const draft = shallowRef<string | null>(null);\n // A single pending debounced dispatch — replaced by the next keystroke,\n // flushed on blur, dropped on unmount (a keystroke against a screen\n // that has gone is worse than a lost one).\n let timer: ReturnType<typeof setTimeout> | undefined;\n const clearPending = (): void => {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n onBeforeUnmount(clearPending);\n\n const fire = (next: string): void => {\n if (props.novaModel === undefined) return;\n dispatch({ type: 'ui:model', ref: props.novaModel.ref, payload: next });\n };\n\n const onInput = (event: Event): void => {\n const target = event.target;\n if (!(target instanceof HTMLInputElement)) return;\n const next = target.value;\n draft.value = next;\n const debounceMs = props.debounce ?? 0;\n if (debounceMs > 0) {\n clearPending();\n timer = setTimeout(() => {\n timer = undefined;\n fire(next);\n }, debounceMs);\n } else {\n fire(next);\n }\n };\n\n const onFocus = (): void => {\n draft.value = props.value ?? '';\n };\n const onBlur = (): void => {\n // flush any pending keystroke now, then hand authority back\n const pending = draft.value;\n if (timer !== undefined && pending !== null) {\n clearPending();\n fire(pending);\n }\n draft.value = null;\n };\n\n return () => {\n const isDisabled = props.disabled ?? false;\n return h('input', {\n type: props.type ?? 'text',\n placeholder: props.placeholder,\n disabled: isDisabled,\n value: draft.value ?? props.value ?? '',\n onInput,\n onFocus,\n onBlur,\n onMouseenter: () => (isHovered.value = true),\n onMouseleave: () => (isHovered.value = false),\n style: inputStyle(isDisabled, draft.value !== null, isHovered.value),\n });\n };\n },\n {\n name: 'NovaInput',\n props: ['type', 'placeholder', 'disabled', 'value', 'debounce', 'novaModel'],\n inheritAttrs: false,\n },\n ),\n { meta: { description: 'Text input bound to data via the `model` field on the layout node.', propsSchema: InputPropsSchema } },\n);\n","import { defineComponent, h, type VNode } from 'vue';\nimport { JsonTreePropsSchema, PanelPropsSchema, type JsonTreeProps, type PanelProps } from '../../primitive-props';\nimport { useNovaDispatch } from '../composables/context';\n\n// ═══════════════════════════════════════════════════════════\n// The introspection primitives nova/devtools composes against — Panel and\n// JsonTree. Generic, useful anywhere.\n// ═══════════════════════════════════════════════════════════\n\nexport { PanelPropsSchema, type PanelProps, JsonTreePropsSchema, type JsonTreeProps };\n\n// ─── Panel ─────────────────────────────────────────────────\n// A framed, elevated surface with an optional title header. `backRef` /\n// `closeRef` grow a header ← / ✕ firing ui:click with that ref.\n\nconst HEADER_BUTTON_STYLE = {\n border: 'none',\n background: 'none',\n color: '#6b7280',\n cursor: 'pointer',\n fontSize: '13px',\n lineHeight: 1,\n padding: '2px',\n};\n\nexport const Panel = Object.assign(\n defineComponent(\n (props: PanelProps, { slots }) => {\n const dispatch = useNovaDispatch();\n const headerButton = (ref: string, glyph: string): VNode =>\n h('button', { type: 'button', style: HEADER_BUTTON_STYLE, onClick: () => dispatch({ type: 'ui:click', ref }) }, glyph);\n return () =>\n h(\n 'div',\n {\n style: {\n border: '1px solid #d8dae0',\n borderRadius: '10px',\n background: '#fff',\n boxShadow: '0 1px 3px rgba(0,0,0,.06)',\n padding: '12px',\n },\n },\n [\n props.title === undefined\n ? null\n : h('div', { style: { display: 'flex', alignItems: 'center', gap: '6px', fontWeight: 600, fontSize: '13px', marginBottom: '8px' } }, [\n props.backRef === undefined ? null : headerButton(props.backRef, '←'),\n h('span', { style: { flex: 1 } }, props.title),\n props.closeRef === undefined ? null : headerButton(props.closeRef, '✕'),\n ]),\n slots.default?.(),\n ],\n );\n },\n { name: 'NovaPanel', props: ['title', 'backRef', 'closeRef'], inheritAttrs: false },\n ),\n {\n meta: {\n description: 'A framed, elevated surface with an optional title; `closeRef` adds a header ✕.',\n propsSchema: PanelPropsSchema,\n },\n },\n);\n\n// ─── JsonTree ──────────────────────────────────────────────\n// A collapsible view of any JSON value via native <details> (no state).\n\nconst entriesOf = (value: object): Array<[string, unknown]> =>\n Array.isArray(value) ? value.map((item, index): [string, unknown] => [String(index), item]) : Object.entries(value);\n\nconst jsonNode = (value: unknown, name: string | undefined, key?: string): VNode => {\n if (value !== null && typeof value === 'object') {\n const entries = entriesOf(value);\n const shape = Array.isArray(value) ? `[${entries.length}]` : `{${entries.length}}`;\n return h('details', { key }, [\n h('summary', { style: { cursor: 'pointer', color: '#6b7280' } }, name === undefined ? shape : `${name} ${shape}`),\n h(\n 'div',\n { style: { paddingLeft: '13px', borderLeft: '1px solid #d8dae0', marginLeft: '3px' } },\n entries.map(([childKey, child]) => jsonNode(child, childKey, childKey)),\n ),\n ]);\n }\n const text = name === undefined ? JSON.stringify(value) : `${name}: ${JSON.stringify(value)}`;\n return h('div', { key, style: { whiteSpace: 'pre-wrap', wordBreak: 'break-word' } }, text);\n};\n\nexport const JsonTree = Object.assign(\n defineComponent(\n (props: JsonTreeProps) => () =>\n h(\n 'div',\n { style: { fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace', fontSize: '12px', lineHeight: 1.5 } },\n [jsonNode(props.value, props.label)],\n ),\n { name: 'NovaJsonTree', props: ['value', 'label'], inheritAttrs: false },\n ),\n { meta: { description: 'A collapsible view of any JSON value.', propsSchema: JsonTreePropsSchema } },\n);\n","import { shallowRef, toValue, watch, type MaybeRefOrGetter, type Ref } from 'vue';\nimport type { ActionStatus, PublicActionRuntime } from '@action';\nimport type { RenderNode } from '@layout';\nimport type { CanvasState, Shell, StateSnapshot } from '@shell';\nimport type { Phrasebook } from '../../../i18n/phrases';\nimport { useShellSource } from './context';\n\n// ═══════════════════════════════════════════════════════════\n// Subscription bindings (ADAPTER.md §3): core subscriptions bridged into Vue\n// reactivity. Each composable holds a shallowRef — core hands out immutable\n// snapshots, so deep reactivity would only cost — re-read on the MATCHING\n// subscription. The subscription lives in a watch over (shell, key): a\n// swapped shell or a changed id resubscribes, and the watch's cleanup\n// unsubscribes on both that and unmount.\n// ═══════════════════════════════════════════════════════════\n\ntype Unsubscribe = () => void;\n\ntype Binding<T, K> = {\n key: () => K;\n read: (shell: Shell, key: K) => T;\n subscribe: (shell: Shell, key: K, notify: () => void) => Unsubscribe;\n};\n\nconst bindShell = <T, K>(binding: Binding<T, K>): Readonly<Ref<T>> => {\n const source = useShellSource();\n const value = shallowRef<T>(binding.read(source.shell, binding.key()));\n watch(\n (): [Shell, K] => [source.shell, binding.key()],\n ([shell, key], _previous, onCleanup) => {\n const refresh = (): void => {\n value.value = binding.read(shell, key);\n };\n refresh();\n onCleanup(binding.subscribe(shell, key, refresh));\n },\n { immediate: true },\n );\n return value;\n};\n\nconst EMPTY: RenderNode[] = [];\n\nconst subscribeState = (shell: Shell, _key: unknown, notify: () => void): Unsubscribe => shell.onStateChange(() => notify());\n\n// A canvas's rendered tree depends on its instances' data, not only the\n// canvas's own state, so it recomputes on every shell state change (as the\n// React hook does).\nexport const useCanvasRenderTree = (canvasId: MaybeRefOrGetter<string | undefined>): Readonly<Ref<RenderNode[]>> =>\n bindShell({\n key: () => toValue(canvasId),\n read: (shell, id) => (id === undefined || id === '' ? EMPTY : shell.getCanvasRenderTree(id)),\n subscribe: subscribeState,\n });\n\nexport const useShellRenderTree = (): Readonly<Ref<RenderNode[]>> =>\n bindShell({ key: () => undefined, read: (shell) => shell.getShellRenderTree(), subscribe: subscribeState });\n\nexport const useShellState = (): Readonly<Ref<StateSnapshot>> =>\n bindShell({ key: () => undefined, read: (shell) => shell.getState(), subscribe: subscribeState });\n\n// The shell owns canvas-change equality — onCanvasChange only fires on\n// meaningful change, so no comparator lives here.\nexport const useCanvas = (canvasId: MaybeRefOrGetter<string>): Readonly<Ref<CanvasState>> =>\n bindShell({\n key: () => toValue(canvasId),\n read: (shell, id) => shell.getCanvasState(id),\n subscribe: (shell, id, notify) => shell.onCanvasChange(id, () => notify()),\n });\n\n// Listens to one runtime AND to the shell: the instance may not exist yet, or\n// be replaced under the same id, so a state change showing a different\n// runtime under the id re-attaches the runtime listener.\nconst subscribeRuntime =\n (listen: (runtime: PublicActionRuntime, notify: () => void) => Unsubscribe) =>\n (shell: Shell, instanceId: string, notify: () => void): Unsubscribe => {\n let current = shell.getRuntime(instanceId);\n let offRuntime = current === undefined ? undefined : listen(current, notify);\n const offState = shell.onStateChange(() => {\n const next = shell.getRuntime(instanceId);\n if (next !== current) {\n offRuntime?.();\n current = next;\n offRuntime = current === undefined ? undefined : listen(current, notify);\n }\n notify();\n });\n return () => {\n offRuntime?.();\n offState();\n };\n };\n\nconst onData = subscribeRuntime((runtime, notify) => runtime.onDataChange(() => notify()));\nconst onStatus = subscribeRuntime((runtime, notify) => runtime.onStatusChange(() => notify()));\n\nexport const useActionData = (instanceId: MaybeRefOrGetter<string>): Readonly<Ref<Record<string, unknown> | undefined>> =>\n bindShell({ key: () => toValue(instanceId), read: (shell, id) => shell.getRuntime(id)?.getData(), subscribe: onData });\n\nexport const useActionStatus = (instanceId: MaybeRefOrGetter<string>): Readonly<Ref<ActionStatus | undefined>> =>\n bindShell({ key: () => toValue(instanceId), read: (shell, id) => shell.getRuntime(id)?.instance.status, subscribe: onStatus });\n\n// One instance's rendered tree. Two inputs: the runtime's data and the shell's\n// phrasebook (setPhrases changes the words without touching any data), so it\n// listens to both and caches on both — an unrelated state change hands back\n// the same tree and Vue skips the re-render.\nexport const useRenderTree = (instanceId: MaybeRefOrGetter<string>): Readonly<Ref<RenderNode[]>> => {\n let cache: { data: Record<string, unknown>; phrases: Phrasebook | undefined; tree: RenderNode[] } | undefined;\n return bindShell({\n key: () => toValue(instanceId),\n read: (shell, id) => {\n const runtime = shell.getRuntime(id);\n if (runtime === undefined) {\n cache = undefined;\n return EMPTY;\n }\n const data = runtime.getData();\n const phrases = shell.getPhrases();\n if (cache !== undefined && cache.data === data && cache.phrases === phrases) return cache.tree;\n const tree = runtime.render();\n cache = { data, phrases, tree };\n return tree;\n },\n subscribe: onData,\n });\n};\n","import { defineComponent, h, inject, provide } from 'vue';\nimport { scopeDispatch } from '@shared/event-bus';\nimport { ActionSlotPropsSchema, CanvasSlotPropsSchema, type ActionSlotProps, type CanvasSlotProps } from '../../primitive-props';\nimport { NovaRenderKey, type NovaRenderContextValue } from '../context';\nimport { useShellSource } from '../composables/context';\nimport { useCanvasRenderTree, useRenderTree } from '../composables/shell';\nimport { RenderTree } from '../render-tree';\n\n// ═══════════════════════════════════════════════════════════\n// The shell-backed structural slots (ADAPTER.md §4). They pull from the shell\n// injection, so they render only inside <NovaShellProvider>. A remote host (a\n// moss terminal) registers its own wire-backed pair under the same names.\n// ═══════════════════════════════════════════════════════════\n\nexport { CanvasSlotPropsSchema, type CanvasSlotProps, ActionSlotPropsSchema, type ActionSlotProps };\n\n// ─── CanvasSlot ────────────────────────────────────────────\n\nexport const CanvasSlot = Object.assign(\n defineComponent(\n (props: CanvasSlotProps) => {\n const tree = useCanvasRenderTree(() => props.canvasId);\n return () => (props.canvasId === undefined || props.canvasId === '' ? null : h(RenderTree, { nodes: tree.value }));\n },\n { name: 'NovaCanvasSlot', props: ['canvasId'], inheritAttrs: false },\n ),\n {\n meta: {\n description: 'Renders a canvas by id, recursing into its actionLayout.',\n propsSchema: CanvasSlotPropsSchema,\n },\n },\n);\n\n// ─── ActionSlot ────────────────────────────────────────────\n\n// Re-provides the render context with dispatch scoped to one instance, so the\n// runtime delivers UI events from its subtree to that instance's own triggers\n// only. The stamping rule is core's scopeDispatch — not reimplemented here. It\n// sits INSIDE the slot wrapper, as in the React adapter: the wrapper itself is\n// outside the instance.\nconst InstanceScope = defineComponent(\n (props: { instanceId: string }, { slots }) => {\n const parent = inject(NovaRenderKey, undefined);\n if (parent !== undefined) {\n const scoped: NovaRenderContextValue = {\n get registry() {\n return parent.registry;\n },\n get dispatch() {\n return scopeDispatch(parent.dispatch, props.instanceId);\n },\n get publish() {\n return parent.publish;\n },\n get slotWrapper() {\n return parent.slotWrapper;\n },\n get fallback() {\n return parent.fallback;\n },\n };\n provide(NovaRenderKey, scoped);\n }\n return () => slots.default?.();\n },\n { name: 'NovaInstanceScope', props: ['instanceId'] },\n);\n\nexport const ActionSlot = Object.assign(\n defineComponent(\n (props: ActionSlotProps) => {\n const source = useShellSource();\n const ctx = inject(NovaRenderKey, undefined);\n const tree = useRenderTree(() => props.instanceId ?? '');\n return () => {\n const instanceId = props.instanceId;\n const hasInstance = instanceId !== undefined && instanceId !== '';\n const content =\n hasInstance && tree.value.length > 0\n ? h(InstanceScope, { instanceId }, { default: () => h(RenderTree, { nodes: tree.value }) })\n : null;\n const Wrapper = ctx?.slotWrapper;\n if (Wrapper === undefined) return content;\n // With a wrapper, render it PERSISTENTLY (content or null) so a\n // presence-managing wrapper can animate an instance leaving. Identity\n // resolves from the live runtime; undefined while empty or exiting.\n const runtime = hasInstance ? source.shell.getRuntime(instanceId) : undefined;\n return h(\n Wrapper,\n { canvasId: runtime?.instance.canvasId, instanceId: hasInstance ? instanceId : undefined, action: runtime?.definition },\n { default: () => content },\n );\n };\n },\n { name: 'NovaActionSlot', props: ['instanceId'], inheritAttrs: false },\n ),\n {\n meta: {\n description: 'Renders an action instance by id. Used inside a canvas actionLayout.',\n propsSchema: ActionSlotPropsSchema,\n },\n },\n);\n","// ═══════════════════════════════════════════════════════════\n// @niscorp/nova/adapters/vue/components\n//\n// Headless Vue component set for Nova layouts — the same vocabulary, and the\n// same props schemas, as the React kit. Every component carries static\n// `.meta` (description + Zod props schema). `registerNovaVueComponents`\n// batches them into a registry via `registerAll`.\n// ═══════════════════════════════════════════════════════════\n\nimport type { ComponentRegistry } from '@layout';\nimport { Box, Stack, Text } from './layout';\nimport { Button, Input } from './controls';\nimport { JsonTree, Panel } from './introspection';\nimport { ActionSlot, CanvasSlot } from './slots';\n\nexport { Stack, StackPropsSchema, type StackProps } from './layout';\nexport { Text, TextPropsSchema, type TextProps } from './layout';\nexport { Box, BoxPropsSchema, type BoxProps } from './layout';\nexport { Input, InputPropsSchema, type InputProps } from './controls';\nexport { Button, ButtonPropsSchema, type ButtonProps } from './controls';\n\n// ─── Introspection primitives (used by nova/devtools) ──────\nexport { Panel, PanelPropsSchema, type PanelProps } from './introspection';\nexport { JsonTree, JsonTreePropsSchema, type JsonTreeProps } from './introspection';\n\n// ─── Shell slots ───────────────────────────────────────────\n// Shell-aware: they read the shell injection and must render inside a\n// <NovaShellProvider>. A remote host registers its own pair under the names.\nexport { CanvasSlot, CanvasSlotPropsSchema, type CanvasSlotProps } from './slots';\nexport { ActionSlot, ActionSlotPropsSchema, type ActionSlotProps } from './slots';\n\n// ─── Bulk registration helper ──────────────────────────────\n// Typed over the untyped registry so it takes a kit's\n// ComponentRegistry<NovaComponent> and a shell's registry alike.\nexport const registerNovaVueComponents = (registry: ComponentRegistry): void => {\n registry.registerAll({\n Stack,\n Text,\n Input,\n Button,\n Box,\n Panel,\n JsonTree,\n CanvasSlot,\n ActionSlot,\n });\n};\n","import { defineComponent, h } from 'vue';\nimport type { ComponentRegistry } from '@layout';\nimport type { Shell } from '@shell';\nimport { CANVAS_SLOT_NAME } from '@shell';\nimport { registerNovaVueComponents } from './components';\nimport { useCanvasRenderTree, useShellRenderTree } from './composables/shell';\nimport { useShell } from './composables/context';\nimport type { SlotWrapper } from './context';\nimport { NovaShellProvider } from './provider';\nimport { RenderTree } from './render-tree';\n\n// ═══════════════════════════════════════════════════════════\n// <NovaShell> / <NovaCanvas> — the mountable shell surfaces. Each hides the\n// provider + render-tree wiring behind one component. The lower-level pieces\n// (NovaShellProvider, RenderTree, the composables) stay exported for custom\n// composition.\n// ═══════════════════════════════════════════════════════════\n\n// Idempotent: the slot components are required by the shell's default\n// layouts, and the primitives are the vocabulary every demo expects.\nconst ensureVueBuiltins = (registry: ComponentRegistry): void => {\n if (registry.has(CANVAS_SLOT_NAME)) return;\n registerNovaVueComponents(registry);\n};\n\n// ─── <NovaShell> ───────────────────────────────────────────\n\nexport type NovaShellProps = {\n shell: Shell;\n // render against a different registry than shell.registry (rare)\n registry?: ComponentRegistry;\n // wraps every action instance's content at the ActionSlot seam\n slotWrapper?: SlotWrapper;\n // register the Vue builtins on the resolved registry. Default true.\n builtins?: boolean;\n};\n\nconst ShellRenderTreeView = defineComponent(\n () => {\n const nodes = useShellRenderTree();\n return () => h(RenderTree, { nodes: nodes.value });\n },\n { name: 'NovaShellRenderTree' },\n);\n\nexport const NovaShell = defineComponent(\n (props: NovaShellProps) => {\n if (props.builtins !== false) ensureVueBuiltins(props.registry ?? props.shell.registry);\n return () =>\n h(\n NovaShellProvider,\n { shell: props.shell, registry: props.registry, slotWrapper: props.slotWrapper },\n { default: () => h(ShellRenderTreeView) },\n );\n },\n { name: 'NovaShell', props: ['shell', 'registry', 'slotWrapper', 'builtins'] },\n);\n\n// ─── <NovaCanvas> ──────────────────────────────────────────\n\nexport type NovaCanvasProps = {\n // the canvas to render\n id: string;\n // when given, NovaCanvas provides its own shell; when omitted it must sit\n // inside a <NovaShell> / <NovaShellProvider>\n shell?: Shell;\n registry?: ComponentRegistry;\n builtins?: boolean;\n};\n\nconst CanvasRenderTreeView = defineComponent(\n (props: { canvasId: string }) => {\n // asserts a shell is provided — useShell throws a clear error otherwise\n useShell();\n const nodes = useCanvasRenderTree(() => props.canvasId);\n return () => h(RenderTree, { nodes: nodes.value });\n },\n { name: 'NovaCanvasRenderTree', props: ['canvasId'] },\n);\n\nexport const NovaCanvas = defineComponent(\n (props: NovaCanvasProps) => {\n const { shell } = props;\n if (shell !== undefined && props.builtins !== false) ensureVueBuiltins(props.registry ?? shell.registry);\n return () => {\n const view = h(CanvasRenderTreeView, { canvasId: props.id });\n if (props.shell === undefined) return view;\n return h(NovaShellProvider, { shell: props.shell, registry: props.registry }, { default: () => view });\n };\n },\n { name: 'NovaCanvas', props: ['id', 'shell', 'registry', 'builtins'] },\n);\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/adapters/vue/provider.ts","../../../src/adapters/vue/error-boundary.ts","../../../src/adapters/vue/nova.ts"],"names":["defineComponent","provide","NovaRenderKey","NovaShellKey","provideShellHead","h","shallowRef","onErrorCaptured","CANVAS_SLOT_NAME","registerNovaVueComponents","useShellRenderTree","RenderTree","useShell","useCanvasRenderTree"],"mappings":";;;;;;;;;;;;;;;;;;AAOA,IAAM,eAA6B,MAAM;AAAC,CAAA;AAC1C,IAAM,cAA2B,MAAM;AAAC,CAAA;AAmBjC,IAAM,kBAAA,GAAqBA,mBAAA;AAAA,EAChC,CAAC,KAAA,EAAgC,EAAE,KAAA,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,EAAY,EAAE,KAAA,EAAO,KAAA,CAAM,OAAO,CAAA;AAAA,EACnD,CAAA;AAAA,EACA,EAAE,IAAA,EAAM,sBAAA,EAAwB,KAAA,EAAO,CAAC,UAAU,CAAA;AACpD,CAAA;AAEO,IAAM,UAAA,GAAaX,mBAAAA;AAAA,EACxB,CAAC,KAAA,KAA2B;AAC1B,IAAA,MAAM,EAAE,OAAM,GAAI,KAAA;AAClB,IAAA,IAAI,KAAA,KAAU,UAAa,KAAA,CAAM,QAAA,KAAa,OAAO,iBAAA,CAAkB,KAAA,CAAM,QAAA,IAAY,KAAA,CAAM,QAAQ,CAAA;AACvG,IAAA,OAAO,MAAM;AACX,MAAA,MAAM,OAAOK,KAAAA,CAAE,oBAAA,EAAsB,EAAE,QAAA,EAAU,KAAA,CAAM,IAAI,CAAA;AAC3D,MAAA,IAAI,KAAA,CAAM,KAAA,KAAU,MAAA,EAAW,OAAO,IAAA;AACtC,MAAA,OAAOA,KAAAA,CAAE,iBAAA,EAAmB,EAAE,KAAA,EAAO,MAAM,KAAA,EAAO,QAAA,EAAU,KAAA,CAAM,QAAA,EAAS,EAAG,EAAE,OAAA,EAAS,MAAM,MAAM,CAAA;AAAA,IACvG,CAAA;AAAA,EACF,CAAA;AAAA,EACA,EAAE,MAAM,YAAA,EAAc,KAAA,EAAO,CAAC,IAAA,EAAM,OAAA,EAAS,UAAA,EAAY,UAAU,CAAA;AACrE","file":"index.cjs","sourcesContent":["import { defineComponent, h, provide } from 'vue';\nimport type { ComponentRegistry } from '@layout';\nimport type { Shell } from '@shell';\nimport { NovaRenderKey, NovaShellKey, type NovaRenderContextValue, type NovaShellSource, type SlotWrapper } from './context';\nimport { provideShellHead } from './head';\nimport type { NovaComponent, NovaDispatch, NovaPublish } from './types';\n\nconst noopDispatch: NovaDispatch = () => {};\nconst noopPublish: NovaPublish = () => {};\n\n// ═══════════════════════════════════════════════════════════\n// <NovaRenderProvider>\n//\n// The framework-agnostic renderer context. Pairs a component registry with a\n// dispatch and publish function. Works with no shell — dispatch and publish\n// default to no-ops so static layouts render without event infrastructure.\n// ═══════════════════════════════════════════════════════════\n\nexport type NovaRenderProviderProps = {\n registry: ComponentRegistry;\n dispatch?: NovaDispatch;\n publish?: NovaPublish;\n slotWrapper?: SlotWrapper;\n // renderer for unregistered component names; omit for strict error markers\n fallback?: NovaComponent;\n};\n\nexport const NovaRenderProvider = defineComponent(\n (props: NovaRenderProviderProps, { slots }) => {\n const value: NovaRenderContextValue = {\n get registry() {\n return props.registry;\n },\n get dispatch() {\n return props.dispatch ?? noopDispatch;\n },\n get publish() {\n return props.publish ?? noopPublish;\n },\n get slotWrapper() {\n return props.slotWrapper;\n },\n get fallback() {\n return props.fallback;\n },\n };\n provide(NovaRenderKey, value);\n return () => slots.default?.();\n },\n { name: 'NovaRenderProvider', props: ['registry', 'dispatch', 'publish', 'slotWrapper', 'fallback'] },\n);\n\n// ═══════════════════════════════════════════════════════════\n// <NovaShellProvider>\n//\n// <NovaRenderProvider> plus the shell. The registry defaults to\n// `shell.registry`; dispatch and publish go to the shell.\n// ═══════════════════════════════════════════════════════════\n\nexport type NovaShellProviderProps = {\n shell: Shell;\n registry?: ComponentRegistry;\n slotWrapper?: SlotWrapper;\n};\n\nexport const NovaShellProvider = defineComponent(\n (props: NovaShellProviderProps, { slots }) => {\n const source: NovaShellSource = {\n get shell() {\n return props.shell;\n },\n };\n provide(NovaShellKey, source);\n provideShellHead(() => props.shell);\n const dispatch: NovaDispatch = (event) => props.shell.dispatch(event);\n const publish: NovaPublish = (channel, payload) => props.shell.publish(channel, payload);\n return () =>\n h(\n NovaRenderProvider,\n { registry: props.registry ?? props.shell.registry, dispatch, publish, slotWrapper: props.slotWrapper },\n { default: () => slots.default?.() },\n );\n },\n { name: 'NovaShellProvider', props: ['shell', 'registry', 'slotWrapper'] },\n);\n","import { defineComponent, h, onErrorCaptured, shallowRef, type VNodeChild } from 'vue';\n\n// ═══════════════════════════════════════════════════════════\n// Vue's error boundary is a hook, not a class: onErrorCaptured stops the\n// error propagating (return false) and swaps the subtree for a fallback.\n// ═══════════════════════════════════════════════════════════\n\nexport type NovaErrorBoundaryProps = {\n fallback?: (error: Error) => VNodeChild;\n onError?: (error: Error, info: string) => void;\n};\n\nexport const NovaErrorBoundary = defineComponent(\n (props: NovaErrorBoundaryProps, { slots }) => {\n const caught = shallowRef<Error | undefined>(undefined);\n onErrorCaptured((err, _instance, info) => {\n const error = err instanceof Error ? err : new Error(String(err));\n caught.value = error;\n props.onError?.(error, info);\n return false;\n });\n return () => {\n const error = caught.value;\n if (error === undefined) return slots.default?.();\n if (props.fallback !== undefined) return props.fallback(error);\n return h('div', { 'data-nova-error-boundary': 'true', role: 'alert' }, error.message);\n };\n },\n { name: 'NovaErrorBoundary', props: ['fallback', 'onError'] },\n);\n","import { defineComponent, h } from 'vue';\nimport type { ComponentRegistry } from '@layout';\nimport type { Shell } from '@shell';\nimport { CANVAS_SLOT_NAME } from '@shell';\nimport { registerNovaVueComponents } from './components';\nimport { useCanvasRenderTree, useShellRenderTree } from './composables/shell';\nimport { useShell } from './composables/context';\nimport type { SlotWrapper } from './context';\nimport { NovaShellProvider } from './provider';\nimport { RenderTree } from './render-tree';\n\n// ═══════════════════════════════════════════════════════════\n// <NovaShell> / <NovaCanvas> — the mountable shell surfaces. Each hides the\n// provider + render-tree wiring behind one component. The lower-level pieces\n// (NovaShellProvider, RenderTree, the composables) stay exported for custom\n// composition.\n// ═══════════════════════════════════════════════════════════\n\n// Idempotent: the slot components are required by the shell's default\n// layouts, and the primitives are the vocabulary every demo expects.\nconst ensureVueBuiltins = (registry: ComponentRegistry): void => {\n if (registry.has(CANVAS_SLOT_NAME)) return;\n registerNovaVueComponents(registry);\n};\n\n// ─── <NovaShell> ───────────────────────────────────────────\n\nexport type NovaShellProps = {\n shell: Shell;\n // render against a different registry than shell.registry (rare)\n registry?: ComponentRegistry;\n // wraps every action instance's content at the ActionSlot seam\n slotWrapper?: SlotWrapper;\n // register the Vue builtins on the resolved registry. Default true.\n builtins?: boolean;\n};\n\nconst ShellRenderTreeView = defineComponent(\n () => {\n const nodes = useShellRenderTree();\n return () => h(RenderTree, { nodes: nodes.value });\n },\n { name: 'NovaShellRenderTree' },\n);\n\nexport const NovaShell = defineComponent(\n (props: NovaShellProps) => {\n if (props.builtins !== false) ensureVueBuiltins(props.registry ?? props.shell.registry);\n return () =>\n h(\n NovaShellProvider,\n { shell: props.shell, registry: props.registry, slotWrapper: props.slotWrapper },\n { default: () => h(ShellRenderTreeView) },\n );\n },\n { name: 'NovaShell', props: ['shell', 'registry', 'slotWrapper', 'builtins'] },\n);\n\n// ─── <NovaCanvas> ──────────────────────────────────────────\n\nexport type NovaCanvasProps = {\n // the canvas to render\n id: string;\n // when given, NovaCanvas provides its own shell; when omitted it must sit\n // inside a <NovaShell> / <NovaShellProvider>\n shell?: Shell;\n registry?: ComponentRegistry;\n builtins?: boolean;\n};\n\nconst CanvasRenderTreeView = defineComponent(\n (props: { canvasId: string }) => {\n // asserts a shell is provided — useShell throws a clear error otherwise\n useShell();\n const nodes = useCanvasRenderTree(() => props.canvasId);\n return () => h(RenderTree, { nodes: nodes.value });\n },\n { name: 'NovaCanvasRenderTree', props: ['canvasId'] },\n);\n\nexport const NovaCanvas = defineComponent(\n (props: NovaCanvasProps) => {\n const { shell } = props;\n if (shell !== undefined && props.builtins !== false) ensureVueBuiltins(props.registry ?? shell.registry);\n return () => {\n const view = h(CanvasRenderTreeView, { canvasId: props.id });\n if (props.shell === undefined) return view;\n return h(NovaShellProvider, { shell: props.shell, registry: props.registry }, { default: () => view });\n };\n },\n { name: 'NovaCanvas', props: ['id', 'shell', 'registry', 'builtins'] },\n);\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { NovaRenderKey, NovaShellKey, provideShellHead, useShellRenderTree, RenderTree, useShell, useCanvasRenderTree, registerNovaVueComponents } from '../../chunk-
|
|
2
|
-
export { ErrorMarker, NovaRenderKey, NovaShellKey, RenderNodeView, RenderTree, isNovaComponent, useActionData, useActionStatus, useCanvas, useCanvasRenderTree, useNovaDispatch, useNovaPublish, useNovaRegistry, useRenderTree, useShell, useShellRenderTree, useShellState, useSlotWrapper } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
import { NovaRenderKey, NovaShellKey, provideShellHead, useShellRenderTree, RenderTree, useShell, useCanvasRenderTree, registerNovaVueComponents } from '../../chunk-7MATRNZZ.js';
|
|
2
|
+
export { ErrorMarker, NovaRenderKey, NovaShellKey, RenderNodeView, RenderTree, isNovaComponent, useActionData, useActionStatus, useCanvas, useCanvasRenderTree, useNovaDispatch, useNovaPublish, useNovaRegistry, useRenderTree, useShell, useShellRenderTree, useShellState, useSlotWrapper } from '../../chunk-7MATRNZZ.js';
|
|
3
|
+
import '../../chunk-EG45GQOE.js';
|
|
4
4
|
import '../../chunk-V4BPFFFV.js';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-P5SJ3QXJ.js';
|
|
6
6
|
import { CANVAS_SLOT_NAME } from '../../chunk-RFBIGRCI.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-XUSKGJRI.js';
|
|
8
8
|
import '../../chunk-OGD5CCMZ.js';
|
|
9
9
|
import '../../chunk-7TS3YVQR.js';
|
|
10
10
|
import '../../chunk-OE4E6IBD.js';
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,68 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkUGG7MCX4_cjs = require('../chunk-UGG7MCX4.cjs');
|
|
4
|
+
var chunkPMKWYOOX_cjs = require('../chunk-PMKWYOOX.cjs');
|
|
5
|
+
var chunkD4PUWBN6_cjs = require('../chunk-D4PUWBN6.cjs');
|
|
6
|
+
require('../chunk-Q7SFCCGT.cjs');
|
|
3
7
|
var cortex = require('@niscorp/cortex');
|
|
4
|
-
var zod = require('zod');
|
|
5
8
|
|
|
6
|
-
// src/agent/layout.agent.ts
|
|
7
|
-
zod.z.object({
|
|
8
|
-
$if: zod.z.unknown().describe("Condition \u2014 resolved recursively, then checked for truthiness."),
|
|
9
|
-
$then: zod.z.unknown().describe("Value when condition is truthy \u2014 resolved recursively."),
|
|
10
|
-
$else: zod.z.unknown().optional().describe("Value when condition is falsy \u2014 resolved recursively.")
|
|
11
|
-
}).strict().describe("Conditional value directive. Resolved at bind time.");
|
|
12
|
-
var ResolvableSchema = zod.z.unknown().describe(
|
|
13
|
-
'Any value. Strings support {{}} templates and bare $-paths. The data ROOT is "$." \u2014 a data key is ALWAYS "$.key" ("{{$.rows.length}} found", "$.loading"); "$key" without the dot is INVALID. Loop variables (a `for` directive\'s `as`) are "$<name>.field" ("{{$row.title}}"). Objects may be directives like {$if,$then,$else}. Arrays and nested objects are walked recursively. Everything else is literal.'
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
// src/layout/schemas.ts
|
|
17
|
-
var LayoutPrimitiveSchema = zod.z.union([zod.z.string(), zod.z.number(), zod.z.boolean(), zod.z.null()]).describe("A primitive layout value rendered as text.");
|
|
18
|
-
var ComponentNodeSchema = zod.z.lazy(
|
|
19
|
-
() => zod.z.object({
|
|
20
|
-
component: zod.z.string().describe("The registry name of the component to render."),
|
|
21
|
-
props: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Component props; values may be bindings to be resolved at render time."),
|
|
22
|
-
children: zod.z.union([LayoutNodeSchema, zod.z.array(LayoutNodeSchema)]).optional().describe("Child layout content (a single node or an array of nodes)."),
|
|
23
|
-
ref: zod.z.string().optional().describe("A stable identifier used to target this component from event handlers."),
|
|
24
|
-
model: zod.z.string().optional().describe('A two-way binding path, e.g. "$.name".'),
|
|
25
|
-
events: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Map of event name to event configuration handled by the action runtime.")
|
|
26
|
-
}).strict().describe("A node that instantiates a component from the registry.")
|
|
27
|
-
);
|
|
28
|
-
var ConditionalNodeSchema = zod.z.lazy(
|
|
29
|
-
() => zod.z.object({
|
|
30
|
-
if: ResolvableSchema.describe("Resolvable value evaluated for truthiness."),
|
|
31
|
-
then: LayoutNodeSchema.describe("Layout to render when condition is truthy."),
|
|
32
|
-
else: LayoutNodeSchema.optional().describe("Layout to render when condition is falsy.")
|
|
33
|
-
}).strict().describe("A node that conditionally renders one of two branches.")
|
|
34
|
-
);
|
|
35
|
-
var LoopNodeSchema = zod.z.lazy(
|
|
36
|
-
() => zod.z.object({
|
|
37
|
-
for: ResolvableSchema.describe("Resolvable value that resolves to an iterable array."),
|
|
38
|
-
as: zod.z.string().describe("Name to bind each iterated item under in the inner scope."),
|
|
39
|
-
key: zod.z.string().optional().describe("Optional key path on each item used for stable identity."),
|
|
40
|
-
do: LayoutNodeSchema.describe("Layout rendered once per iterated item.")
|
|
41
|
-
}).strict().describe("A node that iterates an array binding and renders a layout for each item.")
|
|
42
|
-
);
|
|
43
|
-
var LayoutRefNodeSchema = zod.z.object({
|
|
44
|
-
ref: zod.z.string().describe("Identifier of a layout stored in the layout store to inline at this position.")
|
|
45
|
-
}).strict().describe("A reference to a stored layout, inlined during render.");
|
|
46
|
-
var SlotNodeSchema = zod.z.object({
|
|
47
|
-
slot: zod.z.string().describe(
|
|
48
|
-
"Name of a slot placeholder. When an ActionFragment is composed with an action (a push/replace `with`), the fragment's `{ slot: \"body\" }` node is replaced by the composing action's own layout. An unfilled slot renders nothing."
|
|
49
|
-
)
|
|
50
|
-
}).strict().describe(
|
|
51
|
-
"A placeholder that a fragment-merge fills with a composing action's layout. Only meaningful inside an ActionFragment's layout."
|
|
52
|
-
);
|
|
53
|
-
var LayoutNodeSchema = zod.z.lazy(
|
|
54
|
-
() => zod.z.union([
|
|
55
|
-
ComponentNodeSchema,
|
|
56
|
-
ConditionalNodeSchema,
|
|
57
|
-
LoopNodeSchema,
|
|
58
|
-
LayoutRefNodeSchema,
|
|
59
|
-
SlotNodeSchema,
|
|
60
|
-
zod.z.array(LayoutNodeSchema),
|
|
61
|
-
LayoutPrimitiveSchema
|
|
62
|
-
]).describe("Any layout node: component, conditional, loop, layout ref, slot, array of nodes, or a primitive text value.")
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
// src/agent/layout.agent.ts
|
|
66
9
|
var INSTRUCTIONS = `You are the Nova layout agent. Given an intent, a component palette, and a data example, produce a Nova LayoutNode that renders the data as a UI.
|
|
67
10
|
|
|
68
11
|
Your input:
|
|
@@ -81,98 +24,17 @@ var layoutAgent = cortex.defineAgent({
|
|
|
81
24
|
id: "nova.layout",
|
|
82
25
|
description: "Generates a Nova LayoutNode from an intent, a component palette, and a data example.",
|
|
83
26
|
instructions: INSTRUCTIONS,
|
|
84
|
-
output: { schema: LayoutNodeSchema }
|
|
27
|
+
output: { schema: chunkD4PUWBN6_cjs.LayoutNodeSchema }
|
|
85
28
|
});
|
|
86
29
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
};
|
|
96
|
-
var paletteEntryOf = (name, meta, omitProps) => {
|
|
97
|
-
let propsSchema;
|
|
98
|
-
if (meta.propsSchema !== void 0) {
|
|
99
|
-
const js = meta.propsSchema["~standard"].jsonSchema.output({ target: "draft-07" });
|
|
100
|
-
propsSchema = omitProps !== void 0 && omitProps.length > 0 ? stripProps(js, omitProps) : js;
|
|
101
|
-
}
|
|
102
|
-
return { name, description: meta.description ?? "", ...propsSchema === void 0 ? {} : { propsSchema } };
|
|
103
|
-
};
|
|
104
|
-
var paletteFromRegistry = (registry, options = {}) => {
|
|
105
|
-
const names = options.include ?? registry.list();
|
|
106
|
-
const out = [];
|
|
107
|
-
for (const name of names) {
|
|
108
|
-
const entry = registry.get(name);
|
|
109
|
-
if (entry === void 0) continue;
|
|
110
|
-
out.push(paletteEntryOf(name, entry.meta, options.omitProps));
|
|
111
|
-
}
|
|
112
|
-
return out;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
// src/agent/affordances.ts
|
|
116
|
-
var KEY_PATTERN = /\$\.([A-Za-z_][A-Za-z0-9_]*)/g;
|
|
117
|
-
var VAR_PATTERN = /\$([A-Za-z_][A-Za-z0-9_]*)\./g;
|
|
118
|
-
var collectInteractive = (layout) => {
|
|
119
|
-
const refs = [];
|
|
120
|
-
const models = [];
|
|
121
|
-
const boundKeys = /* @__PURE__ */ new Set();
|
|
122
|
-
const suspects = /* @__PURE__ */ new Set();
|
|
123
|
-
let componentCount = 0;
|
|
124
|
-
const scanString = (value, scope) => {
|
|
125
|
-
for (const match of value.matchAll(KEY_PATTERN)) {
|
|
126
|
-
const key = match[1];
|
|
127
|
-
if (key !== void 0) boundKeys.add(key);
|
|
128
|
-
}
|
|
129
|
-
for (const match of value.matchAll(VAR_PATTERN)) {
|
|
130
|
-
const name = match[1];
|
|
131
|
-
if (name !== void 0 && !scope.has(name)) suspects.add(`$${name}.`);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
const walk = (node, scope) => {
|
|
135
|
-
if (typeof node === "string") return scanString(node, scope);
|
|
136
|
-
if (Array.isArray(node)) {
|
|
137
|
-
for (const child of node) walk(child, scope);
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
if (node === null || typeof node !== "object") return;
|
|
141
|
-
const record = node;
|
|
142
|
-
const loopVar = record["for"] !== void 0 && typeof record["as"] === "string" ? record["as"] : void 0;
|
|
143
|
-
const childScope = loopVar !== void 0 ? /* @__PURE__ */ new Set([...scope, loopVar]) : scope;
|
|
144
|
-
const component = typeof record["component"] === "string" ? record["component"] : void 0;
|
|
145
|
-
if (component !== void 0) {
|
|
146
|
-
componentCount += 1;
|
|
147
|
-
if (typeof record["ref"] === "string" && record["ref"].length > 0) {
|
|
148
|
-
refs.push({ ref: record["ref"], component, via: "ref" });
|
|
149
|
-
}
|
|
150
|
-
if (typeof record["model"] === "string" && record["model"].length > 0) {
|
|
151
|
-
models.push({ path: record["model"], component });
|
|
152
|
-
}
|
|
153
|
-
const props = record["props"];
|
|
154
|
-
if (props !== null && typeof props === "object" && !Array.isArray(props)) {
|
|
155
|
-
for (const [key, value] of Object.entries(props)) {
|
|
156
|
-
if (key.endsWith("Ref") && typeof value === "string" && value.length > 0) {
|
|
157
|
-
refs.push({ ref: value, component, via: key });
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
for (const value of Object.values(record)) walk(value, childScope);
|
|
163
|
-
};
|
|
164
|
-
walk(layout, /* @__PURE__ */ new Set());
|
|
165
|
-
return {
|
|
166
|
-
refs,
|
|
167
|
-
models,
|
|
168
|
-
boundKeys: [...boundKeys].sort(),
|
|
169
|
-
suspectBindings: [...suspects].sort(),
|
|
170
|
-
componentCount
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
exports.collectInteractive = collectInteractive;
|
|
30
|
+
Object.defineProperty(exports, "paletteFromRegistry", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return chunkUGG7MCX4_cjs.paletteFromRegistry; }
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "collectInteractive", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return chunkPMKWYOOX_cjs.collectInteractive; }
|
|
37
|
+
});
|
|
175
38
|
exports.layoutAgent = layoutAgent;
|
|
176
|
-
exports.paletteFromRegistry = paletteFromRegistry;
|
|
177
39
|
//# sourceMappingURL=index.cjs.map
|
|
178
40
|
//# sourceMappingURL=index.cjs.map
|