@niscorp/nova 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/ACTION_DOCS.md +2 -0
  2. package/ADAPTER.md +19 -1
  3. package/CHANGELOG.md +69 -0
  4. package/I18N_DOCS.md +18 -3
  5. package/REACT_DOCS.md +4 -2
  6. package/README.md +93 -3
  7. package/SHELL_DOCS.md +16 -7
  8. package/TERMINAL_DOCS.md +24 -5
  9. package/dist/adapters/dom/components/index.cjs +2 -4
  10. package/dist/adapters/dom/components/index.cjs.map +1 -1
  11. package/dist/adapters/dom/components/index.d.cts +4 -4
  12. package/dist/adapters/dom/components/index.d.ts +4 -4
  13. package/dist/adapters/dom/components/index.js +1 -3
  14. package/dist/adapters/dom/components/index.js.map +1 -1
  15. package/dist/adapters/dom/index.cjs +14 -14
  16. package/dist/adapters/dom/index.d.cts +4 -4
  17. package/dist/adapters/dom/index.d.ts +4 -4
  18. package/dist/adapters/dom/index.js +12 -12
  19. package/dist/adapters/dom/server.cjs +13 -13
  20. package/dist/adapters/dom/server.cjs.map +1 -1
  21. package/dist/adapters/dom/server.d.cts +4 -4
  22. package/dist/adapters/dom/server.d.ts +4 -4
  23. package/dist/adapters/dom/server.js +12 -12
  24. package/dist/adapters/dom/server.js.map +1 -1
  25. package/dist/adapters/ink/index.js +0 -2
  26. package/dist/adapters/ink/index.js.map +1 -1
  27. package/dist/adapters/react/components/index.cjs +32 -32
  28. package/dist/adapters/react/components/index.d.cts +2 -2
  29. package/dist/adapters/react/components/index.d.ts +2 -2
  30. package/dist/adapters/react/components/index.js +13 -13
  31. package/dist/adapters/react/index.cjs +35 -35
  32. package/dist/adapters/react/index.d.cts +6 -6
  33. package/dist/adapters/react/index.d.ts +6 -6
  34. package/dist/adapters/react/index.js +13 -13
  35. package/dist/adapters/tty/components/index.cjs +2 -4
  36. package/dist/adapters/tty/components/index.cjs.map +1 -1
  37. package/dist/adapters/tty/components/index.d.cts +4 -4
  38. package/dist/adapters/tty/components/index.d.ts +4 -4
  39. package/dist/adapters/tty/components/index.js +1 -3
  40. package/dist/adapters/tty/components/index.js.map +1 -1
  41. package/dist/adapters/tty/index.cjs +12 -12
  42. package/dist/adapters/tty/index.cjs.map +1 -1
  43. package/dist/adapters/tty/index.d.cts +4 -4
  44. package/dist/adapters/tty/index.d.ts +4 -4
  45. package/dist/adapters/tty/index.js +10 -10
  46. package/dist/adapters/tty/index.js.map +1 -1
  47. package/dist/adapters/vue/components/index.cjs +32 -32
  48. package/dist/adapters/vue/components/index.d.cts +2 -2
  49. package/dist/adapters/vue/components/index.d.ts +2 -2
  50. package/dist/adapters/vue/components/index.js +13 -13
  51. package/dist/adapters/vue/index.cjs +41 -41
  52. package/dist/adapters/vue/index.cjs.map +1 -1
  53. package/dist/adapters/vue/index.d.cts +6 -6
  54. package/dist/adapters/vue/index.d.ts +6 -6
  55. package/dist/adapters/vue/index.js +14 -14
  56. package/dist/adapters/vue/index.js.map +1 -1
  57. package/dist/agent/index.cjs +6 -6
  58. package/dist/agent/index.cjs.map +1 -1
  59. package/dist/agent/index.d.cts +2 -2
  60. package/dist/agent/index.d.ts +2 -2
  61. package/dist/agent/index.js +3 -3
  62. package/dist/agent/index.js.map +1 -1
  63. package/dist/{chunk-SVNK5NIK.js → chunk-2H6Y25FO.js} +6 -6
  64. package/dist/chunk-2H6Y25FO.js.map +1 -0
  65. package/dist/{chunk-DU2VIJAF.js → chunk-3JE77TNL.js} +16 -49
  66. package/dist/chunk-3JE77TNL.js.map +1 -0
  67. package/dist/{chunk-OE527MXF.cjs → chunk-3XFQI5P2.cjs} +2 -2
  68. package/dist/chunk-3XFQI5P2.cjs.map +1 -0
  69. package/dist/{chunk-XQTI4Q4I.js → chunk-A4GK3PLP.js} +4 -4
  70. package/dist/chunk-A4GK3PLP.js.map +1 -0
  71. package/dist/{chunk-PMKWYOOX.cjs → chunk-BXUEWV7V.cjs} +2 -2
  72. package/dist/chunk-BXUEWV7V.cjs.map +1 -0
  73. package/dist/{chunk-RFBIGRCI.js → chunk-C63CBYD5.js} +3 -3
  74. package/dist/chunk-C63CBYD5.js.map +1 -0
  75. package/dist/{chunk-FSUMCJAR.cjs → chunk-CQZH3L3W.cjs} +39 -39
  76. package/dist/chunk-CQZH3L3W.cjs.map +1 -0
  77. package/dist/{chunk-UGG7MCX4.cjs → chunk-DC5HONDE.cjs} +2 -2
  78. package/dist/chunk-DC5HONDE.cjs.map +1 -0
  79. package/dist/{chunk-OO247V4J.cjs → chunk-DLZNZHUW.cjs} +92 -125
  80. package/dist/chunk-DLZNZHUW.cjs.map +1 -0
  81. package/dist/{chunk-VOD5JA4D.js → chunk-EK2GBZ7D.js} +5 -5
  82. package/dist/chunk-EK2GBZ7D.js.map +1 -0
  83. package/dist/{chunk-WGPFR7MN.cjs → chunk-FKAPJMNR.cjs} +28 -28
  84. package/dist/chunk-FKAPJMNR.cjs.map +1 -0
  85. package/dist/{chunk-DIFE573X.js → chunk-G4OQ4PEO.js} +6 -6
  86. package/dist/chunk-G4OQ4PEO.js.map +1 -0
  87. package/dist/{chunk-RBU5PHN4.js → chunk-GQVJ5UAS.js} +2 -2
  88. package/dist/chunk-GQVJ5UAS.js.map +1 -0
  89. package/dist/{chunk-3IPM5QBT.cjs → chunk-HDREPLRA.cjs} +13 -13
  90. package/dist/chunk-HDREPLRA.cjs.map +1 -0
  91. package/dist/{chunk-TRJYDVWK.cjs → chunk-I35ZD3PU.cjs} +26 -26
  92. package/dist/chunk-I35ZD3PU.cjs.map +1 -0
  93. package/dist/{chunk-KW34ZKF5.cjs → chunk-ITGR7P2B.cjs} +2 -2
  94. package/dist/chunk-ITGR7P2B.cjs.map +1 -0
  95. package/dist/{chunk-JI7ZRESP.js → chunk-JKULAG53.js} +2 -2
  96. package/dist/chunk-JKULAG53.js.map +1 -0
  97. package/dist/{chunk-IZ2UU5UL.cjs → chunk-K54CT3QN.cjs} +50 -69
  98. package/dist/chunk-K54CT3QN.cjs.map +1 -0
  99. package/dist/{chunk-7TS3YVQR.js → chunk-M2ZZUSH3.js} +6 -7
  100. package/dist/chunk-M2ZZUSH3.js.map +1 -0
  101. package/dist/{chunk-GV7UC3SS.cjs → chunk-MEZCO7ND.cjs} +2 -2
  102. package/dist/chunk-MEZCO7ND.cjs.map +1 -0
  103. package/dist/{chunk-D4PUWBN6.cjs → chunk-NBXZ3RAC.cjs} +2 -2
  104. package/dist/chunk-NBXZ3RAC.cjs.map +1 -0
  105. package/dist/{chunk-L5223LLX.js → chunk-OBFFZ23H.js} +2 -2
  106. package/dist/chunk-OBFFZ23H.js.map +1 -0
  107. package/dist/{chunk-F2H7WP6R.js → chunk-OSIFUROH.js} +6 -6
  108. package/dist/chunk-OSIFUROH.js.map +1 -0
  109. package/dist/{chunk-G4LSLLGI.js → chunk-PCUXNVWF.js} +7 -7
  110. package/dist/chunk-PCUXNVWF.js.map +1 -0
  111. package/dist/{chunk-WGZZKCJQ.cjs → chunk-QHX3VA55.cjs} +7 -7
  112. package/dist/chunk-QHX3VA55.cjs.map +1 -0
  113. package/dist/{chunk-PNQY6OFB.cjs → chunk-QTJ4ZQRM.cjs} +20 -20
  114. package/dist/chunk-QTJ4ZQRM.cjs.map +1 -0
  115. package/dist/{chunk-KOYRJXTI.cjs → chunk-RVU6YEHO.cjs} +10 -11
  116. package/dist/chunk-RVU6YEHO.cjs.map +1 -0
  117. package/dist/{chunk-5AF72LOE.cjs → chunk-SABSY2BW.cjs} +8 -8
  118. package/dist/chunk-SABSY2BW.cjs.map +1 -0
  119. package/dist/{chunk-V4BPFFFV.js → chunk-SCXYAXMO.js} +3 -3
  120. package/dist/chunk-SCXYAXMO.js.map +1 -0
  121. package/dist/{chunk-2MNLEL45.js → chunk-SVWDKXSH.js} +2 -2
  122. package/dist/chunk-SVWDKXSH.js.map +1 -0
  123. package/dist/{chunk-3JRTELLC.js → chunk-UXFQZX6O.js} +3 -3
  124. package/dist/chunk-UXFQZX6O.js.map +1 -0
  125. package/dist/{chunk-OE4E6IBD.js → chunk-Y3UKAJJX.js} +2 -2
  126. package/dist/chunk-Y3UKAJJX.js.map +1 -0
  127. package/dist/{chunk-Y6XVPRYH.js → chunk-YV2G37TJ.js} +8 -27
  128. package/dist/chunk-YV2G37TJ.js.map +1 -0
  129. package/dist/{chunk-5YQIAS4V.cjs → chunk-ZR54IVVS.cjs} +20 -20
  130. package/dist/chunk-ZR54IVVS.cjs.map +1 -0
  131. package/dist/{chunk-TMLNVU5W.cjs → chunk-ZVQKCDUG.cjs} +7 -7
  132. package/dist/chunk-ZVQKCDUG.cjs.map +1 -0
  133. package/dist/{chunk-OGD5CCMZ.js → chunk-ZZRQAH5Z.js} +2 -2
  134. package/dist/chunk-ZZRQAH5Z.js.map +1 -0
  135. package/dist/devtools/index.cjs +12 -42
  136. package/dist/devtools/index.cjs.map +1 -1
  137. package/dist/devtools/index.d.cts +4 -4
  138. package/dist/devtools/index.d.ts +4 -4
  139. package/dist/devtools/index.js +9 -39
  140. package/dist/devtools/index.js.map +1 -1
  141. package/dist/document/index.cjs +16 -16
  142. package/dist/document/index.d.cts +6 -6
  143. package/dist/document/index.d.ts +6 -6
  144. package/dist/document/index.js +3 -3
  145. package/dist/{effects-CndX9K7D.d.cts → effects-DkBBrxVj.d.cts} +0 -2
  146. package/dist/{effects-CndX9K7D.d.ts → effects-DkBBrxVj.d.ts} +0 -2
  147. package/dist/{endpoints-CD-6Jl-H.d.ts → endpoints-DD6VsLv9.d.ts} +1 -1
  148. package/dist/{endpoints-Dem-EdRx.d.cts → endpoints-fqx9Vmf6.d.cts} +1 -1
  149. package/dist/examples/index.cjs +4 -4
  150. package/dist/examples/index.cjs.map +1 -1
  151. package/dist/examples/index.d.cts +4 -4
  152. package/dist/examples/index.d.ts +4 -4
  153. package/dist/examples/index.js +3 -3
  154. package/dist/examples/index.js.map +1 -1
  155. package/dist/{head-CAzfTnpV.d.cts → head-BOjhYA36.d.cts} +2 -2
  156. package/dist/{head-DRpbbj-l.d.ts → head-CBib11hD.d.ts} +2 -2
  157. package/dist/i18n/index.cjs +13 -13
  158. package/dist/i18n/index.d.cts +4 -6
  159. package/dist/i18n/index.d.ts +4 -6
  160. package/dist/i18n/index.js +3 -3
  161. package/dist/{index-CNfzSBe2.d.ts → index-BjQX8XZl.d.ts} +1 -1
  162. package/dist/{index-caZoXSwr.d.cts → index-BoPH5aSd.d.cts} +1 -1
  163. package/dist/index.cjs +91 -91
  164. package/dist/index.d.cts +11 -11
  165. package/dist/index.d.ts +11 -11
  166. package/dist/index.js +11 -11
  167. package/dist/migrations/index.cjs +8 -9
  168. package/dist/migrations/index.cjs.map +1 -1
  169. package/dist/migrations/index.d.cts +1 -1
  170. package/dist/migrations/index.d.ts +1 -1
  171. package/dist/migrations/index.js +5 -6
  172. package/dist/migrations/index.js.map +1 -1
  173. package/dist/{palette-CIpPH90W.d.ts → palette-BZujb2rm.d.ts} +1 -1
  174. package/dist/{palette-CvwZZCkx.d.cts → palette-CCxWSi3C.d.cts} +1 -1
  175. package/dist/reflect/index.cjs +27 -27
  176. package/dist/reflect/index.d.cts +5 -5
  177. package/dist/reflect/index.d.ts +5 -5
  178. package/dist/reflect/index.js +9 -9
  179. package/dist/{types-qnKMx0_V.d.ts → types-CJC8mnzl.d.ts} +0 -1
  180. package/dist/{types-j290XhCn.d.cts → types-CR56luN7.d.cts} +0 -1
  181. package/dist/{types-DsWNYc7R.d.cts → types-D0x56Ya-.d.cts} +1 -1
  182. package/dist/{types-D23TRvqe.d.ts → types-Dn9cBFCC.d.ts} +3 -3
  183. package/dist/{types-C9734_lJ.d.cts → types-DzB3TAQj.d.cts} +1 -1
  184. package/dist/{types-BWc-olbY.d.ts → types-LXw2RJfH.d.ts} +1 -1
  185. package/dist/{types-qkzTfSye.d.cts → types-OsJI-ceI.d.cts} +3 -3
  186. package/dist/{types-BSKx5MXW.d.ts → types-pbBIUNxw.d.ts} +1 -1
  187. package/package.json +7 -7
  188. package/dist/chunk-2MNLEL45.js.map +0 -1
  189. package/dist/chunk-3IPM5QBT.cjs.map +0 -1
  190. package/dist/chunk-3JRTELLC.js.map +0 -1
  191. package/dist/chunk-5AF72LOE.cjs.map +0 -1
  192. package/dist/chunk-5YQIAS4V.cjs.map +0 -1
  193. package/dist/chunk-7TS3YVQR.js.map +0 -1
  194. package/dist/chunk-D4PUWBN6.cjs.map +0 -1
  195. package/dist/chunk-DIFE573X.js.map +0 -1
  196. package/dist/chunk-DU2VIJAF.js.map +0 -1
  197. package/dist/chunk-F2H7WP6R.js.map +0 -1
  198. package/dist/chunk-FSUMCJAR.cjs.map +0 -1
  199. package/dist/chunk-G4LSLLGI.js.map +0 -1
  200. package/dist/chunk-GV7UC3SS.cjs.map +0 -1
  201. package/dist/chunk-IZ2UU5UL.cjs.map +0 -1
  202. package/dist/chunk-JI7ZRESP.js.map +0 -1
  203. package/dist/chunk-KOYRJXTI.cjs.map +0 -1
  204. package/dist/chunk-KW34ZKF5.cjs.map +0 -1
  205. package/dist/chunk-L5223LLX.js.map +0 -1
  206. package/dist/chunk-OE4E6IBD.js.map +0 -1
  207. package/dist/chunk-OE527MXF.cjs.map +0 -1
  208. package/dist/chunk-OGD5CCMZ.js.map +0 -1
  209. package/dist/chunk-OO247V4J.cjs.map +0 -1
  210. package/dist/chunk-PMKWYOOX.cjs.map +0 -1
  211. package/dist/chunk-PNQY6OFB.cjs.map +0 -1
  212. package/dist/chunk-RBU5PHN4.js.map +0 -1
  213. package/dist/chunk-RFBIGRCI.js.map +0 -1
  214. package/dist/chunk-SVNK5NIK.js.map +0 -1
  215. package/dist/chunk-TMLNVU5W.cjs.map +0 -1
  216. package/dist/chunk-TRJYDVWK.cjs.map +0 -1
  217. package/dist/chunk-UGG7MCX4.cjs.map +0 -1
  218. package/dist/chunk-V4BPFFFV.js.map +0 -1
  219. package/dist/chunk-VOD5JA4D.js.map +0 -1
  220. package/dist/chunk-WGPFR7MN.cjs.map +0 -1
  221. package/dist/chunk-WGZZKCJQ.cjs.map +0 -1
  222.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,EACf;AACA,EAAA,OAAO,IAAI,CAAC,CAAA,EAAG,MAAK,KAAM,EAAA,MAAQ,KAAA,EAAM;AACxC,EAAA,OAAO,GAAA,CAAI,IAAI,MAAA,GAAS,CAAC,GAAG,IAAA,EAAK,KAAM,EAAA,EAAI,GAAA,CAAI,GAAA,EAAI;AACnD,EAAA,OAAO,GAAA;AACT,CAAA;AAEO,IAAM,gBAAgB,CAC3B,QAAA,EACA,GAAA,EACA,OAAA,GAAuC,EAAC,KAC5B;AACZ,EAAA,MAAM,SAAS,MAAgB;AAC7B,IAAA,MAAM,MAAwB,EAAC;AAG/B,IAAA,MAAM,MAAW,EAAE,QAAA,EAAU,MAAA,EAAQ,EAAA,EAAI,KAAK,GAAA,EAAK,GAAI,OAAA,CAAQ,QAAA,KAAa,SAAY,EAAE,QAAA,EAAU,QAAQ,QAAA,EAAS,GAAI,EAAC,EAAG;AAC7H,IAAA,MAAM,KAAA,GAAQ,GAAA,CAAI,KAAA,EAAM,CAAE,OAAA,CAAQ,CAAC,IAAA,KAAS,UAAA,CAAW,IAAA,EAAM,GAAG,CAAA,CAAE,KAAK,CAAA;AACvE,IAAA,OAAO,EAAE,MAAM,IAAA,CAAK,KAAK,EAAE,IAAA,CAAK,IAAI,CAAA,EAAG,YAAA,EAAc,GAAA,EAAI;AAAA,EAC3D,CAAA;AACA,EAAA,OAAO,EAAE,MAAA,EAAO;AAClB","file":"index.cjs","sourcesContent":["import type { ComponentRegistry, RenderNode } from '@layout/types';\nimport { isHeadNode } from '@shell';\nimport type { RenderApi } from '@shell';\n\n// ═══════════════════════════════════════════════════════════\n// @niscorp/nova/adapters/tty — a text adapter, the terminal sibling of\n// nova/dom. It turns a served RenderNode tree into lines of plain text plus a\n// numbered table of INTERACTIVES: every `ref`'d node prints with a `[n]`\n// marker and lands in the table, so a REPL host can map \"click 3\" / \"set 5 x\"\n// onto the same event vocabulary the DOM adapter wires by convention —\n// `ui:click` (payload = the node's `value` prop), `ui:model`, `ui:key`.\n// Origin is never stamped here — moss stamps the active instance server-side.\n//\n// No framework, no I/O, no node builtins: render() is a pure snapshot →\n// { text, interactives }. The host (moss's terminal/tty target) owns stdio,\n// prompts, and dispatch; this adapter only says what the screen IS and what\n// on it can be acted on. `CanvasSlot` is resolved here (the frame's markers →\n// per-canvas trees), the one piece of terminal structure the renderer owns.\n// See packages/nova/ADAPTER.md for the shared adapter contract.\n// ═══════════════════════════════════════════════════════════\n\n// A rendered block: lines of text, composed upward (a Stack stacks child\n// blocks, a Row joins single-line children inline, …).\nexport type TtyBlock = { lines: string[] };\n\n// What an interactive marker can be driven with — the REPL host maps these\n// to events: click/row → ui:click, model → ui:model (a typed value),\n// toggle → ui:model (a negated boolean).\nexport type TtyInteractiveKind = 'click' | 'row' | 'model' | 'toggle';\n\nexport type TtyInteractive = {\n // the printed `[n]` — 1-based, in registration order\n index: number;\n kind: TtyInteractiveKind;\n ref: string;\n // the canvas whose dispatch this belongs to; '' = frame chrome (dispatches\n // nothing, same as the DOM adapter's frame)\n canvas: string;\n // the action instance it sits in (the enclosing ActionSlot's instanceId) —\n // a list canvas renders several live instances at once, so the host stamps\n // this as the event's origin, exactly as the DOM adapter does. Absent\n // outside any instance.\n origin?: string;\n // what was printed — for the host's `refs` listing\n label: string;\n // click/row: the dispatch payload; model/toggle: the current value\n value?: unknown;\n // the model path, when model-bound — display only, the server owns meaning\n path?: string;\n};\n\nexport type TtyComponentContext = {\n props: Record<string, unknown>;\n // the node's children, already rendered — the component stacks or joins\n // them where it wants (leaves ignore them).\n children: TtyBlock[];\n // register an interactive and get its printed index — for data-driven\n // components with INTERNAL interactivity (a table's rows, a panel's ✕);\n // simple components let the renderer mark their `ref`/`model` by convention.\n register: (entry: { kind: TtyInteractiveKind; ref: string; label: string; value?: unknown; path?: string }) => number;\n};\n\n// A TTY component: props + rendered children in, one block of lines out.\nexport type TtyComponent = (ctx: TtyComponentContext) => TtyBlock;\n\n// What the terminal hands the view: core's `RenderApi` — the same single\n// definition the dom/react adapters and moss's terminal share.\nexport type TtyRenderApi = RenderApi;\n\n// One rendered frame: the full screen text and everything actionable on it.\nexport type TtyFrame = { text: string; interactives: TtyInteractive[] };\n\nexport type TtyView = {\n // render the current snapshot; call on every wire change\n render: () => TtyFrame;\n};\n\nconst CANVAS_SLOT = 'CanvasSlot';\nconst ACTION_SLOT = 'ActionSlot';\nconst RULE_WIDTH = 60;\n\n// The recursion context: the registry, the canvas in force (frame chrome is\n// ''; a CanvasSlot switches it), the interactive accumulator, the resolver.\ntype Ctx = {\n registry: ComponentRegistry<TtyComponent>;\n canvas: string;\n // the enclosing action instance, when inside one (an ActionSlot switches it)\n origin?: string;\n api: TtyRenderApi;\n out: TtyInteractive[];\n // used when a component name is unregistered — a permissive renderer (the\n // default kit) supplies one so unknown primitives render their children\n // instead of an error; strict consumers omit it.\n fallback?: TtyComponent;\n};\n\nconst errorBlock = (code: string, message: string): TtyBlock => ({ lines: [`!! ${code}: ${message}`] });\n\nconst labelOf = (block: TtyBlock, ref: string): string => {\n const first = block.lines[0]?.trim() ?? '';\n return first === '' ? ref : first.slice(0, 48);\n};\n\n// A canvas heading: `── main ─────…` — the one piece of chrome the renderer\n// prints itself, so a REPL reader can tell canvases apart.\nconst canvasRule = (id: string): string => {\n const head = `── ${id} `;\n return head + '─'.repeat(Math.max(0, RULE_WIDTH - head.length));\n};\n\nconst renderNode = (node: RenderNode, ctx: Ctx): TtyBlock => {\n if (node.type === 'text') return { lines: node.value.split('\\n') };\n if (node.type === 'fragment') return { lines: node.children.flatMap((child) => renderNode(child, ctx).lines) };\n if (node.type === 'error') return errorBlock(node.code, node.message);\n\n // component\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 { lines: [] };\n if (node.name === CANVAS_SLOT) {\n const canvasId = typeof node.props['canvasId'] === 'string' ? (node.props['canvasId'] as string) : '';\n if (canvasId === '') return { lines: [] };\n const tree = ctx.api.canvasTree(canvasId);\n // an empty canvas collapses entirely — no heading for nothing\n if (tree.length === 0) return { lines: [] };\n // a canvas starts outside any instance, even one placed by an instance's layout\n const { origin: _outer, ...outside } = ctx;\n const canvasCtx: Ctx = { ...outside, canvas: canvasId };\n return { lines: [canvasRule(canvasId), ...tree.flatMap((child) => renderNode(child, canvasCtx).lines), ''] };\n }\n\n const entry = ctx.registry.get(node.name);\n const build = entry !== undefined ? entry.component : ctx.fallback;\n if (build === undefined) return errorBlock('COMPONENT_NOT_FOUND', node.name);\n\n // An ActionSlot is an instance boundary: what is inside it belongs to it.\n const instanceId = node.name === ACTION_SLOT ? node.props['instanceId'] : undefined;\n const inner: Ctx = typeof instanceId === 'string' && instanceId !== '' ? { ...ctx, origin: instanceId } : ctx;\n const children = node.children.filter((child) => !isHeadNode(child)).map((child) => renderNode(child, inner));\n const register: TtyComponentContext['register'] = (item) => {\n const interactive: TtyInteractive = { index: ctx.out.length + 1, canvas: ctx.canvas, ...(ctx.origin !== undefined ? { origin: ctx.origin } : {}), ...item };\n ctx.out.push(interactive);\n return interactive.index;\n };\n const block = build({ props: node.props, children, register });\n\n // Convention wiring, the TTY twin of the DOM adapter's listeners: a model'd\n // node is an input (`toggle` when its current value is a boolean), a bare\n // ref'd node is clickable (payload = its `value` prop). The marker lands on\n // the block's first line.\n if (node.model !== undefined) {\n const current = node.props['value'] ?? node.props['checked'];\n const kind: TtyInteractiveKind = typeof current === 'boolean' ? 'toggle' : 'model';\n const index = register({ kind, ref: node.model.ref, label: labelOf(block, node.model.ref), value: current, path: node.model.path });\n return { lines: [`[${index}] ${block.lines[0] ?? ''}`, ...block.lines.slice(1)] };\n }\n if (node.ref !== undefined) {\n const value = node.props['value'];\n const index = register({ kind: 'click', ref: node.ref, label: labelOf(block, node.ref), ...(value !== undefined ? { value } : {}) });\n return { lines: [`[${index}] ${block.lines[0] ?? ''}`, ...block.lines.slice(1)] };\n }\n return block;\n};\n\n// Collapse runs of blank lines so stacked empty canvases don't leave gaps.\nconst tidy = (lines: string[]): string[] => {\n const out: string[] = [];\n for (const line of lines) {\n if (line.trim() === '' && out[out.length - 1]?.trim() === '') continue;\n out.push(line);\n }\n while (out[0]?.trim() === '') out.shift();\n while (out[out.length - 1]?.trim() === '') out.pop();\n return out;\n};\n\nexport const createTtyView = (\n registry: ComponentRegistry<TtyComponent>,\n api: TtyRenderApi,\n options: { fallback?: TtyComponent } = {},\n): TtyView => {\n const render = (): TtyFrame => {\n const out: TtyInteractive[] = [];\n // The frame is chrome — its interactives belong to no canvas and the host\n // dispatches nothing for them, same as the DOM adapter's frame dispatch.\n const ctx: Ctx = { registry, canvas: '', api, out, ...(options.fallback !== undefined ? { fallback: options.fallback } : {}) };\n const lines = api.frame().flatMap((node) => renderNode(node, ctx).lines);\n return { text: tidy(lines).join('\\n'), interactives: out };\n };\n return { render };\n};\n"]}
