@jxsuite/studio 2.0.1 → 2.1.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.
Files changed (419) hide show
  1. package/canvas.html +21 -0
  2. package/dist/chunks/Overlay.dev-qfjzkms8.js +23 -0
  3. package/dist/chunks/{Overlay.dev-cszx7yn5.js.map → Overlay.dev-qfjzkms8.js.map} +1 -1
  4. package/dist/chunks/{adapter-z8fkmbmv.js → adapter-qfnesn5v.js} +2 -2
  5. package/dist/chunks/{cf-settings-mmyv436d.js → cf-settings-73sh5z4p.js} +3 -3
  6. package/dist/chunks/{components-799jpvhm.js → components-2bpqp4mq.js} +5 -7
  7. package/dist/chunks/{components-799jpvhm.js.map → components-2bpqp4mq.js.map} +1 -1
  8. package/dist/chunks/content-source-34gnkbnn.js +38 -0
  9. package/dist/chunks/content-source-34gnkbnn.js.map +9 -0
  10. package/dist/chunks/convert-to-repeater-t8kxre5s.js +258 -0
  11. package/dist/chunks/convert-to-repeater-t8kxre5s.js.map +10 -0
  12. package/dist/chunks/extension-sections-6mqydz35.js +301 -0
  13. package/dist/chunks/extension-sections-6mqydz35.js.map +11 -0
  14. package/dist/chunks/files-8kn321h1.js +70 -0
  15. package/dist/chunks/files-8kn321h1.js.map +9 -0
  16. package/dist/chunks/{format-host-8jxwts2p.js → format-host-mkwsmt8d.js} +3 -3
  17. package/dist/chunks/git-panel-tjbr191d.js +51 -0
  18. package/dist/chunks/git-panel-tjbr191d.js.map +9 -0
  19. package/dist/chunks/{index-baeg2x3y.js → index-7pxchcce.js} +4 -3
  20. package/dist/chunks/{index-baeg2x3y.js.map → index-7pxchcce.js.map} +3 -3
  21. package/dist/chunks/{jx-validate-qx8degj7.js → jx-validate-v6qgknrs.js} +3 -3
  22. package/dist/chunks/layers-panel-87pb25km.js +58 -0
  23. package/dist/chunks/layers-panel-87pb25km.js.map +9 -0
  24. package/dist/chunks/{monaco-setup-zjdp9zdw.js → monaco-setup-e0yh25j4.js} +4 -75
  25. package/dist/chunks/{monaco-setup-zjdp9zdw.js.map → monaco-setup-e0yh25j4.js.map} +3 -4
  26. package/dist/chunks/publish-panel-m0fcgdrt.js +21 -0
  27. package/dist/chunks/publish-panel-m0fcgdrt.js.map +9 -0
  28. package/dist/chunks/quick-search-rhs6cbsb.js +53 -0
  29. package/dist/chunks/quick-search-rhs6cbsb.js.map +9 -0
  30. package/dist/chunks/right-panel-zpdxd98t.js +37 -0
  31. package/dist/chunks/right-panel-zpdxd98t.js.map +9 -0
  32. package/dist/chunks/section-registry-zmckaxf4.js +30 -0
  33. package/dist/chunks/section-registry-zmckaxf4.js.map +9 -0
  34. package/dist/chunks/sp-overlay.dev-9ran0sfq.js +18 -0
  35. package/dist/chunks/sp-overlay.dev-9ran0sfq.js.map +9 -0
  36. package/dist/chunks/sp-popover.dev-rebmdncr.js +9 -0
  37. package/dist/chunks/sp-popover.dev-rebmdncr.js.map +9 -0
  38. package/dist/chunks/sp-progress-circle.dev-5vkppfkt.js +15 -0
  39. package/dist/chunks/sp-progress-circle.dev-5vkppfkt.js.map +9 -0
  40. package/dist/chunks/sp-tooltip.dev-ykqrg8h5.js +15 -0
  41. package/dist/chunks/sp-tooltip.dev-ykqrg8h5.js.map +9 -0
  42. package/dist/chunks/{sp-tray.dev-pb2fsd65.js → sp-tray.dev-ey59vfh7.js} +10 -8
  43. package/dist/chunks/{sp-tray.dev-pb2fsd65.js.map → sp-tray.dev-ey59vfh7.js.map} +2 -2
  44. package/dist/chunks/{studio-9qr6fq7p.js → studio-0rqqhrdy.js} +10 -378
  45. package/dist/chunks/{studio-9qr6fq7p.js.map → studio-0rqqhrdy.js.map} +4 -14
  46. package/dist/chunks/{studio-5x6tqqec.js → studio-2sj1jj3v.js} +10 -8
  47. package/dist/chunks/{studio-5x6tqqec.js.map → studio-2sj1jj3v.js.map} +2 -2
  48. package/dist/chunks/{studio-h3fw0wn8.js → studio-3fk1ac9z.js} +6 -4
  49. package/dist/chunks/{studio-h3fw0wn8.js.map → studio-3fk1ac9z.js.map} +2 -2
  50. package/dist/chunks/studio-41exgzhq.js +6690 -0
  51. package/dist/chunks/studio-41exgzhq.js.map +38 -0
  52. package/dist/chunks/{studio-7v2bpweq.js → studio-4mqb9a0j.js} +6 -4
  53. package/dist/chunks/{studio-7v2bpweq.js.map → studio-4mqb9a0j.js.map} +2 -2
  54. package/dist/chunks/studio-50k77cca.js +1787 -0
  55. package/dist/chunks/studio-50k77cca.js.map +18 -0
  56. package/dist/chunks/{studio-56v3zwk6.js → studio-6a0h7sne.js} +10 -8
  57. package/dist/chunks/{studio-56v3zwk6.js.map → studio-6a0h7sne.js.map} +2 -2
  58. package/dist/chunks/studio-6f0am8f2.js +53 -0
  59. package/dist/chunks/studio-6f0am8f2.js.map +10 -0
  60. package/dist/chunks/studio-6nmjc5qk.js +7002 -0
  61. package/dist/chunks/studio-6nmjc5qk.js.map +32 -0
  62. package/dist/chunks/studio-7afd21nw.js +67 -0
  63. package/dist/chunks/studio-7afd21nw.js.map +10 -0
  64. package/dist/chunks/{studio-xze4zrs1.js → studio-7bmdvzne.js} +2 -2
  65. package/dist/chunks/studio-7bmdvzne.js.map +10 -0
  66. package/dist/chunks/studio-8jpzqk5s.js +128 -0
  67. package/dist/chunks/studio-8jpzqk5s.js.map +10 -0
  68. package/dist/chunks/studio-94m77tgk.js +1482 -0
  69. package/dist/chunks/studio-94m77tgk.js.map +13 -0
  70. package/dist/chunks/studio-9je6w5sq.js +1000 -0
  71. package/dist/chunks/studio-9je6w5sq.js.map +16 -0
  72. package/dist/chunks/{studio-w7c6kvk7.js → studio-a7pzveq1.js} +2 -2
  73. package/dist/chunks/{studio-gs6kqdt1.js → studio-adn0z1k3.js} +14 -8
  74. package/dist/chunks/{studio-gs6kqdt1.js.map → studio-adn0z1k3.js.map} +3 -3
  75. package/dist/chunks/{studio-kr88ryr7.js → studio-bsxxx3x2.js} +17 -15
  76. package/dist/chunks/{studio-kr88ryr7.js.map → studio-bsxxx3x2.js.map} +7 -6
  77. package/dist/chunks/studio-bw5dz6km.js +608 -0
  78. package/dist/chunks/studio-bw5dz6km.js.map +21 -0
  79. package/dist/chunks/studio-c6s5getc.js +4232 -0
  80. package/dist/chunks/studio-c6s5getc.js.map +39 -0
  81. package/dist/chunks/studio-cjm7fdjf.js +451 -0
  82. package/dist/chunks/studio-cjm7fdjf.js.map +14 -0
  83. package/dist/chunks/{studio-cx91mnh8.js → studio-ckwz4d3x.js} +53 -53
  84. package/dist/chunks/{studio-cx91mnh8.js.map → studio-ckwz4d3x.js.map} +5 -5
  85. package/dist/chunks/studio-dg7zyt5x.js +28 -0
  86. package/dist/chunks/studio-dg7zyt5x.js.map +10 -0
  87. package/dist/chunks/studio-dzcyvvvz.js +166 -0
  88. package/dist/chunks/studio-dzcyvvvz.js.map +10 -0
  89. package/dist/chunks/{studio-7kqe41sa.js → studio-evkr5d3b.js} +15 -7
  90. package/dist/chunks/{studio-7kqe41sa.js.map → studio-evkr5d3b.js.map} +5 -4
  91. package/dist/chunks/studio-f12h6177.js +411 -0
  92. package/dist/chunks/studio-f12h6177.js.map +13 -0
  93. package/dist/chunks/studio-hbp1s8m9.js +1817 -0
  94. package/dist/chunks/studio-hbp1s8m9.js.map +14 -0
  95. package/dist/chunks/studio-k2sxjph5.js +15295 -0
  96. package/dist/chunks/studio-k2sxjph5.js.map +235 -0
  97. package/dist/chunks/studio-myje51t3.js +385 -0
  98. package/dist/chunks/studio-myje51t3.js.map +12 -0
  99. package/dist/chunks/studio-na6rwzhw.js +353 -0
  100. package/dist/chunks/studio-na6rwzhw.js.map +11 -0
  101. package/dist/chunks/{studio-4k0m4fmp.js → studio-p471gg5n.js} +126 -3
  102. package/dist/chunks/studio-p471gg5n.js.map +14 -0
  103. package/dist/chunks/{studio-9bjwf0d4.js → studio-rgwcpast.js} +5 -46
  104. package/dist/chunks/{studio-9bjwf0d4.js.map → studio-rgwcpast.js.map} +4 -5
  105. package/dist/chunks/{studio-esrewxap.js → studio-s519zc99.js} +3 -3
  106. package/dist/chunks/studio-sas7mt3k.js +75 -0
  107. package/dist/chunks/studio-sas7mt3k.js.map +10 -0
  108. package/dist/chunks/studio-t5wqwzdh.js +74 -0
  109. package/dist/chunks/studio-t5wqwzdh.js.map +10 -0
  110. package/dist/chunks/{studio-9qpspwfn.js → studio-temv5bw4.js} +5 -5
  111. package/dist/chunks/{studio-9qpspwfn.js.map → studio-temv5bw4.js.map} +1 -1
  112. package/dist/chunks/{studio-qkvt37c0.js → studio-tr20m8g8.js} +669 -18
  113. package/dist/chunks/studio-tr20m8g8.js.map +9 -0
  114. package/dist/chunks/{studio-v7jkjqng.js → studio-v96qfnww.js} +5514 -4291
  115. package/dist/chunks/studio-v96qfnww.js.map +54 -0
  116. package/dist/chunks/studio-vcetc91k.js +659 -0
  117. package/dist/chunks/studio-vcetc91k.js.map +10 -0
  118. package/dist/chunks/{studio-jm0z592w.js → studio-vmymjefp.js} +2972 -4937
  119. package/dist/chunks/studio-vmymjefp.js.map +98 -0
  120. package/dist/chunks/{studio-bghqfmea.js → studio-wwseqyw0.js} +2 -2
  121. package/dist/chunks/studio-x9hmy5kr.js +390 -0
  122. package/dist/chunks/studio-x9hmy5kr.js.map +10 -0
  123. package/dist/chunks/studio-xa0ce0n7.js +335 -0
  124. package/dist/chunks/studio-xa0ce0n7.js.map +10 -0
  125. package/dist/chunks/studio-xm3dbxvn.js +378 -0
  126. package/dist/chunks/studio-xm3dbxvn.js.map +19 -0
  127. package/dist/chunks/{studio-nqw433kv.js → studio-xmvbhg31.js} +2 -2
  128. package/dist/chunks/studio-zv37yrfa.js +1054 -0
  129. package/dist/chunks/studio-zv37yrfa.js.map +13 -0
  130. package/dist/chunks/{ws-client-q7hkz3j9.js → ws-client-654ts66j.js} +6 -4
  131. package/dist/chunks/ws-client-654ts66j.js.map +11 -0
  132. package/dist/iframe-entry.js +668 -230
  133. package/dist/studio.js +21080 -32585
  134. package/index.html +35 -4685
  135. package/package.json +17 -15
  136. package/src/about/about-modal.ts +42 -11
  137. package/src/browse/library-commands.ts +240 -0
  138. package/src/browse/library-layouts.ts +369 -0
  139. package/src/browse/library-model.ts +396 -0
  140. package/src/browse/library-pane.ts +1049 -0
  141. package/src/browse/library-preview.ts +252 -0
  142. package/src/browse/library-source.ts +150 -0
  143. package/src/canvas/canvas-helpers.ts +33 -9
  144. package/src/canvas/canvas-live-render.ts +45 -29
  145. package/src/canvas/canvas-patcher.ts +151 -31
  146. package/src/canvas/canvas-perf.ts +46 -7
  147. package/src/canvas/canvas-render.ts +1092 -220
  148. package/src/canvas/canvas-surface.ts +240 -0
  149. package/src/canvas/canvas-utils.ts +1166 -124
  150. package/src/canvas/iframe-drop.ts +2 -1
  151. package/src/canvas/iframe-entry.ts +241 -4
  152. package/src/canvas/iframe-host.ts +1226 -143
  153. package/src/canvas/iframe-inline-edit.ts +31 -0
  154. package/src/canvas/iframe-interaction.ts +76 -16
  155. package/src/canvas/iframe-keys.ts +107 -45
  156. package/src/canvas/iframe-overlay.ts +38 -1
  157. package/src/canvas/iframe-protocol.ts +137 -2
  158. package/src/canvas/iframe-render.ts +70 -2
  159. package/src/canvas/iframe-slash.ts +6 -0
  160. package/src/canvas/path-mapping.ts +56 -6
  161. package/src/canvas/surface-registry.ts +292 -0
  162. package/src/collab/collab-commands.ts +244 -0
  163. package/src/collab/collab-session.ts +198 -32
  164. package/src/collab/collab-state.ts +28 -2
  165. package/src/collab/presence-chips.ts +100 -9
  166. package/src/commands/active-registry.ts +42 -0
  167. package/src/commands/app-commands.ts +176 -0
  168. package/src/commands/budget.ts +158 -0
  169. package/src/commands/command-args.ts +253 -0
  170. package/src/commands/context.ts +387 -0
  171. package/src/commands/defaults.ts +580 -0
  172. package/src/commands/keymap.ts +571 -0
  173. package/src/commands/levels.ts +345 -0
  174. package/src/commands/live-context.ts +193 -0
  175. package/src/commands/reference.ts +227 -0
  176. package/src/commands/registry.ts +293 -0
  177. package/src/component-props.ts +3 -2
  178. package/src/content/draft-state.ts +106 -0
  179. package/src/content/entry-commands.ts +282 -0
  180. package/src/content/entry-editor.ts +327 -0
  181. package/src/content/entry-fields.ts +116 -0
  182. package/src/content/entry-model.ts +175 -0
  183. package/src/editor/canvas-context-menu.ts +17 -11
  184. package/src/editor/canvas-slash-bridge.ts +11 -4
  185. package/src/editor/context-menu.ts +804 -204
  186. package/src/editor/convert-to-component.ts +31 -10
  187. package/src/editor/convert-to-repeater.ts +3 -2
  188. package/src/editor/inline-edit-apply.ts +5 -5
  189. package/src/editor/inline-edit.ts +86 -50
  190. package/src/editor/insert-zone-action.ts +1 -1
  191. package/src/editor/shortcuts.ts +1043 -329
  192. package/src/editor/slash-menu.ts +1 -0
  193. package/src/files/elements.ts +166 -0
  194. package/src/files/file-ops.ts +178 -31
  195. package/src/files/files.ts +898 -268
  196. package/src/files/fs-events.ts +21 -0
  197. package/src/files/media-meta.ts +203 -0
  198. package/src/files/media-paths.ts +141 -0
  199. package/src/files/media-upload.ts +7 -3
  200. package/src/files/media-usage.ts +189 -0
  201. package/src/github/github-auth.ts +235 -33
  202. package/src/github/github-publish.ts +80 -21
  203. package/src/grid/grid-controller.ts +152 -12
  204. package/src/grid/grid-layout.ts +225 -20
  205. package/src/grid/grid-open.ts +120 -0
  206. package/src/grid/grid-panel.ts +554 -39
  207. package/src/grid/grid-source.ts +27 -1
  208. package/src/grid/redirects-grid.ts +599 -0
  209. package/src/grid/redirects.ts +398 -0
  210. package/src/grid/sources/content-source.ts +108 -2
  211. package/src/i18n/i18n-commands.ts +322 -0
  212. package/src/new-project/add-repo-modal.ts +8 -10
  213. package/src/new-project/import-tab.ts +7 -0
  214. package/src/new-project/location-fields.ts +9 -1
  215. package/src/new-project/new-project-modal.ts +221 -245
  216. package/src/packages/jxsuite-update.ts +97 -48
  217. package/src/packages/pull-package-sync.ts +18 -9
  218. package/src/page-params.ts +2 -1
  219. package/src/panels/activity-bar.ts +152 -91
  220. package/src/panels/activity-panel.ts +481 -0
  221. package/src/panels/ai-chat/chat-markdown.ts +8 -3
  222. package/src/panels/ai-chat/chat-view.ts +245 -18
  223. package/src/panels/ai-chat/composer.ts +31 -5
  224. package/src/panels/ai-chat/sessions-view.ts +17 -10
  225. package/src/panels/ai-panel.ts +279 -53
  226. package/src/panels/block-action-bar.ts +1115 -224
  227. package/src/panels/bottom-dock.ts +337 -0
  228. package/src/panels/canvas-dnd-bridge.ts +37 -8
  229. package/src/panels/chat-panel.ts +29 -12
  230. package/src/panels/data-explorer.ts +254 -112
  231. package/src/panels/data-grid.ts +10 -4
  232. package/src/panels/dnd.ts +28 -51
  233. package/src/panels/editors.ts +434 -107
  234. package/src/panels/elements-panel.ts +66 -2
  235. package/src/panels/empty-state.ts +112 -0
  236. package/src/panels/events-panel.ts +596 -82
  237. package/src/panels/formula-workspace.ts +408 -218
  238. package/src/panels/frontmatter-fields.ts +51 -10
  239. package/src/panels/frontmatter-panel.ts +357 -79
  240. package/src/panels/git-panel.ts +375 -164
  241. package/src/panels/head-panel.ts +791 -85
  242. package/src/panels/i18n-panel.ts +592 -0
  243. package/src/panels/imports-panel.ts +95 -85
  244. package/src/panels/jump-bar.ts +584 -0
  245. package/src/panels/layers-panel.ts +1106 -328
  246. package/src/panels/left-panel.ts +109 -204
  247. package/src/panels/navigator-panels.ts +131 -0
  248. package/src/panels/overlays.ts +7 -2
  249. package/src/panels/pane-context.ts +1477 -0
  250. package/src/panels/pane-grid.ts +406 -0
  251. package/src/panels/panel-registry.ts +340 -0
  252. package/src/panels/panel-scheduler.ts +75 -0
  253. package/src/panels/problems-panel.ts +234 -0
  254. package/src/panels/properties-panel.ts +946 -1139
  255. package/src/panels/provenance.ts +258 -0
  256. package/src/panels/quick-search.ts +791 -122
  257. package/src/panels/right-panel.ts +228 -102
  258. package/src/panels/seo-modal.ts +395 -0
  259. package/src/panels/settings-pane.ts +203 -0
  260. package/src/panels/signals-panel.ts +354 -137
  261. package/src/panels/statement-editor.ts +41 -25
  262. package/src/panels/statusbar.ts +342 -106
  263. package/src/panels/style-panel.ts +974 -463
  264. package/src/panels/style-utils.ts +3 -3
  265. package/src/panels/stylebook-doc.ts +4 -2
  266. package/src/panels/stylebook-layers-panel.ts +3 -2
  267. package/src/panels/stylebook-panel.ts +51 -26
  268. package/src/panels/tab-strip.ts +1058 -78
  269. package/src/panels/target-line.ts +274 -0
  270. package/src/panels/toolbar.ts +631 -484
  271. package/src/panels/welcome-screen.ts +301 -198
  272. package/src/platform-errors.ts +26 -3
  273. package/src/platform.ts +96 -2
  274. package/src/platforms/cloud.ts +71 -8
  275. package/src/platforms/devserver.ts +92 -29
  276. package/src/publish/deploy-checklist.ts +383 -0
  277. package/src/publish/pages-service.ts +10 -1
  278. package/src/publish/publish-commands.ts +218 -0
  279. package/src/publish/publish-panel.ts +110 -16
  280. package/src/recent-projects.ts +3 -2
  281. package/src/services/a11y-report.ts +505 -0
  282. package/src/services/ai-models.ts +30 -1
  283. package/src/services/ai-project-tools.ts +29 -10
  284. package/src/services/ai-system-prompt.ts +53 -14
  285. package/src/services/ai-tools.ts +39 -3
  286. package/src/services/ai-writes.ts +154 -0
  287. package/src/services/announce.ts +97 -0
  288. package/src/services/automation.ts +424 -175
  289. package/src/services/cem-export.ts +9 -4
  290. package/src/services/clock.ts +61 -0
  291. package/src/services/document-assistant.ts +36 -8
  292. package/src/services/idle.ts +179 -0
  293. package/src/services/import-client.ts +26 -0
  294. package/src/services/monaco-buffer.ts +627 -0
  295. package/src/services/monaco-lazy.ts +36 -0
  296. package/src/services/notify.ts +271 -0
  297. package/src/services/profile.ts +155 -0
  298. package/src/services/references.ts +0 -0
  299. package/src/services/token-lint.ts +3 -2
  300. package/src/services/tool-executor.ts +53 -7
  301. package/src/services/trusted-types.ts +123 -0
  302. package/src/settings/contexts-section.ts +427 -0
  303. package/src/settings/contributed-section.ts +149 -11
  304. package/src/settings/css-vars-editor.ts +306 -349
  305. package/src/settings/defs-editor.ts +93 -34
  306. package/src/settings/dependencies-editor.ts +7 -7
  307. package/src/settings/extension-sections.ts +37 -5
  308. package/src/settings/general-settings.ts +204 -121
  309. package/src/settings/locales-section.ts +347 -0
  310. package/src/settings/preferences-accounts.ts +140 -0
  311. package/src/settings/preferences-dialog.ts +620 -0
  312. package/src/settings/preferences-keymap.ts +270 -0
  313. package/src/settings/project-sections.ts +260 -0
  314. package/src/settings/section-registry.ts +169 -0
  315. package/src/settings/settings-document.ts +385 -0
  316. package/src/shell.ts +1549 -0
  317. package/src/site-context.ts +45 -20
  318. package/src/state.ts +14 -275
  319. package/src/store.ts +88 -43
  320. package/src/studio.ts +790 -346
  321. package/src/style/live-preview.ts +36 -0
  322. package/src/style/project-styles.ts +349 -0
  323. package/src/style/token-ref.ts +123 -0
  324. package/src/tabs/patch-ops.ts +16 -4
  325. package/src/tabs/project-config.ts +416 -0
  326. package/src/tabs/selection.ts +323 -0
  327. package/src/tabs/tab.ts +182 -47
  328. package/src/tabs/transact.ts +209 -28
  329. package/src/types.ts +68 -13
  330. package/src/ui/ai-credentials-form.ts +39 -35
  331. package/src/ui/ai-managed-connect.ts +7 -1
  332. package/src/ui/dynamic-slot.ts +224 -81
  333. package/src/ui/expression-editor.ts +71 -63
  334. package/src/ui/field-input.ts +4 -6
  335. package/src/ui/field-row.ts +215 -38
  336. package/src/ui/form-controls.ts +194 -7
  337. package/src/ui/layers.ts +492 -69
  338. package/src/ui/media-picker.ts +115 -25
  339. package/src/ui/panel-resize.ts +109 -91
  340. package/src/ui/progress-modal.ts +131 -50
  341. package/src/ui/regions.ts +462 -0
  342. package/src/ui/schema-form.ts +229 -45
  343. package/src/ui/spectrum.ts +24 -8
  344. package/src/ui/timing.ts +49 -0
  345. package/src/ui/value-selector.ts +20 -0
  346. package/src/ui/value-source.ts +348 -0
  347. package/src/ui/virtual-window.ts +400 -0
  348. package/src/utils/edit-display.ts +3 -2
  349. package/src/utils/inherited-style.ts +67 -37
  350. package/src/view.ts +64 -78
  351. package/src/workspace/pane-derive.ts +1258 -0
  352. package/src/workspace/session.ts +317 -0
  353. package/src/workspace/workspace.ts +1345 -23
  354. package/styles/canvas.css +653 -0
  355. package/styles/forced-colors.css +106 -0
  356. package/styles/inspector.css +1454 -0
  357. package/styles/overlays.css +2704 -0
  358. package/styles/panels.css +1701 -0
  359. package/styles/shell.css +1423 -0
  360. package/styles/tokens.css +151 -0
  361. package/dist/chunks/Overlay.dev-cszx7yn5.js +0 -22
  362. package/dist/chunks/extension-sections-qr3drkkw.js +0 -531
  363. package/dist/chunks/extension-sections-qr3drkkw.js.map +0 -12
  364. package/dist/chunks/files-j8a1t06k.js +0 -50
  365. package/dist/chunks/files-j8a1t06k.js.map +0 -9
  366. package/dist/chunks/git-panel-xtq5z81x.js +0 -28
  367. package/dist/chunks/git-panel-xtq5z81x.js.map +0 -9
  368. package/dist/chunks/layers-panel-ancn2wpq.js +0 -26
  369. package/dist/chunks/layers-panel-ancn2wpq.js.map +0 -9
  370. package/dist/chunks/settings-modal-17ttr96g.js +0 -29
  371. package/dist/chunks/settings-modal-17ttr96g.js.map +0 -9
  372. package/dist/chunks/sp-overlay.dev-earn5as8.js +0 -17
  373. package/dist/chunks/sp-overlay.dev-earn5as8.js.map +0 -9
  374. package/dist/chunks/sp-popover.dev-frxtfejn.js +0 -8
  375. package/dist/chunks/sp-popover.dev-frxtfejn.js.map +0 -9
  376. package/dist/chunks/sp-progress-circle.dev-7tvw34h8.js +0 -14
  377. package/dist/chunks/sp-progress-circle.dev-7tvw34h8.js.map +0 -9
  378. package/dist/chunks/sp-tooltip.dev-a9fywesm.js +0 -21
  379. package/dist/chunks/sp-tooltip.dev-a9fywesm.js.map +0 -10
  380. package/dist/chunks/studio-0xgs7xrs.js +0 -429
  381. package/dist/chunks/studio-0xgs7xrs.js.map +0 -13
  382. package/dist/chunks/studio-4d8hzcz5.js +0 -3427
  383. package/dist/chunks/studio-4d8hzcz5.js.map +0 -26
  384. package/dist/chunks/studio-4k0m4fmp.js.map +0 -13
  385. package/dist/chunks/studio-9smfzqhc.js +0 -19
  386. package/dist/chunks/studio-9smfzqhc.js.map +0 -10
  387. package/dist/chunks/studio-jm0z592w.js.map +0 -115
  388. package/dist/chunks/studio-m2t4mdg5.js +0 -1854
  389. package/dist/chunks/studio-m2t4mdg5.js.map +0 -18
  390. package/dist/chunks/studio-n4p11dfy.js +0 -853
  391. package/dist/chunks/studio-n4p11dfy.js.map +0 -12
  392. package/dist/chunks/studio-qkvt37c0.js.map +0 -9
  393. package/dist/chunks/studio-sjh1wt1a.js +0 -3744
  394. package/dist/chunks/studio-sjh1wt1a.js.map +0 -22
  395. package/dist/chunks/studio-v7jkjqng.js.map +0 -46
  396. package/dist/chunks/studio-xq0t7n5t.js +0 -140
  397. package/dist/chunks/studio-xq0t7n5t.js.map +0 -10
  398. package/dist/chunks/studio-xze4zrs1.js.map +0 -10
  399. package/dist/chunks/studio-yfcstdzy.js +0 -399
  400. package/dist/chunks/studio-yfcstdzy.js.map +0 -12
  401. package/dist/chunks/studio-zp7jncs8.js +0 -469
  402. package/dist/chunks/studio-zp7jncs8.js.map +0 -14
  403. package/dist/chunks/ws-client-q7hkz3j9.js.map +0 -11
  404. package/src/browse/browse-modal.ts +0 -69
  405. package/src/browse/browse.ts +0 -904
  406. package/src/canvas/canvas-diff.ts +0 -216
  407. package/src/canvas/nested-site-style.ts +0 -58
  408. package/src/new-project/design-fields.ts +0 -264
  409. package/src/new-project/templates.ts +0 -61
  410. package/src/panels/tab-bar.ts +0 -548
  411. package/src/settings/settings-modal.ts +0 -203
  412. /package/dist/chunks/{adapter-z8fkmbmv.js.map → adapter-qfnesn5v.js.map} +0 -0
  413. /package/dist/chunks/{cf-settings-mmyv436d.js.map → cf-settings-73sh5z4p.js.map} +0 -0
  414. /package/dist/chunks/{format-host-8jxwts2p.js.map → format-host-mkwsmt8d.js.map} +0 -0
  415. /package/dist/chunks/{jx-validate-qx8degj7.js.map → jx-validate-v6qgknrs.js.map} +0 -0
  416. /package/dist/chunks/{studio-w7c6kvk7.js.map → studio-a7pzveq1.js.map} +0 -0
  417. /package/dist/chunks/{studio-esrewxap.js.map → studio-s519zc99.js.map} +0 -0
  418. /package/dist/chunks/{studio-bghqfmea.js.map → studio-wwseqyw0.js.map} +0 -0
  419. /package/dist/chunks/{studio-nqw433kv.js.map → studio-xmvbhg31.js.map} +0 -0
