@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,14 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/panels/events-panel.ts", "../src/utils/inherited-style.ts", "../src/panels/target-line.ts", "../src/panels/style-panel.ts", "../src/panels/right-panel.ts"],
4
+ "sourcesContent": [
5
+ "/// <reference lib=\"dom\" />\n/**\n * The Logic tab — everything about how this element BEHAVES.\n *\n * Plan §6.5 re-split the inspector by task rather than by data type, and this is the tab that\n * gained by it. Wiring a `$switch`, wiring a repeater to a collection and wiring a click handler\n * are one job; they were three, split across two tabs, because a `$switch` is stored as a property\n * and a click handler is stored as a property-shaped function, and the old split followed the\n * storage. So Logic is now:\n *\n * - **Repeating list** — the `$prototype: \"Array\"` node's items / filter / sort, and its template.\n * - **Condition** — the `$switch` expression and its cases.\n * - **Events** — declared events, bindings, inline bodies, expressions.\n * - **Observed Attributes · CSS Properties · CSS Parts** — a custom element's outward contract.\n *\n * The last three arrived from the Content tab, where they were three near-identical hand-written\n * flex rows; they are now three calls to {@link renderStaticKvRow}.\n *\n * Everything here reads `session.selection`, so the tab is selection-level in the same sense the\n * rest of the inspector is: no selection is an empty state, not a blank panel.\n */\n\nimport { getNodeAtPath, renderOnly } from \"../store\";\nimport { html, nothing } from \"lit-html\";\nimport { live } from \"lit-html/directives/live.js\";\nimport { activeTab } from \"../workspace/workspace\";\nimport { primarySelection, unifyValues } from \"../tabs/selection\";\nimport { renderProvenanceChip } from \"./provenance\";\nimport {\n mutateAddDef,\n mutateAddSwitchCase,\n mutateRemoveSwitchCase,\n mutateRenameSwitchCase,\n mutateUpdateProperty,\n transactDoc,\n} from \"../tabs/transact\";\nimport { clickAnythingTo, renderEmptyState, staleSelectionMessage } from \"./empty-state\";\nimport { renderExpressionEditor } from \"../ui/expression-editor\";\nimport { renderStatementEditor } from \"./statement-editor\";\nimport { inspectorStatementsRegion } from \"../ui/regions\";\nimport { livePreviewExpression } from \"../services/live-preview\";\nimport { renderFieldRow, renderStaticKvRow } from \"../ui/field-row\";\nimport { renderDynamicSlot, slotMode, switchSlotMode } from \"../ui/dynamic-slot\";\nimport { VALUE_SOURCE_LABELS, capsForPosition } from \"../ui/value-source\";\nimport { spTextField } from \"../ui/field-input\";\nimport {\n bindableSignalNames,\n defaultAsString,\n isInspectorSectionOpen,\n mapSignalsFor,\n setInspectorSection,\n} from \"./properties-panel\";\nimport { collectCssParts } from \"./signals-panel\";\nimport { openLogicTarget } from \"./formula-workspace\";\nimport {\n getEventBinding,\n isExpressionDef,\n isFunctionDef,\n isJsonObject,\n isRef,\n} from \"@jxsuite/schema/guards\";\n\nimport type { JsonValue } from \"../types\";\nimport type { TemplateResult } from \"lit-html\";\nimport type { SlotCapsSource, SlotMode, SignalOption } from \"../ui/dynamic-slot\";\nimport type { JxPath } from \"../state\";\nimport type {\n CemEvent,\n JxEventBinding,\n JxFunctionDef,\n JxMutableNode,\n JxPrototypeDef,\n} from \"@jxsuite/schema/types\";\n\n/**\n * The events worth SUGGESTING — not the events an element may have.\n *\n * These ten were a closed `sp-picker`, so `ondragover`, `onpointerdown`, `onwheel`, `onpaste` and\n * every custom event a component emits were unbindable from the Inspector: the plan's §6.5 asks for\n * \"a free-form combobox instead of a hard-coded list of ten\", and `ui/value-selector.ts`'s own\n * docstring names this field as the reason it exists (\"what lets a control like the event-name\n * field stop being a list of ten\"). The widget was written and never wired.\n */\nexport const EVENT_NAMES = [\n \"onclick\",\n \"oninput\",\n \"onchange\",\n \"onsubmit\",\n \"onkeydown\",\n \"onkeyup\",\n \"onfocus\",\n \"onblur\",\n \"onmouseenter\",\n \"onmouseleave\",\n];\n\n/** {@link EVENT_NAMES} as the combobox's option list, plus whatever this element already declares. */\nfunction eventNameOptions(declared: readonly string[]): { label: string; value: string }[] {\n const seen = new Set<string>();\n const out: { label: string; value: string }[] = [];\n for (const name of [...declared, ...EVENT_NAMES]) {\n if (!seen.has(name)) {\n seen.add(name);\n out.push({ label: name, value: name });\n }\n }\n return out;\n}\n\n/**\n * The rungs an `on*` handler permits, derived from the schema (`RefObject | ExpressionEntry |\n * FunctionDef`) rather than listed here.\n *\n * This picker used to read Inline code / Expression / Existing function — a fourth private dialect\n * for the one ladder §6.6 collapses, so a user who learned \"Formula\" on a property row met\n * \"Expression\" here and had no reason to think they were the same thing.\n */\nconst HANDLER_MODES: SlotMode[] = capsForPosition(\"eventHandler\");\n\n/** The value a handler starts at on each rung, when the user has never been on that rung before. */\nfunction seedForHandlerMode(mode: SlotMode, functionDefs: [string, unknown][]): JsonValue {\n if (mode === \"function\") {\n return { $prototype: \"Function\", body: \"\", parameters: [] };\n }\n if (mode === \"expression\") {\n return { $expression: { operator: \"=\", target: null } };\n }\n const [firstFn] = functionDefs;\n return firstFn ? { $ref: `#/state/${firstFn[0]}` } : { $ref: \"\" };\n}\n\n// ─── The bindable row ────────────────────────────────────────────────────────\n\n/** Arguments for {@link bindableFieldRow}. */\ninterface BindableRowOpts {\n /** The `data-prop` key — what `inspector/field:<prop>` addresses. */\n prop: string;\n label: string;\n /** The raw document value: a JSON literal, `{ $ref }`, a `${}` template or an `$expression`. */\n rawValue: unknown;\n onChange: (v?: JsonValue) => void;\n /** Removes the position outright. Absent means the position is mandatory and cannot be cleared. */\n onClear?: (() => void) | undefined;\n /** Extra signals this position may bind to — `$map/item` and friends inside a template. */\n extraSignals?: SignalOption[] | null;\n /** Stable identity for the dynamic slot's per-mode value memory; must include the node path. */\n fieldKey: string;\n /** The document position being edited — the rungs follow from its schema, never from here. */\n caps: SlotCapsSource;\n}\n\n/**\n * A bindable value as a first-class field row.\n *\n * This used to render a bare `<div class=\"field-row\">` with a label and a widget: no set-dot, no\n * clear affordance, no error slot — the three things every other row in the inspector has had since\n * `renderFieldRow` landed. Repeater and Switch fields were the last second-class rows in the\n * inspector, which is exactly what §12 P5 item 6 names.\n *\n * Every position it serves is a single-line expression (a collection, a filter, a sort key, a\n * `$switch`), so it draws one literal editor rather than dispatching over a widget type — the\n * textarea and checkbox arms it used to carry had no caller in either tab.\n */\nfunction bindableFieldRow({\n prop,\n label,\n rawValue,\n onChange,\n onClear,\n extraSignals = null,\n fieldKey,\n caps,\n}: BindableRowOpts) {\n const defs = activeTab.value!.doc.document.state || {};\n const boundRef = isRef(rawValue) ? rawValue.$ref : null;\n const staticVal = slotMode(rawValue) === \"literal\" ? (rawValue ?? \"\") : \"\";\n\n // De-escalating to literal restores the bound signal's declared default (old unbind behavior).\n const literalDefault = boundRef\n ? defaultAsString(defs[boundRef.startsWith(\"#/state/\") ? boundRef.slice(8) : boundRef]) ||\n undefined\n : undefined;\n\n const slot = renderDynamicSlot({\n caps,\n extraSignals,\n fieldKey,\n literalDefault,\n onChange,\n staticWidget: spTextField(`prop:${label}`, String(staticVal), (v: string) => onChange(v)),\n stateDefs: bindableSignalNames(activeTab.value!.doc.document),\n value: rawValue,\n });\n return renderFieldRow({\n hasValue: rawValue !== undefined && rawValue !== \"\",\n label,\n labelExtra: slot.modeButton,\n prop,\n widget: slot.widget,\n ...(onClear ? { onClear } : {}),\n });\n}\n\n// ─── Repeating list ──────────────────────────────────────────────────────────\n\n/**\n * The repeater's items / filter / sort, and the way into its template.\n *\n * Filter and Sort are always drawn. They used to hide behind `+ Add filter`, which seeded `{ $ref:\n * \"#/state/\" }` — a binding to the empty pointer, which is not a signal — so the row opened already\n * bound to nothing and the only way to type a literal was to cycle the mode ring twice (§11.4).\n * There is no seed to fix, because a repeater has exactly three inputs and an empty row states that\n * better than a button does: type into it and it is set, clear it and it is gone.\n */\nfunction renderRepeaterFieldsTemplate(node: JxMutableNode, path: JxPath) {\n const key = path.join(\"/\");\n const clear = (name: string) => () =>\n transactDoc(activeTab.value, (t) => mutateUpdateProperty(t, path, name));\n const optional = (name: \"filter\" | \"sort\", label: string) =>\n bindableFieldRow({\n caps: name === \"filter\" ? \"repeaterFilter\" : \"repeaterSort\",\n fieldKey: `prop|${key}|${name}`,\n label,\n onChange: (v?: JsonValue) =>\n transactDoc(activeTab.value, (t) => mutateUpdateProperty(t, path, name, v || undefined)),\n onClear: clear(name),\n prop: name,\n rawValue: node[name],\n });\n return html`\n ${bindableFieldRow({\n caps: \"repeaterItems\",\n fieldKey: `prop|${key}|items`,\n label: \"Items\",\n onChange: (v?: JsonValue) =>\n transactDoc(activeTab.value, (t) => mutateUpdateProperty(t, path, \"items\", v)),\n prop: \"items\",\n rawValue: node.items,\n })}\n ${optional(\"filter\", \"Filter\")} ${optional(\"sort\", \"Sort\")}\n ${\n node.map\n ? html`\n <sp-action-button\n size=\"s\"\n class=\"logic-edit-template\"\n @click=${() => {\n activeTab.value!.session.selection = [[...path, \"map\"]];\n }}\n >Edit template →</sp-action-button\n >\n `\n : nothing\n }\n `;\n}\n\n// ─── Condition ───────────────────────────────────────────────────────────────\n\n/** The `$switch` expression and its cases — each case a field row like every other. */\nfunction renderSwitchFieldsTemplate(\n node: JxMutableNode,\n path: JxPath,\n mapSignals: SignalOption[] | null,\n) {\n const caseNames = Object.keys(node.cases || {});\n return html`\n ${bindableFieldRow({\n // `SwitchDef` is a $ref and nothing else, so From data… is the only rung — a $switch is\n // Inherently dynamic, and de-escalating it would delete the key and demote the node.\n caps: \"switchDiscriminant\",\n extraSignals: mapSignals,\n fieldKey: `prop|${path.join(\"/\")}|$switch`,\n label: \"Expression\",\n onChange: (v?: JsonValue) =>\n transactDoc(activeTab.value, (t) => mutateUpdateProperty(t, path, \"$switch\", v)),\n prop: \"$switch\",\n rawValue: node.$switch,\n })}\n <div class=\"logic-subhead\">Cases</div>\n ${caseNames.map((caseName) => {\n let debounce: ReturnType<typeof setTimeout> | undefined;\n return renderFieldRow({\n hasValue: true,\n label: \"Case\",\n prop: `case:${caseName}`,\n provenance: {\n onClick: () =>\n transactDoc(activeTab.value!, (t) => mutateRemoveSwitchCase(t, path, caseName)),\n state: \"set\",\n title: `Remove case \"${caseName}\"`,\n },\n widget: html`\n <div class=\"logic-case-row\">\n <sp-textfield\n size=\"s\"\n class=\"logic-case-name\"\n .value=${live(caseName)}\n @input=${(e: Event) => {\n clearTimeout(debounce);\n const next = (e.target as HTMLInputElement).value;\n debounce = setTimeout(() => {\n if (next && next !== caseName) {\n transactDoc(activeTab.value, (t) =>\n mutateRenameSwitchCase(t, path, caseName, next),\n );\n }\n }, 500);\n }}\n ></sp-textfield>\n <sp-action-button\n size=\"xs\"\n quiet\n class=\"logic-case-open\"\n title=\"Edit case\"\n @click=${(e: Event) => {\n e.stopPropagation();\n activeTab.value!.session.selection = [[...path, \"cases\", caseName]];\n }}\n >→</sp-action-button\n >\n </div>\n `,\n });\n })}\n <span\n class=\"kv-add\"\n @click=${() => {\n transactDoc(activeTab.value, (t) =>\n mutateAddSwitchCase(t, path, `case${caseNames.length + 1}`),\n );\n }}\n >+ Add case</span\n >\n `;\n}\n\n// ─── Events ──────────────────────────────────────────────────────────────────\n\n/** The event bindings themselves — declared events, then one block per bound `on*` key. */\n/**\n * The Logic tab's Mixed contract (§6.5), stated once because it is a judgement, not a mechanism.\n *\n * Wiring splits in two, and a multi-selection treats the halves differently:\n *\n * - **Which events exist, and how each is produced** — the event key, its Value Source rung, and its\n * removal — is a property of the BATCH. Binding one handler to six buttons, or clearing it off\n * all six, is a single decision, so those three controls write to every selected element inside\n * one transaction and one undo step.\n * - **What a handler CONTAINS** — a function body, an expression's operands, a repeater's source and\n * template — is the PRIMARY's. Six elements do not share one handler body; broadcasting a\n * keystroke into six different bodies would destroy five of them, and showing one body while\n * claiming to edit six is the lie the Mixed chip exists to prevent.\n *\n * So the row header states `mixed (n)` when the selected elements disagree about a key — including\n * when some of them do not bind it at all — and the body below it stays what it always was: the\n * primary's, edited alone.\n *\n * @param {readonly JxPath[]} targets\n * @param {string} key\n * @param {JsonValue} [value] — omitted deletes the key.\n */\nfunction commitToTargets(targets: readonly JxPath[], key: string, value?: JsonValue): void {\n transactDoc(activeTab.value, (t) => {\n for (const target of targets) {\n mutateUpdateProperty(t, target, key, value);\n }\n });\n}\n\n/**\n * How many selected elements disagree about one event key — 0 when they agree or there is one.\n *\n * @param {JxMutableNode} doc\n * @param {readonly JxPath[]} targets\n * @param {string} evKey\n * @returns {number}\n */\nfunction mixedEventCount(doc: JxMutableNode, targets: readonly JxPath[], evKey: string): number {\n if (targets.length < 2) {\n return 0;\n }\n const values = targets.map((path) => {\n const n = getNodeAtPath(doc, path) as JxMutableNode | undefined;\n return n ? (getEventBinding(n, evKey) ?? null) : null;\n });\n return unifyValues(values).mixed ? targets.length : 0;\n}\n\nfunction renderEventsBody(\n node: JxMutableNode,\n selection: JxPath,\n isCustomElement: boolean,\n targets: readonly JxPath[] = [selection],\n) {\n const tab = activeTab.value!;\n const defs = tab.doc.document.state || {};\n const functionDefs = Object.entries(defs).filter(\n ([, d]) =>\n (d as JxPrototypeDef)?.$prototype === \"Function\" || (d as Record<string, unknown>)?.$handler,\n );\n\n // Declared CEM events (custom element docs)\n let declaredEventsT: unknown = nothing;\n if (isCustomElement) {\n const allEmits: (CemEvent & { _fn: string })[] = [];\n for (const [fnName, d] of Object.entries(defs)) {\n if (isFunctionDef(d) && Array.isArray(d.emits)) {\n for (const ev of d.emits) {\n allEmits.push({ ...ev, _fn: fnName });\n }\n }\n }\n if (allEmits.length > 0) {\n declaredEventsT = html`\n <div class=\"events-section\">\n <sp-field-label size=\"s\">Declared Events</sp-field-label>\n ${allEmits.map(\n (ev) => html`\n <div class=\"declared-event-row\" title=${ev.description || \"\"}>\n <code class=\"event-code\">${ev.name || \"(unnamed)\"}</code>\n <span class=\"event-source\">← ${ev._fn}</span>\n ${\n isJsonObject(ev.type) && typeof ev.type.text === \"string\"\n ? html`<span class=\"event-type\">${ev.type.text}</span>`\n : nothing\n }\n </div>\n `,\n )}\n </div>\n <sp-divider size=\"s\"></sp-divider>\n `;\n }\n }\n\n // Find existing event bindings. Resolved once, as pairs: asking `getEventBinding` for the key and\n // Then again for the value left a `if (!evVal) return nothing` arm nothing could ever reach.\n const eventEntries = Object.keys(node)\n .filter((k) => k.startsWith(\"on\"))\n .map((k) => [k, getEventBinding(node, k)] as const)\n .filter((pair): pair is [string, JxEventBinding] => pair[1] !== undefined);\n\n return html`\n <div class=\"events-panel\">\n ${declaredEventsT}\n <div class=\"events-section\">\n ${\n eventEntries.length > 0\n ? html` <sp-field-label size=\"s\">Event Bindings</sp-field-label> `\n : nothing\n }\n ${eventEntries.map(([evKey, evVal]) => {\n const inlineFn: JxFunctionDef | null = isFunctionDef(evVal) ? evVal : null;\n const expression = isExpressionDef(evVal) ? evVal.$expression : null;\n const refValue = isRef(evVal) ? evVal.$ref : null;\n const currentMode = slotMode(evVal);\n const modeFieldKey = `event|${selection.join(\"/\")}|${evKey}`;\n return html`\n <div class=\"event-binding\">\n <div class=\"event-row\">\n <jx-value-selector\n size=\"s\"\n class=\"event-name\"\n .value=${evKey}\n .options=${eventNameOptions(Object.keys(node).filter((k) => k.startsWith(\"on\")))}\n @change=${(e: Event) => {\n const newKey = (e.target as HTMLInputElement).value.trim();\n // A NAME, not a menu choice: the field is free-form now, so it has to refuse\n // What it cannot bind rather than trusting a list it no longer constrains.\n if (newKey && newKey !== evKey && /^on[a-z][\\da-z-]*$/i.test(newKey)) {\n // Renaming the key moves the binding on every selected element, in one step.\n transactDoc(activeTab.value, (t) => {\n for (const target of targets) {\n const existing = getEventBinding(\n getNodeAtPath(t.doc.document, target) as JxMutableNode,\n evKey,\n );\n if (existing === undefined) {\n continue;\n }\n mutateUpdateProperty(t, target, evKey);\n mutateUpdateProperty(t, target, newKey, existing as JsonValue);\n }\n });\n }\n }}\n >\n ></jx-value-selector\n >\n <sp-picker\n size=\"s\"\n class=\"event-mode\"\n .value=${live(currentMode)}\n @change=${(e: Event) => {\n const next = (e.target as HTMLInputElement).value as SlotMode;\n /* The same ladder the inspector's rows offer, remembering the representation\n it left: switching to Formula and back used to throw the handler body away. */\n commitToTargets(\n targets,\n evKey,\n switchSlotMode(\n modeFieldKey,\n currentMode,\n next,\n evVal as JsonValue,\n seedForHandlerMode(next, functionDefs),\n ) ?? seedForHandlerMode(next, functionDefs),\n );\n }}\n >\n ${HANDLER_MODES.map(\n (m) => html`<sp-menu-item value=${m}>${VALUE_SOURCE_LABELS[m]}</sp-menu-item>`,\n )}\n </sp-picker>\n ${renderProvenanceChip(evKey, {\n state: mixedEventCount(tab.doc.document, targets, evKey) > 0 ? \"mixed\" : \"set\",\n donor: String(targets.length),\n onClick: () => commitToTargets(targets, evKey),\n title:\n mixedEventCount(tab.doc.document, targets, evKey) > 0\n ? `${targets.length} selected elements bind ${evKey} differently — ` +\n `clearing removes it from all of them`\n : `Clear ${evKey}`,\n })}\n <sp-action-button size=\"xs\" quiet @click=${() => commitToTargets(targets, evKey)}>\n <sp-icon-delete slot=\"icon\"></sp-icon-delete>\n </sp-action-button>\n </div>\n ${\n inlineFn\n ? html`\n <div class=\"event-body-mode\" style=\"display:flex;justify-content:flex-end\">\n <sp-action-group size=\"s\" compact class=\"body-mode-toggle\">\n <sp-action-button\n size=\"s\"\n class=\"body-mode-statements\"\n ?selected=${Array.isArray(inlineFn.body)}\n @click=${() => {\n if (!Array.isArray(inlineFn.body)) {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n ...inlineFn,\n body: [],\n }),\n );\n }\n }}\n >\n Statements\n </sp-action-button>\n <sp-action-button\n size=\"s\"\n class=\"body-mode-code\"\n ?selected=${!Array.isArray(inlineFn.body)}\n @click=${() => {\n if (Array.isArray(inlineFn.body)) {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n ...inlineFn,\n body: \"\",\n }),\n );\n }\n }}\n >\n Code\n </sp-action-button>\n </sp-action-group>\n </div>\n ${\n Array.isArray(inlineFn.body)\n ? renderStatementEditor(\n inlineFn.body,\n (next) =>\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n ...inlineFn,\n body: next,\n }),\n ),\n {\n allowEventRef: true,\n emits: inlineFn.emits ?? [],\n // The Inspector's copy, named by the handler it edits. It answered\n // To `navigator/statements` until the docks were split, and then\n // To a bare `inspector/statements` — which this `.map` stamps once\n // Per structured handler, so two handlers on a node made two\n // Elements answer to it and `resolveRegion` took the second.\n region: inspectorStatementsRegion(evKey),\n stateDefs: Object.keys(defs),\n stateEntries: defs,\n },\n )\n : html`\n <div class=\"event-body-row\">\n <sp-textfield\n size=\"s\"\n multiline\n grows\n placeholder=\"// handler body\"\n .value=${live(typeof inlineFn.body === \"string\" ? inlineFn.body : \"\")}\n @input=${(e: Event) => {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n $prototype: \"Function\",\n body: (e.target as HTMLInputElement).value,\n parameters: inlineFn?.parameters || [],\n }),\n );\n }}\n >\n </sp-textfield>\n <sp-action-button\n size=\"xs\"\n quiet\n title=\"Open in editor\"\n @click=${() => {\n openLogicTarget({\n editing: { eventKey: evKey, path: selection, type: \"event\" },\n surface: \"function\",\n });\n }}\n >\n <sp-icon-code slot=\"icon\"></sp-icon-code>\n </sp-action-button>\n </div>\n `\n }\n `\n : expression\n ? html`\n <div class=\"event-body-row\">\n <div style=\"flex:1;min-width:0\">\n ${renderExpressionEditor(\n expression,\n (newNode: unknown) =>\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n $expression: newNode,\n }),\n ),\n {\n allowEventRef: true,\n // Live-context evaluation in the canvas iframe, snapshot fallback\n // (M6). The selection path is the context, so a binding inside a\n // Repeater template previews with the first item's $map scope.\n preview: livePreviewExpression(\n tab,\n `event:${JSON.stringify(selection)}:${evKey}`,\n expression,\n selection,\n () => renderOnly(\"rightPanel\"),\n ),\n onInsertDef: (defName, def) =>\n transactDoc(activeTab.value, (t) =>\n mutateAddDef(t, defName, def as Record<string, JsonValue>),\n ),\n stateDefs: Object.keys(defs),\n stateEntries: defs,\n },\n )}\n </div>\n <sp-action-button\n size=\"xs\"\n quiet\n title=\"Open in formula workspace\"\n @click=${() => {\n openLogicTarget({\n editing: { eventKey: evKey, path: selection, type: \"event\" },\n surface: \"formula\",\n });\n }}\n >\n <sp-icon-align-bottom slot=\"icon\"></sp-icon-align-bottom>\n </sp-action-button>\n </div>\n `\n : html`\n <sp-picker\n size=\"s\"\n class=\"event-handler\"\n .value=${live(refValue || \"__none__\")}\n @change=${(e: Event) => {\n if (\n (e.target as HTMLInputElement).value &&\n (e.target as HTMLInputElement).value !== \"__none__\"\n ) {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n $ref: (e.target as HTMLInputElement).value,\n }),\n );\n } else {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey),\n );\n }\n }}\n >\n <sp-menu-item value=\"__none__\">— none —</sp-menu-item>\n ${functionDefs.map(\n ([fName]) =>\n html`<sp-menu-item value=${`#/state/${fName}`}\n >${fName}</sp-menu-item\n >`,\n )}\n </sp-picker>\n `\n }\n </div>\n `;\n })}\n <sp-action-button\n size=\"s\"\n quiet\n @click=${() => {\n let evName = \"onclick\";\n for (const name of EVENT_NAMES) {\n if (!node[name]) {\n evName = name;\n break;\n }\n }\n if (functionDefs.length > 0) {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evName, {\n $ref: `#/state/${functionDefs[0]![0]}`,\n }),\n );\n } else {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evName, {\n $prototype: \"Function\",\n body: \"\",\n parameters: [],\n }),\n );\n }\n }}\n >\n <sp-icon-add slot=\"icon\"></sp-icon-add>\n Add Event\n </sp-action-button>\n </div>\n </div>\n `;\n}\n\n// ─── The custom element's outward contract ───────────────────────────────────\n\n/** Observed attributes: the `attribute` names a page may set from markup, and what they feed. */\nfunction renderObservedAttrsSection(document: JxMutableNode) {\n const state = document.state || {};\n const entries = Object.entries(state).filter(([, d]) => (d as Record<string, unknown>).attribute);\n return html`\n <sp-accordion-item\n label=\"Observed Attributes\"\n ?open=${isInspectorSectionOpen(\"__observed\", false)}\n @sp-accordion-item-toggle=${() =>\n setInspectorSection(\"__observed\", !isInspectorSectionOpen(\"__observed\", false))}\n >\n <div class=\"style-section-body\">\n ${\n entries.length === 0\n ? renderEmptyState({\n compact: true,\n message:\n \"Attributes let a page set this component from markup. \" +\n 'Name an \"attribute\" on a data entry to expose it here.',\n })\n : entries.map(([key, d]) => {\n const def = d as Record<string, unknown>;\n return renderStaticKvRow({\n detail: `→ ${key}`,\n name: String(def.attribute),\n ...(def.type ? { value: String(def.type) } : {}),\n ...(def.reflects ? { tags: [\"reflects\"] } : {}),\n });\n })\n }\n </div>\n </sp-accordion-item>\n `;\n}\n\n/** The `--custom-properties` a page may override on this component. */\nfunction renderCssPropsSection(node: JxMutableNode) {\n const style = node.style || {};\n const cssProps = Object.entries(style).filter(([k]) => k.startsWith(\"--\"));\n if (cssProps.length === 0) {\n return nothing;\n }\n return html`\n <sp-accordion-item\n label=\"CSS Properties\"\n ?open=${isInspectorSectionOpen(\"__cssprops\", false)}\n @sp-accordion-item-toggle=${() =>\n setInspectorSection(\"__cssprops\", !isInspectorSectionOpen(\"__cssprops\", false))}\n >\n <div class=\"style-section-body\">\n ${cssProps.map(([prop, val]) => renderStaticKvRow({ name: prop, value: String(val) }))}\n </div>\n </sp-accordion-item>\n `;\n}\n\n/** The `part` names a page may style inside this component's shadow tree. */\nfunction renderCssPartsSection(document: JxMutableNode) {\n const parts = collectCssParts(document);\n if (parts.length === 0) {\n return nothing;\n }\n return html`\n <sp-accordion-item\n label=\"CSS Parts\"\n ?open=${isInspectorSectionOpen(\"__cssparts\", false)}\n @sp-accordion-item-toggle=${() =>\n setInspectorSection(\"__cssparts\", !isInspectorSectionOpen(\"__cssparts\", false))}\n >\n <div class=\"style-section-body\">\n ${parts.map((p) => renderStaticKvRow({ detail: `<${p.tag}>`, name: p.name }))}\n </div>\n </sp-accordion-item>\n `;\n}\n\n// ─── The tab ─────────────────────────────────────────────────────────────────\n\n/**\n * The Logic tab.\n *\n * @param {{ isCustomElementDoc: () => boolean }} helpers — injected because the answer needs the\n * tab's mode and ui, which the dock already has in hand.\n */\nexport function renderLogicPanelTemplate(helpers: {\n isCustomElementDoc: () => boolean;\n}): TemplateResult {\n const { isCustomElementDoc } = helpers;\n const tab = activeTab.value;\n const selection = primarySelection(tab?.session.selection);\n const doc = tab?.doc.document;\n if (!selection) {\n return renderEmptyState({ message: clickAnythingTo(\"wire it up\") });\n }\n const node = getNodeAtPath(doc!, selection);\n if (!node) {\n return renderEmptyState({ message: staleSelectionMessage() });\n }\n\n // The whole selection the Logic tab wires. `[selection]` when one element is selected — which is\n // Every existing call site's behaviour, unchanged.\n const targets: JxPath[] =\n tab!.session.selection.length > 0 ? tab!.session.selection : [selection];\n const isMapNode = node.$prototype === \"Array\";\n const isSwitchNode = Boolean(node.$switch);\n const isRoot = selection.length === 0;\n const isCustomElement = isCustomElementDoc();\n const mapSignals = mapSignalsFor(selection);\n\n const repeaterT = isMapNode\n ? html`\n <sp-accordion-item label=\"Repeating list\" open>\n <div class=\"style-section-body\">${renderRepeaterFieldsTemplate(node, selection)}</div>\n </sp-accordion-item>\n `\n : nothing;\n\n const switchT = isSwitchNode\n ? html`\n <sp-accordion-item label=\"Condition\" open>\n <div class=\"style-section-body\">\n ${renderSwitchFieldsTemplate(node, selection, mapSignals)}\n </div>\n </sp-accordion-item>\n `\n : nothing;\n\n // A repeater is not an element: it has no `on*` position to bind, and offering \"Add Event\" on one\n // Writes a handler onto a node the renderer never mounts.\n const eventsT = isMapNode\n ? nothing\n : html`\n <sp-accordion-item label=\"Events\" open>\n <div class=\"style-section-body\">\n ${renderEventsBody(node, selection, isCustomElement, targets)}\n </div>\n </sp-accordion-item>\n `;\n\n const contractT =\n isCustomElement && isRoot\n ? html`\n ${renderObservedAttrsSection(doc!)} ${renderCssPropsSection(node)}\n ${renderCssPartsSection(doc!)}\n `\n : nothing;\n\n return html`\n <div class=\"style-sidebar\">\n <sp-accordion allow-multiple size=\"s\">\n ${repeaterT} ${switchT} ${eventsT} ${contractT}\n </sp-accordion>\n </div>\n `;\n}\n",
6
+ "/**\n * Inherited-style.js — the effective inherited style for a breakpoint tab, **and the breakpoint it\n * came from**.\n *\n * Walks the cascade (base → each media block in order) up to but not including the active\n * breakpoint, producing the set of property values that would apply if no explicit override exists\n * on the current tab.\n *\n * The walk has always known the donor — it is the loop variable — and the answer was thrown away\n * one line later, which left the inspector able to show an inherited value only as an input\n * placeholder, visually identical to the CSS initial value rendered beside it.\n * {@link computeInheritedSources} keeps the donor; {@link computeInheritedStyle} is the projection\n * that drops it, for callers that only want the value.\n */\n\nimport type { JxStyle } from \"@jxsuite/schema/types\";\n\n/** One inherited property: the value that shows through, and the breakpoint it was set on. */\nexport interface InheritedSource {\n value: string | number;\n /** The donor breakpoint's name, or `null` when the value comes from the base context. */\n donor: string | null;\n}\n\n/**\n * Compute the inherited style map WITH each value's donor breakpoint.\n *\n * @param {JxStyle} style — full style object (flat props + @media blocks + selectors)\n * @param {string[]} mediaNames — ordered breakpoint names (from parseMediaEntries, respects cascade\n * direction)\n * @param {string | null} activeTab — current breakpoint tab name, or null for base\n * @param {string | null} activeSelector — current nested selector, or null\n * @returns {Record<string, InheritedSource>} Prop → { value, donor }\n */\nexport function computeInheritedSources(\n style: JxStyle,\n mediaNames: string[],\n activeTab: string | null,\n activeSelector: string | null = null,\n): Record<string, InheritedSource> {\n if (activeTab === null || mediaNames.length === 0) {\n return {};\n }\n\n const inherited: Record<string, InheritedSource> = {};\n\n /** Layer one block over the accumulator, recording `donor` for everything it contributes. */\n const layer = (block: JxStyle, donor: string | null) => {\n for (const [p, v] of Object.entries(block)) {\n if (typeof v !== \"object\") {\n inherited[p] = { donor, value: (v as string | number) ?? \"\" };\n }\n }\n };\n\n if (activeSelector) {\n // Selector inheritance: base selector → each media's selector block, in cascade order.\n layer((style[activeSelector] || {}) as JxStyle, null);\n for (const name of mediaNames) {\n if (name === activeTab) {\n break;\n }\n layer(\n (((style[`@${name}`] || {}) as Record<string, unknown>)[activeSelector] || {}) as JxStyle,\n name,\n );\n }\n return inherited;\n }\n\n // Base flat props first, then each media block in order until the current tab.\n layer(style, null);\n for (const name of mediaNames) {\n if (name === activeTab) {\n break;\n }\n layer((style[`@${name}`] || {}) as JxStyle, name);\n }\n return inherited;\n}\n\n/**\n * Compute the inherited style object for a given breakpoint tab — values only.\n *\n * @param {JxStyle} style — full style object (flat props + @media blocks + selectors)\n * @param {string[]} mediaNames — ordered breakpoint names (from parseMediaEntries, respects cascade\n * direction)\n * @param {string | null} activeTab — current breakpoint tab name, or null for base\n * @param {string | null} activeSelector — current nested selector, or null\n * @returns {Record<string, string | number>} Inherited style map (prop → value)\n */\nexport function computeInheritedStyle(\n style: JxStyle,\n mediaNames: string[],\n activeTab: string | null,\n activeSelector: string | null = null,\n): Record<string, string | number> {\n const values: Record<string, string | number> = {};\n for (const [prop, source] of Object.entries(\n computeInheritedSources(style, mediaNames, activeTab, activeSelector),\n )) {\n values[prop] = source.value;\n }\n return values;\n}\n",
7
+ "/// <reference lib=\"dom\" />\n/**\n * The Target Line — the Style tab's compound edit target, as one sentence (plan §6.1).\n *\n * ```text\n * ⌖ h1 · @md · :hover · dark variant [ all <h1> in this document ]\n * ```\n *\n * `style-panel.ts` has always computed this tuple exactly: it is the per-field key\n * (`style|${sel}|${editMedia}|${activeSelector}|${prop}`) and the five-branch if/else that picks\n * the commit function. What it did with it was hide it behind three disconnected widgets on two\n * different bars — a `<sp-tabs>` breakpoint strip, a `.selector-select` picker, and a\n * `.style-scheme-badge` whose class had **no CSS rule anywhere in the repo**, so the one control\n * that admitted the tab bar was overriding the panel rendered as unstyled inline text.\n *\n * Three rules shape what this module is allowed to be:\n *\n * 1. **Every segment is a control.** A sentence you cannot act on is a caption, and the panel already\n * had one of those.\n * 2. **The Style tab does not own the breakpoint or the scheme.** Those axes are SELECTED on the pane\n * context bar (region ⑦) and DEFINED in Project Settings › Contexts — §2 principle 5. The\n * breakpoint and scheme segments therefore state the resolved value and route to the definition\n * site; they do not offer a third list to pick from. The selector segment is the one axis this\n * tab owns, so it is the one segment with a menu.\n * 3. **The scope chip is what makes Stylebook safe.** Entering Stylebook silently discards the element\n * selection and converts every subsequent edit from \"this element\" to \"every element of this\n * tag\" — with one line of text, after the fact, as the only signal. The chip states the blast\n * radius BEFORE the first keystroke, and the project case is a warning band with an affected\n * count and a \"show affected\" list.\n *\n * The count comes from `services/references.ts` where that query can answer, and says **\"unknown\"**\n * where it cannot. A confirmation may be silent; it may never be confidently wrong.\n */\n\nimport { html, nothing } from \"lit-html\";\nimport { ref } from \"lit-html/directives/ref.js\";\nimport { classMap } from \"lit-html/directives/class-map.js\";\n\n/** The overlay this module drives — `open` is `overlay-trigger`'s own declared state. */\ninterface SelectorTrigger extends HTMLElement {\n open?: string | undefined;\n}\n\n/** The live selector trigger, captured by the template's own `ref`. */\nlet _selectorTrigger: SelectorTrigger | null = null;\n\n/**\n * Forget the trigger — the Inspector unmounted, or a test is starting clean.\n *\n * A module-local handle rather than a `querySelector` at call time: the line is rebuilt on every\n * Inspector render, so anything that resolved it once would hold a detached node.\n */\nexport function resetSelectorTrigger(): void {\n _selectorTrigger = null;\n}\n\n/**\n * Open the selector menu.\n *\n * `open = \"click\"` is the element's own declared state, which is the difference between a command\n * that presses a control and a manifest that hands a CSS selector to a synthetic mouse (§13).\n *\n * @throws {RangeError} When the Style tab is not rendered.\n */\nexport function openSelectorMenu(): void {\n if (!_selectorTrigger?.isConnected) {\n throw new RangeError(\n `command \"style.openSelectorMenu\" needs the Inspector's Style tab rendered; its selector ` +\n `menu is not in the document`,\n );\n }\n _selectorTrigger.open = \"click\";\n}\n\n/** Close it again — every menu choice does this, so the sentence is readable straight after. */\nfunction closeSelectorMenu(): void {\n if (_selectorTrigger) {\n _selectorTrigger.open = undefined;\n }\n}\n\n// ─── The model ───────────────────────────────────────────────────────────────\n\n/** One clickable word of the sentence. */\nexport interface TargetSegment {\n /** `element` | `media` | `scheme` — the axis, used as the segment's `data-seg`. */\n key: string;\n label: string;\n title: string;\n /** What clicking it opens. A segment with no action is not rendered as a button. */\n onActivate?: (() => void) | undefined;\n}\n\n/** The selector axis — the one the Style tab owns, so the one with a menu. */\nexport interface TargetSelector {\n /** The active nested selector, or `null` for the element's own base rule. */\n value: string | null;\n /** Every selector offerable right now: the common set ∪ what the element declares. */\n options: string[];\n /** Which options the element already declares — marked in the menu. */\n declared: Set<string>;\n onSelect: (selector: string | null) => void;\n /** Opens the Add Nested Selector dialog (`showPromptDialog`, ui-guidelines §8.7). */\n onAddCustom: () => void;\n}\n\n/** How wide the blast radius is, and what the app can say about it. */\nexport interface TargetScope {\n kind: \"element\" | \"document\" | \"project\";\n /** \"this element\" / \"all `<h1>` in this document\" / \"all `<h1>` in this project\". */\n label: string;\n /** The affected-count sentence — \"312 elements in 24 files\", or \"unknown\". */\n affected?: string | undefined;\n /** The files the count came from, for the \"show affected\" disclosure. */\n affectedFiles?: readonly { path: string; count: number }[] | undefined;\n showAffected?: boolean | undefined;\n onToggleAffected?: (() => void) | undefined;\n}\n\nexport interface TargetLineModel {\n segments: TargetSegment[];\n selector: TargetSelector;\n scope: TargetScope;\n}\n\n// ─── Rendering ───────────────────────────────────────────────────────────────\n\nfunction segmentTpl(segment: TargetSegment) {\n const cls = `tl-seg tl-seg--${segment.key}`;\n if (!segment.onActivate) {\n return html`<span class=${cls} data-seg=${segment.key} title=${segment.title}\n >${segment.label}</span\n >`;\n }\n return html`<button\n type=\"button\"\n class=${cls}\n data-seg=${segment.key}\n title=${segment.title}\n @click=${segment.onActivate}\n >\n ${segment.label}\n </button>`;\n}\n\n/** The label the selector segment wears when no nested selector is active. */\nexport const BASE_SELECTOR_LABEL = \"base rule\";\n\nfunction selectorTpl(selector: TargetSelector) {\n const label = selector.value ?? BASE_SELECTOR_LABEL;\n const choose = (value: string | null) => {\n closeSelectorMenu();\n selector.onSelect(value);\n };\n return html`\n <overlay-trigger\n placement=\"bottom-start\"\n triggered-by=\"click\"\n ${ref((el) => {\n _selectorTrigger = (el as SelectorTrigger | undefined) ?? null;\n })}\n >\n <button\n slot=\"trigger\"\n type=\"button\"\n class=\"tl-seg tl-seg--selector\"\n data-seg=\"selector\"\n title=\"The state or nested rule these edits land in — click to choose another\"\n >\n ${label} ⌄\n </button>\n <sp-popover slot=\"click-content\" tip class=\"tl-selector-popover\">\n <sp-menu class=\"tl-selector-menu\">\n <sp-menu-item value=\"__base__\" @click=${() => choose(null)}>\n ${BASE_SELECTOR_LABEL}\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n ${selector.options.map(\n (option) => html`\n <sp-menu-item value=${option} @click=${() => choose(option)}>\n ${selector.declared.has(option) ? `${option} ●` : option}\n </sp-menu-item>\n `,\n )}\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item\n value=\"__add_custom__\"\n @click=${() => {\n closeSelectorMenu();\n selector.onAddCustom();\n }}\n >\n + Add custom…\n </sp-menu-item>\n </sp-menu>\n </sp-popover>\n </overlay-trigger>\n `;\n}\n\nfunction scopeTpl(scope: TargetScope) {\n const classes = classMap({\n \"tl-scope\": true,\n [`tl-scope--${scope.kind}`]: true,\n });\n const title =\n scope.kind === \"element\"\n ? \"These edits apply to the selected element only\"\n : `These edits apply to ${scope.label}`;\n return html`<span class=${classes} data-scope=${scope.kind} title=${title}>${scope.label}</span>`;\n}\n\nfunction warningTpl(scope: TargetScope) {\n if (scope.kind !== \"project\") {\n return nothing;\n }\n const files = scope.affectedFiles ?? [];\n return html`\n <div class=\"tl-warning\" role=\"status\">\n <p class=\"tl-warning-text\">\n Every edit here restyles ${scope.label} — ${scope.affected ?? \"unknown\"}.\n </p>\n ${\n scope.onToggleAffected\n ? html`<button type=\"button\" class=\"tl-warning-action\" @click=${scope.onToggleAffected}>\n ${scope.showAffected ? \"Hide affected\" : \"Show affected\"}\n </button>`\n : nothing\n }\n ${\n scope.showAffected\n ? files.length > 0\n ? html`<ul class=\"tl-affected\">\n ${files.map(\n (file) => html`<li class=\"tl-affected-row\">\n <span class=\"tl-affected-path\">${file.path}</span>\n <span class=\"tl-affected-count\">${file.count}</span>\n </li>`,\n )}\n </ul>`\n : html`<p class=\"tl-affected-empty\">\n No file list — the project could not be searched.\n </p>`\n : nothing\n }\n </div>\n `;\n}\n\n/**\n * Render the Target Line.\n *\n * @param {TargetLineModel} model\n * @returns {import(\"lit-html\").TemplateResult}\n */\nexport function renderTargetLine(model: TargetLineModel) {\n return html`\n <div class=\"target-line\" data-jx-region=\"inspector/target\">\n <span class=\"tl-glyph\" aria-hidden=\"true\">⌖</span>\n <div class=\"tl-segments\">\n ${model.segments.map(\n (segment, index) => html`\n ${index > 0 ? html`<span class=\"tl-sep\" aria-hidden=\"true\">·</span>` : nothing}\n ${segmentTpl(segment)}\n `,\n )}\n <span class=\"tl-sep\" aria-hidden=\"true\">·</span>\n ${selectorTpl(model.selector)}\n </div>\n ${scopeTpl(model.scope)}\n </div>\n ${warningTpl(model.scope)}\n `;\n}\n",
8
+ "/// <reference lib=\"dom\" />\n/**\n * Style panel — CSS property editor under the **Target Line** (§6.1), with provenance-coded rows\n * (§6.2), a section accordion, shorthand expand/compress, and a property filter.\n *\n * The panel resolves a compound coordinate before it can commit anything: `(selection, breakpoint,\n * scheme layer, nested selector)`. It has always computed that tuple — it is the per-field key and\n * the five-branch if/else below — and it used to hide it behind three disconnected widgets on two\n * different bars. `target-line.ts` renders it as one sentence instead, and the three widgets are\n * gone: the breakpoint and scheme axes are selected on the pane context bar (region ⑦), and the\n * selector is the one axis this tab owns.\n *\n * Every row then says where its value came from. `provenance.ts` supplies the chip;\n * `computeInheritedSources()` supplies the donor breakpoint the cascade walk always knew and this\n * panel used to throw away.\n */\n\nimport { html, nothing } from \"lit-html\";\nimport { getNestedStyle } from \"@jxsuite/schema/guards\";\nimport { live } from \"lit-html/directives/live.js\";\nimport { ifDefined } from \"lit-html/directives/if-defined.js\";\nimport {\n COMMON_SELECTORS,\n debouncedStyleCommit,\n getNodeAtPath,\n isNestedSelector,\n renderOnly,\n updateUi,\n} from \"../store\";\nimport { activeTab } from \"../workspace/workspace\";\nimport { primarySelection, unifyValues } from \"../tabs/selection\";\nimport { shell } from \"../shell\";\nimport { activeRegistry } from \"../commands/active-registry\";\nimport { selectStylebookTag } from \"./stylebook-panel\";\nimport {\n mutateUpdateMediaNestedStyle,\n mutateUpdateMediaNestedStylePath,\n mutateUpdateMediaStyle,\n mutateUpdateNestedStyle,\n mutateUpdateNestedStylePath,\n mutateUpdateStyle,\n transactDoc,\n} from \"../tabs/transact\";\nimport { inferInputType, propLabel } from \"../utils/studio-utils\";\nimport { stringArg } from \"../commands/command-args\";\nimport type { AnyCommand, CommandRegistry } from \"../commands/registry\";\nimport { renderFieldRow } from \"../ui/field-row\";\nimport { showPromptDialog } from \"../ui/layers\";\nimport { renderDynamicSlot } from \"../ui/dynamic-slot\";\nimport { parseMediaEntries, schemeOfQuery } from \"../utils/canvas-media\";\nimport { getEffectiveMedia, getEffectiveStyle } from \"../site-context\";\nimport { computeInheritedSources } from \"../utils/inherited-style\";\nimport { loadUsages, peekUsages, usageFiles } from \"../services/references\";\nimport { mediaDisplayName } from \"./shared\";\nimport { countProvenance, renderProvenanceChip, renderProvenanceDots } from \"./provenance\";\nimport {\n openSelectorMenu,\n renderTargetLine,\n resetSelectorTrigger as resetTargetSelector,\n} from \"./target-line\";\nimport {\n clickAnythingTo,\n openPageAction,\n renderEmptyState,\n staleSelectionMessage,\n} from \"./empty-state\";\nimport {\n allConditionsPass,\n autoOpenSections,\n compressBorderSide,\n compressShorthand,\n cssMeta,\n expandBorderSide,\n expandShorthand,\n getCssInitialMap,\n getLonghands,\n} from \"./style-utils\";\nimport { widgetForType } from \"./style-inputs\";\n\nimport type { FieldProvenance, ProvenanceState } from \"./provenance\";\nimport type { TargetScope, TargetSegment } from \"./target-line\";\nimport type { Tab } from \"../tabs/tab\";\nimport type { JxPath } from \"../state\";\nimport type { JsonValue } from \"../types\";\nimport type { JxMutableNode, JxStyle } from \"@jxsuite/schema/types\";\n\ninterface CssLonghand {\n name: string;\n entry: Record<string, unknown>;\n}\n\ntype CssPropertyEntry = Record<string, unknown>;\n\n/** The chip a row wears when its caller has nothing more specific to say. */\nconst DEFAULT_PROVENANCE: FieldProvenance = { state: \"default\" };\n\ntype StyleMutateFn = (\n t: Tab,\n prop: string,\n val?: string | Record<string, unknown> | undefined,\n) => void;\n\n/**\n * Check if a selector is a stylebook tag path (e.g., \"table\" or \"table th\"). Tag paths don't start\n * with selector prefixes (`:`, `.`, `&`, `[`, `@`).\n *\n * @param {string} selector\n * @returns {boolean}\n */\nfunction isTagPath(selector: string) {\n return /^[a-z]/.test(selector);\n}\n\n/**\n * Resolve a style object by traversing a nested tag path. e.g., \"table th\" → style[\"table\"][\"th\"]\n *\n * @param {JxStyle} style\n * @param {string} tagPath\n * @returns {JxStyle}\n */\nfunction resolveNestedTagStyle(style: JxStyle, tagPath: string): JxStyle {\n let obj: JxStyle | undefined = style;\n for (const part of tagPath.split(\" \")) {\n obj = getNestedStyle(obj, part);\n if (!obj) {\n return {};\n }\n }\n return obj;\n}\n\n/**\n * The style object one compound coordinate addresses.\n *\n * Split out of the panel body because the coordinate has to be resolved TWICE: once against the\n * effective (site-merged) style, which is what the rows display, and once against the document's\n * own, which is what a commit writes. The difference between the two is the \"from site tokens\"\n * donor — invisible for as long as there was only one resolution.\n *\n * @param {JxStyle} style\n * @param {string | null} activeSelector\n * @param {string | null} editMedia\n * @returns {JxStyle}\n */\nfunction resolveContextStyle(\n style: JxStyle,\n activeSelector: string | null,\n editMedia: string | null,\n): JxStyle {\n const base = editMedia ? (getNestedStyle(style, `@${editMedia}`) ?? {}) : style;\n if (activeSelector) {\n return isTagPath(activeSelector)\n ? resolveNestedTagStyle(base, activeSelector)\n : (getNestedStyle(base, activeSelector) ?? {});\n }\n const flat: JxStyle = {};\n for (const [p, v] of Object.entries(base)) {\n if (typeof v !== \"object\") {\n flat[p] = v;\n }\n }\n return flat;\n}\n\n/**\n * The mutation that writes to one compound coordinate — the other half of\n * {@link resolveContextStyle}, and the reason the two now sit side by side: they are one decision\n * expressed twice, and they used to be interleaved in a five-branch `if/else` where a new branch\n * could easily read one coordinate and write another.\n *\n * @param {JxPath} sel\n * @param {string | null} activeSelector\n * @param {string | null} editMedia\n * @returns {StyleMutateFn}\n */\nfunction contextMutate(\n sel: JxPath,\n activeSelector: string | null,\n editMedia: string | null,\n): StyleMutateFn {\n if (activeSelector && isTagPath(activeSelector)) {\n const stylePath = activeSelector.split(\" \");\n return editMedia\n ? (t, prop, val) =>\n mutateUpdateMediaNestedStylePath(\n t,\n sel,\n editMedia,\n stylePath,\n prop,\n val as string | undefined,\n )\n : (t, prop, val) =>\n mutateUpdateNestedStylePath(t, sel, stylePath, prop, val as string | undefined);\n }\n if (activeSelector) {\n return editMedia\n ? (t, prop, val) =>\n mutateUpdateMediaNestedStyle(\n t,\n sel,\n editMedia,\n activeSelector,\n prop,\n val as string | undefined,\n )\n : (t, prop, val) =>\n mutateUpdateNestedStyle(t, sel, activeSelector, prop, val as string | undefined);\n }\n return editMedia\n ? (t, prop, val) => mutateUpdateMediaStyle(t, sel, editMedia, prop, val as string | undefined)\n : (t, prop, val) => mutateUpdateStyle(t, sel, prop, val as string | undefined);\n}\n\n/**\n * Which properties the selected elements disagree about, at the coordinate the tab is editing.\n *\n * Resolved through the SAME `resolveContextStyle` the panel reads its own values with, so \"mixed\"\n * is decided at exactly the breakpoint, scheme layer and selector the Target Line names — two cards\n * that differ only inside `@md` are not mixed while you are editing Base.\n *\n * Returns an empty set for a selection of one, which is the whole reason a single selection renders\n * no Mixed state anywhere: the loop never finds a second value to disagree with.\n *\n * @param {Tab} tab\n * @param {readonly JxPath[]} targets\n * @param {string | null} activeSelector\n * @param {string | null} editMedia\n * @returns {Set<string>}\n */\nfunction mixedStyleProps(\n tab: Tab,\n targets: readonly JxPath[],\n activeSelector: string | null,\n editMedia: string | null,\n): Set<string> {\n const mixed = new Set<string>();\n if (targets.length < 2) {\n return mixed;\n }\n const blocks = targets.map((path) => {\n const node = getNodeAtPath(tab.doc.document, path) as JxMutableNode | undefined;\n return resolveContextStyle(node?.style ?? {}, activeSelector, editMedia);\n });\n const props = new Set<string>();\n for (const block of blocks) {\n for (const prop of Object.keys(block)) {\n props.add(prop);\n }\n }\n for (const prop of props) {\n if (unifyValues(blocks.map((block) => block[prop] ?? null)).mixed) {\n mixed.add(prop);\n }\n }\n return mixed;\n}\n\n// ─── Row renderers ──────────────────────────────────────────────────────────\n\nfunction renderStyleRow(\n entry: CssPropertyEntry,\n prop: string,\n value: string,\n onCommit: (v: string | undefined) => void,\n isWarning: boolean,\n gridMode: boolean,\n inheritedValue: string | undefined,\n templateSignals: string[] = [],\n fieldKey: string = prop,\n provenance?: FieldProvenance,\n) {\n const chip: FieldProvenance = provenance ?? DEFAULT_PROVENANCE;\n const type = inferInputType(entry);\n const hasVal = value !== undefined && value !== \"\";\n const placeholder = !hasVal && inheritedValue ? String(inheritedValue) : \"\";\n const spanVal = gridMode && (entry as Record<string, unknown>).$span === 2 ? 2 : undefined;\n // The rungs come from `StyleObject.additionalProperties`, not from a list here (§6.6 rule 2).\n // That derives literal + ${} template: a CSS value carrying `${…}` IS a signal binding, which\n // `emitStyleString` compiles to a reactive declaration, and `$ref` is not admitted by JxStyle.\n // Naming the POSITION rather than the answer is the point — a schema that later admits another\n // Rung cannot then be contradicted by a hand-written array sitting here.\n const slot = renderDynamicSlot({\n caps: \"styleProperty\",\n fieldKey,\n onChange: (v?: JsonValue) => onCommit(v === undefined || v === \"\" ? undefined : String(v)),\n staticWidget: widgetForType(type, entry, prop, value, onCommit, { placeholder }),\n stateDefs: templateSignals,\n value,\n });\n // `hasValue` is false because the chip supersedes the row's derived set-dot: the dot could only\n // Say set-or-not, and three of the four states this panel can now answer with were previously\n // Indistinguishable from \"unset\".\n return renderFieldRow({\n prop,\n label: propLabel(entry, prop),\n hasValue: false,\n widget: slot.widget,\n provenance: chip,\n labelExtra: slot.modeButton,\n ...(spanVal != null && { span: spanVal }),\n warning: isWarning,\n });\n}\n\n/** What {@link renderShorthandRow} needs to draw one shorthand and its longhand children. */\ninterface ShorthandRowOptions {\n prop: string;\n entry: CssPropertyEntry;\n /** The style block at the edited coordinate — the primary element's, as every row reads it. */\n style: Record<string, unknown>;\n /** The write, already fanned across the selection. Called INSIDE a transaction. */\n mutate: StyleMutateFn;\n inherited: Record<string, string | number>;\n ctx: ProvenanceCtx;\n}\n\n/**\n * A shorthand property row: the header field, plus one row per longhand when it is expanded.\n *\n * Two things were wrong with it, and they were the same thing. It took a single-target mutation\n * while every other row in the tab took the selection-wide one, so \"set padding on six cards in one\n * decision\" — the sentence §6.5 makes, with padding as its example — wrote to one card. And it drew\n * its own `.set-dot` rather than a provenance chip, so a shorthand `mixedStyleProps` had ALREADY\n * flagged as mixed offered a plain \"Clear padding\" affordance instead of saying so.\n *\n * Both are fixed by taking the same two things every other row takes: `mutate`, which fans across\n * the selection, and `ctx`, which answers where a value came from.\n */\nfunction renderShorthandRow({\n prop: shortProp,\n entry,\n style,\n mutate,\n inherited,\n ctx,\n}: ShorthandRowOptions) {\n const tab = activeTab.value!;\n const longhands = getLonghands(shortProp) as CssLonghand[];\n const shortVal = style[shortProp];\n const hasLonghands = longhands.some((l: CssLonghand) => style[l.name] !== undefined);\n const isExpanded = tab.session.ui.styleShorthands[shortProp] ?? hasLonghands;\n const hasAnyVal = shortVal !== undefined || hasLonghands;\n\n /**\n * Drop every longhand, then write the shorthand — the one write order this row has.\n *\n * The longhands go unconditionally rather than \"the ones the panel can see set\", because what the\n * panel can see is the PRIMARY element's style: a second selected element with a `paddingTop` of\n * its own would otherwise keep it and quietly out-rank the shorthand just written over it.\n * Deleting a property an element does not have is a no-op on that element.\n */\n const writeShorthand = (val?: string | undefined) =>\n transactDoc(activeTab.value, (t) => {\n for (const l of longhands) {\n mutate(t, l.name);\n }\n mutate(t, shortProp, val);\n });\n const clearAll = () =>\n transactDoc(activeTab.value, (t) => {\n mutate(t, shortProp);\n for (const l of longhands) {\n mutate(t, l.name);\n }\n });\n\n const headerWidget = html`\n <div class=\"style-shorthand-header\">\n <sp-textfield\n size=\"s\"\n .value=${live(shortVal || \"\")}\n placeholder=${\n !shortVal && hasLonghands\n ? longhands.map((l: CssLonghand) => style[l.name] || \"0\").join(\" \")\n : !shortVal && inherited[shortProp]\n ? inherited[shortProp]\n : !shortVal && longhands.some((l: CssLonghand) => inherited[l.name])\n ? longhands.map((l: CssLonghand) => inherited[l.name] || \"0\").join(\" \")\n : \"\"\n }\n @input=${debouncedStyleCommit(`short:${shortProp}`, 400, (e: Event) => {\n writeShorthand((e.target as HTMLInputElement).value || undefined);\n })}\n ></sp-textfield>\n <sp-action-button\n size=\"xs\"\n quiet\n @click=${(e: Event) => {\n e.stopPropagation();\n activeTab.value!.session.ui.styleShorthands = {\n ...activeTab.value!.session.ui.styleShorthands,\n [shortProp]: !isExpanded,\n };\n }}\n >\n ${\n isExpanded\n ? html`<sp-icon-chevron-down slot=\"icon\"></sp-icon-chevron-down>`\n : html`<sp-icon-chevron-right slot=\"icon\"></sp-icon-chevron-right>`\n }\n </sp-action-button>\n </div>\n `;\n\n return html`\n ${renderFieldRow({\n prop: shortProp,\n label: propLabel(entry, shortProp),\n hasValue: hasAnyVal,\n widget: headerWidget,\n provenance: shorthandProvenance(shortProp, ctx, hasAnyVal ? clearAll : undefined),\n })}\n ${\n isExpanded\n ? (() => {\n const isBorderSide =\n (entry as Record<string, unknown>).$shorthandType === \"border-side\";\n const expanded = shortVal\n ? isBorderSide\n ? expandBorderSide(shortVal as string)\n : expandShorthand(shortVal as string, longhands.length)\n : null;\n const compress = isBorderSide ? compressBorderSide : compressShorthand;\n const emptyVal = isBorderSide ? \"\" : \"0\";\n /** This longhand becomes `val`; the others keep whatever they show. */\n const recompress = (idx: number, val: string) =>\n writeShorthand(\n compress(\n longhands.map((l: CssLonghand, i: number) =>\n i === idx ? val : (style[l.name] ?? (expanded ? expanded[i] : emptyVal)),\n ) as string[],\n ),\n );\n return longhands.map(({ name, entry: lEntry }: CssLonghand, idx: number) => {\n const lVal = style[name] ?? (expanded ? expanded[idx] : \"\");\n const hasLVal = lVal !== undefined && lVal !== \"\";\n return html`\n <div class=\"style-row style-row--child\" data-prop=${name}>\n <div class=\"style-row-label\">\n ${renderProvenanceChip(\n name,\n longhandProvenance(name, shortProp, hasLVal, ctx, () =>\n recompress(idx, emptyVal),\n ),\n )}\n <sp-field-label size=\"s\" title=${name}\n >${propLabel(lEntry, name)}</sp-field-label\n >\n </div>\n ${widgetForType(\n inferInputType(lEntry),\n lEntry,\n name,\n lVal as string,\n (newVal: string) => recompress(idx, newVal || emptyVal),\n {\n placeholder: !lVal && inherited[name] ? String(inherited[name]) : \"\",\n },\n )}\n </div>\n `;\n });\n })()\n : nothing\n }\n `;\n}\n\n// ─── The edit target ─────────────────────────────────────────────────────────\n\n/** Forget the selector menu's element handle — the Inspector unmounted, or a test starts clean. */\nexport function resetSelectorMenu(): void {\n resetTargetSelector();\n}\n\n/**\n * Whether the \"show affected\" list under a project-wide warning band is open.\n *\n * Module-local rather than a `session.ui` field: it is a disclosure on a project-level warning, and\n * a per-document field would make the same warning open in one tab and closed in another.\n */\nlet _showAffected = false;\n\n/** Fold the affected list away — the Inspector unmounted, or a test starts clean. */\nexport function resetAffectedDisclosure(): void {\n _showAffected = false;\n}\n\n/**\n * Ask a registered command to do something this panel does not own.\n *\n * The breakpoint and the colour scheme are DEFINED in Project Settings › Contexts and SELECTED on\n * the pane context bar. A Target Line segment that opened its own list would be the third selector\n * §6.4 forbids, so it routes to the definition site through the same command the context bar's\n * \"Manage contexts…\" footer runs.\n */\nfunction runCommand(id: string, args?: Record<string, unknown>): void {\n void activeRegistry()?.run(id, args);\n}\n\n/**\n * The tag a stylebook rule restyles, when one is being edited.\n *\n * In Stylebook the \"selector\" is a bare tag path (`h1`, `table th`) written into the DOCUMENT's\n * root style, so the first segment of the path is the tag whose blast radius the scope chip\n * states.\n */\nfunction stylebookTagOf(selector: string | null): string | null {\n return selector && isTagPath(selector) ? (selector.split(\" \")[0] ?? null) : null;\n}\n\n/**\n * Whether this document IS the project's stylesheet.\n *\n * `project.json`'s `style` is not a document's style. The compiler hands it to EVERY route's\n * compile as `projectStyle` (`site/site-build.ts`), and `compileStyles` emits its custom properties\n * as `:root`, its flat properties as `body`, and every bare tag key as a global rule — so `{ \"h1\":\n * { \"color\": \"red\" } }` in project.json becomes `h1 { color: red }` in the stylesheet of every\n * page, reaching inside every component instance too (nothing in the compiler or the runtime\n * attaches a shadow root). Studio shows the same cascade: `getEffectiveStyle` merges the object\n * into every open document.\n *\n * That makes the document Stylebook opens by default the widest blast radius in the app — and it is\n * the one `resolveScope` used to label \"in this **document**\", the narrowest.\n *\n * Matched by suffix rather than by equality, the way `studio.ts` and `imports-panel.ts` already\n * address this file: a config reached from a sub-directory is still a config, and it still has no\n * elements of its own for \"in this document\" to be about.\n */\nfunction isProjectStylesheet(path: string): boolean {\n return /(?:^|\\/)project\\.json$/.test(path);\n}\n\n/**\n * How wide an edit here reaches, and — for the project case — how wide, in numbers.\n *\n * Three kinds, in the order a user meets them:\n *\n * - **element** — an element is selected; the rule is scoped to it and to nothing else.\n * - **document** — Stylebook on an ordinary document: every `<tag>` on this page.\n * - **project** — the same keystroke restyles files that are not open. Two documents reach this far:\n * a LAYOUT, whose root style is inherited by every page declaring it, and\n * {@link isProjectStylesheet}, which is inherited by all of them.\n *\n * The project stylesheet reaches it with NO tag as well, which no other document does: deselecting\n * in Stylebook leaves the tab editing project.json's own root style — `:root` and `body` on every\n * route — and there is no element anywhere for \"this element\" to have meant.\n */\nfunction resolveScope(tab: Tab, stylebookTag: string | null): TargetScope {\n const path = tab.documentPath ?? \"\";\n const isProjectStyle = isProjectStylesheet(path);\n if (!stylebookTag) {\n return isProjectStyle\n ? projectScope(\"every page in this project\", null)\n : { kind: \"element\", label: \"this element\" };\n }\n const shared = isProjectStyle || /^\\.?\\/?layouts\\//.test(path);\n const label = `all <${stylebookTag}> in this ${shared ? \"project\" : \"document\"}`;\n return shared ? projectScope(label, stylebookTag) : { kind: \"document\", label };\n}\n\n/**\n * The project-wide warning band: its label, its count, and its disclosure.\n *\n * The count is `findReferences`' tag walk, which counts `tagName` matches across the project. Where\n * the host cannot answer — no `findReferences` route, a failed sweep, or no tag to ask about — the\n * band says **unknown** rather than a confident zero, exactly as `services/references.ts` requires\n * of every rendering.\n *\n * @param {string} label\n * @param {string | null} tagName — null for a root-style edit, which has no tag to count.\n * @returns {TargetScope}\n */\nfunction projectScope(label: string, tagName: string | null): TargetScope {\n if (tagName === null) {\n // No tag, so no query: `:root`/`body` on every route is not a `tagName` sweep, and how many\n // Routes that is, is a question no surface here can answer. A zero would be the same lie the\n // Band exists to stop, in a smaller font — and with no file list, there is nothing to disclose.\n return { affected: \"how many pages that is, is unknown\", kind: \"project\", label };\n }\n const query = { tagName };\n const state = peekUsages(query);\n if (state === null) {\n // First paint for this tag: ask once, and repaint when the answer lands. `loadUsages` joins an\n // In-flight request, so a panel repainting sixty times a second is still one sweep.\n void loadUsages(query).then(() => renderOnly(\"rightPanel\"));\n }\n return {\n kind: \"project\",\n label,\n affected: affectedSentence(state),\n affectedFiles: state?.status === \"ready\" ? usageFiles(state.result) : [],\n showAffected: _showAffected,\n onToggleAffected: () => {\n _showAffected = !_showAffected;\n renderOnly(\"rightPanel\");\n },\n };\n}\n\n/** The affected count, in words — and \"unknown\" wherever the query cannot answer. */\nfunction affectedSentence(state: ReturnType<typeof peekUsages>): string {\n if (state === null || state.status === \"pending\") {\n return \"counting the elements it affects…\";\n }\n if (state.status !== \"ready\") {\n return \"how many elements that is, is unknown\";\n }\n const { files, refsTotal } = state.result;\n if (refsTotal === 0) {\n return \"no element in the project uses it yet\";\n }\n return `${refsTotal} element${refsTotal === 1 ? \"\" : \"s\"} in ${files.length} file${\n files.length === 1 ? \"\" : \"s\"\n }`;\n}\n\n/** The two axes the Style tab states but does not own, plus the element it is pointed at. */\nfunction targetSegments(\n elementLabel: string,\n mediaTab: string | null,\n hasBreakpoints: boolean,\n schemeLayer: string | null,\n): TargetSegment[] {\n const segments: TargetSegment[] = [\n {\n key: \"element\",\n label: elementLabel,\n title: \"What these edits are pointed at — click to find it in the Outline\",\n onActivate: () => runCommand(\"view.setActivity\", { tab: \"layers\" }),\n },\n {\n key: \"media\",\n label: hasBreakpoints && mediaTab ? `@${mediaDisplayName(mediaTab)}` : \"Base\",\n title:\n \"The breakpoint these edits land in. Choose it on the pane's Context control; click to \" +\n \"manage breakpoints.\",\n onActivate: () => runCommand(\"settings.open\", { section: \"contexts\" }),\n },\n ];\n if (schemeLayer) {\n segments.push({\n key: \"scheme\",\n label: `${mediaDisplayName(schemeLayer)} variant`,\n title:\n \"Edits land in this colour-scheme variant. Set the pane's Context control back to Auto \" +\n \"to edit base styles; click to manage schemes.\",\n onActivate: () => runCommand(\"settings.open\", { section: \"contexts\" }),\n });\n }\n return segments;\n}\n\n// ─── Provenance ──────────────────────────────────────────────────────────────\n\n/** An inherited value, its donor's name, and how to go there. */\ninterface InheritedInfo {\n value: string | number;\n donor: string;\n jump?: (() => void) | undefined;\n}\n\n/**\n * The signal a `${…}` style value reads, when it reads one.\n *\n * `state.` is optional because both spellings occur in documents and both mean the same entry — the\n * chip names the signal, not the accessor path it was reached by.\n */\nfunction templateSignalOf(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n return /\\$\\{\\s*(?:state\\.)?([A-Za-z_$][\\w$]*)/.exec(value)?.[1] ?? null;\n}\n\n/** Whether a value is a `${}` template rather than a literal — the `bound` rung for a CSS value. */\nfunction isTemplateValue(value: unknown): boolean {\n return typeof value === \"string\" && value.includes(\"${\");\n}\n\n/** What the Style tab can say about one property's origin. */\ninterface ProvenanceCtx {\n own: JxStyle;\n active: JxStyle;\n inherited: Record<string, InheritedInfo>;\n signals: string[];\n clear: (prop: string) => void;\n /**\n * Properties the selected elements DISAGREE about, and how many elements are selected (§6.5).\n *\n * Empty for a selection of one — which is what keeps every other branch of `provenanceOf`\n * reachable exactly as often as it was before the selection became a set.\n */\n mixed?: { props: Set<string>; count: number } | undefined;\n}\n\n/**\n * Where this property's value came from.\n *\n * Four answers, and three of them were previously indistinguishable from each other: an inherited\n * value arrived as a placeholder identical to the CSS initial value, a site token arrived looking\n * like a local override, and a `${}` binding arrived looking like a literal with braces in it.\n */\nfunction provenanceOf(prop: string, ctx: ProvenanceCtx): FieldProvenance {\n // Mixed is decided FIRST, because it is a fact about the selection rather than about the value:\n // The primary's own value may be perfectly ordinary while five other elements disagree with it,\n // And drawing that as `set` is exactly the lie this state exists to stop.\n if (ctx.mixed?.props.has(prop)) {\n return {\n state: \"mixed\",\n donor: String(ctx.mixed.count),\n onClick: () => ctx.clear(prop),\n };\n }\n const value = ctx.active[prop];\n if (value !== undefined && ctx.own[prop] === undefined) {\n // Present in the effective style but not in the document's own: it came from the site style.\n // No jump: the project style document is not something this tab can open.\n return {\n state: \"inherited\",\n donor: \"site tokens\",\n title: `Inherited from the project's site tokens — ${prop} is not set on this document`,\n };\n }\n if (value !== undefined) {\n if (isTemplateValue(value)) {\n const signal = templateSignalOf(value);\n return {\n state: \"bound\",\n ...(signal ? { donor: signal } : {}),\n ...(signal && ctx.signals.includes(signal)\n ? {\n onClick: () => {\n runCommand(\"view.setActivity\", { tab: \"data\" });\n runCommand(\"data.expandRow\", { name: signal });\n },\n }\n : {}),\n };\n }\n return { state: \"set\", onClick: () => ctx.clear(prop) };\n }\n const inherited = ctx.inherited[prop];\n if (inherited) {\n return {\n state: \"inherited\",\n donor: inherited.donor,\n ...(inherited.jump ? { onClick: inherited.jump } : {}),\n };\n }\n return { state: \"default\" };\n}\n\n/**\n * Where a SHORTHAND row's value came from.\n *\n * A shorthand is less a value than a name for four of them, so every answer it can give is about\n * five properties at once: `padding` is set when `padding` or any of `paddingTop…Left` is, mixed\n * when the selection disagrees about any of the five, and inherited when the cascade supplies one\n * and this document supplies none. Asking only about the shorthand key is what let the row draw a\n * plain \"Clear padding\" dot over a property the panel had already computed as mixed.\n *\n * @param {string} shortProp\n * @param {ProvenanceCtx} ctx\n * @param {(() => void) | undefined} [clearAll] — clears the shorthand AND its longhands, which is\n * the only clear this row has ever meant; omitted where there is nothing to clear.\n * @returns {FieldProvenance}\n */\nfunction shorthandProvenance(\n shortProp: string,\n ctx: ProvenanceCtx,\n clearAll?: (() => void) | undefined,\n): FieldProvenance {\n const props = [shortProp, ...(getLonghands(shortProp) as CssLonghand[]).map((l) => l.name)];\n const { mixed } = ctx;\n if (mixed && props.some((p) => mixed.props.has(p))) {\n return {\n state: \"mixed\",\n donor: String(mixed.count),\n ...(clearAll ? { onClick: clearAll } : {}),\n };\n }\n for (const p of props) {\n const prov = provenanceOf(p, ctx);\n if (prov.state === \"default\") {\n continue;\n }\n return prov.state === \"set\" && clearAll ? { ...prov, onClick: clearAll } : prov;\n }\n return DEFAULT_PROVENANCE;\n}\n\n/**\n * Where a longhand CHILD row's value came from.\n *\n * A longhand can hold a value it was never given: `padding: 1px 2px` fills four child rows, and\n * clearing one of them recompresses the shorthand rather than deleting a key. So a value derived\n * from the shorthand counts as `set` here, and a selection that disagrees about the shorthand\n * disagrees about every child the shorthand fills.\n *\n * @param {string} name\n * @param {string} shortProp\n * @param {boolean} hasValue — set here, or filled in by the shorthand above.\n * @param {ProvenanceCtx} ctx\n * @param {() => void} clearChild\n * @returns {FieldProvenance}\n */\nfunction longhandProvenance(\n name: string,\n shortProp: string,\n hasValue: boolean,\n ctx: ProvenanceCtx,\n clearChild: () => void,\n): FieldProvenance {\n const { mixed } = ctx;\n if (mixed && (mixed.props.has(name) || (hasValue && mixed.props.has(shortProp)))) {\n return { state: \"mixed\", donor: String(mixed.count), onClick: clearChild };\n }\n const prov = provenanceOf(name, ctx);\n if (prov.state === \"set\" || (prov.state === \"default\" && hasValue)) {\n return { state: \"set\", onClick: clearChild };\n }\n return prov;\n}\n\n/**\n * A section's tally, counting a shorthand as set when any of its longhands is.\n *\n * @param {{ prop: string; entry: CssPropertyEntry }[]} entries\n * @param {ProvenanceCtx} ctx\n */\nfunction sectionProvenance(\n entries: { prop: string; entry: CssPropertyEntry }[],\n ctx: ProvenanceCtx,\n): ProvenanceState[] {\n return entries.map(({ prop, entry }) =>\n inferInputType(entry) === \"shorthand\"\n ? shorthandProvenance(prop, ctx).state\n : provenanceOf(prop, ctx).state,\n );\n}\n\n// ─── Main template ──────────────────────────────────────────────────────────\n\n/**\n * @param {JxMutableNode} node\n * @param {string | null} activeMediaTab\n * @param {string | null} activeSelector\n * @param {{ effectiveStyle?: JxStyle; stylebookSelector?: string | null }} [opts] —\n * `effectiveStyle` is the site-merged style Stylebook edits against; `stylebookSelector` is the\n * tag catalogue entry being styled, which is what makes the edit tag-wide rather than\n * element-wide and therefore what the scope chip reports.\n */\nfunction styleSidebarTemplate(\n node: JxMutableNode,\n activeMediaTab: string | null,\n activeSelector: string | null,\n opts: { effectiveStyle?: JxStyle | undefined; stylebookSelector?: string | null } = {},\n) {\n const { effectiveStyle, stylebookSelector = null } = opts;\n const tab = activeTab.value!;\n const sel = primarySelection(tab.session.selection) as JxPath;\n /** The document's OWN style — what a commit writes into. */\n const ownRootStyle: JxStyle = node.style || {};\n const style = effectiveStyle ?? ownRootStyle;\n // Signals seeding the ${} template default when a style value escalates (no $ref in JxStyle).\n const templateSignals = Object.entries(tab.doc.document.state || {})\n .filter(\n ([, d]) =>\n !(d as Record<string, unknown>)?.$handler &&\n (d as Record<string, unknown>)?.$prototype !== \"Function\",\n )\n .map(([defName]) => defName);\n const { sizeBreakpoints } = parseMediaEntries(getEffectiveMedia(tab.doc.document.$media));\n const mediaNames = sizeBreakpoints.map((bp) => bp.name);\n const mediaTab = activeMediaTab || null;\n\n // ── Scheme-layer routing (spec §9.5) ────────────────────────────────────────\n // With the tab-bar scheme control forcing a scheme that has a matching declared scheme query,\n // Base-context edits target that scheme's `@--name` block — no extra sidebar tabs. Breakpoint\n // Tabs stay breakpoint-scoped (scheme × breakpoint compound blocks are unsupported).\n const forcedScheme = tab.session.ui.previewColorScheme;\n const schemeLayer =\n mediaTab === null && (forcedScheme === \"light\" || forcedScheme === \"dark\")\n ? (Object.entries(getEffectiveMedia(tab.doc.document.$media) ?? {}).find(\n ([, q]) => schemeOfQuery(String(q)) === forcedScheme,\n )?.[0] ?? null)\n : null;\n // The media context edits actually target: a valid breakpoint tab, else the scheme layer.\n const editMedia = mediaTab && mediaNames.length > 0 ? mediaTab : schemeLayer;\n\n // ── The selector axis — the one this tab owns ──────────────────────────────\n const contextStyle = editMedia\n ? (style[`@${editMedia}`] as Record<string, unknown>) || {}\n : style;\n const declaredSelectors = new Set(Object.keys(contextStyle).filter((s) => isNestedSelector(s)));\n const selectorOptions = [\n ...new Set([\n ...COMMON_SELECTORS,\n ...declaredSelectors,\n ...(activeSelector ? [activeSelector] : []),\n ]),\n ];\n\n // ── The Target Line (§6.1) ─────────────────────────────────────────────────\n // The three widgets this replaces are gone: the breakpoint `<sp-tabs>` strip, the\n // `.selector-select` picker and the `.style-scheme-badge`. The first two named axes the pane\n // Context bar already selects; the third emitted a class with no CSS rule anywhere in the repo.\n const stylebookTag = stylebookTagOf(stylebookSelector);\n const elementLabel =\n stylebookTag ?? (typeof node.tagName === \"string\" ? node.tagName : \"element\");\n const targetLineT = renderTargetLine({\n segments: targetSegments(elementLabel, mediaTab, mediaNames.length > 0, schemeLayer),\n selector: {\n value: activeSelector,\n options: selectorOptions,\n declared: declaredSelectors,\n onSelect: (value) => {\n activeTab.value!.session.ui.activeSelector = value;\n },\n onAddCustom: () => {\n // One flow, through `ui/layers.ts` — the imperative `<input>` this replaces was appended to\n // A bar lit-html owns, bypassing both the renderer and the overlay stack (§11.4).\n void showPromptDialog(\"Add Selector\", {\n confirmLabel: \"Use\",\n message: \"A state or nested rule to edit under this element.\",\n placeholder: \":hover, .child, &.active, [attr]\",\n validate: (v) =>\n isNestedSelector(v.trim()) ? \"\" : 'A selector must start with \":\", \".\", \"&\" or \"[\".',\n }).then((value) => {\n if (value) {\n activeTab.value!.session.ui.activeSelector = value.trim();\n renderOnly(\"rightPanel\");\n }\n });\n },\n },\n scope: resolveScope(tab, stylebookTag),\n });\n\n // ── Filter bar ─────────────────────────────────────────────────────────────\n // One control. The \"Active\" toggle is gone: it existed only because provenance was invisible\n // With a section closed, and a heading that says \"3 set here · 2 inherited\" answers the same\n // Question without hiding two thirds of the panel to do it (§6.2).\n const filterBarT = html`\n <div class=\"style-filter-bar\">\n <sp-textfield\n size=\"s\"\n class=\"style-filter-input\"\n placeholder=\"Filter properties…\"\n .value=${live(tab.session.ui.styleFilter || \"\")}\n @input=${(e: Event) => {\n activeTab.value!.session.ui.styleFilter = (e.target as HTMLInputElement).value;\n }}\n ></sp-textfield>\n </div>\n `;\n\n // ── Determine the active style object ──────────────────────────────────────\n const activeStyle = resolveContextStyle(style, activeSelector, editMedia);\n // The SAME coordinate, resolved against the document's own style. In Stylebook `style` is the\n // Site-merged effective style, so a property present here and absent there arrived from the\n // Project's tokens — a donor the panel can now name instead of drawing it as a local override\n // Whose \"clear\" would silently do nothing.\n const ownStyle =\n style === ownRootStyle\n ? activeStyle\n : resolveContextStyle(ownRootStyle, activeSelector, editMedia);\n // ── The selection, and what it means to commit to it (§6.5) ────────────────\n // Every selected element gets the same write, inside ONE `transactDoc` — so setting padding on\n // Six cards is one decision and one undo step. With one element selected this loop runs once\n // Against `sel` and is indistinguishable from the single-target commit it replaces.\n const targets = tab.session.selection.length > 0 ? tab.session.selection : [sel];\n /**\n * ONE write, applied to every selected element — the only write function this tab has.\n *\n * It takes the caller's transaction rather than opening its own, because a row that writes twice\n * (a shorthand and the longhands it supersedes; a renamed custom property and its old key) must\n * still be one undo step. There is no single-target counterpart: every row that had one wrote to\n * the primary element and silently dropped the rest of the selection on the floor.\n */\n const mutateTargets: StyleMutateFn = (t, prop, val) => {\n for (const target of targets) {\n contextMutate(target, activeSelector, editMedia)(t, prop, val);\n }\n };\n const commitStyle = (prop: string, val?: string | Record<string, unknown> | undefined) =>\n transactDoc(activeTab.value, (t) => mutateTargets(t, prop, val));\n /** One target's OWN block at this coordinate — what a write that preserves values reads first. */\n const targetStyleOf = (t: Tab, target: JxPath): JxStyle => {\n const targetNode = getNodeAtPath(t.doc.document, target) as JxMutableNode | undefined;\n return resolveContextStyle(targetNode?.style ?? {}, activeSelector, editMedia);\n };\n\n // ── Compute inherited style, and NAME THE DONOR ────────────────────────────\n // Scheme layer: the base styles show through as inherited; breakpoint tabs inherit from lower\n // Breakpoints as before. Either way the donor is known at this point and is now kept: it is the\n // Difference between \"some value is showing through\" and \"Base sets this to 16px, go and look\".\n const inheritedInfo: Record<string, InheritedInfo> = {};\n if (schemeLayer) {\n const baseBlock = activeSelector ? (getNestedStyle(style, activeSelector) ?? {}) : style;\n for (const [p, v] of Object.entries(baseBlock)) {\n if (typeof v !== \"object\") {\n inheritedInfo[p] = {\n value: (v as string | number) ?? \"\",\n donor: \"Base\",\n jump: () => updateUi(activeTab.value, \"previewColorScheme\", \"auto\"),\n };\n }\n }\n } else {\n for (const [p, source] of Object.entries(\n computeInheritedSources(style, mediaNames, mediaTab, activeSelector),\n )) {\n inheritedInfo[p] = {\n value: source.value,\n donor: source.donor === null ? \"Base\" : mediaDisplayName(source.donor),\n jump: () => updateUi(activeTab.value, \"activeMedia\", source.donor),\n };\n }\n }\n const inheritedStyle: Record<string, string | number> = {};\n for (const [p, info] of Object.entries(inheritedInfo)) {\n inheritedStyle[p] = info.value;\n }\n const mixedProps = mixedStyleProps(tab, targets, activeSelector, editMedia);\n const provCtx: ProvenanceCtx = {\n own: ownStyle,\n active: activeStyle,\n inherited: inheritedInfo,\n signals: templateSignals,\n clear: (prop: string) => commitStyle(prop),\n ...(mixedProps.size > 0 ? { mixed: { count: targets.length, props: mixedProps } } : {}),\n };\n\n // Auto-open sections that have properties\n const newSections = autoOpenSections({ style: activeStyle }, tab.session.ui.styleSections);\n if (JSON.stringify(newSections) !== JSON.stringify(tab.session.ui.styleSections)) {\n tab.session.ui.styleSections = newSections;\n }\n\n // Partition properties into sections\n const sectionProps: Record<string, { prop: string; entry: CssPropertyEntry }[]> = {};\n for (const sec of cssMeta.$sections) {\n sectionProps[sec.key] = [];\n }\n\n for (const [prop, entry] of Object.entries(cssMeta.$defs) as [string, CssPropertyEntry][]) {\n if (typeof (entry as Record<string, unknown>).$shorthand === \"string\") {\n continue;\n }\n const sec = ((entry as Record<string, unknown>).$section as string) || \"other\";\n sectionProps[sec]!.push({ entry, prop });\n }\n for (const sec of cssMeta.$sections) {\n sectionProps[sec.key]!.sort(\n (\n a: { prop: string; entry: CssPropertyEntry },\n b: { prop: string; entry: CssPropertyEntry },\n ) =>\n ((a.entry as Record<string, unknown>).$order as number) -\n ((b.entry as Record<string, unknown>).$order as number),\n );\n }\n\n const otherProps = [];\n for (const prop of Object.keys(activeStyle)) {\n if (!(cssMeta.$defs as Record<string, unknown>)[prop]) {\n const val = activeStyle[prop];\n if (val !== null && typeof val === \"object\") {\n continue;\n }\n otherProps.push(prop);\n }\n }\n\n const nestedRules: string[] = [];\n for (const [prop, val] of Object.entries(activeStyle)) {\n if (val !== null && typeof val === \"object\" && !Array.isArray(val) && !prop.startsWith(\"@\")) {\n nestedRules.push(prop);\n }\n }\n\n // ── Filter state ─────────────────────────────────────────────────────────\n const filterText = (tab.session.ui.styleFilter || \"\").toLowerCase();\n const isFiltering = filterText.length > 0;\n\n // ── Section templates ────────────────────────────────────────────────────\n const sectionTemplates = cssMeta.$sections\n .filter((sec) => sec.key !== \"other\")\n .map((sec) => {\n const entries = sectionProps[sec.key]!;\n\n const sectionActiveProps = entries.filter(\n ({ prop, entry }: { prop: string; entry: CssPropertyEntry }) => {\n if (activeStyle[prop] !== undefined) {\n return true;\n }\n if (inferInputType(entry) === \"shorthand\") {\n return (getLonghands(prop) as CssLonghand[]).some(\n (l: CssLonghand) => activeStyle[l.name] !== undefined,\n );\n }\n return false;\n },\n );\n\n const clearSection = () => {\n transactDoc(activeTab.value, (t) => {\n for (const { prop, entry } of sectionActiveProps) {\n if (activeStyle[prop] !== undefined) {\n mutateTargets(t, prop);\n }\n if (inferInputType(entry) === \"shorthand\") {\n for (const l of getLonghands(prop) as CssLonghand[]) {\n mutateTargets(t, l.name);\n }\n }\n }\n });\n };\n\n // The heading's own answer to \"is anything in here set, inherited or bound\" — the question\n // The retired \"Active\" toggle answered by hiding everything that was not.\n const counts = countProvenance(sectionProvenance(entries, provCtx));\n const headingT = html`\n <span slot=\"heading\" class=\"style-section-heading\">\n ${sec.label}\n ${renderProvenanceDots(counts, {\n onClearSet: sectionActiveProps.length > 0 ? clearSection : undefined,\n clearTitle: `Clear all ${sec.label.toLowerCase()} properties`,\n })}\n </span>\n `;\n\n const isOpen = isFiltering ? true : (tab.session.ui.styleSections[sec.key] ?? false);\n\n if (!isOpen) {\n return html`\n <sp-accordion-item\n label=${sec.label}\n .open=${false}\n @sp-accordion-item-toggle=${(e: Event) => {\n activeTab.value!.session.ui.styleSections = {\n ...activeTab.value!.session.ui.styleSections,\n [sec.key]: (e.target as HTMLElement & { open: boolean }).open,\n };\n }}\n >\n ${headingT}\n </sp-accordion-item>\n `;\n }\n\n const rows = [];\n for (const { prop, entry } of entries) {\n const val = activeStyle[prop];\n const hasVal = val !== undefined;\n const condMet = allConditionsPass(entry, activeStyle);\n const type = inferInputType(entry);\n if (!hasVal && !condMet) {\n continue;\n }\n\n if (filterText) {\n const label = propLabel(entry, prop).toLowerCase();\n if (!prop.includes(filterText) && !label.includes(filterText)) {\n continue;\n }\n }\n\n if (type === \"shorthand\") {\n const longhands = getLonghands(prop) as CssLonghand[];\n const hasAny =\n hasVal || longhands.some((l: CssLonghand) => activeStyle[l.name] !== undefined);\n if (!hasAny && !condMet) {\n continue;\n }\n rows.push(\n renderShorthandRow({\n prop,\n entry,\n style: activeStyle,\n mutate: mutateTargets,\n inherited: inheritedStyle,\n ctx: provCtx,\n }),\n );\n } else {\n const isWarning = hasVal && !condMet;\n if (hasVal || condMet) {\n rows.push(\n renderStyleRow(\n entry,\n prop,\n (val as string) ?? \"\",\n (newVal: string | undefined) => commitStyle(prop, newVal || undefined),\n isWarning,\n sec.$layout === \"grid\",\n inheritedStyle[prop] as string | undefined,\n templateSignals,\n `style|${sel.join(\"/\")}|${editMedia ?? \"\"}|${activeSelector ?? \"\"}|${prop}`,\n provenanceOf(prop, provCtx),\n ),\n );\n }\n }\n }\n\n if (isFiltering && rows.length === 0) {\n return nothing;\n }\n\n return html`\n <sp-accordion-item\n label=${sec.label}\n .open=${isOpen}\n @sp-accordion-item-toggle=${(e: Event) => {\n activeTab.value!.session.ui.styleSections = {\n ...activeTab.value!.session.ui.styleSections,\n [sec.key]: (e.target as HTMLElement & { open: boolean }).open,\n };\n }}\n >\n ${headingT}\n <div class=${sec.$layout === \"grid\" ? \"style-section-body--grid\" : \"\"}>${rows}</div>\n </sp-accordion-item>\n `;\n });\n\n // ── Custom section ─────────────────────────────────────────────────────────\n const cssInitialMap = getCssInitialMap();\n const customIsOpen = tab.session.ui.styleSections.other ?? otherProps.length > 0;\n const customSectionT = html`\n <sp-accordion-item\n label=\"Custom\"\n .open=${customIsOpen}\n @sp-accordion-item-toggle=${(e: Event) => {\n activeTab.value!.session.ui.styleSections = {\n ...activeTab.value!.session.ui.styleSections,\n other: (e.target as HTMLElement & { open: boolean }).open,\n };\n }}\n >\n <div>\n ${otherProps.map(\n (prop) => html`\n <div class=\"kv-row\">\n <sp-textfield\n size=\"s\"\n class=\"kv-key\"\n .value=${live(prop)}\n @change=${(e: Event) => {\n const newProp = (e.target as HTMLInputElement).value.trim();\n if (!newProp || newProp === prop) {\n return;\n }\n // A rename is the one write that cannot be fanned out with a single value: each\n // Element keeps ITS OWN value under the new key. The old code batched half of the\n // Rename (the delete) against the primary and the other half against the primary\n // Too, while the value cell beside it wrote to the whole selection — so renaming\n // A property the selection shared moved it on one element and left it on the\n // Rest.\n transactDoc(activeTab.value, (t) => {\n for (const target of targets) {\n const current = targetStyleOf(t, target)[prop];\n if (current === undefined) {\n continue;\n }\n const write = contextMutate(target, activeSelector, editMedia);\n write(t, prop);\n write(t, newProp, String(current));\n }\n });\n }}\n ></sp-textfield>\n <sp-textfield\n size=\"s\"\n class=\"kv-val\"\n .value=${live(String(activeStyle[prop]))}\n placeholder=${ifDefined(cssInitialMap.get(prop))}\n @input=${debouncedStyleCommit(`custom:${prop}`, 400, (e: Event) => {\n commitStyle(prop, (e.target as HTMLInputElement).value);\n })}\n ></sp-textfield>\n <sp-action-button size=\"xs\" quiet @click=${() => commitStyle(prop)}>\n <sp-icon-close slot=\"icon\"></sp-icon-close>\n </sp-action-button>\n </div>\n `,\n )}\n <div style=\"display:flex;gap:4px;padding-top:4px\">\n <sp-textfield\n size=\"s\"\n placeholder=\"Property name…\"\n style=\"flex:1\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n const prop = (e.target as HTMLInputElement).value.trim();\n if (prop) {\n const initial = cssInitialMap.get(prop) || \"\";\n commitStyle(prop, initial || \"\");\n (e.target as HTMLInputElement).value = \"\";\n }\n }\n }}\n ></sp-textfield>\n </div>\n </div>\n </sp-accordion-item>\n `;\n\n // ── Relative Styling section (nested rules) ───────────────────────────────\n const nestedIsOpen = tab.session.ui.styleSections.nested ?? nestedRules.length > 0;\n const nestedSectionT =\n nestedRules.length > 0\n ? html`\n <sp-accordion-item\n label=\"Relative Styling\"\n .open=${nestedIsOpen}\n @sp-accordion-item-toggle=${(e: Event) => {\n activeTab.value!.session.ui.styleSections = {\n ...activeTab.value!.session.ui.styleSections,\n nested: (e.target as HTMLElement & { open: boolean }).open,\n };\n }}\n >\n <div style=\"display:flex;flex-direction:column;gap:4px;padding:4px 0\">\n ${nestedRules.map(\n (rule) => html`\n <div style=\"display:flex;align-items:center;gap:4px\">\n <button\n style=\"flex:1;text-align:left;padding:6px 10px;background:var(--spectrum-gray-200, #1a1a1a);border:none;border-radius:var(--radius);color:var(--spectrum-gray-900, #fafafa);font-size:var(--spectrum-font-size-75, 12px);cursor:pointer\"\n @click=${() => {\n const newSelector = activeSelector ? `${activeSelector} ${rule}` : rule;\n selectStylebookTag(newSelector, undefined, {\n panCanvas: true,\n });\n }}\n >\n ${rule}\n </button>\n <sp-action-button size=\"xs\" quiet @click=${() => commitStyle(rule)}>\n <sp-icon-delete slot=\"icon\"></sp-icon-delete>\n </sp-action-button>\n </div>\n `,\n )}\n <button\n style=\"padding:6px 10px;background:none;border:1px dashed var(--spectrum-gray-400, #333);border-radius:var(--radius);color:var(--spectrum-gray-700, #a1a1aa);font-size:var(--spectrum-font-size-75, 12px);cursor:pointer\"\n @click=${async () => {\n const name = await showPromptDialog(\"Add Nested Selector\", {\n confirmLabel: \"Add\",\n message: \"Enter a selector to nest under the current rule.\",\n placeholder: \"th, :hover, .active\",\n validate: (v) => (v.trim() ? \"\" : \"Enter a selector.\"),\n });\n if (name) {\n commitStyle(name, {});\n }\n }}\n >\n + Add\n </button>\n </div>\n </sp-accordion-item>\n `\n : nothing;\n\n return html`\n <div class=\"style-sidebar\">\n ${targetLineT} ${filterBarT}\n <sp-accordion allow-multiple size=\"s\">\n ${sectionTemplates} ${nestedSectionT} ${customSectionT}\n </sp-accordion>\n </div>\n `;\n}\n\n// ─── Entry point ────────────────────────────────────────────────────────────\n\n/**\n * Top-level Style panel — returns a lit-html template.\n *\n * @param {{ getCanvasMode: () => string }} ctx\n * @returns {import(\"lit-html\").TemplateResult}\n */\nexport function renderStylePanelTemplate(ctx: { getCanvasMode: () => string }) {\n const tab = activeTab.value;\n const noDocument = () =>\n renderEmptyState({\n actions: [openPageAction()],\n message: \"Open a page to style what you click.\",\n });\n if (!tab) {\n return noDocument();\n }\n if (ctx.getCanvasMode() === \"stylebook\" && shell.stylebook.selection) {\n const node = tab.doc.document;\n if (!node) {\n return noDocument();\n }\n // No separate `Styling: <h1>` header. It said the same thing the Target Line's scope chip says,\n // Except that it said it as a caption, after the fact, and without the blast radius (§6.1).\n return styleSidebarTemplate(node, tab.session.ui.activeMedia, tab.session.ui.activeSelector, {\n effectiveStyle: getEffectiveStyle(node.style),\n stylebookSelector: shell.stylebook.selection,\n });\n }\n const selected = primarySelection(tab.session.selection);\n if (!selected) {\n return renderEmptyState({ message: clickAnythingTo(\"style it\") });\n }\n const node = getNodeAtPath(tab.doc.document, selected);\n if (!node) {\n return renderEmptyState({ message: staleSelectionMessage() });\n }\n return styleSidebarTemplate(node, tab.session.ui.activeMedia, tab.session.ui.activeSelector);\n}\n\n// ─── Commands ─────────────────────────────────────────────────────────────────\n\n/**\n * The Style tab's selector verbs.\n *\n * `style.openSelectorMenu` is the one command here that addresses a CONTROL rather than a state,\n * and it earns that on purpose: the shot it serves photographs the open menu, so the menu is the\n * subject. What it does not do is hand a CSS selector back to the runner for a synthetic mouse\n * press — the element comes from the Target Line's own `ref`, so a refactor of that markup moves\n * the handle with it. The menu it opens is now a segment of the Target Line rather than a picker on\n * a retired toolbar; the id, and therefore the shot, is unchanged.\n *\n * `style.setSelector` is the state half of the same idea, and it is what a caller that wants a\n * RESULT rather than a picture should use: the menu exists to choose a selector, and choosing one\n * is expressible.\n *\n * @returns {AnyCommand[]}\n */\nexport function styleCommands(): AnyCommand[] {\n const styleTabOpen = (ctx: { document: { open: boolean }; selection: { count: number } }) =>\n ctx.document.open && ctx.selection.count > 0;\n\n return [\n {\n category: \"View\",\n id: \"style.openSelectorMenu\",\n level: \"selection\",\n menus: [\"palette\"],\n group: \"8_style\",\n requires: \"the Style tab showing a selected element\",\n when: styleTabOpen,\n run: () => openSelectorMenu(),\n title: \"Open Selector Menu\",\n },\n {\n args: {\n additionalProperties: false,\n properties: {\n selector: pathlessSelectorProperty(),\n },\n required: [\"selector\"],\n type: \"object\",\n },\n category: \"View\",\n id: \"style.setSelector\",\n level: \"selection\",\n menus: [\"palette\"],\n group: \"8_style\",\n requires: \"an element selection\",\n when: styleTabOpen,\n run: (_commandCtx, args) => {\n const { selector } = args as { selector?: unknown };\n if (selector === null) {\n const tab = activeTab.value;\n if (tab) {\n tab.session.ui.activeSelector = null;\n }\n return;\n }\n const value = stringArg(\"style.setSelector\", args, \"selector\");\n if (!isNestedSelector(value)) {\n throw new RangeError(\n `command \"style.setSelector\" argument \"selector\": \"${value}\" is not a nested ` +\n `selector — it must start with \":\", \".\", \"&\" or \"[\"`,\n );\n }\n const tab = activeTab.value;\n if (!tab) {\n throw new RangeError(`command \"style.setSelector\" needs an open document`);\n }\n tab.session.ui.activeSelector = value;\n },\n title: \"Set Style Selector\",\n },\n ];\n}\n\n/** The `selector` property's schema: a nested selector, or `null` for the base context. */\nfunction pathlessSelectorProperty(): object {\n return {\n description:\n 'A nested selector such as \":hover\", \".child\" or \"[open]\". null edits the base context.',\n oneOf: [{ type: \"string\" }, { type: \"null\" }],\n };\n}\n\n/**\n * Register the Style tab's selector verbs.\n *\n * @param {CommandRegistry} registry\n */\nexport function registerStyleCommands(registry: CommandRegistry): void {\n registry.registerAll(styleCommands());\n}\n",
9
+ "/// <reference lib=\"dom\" />\n/**\n * Right panel — the Inspector dock: four tabs, one dock, one column.\n *\n * **Content · Style · Logic · Assistant**, text-labelled. Three of those are renames of what was\n * here (Properties→Content, Events→Logic) and the fourth is the assistant, folded in from the fifth\n * grid column it used to own — which is the point of plan §3.2 ⑨: an inspector tab costs zero\n * additional width, so the canvas gets the ~300px back and the assistant is still one key away.\n *\n * Two things changed shape to make that work:\n *\n * - **The tabs are words, not icons.** Three icon-only tabs with `title` attributes meant three hover\n * probes to learn a dock you look at all day, and the icons were `sp-icon-properties` /\n * `sp-icon-event` / `sp-icon-brush` — a form, a lightning bolt and a paintbrush, none of which\n * says \"this is where the link target lives\".\n * - **The containers are permanent.** The no-document state used to drop and rebuild them; it now\n * renders INTO the three document tabs, because the Assistant's DOM (composer draft, scroll\n * position, streaming part cache) must survive a document closing — the assistant works with no\n * project at all, which is exactly the New Project hand-off's requirement.\n *\n * Every tab renders under a header naming its target (§3.2 ⑨), the same treatment wave A gave the\n * Navigator panels. The Target Line proper — provenance-coded, cascade-aware — is §6 and P5; this\n * is its honest predecessor: the tab's name, and what it is pointed at.\n *\n * The heavy sub-templates (properties, style) remain in their own modules and are passed the ctx\n * they need.\n */\n\nimport { html, render as litRender } from \"lit-html\";\nimport { getNodeAtPath, nodeLabel, rightPanel } from \"../store\";\nimport { effect, effectScope, reactive } from \"../reactivity\";\nimport { createPanelScheduler } from \"./panel-scheduler\";\nimport type { PanelScheduler } from \"./panel-scheduler\";\nimport { activeTab } from \"../workspace/workspace\";\nimport { primarySelection } from \"../tabs/selection\";\nimport { openPageAction, renderEmptyState } from \"./empty-state\";\nimport { renderLogicPanelTemplate } from \"./events-panel\";\nimport { isCustomElementDoc } from \"./signals-panel\";\n\nimport { DEFAULT_INSPECTOR_TAB, isInspectorTabId, shell } from \"../shell\";\nimport { INSPECTOR_TABS } from \"../commands/defaults\";\nimport { inspectorTabRegion, REGION_ATTR } from \"../ui/regions\";\nimport { isColorPopoverOpen } from \"../ui/color-selector\";\nimport { renderStylePanelTemplate } from \"./style-panel\";\nimport { renderPropertiesPanelTemplate } from \"./properties-panel\";\n\nimport type { InspectorTabId } from \"../shell\";\nimport type { TemplateResult } from \"lit-html\";\nimport type { EffectScope } from \"@vue/reactivity\";\n\ninterface RightPanelCtx {\n navigateToComponent: (path: string) => void;\n getCanvasMode: () => string;\n renderCanvas: () => void;\n /**\n * Hand the Assistant tab's body to whoever owns the assistant, once.\n *\n * Injected rather than imported so the dependency runs one way: `chat-panel.ts` reaches back into\n * this module to SELECT its tab, and a matching import here would be a cycle between the host and\n * its tenant. `studio.ts` already composes both, so it is the natural place to join them.\n */\n mountAssistant: (host: HTMLElement) => void;\n}\n\nlet _ctx: RightPanelCtx | null = null;\n\nlet _scope: EffectScope | null = null;\n\nlet _scheduler: PanelScheduler | null = null;\n\n/**\n * The selected tab while NO document is open.\n *\n * `session.ui.rightTab` is per-document — the tab you were on comes back with the file — and with\n * no file there is nowhere per-document to put it. The Assistant is usable in exactly that state\n * (the New Project flow hands it a brief before any document exists), so the selection falls back\n * here rather than being refused.\n *\n * Reactive, because it is read by surfaces outside this module: the Command Bar's assistant toggle\n * reports whether the assistant is showing, and a plain field would leave that button lying on the\n * welcome screen — which is the whole class of bug `shell.ts` was split out to end.\n */\nconst _detached = reactive({ tab: DEFAULT_INSPECTOR_TAB as InspectorTabId });\n\n/**\n * Mount the right panel.\n *\n * @param {RightPanelCtx} ctx\n */\nexport function mount(ctx: RightPanelCtx) {\n _ctx = ctx;\n _scheduler = createPanelScheduler({\n blockWhile: isColorPopoverOpen,\n render: _doRender,\n root: rightPanel,\n });\n _scheduler.bindFocus();\n _scope = effectScope();\n _scope.run(() => {\n effect(() => {\n const tab = activeTab.value;\n // Layout chrome is not IN the document, so nothing per-tab changes when the canvas reports a\n // `layoutHit` — and the panel that answers it (the Content tab's Layout Element card) spent a\n // Release cycle repainting only because the canvas host happened to call `renderOnly` too.\n // Reading it here makes the dock's dependency on it real.\n void shell.layoutSelection;\n // No tab is a state the inspector renders (its no-document empty state), not one it skips.\n if (tab) {\n // Track properties the right panel reads\n void tab.doc.document;\n // The whole SET, joined — a bare property read would not re-trigger when the selection\n // Changes WITHIN the array, and §6.5's helpers always replace it but nothing enforces that.\n void tab.session.selection.map((path) => path.join(\"/\")).join(\"|\");\n void tab.session.ui.rightTab;\n void tab.session.ui.activeMedia;\n void tab.session.ui.activeSelector;\n void tab.session.ui.styleSections;\n void tab.session.ui.styleShorthands;\n void tab.session.ui.styleFilter;\n void tab.session.ui.inspectorSections;\n }\n render();\n });\n });\n}\n\nexport function unmount() {\n _scope?.stop();\n _scope = null;\n _ctx = null;\n _scheduler?.unbind();\n _scheduler = null;\n _containers = null;\n _detached.tab = DEFAULT_INSPECTOR_TAB;\n}\n\n/**\n * Request a render. Coalesced and deferred while a text input in the panel is focused or a color\n * popover is open (so explicit callers can never clobber a field mid-edit).\n */\nexport function render() {\n _scheduler?.schedule();\n}\n\n/**\n * The tab showing right now — the stored value, coerced to a declared one.\n *\n * Coercion rather than trust because the value is persisted session state: a build that spelled a\n * tab differently, or an automation step that guessed, must land on Content rather than on a blank\n * dock with no tab selected.\n */\nexport function inspectorTab(): InspectorTabId {\n const tab = activeTab.value;\n if (!tab) {\n return _detached.tab;\n }\n const stored: unknown = tab.session.ui.rightTab;\n return isInspectorTabId(stored) ? stored : DEFAULT_INSPECTOR_TAB;\n}\n\n/**\n * Select a tab. The ONE writer — the strip, `view.setRightTab`, `view.setAssistant` and the\n * assistant's own pending-prompt hand-off all come through here.\n */\nexport function setInspectorTab(tab: InspectorTabId): void {\n const aTab = activeTab.value;\n if (aTab) {\n aTab.session.ui.rightTab = tab;\n } else {\n _detached.tab = tab;\n }\n render();\n}\n\n/** Tab value → its body container, built once and reused across renders. */\nlet _containers: Map<InspectorTabId, HTMLElement> | null = null;\n\nfunction _ensureContainers(ctx: RightPanelCtx): Map<InspectorTabId, HTMLElement> {\n if (_containers) {\n return _containers;\n }\n _containers = new Map(\n INSPECTOR_TABS.map((t) => {\n const el = document.createElement(\"div\");\n el.className = \"panel-body\";\n el.setAttribute(REGION_ATTR, inspectorTabRegion(t.id));\n return [t.id as InspectorTabId, el] as const;\n }),\n );\n // The assistant owns its container for the life of the window: it is bound as lit's render host\n // For a streaming rAF loop, and rebuilding it would drop the transcript and the composer draft.\n ctx.mountAssistant(_containers.get(\"assistant\")!);\n return _containers;\n}\n\n/**\n * What the selected tab is pointed AT, in the fewest words that are true.\n *\n * A tag name when a node is selected, the document's own name when nothing is, and \"no document\"\n * when there is nothing open. The dock spent its whole life unable to answer this — three icon tabs\n * and no statement of target anywhere — which is how \"why is this field disabled\" became a question\n * with no on-screen answer.\n */\nfunction inspectorTarget(): string {\n const tab = activeTab.value;\n if (!tab) {\n return \"no document\";\n }\n // Layout chrome first: it is mutually exclusive with a document selection, and it is the one\n // Target whose name has to say where it came FROM — \"<header> in layouts/base.json\" is the whole\n // Answer to \"why can I not edit this\".\n const layout = shell.layoutSelection;\n if (layout) {\n return `<${layout.tagName || \"element\"}> in ${layout.layoutFile || \"the layout\"}`;\n }\n const paths = tab.session.selection;\n const selection = primarySelection(paths);\n if (selection) {\n // The inspector's title names the batch when there is one — it edits all of them, and titling\n // It after the primary alone is how a Mixed field ends up looking like a plain value.\n return paths.length > 1\n ? `${paths.length} elements`\n : nodeLabel(getNodeAtPath(tab.doc.document, selection));\n }\n const path = tab.documentPath;\n return path ? (path.split(\"/\").at(-1) ?? \"document\") : \"document\";\n}\n\n/** The dock's header: which tab you are in, and what it is pointed at. */\nfunction headerTpl(tab: InspectorTabId): TemplateResult {\n const title = INSPECTOR_TABS.find((t) => t.id === tab)?.title ?? tab;\n return html`\n <header class=\"panel-header\">\n <span class=\"panel-header-title\">${title}</span>\n <span class=\"panel-header-level\">${inspectorTarget()}</span>\n </header>\n `;\n}\n\n/** The four-tab strip. Text labels: a dock you read all day should not need to be hovered. */\nfunction tabsTpl(tab: InspectorTabId): TemplateResult {\n return html`\n <div class=\"panel-tabs inspector-tabs\">\n <sp-tabs\n selected=${tab}\n quiet\n size=\"s\"\n @change=${(e: Event & { target: { selected: string } }) => {\n const sel = e.target.selected;\n if (sel && sel !== tab && isInspectorTabId(sel)) {\n setInspectorTab(sel);\n }\n }}\n >\n ${INSPECTOR_TABS.map((t) => html`<sp-tab value=${t.id} label=${t.title}></sp-tab>`)}\n </sp-tabs>\n </div>\n `;\n}\n\n/** The inspector's no-document state, rendered into a document tab's own body. */\nfunction noDocumentTpl(): TemplateResult {\n return renderEmptyState({\n actions: [openPageAction()],\n message: \"Open a page to inspect and style what you click.\",\n });\n}\n\nfunction _doRender() {\n if (!_ctx) {\n return;\n }\n try {\n const ctx = _ctx as RightPanelCtx;\n const aTab = activeTab.value;\n const tab = inspectorTab();\n\n litRender(html`${headerTpl(tab)}${tabsTpl(tab)}`, rightPanel);\n\n const containers = _ensureContainers(ctx);\n // Show/hide containers, and attach any that a fresh build has not mounted yet.\n for (const [key, el] of containers) {\n el.style.display = key === tab ? \"\" : \"none\";\n if (!el.parentNode) {\n rightPanel.append(el);\n }\n }\n\n const body = containers.get(tab)!;\n // The assistant paints itself through its own rAF loop into this very container (streaming has\n // To repaint while the composer is focused), so the host must not render over it.\n if (tab === \"assistant\") {\n return;\n }\n if (!aTab) {\n litRender(noDocumentTpl(), body);\n return;\n }\n if (tab === \"properties\") {\n litRender(\n renderPropertiesPanelTemplate({\n navigateToComponent: ctx.navigateToComponent,\n }),\n body,\n );\n } else if (tab === \"events\") {\n litRender(\n renderLogicPanelTemplate({\n isCustomElementDoc: () =>\n isCustomElementDoc({\n document: aTab.doc.document,\n mode: aTab.doc.mode,\n selection: aTab.session.selection,\n ui: aTab.session.ui,\n }),\n }),\n body,\n );\n } else {\n try {\n litRender(renderStylePanelTemplate({ getCanvasMode: ctx.getCanvasMode }), body);\n } catch (error) {\n console.error(\"[renderStylePanelTemplate]\", error);\n }\n }\n } catch (error) {\n console.error(\"right-panel render error:\", error);\n }\n}\n"
10
+ ],
11
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFO,IAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGA,SAAS,gBAAgB,CAAC,UAAiE;AAAA,EACzF,MAAM,OAAO,IAAI;AAAA,EACjB,MAAM,MAA0C,CAAC;AAAA,EACjD,WAAW,QAAQ,CAAC,GAAG,UAAU,GAAG,WAAW,GAAG;AAAA,IAChD,IAAI,CAAC,KAAK,IAAI,IAAI,GAAG;AAAA,MACnB,KAAK,IAAI,IAAI;AAAA,MACb,IAAI,KAAK,EAAE,OAAO,MAAM,OAAO,KAAK,CAAC;AAAA,IACvC;AAAA,EACF;AAAA,EACA,OAAO;AAAA;AAWT,IAAM,gBAA4B,gBAAgB,cAAc;AAGhE,SAAS,kBAAkB,CAAC,MAAgB,cAA8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