1
+ {"version":3,"sources":["../../../src/adapters/tty/index.ts"],"names":["isHeadNode"],"mappings":";;;;;;;;;;;;;;;AAqCA,IAAM,WAAA,GAAc,YAAA;AACpB,IAAM,WAAA,GAAc,YAAA;AACpB,IAAM,UAAA,GAAa,EAAA;AAWnB,IAAM,UAAA,GAAa,CAAC,IAAA,EAAc,OAAA,MAA+B,EAAE,KAAA,EAAO,CAAC,CAAA,GAAA,EAAM,IAAI,CAAA,EAAA,EAAK,OAAO,CAAA,CAAE,CAAA,EAAE,CAAA;AAErG,IAAM,OAAA,GAAU,CAAC,KAAA,EAAiB,GAAA,KAAwB;AACxD,EAAA,MAAM,QAAQ,KAAA,CAAM,KAAA,CAAM,CAAC,CAAA,EAAG,MAAK,IAAK,EAAA;AACxC,EAAA,OAAO,UAAU,EAAA,GAAK,GAAA,GAAM,KAAA,CAAM,KAAA,CAAM,GAAG,EAAE,CAAA;AAC/C,CAAA;AAEA,IAAM,UAAA,GAAa,CAAC,EAAA,KAAuB;AACzC,EAAA,MAAM,IAAA,GAAO,gBAAM,EAAE,CAAA,CAAA,CAAA;AACrB,EAAA,OAAO,IAAA,GAAO,SAAI,MAAA,CAAO,IAAA,CAAK,IAAI,CAAA,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A,OAAO,EAAE,MAAA,EAAO;AAClB","file":"index.cjs","sourcesContent":["import type { ComponentRegistry, RenderNode } from '@layout/types';\nimport { isHeadNode } from '@shell';\nimport type { RenderApi } from '@shell';\n\nexport type TtyBlock = { lines: string[] };\n\nexport type TtyInteractiveKind = 'click' | 'row' | 'model' | 'toggle';\n\nexport type TtyInteractive = {\n index: number;\n kind: TtyInteractiveKind;\n ref: string;\n // '' is the frame, which dispatches nothing.\n canvas: string;\n origin?: string;\n label: string;\n // click and row: the dispatch payload. model and toggle: the current value.\n value?: unknown;\n path?: string;\n};\n\nexport type TtyComponentContext = {\n props: Record<string, unknown>;\n children: TtyBlock[];\n register: (entry: { kind: TtyInteractiveKind; ref: string; label: string; value?: unknown; path?: string }) => number;\n};\n\nexport type TtyComponent = (ctx: TtyComponentContext) => TtyBlock;\n\nexport type TtyRenderApi = RenderApi;\n\nexport type TtyFrame = { text: string; interactives: TtyInteractive[] };\n\nexport type TtyView = {\n render: () => TtyFrame;\n};\n\nconst CANVAS_SLOT = 'CanvasSlot';\nconst ACTION_SLOT = 'ActionSlot';\nconst RULE_WIDTH = 60;\n\ntype Ctx = {\n registry: ComponentRegistry<TtyComponent>;\n canvas: string;\n origin?: string;\n api: TtyRenderApi;\n out: TtyInteractive[];\n fallback?: TtyComponent;\n};\n\nconst errorBlock = (code: string, message: string): TtyBlock => ({ lines: [`!! ${code}: ${message}`] });\n\nconst labelOf = (block: TtyBlock, ref: string): string => {\n const first = block.lines[0]?.trim() ?? '';\n return first === '' ? ref : first.slice(0, 48);\n};\n\nconst canvasRule = (id: string): string => {\n const head = `── ${id} `;\n return head + '─'.repeat(Math.max(0, RULE_WIDTH - head.length));\n};\n\nconst renderNode = (node: RenderNode, ctx: Ctx): TtyBlock => {\n if (node.type === 'text') return { lines: node.value.split('\\n') };\n if (node.type === 'fragment') return { lines: node.children.flatMap((child) => renderNode(child, ctx).lines) };\n if (node.type === 'error') return errorBlock(node.code, node.message);\n\n if (isHeadNode(node)) return { lines: [] };\n if (node.name === CANVAS_SLOT) {\n const canvasId = typeof node.props['canvasId'] === 'string' ? (node.props['canvasId'] as string) : '';\n if (canvasId === '') return { lines: [] };\n const tree = ctx.api.canvasTree(canvasId);\n if (tree.length === 0) return { lines: [] };\n // A canvas starts outside any instance, even when an instance's layout placed it.\n const { origin: _outer, ...outside } = ctx;\n const canvasCtx: Ctx = { ...outside, canvas: canvasId };\n return { lines: [canvasRule(canvasId), ...tree.flatMap((child) => renderNode(child, canvasCtx).lines), ''] };\n }\n\n const entry = ctx.registry.get(node.name);\n const build = entry !== undefined ? entry.component : ctx.fallback;\n if (build === undefined) return errorBlock('COMPONENT_NOT_FOUND', node.name);\n\n const instanceId = node.name === ACTION_SLOT ? node.props['instanceId'] : undefined;\n const inner: Ctx = typeof instanceId === 'string' && instanceId !== '' ? { ...ctx, origin: instanceId } : ctx;\n const children = node.children.filter((child) => !isHeadNode(child)).map((child) => renderNode(child, inner));\n const register: TtyComponentContext['register'] = (item) => {\n const interactive: TtyInteractive = { index: ctx.out.length + 1, canvas: ctx.canvas, ...(ctx.origin !== undefined ? { origin: ctx.origin } : {}), ...item };\n ctx.out.push(interactive);\n return interactive.index;\n };\n const block = build({ props: node.props, children, register });\n\n if (node.model !== undefined) {\n const current = node.props['value'] ?? node.props['checked'];\n const kind: TtyInteractiveKind = typeof current === 'boolean' ? 'toggle' : 'model';\n const index = register({ kind, ref: node.model.ref, label: labelOf(block, node.model.ref), value: current, path: node.model.path });\n return { lines: [`[${index}] ${block.lines[0] ?? ''}`, ...block.lines.slice(1)] };\n }\n if (node.ref !== undefined) {\n const value = node.props['value'];\n const index = register({ kind: 'click', ref: node.ref, label: labelOf(block, node.ref), ...(value !== undefined ? { value } : {}) });\n return { lines: [`[${index}] ${block.lines[0] ?? ''}`, ...block.lines.slice(1)] };\n }\n return block;\n};\n\nconst tidy = (lines: string[]): string[] => {\n const out: string[] = [];\n for (const line of lines) {\n if (line.trim() === '' && out[out.length - 1]?.trim() === '') continue;\n out.push(line);\n }\n while (out[0]?.trim() === '') out.shift();\n while (out[out.length - 1]?.trim() === '') out.pop();\n return out;\n};\n\nexport const createTtyView = (\n registry: ComponentRegistry<TtyComponent>,\n api: TtyRenderApi,\n options: { fallback?: TtyComponent } = {},\n): TtyView => {\n const render = (): TtyFrame => {\n const out: TtyInteractive[] = [];\n const ctx: Ctx = { registry, canvas: '', api, out, ...(options.fallback !== undefined ? { fallback: options.fallback } : {}) };\n const lines = api.frame().flatMap((node) => renderNode(node, ctx).lines);\n return { text: tidy(lines).join('\\n'), interactives: out };\n };\n return { render };\n};\n"]}
@@ -1,9 +1,9 @@
1
- import { C as ComponentRegistry } from '../../types-j290XhCn.cjs';
2
- import { R as RenderApi } from '../../types-qkzTfSye.cjs';
1
+ import { C as ComponentRegistry } from '../../types-CR56luN7.cjs';
2
+ import { R as RenderApi } from '../../types-OsJI-ceI.cjs';
3
3
  import 'zod';