@@ -0,0 +1,39 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/panels/provenance.ts", "../src/ui/field-row.ts", "../src/ui/formula-chips.ts", "../../formulas/src/catalog.ts", "../src/ui/formula-catalog.ts", "../src/ui/formula-palette.ts", "../../schema/defs/tag-expression.schema.ts", "../../schema/defs/tag-name.schema.ts", "../../schema/defs/string-or-ref.schema.ts", "../../schema/defs/head-entry.schema.ts", "../../schema/defs/cem.schema.ts", "../../schema/defs/image-config.schema.ts", "../../schema/defs/ref-object.schema.ts", "../../schema/defs/style-object.schema.ts", "../../schema/defs/children-value.schema.ts", "../../schema/defs/element-def.schema.ts", "../../schema/defs/typed-state-def.schema.ts", "../../schema/defs/function-def.schema.ts", "../../schema/defs/external-class-def.schema.ts", "../../schema/defs/pure-type-def.schema.ts", "../../schema/defs/expression-node.schema.ts", "../../schema/defs/state-entry.schema.ts", "../../schema/defs/class-def.schema.ts", "../../schema/defs/project-config.schema.ts", "../../schema/defs/extension-manifest.schema.ts", "../src/ui/value-source.ts", "../src/ui/expression-editor.ts", "../src/ui/dynamic-slot.ts", "../src/ui/schema-form.ts", "../src/services/context-resolver.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * Provenance — where the value in a field came from, as one chip (plan §6.2).\n *\n * Four states, and the two that carry information NAME THEIR SOURCE:\n *\n * | State | Rendering | Click |\n * | --------- | --------------------------------- | ----------------- |\n * | set | accent dot | clear the value |\n * | inherited | amber, \"from Base\" / \"from Md\" | jump to the donor |\n * | default | nothing — absence IS the ghost | — |\n * | bound | violet, naming the signal/formula | open the source |\n * | mixed | neutral, \"mixed (3)\" — see below | clear across all |\n *\n * **Mixed** is what a multi-selection says when the selected elements disagree about a field\n * (§6.5). It is a fifth state of THIS chip rather than a fifth widget, because it answers the same\n * question the other four answer — _where did the value in this box come from?_ — and the honest\n * answer is \"from several places, and they differ\". It names how many elements are involved, so\n * \"mixed\" never has to mean \"some unknown number of things\". Typing into a Mixed field commits the\n * new value to every selected element in one transaction; the chip's click clears it from all of\n * them, which is the same verb `set` has, applied to the same set.\n *\n * `set` and `default` are the only two the inspector could previously express, and it expressed\n * them as a dot or the absence of one. The other two were known at render time and thrown away: an\n * inherited style value arrived as an input placeholder, visually indistinguishable from the CSS\n * initial value `style-inputs.ts` renders into the same slot, and a `${…}`-bound value looked like\n * a literal that happened to contain braces.\n *\n * **One module, two cascades.** The Style tab reads provenance against the breakpoint / scheme /\n * site-token cascade; Component Props reads it against the component's declared defaults. Same\n * question, same words, same chip — so the two surfaces cannot drift into two vocabularies for one\n * idea. The chip's CSS lives in `styles/inspector.css` beside `.set-dot`, which the `set` state\n * reuses outright: a 6px accent dot that clears the value on click is exactly what the set state\n * has always been, and every stylesheet rule and test that addresses `.set-dot` keeps addressing\n * the same thing.\n */\n\nimport { html, nothing } from \"lit-html\";\nimport { classMap } from \"lit-html/directives/class-map.js\";\n\n/** The states of §6.2 (four) plus §6.5's `mixed`, in the order the table lists them. */\nexport type ProvenanceState = \"set\" | \"inherited\" | \"default\" | \"bound\" | \"mixed\";\n\n/** Where one field's value came from, and what clicking the chip does about it. */\nexport interface FieldProvenance {\n state: ProvenanceState;\n /**\n * Who supplied the value, in the words a reader would use — `\"Base\"`, `\"Md\"`, `\"site tokens\"`,\n * `\"the component default\"`, or a signal name. Rendered verbatim after the word \"from\" for\n * `inherited`, and on its own for `bound`, so a caller passes the noun and never the preposition.\n * For `mixed` it is the COUNT of disagreeing elements, as a string.\n */\n donor?: string | undefined;\n /**\n * Clear (`set`), jump to the donor (`inherited`), open the source (`bound`). A chip with no\n * handler renders as a `<span>`, never a `<button>`: a control that looks pressable and does\n * nothing is the defect this phase exists to remove.\n */\n onClick?: (() => void) | undefined;\n /** Overrides the derived tooltip. */\n title?: string | undefined;\n}\n\n/** The lead word of the derived tooltip, per state. */\nconst PROVENANCE_TITLES: Readonly<Record<ProvenanceState, string>> = {\n bound: \"Bound\",\n default: \"Not set\",\n inherited: \"Inherited\",\n mixed: \"Mixed\",\n set: \"Set here\",\n};\n\n/** The chip's own text. The dots say nothing; the two informative states name a donor. */\nfunction provenanceText(p: FieldProvenance): string {\n if (p.state === \"inherited\") {\n return p.donor ? `from ${p.donor}` : \"inherited\";\n }\n if (p.state === \"bound\") {\n return p.donor ?? \"bound\";\n }\n if (p.state === \"mixed\") {\n return p.donor ? `mixed (${p.donor})` : \"mixed\";\n }\n return \"\";\n}\n\n/** The tooltip a chip carries when the caller does not supply one. */\nexport function provenanceTitle(prop: string, p: FieldProvenance): string {\n if (p.title) {\n return p.title;\n }\n const lead = PROVENANCE_TITLES[p.state];\n if (p.state === \"inherited\") {\n return `${lead} from ${p.donor ?? \"the cascade\"} — click to go there`;\n }\n if (p.state === \"bound\") {\n return p.donor ? `${lead} to ${p.donor} — click to open it` : lead;\n }\n if (p.state === \"set\") {\n return `${lead} — click to clear ${prop}`;\n }\n if (p.state === \"mixed\") {\n const count = p.donor ? `${p.donor} selected elements` : \"the selected elements\";\n return `${lead} — ${count} have different values for ${prop}; typing sets them all`;\n }\n return `${lead} — ${prop} falls back to the browser default`;\n}\n\n/**\n * The provenance chip.\n *\n * `default` renders **nothing**, and that is the ghost: a dot on every unset row is 138 dots on the\n * Style tab and a uniform grey field on Content, which says less than silence. `.set-dot`'s own\n * documented rule already reads \"only show when the property is explicitly set\" (ui-guidelines\n * §4.2) — this keeps it, and gives the two states that were previously indistinguishable from\n * absence a chip of their own.\n *\n * @param {string} prop — the field key, used in the derived tooltip.\n * @param {FieldProvenance} p\n * @returns {import(\"lit-html\").TemplateResult | typeof nothing}\n */\nexport function renderProvenanceChip(prop: string, p: FieldProvenance) {\n if (p.state === \"default\") {\n return nothing;\n }\n const text = provenanceText(p);\n const title = provenanceTitle(prop, p);\n const isDot = p.state === \"set\";\n const classes = classMap({\n \"provenance-chip\": true,\n [`provenance-chip--${p.state}`]: true,\n // The set state reuses `.set-dot`'s geometry — the chip is a generalisation of the dot, not a\n // Replacement for it, and a 6px circle is not a button.\n \"set-dot\": isDot,\n });\n const { onClick } = p;\n if (!onClick) {\n return html`<span class=${classes} title=${title}>${text}</span>`;\n }\n const activate = (e: Event) => {\n e.stopPropagation();\n e.preventDefault();\n onClick();\n };\n return isDot\n ? html`<span class=${classes} title=${title} @click=${activate}>${text}</span>`\n : html`<button type=\"button\" class=${classes} title=${title} @click=${activate}>\n ${text}\n </button>`;\n}\n\n// ─── Section summaries ────────────────────────────────────────────────────────\n\n/** How many fields in a group are in each informative state. */\nexport interface ProvenanceCounts {\n set: number;\n inherited: number;\n bound: number;\n mixed: number;\n}\n\n/**\n * Tally a group of states.\n *\n * @param {Iterable<ProvenanceState>} states\n * @returns {ProvenanceCounts}\n */\nexport function countProvenance(states: Iterable<ProvenanceState>): ProvenanceCounts {\n const counts: ProvenanceCounts = { bound: 0, inherited: 0, mixed: 0, set: 0 };\n for (const state of states) {\n if (state !== \"default\") {\n counts[state] += 1;\n }\n }\n return counts;\n}\n\n/** Whether a tally has anything to show at all. */\nexport function hasProvenance(counts: ProvenanceCounts): boolean {\n return counts.set > 0 || counts.inherited > 0 || counts.bound > 0 || counts.mixed > 0;\n}\n\n/** \"3 set here · 2 inherited · 1 bound\" — the summary a collapsed section states on hover. */\nexport function provenanceSummaryText(counts: ProvenanceCounts): string {\n const parts: string[] = [];\n if (counts.set > 0) {\n parts.push(`${counts.set} set here`);\n }\n if (counts.inherited > 0) {\n parts.push(`${counts.inherited} inherited`);\n }\n if (counts.bound > 0) {\n parts.push(`${counts.bound} bound`);\n }\n if (counts.mixed > 0) {\n parts.push(`${counts.mixed} mixed`);\n }\n return parts.length > 0 ? parts.join(\" · \") : \"nothing set\";\n}\n\n/**\n * A collapsed accordion heading's provenance dots.\n *\n * This is what retires the Style tab's \"Active\" filter toggle. That toggle existed for one reason —\n * with a section closed there was no way to tell whether anything inside it was set, so the only\n * way to find your own overrides was to hide every property that had none. A heading that says \"3\n * set here · 2 inherited\" answers the question without changing what the panel shows.\n *\n * The `set` dot keeps its clear-all handler, so the heading loses no affordance.\n *\n * @param {ProvenanceCounts} counts\n * @param {{ onClearSet?: () => void; clearTitle?: string }} opts\n */\nexport function renderProvenanceDots(\n counts: ProvenanceCounts,\n opts: { onClearSet?: (() => void) | undefined; clearTitle?: string | undefined } = {},\n) {\n if (!hasProvenance(counts)) {\n return nothing;\n }\n const summary = provenanceSummaryText(counts);\n return html`\n <span class=\"provenance-dots\" title=${summary} aria-label=${summary}>\n ${\n counts.set > 0\n ? renderProvenanceChip(\"section\", {\n state: \"set\",\n title: opts.clearTitle ?? summary,\n ...(opts.onClearSet ? { onClick: opts.onClearSet } : {}),\n })\n : nothing\n }\n ${\n counts.inherited > 0\n ? html`<span\n class=\"provenance-chip provenance-chip--inherited set-dot\"\n title=${summary}\n ></span>`\n : nothing\n }\n ${\n counts.bound > 0\n ? html`<span\n class=\"provenance-chip provenance-chip--bound set-dot\"\n title=${summary}\n ></span>`\n : nothing\n }\n ${\n counts.mixed > 0\n ? html`<span\n class=\"provenance-chip provenance-chip--mixed set-dot\"\n title=${summary}\n ></span>`\n : nothing\n }\n </span>\n `;\n}\n",
6
+ "/// <reference lib=\"dom\" />\n/**\n * Field-row.js — the inspector's row vocabulary, in one module.\n *\n * Three rows, and every panel that draws one imports it from here:\n *\n * - {@link renderFieldRow} — label + widget, plus §7.1's **third notification tier** (an `error` line\n * rendered at the control) and §6.2's **provenance chip** (where this value came from). The chip\n * itself is `panels/provenance.ts`'s: one vocabulary, two cascades, one template.\n * - {@link renderKvRow} — an editable key/value pair with a delete affordance. Custom attributes and\n * custom CSS properties are the same row; they were two.\n * - {@link renderStaticKvRow} — the read-only name/value line. Observed Attributes, CSS Properties\n * and CSS Parts each hand-wrote it with the same inline style declarations.\n *\n * **The error line.** The other two notification tiers are hosted records in `services/notify.ts`:\n * a toast is taken away on a timer, a problem is kept until somebody fixes it. An inline error is\n * neither, because it is not a record at all — it is a property of the value currently in the\n * field, and it lives exactly as long as that value does. Which is the point: a rejected value used\n * to be announced in a three-second grey line at the bottom of the window, hundreds of pixels from\n * the field that rejected it, and by the time you looked down the field had snapped back and the\n * reason was gone.\n *\n * **Validated on commit, never on input** (§7.1). Producers decide a value is bad on `change` or\n * blur, not on `input` — a field cannot spend the middle of every word telling you it is wrong.\n */\n\nimport { html, nothing } from \"lit-html\";\nimport { classMap } from \"lit-html/directives/class-map.js\";\nimport { renderProvenanceChip } from \"../panels/provenance\";\n\nimport type { FieldProvenance } from \"../panels/provenance\";\n\n// ─── The field row ───────────────────────────────────────────────────────────\n\n/** Options for {@link renderFieldRow}. */\nexport interface FieldRowOptions {\n prop: string;\n label: string;\n hasValue: boolean;\n onClear?: () => void;\n widget: unknown;\n /** Rendered after the label inside the label cell (e.g. the dynamic-slot mode button). */\n labelExtra?: unknown;\n span?: number;\n warning?: boolean;\n /**\n * Where this value came from (§6.2). When omitted the row derives the `set`/`default` pair from\n * `hasValue` and `onClear`, which is what every caller meant by them all along; a caller that can\n * answer the richer question passes the answer.\n */\n provenance?: FieldProvenance | undefined;\n /**\n * Why the value in this control is not acceptable — §7.1's inline tier.\n *\n * Rendered under the widget in danger colour with `role=\"alert\"`, so a screen reader announces it\n * when it appears. Presence also marks the row invalid, so the state is legible without reading:\n * `warning` says \"this is unusual\", `error` says \"this is refused\".\n *\n * Empty string and `undefined` both mean \"no error\", so a producer can pass its validator's\n * output straight through without a ternary.\n */\n error?: string | undefined;\n /**\n * How many times this value has been refused in a row — the \"message + counter\" §7.1 asks for.\n *\n * A repeat count is the difference between \"the field is still red from last time\" and \"it just\n * refused me again\", which is otherwise invisible when the second attempt fails the same way.\n * Rendered from 2 up.\n */\n errorCount?: number | undefined;\n}\n\n/**\n * Render a universal field row with a provenance chip, label, widget, and an optional inline error.\n *\n * @param {FieldRowOptions} opts\n * @returns {import(\"lit-html\").TemplateResult}\n */\nexport function renderFieldRow({\n prop,\n label,\n hasValue,\n onClear,\n widget,\n labelExtra,\n span,\n warning,\n provenance,\n error,\n errorCount,\n}: FieldRowOptions) {\n const invalid = Boolean(error);\n const chip: FieldProvenance | undefined =\n provenance ??\n (hasValue && onClear ? { onClick: onClear, state: \"set\", title: `Clear ${prop}` } : undefined);\n return html`\n <div\n class=${classMap({\n \"style-row\": true,\n \"style-row--invalid\": invalid,\n \"style-row--warning\": Boolean(warning) && !invalid,\n })}\n data-prop=${prop}\n style=${span === 2 ? \"grid-column: 1 / -1\" : \"\"}\n >\n <div class=\"style-row-label\">\n ${chip ? renderProvenanceChip(prop, chip) : nothing}\n <sp-field-label size=\"s\" title=${prop}>${label}</sp-field-label>\n ${labelExtra ?? nothing}\n </div>\n ${widget}\n ${\n invalid\n ? html`<p class=\"style-row-error\" role=\"alert\">\n ${error}${\n errorCount !== undefined && errorCount > 1\n ? html`<span class=\"style-row-error-count\">×${errorCount}</span>`\n : nothing\n }\n </p>`\n : nothing\n }\n </div>\n `;\n}\n\n// ─── The editable key/value row ──────────────────────────────────────────────\n\n/** Options for {@link renderKvRow}. */\nexport interface KvRowOptions {\n /** The pair's current key. */\n name: string;\n /** The pair's current value. */\n value: string;\n /** Commit both cells, debounced, with the current contents of each. */\n onCommit: (name: string, value: string) => void;\n /** Remove the pair outright. */\n onDelete: () => void;\n /**\n * The value cell's placeholder, resolved from the key — a CSS property's initial value, say.\n *\n * A resolver rather than a string because the key is editable: typing `display` into the key cell\n * should offer `inline` under it before anything is committed, and only the caller knows the\n * map.\n */\n placeholderFor?: ((name: string) => string) | undefined;\n /** Debounce before {@link KvRowOptions.onCommit}, in ms. */\n debounceMs?: number;\n}\n\n/**\n * An editable key/value pair with a delete affordance — the ONE implementation.\n *\n * Custom HTML attributes and custom CSS properties are the same row and were written twice, with\n * different rename behaviour (one committed on `input`, the other on `change`) and different\n * placeholder plumbing. They now differ only in what they pass in.\n *\n * @param {KvRowOptions} opts\n */\nexport function renderKvRow({\n name,\n value,\n onCommit,\n onDelete,\n placeholderFor,\n debounceMs = 400,\n}: KvRowOptions) {\n let debounce: ReturnType<typeof setTimeout> | undefined;\n let currentName = name;\n let currentValue = value;\n const commit = () => {\n clearTimeout(debounce);\n debounce = setTimeout(() => onCommit(currentName, currentValue), debounceMs);\n };\n return html`\n <div class=\"kv-row\" data-prop=${name}>\n <sp-textfield\n size=\"s\"\n class=\"kv-key\"\n .value=${name}\n @input=${(e: Event) => {\n currentName = (e.target as HTMLInputElement).value;\n commit();\n }}\n @change=${\n placeholderFor\n ? (e: Event) => {\n const cell = (e.target as HTMLInputElement)\n .closest(\".kv-row\")\n ?.querySelector(\".kv-val\");\n cell?.setAttribute(\n \"placeholder\",\n placeholderFor((e.target as HTMLInputElement).value),\n );\n }\n : nothing\n }\n ></sp-textfield>\n <sp-textfield\n size=\"s\"\n class=\"kv-val\"\n .value=${value}\n placeholder=${placeholderFor ? placeholderFor(name) : \"\"}\n @input=${(e: Event) => {\n currentValue = (e.target as HTMLInputElement).value;\n commit();\n }}\n ></sp-textfield>\n <sp-action-button size=\"xs\" quiet title=\"Remove ${name}\" @click=${onDelete}>\n <sp-icon-close slot=\"icon\"></sp-icon-close>\n </sp-action-button>\n </div>\n `;\n}\n\n// ─── The read-only key/value row ─────────────────────────────────────────────\n\n/** Options for {@link renderStaticKvRow}. */\nexport interface StaticKvRowOptions {\n /** The thing being named — an attribute, a custom property, a part. Rendered as code. */\n name: string;\n /** What it maps to, rendered immediately after the name (\"→ count\", \"<button>\"). */\n detail?: string | undefined;\n /** Its value or type, rendered hard right. */\n value?: string | undefined;\n /** Flags, rendered hard right after the value (\"reflects\"). */\n tags?: readonly string[] | undefined;\n}\n\n/**\n * A read-only name/value line.\n *\n * Observed Attributes, CSS Properties and CSS Parts each hand-wrote this with the same\n * `display:flex;gap:6px;align-items:center;padding:2px 0;font-size:…` inline block — three copies\n * of one row, none of them addressable by a stylesheet, and so none of them able to respond to the\n * theme. They differ only in which of the three slots they fill.\n *\n * @param {StaticKvRowOptions} opts\n */\nexport function renderStaticKvRow({ name, detail, value, tags }: StaticKvRowOptions) {\n return html`\n <div class=\"kv-static-row\" data-prop=${name}>\n <code class=\"kv-static-name\">${name}</code>\n ${detail ? html`<span class=\"kv-static-detail\">${detail}</span>` : nothing}\n ${value ? html`<span class=\"kv-static-value\">${value}</span>` : nothing}\n ${(tags ?? []).map((tag) => html`<span class=\"kv-static-tag\">${tag}</span>`)}\n </div>\n `;\n}\n",
7
+ "/// <reference lib=\"dom\" />\n/**\n * Formula chips — a horizontal presentation layer summarizing an expression tree as left-to-right\n * chips (spec §19.9). The `target` chain unrolls deepest-first: the head chip is the innermost\n * target operand (ref/literal), followed by each operator up to the root. Nested non-target\n * operands render as parenthesized group chips. Pure presentation — no editing logic; clicking a\n * chip reports the node path to the caller.\n */\n\nimport { html, nothing } from \"lit-html\";\nimport { isJsonObject, isRef } from \"@jxsuite/schema/guards\";\n\nimport type { TemplateResult } from \"lit-html\";\nimport type { EditorPreview } from \"./expression-editor\";\n\ntype NodePath = (string | number)[];\n\ninterface ChainLink {\n node: Record<string, unknown>;\n path: NodePath;\n}\n\ninterface Chain {\n /** The innermost target operand (ref/literal), absent for target-less roots. */\n head: { value: unknown; path: NodePath } | null;\n /** Operator nodes, deepest target first → outermost operator last. */\n links: ChainLink[];\n}\n\nfunction isExprNode(value: unknown): value is Record<string, unknown> {\n return isJsonObject(value) && typeof value.operator === \"string\";\n}\n\n/** Human label for a pointer ref: strips the #/state/ and window#/ prefixes. */\nfunction refLabel(ref: string): string {\n if (ref.startsWith(\"#/state/\")) {\n return ref.slice(\"#/state/\".length);\n }\n if (ref.startsWith(\"window#/\")) {\n return ref.slice(\"window#/\".length).replaceAll(\"/\", \".\");\n }\n return ref || \"?\";\n}\n\n/** Compact label for a non-node operand (ref or literal). */\nfunction operandLabel(value: unknown): string {\n if (isRef(value)) {\n return refLabel(value.$ref);\n }\n if (isExprNode(value)) {\n return `(${chipSummary(value)})`;\n }\n if (typeof value === \"string\") {\n return JSON.stringify(value);\n }\n return String(value);\n}\n\n/** The chain path for `hops` target descents below `basePath`. */\nfunction targetPath(basePath: NodePath, hops: number): NodePath {\n return [...basePath, ...Array.from({ length: hops }, () => \"target\")];\n}\n\n/** Unroll a node's target chain into head operand + operator links (deepest first). */\nfunction unrollChain(node: Record<string, unknown>, basePath: NodePath): Chain {\n // Collect the chain root-first, then materialize each link's path from its descent depth.\n const nodes: Record<string, unknown>[] = [];\n let current: Record<string, unknown> = node;\n for (;;) {\n nodes.push(current);\n const next = current.target;\n if (isExprNode(next)) {\n current = next;\n } else {\n break;\n }\n }\n const deepest = nodes.at(-1)!;\n const head: Chain[\"head\"] =\n \"target\" in deepest || deepest.target !== undefined\n ? { path: targetPath(basePath, nodes.length), value: deepest.target }\n : null;\n const rootFirst = nodes.map((n, i) => ({ node: n, path: targetPath(basePath, i) }));\n return { head, links: rootFirst.toReversed() };\n}\n\n/** Compact one-line text form of a node: head operand followed by the operator chain. */\nexport function chipSummary(node: unknown): string {\n if (!isExprNode(node)) {\n return operandLabel(node);\n }\n const { head, links } = unrollChain(node, []);\n const parts: string[] = [];\n if (head) {\n parts.push(operandLabel(head.value));\n }\n for (const link of links) {\n parts.push(String(link.node.operator));\n }\n return parts.join(\" › \");\n}\n\n// ─── Rendering ──────────────────────────────────────────────────────────────\n\nconst CHIP_STYLE =\n \"display:inline-flex;align-items:center;gap:4px;max-width:180px;padding:1px 7px;\" +\n \"border:1px solid var(--spectrum-gray-300, #3c3c3c);border-radius:10px;cursor:pointer;\" +\n \"background:var(--spectrum-gray-100, #232323);color:var(--spectrum-gray-800, #d0d0d0);\" +\n \"font-size:11px;font-family:var(--spectrum-code-font-family, monospace);line-height:18px\";\n\n/** Live value badge — same styling convention as the expression editor's `.expr-live-badge`. */\nfunction renderChipBadge(preview: EditorPreview | null | undefined, pathKey: string) {\n const text = preview?.values.get(pathKey);\n if (text === undefined) {\n return nothing;\n }\n return html`\n <span\n class=\"expr-live-badge\"\n title=${text}\n style=\"font-family:var(--spectrum-code-font-family, monospace);font-size:10px;line-height:16px;padding:0 5px;border-radius:4px;background:var(--spectrum-gray-200, #323232);color:var(--spectrum-seafoam-900, #35a690);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px;flex-shrink:1\"\n >${text}</span\n >\n `;\n}\n\nfunction renderChip(\n label: string,\n path: NodePath,\n onSelect: (path: NodePath) => void,\n preview: EditorPreview | null | undefined,\n group = false,\n) {\n return html`\n <button\n type=\"button\"\n class=${group ? \"formula-chip formula-chip--group\" : \"formula-chip\"}\n data-path=${path.join(\"/\")}\n style=${CHIP_STYLE}\n title=${label}\n @click=${() => onSelect(path)}\n >\n <span style=\"white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:110px\"\n >${label}</span\n >\n ${renderChipBadge(preview, path.join(\"/\"))}\n </button>\n `;\n}\n\n/** Collect group chips for a link's non-target expression operands (value/initial/cases). */\nfunction groupChips(\n link: ChainLink,\n onSelect: (path: NodePath) => void,\n preview: EditorPreview | null | undefined,\n): TemplateResult[] {\n const chips: TemplateResult[] = [];\n const add = (operand: unknown, path: NodePath) => {\n if (isExprNode(operand)) {\n chips.push(renderChip(`(${chipSummary(operand)})`, path, onSelect, preview, true));\n }\n };\n const { value, initial, cases } = link.node;\n if (Array.isArray(value)) {\n for (const [i, item] of value.entries()) {\n add(item, [...link.path, \"value\", i]);\n }\n } else {\n add(value, [...link.path, \"value\"]);\n }\n add(initial, [...link.path, \"initial\"]);\n if (isJsonObject(cases)) {\n for (const [key, operand] of Object.entries(cases)) {\n add(operand, [...link.path, \"cases\", key]);\n }\n }\n add(link.node.default, [...link.path, \"default\"]);\n return chips;\n}\n\n/**\n * Render an expression node as a horizontal chip pipeline. Each chip carries the node's live value\n * badge when a preview is supplied; clicking a chip calls `onSelect` with the node path.\n */\nexport function renderFormulaChips(\n node: unknown,\n onSelect: (path: NodePath) => void,\n opts: { preview?: EditorPreview | null; path?: NodePath } = {},\n): TemplateResult {\n if (!isExprNode(node)) {\n return html`${nothing}`;\n }\n const preview = opts.preview ?? null;\n const basePath = opts.path ?? [];\n const { head, links } = unrollChain(node, basePath);\n\n const chips: TemplateResult[] = [];\n if (head) {\n chips.push(renderChip(operandLabel(head.value), head.path, onSelect, preview));\n }\n for (const link of links) {\n chips.push(\n renderChip(String(link.node.operator), link.path, onSelect, preview),\n ...groupChips(link, onSelect, preview),\n );\n }\n\n return html`\n <div\n class=\"formula-chips\"\n style=\"display:flex;flex-wrap:wrap;gap:4px;align-items:center;padding:2px 0 6px\"\n >\n ${chips}\n </div>\n `;\n}\n",
8
+ "/**\n * GENERATED by bin/generate.ts — do not edit. Regenerate with `bun run generate`.\n *\n * Every entry is a named formula (spec §19.4c): a pure $expression body over $args/<name>\n * parameters, verified against the blessed operator and global sets at generation time.\n */\n\nimport type { CemParameter, JxExpressionNode } from \"@jxsuite/schema/types\";\n\nexport interface FormulaCatalogEntry {\n name: string;\n description: string;\n parameters: (string | CemParameter)[];\n expression: JxExpressionNode;\n}\n\nexport const catalog: FormulaCatalogEntry[] = [\n {\n description: \"Arithmetic mean of an array of numbers; 0 for an empty array.\",\n expression: {\n operator: \"?:\",\n target: {\n $ref: \"$args/values/length\",\n },\n value: {\n operator: \"/\",\n target: {\n operator: \"reduce\",\n target: {\n $ref: \"$args/values\",\n },\n initial: 0,\n value: {\n operator: \"+\",\n target: {\n $ref: \"$reduce/acc\",\n },\n value: {\n $ref: \"$map/item\",\n },\n },\n },\n value: {\n $ref: \"$args/values/length\",\n },\n },\n initial: 0,\n },\n name: \"average\",\n parameters: [\n {\n name: \"values\",\n type: {\n text: \"number[]\",\n },\n },\n ],\n },\n {\n description:\n \"Uppercase the first character of a string, leaving the rest unchanged (the CSS text-transform: capitalize shape for a single word).\",\n expression: {\n operator: \"+\",\n target: {\n operator: \"toUpperCase\",\n target: {\n operator: \"charAt\",\n target: {\n $ref: \"$args/text\",\n },\n value: 0,\n },\n },\n value: {\n operator: \"slice\",\n target: {\n $ref: \"$args/text\",\n },\n value: 1,\n },\n },\n name: \"capitalize\",\n parameters: [\n {\n name: \"text\",\n type: {\n text: \"string\",\n },\n },\n ],\n },\n {\n description:\n \"Bound a number to the [min, max] range (the TC39 Math.clamp shape): returns min when below, max when above, the value itself otherwise.\",\n expression: {\n operator: \"call\",\n target: {\n $ref: \"window#/Math/min\",\n },\n value: [\n {\n operator: \"call\",\n target: {\n $ref: \"window#/Math/max\",\n },\n value: [\n {\n $ref: \"$args/value\",\n },\n {\n $ref: \"$args/min\",\n },\n ],\n },\n {\n $ref: \"$args/max\",\n },\n ],\n },\n name: \"clamp\",\n parameters: [\n {\n name: \"value\",\n type: {\n text: \"number\",\n },\n },\n {\n name: \"min\",\n type: {\n text: \"number\",\n },\n },\n {\n name: \"max\",\n type: {\n text: \"number\",\n },\n },\n ],\n },\n {\n description:\n \"A copy of an array with the falsy elements removed (Array.prototype.filter on truthiness).\",\n expression: {\n operator: \"filter\",\n target: {\n $ref: \"$args/values\",\n },\n value: {\n operator: \"!\",\n target: {\n operator: \"!\",\n target: {\n $ref: \"$map/item\",\n },\n },\n },\n },\n name: \"compact\",\n parameters: [\n {\n name: \"values\",\n type: {\n text: \"unknown[]\",\n },\n },\n ],\n },\n {\n description: \"The length of an array or string, or 0 when the value is missing.\",\n expression: {\n operator: \"??\",\n target: {\n $ref: \"$args/values/length\",\n },\n value: 0,\n },\n name: \"count\",\n parameters: [\n {\n name: \"values\",\n type: {\n text: \"unknown[] | string\",\n },\n },\n ],\n },\n {\n description: \"The first element of an array (index 0), or null when empty.\",\n expression: {\n operator: \"??\",\n target: {\n $ref: \"$args/values/0\",\n },\n value: null,\n },\n name: \"first\",\n parameters: [\n {\n name: \"values\",\n type: {\n text: \"unknown[]\",\n },\n },\n ],\n },\n {\n description:\n 'The uppercase first letters of each whitespace-separated word, joined (e.g. \"ada lovelace\" → \"AL\").',\n expression: {\n operator: \"join\",\n target: {\n operator: \"map\",\n target: {\n operator: \"split\",\n target: {\n $ref: \"$args/name\",\n },\n value: \" \",\n },\n value: {\n operator: \"toUpperCase\",\n target: {\n operator: \"charAt\",\n target: {\n $ref: \"$map/item\",\n },\n value: 0,\n },\n },\n },\n value: \"\",\n },\n name: \"initials\",\n parameters: [\n {\n name: \"name\",\n type: {\n text: \"string\",\n },\n },\n ],\n },\n {\n description:\n \"True when an array or string has no elements (length 0 — a missing value counts as empty).\",\n expression: {\n operator: \"===\",\n target: {\n operator: \"??\",\n target: {\n $ref: \"$args/value/length\",\n },\n value: 0,\n },\n value: 0,\n },\n name: \"isEmpty\",\n parameters: [\n {\n name: \"value\",\n type: {\n text: \"unknown[] | string\",\n },\n },\n ],\n },\n {\n description: \"The last element of an array (Array.prototype.at(-1)), or undefined when empty.\",\n expression: {\n operator: \"at\",\n target: {\n $ref: \"$args/values\",\n },\n value: -1,\n },\n name: \"last\",\n parameters: [\n {\n name: \"values\",\n type: {\n text: \"unknown[]\",\n },\n },\n ],\n },\n {\n description:\n \"The largest number in an array (Math.max folded over the values); undefined for an empty array.\",\n expression: {\n operator: \"reduce\",\n target: {\n $ref: \"$args/values\",\n },\n initial: {\n $ref: \"$args/values/0\",\n },\n value: {\n operator: \"call\",\n target: {\n $ref: \"window#/Math/max\",\n },\n value: [\n {\n $ref: \"$reduce/acc\",\n },\n {\n $ref: \"$map/item\",\n },\n ],\n },\n },\n name: \"max\",\n parameters: [\n {\n name: \"values\",\n type: {\n text: \"number[]\",\n },\n },\n ],\n },\n {\n description:\n \"The smallest number in an array (Math.min folded over the values); undefined for an empty array.\",\n expression: {\n operator: \"reduce\",\n target: {\n $ref: \"$args/values\",\n },\n initial: {\n $ref: \"$args/values/0\",\n },\n value: {\n operator: \"call\",\n target: {\n $ref: \"window#/Math/min\",\n },\n value: [\n {\n $ref: \"$reduce/acc\",\n },\n {\n $ref: \"$map/item\",\n },\n ],\n },\n },\n name: \"min\",\n parameters: [\n {\n name: \"values\",\n type: {\n text: \"number[]\",\n },\n },\n ],\n },\n {\n description: \"part / whole as a percentage (0 when the whole is 0 or missing).\",\n expression: {\n operator: \"?:\",\n target: {\n $ref: \"$args/whole\",\n },\n value: {\n operator: \"*\",\n target: {\n operator: \"/\",\n target: {\n $ref: \"$args/part\",\n },\n value: {\n $ref: \"$args/whole\",\n },\n },\n value: 100,\n },\n initial: 0,\n },\n name: \"percent\",\n parameters: [\n {\n name: \"part\",\n type: {\n text: \"number\",\n },\n },\n {\n name: \"whole\",\n type: {\n text: \"number\",\n },\n },\n ],\n },\n {\n description:\n \"Round a number to the given decimal places (Math.round against a Math.pow(10, digits) scale).\",\n expression: {\n operator: \"/\",\n target: {\n operator: \"call\",\n target: {\n $ref: \"window#/Math/round\",\n },\n value: [\n {\n operator: \"*\",\n target: {\n $ref: \"$args/value\",\n },\n value: {\n operator: \"call\",\n target: {\n $ref: \"window#/Math/pow\",\n },\n value: [\n 10,\n {\n $ref: \"$args/digits\",\n },\n ],\n },\n },\n ],\n },\n value: {\n operator: \"call\",\n target: {\n $ref: \"window#/Math/pow\",\n },\n value: [\n 10,\n {\n $ref: \"$args/digits\",\n },\n ],\n },\n },\n name: \"roundTo\",\n parameters: [\n {\n name: \"value\",\n type: {\n text: \"number\",\n },\n },\n {\n name: \"digits\",\n type: {\n text: \"number\",\n },\n default: 0,\n },\n ],\n },\n {\n description: \"Add every number in an array (Array.prototype.reduce with +, seeded at 0).\",\n expression: {\n operator: \"reduce\",\n target: {\n $ref: \"$args/values\",\n },\n initial: 0,\n value: {\n operator: \"+\",\n target: {\n $ref: \"$reduce/acc\",\n },\n value: {\n $ref: \"$map/item\",\n },\n },\n },\n name: \"sum\",\n parameters: [\n {\n name: \"values\",\n type: {\n text: \"number[]\",\n },\n },\n ],\n },\n {\n description:\n \"Shorten a string to at most the given length, appending a horizontal ellipsis when cut.\",\n expression: {\n operator: \"?:\",\n target: {\n operator: \">\",\n target: {\n $ref: \"$args/text/length\",\n },\n value: {\n $ref: \"$args/length\",\n },\n },\n value: {\n operator: \"+\",\n target: {\n operator: \"slice\",\n target: {\n $ref: \"$args/text\",\n },\n value: [\n 0,\n {\n $ref: \"$args/length\",\n },\n ],\n },\n value: \"…\",\n },\n initial: {\n $ref: \"$args/text\",\n },\n },\n name: \"truncate\",\n parameters: [\n {\n name: \"text\",\n type: {\n text: \"string\",\n },\n },\n {\n name: \"length\",\n type: {\n text: \"number\",\n },\n },\n ],\n },\n] as unknown as FormulaCatalogEntry[];\n",
9
+ "/**\n * Formula catalog — the metadata registry behind the formula palette, chip labels, and Monaco\n * completions (spec §19). Merges three sources into one uniform entry shape:\n *\n * 1. Blessed operators (hand-authored metadata for every member of `BLESSED_OPERATORS`),\n * 2. Blessed pure globals (derived programmatically from `BLESSED_GLOBALS`),\n * 3. Named formulas (derived from document state via `isNamedFormulaDef`).\n *\n * Pure data + factories — no DOM. Descriptions reference genuine ECMA semantics (naming law: no\n * token is invented).\n */\n\nimport { BLESSED_GLOBALS, BLESSED_OPERATORS, PURE_METHOD_OPS } from \"@jxsuite/runtime/expression\";\nimport { catalog as packagedCatalog } from \"@jxsuite/formulas\";\nimport { isJsonObject, isNamedFormulaDef } from \"@jxsuite/schema/guards\";\n\nimport type {\n CemParameter,\n JxExpressionNode,\n JxExpressionOperand,\n JxStateDefinition,\n} from \"@jxsuite/schema/types\";\nimport type { JsonValue } from \"../types\";\n\nexport interface FormulaParameterInfo {\n name: string;\n /** Display string for the parameter type (CEM `{ text }` or JSON Schema `type`). */\n type?: string;\n description?: string;\n default?: JsonValue;\n}\n\nexport interface FormulaCatalogEntry {\n /** Stable identifier: operator token, global path (\"Math/max\"), or state key. */\n name: string;\n /** Display label: operator token, dotted global (\"Math.max\"), or state key. */\n label: string;\n /** Palette group heading; operator groups mirror the expression editor's. */\n group: string;\n kind: \"operator\" | \"global\" | \"formula\";\n description: string;\n parameters: FormulaParameterInfo[];\n /** Factory for a fresh default expression node inserting this entry. */\n insert: () => JxExpressionNode;\n /**\n * A state entry this pick must copy into the document first (packaged formulas vendor their JSON\n * in — the project owns the copy; no package resolution at build or run time).\n */\n ensure?: { name: string; def: JxStateDefinition };\n}\n\n/**\n * Apply a palette pick: vendor the entry's state def in first when required (and not already\n * present), then hand the fresh node to the caller. The single funnel every pick site uses.\n */\nexport function applyCatalogPick(\n entry: FormulaCatalogEntry,\n onChange: (node: JxExpressionNode) => void,\n opts?: {\n stateEntries?: Record<string, JxStateDefinition> | null | undefined;\n onInsertDef?: ((name: string, def: JxStateDefinition) => void) | undefined;\n },\n): void {\n if (entry.ensure && !opts?.stateEntries?.[entry.ensure.name]) {\n opts?.onInsertDef?.(entry.ensure.name, entry.ensure.def);\n }\n onChange(entry.insert());\n}\n\n// ─── Blessed operators (hand-authored) ──────────────────────────────────────\n\ninterface OperatorMeta {\n group: string;\n description: string;\n parameters: FormulaParameterInfo[];\n insert: () => JxExpressionNode;\n}\n\nconst REF_TARGET = { description: \"Writable pointer the operation applies to\", name: \"target\" };\nconst LEFT = { description: \"Left operand\", name: \"target\" };\nconst RIGHT = { description: \"Right operand\", name: \"value\" };\n\nfunction assignMeta(op: string, verb: string): OperatorMeta {\n return {\n description: `${verb} assignment operator (ECMA \\`${op}\\`): stores the result at the target pointer.`,\n group: \"Assignment\",\n insert: () => ({ operator: op, target: { $ref: \"\" }, value: null }),\n parameters: [REF_TARGET, { description: \"Value assigned to the target\", name: \"value\" }],\n };\n}\n\nfunction binaryMeta(group: string, op: string, description: string): OperatorMeta {\n return {\n description,\n group,\n insert: () => ({ operator: op, target: null, value: null }),\n parameters: [LEFT, RIGHT],\n };\n}\n\nfunction arrayMeta(op: string, description: string, withValue: boolean): OperatorMeta {\n return {\n description,\n group: \"Array methods\",\n insert: () =>\n withValue\n ? { operator: op, target: { $ref: \"\" }, value: null }\n : { operator: op, target: { $ref: \"\" } },\n parameters: withValue\n ? [REF_TARGET, { description: \"Element to add\", name: \"value\" }]\n : [REF_TARGET],\n };\n}\n\nfunction aggregateMeta(op: string, description: string, withInitial: boolean): OperatorMeta {\n const node: JxExpressionNode = {\n operator: op,\n target: { $ref: \"\" },\n value: { operator: \"!\", target: null },\n };\n return {\n description,\n group: \"Aggregate\",\n insert: () => (withInitial ? { ...node, initial: 0 } : { ...node }),\n parameters: [\n { description: \"Array pointer to iterate\", name: \"target\" },\n { description: \"Per-item expression ($map/item, $map/index)\", name: \"value\" },\n ...(withInitial\n ? [{ description: \"Initial accumulator ($reduce/acc)\", name: \"initial\" }]\n : []),\n ],\n };\n}\n\nconst OPERATOR_META: Record<string, OperatorMeta> = {\n \"!\": {\n description: \"Logical NOT operator (ECMA `!`): coerces the operand to boolean and negates it.\",\n group: \"Unary\",\n insert: () => ({ operator: \"!\", target: null }),\n parameters: [{ description: \"Operand to negate\", name: \"target\" }],\n },\n \"!==\": binaryMeta(\n \"Comparison\",\n \"!==\",\n \"Strict inequality operator (ECMA `!==`): true when the operands differ without coercion.\",\n ),\n \"%\": binaryMeta(\n \"Arithmetic\",\n \"%\",\n \"Remainder operator (ECMA `%`): remainder of dividing the left operand by the right.\",\n ),\n \"&&\": binaryMeta(\n \"Logical\",\n \"&&\",\n \"Logical AND operator (ECMA `&&`): yields the right operand when the left is truthy.\",\n ),\n \"*\": binaryMeta(\n \"Arithmetic\",\n \"*\",\n \"Multiplication operator (ECMA `*`): numeric product of the operands.\",\n ),\n \"*=\": assignMeta(\"*=\", \"Multiplication\"),\n \"+\": binaryMeta(\n \"Arithmetic\",\n \"+\",\n \"Addition operator (ECMA `+`): numeric addition, or string concatenation.\",\n ),\n \"+=\": assignMeta(\"+=\", \"Addition\"),\n \"-\": binaryMeta(\n \"Arithmetic\",\n \"-\",\n \"Subtraction operator (ECMA `-`); with no value operand it is unary negation.\",\n ),\n \"-=\": assignMeta(\"-=\", \"Subtraction\"),\n \"/\": binaryMeta(\"Arithmetic\", \"/\", \"Division operator (ECMA `/`): quotient of the operands.\"),\n \"/=\": assignMeta(\"/=\", \"Division\"),\n \"<\": binaryMeta(\n \"Comparison\",\n \"<\",\n \"Less-than operator (ECMA `<`): relational comparison of the operands.\",\n ),\n \"<=\": binaryMeta(\n \"Comparison\",\n \"<=\",\n \"Less-than-or-equal operator (ECMA `<=`): relational comparison of the operands.\",\n ),\n \"=\": assignMeta(\"=\", \"Simple\"),\n \"===\": binaryMeta(\n \"Comparison\",\n \"===\",\n \"Strict equality operator (ECMA `===`): true when the operands are equal without coercion.\",\n ),\n \">\": binaryMeta(\n \"Comparison\",\n \">\",\n \"Greater-than operator (ECMA `>`): relational comparison of the operands.\",\n ),\n \">=\": binaryMeta(\n \"Comparison\",\n \">=\",\n \"Greater-than-or-equal operator (ECMA `>=`): relational comparison of the operands.\",\n ),\n \"??\": binaryMeta(\n \"Logical\",\n \"??\",\n \"Nullish coalescing operator (ECMA `??`): yields the right operand when the left is null or undefined.\",\n ),\n \"?:\": {\n description:\n \"Conditional operator (ECMA `?:`): evaluates the test in target, yielding value when truthy, initial otherwise.\",\n group: \"Conditional\",\n insert: () => ({ initial: null, operator: \"?:\", target: null, value: null }),\n parameters: [\n { description: \"Test condition\", name: \"target\" },\n { description: \"Result when the test is truthy\", name: \"value\" },\n { description: \"Result when the test is falsy\", name: \"initial\" },\n ],\n },\n \"||\": binaryMeta(\n \"Logical\",\n \"||\",\n \"Logical OR operator (ECMA `||`): yields the right operand when the left is falsy.\",\n ),\n call: {\n description:\n \"Function.prototype.call (ECMA): invokes a named formula (#/state/…) or blessed pure global (window#/…) with positional arguments.\",\n group: \"Function\",\n insert: () => ({ operator: \"call\", target: { $ref: \"\" }, value: [] }),\n parameters: [\n { description: \"Callee pointer: #/state/<formula> or window#/<global>\", name: \"target\" },\n { description: \"Positional argument list\", name: \"value\" },\n ],\n },\n filter: aggregateMeta(\n \"filter\",\n \"Array.prototype.filter (ECMA): keeps elements whose per-item expression is truthy.\",\n false,\n ),\n map: aggregateMeta(\n \"map\",\n \"Array.prototype.map (ECMA): transforms each element via the per-item expression.\",\n false,\n ),\n pop: arrayMeta(\n \"pop\",\n \"Array.prototype.pop (ECMA): removes and returns the last element of the target array.\",\n false,\n ),\n push: arrayMeta(\n \"push\",\n \"Array.prototype.push (ECMA): appends the value to the target array.\",\n true,\n ),\n reduce: aggregateMeta(\n \"reduce\",\n \"Array.prototype.reduce (ECMA): folds the array into an accumulator via the per-item expression.\",\n true,\n ),\n shift: arrayMeta(\n \"shift\",\n \"Array.prototype.shift (ECMA): removes and returns the first element of the target array.\",\n false,\n ),\n splice: {\n description:\n \"Array.prototype.splice (ECMA): removes and/or inserts elements at an index of the target array.\",\n group: \"Array methods\",\n insert: () => ({ operator: \"splice\", target: { $ref: \"\" }, value: [null] }),\n parameters: [\n REF_TARGET,\n { description: \"Arguments: start, deleteCount, items…\", name: \"value\" },\n ],\n },\n switch: {\n description:\n \"Switch selection (ECMA `switch` semantics): matches the target's string form against case keys, falling back to default.\",\n group: \"Conditional\",\n insert: () => ({ cases: {}, default: null, operator: \"switch\", target: null }),\n parameters: [\n { description: \"Discriminant value\", name: \"target\" },\n { description: \"Matched value → result operand map\", name: \"cases\" },\n { description: \"Result when no case matches\", name: \"default\" },\n ],\n },\n unshift: arrayMeta(\n \"unshift\",\n \"Array.prototype.unshift (ECMA): prepends the value to the target array.\",\n true,\n ),\n};\n\n/** Catalog entries for every blessed operator, in `BLESSED_OPERATORS` iteration order. */\nexport function operatorEntries(): FormulaCatalogEntry[] {\n const out: FormulaCatalogEntry[] = [];\n for (const op of BLESSED_OPERATORS) {\n // Own-property lookup only: a bare index would resolve inherited Object.prototype members for\n // Ops like \"toLocaleString\", yielding a bogus meta whose undefined group/description breaks\n // The palette's substring filter.\n const meta = Object.hasOwn(OPERATOR_META, op) ? OPERATOR_META[op] : undefined;\n if (meta) {\n out.push({\n description: meta.description,\n group: meta.group,\n insert: meta.insert,\n kind: \"operator\",\n label: op,\n name: op,\n parameters: meta.parameters,\n });\n } else if (PURE_METHOD_OPS.has(op)) {\n out.push(pureMethodEntry(op));\n }\n }\n return out;\n}\n\n// ─── Pure standard-library methods (derived, spec §19.4d) ───────────────────\n\n/** Prototype owner per pure method — drives grouping and the derived description. */\nconst PURE_METHOD_PROTO: Record<string, string> = {\n at: \"Array/String\",\n charAt: \"String\",\n concat: \"Array/String\",\n endsWith: \"String\",\n flat: \"Array\",\n includes: \"Array/String\",\n indexOf: \"Array/String\",\n join: \"Array\",\n lastIndexOf: \"Array/String\",\n normalize: \"String\",\n padEnd: \"String\",\n padStart: \"String\",\n repeat: \"String\",\n replaceAll: \"String\",\n slice: \"Array/String\",\n split: \"String\",\n startsWith: \"String\",\n toFixed: \"Number\",\n toLocaleLowerCase: \"String\",\n toLocaleString: \"Number\",\n toLocaleUpperCase: \"String\",\n toLowerCase: \"String\",\n toPrecision: \"Number\",\n toReversed: \"Array\",\n toSorted: \"Array\",\n toSpliced: \"Array\",\n toUpperCase: \"String\",\n trim: \"String\",\n trimEnd: \"String\",\n trimStart: \"String\",\n with: \"Array\",\n};\n\n/** Methods that take no argument — their insert seed omits `value`. */\nexport const ZERO_ARG_METHODS = new Set([\n \"flat\",\n \"normalize\",\n \"toLocaleLowerCase\",\n \"toLocaleString\",\n \"toLocaleUpperCase\",\n \"toLowerCase\",\n \"toReversed\",\n \"toSorted\",\n \"toUpperCase\",\n \"trim\",\n \"trimEnd\",\n \"trimStart\",\n]);\n\n/** The derived catalog entry for one pure method operator (spec §19.4d). */\nfunction pureMethodEntry(op: string): FormulaCatalogEntry {\n const proto = PURE_METHOD_PROTO[op] ?? \"Standard library\";\n return {\n description: `${proto}.prototype.${op} (ECMA) — pure: never mutates the receiver. Receiver in target; argument (or argument list) in value.`,\n group: `${proto} methods`,\n insert: () =>\n ZERO_ARG_METHODS.has(op)\n ? { operator: op, target: { $ref: \"\" } }\n : { operator: op, target: { $ref: \"\" }, value: null },\n kind: \"operator\",\n label: op,\n name: op,\n parameters: [],\n };\n}\n\n// ─── Blessed globals (derived) ──────────────────────────────────────────────\n\n/**\n * Synthetic blessed helpers wrap constructor-shaped standard-library APIs (spec §19.4c); their\n * catalog descriptions name the wrapped API rather than claiming a literal global exists.\n */\nconst HELPER_DESCRIPTIONS: Record<string, string> = {\n \"Intl/formatDate\":\n \"Intl.formatDate(value, locale?, options?) — blessed helper wrapping new Intl.DateTimeFormat(locale, options).format(new Date(value)).\",\n \"Intl/formatNumber\":\n \"Intl.formatNumber(value, locale?, options?) — blessed helper wrapping new Intl.NumberFormat(locale, options).format(value).\",\n \"Intl/formatRelativeTime\":\n \"Intl.formatRelativeTime(value, unit, locale?, options?) — blessed helper wrapping new Intl.RelativeTimeFormat(locale, options).format(value, unit).\",\n};\n\n/** Catalog entries derived from `BLESSED_GLOBALS`; grouped by namespace (bare → globalThis). */\nexport function globalEntries(): FormulaCatalogEntry[] {\n const out: FormulaCatalogEntry[] = [];\n for (const name of BLESSED_GLOBALS) {\n const slash = name.indexOf(\"/\");\n const group = slash === -1 ? \"globalThis\" : name.slice(0, slash);\n const label = name.replaceAll(\"/\", \".\");\n out.push({\n description:\n HELPER_DESCRIPTIONS[name] ??\n `${label} — blessed pure global from the ECMAScript standard library, invoked via the call operator (window#/${name}).`,\n group,\n insert: () => ({ operator: \"call\", target: { $ref: `window#/${name}` }, value: [] }),\n kind: \"global\",\n label,\n name,\n parameters: [],\n });\n }\n return out;\n}\n\n// ─── Named formulas (derived from document state) ───────────────────────────\n\n/** Normalize a `(string | CemParameter)` parameter declaration to display metadata. */\nfunction toParameterInfo(p: string | CemParameter): FormulaParameterInfo | null {\n if (typeof p === \"string\") {\n return p ? { name: p } : null;\n }\n if (!isJsonObject(p) || typeof p.name !== \"string\" || !p.name) {\n return null;\n }\n const info: FormulaParameterInfo = { name: p.name };\n const { type } = p;\n if (typeof type === \"string\") {\n info.type = type;\n } else if (isJsonObject(type)) {\n if (typeof type.text === \"string\") {\n info.type = type.text;\n } else if (typeof type.type === \"string\") {\n info.type = type.type;\n }\n }\n if (typeof p.description === \"string\") {\n info.description = p.description;\n }\n if (\"default\" in p && p.default !== undefined) {\n info.default = p.default as JsonValue;\n }\n return info;\n}\n\n/** Catalog entries for the document's named formulas (parameterized `$expression` entries). */\nexport function namedFormulaEntries(\n state?: Record<string, JxStateDefinition> | null,\n): FormulaCatalogEntry[] {\n const out: FormulaCatalogEntry[] = [];\n for (const [key, def] of Object.entries(state ?? {})) {\n if (!isNamedFormulaDef(def)) {\n continue;\n }\n const parameters = (def.parameters as (string | CemParameter)[])\n .map((p) => toParameterInfo(p))\n .filter((p): p is FormulaParameterInfo => p !== null);\n const description =\n typeof def.description === \"string\" && def.description\n ? def.description\n : typeof def.$title === \"string\" && def.$title\n ? def.$title\n : `Named formula \"${key}\" from document state.`;\n out.push({\n description,\n group: \"Formulas\",\n insert: () => ({\n operator: \"call\",\n target: { $ref: `#/state/${key}` },\n value: parameters.map((p) => (p.default ?? null) as JxExpressionOperand),\n }),\n kind: \"formula\",\n label: key,\n name: key,\n parameters,\n });\n }\n return out;\n}\n\n// ─── Merged registry ────────────────────────────────────────────────────────\n\n// ─── Packaged formulas (@jxsuite/formulas, copy-in) ─────────────────────────\n\n/**\n * Catalog entries for the packaged composite formulas. Picking one vendors its JSON state entry\n * into the document via `ensure` and inserts a call node — projects stay self-contained; entries\n * already present in state are skipped (the named-formula entry represents them instead).\n */\nexport function packagedFormulaEntries(\n state?: Record<string, JxStateDefinition> | null,\n): FormulaCatalogEntry[] {\n const out: FormulaCatalogEntry[] = [];\n for (const formula of packagedCatalog) {\n if (state?.[formula.name]) {\n continue;\n }\n const parameters = formula.parameters\n .map((p) => toParameterInfo(p))\n .filter((p): p is FormulaParameterInfo => p !== null);\n out.push({\n description: formula.description,\n ensure: {\n def: {\n $description: formula.description,\n $expression: formula.expression,\n parameters: formula.parameters,\n },\n name: formula.name,\n },\n group: \"Formulas library\",\n insert: () => ({\n operator: \"call\",\n target: { $ref: `#/state/${formula.name}` },\n value: parameters.map((p) => (p.default ?? null) as JxExpressionOperand),\n }),\n kind: \"formula\",\n label: formula.name,\n name: formula.name,\n parameters,\n });\n }\n return out;\n}\n\n/** The full catalog: named formulas first (most specific), then packaged, operators, globals. */\nexport function formulaCatalog(\n state?: Record<string, JxStateDefinition> | null,\n): FormulaCatalogEntry[] {\n return [\n ...namedFormulaEntries(state),\n ...packagedFormulaEntries(state),\n ...operatorEntries(),\n ...globalEntries(),\n ];\n}\n\n/** Resolve a `call` callee pointer to its catalog entry, when resolvable. */\nexport function calleeEntry(\n ref: string,\n state?: Record<string, JxStateDefinition> | null,\n): FormulaCatalogEntry | undefined {\n if (ref.startsWith(\"window#/\")) {\n const name = ref.slice(\"window#/\".length);\n return globalEntries().find((e) => e.name === name);\n }\n if (ref.startsWith(\"#/state/\")) {\n const key = ref.slice(\"#/state/\".length);\n return namedFormulaEntries(state).find((e) => e.name === key);\n }\n return undefined;\n}\n",
10
+ "/// <reference lib=\"dom\" />\n/**\n * Formula palette — a command-palette overlay for browsing/searching the formula catalog (spec\n * §19.9). Clones the quick-search pattern: a plain overlay div (no nested sp-overlay), a search\n * field, grouped results, and keyboard navigation. Picking an entry calls `onPick` with it; the\n * caller decides what to insert.\n */\n\nimport { html, render as litRender, nothing } from \"lit-html\";\nimport { classMap } from \"lit-html/directives/class-map.js\";\nimport { live } from \"lit-html/directives/live.js\";\nimport { ref } from \"lit-html/directives/ref.js\";\nimport { getLayerSlot } from \"./layers\";\nimport { rectOf } from \"../utils/geometry\";\n\nimport type { FormulaCatalogEntry } from \"./formula-catalog\";\n\nexport interface FormulaPaletteOpts {\n entries: FormulaCatalogEntry[];\n onPick: (entry: FormulaCatalogEntry) => void;\n /** Optional anchor element the panel is positioned under; centered when absent. */\n anchor?: HTMLElement | null;\n}\n\nlet _open = false;\nlet _opts: FormulaPaletteOpts | null = null;\nlet _query = \"\";\nlet _selectedIndex = 0;\n\nfunction getContainer() {\n return getLayerSlot(\"popover\", \"formula-palette\");\n}\n\nexport function openFormulaPalette(opts: FormulaPaletteOpts) {\n _open = true;\n _opts = opts;\n _query = \"\";\n _selectedIndex = 0;\n renderOverlay();\n}\n\nexport function closeFormulaPalette() {\n _open = false;\n _opts = null;\n renderOverlay();\n}\n\n/** Entries matching the current query (label, name, group, or description substring). */\nfunction filteredEntries(): FormulaCatalogEntry[] {\n const entries = _opts?.entries ?? [];\n const needle = _query.trim().toLowerCase();\n if (!needle) {\n return entries;\n }\n return entries.filter(\n (e) =>\n e.label.toLowerCase().includes(needle) ||\n e.name.toLowerCase().includes(needle) ||\n e.group.toLowerCase().includes(needle) ||\n e.description.toLowerCase().includes(needle),\n );\n}\n\n/** Group entries for display, preserving first-seen group order. */\nfunction groupedEntries(entries: FormulaCatalogEntry[]): [string, FormulaCatalogEntry[]][] {\n const groups = new Map<string, FormulaCatalogEntry[]>();\n for (const entry of entries) {\n const bucket = groups.get(entry.group);\n if (bucket) {\n bucket.push(entry);\n } else {\n groups.set(entry.group, [entry]);\n }\n }\n return [...groups.entries()];\n}\n\nfunction pickEntry(entry: FormulaCatalogEntry) {\n const opts = _opts;\n closeFormulaPalette();\n opts?.onPick(entry);\n}\n\nfunction onInput(e: Event) {\n _query = (e.target as HTMLInputElement).value;\n _selectedIndex = 0;\n renderOverlay();\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n const entries = filteredEntries();\n switch (e.key) {\n case \"ArrowDown\": {\n e.preventDefault();\n _selectedIndex = Math.min(_selectedIndex + 1, entries.length - 1);\n renderOverlay();\n break;\n }\n case \"ArrowUp\": {\n e.preventDefault();\n _selectedIndex = Math.max(_selectedIndex - 1, 0);\n renderOverlay();\n break;\n }\n case \"Enter\": {\n e.preventDefault();\n if (entries[_selectedIndex]) {\n pickEntry(entries[_selectedIndex]!);\n }\n break;\n }\n case \"Escape\": {\n e.preventDefault();\n closeFormulaPalette();\n break;\n }\n default: {\n break;\n }\n }\n}\n\n/** Inline position style for the panel when anchored to an element. */\nfunction panelStyle(): string {\n const anchor = _opts?.anchor;\n if (!anchor) {\n return \"\";\n }\n const rect = rectOf(anchor);\n if (!rect || (rect.top === 0 && rect.left === 0 && rect.width === 0)) {\n return \"\";\n }\n const left = Math.max(8, Math.min(rect.left, (globalThis.innerWidth || 1200) - 568));\n return `position:fixed;left:${left}px;top:${rect.bottom + 4}px;margin:0`;\n}\n\nfunction renderOverlay() {\n const container = getContainer();\n if (!_open) {\n litRender(nothing, container);\n return;\n }\n\n const entries = filteredEntries();\n const groups = groupedEntries(entries);\n const hasQuery = _query.trim().length > 0;\n\n const tpl = html`\n <div class=\"quick-search-overlay formula-palette-overlay\" @click=${closeFormulaPalette}>\n <div\n class=\"quick-search-panel formula-palette\"\n style=${panelStyle()}\n @click=${(e: Event) => e.stopPropagation()}\n >\n <input\n class=\"quick-search-input formula-palette-input\"\n type=\"text\"\n placeholder=\"Search formulas, operators, globals…\"\n .value=${live(_query)}\n @input=${onInput}\n @keydown=${onKeydown}\n ${ref((el) => {\n if (el) {\n requestAnimationFrame(() => (el as HTMLInputElement).focus());\n }\n })}\n />\n <div class=\"quick-search-results\">\n ${\n entries.length === 0\n ? html`<div class=\"quick-search-empty\">\n ${hasQuery ? \"No results\" : \"No entries available\"}\n </div>`\n : nothing\n }\n ${groups.map(\n ([group, groupEntries]) => html`\n <div class=\"quick-search-section-label\">${group}</div>\n ${groupEntries.map((entry) => {\n const index = entries.indexOf(entry);\n return html`\n <div\n class=${classMap({\n \"quick-search-item\": true,\n selected: index === _selectedIndex,\n })}\n @click=${() => pickEntry(entry)}\n @mouseenter=${() => {\n _selectedIndex = index;\n renderOverlay();\n }}\n >\n <span\n class=\"quick-search-name\"\n style=\"font-family:var(--spectrum-code-font-family, monospace)\"\n >${entry.label}</span\n >\n <span class=\"quick-search-path\" title=${entry.description}\n >${entry.description}</span\n >\n <span class=\"quick-search-badge\">${entry.kind}</span>\n </div>\n `;\n })}\n `,\n )}\n </div>\n </div>\n </div>\n `;\n\n litRender(tpl, container);\n}\n",
11
+ "/**\n * A tag name chosen at element creation, from a set the schema can enumerate.\n *\n * The motivating case is one element that must be an `<a>` when a prop is set and a `<div>` when it\n * is not, wrapping an identical subtree either way. Before this def there were two answers and both\n * were bad: write `\"${state.href ? 'a' : 'div'}\"`, which nothing in the pipeline evaluates and each\n * consumer then broke differently and silently (see {@link tagNameSchema}); or reach for a\n * `$switch` CHILD, whose cases render in place of the container's content — so varying the wrapper\n * means duplicating the whole subtree once per case, and still leaves the container `<div>` wrapped\n * around the result.\n *\n * **The results are `TagName`s, not operands.** That is the property everything else here depends\n * on. The discriminant in `target` may be any expression, but every branch's RESULT is a literal\n * tag held to the same pattern a written-out tag is held to — so the candidate set is readable\n * straight out of the JSON without evaluating anything. The compiler can emit one template per\n * candidate, `jx validate` can refuse `\"A LINK\"` at authoring time, and the void-element,\n * preformatted, `img` and slot analyses that read a tag structurally keep a finite set to reason\n * about. A `${…}` template in this position would have surrendered all of that.\n *\n * **Vocabulary, not new keywords.** `$expression`, `?:` (test in `target`, consequent in `value`,\n * alternate in `initial`) and `switch` (discriminant in `target`, results in `cases`/`default`) all\n * already mean exactly this — see `expression-node.schema.ts` and spec §19.4b. The alternative\n * considered was `$switch`/`cases` inside the tagName block, which would have been a THIRD switch\n * syntax in a language that has two, and would have made `cases` a homograph inside one element\n * object: tag strings in `tagName`, child subtrees three lines below.\n *\n * **`default`/`initial` are REQUIRED here.** The expression-level `switch` leaves `default`\n * optional and yields `undefined` when nothing matches; an element with no tag is not a thing that\n * can exist, so the fallback is mandatory rather than a shape the runtime has to invent a rule\n * for.\n *\n * **Evaluated ONCE, when the element is created, and never re-read.** This is the one place a\n * `$expression` is not live, and it is deliberate: a tag that changed after mount would mean\n * replacing the node, which costs the subtree's listeners, its focus, its typed input values and\n * its component instances — and the runtime has no dispose walk to pay that bill with. `jx\n * validate` warns when a tag discriminant is also an assignment target anywhere in the document, so\n * the one case where the rule bites is caught at authoring time rather than discovered as a `<div>`\n * that never became an `<a>`.\n */\nexport const tagExpressionSchema = {\n anyOf: [\n {\n additionalProperties: false,\n description:\n \"Two-way: `target` is the test, `value` the tag when it is truthy, `initial` the tag when it is not.\",\n properties: {\n initial: { $ref: \"#/$defs/TagName\" },\n operator: { const: \"?:\", type: \"string\" },\n target: { $ref: \"#/$defs/ExpressionOperand\" },\n value: { $ref: \"#/$defs/TagName\" },\n },\n required: [\"operator\", \"target\", \"value\", \"initial\"],\n title: \"?: — the tag when the test holds, and the tag when it does not\",\n },\n {\n additionalProperties: false,\n description:\n \"Multiway: `target` is the discriminant, matched against case keys by its string form. \" +\n \"`default` is required — an element with no tag cannot exist.\",\n properties: {\n cases: {\n additionalProperties: { $ref: \"#/$defs/TagName\" },\n type: \"object\",\n },\n default: { $ref: \"#/$defs/TagName\" },\n operator: { const: \"switch\", type: \"string\" },\n target: { $ref: \"#/$defs/ExpressionOperand\" },\n },\n required: [\"operator\", \"target\", \"cases\", \"default\"],\n title: \"switch — one tag per discriminant value, with a required fallback\",\n },\n ],\n description:\n \"A tag name chosen at element creation. Every branch resolves to a `TagName`, so the candidate \" +\n \"set is enumerable without evaluating anything.\",\n} as const;\n\n/**\n * What an ELEMENT's `tagName` may be: a name, or a {@link tagExpressionSchema} choosing between\n * names.\n *\n * Wired into `ElementDef.tagName` alone. The document ROOT and `SwitchNode`'s container keep the\n * bare `TagName`, so `customElements.define`, the compiler's module emit and the output filenames\n * derived from the root tag all keep receiving a string — a guarantee that lives in the type rather\n * than in a positional branch someone can forget. `HeadEntry` declares its own `tagName` and never\n * referenced the shared def, so a head tag is static for free.\n */\nexport const elementTagNameSchema = {\n anyOf: [\n { $ref: \"#/$defs/TagName\" },\n {\n additionalProperties: false,\n properties: { $expression: { $ref: \"#/$defs/TagExpression\" } },\n required: [\"$expression\"],\n type: \"object\",\n },\n ],\n} as const;\n",
12
+ "export const tagNameSchema = {\n description:\n \"HTML element tag name or custom element name (must contain a hyphen per Web Components spec). \" +\n \"A NAME, never an expression: no `${…}` position in the pipeline evaluates a tagName. Use \" +\n \"`$switch`/`cases` to vary the element.\",\n minLength: 1,\n /* THE PATTERN IS THE WHOLE POINT. Without it `\"\\${state.href ? 'a' : 'div'}\"` validates, and every\n consumer downstream then does something different and silent with it: the runtime hands it to\n `document.createElement` and throws `InvalidCharacterError`; the compiler splices it into a lit\n template as a binding in tag position, which lit cannot do; and the static renderer emits it into\n the prerendered HTML and re-resolves that string against the PAGE scope, where the component's\n own `state` is undefined — so a built site silently collapses to the fallback branch's tag with\n the other branch's attributes. Found by driving Studio against a real site whose component did\n exactly this. Every tagName in packages/, extensions/, sites/, examples/ and docs/ already\n conforms, so the pattern only rejects what was already broken. */\n pattern: \"^[a-zA-Z][a-zA-Z0-9._-]*$\",\n type: \"string\",\n} as const;\n",
13
+ "export const stringOrRefSchema = {\n oneOf: [{ type: \"string\" }, { $ref: \"#/$defs/RefObject\" }],\n} as const;\n\nexport const boolOrRefSchema = {\n oneOf: [{ type: \"boolean\" }, { $ref: \"#/$defs/RefObject\" }],\n} as const;\n\nexport const numberOrRefSchema = {\n oneOf: [{ type: \"number\" }, { $ref: \"#/$defs/RefObject\" }],\n} as const;\n",
14
+ "export const headEntrySchema = {\n additionalProperties: true,\n description: \"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.\",\n properties: {\n attributes: {\n additionalProperties: {\n oneOf: [{ type: \"string\" }, { type: \"boolean\" }],\n },\n type: \"object\",\n },\n children: { items: { $ref: \"#/$defs/HeadEntry\" }, type: \"array\" },\n tagName: { type: \"string\" },\n textContent: {\n description:\n \"Element content. An object is serialized to JSON inside the tag — that is how a \" +\n 'JSON-LD block (`<script type=\"application/ld+json\">`) is authored.',\n oneOf: [{ type: \"string\" }, { type: \"object\" }],\n },\n },\n required: [\"tagName\"],\n type: \"object\",\n} as const;\n",
15
+ "export const cemParameterSchema = {\n description:\n \"A CEM-compatible parameter definition for a function. \" +\n \"Follows the Custom Elements Manifest Parameter shape.\",\n properties: {\n default: { description: \"Default value for the parameter.\" },\n description: { description: \"Parameter documentation.\", type: \"string\" },\n name: { description: \"Parameter name.\", type: \"string\" },\n optional: { description: \"Whether the parameter is optional.\", type: \"boolean\" },\n type: { description: \"Parameter type (JSON Schema or CEM { text } format).\" },\n },\n required: [\"name\"],\n type: \"object\",\n} as const;\n\nexport const cemEventSchema = {\n description:\n \"A CEM-compatible event definition. Describes a CustomEvent the function dispatches.\",\n properties: {\n deprecated: {\n description: \"Deprecation notice.\",\n oneOf: [{ type: \"boolean\" }, { type: \"string\" }],\n },\n description: { description: \"Event documentation.\", type: \"string\" },\n name: { description: \"Event name (e.g. 'task-toggled').\", type: \"string\" },\n type: { description: \"Event type (e.g. { text: 'CustomEvent' }).\" },\n },\n required: [\"name\"],\n type: \"object\",\n} as const;\n",
16
+ "export const imageConfigSchema = {\n description: \"Image optimization configuration for the project.\",\n properties: {\n formats: { items: { type: \"string\" }, type: \"array\" },\n lazyLoad: { type: \"boolean\" },\n optimize: { type: \"boolean\" },\n picture: {\n description:\n \"Wrap a multi-format image in a <picture> with one <source> per format (default true). \" +\n \"With it off the <img> carries a srcset in the preferred format alone, which browsers \" +\n \"that cannot decode that format will still select from.\",\n type: \"boolean\",\n },\n quality: {\n properties: {\n avif: { type: \"number\" },\n jpeg: { type: \"number\" },\n png: { type: \"number\" },\n webp: { type: \"number\" },\n },\n type: \"object\",\n },\n remoteDomains: {\n description:\n \"Hostnames whose remote (https) images are optimized through /cdn-cgi/image transform \" +\n 'URLs (cloudflare service only), e.g. [\"drive.usercontent.google.com\"]. Remote sources ' +\n \"from other hosts are left untouched.\",\n items: { type: \"string\" },\n type: \"array\",\n },\n service: {\n description:\n 'How images are optimized: \"build\" runs Sharp at build time; \"cloudflare\" emits ' +\n \"/cdn-cgi/image transform URLs served by Cloudflare Image Transformations (requires \" +\n \"the feature to be enabled on the serving zone).\",\n enum: [\"build\", \"cloudflare\"],\n type: \"string\",\n },\n sizes: { type: \"string\" },\n widths: { items: { type: \"number\" }, type: \"array\" },\n },\n type: \"object\",\n} as const;\n",
17
+ "export const internalRefSchema = {\n description: \"Reference to a $defs type definition in the current component.\",\n examples: [\"#/$defs/Count\", \"#/$defs/TodoItem\", \"#/$defs/Status\"],\n pattern: \"^#/\\\\$defs/\",\n type: \"string\",\n} as const;\n\nexport const stateRefSchema = {\n description: \"Reference to a state entry (runtime variable) in the current component.\",\n examples: [\"#/state/count\", \"#/state/addTask\", \"#/state/items\"],\n pattern: \"^#/state/\",\n type: \"string\",\n} as const;\n\nexport const externalRefSchema = {\n description: \"Reference to an external Jx component file.\",\n examples: [\"./card.json\", \"https://cdn.example.com/button.json\"],\n pattern: \"^(\\\\./|\\\\.\\\\./).*\\\\.json$|^https?://\",\n type: \"string\",\n} as const;\n\nexport const globalRefSchema = {\n description: \"Reference to a window or document global.\",\n examples: [\"window#/currentUser\", \"document#/appConfig\"],\n pattern: \"^(window|document)#/\",\n type: \"string\",\n} as const;\n\nexport const parentRefSchema = {\n description: \"Reference to a named state entry passed via $props from a parent component.\",\n examples: [\"parent#/sharedState\", \"parent#/theme\"],\n pattern: \"^parent#/\",\n type: \"string\",\n} as const;\n\nexport const mapRefSchema = {\n description: \"Reference to the current Array map iteration context.\",\n examples: [\"$map/item\", \"$map/index\", \"$map/item/text\", \"$map/item/done\"],\n pattern: \"^\\\\$map/(item|index)(/.*)?$\",\n type: \"string\",\n} as const;\n\nexport const anyRefSchema = {\n oneOf: [\n { $ref: \"#/$defs/InternalRef\" },\n { $ref: \"#/$defs/StateRef\" },\n { $ref: \"#/$defs/ExternalRef\" },\n { $ref: \"#/$defs/GlobalRef\" },\n { $ref: \"#/$defs/ParentRef\" },\n { $ref: \"#/$defs/MapRef\" },\n ],\n type: \"string\",\n} as const;\n\nexport const refObjectSchema = {\n additionalProperties: false,\n description: \"A $ref binding. Resolves to a state entry (reactive) or plain value (static).\",\n properties: { $ref: { $ref: \"#/$defs/AnyRef\" } },\n required: [\"$ref\"],\n type: \"object\",\n} as const;\n\nexport const externalComponentRefSchema = {\n properties: {\n $props: { $ref: \"#/$defs/PropsObject\" },\n $ref: { $ref: \"#/$defs/ExternalRef\" },\n },\n required: [\"$ref\"],\n type: \"object\",\n} as const;\n",
18
+ "export const styleObjectSchema = {\n additionalProperties: {\n oneOf: [{ type: \"string\" }, { type: \"number\" }, { $ref: \"#/$defs/StyleObject\" }],\n },\n description:\n \"CSS style definition. camelCase property names follow CSSOM convention. \" +\n \"Keys starting with :, ., &, or [ are treated as nested CSS selectors. \" +\n \"Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. \" +\n \"Nesting is recursive: selector and at-rule groups may nest to arbitrary depth \" +\n \"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission.\",\n properties: {},\n type: \"object\",\n} as const;\n",
19
+ "export const arrayNamespaceSchema = {\n additionalProperties: false,\n description: \"Dynamic mapped list. Re-renders when the items state entry changes.\",\n properties: {\n $prototype: { const: \"Array\", type: \"string\" },\n filter: { $ref: \"#/$defs/RefObject\" },\n items: {\n oneOf: [{ $ref: \"#/$defs/RefObject\" }, { type: \"array\" }],\n },\n map: { $ref: \"#/$defs/ElementDef\" },\n sort: { $ref: \"#/$defs/RefObject\" },\n },\n required: [\"$prototype\", \"items\", \"map\"],\n type: \"object\",\n} as const;\n\nexport const childrenValueSchema = {\n description:\n \"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed \" +\n \"freely. A bare Array namespace (the whole children slot is one dynamic list) is also \" +\n \"accepted for backward compatibility, as is a ${…} template string that resolves at build \" +\n \"time to an array of child definitions.\",\n oneOf: [\n {\n items: {\n /* `anyOf`, not `oneOf`, and SwitchNode is the reason for both halves of that.\n `$defs.SwitchNode` was defined and referenced from nowhere — a node the compiler fully\n renders (`shared.ts` renderSwitch) that no position in the schema admitted, so every\n document with a `$switch` child failed `jx validate`. Adding the ref under `oneOf` would\n have traded one break for another: a switch child that also carries `tagName` (its\n container element) matches ElementDef AND SwitchNode, and \"exactly one\" then rejects the\n form that works today. `anyOf` accepts both, and still rejects a child object that is\n neither. */\n anyOf: [\n { $ref: \"#/$defs/ElementDef\" },\n { $ref: \"#/$defs/SwitchNode\" },\n { $ref: \"#/$defs/ArrayNamespace\" },\n { type: \"string\" },\n { type: \"number\" },\n ],\n },\n type: \"array\",\n },\n { $ref: \"#/$defs/ArrayNamespace\" },\n {\n description:\n \"Computed children — a ${…} template that resolves at build time to an array of child \" +\n 'definitions (e.g. \"${state.entry.$children}\" for parsed content). A bare plain-text ' +\n \"string is NOT a valid children value; text children must be array items.\",\n pattern: \"\\\\$\\\\{\",\n type: \"string\",\n },\n ],\n} as const;\n",
20
+ "export const attributesObjectSchema = {\n additionalProperties: {\n oneOf: [\n { type: \"string\" },\n { type: \"number\" },\n { type: \"boolean\" },\n { $ref: \"#/$defs/RefObject\" },\n ],\n },\n description: \"HTML attributes and ARIA attributes set via element.setAttribute().\",\n type: \"object\",\n} as const;\n\nexport const propsObjectSchema = {\n // AnyOf, not oneOf: a RefObject value legitimately matches both the plain-object branch and\n // The RefObject branch, and exclusive matching would reject every $ref-bound prop.\n additionalProperties: {\n anyOf: [\n { type: \"string\" },\n { type: \"number\" },\n { type: \"boolean\" },\n { type: \"array\" },\n { type: \"object\" },\n { $ref: \"#/$defs/RefObject\" },\n ],\n },\n description: \"Explicit prop passing at a component boundary.\",\n type: \"object\",\n} as const;\n\nexport const elementPropertyValueSchema = {\n oneOf: [\n { type: \"string\" },\n { type: \"number\" },\n { type: \"boolean\" },\n { type: \"null\" },\n { $ref: \"#/$defs/RefObject\" },\n ],\n} as const;\n\nexport const switchDefSchema = {\n additionalProperties: false,\n description: \"Reactive $ref that drives which case to render.\",\n // The discriminant is a reactive state path (e.g. \"#/state/currentRoute\") resolved by\n // ResolveRef at render time — not a #/$defs/ type pointer.\n properties: { $ref: { $ref: \"#/$defs/StateRef\" } },\n required: [\"$ref\"],\n type: \"object\",\n} as const;\n\nexport const switchNodeSchema = {\n properties: {\n $switch: { $ref: \"#/$defs/SwitchDef\" },\n cases: {\n additionalProperties: {\n oneOf: [{ $ref: \"#/$defs/ElementDef\" }, { $ref: \"#/$defs/ExternalComponentRef\" }],\n },\n type: \"object\",\n },\n tagName: { $ref: \"#/$defs/TagName\" },\n },\n required: [\"$switch\", \"cases\"],\n type: \"object\",\n} as const;\n\nexport const elementDefSchema = {\n additionalProperties: { $ref: \"#/$defs/ElementPropertyValue\" },\n description: \"A Jx element definition. Maps directly to a DOM element.\",\n properties: {\n \"$map/index\": { $ref: \"#/$defs/RefObject\" },\n \"$map/item\": { $ref: \"#/$defs/RefObject\" },\n $props: { $ref: \"#/$defs/PropsObject\" },\n $ref: { $ref: \"#/$defs/ExternalRef\" },\n $switch: { $ref: \"#/$defs/SwitchDef\" },\n alt: { $ref: \"#/$defs/StringOrRef\" },\n attributes: { $ref: \"#/$defs/AttributesObject\" },\n cases: {\n additionalProperties: {\n oneOf: [{ $ref: \"#/$defs/ElementDef\" }, { $ref: \"#/$defs/ExternalComponentRef\" }],\n },\n description:\n \"Switch cases for this element. Maps case values to element definitions or external \" +\n \"component refs, rendered according to the reactive $switch discriminant.\",\n type: \"object\",\n },\n checked: { $ref: \"#/$defs/BoolOrRef\" },\n children: { $ref: \"#/$defs/ChildrenValue\" },\n className: { $ref: \"#/$defs/StringOrRef\" },\n dir: { enum: [\"ltr\", \"rtl\", \"auto\"], type: \"string\" },\n disabled: { $ref: \"#/$defs/BoolOrRef\" },\n hidden: { $ref: \"#/$defs/BoolOrRef\" },\n href: { $ref: \"#/$defs/StringOrRef\" },\n id: { type: \"string\" },\n innerHTML: { $ref: \"#/$defs/StringOrRef\" },\n innerText: { $ref: \"#/$defs/StringOrRef\" },\n lang: { $ref: \"#/$defs/StringOrRef\" },\n name: { $ref: \"#/$defs/StringOrRef\" },\n placeholder: { $ref: \"#/$defs/StringOrRef\" },\n selected: { $ref: \"#/$defs/BoolOrRef\" },\n src: { $ref: \"#/$defs/StringOrRef\" },\n style: { $ref: \"#/$defs/StyleObject\" },\n tabIndex: { $ref: \"#/$defs/NumberOrRef\" },\n tagName: { $ref: \"#/$defs/ElementTagName\" },\n textContent: { $ref: \"#/$defs/StringOrRef\" },\n title: { $ref: \"#/$defs/StringOrRef\" },\n type: { $ref: \"#/$defs/StringOrRef\" },\n value: { $ref: \"#/$defs/StringOrRef\" },\n },\n required: [\"tagName\"],\n type: \"object\",\n} as const;\n",
21
+ "export const typedStateDefSchema = {\n description:\n \"A typed reactive state variable with explicit type and default value. \" +\n \"The type property is a JSON Schema or $ref to a $defs type definition. \" +\n \"The default property is the initial runtime value.\",\n not: { required: [\"$prototype\"] },\n properties: {\n $ref: { description: \"Reference to a shared type definition.\", type: \"string\" },\n attribute: {\n description: \"Linked HTML attribute name for CEM extraction.\",\n type: \"string\",\n },\n default: { description: \"Initial state value.\" },\n deprecated: {\n description: \"Deprecation notice for CEM extraction.\",\n oneOf: [{ type: \"boolean\" }, { type: \"string\" }],\n },\n description: { type: \"string\" },\n examples: { type: \"array\" },\n reflects: {\n description: \"Whether property changes reflect back to the HTML attribute.\",\n type: \"boolean\",\n },\n type: {\n description: \"JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.\",\n oneOf: [{ type: \"string\" }, { type: \"object\" }],\n },\n },\n required: [\"default\"],\n type: \"object\",\n} as const;\n",
22
+ "export const functionDefSchema = {\n additionalProperties: false,\n description:\n 'A function declaration. $prototype must be \"Function\". ' +\n \"body (inline) and $src (external) are mutually exclusive. \" +\n \"First parameter is always state (the reactive scope).\",\n properties: {\n $export: {\n description: \"Named export in $src module. Defaults to the state key name.\",\n type: \"string\",\n },\n $prototype: { const: \"Function\", type: \"string\" },\n $src: {\n description: \"External module specifier. Mutually exclusive with body.\",\n examples: [\"./counter.js\", \"npm:@myorg/validators\"],\n type: \"string\",\n },\n arguments: {\n description:\n \"Legacy alias for parameters: bare string parameter names (state may be listed \" +\n \"explicitly as the first name). Superseded by parameters.\",\n examples: [[\"state\", \"event\"]],\n items: { type: \"string\" },\n type: \"array\",\n },\n body: {\n description:\n \"Inline function body: an opaque JS source string (first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → JS string.\",\n examples: [\n \"state.count++\",\n 'state.items.push({ id: Date.now(), text: \"\", done: false })',\n 'return state.score >= 90 ? \"gold\" : \"silver\"',\n [\n { operator: \"push\", target: { $ref: \"#/state/cart\" }, value: 1 },\n { dispatchEvent: \"cart-changed\", detail: { $ref: \"#/state/cart\" } },\n ],\n ],\n oneOf: [{ type: \"string\" }, { $ref: \"#/$defs/StatementList\" }],\n },\n description: { type: \"string\" },\n emits: {\n description:\n \"Array of CEM-compatible Event objects this function dispatches. \" +\n \"Used for CEM extraction and studio event discovery.\",\n items: { $ref: \"#/$defs/CemEvent\" },\n type: \"array\",\n },\n name: {\n description: \"Explicit function name. Defaults to the state key name.\",\n type: \"string\",\n },\n parameters: {\n description:\n \"Function parameters (after the implicit state parameter). \" +\n \"Accepts CEM-compatible parameter objects or bare string names for backward compatibility.\",\n examples: [\n [\"event\"],\n [{ name: \"event\", type: { text: \"Event\" } }],\n [{ description: \"Item identifier\", name: \"id\", type: { text: \"number\" } }],\n ],\n items: {\n oneOf: [{ type: \"string\" }, { $ref: \"#/$defs/CemParameter\" }],\n },\n type: \"array\",\n },\n type: {\n description: \"Return type for tooling (JSON Schema or CEM { text } format).\",\n },\n },\n required: [\"$prototype\"],\n type: \"object\",\n} as const;\n",
23
+ "export const BUILT_IN_PROTOTYPES = [\n \"Function\",\n \"Request\",\n \"URLSearchParams\",\n \"FormData\",\n \"LocalStorage\",\n \"SessionStorage\",\n \"Cookie\",\n \"IndexedDB\",\n \"Array\",\n \"Set\",\n \"Map\",\n \"Blob\",\n \"ReadableStream\",\n] as const;\n\nexport const externalClassDefSchema = {\n description:\n 'An external class / data source. $prototype is a constructor name (not \"Function\"). ' +\n \"When $prototype is not in the built-in registry, $src is required. \" +\n \"All state entries are reactive by default.\",\n properties: {\n $export: {\n description: \"Named export in $src module. Defaults to the $prototype value.\",\n type: \"string\",\n },\n $prototype: {\n description: \"Constructor name — built-in Web API class or external class name.\",\n examples: [\n \"Request\",\n \"URLSearchParams\",\n \"FormData\",\n \"LocalStorage\",\n \"SessionStorage\",\n \"Cookie\",\n \"IndexedDB\",\n \"Array\",\n \"Set\",\n \"Map\",\n \"Blob\",\n \"ReadableStream\",\n \"MarkdownCollection\",\n \"MyParser\",\n ],\n not: { const: \"Function\" },\n type: \"string\",\n },\n $src: {\n description: \"External module specifier. Required when $prototype is not a built-in.\",\n examples: [\"@jxsuite/md\", \"./lib/my-parser.js\", \"npm:@myorg/data\"],\n type: \"string\",\n },\n autoIncrement: { type: \"boolean\" },\n body: {},\n database: { type: \"string\" },\n debounce: { minimum: 0, type: \"integer\" },\n default: {},\n description: { type: \"string\" },\n domain: { type: \"string\" },\n /* Widened to mirror `sort` below, because this one grab-bag of properties is shared by EVERY\n state `$prototype` with no discrimination on which prototype is in play. `filter` as a\n reactive `$ref` is what the built-in `Array` prototype wants; `@jxsuite/parser`'s\n ContentCollection and `@jxsuite/connector`'s TableQuery both declare their own `filter` as a\n rule ARRAY, and the core shape silently overrode the class's own declaration — so a document\n using a documented class parameter correctly failed `jx validate` with \"must be object\". */\n filter: {\n anyOf: [\n { $ref: \"#/$defs/RefObject\" },\n { description: \"A single filter object, e.g. an equality shorthand.\", type: \"object\" },\n {\n description: 'Ordered filter rules, e.g. [{ field: \"Slug\", op: \"not empty\" }].',\n items: { type: \"object\" },\n type: \"array\",\n },\n ],\n description:\n \"Filter configuration: a reactive $ref binding, a single filter object, or an ordered \" +\n \"array of rules.\",\n },\n headers: { additionalProperties: { type: \"string\" }, type: \"object\" },\n indexes: {\n items: {\n properties: {\n keyPath: {\n oneOf: [{ type: \"string\" }, { items: { type: \"string\" }, type: \"array\" }],\n },\n name: { type: \"string\" },\n unique: { type: \"boolean\" },\n },\n required: [\"name\", \"keyPath\"],\n type: \"object\",\n },\n type: \"array\",\n },\n items: {},\n key: { type: \"string\" },\n keyPath: { type: \"string\" },\n manual: { type: \"boolean\" },\n map: { $ref: \"#/$defs/ElementDef\" },\n maxAge: { type: \"integer\" },\n method: {\n enum: [\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\", \"HEAD\", \"OPTIONS\"],\n type: \"string\",\n },\n name: { type: \"string\" },\n path: { type: \"string\" },\n responseType: {\n enum: [\"json\", \"text\", \"blob\", \"arraybuffer\", \"document\", \"\"],\n type: \"string\",\n },\n sameSite: { enum: [\"strict\", \"lax\", \"none\"], type: \"string\" },\n secure: { type: \"boolean\" },\n sort: {\n anyOf: [\n { $ref: \"#/$defs/RefObject\" },\n { description: \"A single sort rule, e.g. { field, order }.\", type: \"object\" },\n {\n description: 'Ordered sort rules, e.g. [{ field: \"date\", order: \"desc\" }].',\n items: { type: \"object\" },\n type: \"array\",\n },\n ],\n description:\n \"Sort configuration: a reactive $ref binding, a single { field, order } rule, or an \" +\n \"ordered array of rules.\",\n },\n src: {\n description: \"Configuration property passed to external class constructor.\",\n type: \"string\",\n },\n store: { type: \"string\" },\n timing: { enum: [\"compiler\", \"server\", \"client\"], type: \"string\" },\n url: { $ref: \"#/$defs/StringOrRef\" },\n version: { minimum: 1, type: \"integer\" },\n },\n required: [\"$prototype\"],\n type: \"object\",\n} as const;\n",
24
+ "export const pureTypeDefSchema = {\n description:\n \"A reusable JSON Schema type definition for tooling only. \" +\n \"No function, no runtime artifact. \" +\n \"Referenced from state entries via $ref. \" +\n \"Naming convention: PascalCase.\",\n not: {\n anyOf: [{ required: [\"default\"] }, { required: [\"$prototype\"] }],\n },\n properties: {\n description: { type: \"string\" },\n enum: { type: \"array\" },\n examples: { type: \"array\" },\n items: {},\n maxLength: { minimum: 0, type: \"integer\" },\n maximum: { type: \"number\" },\n minLength: { minimum: 0, type: \"integer\" },\n minimum: { type: \"number\" },\n pattern: { type: \"string\" },\n properties: { type: \"object\" },\n required: { items: { type: \"string\" }, type: \"array\" },\n type: { $ref: \"#/$defs/JsonSchemaType\" },\n },\n required: [\"type\"],\n type: \"object\",\n} as const;\n",
25
+ "import { intlHelpersClause } from \"../src/intl.ts\";\n\nexport const expressionPointerSchema = {\n additionalProperties: false,\n description:\n \"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).\",\n properties: {\n $ref: {\n pattern: \"^(\\\\$map/|\\\\$reduce/|\\\\$args/|event#/|#/|parent#/|window#/|document#/)\",\n type: \"string\",\n },\n },\n required: [\"$ref\"],\n type: \"object\",\n} as const;\n\nexport const expressionLiteralSchema = {\n anyOf: [\n { not: { pattern: \"\\\\$\\\\{\" }, type: \"string\" },\n { type: \"number\" },\n { type: \"boolean\" },\n { type: \"null\" },\n { items: { $ref: \"#/$defs/ExpressionOperand\" }, type: \"array\" },\n {\n description:\n \"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.\",\n not: { anyOf: [{ required: [\"$ref\"] }, { required: [\"operator\"] }] },\n type: \"object\",\n },\n ],\n description: \"A non-reactive operand: scalar, plain-object literal, or array of operands.\",\n} as const;\n\nexport const expressionOperandSchema = {\n anyOf: [\n { $ref: \"#/$defs/ExpressionPointer\" },\n { $ref: \"#/$defs/ExpressionNode\" },\n { $ref: \"#/$defs/ExpressionLiteral\" },\n ],\n description:\n \"Anything that may appear in target or value: a pointer, a literal, or a nested expression node.\",\n} as const;\n\nexport const unaryOperatorSchema = { enum: [\"!\", \"-\"] } as const;\nexport const binaryOperatorSchema = {\n enum: [\"+\", \"-\", \"*\", \"/\", \"%\", \"===\", \"!==\", \"<\", \"<=\", \">\", \">=\", \"&&\", \"||\", \"??\"],\n} as const;\nexport const conditionalOperatorSchema = { const: \"?:\" } as const;\nexport const switchOperatorSchema = { const: \"switch\" } as const;\nexport const callOperatorSchema = { const: \"call\" } as const;\nexport const pureMethodSchema = {\n description:\n \"A genuine pure String.prototype / Array.prototype / Number.prototype method (spec §19.4d). The ES2023 change-by-copy family (toSorted, toReversed, toSpliced, with) stands in where mutation would otherwise occur. Receiver in target; value carries the argument (bare scalar) or argument list (array).\",\n enum: [\n \"includes\",\n \"indexOf\",\n \"lastIndexOf\",\n \"join\",\n \"slice\",\n \"concat\",\n \"at\",\n \"flat\",\n \"toSorted\",\n \"toReversed\",\n \"toSpliced\",\n \"with\",\n \"toUpperCase\",\n \"toLowerCase\",\n \"trim\",\n \"trimStart\",\n \"trimEnd\",\n \"split\",\n \"startsWith\",\n \"endsWith\",\n \"padStart\",\n \"padEnd\",\n \"replaceAll\",\n \"repeat\",\n \"charAt\",\n \"normalize\",\n \"toLocaleUpperCase\",\n \"toLocaleLowerCase\",\n \"toFixed\",\n \"toPrecision\",\n \"toLocaleString\",\n ],\n} as const;\nexport const assignmentOperatorSchema = { enum: [\"=\", \"+=\", \"-=\", \"*=\", \"/=\"] } as const;\nexport const noArgMethodSchema = { enum: [\"pop\", \"shift\"] } as const;\nexport const oneArgMethodSchema = { enum: [\"push\", \"unshift\"] } as const;\nexport const spliceMethodSchema = { const: \"splice\" } as const;\nexport const reduceMethodSchema = { const: \"reduce\" } as const;\nexport const mapFilterMethodSchema = { enum: [\"map\", \"filter\"] } as const;\n\nexport const expressionNodeSchema = {\n additionalProperties: false,\n description: \"The core expression node. operator + target, with value gated by arity.\",\n oneOf: [\n {\n not: { anyOf: [{ required: [\"value\"] }, { required: [\"initial\"] }] },\n properties: { operator: { $ref: \"#/$defs/UnaryOperator\" } },\n required: [\"operator\"],\n title: \"Unary — target only, no value\",\n },\n {\n not: { required: [\"initial\"] },\n properties: { operator: { $ref: \"#/$defs/BinaryOperator\" } },\n required: [\"operator\", \"value\"],\n title: \"Binary — left in target, right in value\",\n },\n {\n not: { required: [\"initial\"] },\n properties: {\n operator: { $ref: \"#/$defs/AssignmentOperator\" },\n target: { $ref: \"#/$defs/ExpressionPointer\" },\n },\n required: [\"operator\", \"value\"],\n title: \"Assignment — writable target, value required\",\n },\n {\n not: { anyOf: [{ required: [\"value\"] }, { required: [\"initial\"] }] },\n properties: {\n operator: { $ref: \"#/$defs/NoArgMethod\" },\n target: { $ref: \"#/$defs/ExpressionPointer\" },\n },\n required: [\"operator\"],\n title: \"pop / shift — array receiver, no value\",\n },\n {\n not: { required: [\"initial\"] },\n properties: {\n operator: { $ref: \"#/$defs/OneArgMethod\" },\n target: { $ref: \"#/$defs/ExpressionPointer\" },\n },\n required: [\"operator\", \"value\"],\n title: \"push / unshift — array receiver, single value argument\",\n },\n {\n not: { required: [\"initial\"] },\n properties: {\n operator: { $ref: \"#/$defs/SpliceMethod\" },\n target: { $ref: \"#/$defs/ExpressionPointer\" },\n value: { items: { $ref: \"#/$defs/ExpressionOperand\" }, minItems: 1, type: \"array\" },\n },\n required: [\"operator\", \"value\"],\n title: \"splice — array receiver, [start, deleteCount, ...items]\",\n },\n {\n properties: {\n operator: { $ref: \"#/$defs/ReduceMethod\" },\n target: {\n anyOf: [{ $ref: \"#/$defs/ExpressionPointer\" }, { $ref: \"#/$defs/ExpressionNode\" }],\n },\n value: { $ref: \"#/$defs/ExpressionNode\" },\n },\n required: [\"operator\", \"value\", \"initial\"],\n title: \"reduce — pure fold over a pointer or derived array; seed in initial\",\n },\n {\n not: { required: [\"initial\"] },\n properties: {\n operator: { $ref: \"#/$defs/MapFilterMethod\" },\n target: {\n anyOf: [{ $ref: \"#/$defs/ExpressionPointer\" }, { $ref: \"#/$defs/ExpressionNode\" }],\n },\n value: { $ref: \"#/$defs/ExpressionNode\" },\n },\n required: [\"operator\", \"value\"],\n title: \"map / filter — pure over a pointer or derived array; per-item expression in value\",\n },\n {\n description:\n \"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.\",\n properties: { operator: { $ref: \"#/$defs/ConditionalOperator\" } },\n required: [\"operator\", \"value\", \"initial\"],\n title: \"?: — pure conditional; test in target, consequent in value, alternate in initial\",\n },\n {\n description:\n \"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.\",\n not: { anyOf: [{ required: [\"value\"] }, { required: [\"initial\"] }] },\n properties: {\n cases: {\n additionalProperties: { $ref: \"#/$defs/ExpressionOperand\" },\n type: \"object\",\n },\n default: { $ref: \"#/$defs/ExpressionOperand\" },\n operator: { $ref: \"#/$defs/SwitchOperator\" },\n },\n required: [\"operator\", \"cases\"],\n title:\n \"switch — pure value-keyed selection; discriminant in target, results in cases/default\",\n },\n {\n description:\n \"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.\",\n not: { required: [\"initial\"] },\n properties: { operator: { $ref: \"#/$defs/PureMethod\" } },\n required: [\"operator\"],\n title: \"Pure method — genuine prototype methods; receiver in target, args in value\",\n },\n {\n description:\n \"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and \" +\n `${intlHelpersClause()}) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.`,\n not: { required: [\"initial\"] },\n properties: {\n operator: { $ref: \"#/$defs/CallOperator\" },\n target: { $ref: \"#/$defs/ExpressionPointer\" },\n value: { items: { $ref: \"#/$defs/ExpressionOperand\" }, type: \"array\" },\n },\n required: [\"operator\"],\n title: \"call — invoke a named formula or blessed global; callee in target, args in value\",\n },\n ],\n properties: {\n cases: {\n additionalProperties: { $ref: \"#/$defs/ExpressionOperand\" },\n description: \"switch only: matched discriminant value (string form) → result operand.\",\n type: \"object\",\n },\n default: {\n $ref: \"#/$defs/ExpressionOperand\",\n description: \"switch only: result operand when no case key matches.\",\n },\n initial: { $ref: \"#/$defs/ExpressionOperand\" },\n operator: { type: \"string\" },\n target: { $ref: \"#/$defs/ExpressionOperand\" },\n value: { $ref: \"#/$defs/ExpressionOperand\" },\n },\n required: [\"operator\", \"target\"],\n type: \"object\",\n} as const;\n\nexport const expressionEntrySchema = {\n additionalProperties: false,\n description:\n \"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.\",\n properties: {\n $description: { type: \"string\" },\n $expression: { $ref: \"#/$defs/ExpressionNode\" },\n $title: { type: \"string\" },\n parameters: {\n description:\n \"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.\",\n items: { anyOf: [{ type: \"string\" }, { $ref: \"#/$defs/CemParameter\" }] },\n type: \"array\",\n },\n },\n required: [\"$expression\"],\n type: \"object\",\n} as const;\n",
26
+ "export const stateEntrySchema = {\n description:\n \"A single state entry. Shape is determined by value type: \" +\n \"scalar/array → naked reactive property, string with ${} → computed, \" +\n 'object with $prototype: \"Function\" → function, ' +\n \"object with $prototype: <other> → data source, \" +\n \"object with type and default → typed reactive property, \" +\n \"plain object → naked object reactive property.\",\n oneOf: [\n { type: \"number\" },\n { type: \"boolean\" },\n { type: \"null\" },\n { type: \"string\" },\n { type: \"array\" },\n { $ref: \"#/$defs/TypedStateDef\" },\n { $ref: \"#/$defs/FunctionDef\" },\n { $ref: \"#/$defs/ExternalClassDef\" },\n { $ref: \"#/$defs/ExpressionEntry\" },\n {\n not: {\n anyOf: [\n { required: [\"$prototype\"] },\n { required: [\"default\"] },\n { required: [\"type\"] },\n { required: [\"$expression\"] },\n ],\n },\n type: \"object\",\n },\n ],\n} as const;\n\nexport const stateMapSchema = {\n additionalProperties: { $ref: \"#/$defs/StateEntry\" },\n description:\n \"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). \" +\n \"All entries are reactive by default.\",\n type: \"object\",\n} as const;\n\nexport const defsMapSchema = {\n additionalProperties: { $ref: \"#/$defs/TypeDefEntry\" },\n description:\n \"Map of reusable JSON Schema type definitions. \" +\n \"Keys are PascalCase type names. No runtime artifacts are produced.\",\n type: \"object\",\n} as const;\n\nexport const typeDefEntrySchema = {\n description:\n \"A $defs type definition entry. Must be a pure JSON Schema type \" +\n \"definition or a class definition (.class.json format).\",\n oneOf: [{ $ref: \"#/$defs/PureTypeDef\" }, { $ref: \"#/$defs/ClassDef\" }],\n} as const;\n",
27
+ "/**\n * Method capability roles: \"method\"/\"accessor\" plus every static capability role hosts dispatch on\n * (format-registry EXTENSION_CAPABILITIES — specs/extensions.md §8). Kept as a literal tuple so\n * FromSchema inference stays precise; the drift-guard test in tests/class-schema-drift.test.ts\n * asserts parity with EXTENSION_CAPABILITIES.\n */\nexport const CLASS_METHOD_ROLES = [\n \"method\",\n \"accessor\",\n \"parse\",\n \"serialize\",\n \"discover\",\n \"load\",\n \"projectData\",\n \"resolvePaths\",\n \"lower\",\n \"emit\",\n \"head\",\n \"assets\",\n \"mount\",\n \"dialect\",\n \"deploySchema\",\n \"bindings\",\n \"testConnection\",\n] as const;\n\nexport const classParameterDefSchema = {\n description: \"A typed parameter definition for a class.\",\n properties: {\n default: {},\n description: { type: \"string\" },\n examples: { type: \"array\" },\n format: {\n description: 'When \"json-schema\", this parameter\\'s value is itself a JSON Schema.',\n type: \"string\",\n },\n identifier: { type: \"string\" },\n type: {},\n },\n required: [\"identifier\"],\n type: \"object\",\n} as const;\n\nexport const classFieldDefSchema = {\n description: \"A class field definition with access control and scope.\",\n properties: {\n $prototype: {\n description: 'Data source prototype for this field (e.g., \"Request\").',\n type: \"string\",\n },\n access: { enum: [\"public\", \"private\", \"protected\"], type: \"string\" },\n default: {},\n description: { type: \"string\" },\n examples: { type: \"array\" },\n identifier: { type: \"string\" },\n initializer: {},\n role: { const: \"field\", type: \"string\" },\n scope: { enum: [\"instance\", \"static\"], type: \"string\" },\n type: {},\n },\n type: \"object\",\n} as const;\n\nexport const classConstructorDefSchema = {\n description: \"Class constructor definition.\",\n properties: {\n $prototype: { const: \"Function\", type: \"string\" },\n body: {\n oneOf: [{ type: \"string\" }, { items: { type: \"string\" }, type: \"array\" }],\n },\n description: { type: \"string\" },\n parameters: {\n items: {\n oneOf: [\n {\n additionalProperties: false,\n properties: { $ref: { type: \"string\" } },\n required: [\"$ref\"],\n type: \"object\",\n },\n { $ref: \"#/$defs/ClassParameterDef\" },\n ],\n },\n type: \"array\",\n },\n role: { const: \"constructor\", type: \"string\" },\n superCall: {\n properties: {\n arguments: { items: { type: \"string\" }, type: \"array\" },\n },\n type: \"object\",\n },\n },\n type: \"object\",\n} as const;\n\nexport const classMethodDefSchema = {\n description:\n \"A class method or accessor definition. Capability roles (parse, serialize, discover, load) \" +\n \"mark static methods that hosts (compiler, server, studio) invoke for format dispatch.\",\n properties: {\n $prototype: { const: \"Function\", type: \"string\" },\n access: { enum: [\"public\", \"private\", \"protected\"], type: \"string\" },\n body: {\n oneOf: [{ type: \"string\" }, { items: { type: \"string\" }, type: \"array\" }],\n },\n description: { type: \"string\" },\n getter: {\n properties: { body: { type: \"string\" } },\n type: \"object\",\n },\n identifier: { type: \"string\" },\n parameters: {\n items: {\n oneOf: [\n {\n additionalProperties: false,\n properties: { $ref: { type: \"string\" } },\n required: [\"$ref\"],\n type: \"object\",\n },\n { $ref: \"#/$defs/ClassParameterDef\" },\n ],\n },\n type: \"array\",\n },\n returnType: {},\n role: {\n enum: CLASS_METHOD_ROLES,\n type: \"string\",\n },\n scope: { enum: [\"instance\", \"static\"], type: \"string\" },\n setter: {\n properties: {\n body: { type: \"string\" },\n parameters: { type: \"array\" },\n },\n type: \"object\",\n },\n timing: {\n description:\n \"Execution environments allowed to call this capability directly. \" +\n \"Hosts outside the list round-trip through the dev server.\",\n items: { enum: [\"compiler\", \"server\", \"client\"], type: \"string\" },\n type: \"array\",\n },\n },\n type: \"object\",\n} as const;\n\nexport const formatDefSchema = {\n description:\n \"Format participation marker. A class carrying this block is auto-discovered from the \" +\n \"project imports map and used for file-extension dispatch by the compiler, server, and studio.\",\n properties: {\n documentKinds: {\n description:\n '\"page\"/\"component\" allow the extension in pages/components discovery; ' +\n '\"content\" allows it as a content-type source.',\n items: { enum: [\"page\", \"component\", \"content\"], type: \"string\" },\n type: \"array\",\n },\n exportTarget: {\n description: \"When true, site builds emit a serialized sidecar per page in this format.\",\n type: \"boolean\",\n },\n extensions: {\n description: 'File extensions this format claims, with leading dot (e.g. [\".md\"]).',\n items: { pattern: \"^\\\\.\", type: \"string\" },\n minItems: 1,\n type: \"array\",\n },\n mediaType: {\n description: \"MIME type for the format (icons, labels, HTTP).\",\n type: \"string\",\n },\n remote: {\n description: \"When true, the load capability accepts http(s) URLs as sources.\",\n type: \"boolean\",\n },\n },\n required: [\"extensions\"],\n type: \"object\",\n} as const;\n\nexport const projectBlockDefSchema = {\n additionalProperties: false,\n description:\n \"Project-section admission block (specs/extensions.md §9). A class carrying this block owns \" +\n \"the project.json section named by `key`; hosts dispatch that section's data through the \" +\n \"class's projectData/resolvePaths capabilities.\",\n properties: {\n description: { type: \"string\" },\n key: {\n description: \"The project.json top-level section this class owns (exclusive per project).\",\n type: \"string\",\n },\n referenceable: {\n description: \"Whether section entries can be referenced from documents (e.g. content types).\",\n type: \"boolean\",\n },\n title: { type: \"string\" },\n },\n required: [\"key\"],\n type: \"object\",\n} as const;\n\nexport const serverBlockDefSchema = {\n additionalProperties: false,\n description:\n \"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts \" +\n \"routes under its /_jx/ basePath in the site worker and dev server.\",\n properties: {\n basePath: {\n description: \"Route subtree this class mounts — must be under /_jx/ (exclusive per project).\",\n examples: [\"/_jx/data\", \"/_jx/auth\"],\n type: \"string\",\n },\n module: {\n description: \"Module specifier exporting the mount handler.\",\n type: \"string\",\n },\n order: {\n description: \"Mount order (ascending; default 100).\",\n type: \"number\",\n },\n },\n required: [\"basePath\"],\n type: \"object\",\n} as const;\n\nexport const connectorBlockDefSchema = {\n // Open by design: the block mirrors format-registry's ConnectorBlock ([key: string]: unknown) —\n // Providers carry extra keys (e.g. D1's `module`), so additionalProperties stays true.\n description:\n \"Connection-provider admission block (specs/extensions.md §12). A class carrying this block \" +\n \"provides database connections of the given provider/kind.\",\n properties: {\n kind: {\n description: \"SQL dialect family the provider speaks.\",\n enum: [\"sqlite\", \"postgres\"],\n type: \"string\",\n },\n local: {\n description: \"Local-development substitute provider (e.g. sqlite for D1).\",\n type: \"string\",\n },\n module: {\n description: \"Module specifier exporting the provider implementation.\",\n type: \"string\",\n },\n provider: {\n description: \"Provider identifier (e.g. d1, supabase, sqlite).\",\n type: \"string\",\n },\n serve: {\n description: \"Module specifier exporting the serve-time worker binding.\",\n type: \"string\",\n },\n },\n required: [\"provider\", \"kind\"],\n type: \"object\",\n} as const;\n\nexport const studioHintsSchema = {\n description:\n \"Studio control-surface hints for a format class: editor modes, document-mode rules, \" +\n \"templates, and the element/nesting constraints that gate structural editing.\",\n properties: {\n documentMode: {\n properties: {\n componentWhen: {\n description:\n \"Treat the document as a component when this top-level/frontmatter key matches the regex.\",\n properties: {\n frontmatterKey: { type: \"string\" },\n matches: { type: \"string\" },\n },\n type: \"object\",\n },\n default: { enum: [\"content\", \"component\"], type: \"string\" },\n },\n type: \"object\",\n },\n elements: {\n description: \"Element allowlist and nesting constraints for structural editing.\",\n properties: {\n block: { items: { type: \"string\" }, type: \"array\" },\n inline: { items: { type: \"string\" }, type: \"array\" },\n nesting: {\n additionalProperties: {\n properties: {\n block: { type: \"boolean\" },\n directive: { type: \"boolean\" },\n inline: { type: \"boolean\" },\n only: { items: { type: \"string\" }, type: \"array\" },\n },\n type: \"object\",\n },\n description:\n 'Per-parent child rules keyed by tag (or \"_root\"): ' +\n \"{ block, inline, directive } booleans or { only: [tags] }.\",\n type: \"object\",\n },\n textOnly: { items: { type: \"string\" }, type: \"array\" },\n void: { items: { type: \"string\" }, type: \"array\" },\n },\n type: \"object\",\n },\n icon: { type: \"string\" },\n modes: {\n description: \"Editor modes the studio offers for documents of this format.\",\n items: { type: \"string\" },\n type: \"array\",\n },\n newFileTemplate: {\n description: \"Initial source text for newly created files of this format.\",\n type: \"string\",\n },\n },\n type: \"object\",\n} as const;\n\nexport const classDefSchema = {\n additionalProperties: false,\n description:\n 'A .class.json schema-defined class. $prototype must be \"Class\". ' +\n \"Defines fields, constructor, methods, and type parameters via $defs. \" +\n \"Optionally points to a JS module via $implementation for hybrid execution.\",\n properties: {\n $defs: {\n description: \"Class members: parameters, returnTypes, fields, constructor, methods.\",\n properties: {\n constructor: { $ref: \"#/$defs/ClassConstructorDef\" },\n fields: {\n additionalProperties: { $ref: \"#/$defs/ClassFieldDef\" },\n description: \"Class fields with role, access, scope, and type information.\",\n type: \"object\",\n },\n methods: {\n additionalProperties: { $ref: \"#/$defs/ClassMethodDef\" },\n description: \"Class methods and accessors.\",\n type: \"object\",\n },\n parameters: {\n additionalProperties: { $ref: \"#/$defs/ClassParameterDef\" },\n description: \"Reusable typed parameter schemas, keyed by name.\",\n type: \"object\",\n },\n returnTypes: {\n additionalProperties: { type: \"object\" },\n description: \"Output type schemas, keyed by name.\",\n type: \"object\",\n },\n },\n type: \"object\",\n },\n $id: { type: \"string\" },\n $implementation: {\n description: \"Relative path to a JS module containing the actual class implementation.\",\n type: \"string\",\n },\n $prototype: { const: \"Class\", type: \"string\" },\n $schema: { type: \"string\" },\n $studio: { $ref: \"#/$defs/StudioHints\" },\n connector: { $ref: \"#/$defs/ConnectorBlockDef\" },\n description: { type: \"string\" },\n extends: {\n description: \"Base class — string name or $ref to another .class.json.\",\n oneOf: [\n { type: \"string\" },\n { properties: { $ref: { type: \"string\" } }, required: [\"$ref\"], type: \"object\" },\n ],\n },\n format: { $ref: \"#/$defs/FormatDef\" },\n project: { $ref: \"#/$defs/ProjectBlockDef\" },\n server: { $ref: \"#/$defs/ServerBlockDef\" },\n title: {\n description: \"PascalCase class name, used as the export name.\",\n type: \"string\",\n },\n },\n required: [\"$prototype\", \"title\"],\n type: \"object\",\n} as const;\n",
28
+ "import { LANGUAGE_TAG_PATTERN } from \"../src/locale.ts\";\n\n/**\n * The RFC 9110 §15.4 redirection statuses a static host can express. 303 preserves the \"see other,\n * with GET\" semantics; 307 and 308 preserve the request method, which 301 and 302 historically do\n * not. **200 is not here**: a host's rewrite/proxy convention is not a redirection status, and\n * modelling it as one is what let the compiler emit a meta-refresh page for a rewrite. Rewrites are\n * `{ destination, rewrite: true }`.\n */\nexport const REDIRECT_STATUSES = [301, 302, 303, 307, 308] as const;\n\nexport const projectConfigSchema = {\n description:\n \"Schema for Jx project.json files. \" +\n \"A project.json file is the root anchor file for a Jx project, \" +\n \"declaring site metadata, default settings, global styles, extensions, \" +\n \"and build configuration. Open by design: extension-contributed sections \" +\n \"(e.g. `content`) are opaque top-level keys; the generated per-project \" +\n \"entry document (project.schema.json) closes the composition.\",\n properties: {\n $defs: {\n description: \"Global type definitions available to all pages.\",\n type: \"object\",\n },\n $elements: {\n description:\n \"Global custom element dependencies available to all pages. \" +\n \"Items are $ref objects or npm package specifier strings.\",\n items: {\n oneOf: [\n {\n additionalProperties: false,\n properties: { $ref: { type: \"string\" } },\n required: [\"$ref\"],\n type: \"object\",\n },\n { type: \"string\" },\n ],\n },\n type: \"array\",\n },\n $head: {\n description:\n \"Global <head> entries applied to all pages. \" +\n \"Array of element definitions for meta tags, link tags, script tags, etc.\",\n examples: [\n [\n { attributes: { href: \"/favicon.svg\", rel: \"icon\" }, tagName: \"link\" },\n { attributes: { content: \"Jx\", name: \"generator\" }, tagName: \"meta\" },\n ],\n ],\n items: {\n properties: {\n attributes: {\n additionalProperties: { type: \"string\" },\n type: \"object\",\n },\n tagName: { type: \"string\" },\n },\n type: \"object\",\n },\n type: \"array\",\n },\n $media: {\n additionalProperties: { type: \"string\" },\n description:\n \"Named media breakpoints following CSS @custom-media convention. \" +\n \"Available in all component style objects. Declaring a pure color-scheme \" +\n 'query (e.g. \"--dark\": \"(prefers-color-scheme: dark)\") additionally opts the ' +\n \"site into the forced-scheme contract: @--dark style blocks are dual-emitted \" +\n \"so a data-color-scheme attribute on <html> overrides the OS preference, \" +\n \"color-scheme is declared on :root, and a pre-paint script restores the \" +\n \"visitor's persisted choice (spec §9.5).\",\n examples: [\n {\n \"--dark\": \"(prefers-color-scheme: dark)\",\n \"--lg\": \"(min-width: 1024px)\",\n \"--md\": \"(min-width: 768px)\",\n \"--sm\": \"(min-width: 640px)\",\n },\n ],\n type: \"object\",\n },\n $schema: {\n description:\n \"Relative path to the generated per-project schema (conventionally \" +\n \"./project.schema.json, written by `jx schema`).\",\n type: \"string\",\n },\n build: {\n description: \"Build configuration.\",\n properties: {\n adapter: {\n description: \"Platform adapter for deployment-specific output.\",\n enum: [\"static\", \"cloudflare-pages\", \"cloudflare-workers\", \"node\", \"bun\"],\n type: \"string\",\n },\n deploy: {\n additionalProperties: false,\n description:\n \"Deployment tracking: the hosting project this repo publishes to. Identifiers \" +\n \"only (no secrets) — safe to commit; Studio uses it to tell whether the publish \" +\n \"workflow already exists. `adapter` says how the build is packaged; `deploy` says \" +\n \"where it ships.\",\n properties: {\n accountId: {\n description: \"Hosting account id (e.g. the Cloudflare account id).\",\n type: \"string\",\n },\n productionUrl: {\n description: \"Production URL of the connected hosting project.\",\n type: \"string\",\n },\n projectName: {\n description: \"Hosting project name (e.g. the Cloudflare Pages project).\",\n pattern: \"^[a-z0-9][a-z0-9-]*$\",\n type: \"string\",\n },\n provider: {\n description: \"Hosting provider the project is connected to.\",\n enum: [\"cloudflare-pages\"],\n type: \"string\",\n },\n },\n required: [\"provider\", \"accountId\", \"projectName\"],\n type: \"object\",\n },\n format: {\n default: \"directory\",\n description:\n \"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.\",\n enum: [\"directory\", \"single\"],\n type: \"string\",\n },\n outDir: {\n default: \"./dist\",\n description: \"Output directory for compiled site.\",\n type: \"string\",\n },\n headers: {\n additionalProperties: false,\n description:\n \"Emit dist/_headers — the response headers only the build can know. Honored by \" +\n \"Cloudflare Pages/Workers assets and Netlify; on the node/bun adapters the file \" +\n \"documents what a reverse proxy in front of them must send.\",\n properties: {\n cache: {\n default: \"auto\",\n description:\n '\"auto\" marks the content-addressed image variants immutable (RFC 8246) and ' +\n 'revalidates everything else (RFC 9111). \"off\" emits no Cache-Control at all.',\n enum: [\"auto\", \"off\"],\n type: \"string\",\n },\n enabled: { default: true, type: \"boolean\" },\n rules: {\n additionalProperties: { additionalProperties: { type: \"string\" }, type: \"object\" },\n description: \"Verbatim rules, merged after the generated block.\",\n propertyNames: { pattern: \"^/\" },\n type: \"object\",\n },\n security: {\n additionalProperties: false,\n properties: {\n contentTypeOptions: { default: true, type: \"boolean\" },\n csp: {\n default: false,\n description:\n \"CSP Level 3. Off by default: unlike the other security headers this one \" +\n \"governs code the build cannot see — a third-party script that loads a \" +\n \"second script, a widget that opens a frame — so turning it on is a change \" +\n \"to verify in the browser console, not a safe default. `script-src` is \" +\n \"derived from the inline scripts and external origins the build emitted; \" +\n \"`style-src` keeps 'unsafe-inline', because per-page <style> blocks and \" +\n \"per-element style attributes have no site-wide hash.\",\n oneOf: [\n { type: \"boolean\" },\n { const: \"report-only\" },\n {\n additionalProperties: false,\n properties: {\n directives: {\n additionalProperties: {\n oneOf: [{ type: \"string\" }, { const: false }],\n },\n description:\n \"Replace (string) or remove (false) a computed directive. A \" +\n \"replacement is wholesale, so an addition restates the defaults.\",\n type: \"object\",\n },\n mode: { default: \"enforce\", enum: [\"enforce\", \"report-only\"] },\n reportUri: { format: \"uri-reference\", type: \"string\" },\n },\n type: \"object\",\n },\n ],\n },\n frameOptions: {\n default: \"SAMEORIGIN\",\n oneOf: [{ enum: [\"DENY\", \"SAMEORIGIN\"], type: \"string\" }, { const: false }],\n },\n hsts: {\n default: false,\n description:\n \"RFC 6797. Off by default: a wrong max-age locks the apex domain to HTTPS \" +\n \"for that long, and the mistake is invisible until a certificate lapses. \" +\n \"`preload` requires `includeSubDomains` and is a build error without it.\",\n oneOf: [\n { type: \"boolean\" },\n {\n additionalProperties: false,\n properties: {\n includeSubDomains: { default: true, type: \"boolean\" },\n maxAge: { default: 31_536_000, minimum: 0, type: \"integer\" },\n preload: { default: false, type: \"boolean\" },\n },\n type: \"object\",\n },\n ],\n },\n permissionsPolicy: {\n default: \"camera=(), microphone=(), geolocation=()\",\n oneOf: [{ type: \"string\" }, { const: false }],\n },\n referrerPolicy: {\n default: \"strict-origin-when-cross-origin\",\n oneOf: [\n {\n enum: [\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"origin\",\n \"origin-when-cross-origin\",\n \"same-origin\",\n \"strict-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n type: \"string\",\n },\n { const: false },\n ],\n },\n },\n type: \"object\",\n },\n },\n type: \"object\",\n },\n sitemap: {\n default: true,\n description:\n \"Generate sitemap.xml from the route table (requires `url`). Set false to disable.\",\n type: \"boolean\",\n },\n trailingSlash: {\n default: \"always\",\n description: \"Trailing slash behavior for generated URLs.\",\n enum: [\"always\", \"never\", \"ignore\"],\n type: \"string\",\n },\n },\n type: \"object\",\n },\n copy: {\n additionalProperties: { type: \"string\" },\n description:\n \"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).\",\n type: \"object\",\n },\n defaults: {\n description: \"Default settings applied to all pages unless overridden.\",\n properties: {\n charset: {\n default: \"utf8\",\n description: \"Default charset for the page.\",\n type: \"string\",\n },\n dir: {\n description:\n \"Base direction for the <html> element. Omitted when unset — a page's `$dir` \" +\n \"overrides it. Right-to-left content renders left-to-right without this.\",\n enum: [\"ltr\", \"rtl\", \"auto\"],\n type: \"string\",\n },\n lang: {\n default: \"en\",\n description:\n \"Default lang attribute for the <html> element. A page's `$lang` overrides it.\",\n type: \"string\",\n },\n layout: {\n default: null,\n description:\n \"Default layout file path applied to all pages. \" +\n \"Set to null to render pages without a layout.\",\n examples: [\"./layouts/base.json\"],\n oneOf: [{ type: \"string\" }, { type: \"null\" }],\n },\n shadow: {\n default: false,\n description:\n \"Default shadow-DOM mode for every component (spec.md §16.6). Off unless set: a \" +\n \"shadow root isolates component styles from the page and replaces the <slot> \" +\n \"emulation with real slot distribution. A component's own `$shadow` overrides this \" +\n \"in both directions.\",\n oneOf: [\n { enum: [\"open\", \"closed\"], type: \"string\" },\n { const: false, type: \"boolean\" },\n ],\n },\n },\n type: \"object\",\n },\n extensions: {\n description:\n \"Extension packages: bare package names (resolved project-first through the package \" +\n \"exports map) or relative paths. Each must export jx-extension.json.\",\n examples: [[\"@jxsuite/parser\"]],\n items: { type: \"string\" },\n type: \"array\",\n },\n manifest: {\n additionalProperties: false,\n description:\n 'W3C Web App Manifest, emitted as manifest.webmanifest with a <link rel=\"manifest\"> ' +\n \"on every page. Absent means no manifest: it is a claim that a site is meant to be \" +\n \"installed, and most are not.\",\n properties: {\n backgroundColor: { type: \"string\" },\n categories: { items: { type: \"string\" }, type: \"array\" },\n description: { type: \"string\" },\n dir: { enum: [\"ltr\", \"rtl\", \"auto\"], type: \"string\" },\n display: {\n default: \"standalone\",\n enum: [\"fullscreen\", \"standalone\", \"minimal-ui\", \"browser\"],\n type: \"string\",\n },\n enabled: { default: true, type: \"boolean\" },\n icons: {\n description:\n \"Icons at 192px and 512px are what browsers require before offering to install \" +\n \"the site; the build warns when either is missing.\",\n items: {\n additionalProperties: false,\n properties: {\n purpose: { type: \"string\" },\n sizes: { examples: [\"192x192\"], type: \"string\" },\n src: { type: \"string\" },\n type: { type: \"string\" },\n },\n required: [\"src\"],\n type: \"object\",\n },\n type: \"array\",\n },\n lang: { type: \"string\" },\n name: { description: \"Defaults to the project name.\", type: \"string\" },\n orientation: { type: \"string\" },\n scope: { type: \"string\" },\n shortName: { type: \"string\" },\n startUrl: { default: \"/\", type: \"string\" },\n themeColor: { type: \"string\" },\n },\n type: \"object\",\n },\n serviceWorker: {\n default: false,\n description:\n \"W3C Service Worker, emitted as sw.js. Off unless declared — a worker is sticky, so it \" +\n \"is the one output that can keep breaking visitors after a deploy tries to fix them. \" +\n \"**Turning it off means `false`, not deleting the key**: `false` emits a tombstone at \" +\n \"the same URL that unregisters the old worker and clears its caches, and a 404 there is \" +\n \"not an instruction to stop. HTML is always network-first; only the content-addressed \" +\n \"/images/_optimized/* is served cache-first.\",\n oneOf: [\n { type: \"boolean\" },\n {\n additionalProperties: false,\n properties: {\n enabled: { default: true, type: \"boolean\" },\n offlineFallback: {\n description:\n \"Page served for a failed navigation. Added to `precache` if not already there.\",\n type: \"string\",\n },\n precache: {\n description:\n \"Site-absolute URLs fetched at install time. Each must be a file this build \" +\n \"produces; one that is not fails the build, because a single unreachable entry \" +\n \"stops the worker installing at all.\",\n items: { pattern: \"^/\", type: \"string\" },\n type: \"array\",\n },\n scope: { default: \"/\", type: \"string\" },\n },\n type: \"object\",\n },\n ],\n },\n securityTxt: {\n additionalProperties: false,\n description:\n \"RFC 9116 security.txt, emitted at .well-known/security.txt. `expires` is required by \" +\n \"§2.5.5 and an absent or past value is a build error — an expired file advertises a \" +\n \"reporting channel while telling the reporter not to trust it. A hand-placed \" +\n \"public/.well-known/security.txt shadows this, which is how a clearsigned file ships.\",\n properties: {\n acknowledgments: { items: { type: \"string\" }, type: \"array\" },\n canonical: { type: \"string\" },\n contact: {\n description: \"At least one mailto:, https: or tel: URI (§2.5.3).\",\n items: { type: \"string\" },\n type: \"array\",\n },\n enabled: { default: true, type: \"boolean\" },\n encryption: { items: { type: \"string\" }, type: \"array\" },\n expires: { format: \"date-time\", type: \"string\" },\n hiring: { items: { type: \"string\" }, type: \"array\" },\n policy: { items: { type: \"string\" }, type: \"array\" },\n preferredLanguages: {\n description: \"BCP 47 tags, validated and canonicalized like i18n.locales.\",\n items: { pattern: LANGUAGE_TAG_PATTERN, type: \"string\" },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n i18n: {\n description: \"Internationalization configuration.\",\n properties: {\n defaultLocale: {\n description:\n \"Default locale, as a BCP 47 language tag. The pattern catches shape errors \" +\n \"(`en_US`, `en--US`); the build is the authority on well-formedness.\",\n examples: [\"en\"],\n pattern: LANGUAGE_TAG_PATTERN,\n type: \"string\",\n },\n locales: {\n description: \"Available locales, as BCP 47 language tags.\",\n examples: [[\"en\", \"fr\", \"de\"]],\n items: { pattern: LANGUAGE_TAG_PATTERN, type: \"string\" },\n type: \"array\",\n },\n routing: {\n description: \"Locale routing strategy.\",\n enum: [\"prefix-except-default\", \"prefix-always\"],\n type: \"string\",\n },\n },\n type: \"object\",\n },\n images: { $ref: \"#/$defs/ImageConfig\" },\n imports: {\n additionalProperties: { type: \"string\" },\n description:\n \"Global import map: $prototype names to .class.json file paths. \" +\n \"Makes external classes available by name in all pages.\",\n examples: [\n {\n Markdown: \"@jxsuite/parser/Markdown.class.json\",\n MarkdownCollection: \"@jxsuite/parser/MarkdownCollection.class.json\",\n },\n ],\n type: \"object\",\n },\n name: {\n default: \"Jx Site\",\n description: \"Human-readable project name.\",\n examples: [\"My Portfolio\", \"Jx Example Site\"],\n type: \"string\",\n },\n redirects: {\n additionalProperties: {\n oneOf: [\n { description: \"Destination path or URL; implies a 301.\", type: \"string\" },\n {\n additionalProperties: false,\n description: \"A redirect with an explicit RFC 9110 §15.4 status.\",\n properties: {\n destination: { type: \"string\" },\n status: {\n default: 301,\n description:\n \"RFC 9110 §15.4 redirection status. 307 and 308 preserve the request method; \" +\n \"301 and 302 historically do not.\",\n enum: [...REDIRECT_STATUSES],\n type: \"integer\",\n },\n },\n required: [\"destination\"],\n type: \"object\",\n },\n {\n additionalProperties: false,\n description:\n \"A rewrite (proxy): the destination's content is served AT the source URL, with no \" +\n \"redirect. Emitted as status 200 in `_redirects`, which is the host convention — \" +\n \"not an HTTP redirection status.\",\n properties: {\n destination: { type: \"string\" },\n rewrite: { const: true, type: \"boolean\" },\n },\n required: [\"destination\", \"rewrite\"],\n type: \"object\",\n },\n ],\n },\n description:\n \"Static redirect and rewrite rules. Keys are source paths in URLPattern pathname syntax.\",\n examples: [\n {\n \"/api/*\": { destination: \"https://api.example.com/*\", rewrite: true },\n \"/legacy/*\": { destination: \"/archive/*\", status: 308 },\n \"/old-about\": \"/about\",\n },\n ],\n propertyNames: { pattern: \"^/\" },\n type: \"object\",\n },\n state: {\n description: \"Site-wide reactive state available to all pages.\",\n type: \"object\",\n },\n style: {\n additionalProperties: {\n oneOf: [{ type: \"string\" }, { type: \"number\" }, { $ref: \"#/$defs/StyleObject\" }],\n },\n description:\n \"Global CSS styles applied to the <body> element. \" +\n \"Uses the same camelCase CSSOM convention and recursive selector/at-rule \" +\n \"nesting as component styles.\",\n type: \"object\",\n },\n url: {\n description: \"Production URL of the deployed site.\",\n examples: [\"https://example.com\", \"https://jxsuite.com\"],\n type: \"string\",\n },\n },\n type: \"object\",\n} as const;\n",
29
+ "/**\n * Jx-extension.json manifest schema (specs/extensions.md §4). The manifest is pure data: it\n * enumerates an extension package's classes and schema fragments; behavior lives in the class\n * descriptors it points to.\n */\n\nexport const extensionManifestSchema = {\n additionalProperties: false,\n description:\n \"Schema for jx-extension.json manifests. Located at the extension package root and \" +\n \"exported so hosts can resolve <package>/jx-extension.json through the exports map.\",\n properties: {\n $schema: { type: \"string\" },\n classes: {\n additionalProperties: { type: \"string\" },\n description:\n \"$prototype-visible class name → class descriptor path, relative to the manifest.\",\n type: \"object\",\n },\n description: { description: \"One-line description.\", type: \"string\" },\n name: { description: \"Package name; must match package.json.\", type: \"string\" },\n schemas: {\n additionalProperties: false,\n description: \"Schema fragments this package contributes, relative to the manifest.\",\n properties: {\n document: {\n description: \"Document-schema fragment (positions like $paths values).\",\n type: \"string\",\n },\n fields: {\n description:\n \"Field-union fragment: its $defs members are unioned into the per-project \" +\n \"field-schema resource as extension field extras (specs/extensions.md §5.3).\",\n type: \"string\",\n },\n project: {\n description: \"Project-schema fragment (top-level project.json sections).\",\n type: \"string\",\n },\n },\n type: \"object\",\n },\n title: { description: \"Human-readable name for studio surfaces.\", type: \"string\" },\n },\n required: [\"name\"],\n type: \"object\",\n} as const;\n",
30
+ "/**\n * Value Source — the one vocabulary for \"how is this value produced\", and the derivation that says\n * which productions a given document position actually permits (plan §6.3).\n *\n * Six controls used to answer that question in six dialects: `abc / $ref / ${} / fx` on the dynamic\n * slot, `inline / $expression / ref` on the Events tab, `lit / $ref / expr` on every expression\n * operand, and `Static value / route param / Custom…` in the schema-driven forms. They are the same\n * four rungs of the Rule of Least Power ladder (spec §2.2) wearing four costumes, and a user who\n * learned one learned none of the others. {@link VALUE_SOURCE_LABELS} is the single vocabulary;\n * every surface that offers the choice spells it the same way.\n *\n * **The rungs are derived, not declared.** Each call site used to hand-write the array of rungs it\n * believed legal — four arrays, none of which included `expression`, so the `fx` rung the UI drew\n * was unreachable from every Properties and Style field. {@link deriveSlotCaps} walks the real\n * subschema from `@jxsuite/schema/defs` instead, so the rungs on offer are exactly the shapes the\n * document schema (and therefore `jx validate` and the compiler) accepts at that position:\n *\n * - An attribute, a component prop or an element property → fixed / from-data / mixed-text;\n * - A CSS declaration → fixed / mixed-text, because `JxStyle` has no `$ref` branch at all;\n * - An event handler → from-data / formula / inline-function, and never a fixed value;\n * - A repeater's filter or sort, and a `$switch` discriminant → from-data and nothing else, because\n * `ArrayNamespace` and `SwitchDef` declare a `RefObject` there and no other branch.\n *\n * The walker imports the _source_ def modules rather than the generated `schema.json`, which is\n * half a megabyte of webref data that `services/monaco-lazy.ts` deliberately keeps out of the cold\n * start. The one position the generator synthesises rather than declares — the `on*` handler\n * property — is mirrored here as {@link EVENT_HANDLER_SCHEMA} and pinned to the generated schema by\n * a test, so the mirror cannot drift in silence.\n */\n\nimport {\n arrayNamespaceSchema,\n attributesObjectSchema,\n elementPropertyValueSchema,\n elementTagNameSchema,\n expressionEntrySchema,\n functionDefSchema,\n propsObjectSchema,\n refObjectSchema,\n stringOrRefSchema,\n styleObjectSchema,\n switchDefSchema,\n tagNameSchema,\n} from \"@jxsuite/schema/defs\";\nimport { isFunctionDef, isRef, isTemplateString } from \"@jxsuite/schema/guards\";\n\n/** A rung of the value ladder — one way a document position can produce its value. */\nexport type SlotMode = \"literal\" | \"ref\" | \"template\" | \"expression\" | \"function\";\n\n/** Ladder order, least powerful first (spec §2.2). Every rung list is sorted by this. */\nexport const SLOT_MODE_ORDER: SlotMode[] = [\"literal\", \"ref\", \"template\", \"expression\", \"function\"];\n\n/**\n * The user-facing name of each rung — the whole point of §6.3. `ref` keeps its ellipsis because\n * choosing it opens a picker rather than committing a value.\n */\nexport const VALUE_SOURCE_LABELS: Record<SlotMode, string> = {\n expression: \"Formula\",\n function: \"Inline function\",\n literal: \"Fixed value\",\n ref: \"From data…\",\n template: \"Mixed text\",\n};\n\n/** One line of plain language per rung, shown beside its name in the picker. */\nexport const VALUE_SOURCE_HINTS: Record<SlotMode, string> = {\n expression: \"Computed from other values, built up operator by operator.\",\n function: \"Code that runs when this fires.\",\n literal: \"A value you type here, the same every time.\",\n ref: \"The current value of a signal, picked from a list.\",\n template: \"Text with ${…} placeholders that fill in from signals.\",\n};\n\n/** Detect which rung of the ladder a raw document value occupies. */\nexport function slotMode(value: unknown): SlotMode {\n if (isRef(value)) {\n return \"ref\";\n }\n if (isFunctionDef(value)) {\n return \"function\";\n }\n if (isTemplateString(value)) {\n return \"template\";\n }\n if (value && typeof value === \"object\" && \"$expression\" in value) {\n return \"expression\";\n }\n return \"literal\";\n}\n\n// ─── Schema walk ────────────────────────────────────────────────────────────\n\ntype SchemaNode = Record<string, unknown>;\n\n/**\n * The `on*` property shape that `@jxsuite/schema`'s generator synthesises for every EventHandler\n * IDL attribute (`buildEventHandlerProperties`). It is the only slot position with no declared\n * module in `defs/`; `tests/value-source.test.ts` asserts it still equals the generated one.\n */\nexport const EVENT_HANDLER_SCHEMA = {\n oneOf: [\n { $ref: \"#/$defs/RefObject\" },\n { $ref: \"#/$defs/ExpressionEntry\" },\n { $ref: \"#/$defs/FunctionDef\" },\n ],\n} as const;\n\n/** The `$defs` a slot position can actually reach. Anything else is a bug, not a silent no-rung. */\nconst REACHABLE_DEFS: Record<string, SchemaNode> = {\n ExpressionEntry: expressionEntrySchema as unknown as SchemaNode,\n FunctionDef: functionDefSchema as unknown as SchemaNode,\n RefObject: refObjectSchema as unknown as SchemaNode,\n StyleObject: styleObjectSchema as unknown as SchemaNode,\n};\n\n/** A `{ $ref: … }` binding object: `required: [\"$ref\"]` with a `$ref` property. */\nfunction isRefObjectSchema(node: SchemaNode): boolean {\n const { required } = node;\n return (\n Array.isArray(required) &&\n required.includes(\"$ref\") &&\n Boolean((node.properties as SchemaNode | undefined)?.$ref)\n );\n}\n\n/** A `{ $expression: … }` entry. */\nfunction isExpressionEntrySchema(node: SchemaNode): boolean {\n const { required } = node;\n return Array.isArray(required) && required.includes(\"$expression\");\n}\n\n/** A `$prototype: \"Function\"` declaration. */\nfunction isFunctionDefSchema(node: SchemaNode): boolean {\n const proto = (node.properties as SchemaNode | undefined)?.$prototype as SchemaNode | undefined;\n return proto?.const === \"Function\";\n}\n\n/**\n * A string branch that will accept `${…}`. A pattern/enum/const-constrained string will not — a\n * `TagName` or a `#/state/…` pointer is a string, but not a place a template may be typed.\n */\nfunction isFreeStringSchema(node: SchemaNode): boolean {\n return (\n node.type === \"string\" &&\n node.pattern === undefined &&\n node.enum === undefined &&\n node.const === undefined\n );\n}\n\nconst SCALAR_TYPES = new Set([\"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"]);\n\ninterface WalkState {\n found: Set<SlotMode>;\n /** Pointers the walk could not resolve — surfaced so a schema move fails loudly. */\n unresolved: Set<string>;\n seen: Set<SchemaNode>;\n}\n\nfunction walk(node: unknown, state: WalkState): void {\n if (!node || typeof node !== \"object\") {\n return;\n }\n const schema = node as SchemaNode;\n if (state.seen.has(schema)) {\n return;\n }\n state.seen.add(schema);\n\n const pointer = typeof schema.$ref === \"string\" ? schema.$ref : undefined;\n if (pointer !== undefined && Object.keys(schema).length === 1) {\n const name = pointer.startsWith(\"#/$defs/\") ? pointer.slice(\"#/$defs/\".length) : pointer;\n const target = REACHABLE_DEFS[name];\n if (target) {\n walk(target, state);\n } else {\n state.unresolved.add(pointer);\n }\n return;\n }\n\n /* Recognise a rung BEFORE descending: a RefObject's own `$ref` property is a pointer string,\n not another rung, and an ExpressionEntry's body is the expression grammar, not a ladder. */\n if (isRefObjectSchema(schema)) {\n state.found.add(\"ref\");\n return;\n }\n if (isExpressionEntrySchema(schema)) {\n state.found.add(\"expression\");\n return;\n }\n if (isFunctionDefSchema(schema)) {\n state.found.add(\"function\");\n return;\n }\n\n let composed = false;\n for (const key of [\"oneOf\", \"anyOf\", \"allOf\"]) {\n const branches = schema[key];\n if (Array.isArray(branches)) {\n composed = true;\n for (const branch of branches) {\n walk(branch, state);\n }\n }\n }\n if (composed) {\n return;\n }\n\n if (isFreeStringSchema(schema)) {\n state.found.add(\"literal\");\n state.found.add(\"template\");\n return;\n }\n if (schema.enum !== undefined || schema.const !== undefined) {\n state.found.add(\"literal\");\n return;\n }\n if (typeof schema.type === \"string\" && SCALAR_TYPES.has(schema.type)) {\n state.found.add(\"literal\");\n }\n}\n\n/** Result of a derivation, including the pointers it could not follow. */\nexport interface DerivedCaps {\n caps: SlotMode[];\n unresolved: string[];\n}\n\n/** Derive the rungs a subschema permits, and report any pointer the walk could not follow. */\nexport function deriveSlotCapsDetailed(schema: unknown): DerivedCaps {\n const state: WalkState = { found: new Set(), seen: new Set(), unresolved: new Set() };\n walk(schema, state);\n return {\n caps: SLOT_MODE_ORDER.filter((m) => state.found.has(m)),\n unresolved: [...state.unresolved].toSorted(),\n };\n}\n\n/** Derive the rungs a subschema permits, in ladder order. */\nexport function deriveSlotCaps(schema: unknown): SlotMode[] {\n return deriveSlotCapsDetailed(schema).caps;\n}\n\n// ─── Named positions ────────────────────────────────────────────────────────\n\n/**\n * `ElementTagName`, with `TagName` INLINED so the walk can see it.\n *\n * The shipped def points at `#/$defs/TagName`, and this walker resolves no pointer into the core\n * schema — `deriveSlotCapsDetailed` reports it as unresolved, and the position derived to Formula\n * alone, silently losing the Fixed-value rung. Substituting the def keeps one source of truth for\n * the branches while giving the derivation something it can actually walk.\n *\n * Note what the pattern buys here for free: `isFreeStringSchema` refuses a constrained string, so\n * no `template` rung is offered — and a `${…}` in tag position is exactly what that pattern exists\n * to reject.\n */\nconst ELEMENT_TAG_SCHEMA = {\n anyOf: [tagNameSchema, ...elementTagNameSchema.anyOf.slice(1)],\n} as const;\n\n/**\n * The document positions a bindable slot can occupy. A panel names the position it is editing; the\n * rungs follow from the schema, so a panel can no longer offer a rung the compiler would reject —\n * nor withhold one it would accept.\n */\nexport const SLOT_POSITION_SCHEMAS = {\n /** `attributes: { … }` — `AttributesObject.additionalProperties`. */\n attribute: attributesObjectSchema.additionalProperties,\n /** `$props: { … }` — `PropsObject.additionalProperties`. */\n componentProp: propsObjectSchema.additionalProperties,\n /** An unlisted element property — `ElementDef.additionalProperties`. */\n elementProperty: elementPropertyValueSchema,\n /** An `on*` handler — the generator's synthesised property shape. */\n eventHandler: EVENT_HANDLER_SCHEMA,\n /** A repeater's `filter` — `ArrayNamespace.properties.filter`. */\n repeaterFilter: arrayNamespaceSchema.properties.filter,\n /** A repeater's `items` — `ArrayNamespace.properties.items`. */\n repeaterItems: arrayNamespaceSchema.properties.items,\n /** A repeater's `sort` — `ArrayNamespace.properties.sort`. */\n repeaterSort: arrayNamespaceSchema.properties.sort,\n /** A declaration inside `style: { … }` — `StyleObject.additionalProperties`. */\n styleProperty: styleObjectSchema.additionalProperties,\n /** A `$switch` discriminant — `SwitchDef`, which is a `$ref` and nothing else. */\n switchDiscriminant: switchDefSchema,\n /**\n * An element's `tagName` — `ElementTagName`: a literal name, or a `TagExpression` choosing\n * between names. The rungs derive to Fixed value + Formula, which is the whole point of naming\n * the position rather than hand-rolling a control: the `TagName` branch carries a `pattern`, so\n * `isFreeStringSchema` correctly refuses to offer a template rung here — a `${…}` in tag position\n * is exactly what the pattern exists to reject.\n */\n elementTag: ELEMENT_TAG_SCHEMA,\n /** A declared string-valued element property (`textContent`, `href`, …) — `StringOrRef`. */\n textProperty: stringOrRefSchema,\n} as const;\n\n/** Name of a document position a bindable slot can occupy. */\nexport type SlotPosition = keyof typeof SLOT_POSITION_SCHEMAS;\n\n/**\n * Where a slot's rungs come from. A named {@link SlotPosition} for every position the document\n * schema declares; a schema handed in directly for the one that cannot be named ahead of time — a\n * field in an extension's own config form, whose schema arrives at runtime from the extension.\n *\n * There is deliberately no third form. A caller may not state which rungs it wants: the rungs are\n * derived from a schema or they are not derived at all.\n */\nexport type SlotCapsSource = SlotPosition | { schema: unknown };\n\nconst capsCache = new Map<SlotPosition, SlotMode[]>();\n\n/** The rungs legal at a named document position, derived once and cached. */\nexport function capsForPosition(position: SlotPosition): SlotMode[] {\n const hit = capsCache.get(position);\n if (hit) {\n return hit;\n }\n const derived = deriveSlotCaps(SLOT_POSITION_SCHEMAS[position]);\n capsCache.set(position, derived);\n return derived;\n}\n\n/** The rungs on offer for a {@link SlotCapsSource} — a named position, or a schema handed in. */\nexport function slotCaps(source: SlotCapsSource): SlotMode[] {\n return typeof source === \"string\" ? capsForPosition(source) : deriveSlotCaps(source.schema);\n}\n\n/**\n * The schema of one field in an extension's config form, as something the derivation can walk.\n *\n * Two things a plugin's own fragment does not say, and the form must. An untyped field accepts\n * anything, which for a form control means the free string its widget already draws. And every\n * config value additionally accepts a reactive `$ref` — a data source resolves the pointers in its\n * own config at runtime — which no plugin schema declares because it is not the plugin's to\n * declare. Both are stated here, once, rather than assumed at each form.\n */\nexport function configFieldSchema(field: unknown): { anyOf: unknown[] } {\n const declared = deriveSlotCaps(field).length > 0 ? field : { type: \"string\" };\n return { anyOf: [declared, { $ref: \"#/$defs/RefObject\" }] };\n}\n\n/** Test hook: drop the derivation cache. */\nexport function resetCapsCache(): void {\n capsCache.clear();\n}\n",
31
+ "/// <reference lib=\"dom\" />\n/**\n * The expression editor — one operator row plus an operand editor per slot, nested to any depth.\n *\n * **The layout is CSS, in `styles/inspector.css` (§ \"The expression editor\").** Every row here used\n * to be an inline `display:flex;…` attribute with a hard `min-width` on the pickers, and no rung of\n * that chain could set `min-width: 0` — so at Inspector width the operand controls refused to\n * shrink and Operator, Target and Value were clipped by the edge of the window. The editor is drawn\n * in the Inspector (~280px), in the Navigator, and in the Bottom dock's Logic tab (very wide), so\n * every row wraps to a stack rather than sizing itself in pixels.\n */\nimport { html, nothing } from \"lit-html\";\nimport { live } from \"lit-html/directives/live.js\";\nimport { PURE_METHOD_OPS } from \"@jxsuite/runtime/expression\";\nimport { isJsonObject, isRef } from \"@jxsuite/schema/guards\";\nimport { renderFieldRow } from \"./field-row\";\nimport { renderFormulaChips } from \"./formula-chips\";\nimport { applyCatalogPick, calleeEntry, formulaCatalog } from \"./formula-catalog\";\nimport { openFormulaPalette } from \"./formula-palette\";\nimport { VALUE_SOURCE_LABELS } from \"./value-source\";\nimport { renderEmptyState } from \"../panels/empty-state\";\n\nimport type {\n JxExpressionNode,\n JxExpressionOperand,\n JxStateDefinition,\n} from \"@jxsuite/schema/types\";\nimport type { TemplateResult } from \"lit-html\";\n\n// ─── Operator Categories ────────────────────────────────────────────────────\n\nconst UNARY_OPS = new Set([\"!\", \"-\"]);\nconst BINARY_OPS = new Set([\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"===\",\n \"!==\",\n \"<\",\n \"<=\",\n \">\",\n \">=\",\n \"&&\",\n \"||\",\n \"??\",\n]);\nconst ASSIGN_OPS = new Set([\"=\", \"+=\", \"-=\", \"*=\", \"/=\"]);\n\n/**\n * Does this expression node DO something rather than compute something?\n *\n * An assignment writes a target and yields nothing worth reading; a `+` or a `filter` yields a\n * value. The Data panel needs the distinction to know whether a row has a value column at all —\n * labelling `setBeds0` \"pending\" reads as \"still loading\" for a thing that will never load.\n */\nexport function isActionExpression(node: unknown): boolean {\n const op = (node as { operator?: unknown } | null | undefined)?.operator;\n return typeof op === \"string\" && ASSIGN_OPS.has(op);\n}\nconst NO_ARG_OPS = new Set([\"pop\", \"shift\"]);\nconst ONE_ARG_OPS = new Set([\"push\", \"unshift\"]);\n\nconst ZERO_ARG_METHOD_OPS = new Set([\n \"flat\",\n \"normalize\",\n \"toLocaleLowerCase\",\n \"toLocaleString\",\n \"toLocaleUpperCase\",\n \"toLowerCase\",\n \"toReversed\",\n \"toSorted\",\n \"toUpperCase\",\n \"trim\",\n \"trimEnd\",\n \"trimStart\",\n]);\n\nconst OPERATOR_GROUPS = [\n { label: \"Assignment\", ops: [\"=\", \"+=\", \"-=\", \"*=\", \"/=\"] },\n { label: \"Unary\", ops: [\"!\", \"-\"] },\n { label: \"Arithmetic\", ops: [\"+\", \"-\", \"*\", \"/\", \"%\"] },\n { label: \"Comparison\", ops: [\"===\", \"!==\", \"<\", \"<=\", \">\", \">=\"] },\n { label: \"Logical\", ops: [\"&&\", \"||\", \"??\"] },\n { label: \"Conditional\", ops: [\"?:\", \"switch\"] },\n {\n label: \"Array methods\",\n ops: [\"push\", \"pop\", \"shift\", \"unshift\", \"splice\"],\n },\n {\n label: \"Pure methods (String)\",\n ops: [\n \"toUpperCase\",\n \"toLowerCase\",\n \"trim\",\n \"trimStart\",\n \"trimEnd\",\n \"split\",\n \"startsWith\",\n \"endsWith\",\n \"padStart\",\n \"padEnd\",\n \"replaceAll\",\n \"repeat\",\n \"charAt\",\n \"normalize\",\n ],\n },\n {\n label: \"Pure methods (Array)\",\n ops: [\n \"includes\",\n \"indexOf\",\n \"lastIndexOf\",\n \"join\",\n \"slice\",\n \"concat\",\n \"at\",\n \"flat\",\n \"toSorted\",\n \"toReversed\",\n \"toSpliced\",\n \"with\",\n ],\n },\n { label: \"Pure methods (Number)\", ops: [\"toFixed\", \"toPrecision\", \"toLocaleString\"] },\n { label: \"Aggregate\", ops: [\"reduce\", \"map\", \"filter\"] },\n { label: \"Function\", ops: [\"call\"] },\n];\n\ninterface OperatorInfo {\n needsValue: boolean;\n needsInitial: boolean;\n targetMustBeRef: boolean;\n spliceArray: boolean;\n valueIsNode: boolean;\n switchCases: boolean;\n /** `call`: value is a positional-args array; target is the callee pointer. */\n callArgs: boolean;\n}\n\nconst INFO_DEFAULTS: OperatorInfo = {\n callArgs: false,\n needsInitial: false,\n needsValue: false,\n spliceArray: false,\n switchCases: false,\n targetMustBeRef: false,\n valueIsNode: false,\n};\n\n/**\n * @param {string} op\n * @returns {OperatorInfo}\n */\nfunction operatorInfo(op: string): OperatorInfo {\n if (UNARY_OPS.has(op)) {\n return { ...INFO_DEFAULTS };\n }\n if (op === \"?:\") {\n return { ...INFO_DEFAULTS, needsInitial: true, needsValue: true };\n }\n if (op === \"switch\") {\n return { ...INFO_DEFAULTS, switchCases: true };\n }\n if (op === \"call\") {\n return { ...INFO_DEFAULTS, callArgs: true, targetMustBeRef: true };\n }\n if (PURE_METHOD_OPS.has(op)) {\n // Receiver in target (any operand); zero-arg methods render no value row.\n return { ...INFO_DEFAULTS, needsValue: !ZERO_ARG_METHOD_OPS.has(op) };\n }\n if (BINARY_OPS.has(op)) {\n return { ...INFO_DEFAULTS, needsValue: true };\n }\n if (ASSIGN_OPS.has(op)) {\n return { ...INFO_DEFAULTS, needsValue: true, targetMustBeRef: true };\n }\n if (NO_ARG_OPS.has(op)) {\n return { ...INFO_DEFAULTS, targetMustBeRef: true };\n }\n if (ONE_ARG_OPS.has(op)) {\n return { ...INFO_DEFAULTS, needsValue: true, targetMustBeRef: true };\n }\n if (op === \"splice\") {\n return { ...INFO_DEFAULTS, needsValue: true, spliceArray: true, targetMustBeRef: true };\n }\n if (op === \"reduce\") {\n return {\n ...INFO_DEFAULTS,\n needsInitial: true,\n needsValue: true,\n targetMustBeRef: true,\n valueIsNode: true,\n };\n }\n if (op === \"map\" || op === \"filter\") {\n return { ...INFO_DEFAULTS, needsValue: true, targetMustBeRef: true, valueIsNode: true };\n }\n return { ...INFO_DEFAULTS };\n}\n\n// ─── Operand Mode Detection ─────────────────────────────────────────────────\n\n/**\n * Which rung of the value ladder an operand occupies. The three answers are the same three the\n * Properties, Style and Logic tabs give, and they are spelled the same way — `ui/value-source.ts`\n * owns the words, so `lit / $ref / expr` is gone from the operand picker (plan §6.3).\n *\n * @param {unknown} operand\n * @returns {\"ref\" | \"expression\" | \"literal\"}\n */\nfunction operandMode(operand: unknown) {\n if (operand && typeof operand === \"object\") {\n if (\"$ref\" in operand) {\n return \"ref\";\n }\n if (\"operator\" in operand) {\n return \"expression\";\n }\n }\n return \"literal\";\n}\n\n/** Positional-arg labels for a `call` node, from the callee's catalog entry when resolvable. */\nfunction calleeParamLabels(\n target: unknown,\n state?: Record<string, JxStateDefinition> | null,\n): string[] {\n const ref = isRef(target) ? target.$ref : \"\";\n const entry = ref ? calleeEntry(ref, state) : undefined;\n return entry?.kind === \"formula\" ? entry.parameters.map((p) => p.name) : [];\n}\n\n/**\n * @param {string} mode\n * @returns {JxExpressionOperand}\n */\nfunction defaultForMode(mode: string): JxExpressionOperand {\n if (mode === \"ref\") {\n return { $ref: \"\" };\n }\n if (mode === \"expression\") {\n return { operator: \"!\", target: null };\n }\n return null;\n}\n\n// ─── Literal Type Detection ─────────────────────────────────────────────────\n\n/**\n * @param {unknown} val\n * @returns {\"string\" | \"number\" | \"boolean\" | \"null\"}\n */\nfunction literalType(val: unknown) {\n if (val === null || val === undefined) {\n return \"null\";\n }\n if (typeof val === \"boolean\") {\n return \"boolean\";\n }\n if (typeof val === \"number\") {\n return \"number\";\n }\n return \"string\";\n}\n\n/**\n * @param {string} type\n * @returns {JxExpressionOperand}\n */\nfunction defaultForLiteralType(type: string): JxExpressionOperand {\n if (type === \"number\") {\n return 0;\n }\n if (type === \"boolean\") {\n return false;\n }\n if (type === \"null\") {\n return null;\n }\n return \"\";\n}\n\n// ─── Hint (one-line summary for signal rows) ────────────────────────────────\n\n/**\n * @param {unknown} node\n * @returns {string}\n */\nexport function expressionHint(node: unknown) {\n if (!isJsonObject(node) || typeof node.operator !== \"string\") {\n return \"$expression\";\n }\n const expr = node as unknown as JxExpressionNode;\n const op = expr.operator;\n const { target } = expr;\n const targetLabel = isRef(target)\n ? target.$ref.replace(\"#/state/\", \"\")\n : isJsonObject(target) && typeof target.operator === \"string\"\n ? `(${target.operator}…)`\n : String(target ?? \"?\");\n\n if (ASSIGN_OPS.has(op) || ONE_ARG_OPS.has(op)) {\n return `${op} ${targetLabel}`;\n }\n if (NO_ARG_OPS.has(op)) {\n return `${op}(${targetLabel})`;\n }\n if (op === \"splice\") {\n return `splice(${targetLabel})`;\n }\n if (op === \"call\") {\n return `${targetLabel.replace(\"window#/\", \"\").replaceAll(\"/\", \".\")}(…)`;\n }\n if (op === \"reduce\" || op === \"map\" || op === \"filter\" || PURE_METHOD_OPS.has(op)) {\n return `${op}(${targetLabel})`;\n }\n if (op === \"?:\") {\n return `${targetLabel} ? … : …`;\n }\n if (op === \"switch\") {\n return `switch(${targetLabel})`;\n }\n if (UNARY_OPS.has(op)) {\n return `${op}${targetLabel}`;\n }\n return `${targetLabel} ${op} …`;\n}\n\n// ─── Live Value Badge (spec §19.9) ──────────────────────────────────────────\n\n/** Preview data computed by services/preview-eval.ts — display strings keyed by node path. */\nexport interface EditorPreview {\n values: Map<string, string>;\n error: string | null;\n mutating: boolean;\n}\n\nfunction renderValueBadge(preview: EditorPreview | null | undefined, pathKey: string) {\n const text = preview?.values.get(pathKey);\n if (text === undefined) {\n return nothing;\n }\n return html`<span class=\"expr-live-badge\" title=${text}>${text}</span>`;\n}\n\n// ─── Ref Picker ─────────────────────────────────────────────────────────────\n\n/**\n * @param {string} refVal\n * @param {(newRef: string) => void} onRefChange\n * @param {{ stateDefs: string[]; allowEventRef: boolean }} opts\n * @returns {import(\"lit-html\").TemplateResult}\n */\nfunction renderRefPicker(\n refVal: string,\n onRefChange: (newRef: string) => void,\n opts: { stateDefs: string[]; allowEventRef: boolean },\n) {\n const stateRefs = (opts.stateDefs || []).map((k) => `#/state/${k}`);\n const eventRefs = opts.allowEventRef ? [\"event#/detail\", \"event#/target/value\"] : [];\n const allRefs = [...stateRefs, ...eventRefs];\n const isCustom = refVal && !allRefs.includes(refVal);\n\n // Nothing to pick and nothing already picked: a picker whose only entry is a disabled \"No state\n // Defined\" is a dead end. Say what a binding is instead, in the shell's one empty-state voice.\n if (allRefs.length === 0 && !refVal) {\n return renderEmptyState({\n compact: true,\n detail: \"Add one in the State panel and it shows up here.\",\n message: \"A binding points at a value this page holds.\",\n });\n }\n\n return html`\n <sp-picker\n size=\"s\"\n class=\"expr-ref\"\n placeholder=\"Select…\"\n .value=${live(isCustom ? \"__custom__\" : refVal || \"\")}\n @change=${(e: Event) => {\n const val = (e.target as HTMLInputElement).value;\n if (val === \"__custom__\") {\n return;\n }\n onRefChange(val);\n }}\n >\n ${stateRefs.map(\n (r) => html`<sp-menu-item value=${r}>${r.replace(\"#/state/\", \"\")}</sp-menu-item>`,\n )}\n ${\n eventRefs.length > 0\n ? html`\n <sp-menu-divider></sp-menu-divider>\n ${eventRefs.map((r) => html`<sp-menu-item value=${r}>${r}</sp-menu-item>`)}\n `\n : nothing\n }\n </sp-picker>\n `;\n}\n\n// ─── Literal Editor ─────────────────────────────────────────────────────────\n\n/**\n * @param {unknown} operand\n * @param {(newVal: JxExpressionOperand) => void} onChange\n * @returns {import(\"lit-html\").TemplateResult}\n */\nfunction renderLiteralEditor(operand: unknown, onChange: (newVal: JxExpressionOperand) => void) {\n const type = literalType(operand);\n return html`\n <div class=\"expr-literal\">\n <sp-picker\n size=\"s\"\n class=\"expr-literal-type\"\n .value=${live(type)}\n @change=${(e: Event) => {\n const newType = (e.target as HTMLInputElement).value;\n onChange(defaultForLiteralType(newType));\n }}\n >\n <sp-menu-item value=\"string\">str</sp-menu-item>\n <sp-menu-item value=\"number\">num</sp-menu-item>\n <sp-menu-item value=\"boolean\">bool</sp-menu-item>\n <sp-menu-item value=\"null\">null</sp-menu-item>\n </sp-picker>\n ${\n type === \"string\"\n ? html`<sp-textfield\n size=\"s\"\n class=\"expr-literal-value\"\n .value=${live(String(operand ?? \"\"))}\n @input=${(e: Event) => onChange((e.target as HTMLInputElement).value)}\n ></sp-textfield>`\n : type === \"number\"\n ? html`<sp-number-field\n size=\"s\"\n class=\"expr-literal-value\"\n .value=${live(Number(operand ?? 0))}\n @change=${(e: Event) => onChange(Number((e.target as HTMLInputElement).value))}\n ></sp-number-field>`\n : type === \"boolean\"\n ? html`<sp-checkbox\n size=\"s\"\n class=\"expr-literal-bool\"\n ?checked=${Boolean(operand)}\n @change=${(e: Event) => onChange((e.target as HTMLInputElement).checked)}\n >true</sp-checkbox\n >`\n : html`<span class=\"expr-literal-null\">null</span>`\n }\n </div>\n `;\n}\n\n// ─── Operand Editor ─────────────────────────────────────────────────────────\n\n/**\n * Single-operand editor (mode picker + literal/ref/nested-expression widget). Exported for\n * statement-position operand slots (spec §20: `if` tests, `$switch` discriminants, `dispatchEvent`\n * detail).\n *\n * @param {unknown} operand\n * @param {(newOperand: unknown) => void} onChange\n * @param {{\n * stateDefs: string[];\n * allowEventRef: boolean;\n * depth: number;\n * mustBeRef?: boolean;\n * }} opts\n * @returns {import(\"lit-html\").TemplateResult}\n */\nexport function renderOperandEditor(\n operand: unknown,\n onChange: (newOperand: unknown) => void,\n opts: {\n stateDefs: string[];\n allowEventRef: boolean;\n depth: number;\n mustBeRef?: boolean;\n preview?: EditorPreview | null;\n path?: (string | number)[];\n stateEntries?: Record<string, JxStateDefinition> | null;\n },\n): TemplateResult {\n if (opts.mustBeRef) {\n const refVal = ((operand as Record<string, unknown> | null)?.$ref as string) ?? \"\";\n return html`\n <div class=\"expr-operand\">${renderRefPicker(refVal, (r) => onChange({ $ref: r }), opts)}</div>\n `;\n }\n\n const mode = operandMode(operand);\n return html`\n <div class=\"expr-operand\">\n <sp-picker\n size=\"s\"\n class=\"expr-operand-mode\"\n label=\"Value source\"\n .value=${live(mode)}\n @change=${(e: Event) => {\n const newMode = (e.target as HTMLInputElement).value;\n onChange(defaultForMode(newMode));\n }}\n >\n <sp-menu-item value=\"literal\">${VALUE_SOURCE_LABELS.literal}</sp-menu-item>\n <sp-menu-item value=\"ref\">${VALUE_SOURCE_LABELS.ref}</sp-menu-item>\n <sp-menu-item value=\"expression\">${VALUE_SOURCE_LABELS.expression}</sp-menu-item>\n </sp-picker>\n ${\n mode === \"literal\"\n ? renderLiteralEditor(operand, onChange)\n : mode === \"ref\"\n ? renderRefPicker(\n ((operand as Record<string, unknown> | null)?.$ref as string) ?? \"\",\n (r) => onChange({ $ref: r }),\n opts,\n )\n : renderExpressionEditor(operand, onChange, {\n ...opts,\n depth: opts.depth + 1,\n })\n }\n </div>\n `;\n}\n\n// ─── Positional Args Editor (splice / call) ─────────────────────────────────\n\n/**\n * @param {unknown[]} args\n * @param {(newArgs: unknown[]) => void} onChange\n * @param {{ stateDefs: string[]; allowEventRef: boolean; depth: number }} opts\n * @param {{ labels?: string[]; fallbackLabel?: string }} [naming]\n * @returns {import(\"lit-html\").TemplateResult}\n */\nfunction renderSpliceArgsEditor(\n args: unknown[],\n onChange: (newArgs: unknown[]) => void,\n opts: { stateDefs: string[]; allowEventRef: boolean; depth: number },\n naming: { labels?: string[]; fallbackLabel?: string } = {},\n): TemplateResult {\n const safeArgs = Array.isArray(args) ? args : [];\n const labels = naming.labels ?? [\"start\", \"del\", \"item\"];\n const fallbackLabel = naming.fallbackLabel ?? \"item\";\n\n return html`\n <div class=\"array-object-field\">\n ${safeArgs.map(\n (arg, idx) => html`\n <div class=\"array-object-row\">\n <span class=\"array-object-label\">${labels[idx] ?? fallbackLabel}</span>\n ${renderOperandEditor(\n arg,\n (newArg) => {\n const updated = [...safeArgs];\n updated[idx] = newArg;\n onChange(updated);\n },\n { ...opts, mustBeRef: false },\n )}\n <sp-action-button\n quiet\n size=\"xs\"\n @click=${() => {\n const updated = safeArgs.filter((_, i) => i !== idx);\n onChange(updated.length > 0 ? updated : [null]);\n }}\n >\n <sp-icon-delete slot=\"icon\"></sp-icon-delete>\n </sp-action-button>\n </div>\n `,\n )}\n <sp-action-button quiet size=\"s\" @click=${() => onChange([...safeArgs, null])}>\n + Add arg\n </sp-action-button>\n </div>\n `;\n}\n\n// ─── Operator Picker Menu ───────────────────────────────────────────────────\n\nconst _operatorMenuCache = OPERATOR_GROUPS.map(\n (group, i) => html`\n ${i > 0 ? html`<sp-menu-divider></sp-menu-divider>` : nothing}\n <sp-menu-group>\n <span slot=\"header\">${group.label}</span>\n ${group.ops.map((op) => html`<sp-menu-item value=${op}>${op}</sp-menu-item>`)}\n </sp-menu-group>\n `,\n);\n\n// ─── Main Expression Editor ─────────────────────────────────────────────────\n\nexport interface ExpressionEditorOpts {\n stateDefs: string[];\n allowEventRef: boolean;\n depth?: number;\n preview?: EditorPreview | null;\n path?: (string | number)[];\n /** Full state defs map — resolves named-formula catalog entries (call labels, palette). */\n stateEntries?: Record<string, JxStateDefinition> | null;\n /** Chip-strip click hook (depth 0). No-op when absent. */\n onChipSelect?: (path: (string | number)[]) => void;\n /** Vendors a packaged formula's state entry into the document on catalog pick. */\n onInsertDef?: (name: string, def: JxStateDefinition) => void;\n}\n\n/**\n * @param {unknown} node\n * @param {(node: unknown) => void} onChange\n * @param {ExpressionEditorOpts} opts\n * @returns {import(\"lit-html\").TemplateResult}\n */\nexport function renderExpressionEditor(\n node: unknown,\n onChange: (node: unknown) => void,\n opts: ExpressionEditorOpts,\n): TemplateResult {\n const depth = opts.depth ?? 0;\n const safeNode: Record<string, unknown> =\n node && typeof node === \"object\"\n ? (node as Record<string, unknown>)\n : { operator: \"=\", target: null };\n const op = (safeNode.operator as string) || \"=\";\n const info = operatorInfo(op);\n const preview = opts.preview ?? null;\n const path = opts.path ?? [];\n const pathKey = path.join(\"/\");\n const sub = (...segs: (string | number)[]) => [...path, ...segs].join(\"/\");\n /** Wrap an operand widget with its live value badge. */\n const withBadge = (widget: unknown, key: string) =>\n html`<div class=\"expr-widget\">${widget}${renderValueBadge(preview, key)}</div>`;\n\n // The root badge: pure roots show their result; mutating roots' effect shows on target/value.\n const rootBadge =\n depth === 0 && preview && !preview.mutating ? renderValueBadge(preview, pathKey) : nothing;\n\n return html`\n <div class=${depth > 0 ? \"expression-editor expression-editor--nested\" : \"expression-editor\"}>\n ${\n depth === 0\n ? renderFormulaChips(safeNode, opts.onChipSelect ?? (() => {}), { path, preview })\n : nothing\n }\n ${\n depth === 0 && preview?.error\n ? html`<div class=\"expr-error\">${preview.error}</div>`\n : nothing\n }\n ${renderFieldRow({\n hasValue: false,\n label: \"Operator\",\n prop: \"operator\",\n widget: html`\n <div class=\"expr-widget\">\n <sp-picker\n size=\"s\"\n class=\"expr-operator\"\n .value=${live(op)}\n @change=${(e: Event) => {\n const newOp = (e.target as HTMLInputElement).value;\n const newInfo = operatorInfo(newOp);\n const updated: Record<string, unknown> = {\n operator: newOp,\n target: safeNode.target,\n };\n if (newInfo.targetMustBeRef && operandMode(safeNode.target) !== \"ref\") {\n updated.target = { $ref: \"\" };\n }\n if (newInfo.needsValue) {\n if (newInfo.valueIsNode) {\n const val = safeNode.value as Record<string, unknown> | null;\n updated.value = val?.operator\n ? safeNode.value\n : { operator: \"!\", target: null };\n } else if (newInfo.spliceArray) {\n updated.value = Array.isArray(safeNode.value) ? safeNode.value : [null];\n } else {\n updated.value = safeNode.value ?? null;\n }\n }\n if (newInfo.needsInitial) {\n updated.initial = safeNode.initial ?? (newOp === \"?:\" ? null : 0);\n }\n if (newInfo.switchCases) {\n updated.cases = isJsonObject(safeNode.cases) ? safeNode.cases : {};\n if (\"default\" in safeNode) {\n updated.default = safeNode.default;\n }\n }\n if (newInfo.callArgs) {\n updated.value = Array.isArray(safeNode.value) ? safeNode.value : [];\n }\n onChange(updated);\n }}\n >\n ${_operatorMenuCache}\n </sp-picker>\n <sp-action-button\n quiet\n size=\"s\"\n class=\"expr-browse-catalog\"\n title=\"Browse catalog\"\n @click=${(e: Event) =>\n openFormulaPalette({\n anchor: e.currentTarget as HTMLElement,\n entries: formulaCatalog(opts.stateEntries),\n onPick: (entry) =>\n applyCatalogPick(entry, onChange, {\n onInsertDef: opts.onInsertDef,\n stateEntries: opts.stateEntries,\n }),\n })}\n >\n <sp-icon-brackets slot=\"icon\"></sp-icon-brackets>\n </sp-action-button>\n ${rootBadge}\n </div>\n `,\n })}\n ${renderFieldRow({\n hasValue: false,\n label: op === \"?:\" ? \"If\" : op === \"switch\" ? \"On\" : op === \"call\" ? \"Callee\" : \"Target\",\n prop: \"target\",\n widget: withBadge(\n renderOperandEditor(safeNode.target, (t) => onChange({ ...safeNode, target: t }), {\n ...opts,\n depth,\n mustBeRef: info.targetMustBeRef,\n path: [...path, \"target\"],\n }),\n sub(\"target\"),\n ),\n })}\n ${\n info.needsValue && !info.valueIsNode && !info.spliceArray\n ? renderFieldRow({\n hasValue: false,\n label: op === \"?:\" ? \"Then\" : \"Value\",\n prop: \"value\",\n widget: withBadge(\n renderOperandEditor(safeNode.value, (v) => onChange({ ...safeNode, value: v }), {\n ...opts,\n depth,\n mustBeRef: false,\n path: [...path, \"value\"],\n }),\n sub(\"value\"),\n ),\n })\n : nothing\n }\n ${\n info.needsValue && info.valueIsNode\n ? html`\n <div class=\"expr-subsection\">\n ${renderFieldRow({\n hasValue: false,\n label: \"Per-item\",\n prop: \"value\",\n widget: nothing,\n })}\n ${renderExpressionEditor(\n (safeNode.value as Record<string, unknown> | null)?.operator\n ? safeNode.value\n : { operator: \"!\", target: null },\n (v) => onChange({ ...safeNode, value: v }),\n { ...opts, depth: depth + 1, path: [...path, \"value\"] },\n )}\n </div>\n `\n : nothing\n }\n ${\n info.spliceArray\n ? html`\n <div class=\"expr-subsection\">\n ${renderFieldRow({\n hasValue: false,\n label: \"Args\",\n prop: \"value\",\n widget: nothing,\n })}\n ${renderSpliceArgsEditor(\n safeNode.value as unknown[],\n (v) => onChange({ ...safeNode, value: v }),\n {\n ...opts,\n depth,\n },\n )}\n </div>\n `\n : nothing\n }\n ${\n info.callArgs\n ? html`\n <div class=\"expr-subsection\">\n ${renderFieldRow({\n hasValue: false,\n label: \"Args\",\n prop: \"value\",\n widget: nothing,\n })}\n ${renderSpliceArgsEditor(\n safeNode.value as unknown[],\n (v) => onChange({ ...safeNode, value: v }),\n { ...opts, depth },\n {\n fallbackLabel: \"arg\",\n labels: calleeParamLabels(safeNode.target, opts.stateEntries),\n },\n )}\n </div>\n `\n : nothing\n }\n ${\n info.switchCases\n ? renderSwitchCasesEditor(safeNode, onChange, { ...opts, depth, path }, withBadge)\n : nothing\n }\n ${\n info.needsInitial\n ? renderFieldRow({\n hasValue: false,\n label: op === \"?:\" ? \"Else\" : \"Initial\",\n prop: \"initial\",\n widget: withBadge(\n renderOperandEditor(\n safeNode.initial,\n (v) => onChange({ ...safeNode, initial: v }),\n {\n ...opts,\n depth,\n mustBeRef: false,\n path: [...path, \"initial\"],\n },\n ),\n sub(\"initial\"),\n ),\n })\n : nothing\n }\n </div>\n `;\n}\n\n// ─── Switch Cases Editor ────────────────────────────────────────────────────\n\n/**\n * Case rows for the `switch` operator: matched value → result operand, plus the default operand.\n * Mirrors the element-level `$switch`/`cases` model (spec §19.4b).\n */\nfunction renderSwitchCasesEditor(\n safeNode: Record<string, unknown>,\n onChange: (node: unknown) => void,\n opts: {\n stateDefs: string[];\n allowEventRef: boolean;\n depth: number;\n preview?: EditorPreview | null;\n path: (string | number)[];\n },\n withBadge: (widget: unknown, key: string) => TemplateResult,\n): TemplateResult {\n const cases = isJsonObject(safeNode.cases)\n ? (safeNode.cases as Record<string, unknown>)\n : ({} as Record<string, unknown>);\n const entries = Object.entries(cases);\n const setCases = (next: Record<string, unknown>) => onChange({ ...safeNode, cases: next });\n\n return html`\n <div class=\"switch-cases\">\n ${entries.map(\n ([key, operand]) => html`\n <div class=\"switch-case-row\">\n <sp-textfield\n size=\"s\"\n class=\"switch-case-key\"\n placeholder=\"value\"\n .value=${live(key)}\n @change=${(e: Event) => {\n const newKey = (e.target as HTMLInputElement).value;\n if (newKey === key) {\n return;\n }\n const next: Record<string, unknown> = {};\n for (const [k, v] of entries) {\n next[k === key ? newKey : k] = v;\n }\n setCases(next);\n }}\n ></sp-textfield>\n ${withBadge(\n renderOperandEditor(operand, (v) => setCases({ ...cases, [key]: v }), {\n ...opts,\n mustBeRef: false,\n path: [...opts.path, \"cases\", key],\n }),\n [...opts.path, \"cases\", key].join(\"/\"),\n )}\n <sp-action-button\n quiet\n size=\"xs\"\n @click=${() => {\n const next = { ...cases };\n delete next[key];\n setCases(next);\n }}\n >\n <sp-icon-delete slot=\"icon\"></sp-icon-delete>\n </sp-action-button>\n </div>\n `,\n )}\n <div class=\"switch-case-row\">\n <span class=\"switch-case-key switch-case-default\">default</span>\n ${withBadge(\n renderOperandEditor(safeNode.default, (v) => onChange({ ...safeNode, default: v }), {\n ...opts,\n mustBeRef: false,\n path: [...opts.path, \"default\"],\n }),\n [...opts.path, \"default\"].join(\"/\"),\n )}\n </div>\n <sp-action-button\n quiet\n size=\"s\"\n @click=${() => {\n let n = entries.length + 1;\n let key = `case ${n}`;\n while (Object.hasOwn(cases, key)) {\n n += 1;\n key = `case ${n}`;\n }\n setCases({ ...cases, [key]: null });\n }}\n >\n + Add case\n </sp-action-button>\n </div>\n `;\n}\n",
32
+ "/// <reference lib=\"dom\" />\n/**\n * Dynamic-slot — the shared Value Source control for any bindable document position.\n *\n * Renders the panel-provided static widget plus a label-side chip that names, in plain language,\n * how this value is produced — Fixed value / From data… / Mixed text / Formula\n * (`ui/value-source.ts` owns the vocabulary). Clicking the chip opens a picker listing every rung\n * the position permits, so **any rung is one action away**. It used to be a cycle ring: `$ref →\n * literal` meant passing through `${}`, committing a template to the document on the way past, and\n * the only way to know where the next click would land was the tooltip.\n *\n * The rungs are not declared by the caller but **derived from the schema** at the named position\n * (plan §6.3): `caps` is a {@link SlotPosition}, or a schema handed in for the one case a position\n * name cannot cover — a field in an extension's config form, whose schema arrives at runtime. There\n * is no way for a caller to state a rung list of its own.\n *\n * Each mode's last value is remembered per field for the session, so switching back to an earlier\n * mode restores what the user had there. The same memory is exported for the Events tab, which\n * offers the same ladder in its own layout.\n */\n\nimport { html, nothing } from \"lit-html\";\nimport { live } from \"lit-html/directives/live.js\";\nimport { isRef } from \"@jxsuite/schema/guards\";\nimport { cloneValue } from \"../tabs/doc-op-apply\";\nimport { activeTab } from \"../workspace/workspace\";\nimport { renderExpressionEditor } from \"./expression-editor\";\nimport { VALUE_SOURCE_HINTS, VALUE_SOURCE_LABELS, slotCaps, slotMode } from \"./value-source\";\n\nimport type { TemplateResult } from \"lit-html\";\nimport type { EditorPreview } from \"./expression-editor\";\nimport type { JxStateDefinition } from \"@jxsuite/schema/types\";\nimport type { JsonValue } from \"../types\";\nimport type { SlotCapsSource, SlotMode } from \"./value-source\";\n\nexport type { SlotCapsSource, SlotMode, SlotPosition } from \"./value-source\";\nexport { slotCaps, slotMode } from \"./value-source\";\n\n/*\n * Session memory of each field's last value per mode, so switching modes round-trips user input.\n * Keyed `${tabId}|${fieldKey}|${mode}`; the mode key is derived from the value at stash time, so a\n * restore always lands a value whose slotMode() matches the target mode. `undefined` is a\n * legitimate stash (cleared literal), hence Map.has() discrimination on recall.\n */\nconst slotModeMemory = new Map<string, JsonValue | undefined>();\n\n/*\n * The rung each field is CURRENTLY being edited at, keyed `${tabId}|${fieldKey}`.\n *\n * Without this the rendered rung was re-sniffed from the document value on every render, so typing\n * `${` into a Fixed value field swapped the widget out from under the cursor mid-keystroke — and\n * typing the closing brace away swapped it back. A keystroke can only ever move a value between\n * the literal and mixed-text rungs (both are plain strings); every other transition needs a\n * structural change to the value, which a text edit cannot make. So those two rungs hold once\n * entered, and everything else still follows the document.\n */\nconst slotModeRendered = new Map<string, SlotMode>();\n\n/** Test hook: drop all remembered per-mode field values and per-field rungs. */\nexport function resetSlotModeMemory(): void {\n slotModeMemory.clear();\n slotModeRendered.clear();\n}\n\nfunction memoryKey(fieldKey: string, mode: SlotMode): string {\n return `${activeTab.value?.id ?? \"-\"}|${fieldKey}|${mode}`;\n}\n\nfunction fieldScopeKey(fieldKey: string): string {\n return `${activeTab.value?.id ?? \"-\"}|${fieldKey}`;\n}\n\n/** Remember `value` as this field's representation at `mode`, for a later switch back. */\nexport function stashSlotValue(\n fieldKey: string,\n mode: SlotMode,\n value: JsonValue | undefined,\n): void {\n slotModeMemory.set(memoryKey(fieldKey, mode), cloneValue(value));\n}\n\n/** Whether this field has a remembered representation at `mode`. */\nexport function hasStashedSlotValue(fieldKey: string, mode: SlotMode): boolean {\n return slotModeMemory.has(memoryKey(fieldKey, mode));\n}\n\n/** This field's remembered representation at `mode` (a fresh clone). */\nexport function recallSlotValue(fieldKey: string, mode: SlotMode): JsonValue | undefined {\n return cloneValue(slotModeMemory.get(memoryKey(fieldKey, mode)));\n}\n\n/** Record the rung the user just chose for this field, so the next render honours it. */\nexport function setSlotMode(fieldKey: string, mode: SlotMode): void {\n slotModeRendered.set(fieldScopeKey(fieldKey), mode);\n}\n\n/** Whether a keystroke alone could have produced this rung transition. */\nfunction isTextEditRung(mode: SlotMode): boolean {\n return mode === \"literal\" || mode === \"template\";\n}\n\n/**\n * The rung to render this field at: the one it is already being edited at when a text edit could\n * explain the difference, otherwise whatever the document value says. Records its answer.\n */\nexport function effectiveSlotMode(fieldKey: string, value: unknown): SlotMode {\n const key = fieldScopeKey(fieldKey);\n const sniffed = slotMode(value);\n const previous = slotModeRendered.get(key);\n const mode =\n previous !== undefined && isTextEditRung(previous) && isTextEditRung(sniffed)\n ? previous\n : sniffed;\n slotModeRendered.set(key, mode);\n return mode;\n}\n\nfunction hasRefOptions(opts: DynamicSlotOpts): boolean {\n return opts.stateDefs.length > 0 || Boolean(opts.extraSignals?.length);\n}\n\nexport interface SignalOption {\n value: string;\n label: string;\n}\n\nexport interface DynamicSlotOpts {\n /** Stable identity for per-mode value memory; must incorporate the node path. */\n fieldKey: string;\n /** Current raw document value at this position. */\n value: unknown;\n /** Write-through to the document; `undefined` clears the position. */\n onChange: (v?: JsonValue) => void;\n /** Panel-provided literal editor for this slot's type. */\n staticWidget: unknown;\n /** Where this slot's rungs are derived from — a named document position, or a schema. */\n caps: SlotCapsSource;\n /** State keys offered by the ref picker and expression editor. */\n stateDefs: string[];\n /**\n * Let the From data… rung take a pointer that is not in its list.\n *\n * The list is complete wherever it is a component's own signals. It is not complete in an\n * extension's config form, where a value may point at a route param, a signal, or a pointer\n * neither the form nor the panel enumerates — so there the same rung is a combobox whose options\n * are suggestions, which is what `jx-value-selector` is for.\n */\n allowCustomRef?: boolean;\n /** Full state defs map — lets expression mode resolve named-formula catalog entries. */\n stateEntries?: Record<string, JxStateDefinition> | null;\n /** Extra pointer options beyond #/state/* (e.g. $map/item within repeater templates). */\n extraSignals?: SignalOption[] | null;\n /** Offer event#/ refs inside expression mode (handler positions only). */\n allowEventRef?: boolean;\n /** Live values for expression mode badges (services/preview-eval.ts). */\n preview?: EditorPreview | null;\n /** Static value restored when de-escalating to literal mode. */\n literalDefault?: JsonValue;\n /**\n * A position-specific seed for a rung, overriding the generic one.\n *\n * The generic expression seed is `{ operator: \"??\" }`, which is a sensible starting point almost\n * everywhere and an INVALID document in a position whose schema narrows which operators it takes.\n * An element's `tagName` is the first such position — a `TagExpression` is `?:` or `switch` and\n * nothing else — so a generic seed would drop a document that fails its own validator the moment\n * the chip is clicked. Return `undefined` to accept the generic seed.\n */\n seedFor?: (mode: SlotMode) => JsonValue | undefined;\n}\n\nfunction defaultForSlotMode(mode: SlotMode, opts: DynamicSlotOpts): JsonValue | undefined {\n switch (mode) {\n case \"ref\": {\n const [first] = opts.stateDefs;\n return first ? { $ref: `#/state/${first}` } : { $ref: opts.extraSignals?.[0]?.value ?? \"\" };\n }\n case \"template\": {\n const [first] = opts.stateDefs;\n return first ? `\\${state.${first}}` : \"${}\";\n }\n case \"expression\": {\n return { $expression: { operator: \"??\", target: null, value: null } };\n }\n case \"function\": {\n return { $prototype: \"Function\", body: \"\", parameters: [] };\n }\n default: {\n return opts.literalDefault;\n }\n }\n}\n\n/** Every pointer the From data… rung offers, as `{ value, label }` options. */\nfunction refOptions(opts: DynamicSlotOpts): SignalOption[] {\n return [\n ...opts.stateDefs.map((name) => ({ label: name, value: `#/state/${name}` })),\n ...(opts.extraSignals ?? []),\n ];\n}\n\nfunction renderCustomRefWidget(refVal: string, opts: DynamicSlotOpts) {\n return html`\n <jx-value-selector\n size=\"s\"\n style=\"flex:1\"\n placeholder=\"#/state/…\"\n .value=${refVal}\n .options=${refOptions(opts)}\n @change=${(e: Event & { detail?: { value?: string } }) => {\n const v = (e.detail?.value ?? (e.target as HTMLInputElement).value ?? \"\").trim();\n if (v) {\n opts.onChange({ $ref: v });\n } else {\n opts.onChange();\n }\n }}\n ></jx-value-selector>\n `;\n}\n\nfunction renderRefWidget(refVal: string, opts: DynamicSlotOpts) {\n if (opts.allowCustomRef) {\n return renderCustomRefWidget(refVal, opts);\n }\n return html`\n <sp-picker\n size=\"s\"\n quiet\n style=\"flex:1\"\n placeholder=\"— select signal —\"\n value=${refVal || nothing}\n @change=${(e: Event) => {\n const v = (e.target as HTMLInputElement).value;\n if (v) {\n opts.onChange({ $ref: v });\n } else {\n opts.onChange();\n }\n }}\n >\n ${opts.stateDefs.map(\n (name) => html`<sp-menu-item value=${`#/state/${name}`}>${name}</sp-menu-item>`,\n )}\n ${\n opts.extraSignals?.length\n ? html`\n <sp-menu-divider></sp-menu-divider>\n ${opts.extraSignals.map(\n (sig) => html`<sp-menu-item value=${sig.value}>${sig.label}</sp-menu-item>`,\n )}\n `\n : nothing\n }\n </sp-picker>\n `;\n}\n\nfunction renderTemplateWidget(value: unknown, opts: DynamicSlotOpts) {\n return html`\n <sp-textfield\n size=\"s\"\n style=\"flex:1;font-family:var(--spectrum-code-font-family, monospace)\"\n placeholder=\"\\${state.…}\"\n .value=${live(String(value ?? \"\"))}\n @change=${(e: Event) => opts.onChange((e.target as HTMLInputElement).value)}\n ></sp-textfield>\n `;\n}\n\nexport interface DynamicSlotParts {\n /** Label-side Value Source chip and its picker. */\n modeButton: TemplateResult;\n /** Active-mode widget, sized to fill the row's widget column. */\n widget: TemplateResult;\n}\n\n/**\n * Switch a field to `next`: stash the outgoing representation, restore the incoming one if this\n * field has been there before, and record the new rung. Shared with the Events tab, which used to\n * throw the outgoing representation away on every mode change.\n */\nexport function switchSlotMode(\n fieldKey: string,\n from: SlotMode,\n to: SlotMode,\n current: JsonValue | undefined,\n seed: JsonValue | undefined,\n): JsonValue | undefined {\n stashSlotValue(fieldKey, from, current);\n setSlotMode(fieldKey, to);\n return hasStashedSlotValue(fieldKey, to) ? recallSlotValue(fieldKey, to) : seed;\n}\n\n/** A DOM id for the chip, so `sp-overlay` can name it as its trigger. */\nfunction chipId(fieldKey: string): string {\n return `value-source-${fieldKey.replaceAll(/[^\\dA-Za-z]+/g, \"-\")}`;\n}\n\n/**\n * The label-side Value Source chip: the current rung in plain language — quiet while the value is\n * fixed, accent-tinted once it is produced from something else — opening a picker of every rung\n * this position permits.\n */\nfunction renderModeChip(mode: SlotMode, caps: SlotMode[], opts: DynamicSlotOpts): TemplateResult {\n const color =\n mode === \"literal\"\n ? \"color:var(--spectrum-gray-600, #808080)\"\n : \"color:var(--spectrum-accent-content-color-default, #5c9dff)\";\n // A ref rung with nothing to point at is a dead end — drop it rather than offer an empty picker.\n const offered = caps.filter((m) => m !== \"ref\" || hasRefOptions(opts));\n const label = VALUE_SOURCE_LABELS[mode];\n /* Disabled only when the rung this value already sits on is the only one there is. A value on a\n rung the position does NOT permit — a fixed string left in a `$switch`, say — is exactly the\n case that needs the chip most, and counting rungs alone used to grey it out. */\n if (!offered.some((m) => m !== mode)) {\n const hint = `Value source: ${label} (no other source available here)`;\n return html`\n <sp-action-button\n size=\"xs\"\n quiet\n disabled\n class=\"dynamic-slot-mode\"\n style=${color}\n title=${hint}\n aria-label=${hint}\n >${label}</sp-action-button\n >\n `;\n }\n const id = chipId(opts.fieldKey);\n const hint = `Value source: ${label} — click to change`;\n const choose = (next: SlotMode) => {\n if (next === mode) {\n return;\n }\n /* Leaving ref seeds an empty literal stash with the signal's declared default, so\n unbind-restores-default survives a detour (ref → mixed text → fixed value). */\n if (\n mode === \"ref\" &&\n opts.literalDefault !== undefined &&\n !hasStashedSlotValue(opts.fieldKey, \"literal\")\n ) {\n stashSlotValue(opts.fieldKey, \"literal\", opts.literalDefault);\n }\n opts.onChange(\n switchSlotMode(\n opts.fieldKey,\n mode,\n next,\n cloneValue(opts.value as JsonValue | undefined),\n opts.seedFor?.(next) ?? defaultForSlotMode(next, opts),\n ),\n );\n };\n return html`\n <sp-action-button\n id=${id}\n size=\"xs\"\n quiet\n class=\"dynamic-slot-mode\"\n style=${color}\n title=${hint}\n aria-label=${hint}\n >${label}</sp-action-button\n >\n <sp-overlay trigger=\"${id}@click\" placement=\"bottom-start\" type=\"auto\">\n <sp-popover>\n <sp-menu size=\"s\" label=\"Value source\">\n ${offered.map(\n (m) => html`\n <sp-menu-item data-mode=${m} ?selected=${m === mode} @click=${() => choose(m)}\n >${VALUE_SOURCE_LABELS[m]}\n <span slot=\"description\">${VALUE_SOURCE_HINTS[m]}</span></sp-menu-item\n >\n `,\n )}\n </sp-menu>\n </sp-popover>\n </sp-overlay>\n `;\n}\n\n/**\n * Render a bindable slot as two parts the panel places independently: the active mode's widget for\n * the row's value column, and the Value Source chip for the label side.\n */\nexport function renderDynamicSlot(opts: DynamicSlotOpts): DynamicSlotParts {\n const caps = slotCaps(opts.caps);\n const mode = effectiveSlotMode(opts.fieldKey, opts.value);\n\n const widget =\n mode === \"ref\"\n ? renderRefWidget(isRef(opts.value) ? opts.value.$ref : \"\", opts)\n : mode === \"template\"\n ? renderTemplateWidget(opts.value, opts)\n : mode === \"expression\"\n ? renderExpressionEditor(\n (opts.value as { $expression?: unknown }).$expression,\n (node) => opts.onChange({ $expression: node } as JsonValue),\n {\n allowEventRef: opts.allowEventRef ?? false,\n preview: opts.preview ?? null,\n stateDefs: opts.stateDefs,\n stateEntries: opts.stateEntries ?? null,\n },\n )\n : opts.staticWidget;\n\n return {\n modeButton: renderModeChip(mode, caps, opts),\n widget: html`\n <div class=\"dynamic-slot\" style=\"display:flex;flex:1;min-width:0\">\n <div style=\"flex:1;min-width:0\">${widget}</div>\n </div>\n `,\n };\n}\n",
33
+ "/// <reference lib=\"dom\" />\n/**\n * Schema-form — reusable JSON-Schema → form rendering engine, extracted from the signals panel.\n *\n * Maps schema property types to Spectrum controls (enum → picker, boolean → checkbox,\n * number/integer → number-field, `json-schema` format → multiline JSON editor, array-of-objects →\n * multi-row inline form, other array/object → JSON text field, default → textfield). Hosts commit\n * edits through a single `onChange(patch)` callback; dynamic enum choices resolve through a\n * {@link SchemaFormContext}. Custom controls register by name via {@link registerFormControl} and\n * are consulted first for `ui` overrides.\n *\n * **Binding is the same ladder as everywhere else** (§6.6). A host that names somewhere a value can\n * come from — route params, the document's signals — gets a Value Source chip on every scalar\n * field, drawn by `ui/dynamic-slot.ts` and named by `ui/value-source.ts`. It replaces two things: a\n * private `Static value / $params/… / Custom…` picker that mounted only when the field ALREADY held\n * a `$ref` (so no form had a gesture for starting a binding at all), and a link button beside the\n * textfield that silently committed the first route param. A host that names no source — the\n * project settings forms — draws no chip and edits fixed values, exactly as before.\n */\n\nimport { html, nothing } from \"lit-html\";\nimport { ifDefined } from \"lit-html/directives/if-defined.js\";\nimport { live } from \"lit-html/directives/live.js\";\nimport { styleMap } from \"lit-html/directives/style-map.js\";\nimport { isRef } from \"@jxsuite/schema/guards\";\nimport { renderFieldRow } from \"./field-row\";\nimport { renderDynamicSlot } from \"./dynamic-slot\";\nimport { configFieldSchema } from \"./value-source\";\nimport type { TemplateResult } from \"lit-html\";\nimport type { SignalOption } from \"./dynamic-slot\";\nimport type { JsonValue } from \"../types\";\n\n/** A (possibly nested) JSON Schema node, covering both object and property level keys. */\nexport interface JsonSchema {\n type?: string;\n properties?: Record<string, JsonSchema>;\n required?: string[];\n description?: string;\n enum?: unknown;\n default?: unknown;\n format?: string;\n minimum?: number;\n maximum?: number;\n examples?: string[];\n name?: string;\n items?: JsonSchema;\n /**\n * A pointer to another schema. `#/content/<type>` is the one this engine acts on: it is how\n * site-architecture.md §6.1 declares a relationship between collections, and it is what the\n * schema-builder writes (`form-controls.ts`'s `onChangeRefTarget`).\n */\n $ref?: string;\n}\n\n/** Host-provided context threaded to every control. */\nexport interface SchemaFormContext {\n /** Resolve a `#/$context/…` pointer (or legacy sentinel) against the host's project config. */\n resolvePointer: (pointer: string, scope?: Record<string, unknown>) => unknown;\n /** Route params available for `$ref` bindings (e.g. from the document path). */\n params?: string[] | undefined;\n /**\n * State keys a field may bind to. Together with {@link params} this is the whole answer to \"where\n * could this value come from\" — and naming none of them is how a host says the form edits fixed\n * values only, which is why the settings forms show no Value Source chip.\n */\n signals?: string[] | undefined;\n /** Unique prefix for the dynamic slot's per-field, per-rung value memory. */\n fieldKeyPrefix?: string | undefined;\n /**\n * Commit hook for the \"secret\" control: stores the VALUE in the platform's secret store (never\n * project.json) and returns the derived env-var NAME, which the control persists to the field\n * instead of the value.\n */\n commitSecret?: ((key: string, value: string) => string | Promise<string>) | undefined;\n}\n\n/** Arguments passed to a registered form control. */\nexport interface SchemaFormControlArgs {\n key: string;\n schema: JsonSchema;\n value: unknown;\n onChange: (next: unknown) => void;\n ctx: SchemaFormContext;\n rerender?: (() => void) | undefined;\n}\n\nexport type SchemaFormControl = (args: SchemaFormControlArgs) => TemplateResult;\n\n/** Options for {@link renderForm}. */\nexport interface RenderFormOptions {\n onChange: (patch: Record<string, unknown>) => void;\n context?: SchemaFormContext | undefined;\n /**\n * Per-field overrides from `$studio.settings.entry.ui`: a registered control name, and/or an\n * `enum` source (choice list or `{ \"$ref\": \"#/$context/<pointer>\" }`) layered over the field\n * schema — fragments stay valid JSON Schema while descriptors add dynamic choices.\n */\n ui?: Record<string, { control?: string; enum?: unknown }> | undefined;\n rerender?: (() => void) | undefined;\n /**\n * Externally-produced diagnostics, keyed by property name — §7.1's inline tier, sourced.\n *\n * This is how a validator that runs over the WHOLE document reaches the one field it is about:\n * `jx-validate`'s `project.json` errors (until now wired only to the AI's `write_project_config`,\n * so a human editing the same file through Settings got no validation at all), Monaco's markers\n * for the same file open in the code view, and a host's own commit-time rejection.\n *\n * A host message wins over {@link validateFieldValue}'s intrinsic check, because the host knows\n * things the property schema alone does not — that this enum value names a connector that was\n * just deleted, say. An empty string means \"no error\", so a host can pass a lookup result\n * straight through.\n */\n errors?: Record<string, string> | undefined;\n /** How many times each field has been refused in a row; drives the row's repeat counter. */\n errorCounts?: Record<string, number> | undefined;\n /**\n * Report required-but-empty fields inline. Off by default, and that default is §7.1's rule\n * literally applied: a form the user has not touched yet has not committed anything, so painting\n * every required field red the moment it renders is telling them they got something wrong before\n * they did anything. Required-ness is already shown — the label carries a `*`. A host that\n * validates on submit turns this on for the render that follows the rejected submit.\n */\n showRequired?: boolean | undefined;\n}\n\n// ─── Control registry ────────────────────────────────────────────────────────\n\nconst controlRegistry = new Map<string, SchemaFormControl>();\n\n/** Register (or replace) a named form control. */\nexport function registerFormControl(name: string, control: SchemaFormControl): void {\n controlRegistry.set(name, control);\n}\n\n/** Look up a registered form control by name. */\nexport function getFormControl(name: string): SchemaFormControl | undefined {\n return controlRegistry.get(name);\n}\n\n// ─── References between collections ──────────────────────────────────────────\n\n/** `#/content/<type>` — a property whose value is the id of an entry in another collection. */\nconst CONTENT_REF = /^#\\/content\\/([^/]+)$/;\n\n/**\n * The collection a property references, or null when it references nothing.\n *\n * Exported because it is the ONE test for \"is this field a relationship\", and three surfaces have\n * to agree on it: this engine, the frontmatter renderer, and the grid's relationship cell. A fourth\n * reading of `$ref` is how the picker ends up existing three times with three behaviours.\n */\nexport function referenceTarget(schema: { $ref?: string } | undefined): string | null {\n const match = typeof schema?.$ref === \"string\" ? CONTENT_REF.exec(schema.$ref) : null;\n return match ? match[1]! : null;\n}\n\n/**\n * Inert context used when a host renders a form without one.\n *\n * Exported because a host with genuinely nowhere to resolve from — the frontmatter renderer, whose\n * one registered control reads FILES — should name this rather than write a second empty closure.\n */\nexport const NULL_FORM_CONTEXT: SchemaFormContext = {\n resolvePointer: () => {\n // Nothing to resolve against without a host context\n },\n};\n\n// ─── Enum resolution ─────────────────────────────────────────────────────────\n\n/**\n * Resolve a schema enum definition to concrete choices. Plain arrays pass through; `$ref` objects\n * and sentinel strings resolve through the context's pointer resolver, applying object →\n * `Object.keys` and string[] → itself.\n *\n * @param {unknown} enumDef\n * @param {SchemaFormContext | undefined} ctx\n * @param {Record<string, unknown>} [scope] - Scope for `{@param}` substitution (the form value)\n * @returns {string[] | undefined}\n */\nexport function resolveFormEnum(\n enumDef: unknown,\n ctx?: SchemaFormContext,\n scope?: Record<string, unknown>,\n): string[] | undefined {\n if (Array.isArray(enumDef)) {\n return enumDef as string[];\n }\n let pointer: string | undefined;\n if (enumDef && typeof enumDef === \"object\") {\n const ref = (enumDef as Record<string, unknown>).$ref;\n if (typeof ref === \"string\") {\n pointer = ref;\n }\n } else if (typeof enumDef === \"string\") {\n // Legacy sentinel strings (e.g. \"$contentTypes\") resolve through the host's pointer resolver\n pointer = enumDef;\n }\n if (pointer === undefined || !ctx) {\n return undefined;\n }\n const resolved = ctx.resolvePointer(pointer, scope);\n if (Array.isArray(resolved)) {\n return resolved.map(String);\n }\n if (resolved && typeof resolved === \"object\") {\n return Object.keys(resolved);\n }\n return undefined;\n}\n\n// ─── Field helpers ───────────────────────────────────────────────────────────\n\n/** Parse a numeric field value, returning NaN for blank input (so callers can treat it as unset). */\nexport function parseNumericField(raw: string, integer: boolean): number {\n if (raw.trim() === \"\") {\n return Number.NaN;\n }\n return integer ? Math.trunc(Number(raw)) : Number(raw);\n}\n\n/** Plain textfield editing a `{ $ref }` value directly — the fallback when no binding control. */\nfunction refTextField(key: string, refVal: string, onChange: (next: unknown) => void) {\n return html`<sp-textfield\n size=\"s\"\n label=${key}\n placeholder=${key}\n .value=${live(refVal)}\n @change=${(e: Event) => {\n const v = (e.target as HTMLInputElement).value.trim();\n onChange(v ? { $ref: v } : undefined);\n }}\n ></sp-textfield>`;\n}\n\n/**\n * Render a single inline field within an array-of-objects row. Dispatches by schema type: enum →\n * picker, boolean → switch, number → number-field, else → textfield.\n *\n * @param {string} key\n * @param {JsonSchema} schema\n * @param {unknown} value\n * @param {(val: unknown) => void} onChange\n * @param {SchemaFormContext | undefined} ctx\n * @param {Record<string, unknown>} [scope] - Scope for dependent enum refs (the parent form value)\n * @param {() => void} [rerender] - Repaint hook, threaded so an inline reference can show its\n * choices once they load — an async control with no way to ask for a second frame renders its\n * loading state forever.\n */\nexport function renderInlineField(\n key: string,\n schema: JsonSchema,\n value: unknown,\n onChange: (val: unknown) => void,\n ctx?: SchemaFormContext,\n scope?: Record<string, unknown>,\n rerender?: () => void,\n) {\n if (isRef(value)) {\n return refTextField(key, value.$ref, onChange);\n }\n const referenceControl =\n referenceTarget(schema) === null ? undefined : controlRegistry.get(\"reference\");\n if (referenceControl) {\n return referenceControl({\n ctx: ctx ?? NULL_FORM_CONTEXT,\n key,\n onChange,\n rerender,\n schema,\n value,\n });\n }\n const enumValues = resolveFormEnum(schema.enum, ctx, scope);\n\n if (enumValues) {\n return html`<sp-picker\n size=\"s\"\n label=${key}\n value=${value !== undefined ? String(value) : \"__none__\"}\n @change=${(e: Event) =>\n onChange(\n (e.target as HTMLInputElement).value === \"__none__\"\n ? undefined\n : (e.target as HTMLInputElement).value,\n )}\n >\n <sp-menu-item value=\"__none__\">—</sp-menu-item>\n ${enumValues.map((v: string) => html`<sp-menu-item value=${v}>${v}</sp-menu-item>`)}\n </sp-picker>`;\n }\n if (schema.type === \"boolean\") {\n return html`<sp-switch\n size=\"s\"\n ?checked=${Boolean(value)}\n @change=${(e: Event) => onChange((e.target as HTMLInputElement).checked)}\n >${key}</sp-switch\n >`;\n }\n if (schema.type === \"integer\" || schema.type === \"number\") {\n return html`<sp-number-field\n size=\"s\"\n label=${key}\n .value=${value !== undefined ? value : nothing}\n step=${schema.type === \"integer\" ? \"1\" : nothing}\n @change=${(e: Event) => {\n const parsed = parseNumericField(\n (e.target as HTMLInputElement).value,\n schema.type === \"integer\",\n );\n onChange(Number.isNaN(parsed) ? undefined : parsed);\n }}\n ></sp-number-field>`;\n }\n return html`<sp-textfield\n size=\"s\"\n label=${key}\n placeholder=${key}\n .value=${value ?? \"\"}\n @input=${(e: Event) => onChange((e.target as HTMLInputElement).value || undefined)}\n ></sp-textfield>`;\n}\n\n/** Render a debounced multiline JSON text field for array/object schema properties. */\nfunction renderJsonTextField(currentValue: unknown, ps: JsonSchema, commit: (v: unknown) => void) {\n /** @type {ReturnType<typeof setTimeout> | undefined} */\n let debounce: ReturnType<typeof setTimeout> | undefined;\n return html`<sp-textfield\n multiline\n size=\"s\"\n style=\"min-height:40px\"\n .value=${currentValue !== undefined ? JSON.stringify(currentValue, null, 2) : \"\"}\n placeholder=${ps.default !== undefined ? JSON.stringify(ps.default) : nothing}\n @input=${(e: Event) => {\n clearTimeout(debounce);\n debounce = setTimeout(() => {\n try {\n commit(JSON.parse((e.target as HTMLInputElement).value) as unknown);\n } catch {}\n }, 500);\n }}\n ></sp-textfield>`;\n}\n\n// ─── Per-property control dispatch ───────────────────────────────────────────\n\n/** Render the widget for one schema property, honoring registered-control overrides. */\nfunction renderPropertyControl(\n prop: string,\n ps: JsonSchema,\n value: Record<string, unknown>,\n required: Set<string>,\n opts: RenderFormOptions,\n ctx: SchemaFormContext,\n): TemplateResult {\n const currentValue = value[prop];\n const commit = (next: unknown) => opts.onChange({ [prop]: next });\n const controlArgs: SchemaFormControlArgs = {\n ctx,\n key: prop,\n onChange: commit,\n rerender: opts.rerender,\n schema: ps,\n value: currentValue,\n };\n\n // Explicit ui override → consult the control registry first\n const overrideName = opts.ui?.[prop]?.control;\n if (overrideName) {\n const custom = controlRegistry.get(overrideName);\n if (custom) {\n return custom(controlArgs);\n }\n }\n\n /* A ref left in a form whose host named nowhere to bind: no ladder is drawn, so the pointer is\n edited as the string it is rather than rendered as \"[object Object]\" in a typed widget. */\n if (isRef(currentValue) && isBindableField(ps)) {\n return refTextField(prop, currentValue.$ref, commit);\n }\n\n /* A relationship to another collection (`$ref: \"#/content/<type>\"`) is the registered `reference`\n control, wherever the form is drawn — §9.2's \"one picker\" is this dispatch plus the single\n `registerFormControl(\"reference\", …)` in `ui/form-controls.ts`. It is deliberately NOT an enum:\n the choices are entry files on disk, so they are read asynchronously and can be stale, and a\n schema `enum` is a closed set the document itself declares. When the control is not registered\n (a bare-Bun import of this engine), the field falls through to the plain textfield below rather\n than rendering nothing. */\n if (referenceTarget(ps) !== null) {\n const referenceControl = controlRegistry.get(\"reference\");\n if (referenceControl) {\n return referenceControl(controlArgs);\n }\n }\n\n const enumValues = resolveFormEnum(opts.ui?.[prop]?.enum ?? ps.enum, ctx, value);\n if (enumValues) {\n return html`\n <sp-picker\n size=\"s\"\n value=${\n currentValue !== undefined\n ? String(currentValue)\n : ps.default !== undefined\n ? String(ps.default)\n : \"__none__\"\n }\n @change=${(e: Event) =>\n commit(\n (e.target as HTMLInputElement).value === \"__none__\"\n ? undefined\n : (e.target as HTMLInputElement).value,\n )}\n >\n ${!required.has(prop) ? html`<sp-menu-item value=\"__none__\">—</sp-menu-item>` : nothing}\n ${enumValues.map((val: string) => html`<sp-menu-item value=${val}>${val}</sp-menu-item>`)}\n </sp-picker>\n `;\n }\n if (ps.type === \"boolean\") {\n return html`<sp-checkbox\n ?checked=${currentValue ?? ps.default ?? false}\n @change=${(e: Event) => commit((e.target as HTMLInputElement).checked)}\n ></sp-checkbox>`;\n }\n if (ps.type === \"integer\" || ps.type === \"number\") {\n /** @type {ReturnType<typeof setTimeout> | undefined} */\n let debounce: ReturnType<typeof setTimeout> | undefined;\n return html`<sp-number-field\n size=\"s\"\n min=${ifDefined(ps.minimum)}\n max=${ifDefined(ps.maximum)}\n step=${ps.type === \"integer\" ? \"1\" : nothing}\n .value=${currentValue !== undefined ? currentValue : nothing}\n placeholder=${ps.default != null ? String(ps.default) : nothing}\n @change=${(e: Event) => {\n clearTimeout(debounce);\n debounce = setTimeout(() => {\n const parsed = parseNumericField(\n (e.target as HTMLInputElement).value,\n ps.type === \"integer\",\n );\n commit(Number.isNaN(parsed) ? undefined : parsed);\n }, 400);\n }}\n ></sp-number-field>`;\n }\n if (ps.format === \"json-schema\") {\n const hasValue =\n currentValue && typeof currentValue === \"object\" && Object.keys(currentValue).length > 0;\n const cv = currentValue as Record<string, unknown>;\n const isSchemaRef = hasValue && cv.$ref;\n /** @type {ReturnType<typeof setTimeout> | undefined} */\n let debounce: ReturnType<typeof setTimeout> | undefined;\n return html`\n <div class=\"schema-param-editor\">\n ${\n hasValue && !isSchemaRef && cv.properties\n ? html`\n <div style=\"display:flex;flex-wrap:wrap;gap:3px;margin-bottom:4px\">\n ${Object.entries(cv.properties as Record<string, Record<string, unknown>>).map(\n ([k, v]) => html`\n <span\n style=\"background:var(--bg);padding:1px 6px;border-radius:var(--radius);font-size:10px;color:var(--fg-dim)\"\n >${k}: ${v.type ?? \"any\"}</span\n >\n `,\n )}\n </div>\n `\n : nothing\n }\n <sp-textfield\n multiline\n size=\"s\"\n style=${styleMap({\n fontFamily: \"monospace\",\n fontSize: \"11px\",\n minHeight: hasValue ? \"80px\" : \"40px\",\n })}\n .value=${currentValue !== undefined ? JSON.stringify(currentValue, null, 2) : \"\"}\n placeholder=${ps.description ?? \"JSON Schema defining the data shape…\"}\n @input=${(e: Event) => {\n clearTimeout(debounce);\n debounce = setTimeout(() => {\n try {\n commit(JSON.parse((e.target as HTMLInputElement).value) as unknown);\n } catch {}\n }, 500);\n }}\n ></sp-textfield>\n </div>\n `;\n }\n if (ps.type === \"array\" && ps.items?.type === \"object\" && ps.items?.properties) {\n // Array of objects with defined schema → multi-row inline form\n const rows: Record<string, unknown>[] = Array.isArray(currentValue)\n ? (currentValue as Record<string, unknown>[])\n : [];\n const itemProps = ps.items.properties;\n return html`\n <div class=\"array-object-field\">\n ${rows.map(\n (row: Record<string, unknown>, idx: number) => html`\n <div\n class=\"array-object-row\"\n style=\"display:flex;gap:4px;align-items:center;margin-bottom:4px\"\n >\n ${Object.entries(itemProps).map(([propKey, propSchema]) =>\n renderInlineField(\n propKey,\n propSchema,\n row[propKey],\n (val) => {\n const updated = [...rows];\n updated[idx] = { ...updated[idx], [propKey]: val };\n commit(updated);\n },\n ctx,\n value,\n opts.rerender,\n ),\n )}\n <sp-action-button\n quiet\n size=\"s\"\n @click=${() => {\n const updated = rows.filter((_: unknown, i: number) => i !== idx);\n commit(updated.length > 0 ? updated : undefined);\n opts.rerender?.();\n }}\n >\n <sp-icon-delete slot=\"icon\"></sp-icon-delete>\n </sp-action-button>\n </div>\n `,\n )}\n <sp-action-button\n quiet\n size=\"s\"\n @click=${(e: Event) => {\n e.stopPropagation();\n const newRow: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(itemProps)) {\n if (v.default !== undefined) {\n newRow[k] = v.default;\n }\n }\n commit([...rows, newRow]);\n opts.rerender?.();\n }}\n >+ Add</sp-action-button\n >\n </div>\n `;\n }\n if (ps.type === \"array\" || ps.type === \"object\") {\n return renderJsonTextField(currentValue, ps, commit) as TemplateResult;\n }\n\n /** @type {ReturnType<typeof setTimeout> | undefined} */\n let debounce: ReturnType<typeof setTimeout> | undefined;\n const ph = ps.default !== undefined ? String(ps.default) : (ps.examples?.[0] ?? \"\");\n return html`<sp-textfield\n size=\"s\"\n style=\"flex:1\"\n .value=${currentValue ?? \"\"}\n placeholder=${ph || nothing}\n title=${ps.description || nothing}\n @input=${(e: Event) => {\n clearTimeout(debounce);\n debounce = setTimeout(() => commit((e.target as HTMLInputElement).value || undefined), 400);\n }}\n ></sp-textfield>`;\n}\n\n// ─── The Value Source ladder (§6.6) ──────────────────────────────────────────\n\n/**\n * Whether a property is edited as a single value at all. The three that are not — a nested JSON\n * Schema, an object and an array — are edited as raw JSON or as a multi-row sub-form, and a chip\n * offering to replace that editor with a signal pointer would be offering to delete the user's\n * work.\n */\nfunction isBindableField(ps: JsonSchema): boolean {\n return ps.format !== \"json-schema\" && ps.type !== \"object\" && ps.type !== \"array\";\n}\n\n/** Every pointer this form's host says a value may come from. */\nfunction refSourcesFor(ctx: SchemaFormContext): SignalOption[] {\n return [\n ...(ctx.signals ?? []).map((name) => ({ label: name, value: `#/state/${name}` })),\n ...(ctx.params ?? []).map((name) => ({ label: `$params/${name}`, value: `#/$params/${name}` })),\n ];\n}\n\n// ─── Field validation (§7.1, inline tier) ────────────────────────────────────\n\n/**\n * Why this value is not acceptable for this property schema, or `\"\"` when it is.\n *\n * Deliberately narrow: the checks a _property_ schema can make on its own, at the moment the value\n * is committed. Anything cross-field, cross-document or extension-defined belongs to whoever ran\n * the real validator and arrives through {@link RenderFormOptions.errors} — a form control is not a\n * second implementation of JSON Schema, it is the place a verdict gets rendered.\n *\n * A `$ref` binding is never judged here. Its value is resolved at render time from state the form\n * cannot see, so type-checking the reference itself would refuse every correct binding.\n *\n * @param {JsonSchema} schema\n * @param {unknown} value\n * @param {boolean} isRequired\n * @returns {string}\n */\nexport function validateFieldValue(\n schema: JsonSchema,\n value: unknown,\n isRequired: boolean,\n): string {\n if (isRef(value)) {\n return \"\";\n }\n const empty = value === undefined || value === null || value === \"\";\n if (empty) {\n return isRequired ? \"Required.\" : \"\";\n }\n if (Array.isArray(schema.enum) && !schema.enum.includes(value)) {\n return `Choose one of: ${schema.enum.map(String).join(\", \")}.`;\n }\n if (schema.type === \"number\" || schema.type === \"integer\") {\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n)) {\n return \"Enter a number.\";\n }\n if (schema.type === \"integer\" && !Number.isInteger(n)) {\n return \"Enter a whole number.\";\n }\n if (schema.minimum !== undefined && n < schema.minimum) {\n return `Must be ${schema.minimum} or more.`;\n }\n if (schema.maximum !== undefined && n > schema.maximum) {\n return `Must be ${schema.maximum} or less.`;\n }\n return \"\";\n }\n if (schema.type === \"boolean\" && typeof value !== \"boolean\") {\n return \"Must be true or false.\";\n }\n if (schema.type === \"array\" && !Array.isArray(value)) {\n return \"Must be a list.\";\n }\n if (schema.type === \"object\" && (typeof value !== \"object\" || Array.isArray(value))) {\n return \"Must be an object.\";\n }\n return \"\";\n}\n\n// ─── Form rendering ──────────────────────────────────────────────────────────\n\n/**\n * Render form field rows for a JSON Schema's `properties`, committing edits through `opts.onChange`\n * as single-key patches (`undefined` values mean \"unset the key\").\n *\n * @param {JsonSchema} schema\n * @param {Record<string, unknown>} value - The record being edited\n * @param {RenderFormOptions} opts\n * @returns {TemplateResult}\n */\nexport function renderForm(\n schema: JsonSchema,\n value: Record<string, unknown>,\n opts: RenderFormOptions,\n): TemplateResult {\n const required = new Set(schema.required);\n const ctx = opts.context ?? NULL_FORM_CONTEXT;\n const refSources = refSourcesFor(ctx);\n\n const propertyFields = Object.entries(schema.properties ?? {}).map(([prop, ps]) => {\n const labelText = prop + (required.has(prop) ? \" *\" : \"\");\n // Host diagnostics win over the intrinsic check — see RenderFormOptions.errors.\n const error =\n opts.errors?.[prop] ||\n validateFieldValue(ps, value[prop], Boolean(opts.showRequired) && required.has(prop));\n const count = opts.errorCounts?.[prop];\n const staticWidget = renderPropertyControl(prop, ps, value, required, opts, ctx);\n /* A `ui.control` override owns its whole field — the secret control writes an env-var NAME\n rather than the value it was handed, so a rung switch above it would be editing a different\n thing than the one on screen. */\n const laddered =\n refSources.length > 0 && isBindableField(ps) && !opts.ui?.[prop]?.control\n ? renderDynamicSlot({\n allowCustomRef: true,\n caps: { schema: configFieldSchema(ps) },\n extraSignals: refSources,\n fieldKey: `${ctx.fieldKeyPrefix ?? \"\"}.${prop}`,\n onChange: (v?: JsonValue) => opts.onChange({ [prop]: v }),\n staticWidget,\n stateDefs: [],\n value: value[prop],\n })\n : null;\n return renderFieldRow({\n hasValue: false,\n label: labelText,\n prop: ps.name || prop,\n widget: laddered ? laddered.widget : staticWidget,\n ...(laddered ? { labelExtra: laddered.modeButton } : {}),\n ...(error ? { error } : {}),\n ...(count === undefined ? {} : { errorCount: count }),\n });\n });\n\n return html`${propertyFields}`;\n}\n",
34
+ "/**\n * Context resolver — generic `#/$context/<pointer>` resolution over the project config\n * (specs/extensions.md §9.1).\n *\n * Pointers walk the project config segment by segment. `{@param}` segments substitute values from a\n * caller-provided scope (e.g. the form's current value record), and the `$formats` virtual root\n * resolves to the registered format names instead of a project.json key.\n */\n\n/** Options for {@link resolveContextPointer}. */\nexport interface ResolveContextOptions {\n /** The project configuration object the pointer walks over. */\n projectConfig: Record<string, unknown>;\n /** Scope record supplying `{@param}` substitutions (e.g. the enclosing form value). */\n scope?: Record<string, unknown> | undefined;\n /** Registered formats backing the `$formats` virtual root. */\n formats?: { name: string }[] | undefined;\n}\n\n/** Matches a `{@param}` pointer segment, capturing the param name. */\nconst PARAM_SEGMENT = /^\\{@(\\w+)\\}$/;\n\n/**\n * Resolve a `#/$context/<seg>/<seg>…` pointer.\n *\n * - `{@param}` segments substitute from `opts.scope`; an unresolvable param yields `undefined`.\n * - The `$formats` virtual root returns the format names from `opts.formats`.\n * - Every other pointer is a plain JSON-pointer walk over `opts.projectConfig` — no key is\n * special-cased, so both legacy (`contentTypes`) and newer (`content`) sections resolve alike.\n *\n * @param {string} pointer\n * @param {ResolveContextOptions} opts\n * @returns {unknown} The resolved value, or `undefined` when the pointer does not resolve.\n */\nexport function resolveContextPointer(pointer: string, opts: ResolveContextOptions): unknown {\n if (!pointer.startsWith(\"#/$context/\")) {\n return undefined;\n }\n\n const segments: string[] = [];\n for (const raw of pointer.slice(\"#/$context/\".length).split(\"/\")) {\n const match = raw.match(PARAM_SEGMENT);\n if (match) {\n const value = opts.scope?.[match[1]!];\n if (typeof value !== \"string\" && typeof value !== \"number\") {\n return undefined;\n }\n const substituted = String(value);\n if (!substituted) {\n return undefined;\n }\n segments.push(substituted);\n } else {\n segments.push(raw);\n }\n }\n\n if (segments[0] === \"$formats\") {\n if (segments.length !== 1) {\n return undefined;\n }\n return (opts.formats ?? []).map((format) => format.name);\n }\n\n let node: unknown = opts.projectConfig;\n for (const segment of segments) {\n if (node === null || typeof node !== \"object\") {\n return undefined;\n }\n node = (node as Record<string, unknown>)[segment];\n }\n return node;\n}\n"
35
+ ],
36
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,IAAM,oBAA+D;AAAA,EACnE,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,OAAO;AAAA,EACP,KAAK;AACP;AAGA,SAAS,cAAc,CAAC,GAA4B;AAAA,EAClD,IAAI,EAAE,UAAU,aAAa;AAAA,IAC3B,OAAO,EAAE,QAAQ,QAAQ,EAAE,UAAU;AAAA,EACvC;AAAA,EACA,IAAI,EAAE,UAAU,SAAS;AAAA,IACvB,OAAO,EAAE,SAAS;AAAA,EACpB;AAAA,EACA,IAAI,EAAE,UAAU,SAAS;AAAA,IACvB,OAAO,EAAE,QAAQ,UAAU,EAAE,WAAW;AAAA,EAC1C;AAAA,EACA,OAAO;AAAA;AAIF,SAAS,eAAe,CAAC,MAAc,GAA4B;AAAA,EACxE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