4
4
  import '../../schemas-DPdeFlCT.cjs';
5
- import '../../index-caZoXSwr.cjs';
6
- import '../../effects-CndX9K7D.cjs';
5
+ import '../../index-BoPH5aSd.cjs';
6
+ import '../../effects-DkBBrxVj.cjs';
7
7
  import '../../schemas-pMyyuXV7.cjs';
8
8
 
9
9
  type TtyBlock = {
@@ -1,9 +1,9 @@
1
- import { C as ComponentRegistry } from '../../types-qnKMx0_V.js';
2
- import { R as RenderApi } from '../../types-D23TRvqe.js';
1
+ import { C as ComponentRegistry } from '../../types-CJC8mnzl.js';
2
+ import { R as RenderApi } from '../../types-Dn9cBFCC.js';
3
3
  import 'zod';
4
4
  import '../../schemas-DPdeFlCT.js';
5
- import '../../index-CNfzSBe2.js';
6
- import '../../effects-CndX9K7D.js';
5
+ import '../../index-BjQX8XZl.js';
6
+ import '../../effects-DkBBrxVj.js';
7
7
  import '../../schemas-pMyyuXV7.js';
8
8
 
9
9
  type TtyBlock = {
@@ -1,13 +1,13 @@
1
- import '../../chunk-DU2VIJAF.js';
2
- import { isHeadNode } from '../../chunk-RFBIGRCI.js';
3
- import '../../chunk-Y6XVPRYH.js';
4
- import '../../chunk-OGD5CCMZ.js';
5
- import '../../chunk-7TS3YVQR.js';
6
- import '../../chunk-OE4E6IBD.js';
7
- import '../../chunk-DIFE573X.js';
8
- import '../../chunk-JI7ZRESP.js';
9
- import '../../chunk-RBU5PHN4.js';
10
- import '../../chunk-2MNLEL45.js';
1
+ import '../../chunk-3JE77TNL.js';
2
+ import { isHeadNode } from '../../chunk-C63CBYD5.js';
3
+ import '../../chunk-YV2G37TJ.js';
4
+ import '../../chunk-ZZRQAH5Z.js';
5
+ import '../../chunk-M2ZZUSH3.js';
6
+ import '../../chunk-Y3UKAJJX.js';
7
+ import '../../chunk-G4OQ4PEO.js';
8
+ import '../../chunk-JKULAG53.js';
9
+ import '../../chunk-GQVJ5UAS.js';
10
+ import '../../chunk-SVWDKXSH.js';
11
11
  import '../../chunk-PZ5AY32C.js';
12
12
 
13
13
  // src/adapters/tty/index.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/adapters/tty/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AA6EA,IAAM,WAAA,GAAc,YAAA;AACpB,IAAM,WAAA,GAAc,YAAA;AACpB,IAAM,UAAA,GAAa,EAAA;AAiBnB,IAAM,UAAA,GAAa,CAAC,IAAA,EAAc,OAAA,MAA+B,EAAE,KAAA,EAAO,CAAC,CAAA,GAAA,EAAM,IAAI,CAAA,EAAA,EAAK,OAAO,CAAA,CAAE,CAAA,EAAE,CAAA;AAErG,IAAM,OAAA,GAAU,CAAC,KAAA,EAAiB,GAAA,KAAwB;AACxD,EAAA,MAAM,QAAQ,KAAA,CAAM,KAAA,CAAM,CAAC,CAAA,EAAG,MAAK,IAAK,EAAA;AACxC,EAAA,OAAO,UAAU,EAAA,GAAK,GAAA,GAAM,KAAA,CAAM,KAAA,CAAM,GAAG,EAAE,CAAA;AAC/C,CAAA;AAIA,IAAM,UAAA,GAAa,CAAC,EAAA,KAAuB;AACzC,EAAA,MAAM,IA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AM,IAAA,CAAK,KAAK,EAAE,IAAA,CAAK,IAAI,CAAA,EAAG,YAAA,EAAc,GAAA,EAAI;AAAA,EAC3D,CAAA;AACA,EAAA,OAAO,EAAE,MAAA,EAAO;AAClB","file":"index.js","sourcesContent":["import type { ComponentRegistry, RenderNode } from '@layout/types';\nimport { isHeadNode } from '@shell';\nimport type { RenderApi } from '@shell';\n\n// ═══════════════════════════════════════════════════════════\n// @niscorp/nova/adapters/tty — a text adapter, the terminal sibling of\n// nova/dom. It turns a served RenderNode tree into lines of plain text plus a\n// numbered table of INTERACTIVES: every `ref`'d node prints with a `[n]`\n// marker and lands in the table, so a REPL host can map \"click 3\" / \"set 5 x\"\n// onto the same event vocabulary the DOM adapter wires by convention —\n// `ui:click` (payload = the node's `value` prop), `ui:model`, `ui:key`.\n// Origin is never stamped here — moss stamps the active instance server-side.\n//\n// No framework, no I/O, no node builtins: render() is a pure snapshot →\n// { text, interactives }. The host (moss's terminal/tty target) owns stdio,\n// prompts, and dispatch; this adapter only says what the screen IS and what\n// on it can be acted on. `CanvasSlot` is resolved here (the frame's markers →\n// per-canvas trees), the one piece of terminal structure the renderer owns.\n// See packages/nova/ADAPTER.md for the shared adapter contract.\n// ═══════════════════════════════════════════════════════════\n\n// A rendered block: lines of text, composed upward (a Stack stacks child\n// blocks, a Row joins single-line children inline, …).\nexport type TtyBlock = { lines: string[] };\n\n// What an interactive marker can be driven with — the REPL host maps these\n// to events: click/row → ui:click, model → ui:model (a typed value),\n// toggle → ui:model (a negated boolean).\nexport type TtyInteractiveKind = 'click' | 'row' | 'model' | 'toggle';\n\nexport type TtyInteractive = {\n // the printed `[n]` — 1-based, in registration order\n index: number;\n kind: TtyInteractiveKind;\n ref: string;\n // the canvas whose dispatch this belongs to; '' = frame chrome (dispatches\n // nothing, same as the DOM adapter's frame)\n canvas: string;\n // the action instance it sits in (the enclosing ActionSlot's instanceId) —\n // a list canvas renders several live instances at once, so the host stamps\n // this as the event's origin, exactly as the DOM adapter does. Absent\n // outside any instance.\n origin?: string;\n // what was printed — for the host's `refs` listing\n label: string;\n // click/row: the dispatch payload; model/toggle: the current value\n value?: unknown;\n // the model path, when model-bound — display only, the server owns meaning\n path?: string;\n};\n\nexport type TtyComponentContext = {\n props: Record<string, unknown>;\n // the node's children, already rendered — the component stacks or joins\n // them where it wants (leaves ignore them).\n children: TtyBlock[];\n // register an interactive and get its printed index — for data-driven\n // components with INTERNAL interactivity (a table's rows, a panel's ✕);\n // simple components let the renderer mark their `ref`/`model` by convention.\n register: (entry: { kind: TtyInteractiveKind; ref: string; label: string; value?: unknown; path?: string }) => number;\n};\n\n// A TTY component: props + rendered children in, one block of lines out.\nexport type TtyComponent = (ctx: TtyComponentContext) => TtyBlock;\n\n// What the terminal hands the view: core's `RenderApi` — the same single\n// definition the dom/react adapters and moss's terminal share.\nexport type TtyRenderApi = RenderApi;\n\n// One rendered frame: the full screen text and everything actionable on it.\nexport type TtyFrame = { text: string; interactives: TtyInteractive[] };\n\nexport type TtyView = {\n // render the current snapshot; call on every wire change\n render: () => TtyFrame;\n};\n\nconst CANVAS_SLOT = 'CanvasSlot';\nconst ACTION_SLOT = 'ActionSlot';\nconst RULE_WIDTH = 60;\n\n// The recursion context: the registry, the canvas in force (frame chrome is\n// ''; a CanvasSlot switches it), the interactive accumulator, the resolver.\ntype Ctx = {\n registry: ComponentRegistry<TtyComponent>;\n canvas: string;\n // the enclosing action instance, when inside one (an ActionSlot switches it)\n origin?: string;\n api: TtyRenderApi;\n out: TtyInteractive[];\n // used when a component name is unregistered — a permissive renderer (the\n // default kit) supplies one so unknown primitives render their children\n // instead of an error; strict consumers omit it.\n fallback?: TtyComponent;\n};\n\nconst errorBlock = (code: string, message: string): TtyBlock => ({ lines: [`!! ${code}: ${message}`] });\n\nconst labelOf = (block: TtyBlock, ref: string): string => {\n const first = block.lines[0]?.trim() ?? '';\n return first === '' ? ref : first.slice(0, 48);\n};\n\n// A canvas heading: `── main ─────…` — the one piece of chrome the renderer\n// prints itself, so a REPL reader can tell canvases apart.\nconst canvasRule = (id: string): string => {\n const head = `── ${id} `;\n return head + '─'.repeat(Math.max(0, RULE_WIDTH - head.length));\n};\n\nconst renderNode = (node: RenderNode, ctx: Ctx): TtyBlock => {\n if (node.type === 'text') return { lines: node.value.split('\\n') };\n if (node.type === 'fragment') return { lines: node.children.flatMap((child) => renderNode(child, ctx).lines) };\n if (node.type === 'error') return errorBlock(node.code, node.message);\n\n // component\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 { lines: [] };\n if (node.name === CANVAS_SLOT) {\n const canvasId = typeof node.props['canvasId'] === 'string' ? (node.props['canvasId'] as string) : '';\n if (canvasId === '') return { lines: [] };\n const tree = ctx.api.canvasTree(canvasId);\n // an empty canvas collapses entirely — no heading for nothing\n if (tree.length === 0) return { lines: [] };\n // a canvas starts outside any instance, even one placed by an instance's layout\n const { origin: _outer, ...outside } = ctx;\n const canvasCtx: Ctx = { ...outside, canvas: canvasId };\n return { lines: [canvasRule(canvasId), ...tree.flatMap((child) => renderNode(child, canvasCtx).lines), ''] };\n }\n\n const entry = ctx.registry.get(node.name);\n const build = entry !== undefined ? entry.component : ctx.fallback;\n if (build === undefined) return errorBlock('COMPONENT_NOT_FOUND', node.name);\n\n // An ActionSlot is an instance boundary: what is inside it belongs to it.\n const instanceId = node.name === ACTION_SLOT ? node.props['instanceId'] : undefined;\n const inner: Ctx = typeof instanceId === 'string' && instanceId !== '' ? { ...ctx, origin: instanceId } : ctx;\n const children = node.children.filter((child) => !isHeadNode(child)).map((child) => renderNode(child, inner));\n const register: TtyComponentContext['register'] = (item) => {\n const interactive: TtyInteractive = { index: ctx.out.length + 1, canvas: ctx.canvas, ...(ctx.origin !== undefined ? { origin: ctx.origin } : {}), ...item };\n ctx.out.push(interactive);\n return interactive.index;\n };\n const block = build({ props: node.props, children, register });\n\n // Convention wiring, the TTY twin of the DOM adapter's listeners: a model'd\n // node is an input (`toggle` when its current value is a boolean), a bare\n // ref'd node is clickable (payload = its `value` prop). The marker lands on\n // the block's first line.\n if (node.model !== undefined) {\n const current = node.props['value'] ?? node.props['checked'];\n const kind: TtyInteractiveKind = typeof current === 'boolean' ? 'toggle' : 'model';\n const index = register({ kind, ref: node.model.ref, label: labelOf(block, node.model.ref), value: current, path: node.model.path });\n return { lines: [`[${index}] ${block.lines[0] ?? ''}`, ...block.lines.slice(1)] };\n }\n if (node.ref !== undefined) {\n const value = node.props['value'];\n const index = register({ kind: 'click', ref: node.ref, label: labelOf(block, node.ref), ...(value !== undefined ? { value } : {}) });\n return { lines: [`[${index}] ${block.lines[0] ?? ''}`, ...block.lines.slice(1)] };\n }\n return block;\n};\n\n// Collapse runs of blank lines so stacked empty canvases don't leave gaps.\nconst tidy = (lines: string[]): string[] => {\n const out: string[] = [];\n for (const line of lines) {\n if (line.trim() === '' && out[out.length - 1]?.trim() === '') continue;\n out.push(line);\n }\n while (out[0]?.trim() === '') out.shift();\n while (out[out.length - 1]?.trim() === '') out.pop();\n return out;\n};\n\nexport const createTtyView = (\n registry: ComponentRegistry<TtyComponent>,\n api: TtyRenderApi,\n options: { fallback?: TtyComponent } = {},\n): TtyView => {\n const render = (): TtyFrame => {\n const out: TtyInteractive[] = [];\n // The frame is chrome — its interactives belong to no canvas and the host\n // dispatches nothing for them, same as the DOM adapter's frame dispatch.\n const ctx: Ctx = { registry, canvas: '', api, out, ...(options.fallback !== undefined ? { fallback: options.fallback } : {}) };\n const lines = api.frame().flatMap((node) => renderNode(node, ctx).lines);\n return { text: tidy(lines).join('\\n'), interactives: out };\n };\n return { render };\n};\n"]}
1
+ {"version":3,"sources":["../../../src/adapters/tty/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAqCA,IAAM,WAAA,GAAc,YAAA;AACpB,IAAM,WAAA,GAAc,YAAA;AACpB,IAAM,UAAA,GAAa,EAAA;AAWnB,IAAM,UAAA,GAAa,CAAC,IAAA,EAAc,OAAA,MAA+B,EAAE,KAAA,EAAO,CAAC,CAAA,GA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IAAA,MAAM,MAAwB,EAAC;AAC/B,IAAA,MAAM,MAAW,EAAE,QAAA,EAAU,MAAA,EAAQ,EAAA,EAAI,KAAK,GAAA,EAAK,GAAI,OAAA,CAAQ,QAAA,KAAa,SAAY,EAAE,QAAA,EAAU,QAAQ,QAAA,EAAS,GAAI,EAAC,EAAG;AAC7H,IAAA,MAAM,KAAA,GAAQ,GAAA,CAAI,KAAA,EAAM,CAAE,OAAA,CAAQ,CAAC,IAAA,KAAS,UAAA,CAAW,IAAA,EAAM,GAAG,CAAA,CAAE,KAAK,CAAA;AACvE,IAAA,OAAO,EAAE,MAAM,IAAA,CAAK,KAAK,EAAE,IAAA,CAAK,IAAI,CAAA,EAAG,YAAA,EAAc,GAAA,EAAI;AAAA,EAC3D,CAAA;AACA,EAAA,OAAO,EAAE,MAAA,EAAO;AAClB","file":"index.js","sourcesContent":["import type { ComponentRegistry, RenderNode } from '@layout/types';\nimport { isHeadNode } from '@shell';\nimport type { RenderApi } from '@shell';\n\nexport type TtyBlock = { lines: string[] };\n\nexport type TtyInteractiveKind = 'click' | 'row' | 'model' | 'toggle';\n\nexport type TtyInteractive = {\n index: number;\n kind: TtyInteractiveKind;\n ref: string;\n // '' is the frame, which dispatches nothing.\n canvas: string;\n origin?: string;\n label: string;\n // click and row: the dispatch payload. model and toggle: the current value.\n value?: unknown;\n path?: string;\n};\n\nexport type TtyComponentContext = {\n props: Record<string, unknown>;\n children: TtyBlock[];\n register: (entry: { kind: TtyInteractiveKind; ref: string; label: string; value?: unknown; path?: string }) => number;\n};\n\nexport type TtyComponent = (ctx: TtyComponentContext) => TtyBlock;\n\nexport type TtyRenderApi = RenderApi;\n\nexport type TtyFrame = { text: string; interactives: TtyInteractive[] };\n\nexport type TtyView = {\n render: () => TtyFrame;\n};\n\nconst CANVAS_SLOT = 'CanvasSlot';\nconst ACTION_SLOT = 'ActionSlot';\nconst RULE_WIDTH = 60;\n\ntype Ctx = {\n registry: ComponentRegistry<TtyComponent>;\n canvas: string;\n origin?: string;\n api: TtyRenderApi;\n out: TtyInteractive[];\n fallback?: TtyComponent;\n};\n\nconst errorBlock = (code: string, message: string): TtyBlock => ({ lines: [`!! ${code}: ${message}`] });\n\nconst labelOf = (block: TtyBlock, ref: string): string => {\n const first = block.lines[0]?.trim() ?? '';\n return first === '' ? ref : first.slice(0, 48);\n};\n\nconst canvasRule = (id: string): string => {\n const head = `── ${id} `;\n return head + '─'.repeat(Math.max(0, RULE_WIDTH - head.length));\n};\n\nconst renderNode = (node: RenderNode, ctx: Ctx): TtyBlock => {\n if (node.type === 'text') return { lines: node.value.split('\\n') };\n if (node.type === 'fragment') return { lines: node.children.flatMap((child) => renderNode(child, ctx).lines) };\n if (node.type === 'error') return errorBlock(node.code, node.message);\n\n if (isHeadNode(node)) return { lines: [] };\n if (node.name === CANVAS_SLOT) {\n const canvasId = typeof node.props['canvasId'] === 'string' ? (node.props['canvasId'] as string) : '';\n if (canvasId === '') return { lines: [] };\n const tree = ctx.api.canvasTree(canvasId);\n if (tree.length === 0) return { lines: [] };\n // A canvas starts outside any instance, even when an instance's layout placed it.\n const { origin: _outer, ...outside } = ctx;\n const canvasCtx: Ctx = { ...outside, canvas: canvasId };\n return { lines: [canvasRule(canvasId), ...tree.flatMap((child) => renderNode(child, canvasCtx).lines), ''] };\n }\n\n const entry = ctx.registry.get(node.name);\n const build = entry !== undefined ? entry.component : ctx.fallback;\n if (build === undefined) return errorBlock('COMPONENT_NOT_FOUND', node.name);\n\n const instanceId = node.name === ACTION_SLOT ? node.props['instanceId'] : undefined;\n const inner: Ctx = typeof instanceId === 'string' && instanceId !== '' ? { ...ctx, origin: instanceId } : ctx;\n const children = node.children.filter((child) => !isHeadNode(child)).map((child) => renderNode(child, inner));\n const register: TtyComponentContext['register'] = (item) => {\n const interactive: TtyInteractive = { index: ctx.out.length + 1, canvas: ctx.canvas, ...(ctx.origin !== undefined ? { origin: ctx.origin } : {}), ...item };\n ctx.out.push(interactive);\n return interactive.index;\n };\n const block = build({ props: node.props, children, register });\n\n if (node.model !== undefined) {\n const current = node.props['value'] ?? node.props['checked'];\n const kind: TtyInteractiveKind = typeof current === 'boolean' ? 'toggle' : 'model';\n const index = register({ kind, ref: node.model.ref, label: labelOf(block, node.model.ref), value: current, path: node.model.path });\n return { lines: [`[${index}] ${block.lines[0] ?? ''}`, ...block.lines.slice(1)] };\n }\n if (node.ref !== undefined) {\n const value = node.props['value'];\n const index = register({ kind: 'click', ref: node.ref, label: labelOf(block, node.ref), ...(value !== undefined ? { value } : {}) });\n return { lines: [`[${index}] ${block.lines[0] ?? ''}`, ...block.lines.slice(1)] };\n }\n return block;\n};\n\nconst tidy = (lines: string[]): string[] => {\n const out: string[] = [];\n for (const line of lines) {\n if (line.trim() === '' && out[out.length - 1]?.trim() === '') continue;\n out.push(line);\n }\n while (out[0]?.trim() === '') out.shift();\n while (out[out.length - 1]?.trim() === '') out.pop();\n return out;\n};\n\nexport const createTtyView = (\n registry: ComponentRegistry<TtyComponent>,\n api: TtyRenderApi,\n options: { fallback?: TtyComponent } = {},\n): TtyView => {\n const render = (): TtyFrame => {\n const out: TtyInteractive[] = [];\n const ctx: Ctx = { registry, canvas: '', api, out, ...(options.fallback !== undefined ? { fallback: options.fallback } : {}) };\n const lines = api.frame().flatMap((node) => renderNode(node, ctx).lines);\n return { text: tidy(lines).join('\\n'), interactives: out };\n };\n return { render };\n};\n"]}
@@ -1,97 +1,97 @@
1
1
  'use strict';
2
2
 
3
- var chunkTRJYDVWK_cjs = require('../../../chunk-TRJYDVWK.cjs');
4
- var chunk5AF72LOE_cjs = require('../../../chunk-5AF72LOE.cjs');
5
- require('../../../chunk-WGZZKCJQ.cjs');
6
- require('../../../chunk-OO247V4J.cjs');
7
- require('../../../chunk-PNQY6OFB.cjs');
8
- require('../../../chunk-IZ2UU5UL.cjs');
9
- require('../../../chunk-PMKWYOOX.cjs');
10
- require('../../../chunk-KOYRJXTI.cjs');
11
- require('../../../chunk-GV7UC3SS.cjs');
12
- require('../../../chunk-FSUMCJAR.cjs');
13
- require('../../../chunk-D4PUWBN6.cjs');
14
- require('../../../chunk-KW34ZKF5.cjs');
15
- require('../../../chunk-OE527MXF.cjs');
3
+ var chunkI35ZD3PU_cjs = require('../../../chunk-I35ZD3PU.cjs');
4
+ var chunkSABSY2BW_cjs = require('../../../chunk-SABSY2BW.cjs');
5
+ require('../../../chunk-QHX3VA55.cjs');
6
+ require('../../../chunk-DLZNZHUW.cjs');
7
+ require('../../../chunk-QTJ4ZQRM.cjs');
8
+ require('../../../chunk-K54CT3QN.cjs');
9
+ require('../../../chunk-BXUEWV7V.cjs');
10
+ require('../../../chunk-RVU6YEHO.cjs');
11
+ require('../../../chunk-MEZCO7ND.cjs');
12
+ require('../../../chunk-CQZH3L3W.cjs');
13
+ require('../../../chunk-NBXZ3RAC.cjs');
14
+ require('../../../chunk-ITGR7P2B.cjs');
15
+ require('../../../chunk-3XFQI5P2.cjs');
16
16
  require('../../../chunk-Q7SFCCGT.cjs');
17
17
 
18
18
 
19
19
 
20
20
  Object.defineProperty(exports, "ActionSlot", {
21
21
  enumerable: true,
22
- get: function () { return chunkTRJYDVWK_cjs.ActionSlot; }
22
+ get: function () { return chunkI35ZD3PU_cjs.ActionSlot; }
23
23
  });
24
24
  Object.defineProperty(exports, "Box", {
25
25
  enumerable: true,
26
- get: function () { return chunkTRJYDVWK_cjs.Box; }
26
+ get: function () { return chunkI35ZD3PU_cjs.Box; }
27
27
  });
28
28
  Object.defineProperty(exports, "Button", {
29
29
  enumerable: true,
30
- get: function () { return chunkTRJYDVWK_cjs.Button; }
30
+ get: function () { return chunkI35ZD3PU_cjs.Button; }
31
31
  });
32
32
  Object.defineProperty(exports, "CanvasSlot", {
33
33
  enumerable: true,
34
- get: function () { return chunkTRJYDVWK_cjs.CanvasSlot; }
34
+ get: function () { return chunkI35ZD3PU_cjs.CanvasSlot; }
35
35
  });
36
36
  Object.defineProperty(exports, "Input", {
37
37
  enumerable: true,
38
- get: function () { return chunkTRJYDVWK_cjs.Input; }
38
+ get: function () { return chunkI35ZD3PU_cjs.Input; }
39
39
  });
40
40
  Object.defineProperty(exports, "JsonTree", {
41
41
  enumerable: true,
42
- get: function () { return chunkTRJYDVWK_cjs.JsonTree; }
42
+ get: function () { return chunkI35ZD3PU_cjs.JsonTree; }
43
43
  });
44
44
  Object.defineProperty(exports, "Panel", {
45
45
  enumerable: true,
46
- get: function () { return chunkTRJYDVWK_cjs.Panel; }
46
+ get: function () { return chunkI35ZD3PU_cjs.Panel; }
47
47
  });
48
48
  Object.defineProperty(exports, "Stack", {
49
49
  enumerable: true,
50
- get: function () { return chunkTRJYDVWK_cjs.Stack; }
50
+ get: function () { return chunkI35ZD3PU_cjs.Stack; }
51
51
  });
52
52
  Object.defineProperty(exports, "Text", {
53
53
  enumerable: true,
54
- get: function () { return chunkTRJYDVWK_cjs.Text; }
54
+ get: function () { return chunkI35ZD3PU_cjs.Text; }
55
55
  });
56
56
  Object.defineProperty(exports, "registerNovaVueComponents", {
57
57
  enumerable: true,
58
- get: function () { return chunkTRJYDVWK_cjs.registerNovaVueComponents; }
58
+ get: function () { return chunkI35ZD3PU_cjs.registerNovaVueComponents; }
59
59
  });
60
60
  Object.defineProperty(exports, "ActionSlotPropsSchema", {
61
61
  enumerable: true,
62
- get: function () { return chunk5AF72LOE_cjs.ActionSlotPropsSchema; }
62
+ get: function () { return chunkSABSY2BW_cjs.ActionSlotPropsSchema; }
63
63
  });
64
64
  Object.defineProperty(exports, "BoxPropsSchema", {
65
65
  enumerable: true,
66
- get: function () { return chunk5AF72LOE_cjs.BoxPropsSchema; }
66
+ get: function () { return chunkSABSY2BW_cjs.BoxPropsSchema; }
67
67
  });
68
68
  Object.defineProperty(exports, "ButtonPropsSchema", {
69
69
  enumerable: true,
70
- get: function () { return chunk5AF72LOE_cjs.ButtonPropsSchema; }
70
+ get: function () { return chunkSABSY2BW_cjs.ButtonPropsSchema; }
71
71
  });
72
72
  Object.defineProperty(exports, "CanvasSlotPropsSchema", {
73
73
  enumerable: true,
74
- get: function () { return chunk5AF72LOE_cjs.CanvasSlotPropsSchema; }
74
+ get: function () { return chunkSABSY2BW_cjs.CanvasSlotPropsSchema; }
75
75
  });
76
76
  Object.defineProperty(exports, "InputPropsSchema", {
77
77
  enumerable: true,
78
- get: function () { return chunk5AF72LOE_cjs.InputPropsSchema; }
78
+ get: function () { return chunkSABSY2BW_cjs.InputPropsSchema; }
79
79
  });
80
80
  Object.defineProperty(exports, "JsonTreePropsSchema", {
81
81
  enumerable: true,
82
- get: function () { return chunk5AF72LOE_cjs.JsonTreePropsSchema; }
82
+ get: function () { return chunkSABSY2BW_cjs.JsonTreePropsSchema; }
83
83
  });
84
84
  Object.defineProperty(exports, "PanelPropsSchema", {
85
85
  enumerable: true,
86
- get: function () { return chunk5AF72LOE_cjs.PanelPropsSchema; }
86
+ get: function () { return chunkSABSY2BW_cjs.PanelPropsSchema; }
87
87
  });
88
88
  Object.defineProperty(exports, "StackPropsSchema", {
89
89
  enumerable: true,
90
- get: function () { return chunk5AF72LOE_cjs.StackPropsSchema; }
90
+ get: function () { return chunkSABSY2BW_cjs.StackPropsSchema; }
91
91
  });
92
92
  Object.defineProperty(exports, "TextPropsSchema", {
93
93
  enumerable: true,
94
- get: function () { return chunk5AF72LOE_cjs.TextPropsSchema; }
94
+ get: function () { return chunkSABSY2BW_cjs.TextPropsSchema; }
95
95
  });
96
96
  //# sourceMappingURL=index.cjs.map
97
97
  //# sourceMappingURL=index.cjs.map
@@ -1,8 +1,8 @@
1
- import { C as ComponentRegistry } from '../../../types-j290XhCn.cjs';
1
+ import { C as ComponentRegistry } from '../../../types-CR56luN7.cjs';
2
2
  import * as zod_v4_core from 'zod/v4/core';
3
3
  import * as zod from 'zod';
4
4
  import * as vue from 'vue';
5
- import { c as NovaComponentProps } from '../../../types-C9734_lJ.cjs';
5
+ import { c as NovaComponentProps } from '../../../types-DzB3TAQj.cjs';
6
6
  export { A as ActionSlotProps, b as ActionSlotPropsSchema, a as BoxProps, c as BoxPropsSchema, B as ButtonProps, d as ButtonPropsSchema, C as CanvasSlotProps, e as CanvasSlotPropsSchema, I as InputProps, f as InputPropsSchema, J as JsonTreeProps, g as JsonTreePropsSchema, P as PanelProps, h as PanelPropsSchema, S as StackProps, i as StackPropsSchema, T as TextProps, j as TextPropsSchema } from '../../../primitive-props-Cl5jiC8g.cjs';
7
7
  import '../../../schemas-DPdeFlCT.cjs';
8
8
  import '../../../schemas-pMyyuXV7.cjs';
@@ -1,8 +1,8 @@
1
- import { C as ComponentRegistry } from '../../../types-qnKMx0_V.js';
1
+ import { C as ComponentRegistry } from '../../../types-CJC8mnzl.js';
2
2
  import * as zod_v4_core from 'zod/v4/core';
3
3
  import * as zod from 'zod';
4
4
  import * as vue from 'vue';
5
- import { c as NovaComponentProps } from '../../../types-BWc-olbY.js';
5
+ import { c as NovaComponentProps } from '../../../types-LXw2RJfH.js';
6
6
  export { A as ActionSlotProps, b as ActionSlotPropsSchema, a as BoxProps, c as BoxPropsSchema, B as ButtonProps, d as ButtonPropsSchema, C as CanvasSlotProps, e as CanvasSlotPropsSchema, I as InputProps, f as InputPropsSchema, J as JsonTreeProps, g as JsonTreePropsSchema, P as PanelProps, h as PanelPropsSchema, S as StackProps, i as StackPropsSchema, T as TextProps, j as TextPropsSchema } from '../../../primitive-props-Cl5jiC8g.js';
7
7
  import '../../../schemas-DPdeFlCT.js';
8
8
  import '../../../schemas-pMyyuXV7.js';
@@ -1,16 +1,16 @@
1
- export { ActionSlot, Box, Button, CanvasSlot, Input, JsonTree, Panel, Stack, Text, registerNovaVueComponents } from '../../../chunk-F2H7WP6R.js';
2
- export { ActionSlotPropsSchema, BoxPropsSchema, ButtonPropsSchema, CanvasSlotPropsSchema, InputPropsSchema, JsonTreePropsSchema, PanelPropsSchema, StackPropsSchema, TextPropsSchema } from '../../../chunk-VOD5JA4D.js';
3
- import '../../../chunk-V4BPFFFV.js';
4
- import '../../../chunk-DU2VIJAF.js';
5
- import '../../../chunk-RFBIGRCI.js';
6
- import '../../../chunk-Y6XVPRYH.js';
7
- import '../../../chunk-OGD5CCMZ.js';
8
- import '../../../chunk-7TS3YVQR.js';
9
- import '../../../chunk-OE4E6IBD.js';
10
- import '../../../chunk-DIFE573X.js';
11
- import '../../../chunk-JI7ZRESP.js';
12
- import '../../../chunk-RBU5PHN4.js';
13
- import '../../../chunk-2MNLEL45.js';
1
+ export { ActionSlot, Box, Button, CanvasSlot, Input, JsonTree, Panel, Stack, Text, registerNovaVueComponents } from '../../../chunk-OSIFUROH.js';
2
+ export { ActionSlotPropsSchema, BoxPropsSchema, ButtonPropsSchema, CanvasSlotPropsSchema, InputPropsSchema, JsonTreePropsSchema, PanelPropsSchema, StackPropsSchema, TextPropsSchema } from '../../../chunk-EK2GBZ7D.js';
3
+ import '../../../chunk-SCXYAXMO.js';
4
+ import '../../../chunk-3JE77TNL.js';
5
+ import '../../../chunk-C63CBYD5.js';
6
+ import '../../../chunk-YV2G37TJ.js';
7
+ import '../../../chunk-ZZRQAH5Z.js';
8
+ import '../../../chunk-M2ZZUSH3.js';
9
+ import '../../../chunk-Y3UKAJJX.js';
10
+ import '../../../chunk-G4OQ4PEO.js';
11
+ import '../../../chunk-JKULAG53.js';
12
+ import '../../../chunk-GQVJ5UAS.js';
13
+ import '../../../chunk-SVWDKXSH.js';
14
14
  import '../../../chunk-PZ5AY32C.js';
15
15
  //# sourceMappingURL=index.js.map
16
16
  //# sourceMappingURL=index.js.map
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkTRJYDVWK_cjs = require('../../chunk-TRJYDVWK.cjs');
4
- require('../../chunk-5AF72LOE.cjs');
5
- require('../../chunk-WGZZKCJQ.cjs');
6
- require('../../chunk-OO247V4J.cjs');
7
- var chunkPNQY6OFB_cjs = require('../../chunk-PNQY6OFB.cjs');
8
- require('../../chunk-IZ2UU5UL.cjs');
9
- require('../../chunk-PMKWYOOX.cjs');
10
- require('../../chunk-KOYRJXTI.cjs');
11
- require('../../chunk-GV7UC3SS.cjs');
12
- require('../../chunk-FSUMCJAR.cjs');
13
- require('../../chunk-D4PUWBN6.cjs');
14
- require('../../chunk-KW34ZKF5.cjs');
15
- require('../../chunk-OE527MXF.cjs');
3
+ var chunkI35ZD3PU_cjs = require('../../chunk-I35ZD3PU.cjs');
4
+ require('../../chunk-SABSY2BW.cjs');
5
+ require('../../chunk-QHX3VA55.cjs');
6
+ require('../../chunk-DLZNZHUW.cjs');
7
+ var chunkQTJ4ZQRM_cjs = require('../../chunk-QTJ4ZQRM.cjs');
8
+ require('../../chunk-K54CT3QN.cjs');
9
+ require('../../chunk-BXUEWV7V.cjs');
10
+ require('../../chunk-RVU6YEHO.cjs');
11
+ require('../../chunk-MEZCO7ND.cjs');
12
+ require('../../chunk-CQZH3L3W.cjs');
13
+ require('../../chunk-NBXZ3RAC.cjs');
14
+ require('../../chunk-ITGR7P2B.cjs');
15
+ require('../../chunk-3XFQI5P2.cjs');
16
16
  require('../../chunk-Q7SFCCGT.cjs');
17
17
  var vue = require('vue');
18
18
 
@@ -39,7 +39,7 @@ var NovaRenderProvider = vue.defineComponent(
39
39
  return props.fallback;
40
40
  }
41
41
  };
42
- vue.provide(chunkTRJYDVWK_cjs.NovaRenderKey, value);
42
+ vue.provide(chunkI35ZD3PU_cjs.NovaRenderKey, value);
43
43
  return () => slots.default?.();
44
44
  },
45
45
  { name: "NovaRenderProvider", props: ["registry", "dispatch", "publish", "slotWrapper", "fallback"] }
@@ -51,8 +51,8 @@ var NovaShellProvider = vue.defineComponent(
51
51
  return props.shell;
52
52
  }
53
53
  };
54
- vue.provide(chunkTRJYDVWK_cjs.NovaShellKey, source);
55
- chunkTRJYDVWK_cjs.provideShellHead(() => props.shell);
54
+ vue.provide(chunkI35ZD3PU_cjs.NovaShellKey, source);
55
+ chunkI35ZD3PU_cjs.provideShellHead(() => props.shell);
56
56
  const dispatch = (event) => props.shell.dispatch(event);
57
57
  const publish = (channel, payload) => props.shell.publish(channel, payload);
58
58
  return () => vue.h(
@@ -82,13 +82,13 @@ var NovaErrorBoundary = vue.defineComponent(
82
82
  { name: "NovaErrorBoundary", props: ["fallback", "onError"] }
83
83
  );
84
84
  var ensureVueBuiltins = (registry) => {
85
- if (registry.has(chunkPNQY6OFB_cjs.CANVAS_SLOT_NAME)) return;
86
- chunkTRJYDVWK_cjs.registerNovaVueComponents(registry);
85
+ if (registry.has(chunkQTJ4ZQRM_cjs.CANVAS_SLOT_NAME)) return;
86
+ chunkI35ZD3PU_cjs.registerNovaVueComponents(registry);
87
87
  };
88
88
  var ShellRenderTreeView = vue.defineComponent(
89
89
  () => {
90
- const nodes = chunkTRJYDVWK_cjs.useShellRenderTree();
91
- return () => vue.h(chunkTRJYDVWK_cjs.RenderTree, { nodes: nodes.value });
90
+ const nodes = chunkI35ZD3PU_cjs.useShellRenderTree();
91
+ return () => vue.h(chunkI35ZD3PU_cjs.RenderTree, { nodes: nodes.value });
92
92
  },
93
93
  { name: "NovaShellRenderTree" }
94
94
  );
@@ -105,9 +105,9 @@ var NovaShell = vue.defineComponent(
105
105
  );
106
106
  var CanvasRenderTreeView = vue.defineComponent(
107
107
  (props) => {
108
- chunkTRJYDVWK_cjs.useShell();
109
- const nodes = chunkTRJYDVWK_cjs.useCanvasRenderTree(() => props.canvasId);
110
- return () => vue.h(chunkTRJYDVWK_cjs.RenderTree, { nodes: nodes.value });
108
+ chunkI35ZD3PU_cjs.useShell();
109
+ const nodes = chunkI35ZD3PU_cjs.useCanvasRenderTree(() => props.canvasId);
110
+ return () => vue.h(chunkI35ZD3PU_cjs.RenderTree, { nodes: nodes.value });
111
111
  },
112
112
  { name: "NovaCanvasRenderTree", props: ["canvasId"] }
113
113
  );
@@ -126,75 +126,75 @@ var NovaCanvas = vue.defineComponent(
126
126
 
127
127
  Object.defineProperty(exports, "ErrorMarker", {
128
128
  enumerable: true,
129
- get: function () { return chunkTRJYDVWK_cjs.ErrorMarker; }
129
+ get: function () { return chunkI35ZD3PU_cjs.ErrorMarker; }
130
130
  });
131
131
  Object.defineProperty(exports, "NovaRenderKey", {
132
132
  enumerable: true,
133
- get: function () { return chunkTRJYDVWK_cjs.NovaRenderKey; }
133
+ get: function () { return chunkI35ZD3PU_cjs.NovaRenderKey; }
134
134
  });
135
135
  Object.defineProperty(exports, "NovaShellKey", {
136
136
  enumerable: true,
137
- get: function () { return chunkTRJYDVWK_cjs.NovaShellKey; }
137
+ get: function () { return chunkI35ZD3PU_cjs.NovaShellKey; }
138
138
  });
139
139
  Object.defineProperty(exports, "RenderNodeView", {
140
140
  enumerable: true,
141
- get: function () { return chunkTRJYDVWK_cjs.RenderNodeView; }
141
+ get: function () { return chunkI35ZD3PU_cjs.RenderNodeView; }
142
142
  });
143
143
  Object.defineProperty(exports, "RenderTree", {
144
144
  enumerable: true,
145
- get: function () { return chunkTRJYDVWK_cjs.RenderTree; }
145
+ get: function () { return chunkI35ZD3PU_cjs.RenderTree; }
146
146
  });
147
147
  Object.defineProperty(exports, "isNovaComponent", {
148
148
  enumerable: true,
149
- get: function () { return chunkTRJYDVWK_cjs.isNovaComponent; }
149
+ get: function () { return chunkI35ZD3PU_cjs.isNovaComponent; }
150
150
  });
151
151
  Object.defineProperty(exports, "useActionData", {
152
152
  enumerable: true,
153
- get: function () { return chunkTRJYDVWK_cjs.useActionData; }
153
+ get: function () { return chunkI35ZD3PU_cjs.useActionData; }
154
154
  });
155
155
  Object.defineProperty(exports, "useActionStatus", {
156
156
  enumerable: true,
157
- get: function () { return chunkTRJYDVWK_cjs.useActionStatus; }
157
+ get: function () { return chunkI35ZD3PU_cjs.useActionStatus; }
158
158
  });
159
159
  Object.defineProperty(exports, "useCanvas", {
160
160
  enumerable: true,
161
- get: function () { return chunkTRJYDVWK_cjs.useCanvas; }
161
+ get: function () { return chunkI35ZD3PU_cjs.useCanvas; }
162
162
  });
163
163
  Object.defineProperty(exports, "useCanvasRenderTree", {
164
164
  enumerable: true,
165
- get: function () { return chunkTRJYDVWK_cjs.useCanvasRenderTree; }
165
+ get: function () { return chunkI35ZD3PU_cjs.useCanvasRenderTree; }
166
166
  });
167
167
  Object.defineProperty(exports, "useNovaDispatch", {
168
168
  enumerable: true,
169
- get: function () { return chunkTRJYDVWK_cjs.useNovaDispatch; }
169
+ get: function () { return chunkI35ZD3PU_cjs.useNovaDispatch; }
170
170
  });
171
171
  Object.defineProperty(exports, "useNovaPublish", {
172
172
  enumerable: true,
173
- get: function () { return chunkTRJYDVWK_cjs.useNovaPublish; }
173
+ get: function () { return chunkI35ZD3PU_cjs.useNovaPublish; }
174
174
  });
175
175
  Object.defineProperty(exports, "useNovaRegistry", {
176
176
  enumerable: true,
177
- get: function () { return chunkTRJYDVWK_cjs.useNovaRegistry; }
177
+ get: function () { return chunkI35ZD3PU_cjs.useNovaRegistry; }
178
178
  });
179
179
  Object.defineProperty(exports, "useRenderTree", {
180
180
  enumerable: true,
181
- get: function () { return chunkTRJYDVWK_cjs.useRenderTree; }
181
+ get: function () { return chunkI35ZD3PU_cjs.useRenderTree; }
182
182
  });
183
183
  Object.defineProperty(exports, "useShell", {
184
184
  enumerable: true,
185
- get: function () { return chunkTRJYDVWK_cjs.useShell; }
185
+ get: function () { return chunkI35ZD3PU_cjs.useShell; }
186
186
  });
187
187
  Object.defineProperty(exports, "useShellRenderTree", {
188
188
  enumerable: true,
189
- get: function () { return chunkTRJYDVWK_cjs.useShellRenderTree; }
189
+ get: function () { return chunkI35ZD3PU_cjs.useShellRenderTree; }
190
190
  });
191
191
  Object.defineProperty(exports, "useShellState", {
192
192
  enumerable: true,
193
- get: function () { return chunkTRJYDVWK_cjs.useShellState; }
193
+ get: function () { return chunkI35ZD3PU_cjs.useShellState; }
194
194
  });
195
195
  Object.defineProperty(exports, "useSlotWrapper", {
196
196
  enumerable: true,
197
- get: function () { return chunkTRJYDVWK_cjs.useSlotWrapper; }
197
+ get: function () { return chunkI35ZD3PU_cjs.useSlotWrapper; }
198
198
  });
199
199
  exports.NovaCanvas = NovaCanvas;
200
200
  exports.NovaErrorBoundary = NovaErrorBoundary;
@@ -1 +1 @@
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,EAAM,KAAM;AAC7C,IAAA,MAAM,KAAA,GAAgC;AAAA,MACpC,IAAI,QAAA,GAAW;AACb,QAAA,OAAO,KAAA,CAAM,QAAA;AAAA,MACf,CAAA;AAAA,MACA,IAAI,QAAA,GAAW;AACb,QAAA,OAAO,MAAM,QAAA,IAAY,YAAA;AAAA,MAC3B,CAAA;AAAA,MACA,IAAI,OAAA,GAAU;AACZ,QAAA,OAAO,MAAM,OAAA,IAAW,WAAA;AAAA,MAC1B,CAAA;AAAA,MACA,IAAI,WAAA,GAAc;AAChB,QAAA,OAAO,KAAA,CAAM,WAAA;AAAA,MACf,CAAA;AAAA,MACA,IAAI,QAAA,GAAW;AACb,QAAA,OAAO,KAAA,CAAM,QAAA;AAAA,MACf;AAAA,KACF;AACA,IAAAC,WAAA,CAAQC,iCAAe,KAAK,CAAA;AAC5B,IAAA,OAAO,MAAM,MAAM,OAAA,IAAU;AAAA,EAC/B,CAAA;AAAA,EACA,EAAE,IAAA,EAAM,oBAAA,EAAsB,KAAA,EAAO,CAAC,YAAY,UAAA,EAAY,SAAA,EAAW,aAAA,EAAe,UAAU,CAAA;AACpG;AAeO,IAAM,iBAAA,GAAoBF,mBAAA;AAAA,EAC/B,CAAC,KAAA,EAA+B,EAAE,KAAA,EAAM,KAAM;AAC5C,IAAA,MAAM,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,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
+ {"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;AAUjC,IAAM,kBAAA,GAAqBA,mBAAA;AAAA,EAChC,CAAC,KAAA,EAAgC,EAAE,KAAA,EAAM,KAAM;AAC7C,IAAA,MAAM,KAAA,GAAgC;AAAA,MACpC,IAAI,QAAA,GAAW;AACb,QAAA,OAAO,KAAA,CAAM,QAAA;AAAA,MACf,CAAA;AAAA,MACA,IAAI,QAAA,GAAW;AACb,QAAA,OAAO,MAAM,QAAA,IAAY,YAAA;AAAA,MAC3B,CAAA;AAAA,MACA,IAAI,OAAA,GAAU;AACZ,QAAA,OAAO,MAAM,OAAA,IAAW,WAAA;AAAA,MAC1B,CAAA;AAAA,MACA,IAAI,WAAA,GAAc;AAChB,QAAA,OAAO,KAAA,CAAM,WAAA;AAAA,MACf,CAAA;AAAA,MACA,IAAI,QAAA,GAAW;AACb,QAAA,OAAO,KAAA,CAAM,QAAA;AAAA,MACf;AAAA,KACF;AACA,IAAAC,WAAA,CAAQC,iCAAe,KAAK,CAAA;AAC5B,IAAA,OAAO,MAAM,MAAM,OAAA,IAAU;AAAA,EAC/B,CAAA;AAAA,EACA,EAAE,IAAA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AAE,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\nexport type NovaRenderProviderProps = {\n registry: ComponentRegistry;\n dispatch?: NovaDispatch;\n publish?: NovaPublish;\n slotWrapper?: SlotWrapper;\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\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\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\nconst ensureVueBuiltins = (registry: ComponentRegistry): void => {\n if (registry.has(CANVAS_SLOT_NAME)) return;\n registerNovaVueComponents(registry);\n};\n\nexport type NovaShellProps = {\n shell: Shell;\n registry?: ComponentRegistry;\n slotWrapper?: SlotWrapper;\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\nexport type NovaCanvasProps = {\n id: string;\n shell?: Shell;\n registry?: ComponentRegistry;\n builtins?: boolean;\n};\n\nconst CanvasRenderTreeView = defineComponent(\n (props: { canvasId: string }) => {\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"]}