@adea-ai/ui 0.151.11 → 0.151.13

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 (982) hide show
  1. package/dist/NOTICE +3 -2
  2. package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
  3. package/dist/components/composites/about-dialog/about-dialog.js +27 -48
  4. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  5. package/dist/components/composites/account-menu/account-menu.d.ts +2 -2
  6. package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
  7. package/dist/components/composites/account-menu/account-menu.js +4 -22
  8. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  9. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  10. package/dist/components/composites/action-button/action-button.js +2 -4
  11. package/dist/components/composites/action-button/action-button.js.map +1 -1
  12. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +1 -10
  13. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts.map +1 -1
  14. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +2 -1
  15. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  16. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  17. package/dist/components/composites/appearance-editor/appearance-choices.js +3 -2
  18. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  19. package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
  20. package/dist/components/composites/appearance-editor/appearance-editor.js +1 -0
  21. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  22. package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
  23. package/dist/components/composites/appearance-editor/appearance-rows.js +28 -53
  24. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  25. package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
  26. package/dist/components/composites/appearance-editor/font-settings-group.js +7 -47
  27. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  28. package/dist/components/composites/appearance-editor/index.d.ts +1 -0
  29. package/dist/components/composites/appearance-editor/index.d.ts.map +1 -1
  30. package/dist/components/composites/appearance-editor/index.js +2 -1
  31. package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
  32. package/dist/components/composites/catalog-browser/catalog-browser.js +8 -11
  33. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  34. package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts +5 -4
  35. package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -1
  36. package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -12
  37. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  38. package/dist/components/composites/chat/chat.d.ts +2 -2
  39. package/dist/components/composites/chat/chat.d.ts.map +1 -1
  40. package/dist/components/composites/chat/chat.js.map +1 -1
  41. package/dist/components/composites/checkpoint/checkpoint-model.js +1 -1
  42. package/dist/components/composites/checkpoint/checkpoint-model.js.map +1 -1
  43. package/dist/components/composites/checkpoint/checkpoint.js +3 -3
  44. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  45. package/dist/components/composites/confirmation/confirmation-model.d.ts +3 -12
  46. package/dist/components/composites/confirmation/confirmation-model.d.ts.map +1 -1
  47. package/dist/components/composites/confirmation/confirmation-model.js +5 -17
  48. package/dist/components/composites/confirmation/confirmation-model.js.map +1 -1
  49. package/dist/components/composites/confirmation/confirmation.js +1 -1
  50. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  51. package/dist/components/composites/context/context-model.js +1 -1
  52. package/dist/components/composites/context/context-model.js.map +1 -1
  53. package/dist/components/composites/file-tree/build-file-tree.d.ts +5 -12
  54. package/dist/components/composites/file-tree/build-file-tree.d.ts.map +1 -1
  55. package/dist/components/composites/file-tree/build-file-tree.js +26 -30
  56. package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
  57. package/dist/components/composites/file-tree/file-tree.d.ts +2 -2
  58. package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
  59. package/dist/components/composites/file-tree/file-tree.js +4 -30
  60. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  61. package/dist/components/composites/file-tree/index.d.ts +2 -1
  62. package/dist/components/composites/file-tree/index.d.ts.map +1 -1
  63. package/dist/components/composites/file-tree/index.js +2 -1
  64. package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
  65. package/dist/components/composites/help-center/help-center.js +9 -20
  66. package/dist/components/composites/help-center/help-center.js.map +1 -1
  67. package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -1
  68. package/dist/components/composites/icon-picker/icon-picker.js +7 -11
  69. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  70. package/dist/components/composites/inline-citation/citation.d.ts.map +1 -1
  71. package/dist/components/composites/inline-citation/citation.js +2 -1
  72. package/dist/components/composites/inline-citation/citation.js.map +1 -1
  73. package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
  74. package/dist/components/composites/inline-citation/inline-citation.js +2 -1
  75. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  76. package/dist/components/composites/message-scroller/message-scroller.d.ts +4 -5
  77. package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -1
  78. package/dist/components/composites/message-scroller/message-scroller.js +19 -13
  79. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  80. package/dist/components/composites/message-scroller/scroll-anchor.d.ts +4 -3
  81. package/dist/components/composites/message-scroller/scroll-anchor.d.ts.map +1 -1
  82. package/dist/components/composites/message-scroller/scroll-anchor.js +5 -3
  83. package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
  84. package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
  85. package/dist/components/composites/model-selector/model-selector.js +1 -1
  86. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  87. package/dist/components/composites/model-selector/models.js +1 -1
  88. package/dist/components/composites/model-selector/models.js.map +1 -1
  89. package/dist/components/composites/plan/plan.d.ts.map +1 -1
  90. package/dist/components/composites/plan/plan.js +2 -3
  91. package/dist/components/composites/plan/plan.js.map +1 -1
  92. package/dist/components/composites/queue/queue.d.ts +2 -2
  93. package/dist/components/composites/queue/queue.d.ts.map +1 -1
  94. package/dist/components/composites/queue/queue.js +57 -64
  95. package/dist/components/composites/queue/queue.js.map +1 -1
  96. package/dist/components/composites/reasoning/index.js +3 -1
  97. package/dist/components/composites/reasoning/reasoning.d.ts +2 -3
  98. package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -1
  99. package/dist/components/composites/reasoning/reasoning.js +5 -20
  100. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  101. package/dist/components/composites/settings/settings-layout.d.ts.map +1 -1
  102. package/dist/components/composites/settings/settings-layout.js +3 -2
  103. package/dist/components/composites/settings/settings-layout.js.map +1 -1
  104. package/dist/components/composites/settings/settings-navigation.d.ts.map +1 -1
  105. package/dist/components/composites/settings/settings-navigation.js +1 -1
  106. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  107. package/dist/components/composites/sources/index.js +2 -1
  108. package/dist/components/composites/sources/source.d.ts +3 -8
  109. package/dist/components/composites/sources/source.d.ts.map +1 -1
  110. package/dist/components/composites/sources/source.js +5 -30
  111. package/dist/components/composites/sources/source.js.map +1 -1
  112. package/dist/components/composites/sources/sources.js +2 -1
  113. package/dist/components/composites/sources/sources.js.map +1 -1
  114. package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -1
  115. package/dist/components/composites/stack-trace/stack-trace.js +3 -12
  116. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  117. package/dist/components/composites/subagent/subagent.d.ts +3 -1
  118. package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
  119. package/dist/components/composites/subagent/subagent.js +5 -17
  120. package/dist/components/composites/subagent/subagent.js.map +1 -1
  121. package/dist/components/composites/suggestion/suggestion.d.ts.map +1 -1
  122. package/dist/components/composites/suggestion/suggestion.js +3 -2
  123. package/dist/components/composites/suggestion/suggestion.js.map +1 -1
  124. package/dist/components/composites/task/task.d.ts +2 -3
  125. package/dist/components/composites/task/task.d.ts.map +1 -1
  126. package/dist/components/composites/task/task.js +49 -109
  127. package/dist/components/composites/task/task.js.map +1 -1
  128. package/dist/components/composites/terminal/terminal-model.d.ts +1 -2
  129. package/dist/components/composites/terminal/terminal-model.d.ts.map +1 -1
  130. package/dist/components/composites/terminal/terminal-model.js +7 -1
  131. package/dist/components/composites/terminal/terminal-model.js.map +1 -1
  132. package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
  133. package/dist/components/composites/terminal/terminal.js +3 -12
  134. package/dist/components/composites/terminal/terminal.js.map +1 -1
  135. package/dist/components/composites/test-results/test-results.d.ts.map +1 -1
  136. package/dist/components/composites/test-results/test-results.js +3 -12
  137. package/dist/components/composites/test-results/test-results.js.map +1 -1
  138. package/dist/components/composites/tool/tool.d.ts +0 -1
  139. package/dist/components/composites/tool/tool.d.ts.map +1 -1
  140. package/dist/components/composites/tool/tool.js +47 -41
  141. package/dist/components/composites/tool/tool.js.map +1 -1
  142. package/dist/components/composites/tree/tree-navigation.d.ts +6 -2
  143. package/dist/components/composites/tree/tree-navigation.d.ts.map +1 -1
  144. package/dist/components/composites/tree/tree-navigation.js +18 -1
  145. package/dist/components/composites/tree/tree-navigation.js.map +1 -1
  146. package/dist/components/composites/tree/tree.d.ts +6 -0
  147. package/dist/components/composites/tree/tree.d.ts.map +1 -1
  148. package/dist/components/composites/tree/tree.js +30 -4
  149. package/dist/components/composites/tree/tree.js.map +1 -1
  150. package/dist/components/composites/update-dialog/channel-control.d.ts.map +1 -1
  151. package/dist/components/composites/update-dialog/channel-control.js +7 -8
  152. package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
  153. package/dist/components/composites/update-dialog/update-dialog.d.ts +2 -26
  154. package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
  155. package/dist/components/composites/update-dialog/update-dialog.js +47 -125
  156. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  157. package/dist/components/composites/update-dialog/update-model.d.ts +65 -0
  158. package/dist/components/composites/update-dialog/update-model.d.ts.map +1 -0
  159. package/dist/components/composites/update-dialog/update-model.js +75 -0
  160. package/dist/components/composites/update-dialog/update-model.js.map +1 -0
  161. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  162. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts.map +1 -1
  163. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +3 -16
  164. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  165. package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -1
  166. package/dist/components/composites/workspace-switcher/workspace-switcher.js +10 -14
  167. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  168. package/dist/components/conversation/busy-send-button.d.ts +3 -5
  169. package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
  170. package/dist/components/conversation/busy-send-button.js +4 -15
  171. package/dist/components/conversation/busy-send-button.js.map +1 -1
  172. package/dist/components/conversation/chat-composer.d.ts +1 -1
  173. package/dist/components/conversation/chat-composer.d.ts.map +1 -1
  174. package/dist/components/conversation/chat-composer.js +1 -1
  175. package/dist/components/conversation/chat-composer.js.map +1 -1
  176. package/dist/components/conversation/composer-core.d.ts +35 -0
  177. package/dist/components/conversation/composer-core.d.ts.map +1 -0
  178. package/dist/components/conversation/composer-core.js +68 -0
  179. package/dist/components/conversation/composer-core.js.map +1 -0
  180. package/dist/components/conversation/composer-menu.d.ts +1 -1
  181. package/dist/components/conversation/composer-menu.d.ts.map +1 -1
  182. package/dist/components/conversation/composer-menu.js.map +1 -1
  183. package/dist/components/conversation/conversation-pane.d.ts +4 -1
  184. package/dist/components/conversation/conversation-pane.d.ts.map +1 -1
  185. package/dist/components/conversation/conversation-pane.js +4 -0
  186. package/dist/components/conversation/conversation-pane.js.map +1 -1
  187. package/dist/components/conversation/conversation-surface.d.ts +9 -6
  188. package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
  189. package/dist/components/conversation/conversation-surface.js +7 -5
  190. package/dist/components/conversation/conversation-surface.js.map +1 -1
  191. package/dist/components/conversation/ime-guard.d.ts +1 -0
  192. package/dist/components/conversation/ime-guard.d.ts.map +1 -1
  193. package/dist/components/conversation/ime-guard.js +5 -0
  194. package/dist/components/conversation/ime-guard.js.map +1 -1
  195. package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
  196. package/dist/components/conversation/internal/chat-composer-shell.js +16 -50
  197. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  198. package/dist/components/conversation/message-composer.d.ts +1 -3
  199. package/dist/components/conversation/message-composer.d.ts.map +1 -1
  200. package/dist/components/conversation/message-composer.js +15 -32
  201. package/dist/components/conversation/message-composer.js.map +1 -1
  202. package/dist/components/conversation/message-row.d.ts +10 -11
  203. package/dist/components/conversation/message-row.d.ts.map +1 -1
  204. package/dist/components/conversation/message-row.js +24 -49
  205. package/dist/components/conversation/message-row.js.map +1 -1
  206. package/dist/components/conversation/paste-token-editor.d.ts.map +1 -1
  207. package/dist/components/conversation/paste-token-editor.js +7 -17
  208. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  209. package/dist/components/conversation/paste-tokens.d.ts +10 -1
  210. package/dist/components/conversation/paste-tokens.d.ts.map +1 -1
  211. package/dist/components/conversation/paste-tokens.js +26 -2
  212. package/dist/components/conversation/paste-tokens.js.map +1 -1
  213. package/dist/components/conversation/scroll-follow-core.d.ts +30 -79
  214. package/dist/components/conversation/scroll-follow-core.d.ts.map +1 -1
  215. package/dist/components/conversation/scroll-follow-core.js +65 -54
  216. package/dist/components/conversation/scroll-follow-core.js.map +1 -1
  217. package/dist/components/conversation/scroll-follow.d.ts +5 -1
  218. package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
  219. package/dist/components/conversation/scroll-follow.js +27 -91
  220. package/dist/components/conversation/scroll-follow.js.map +1 -1
  221. package/dist/components/conversation/thread-panel.d.ts +0 -2
  222. package/dist/components/conversation/thread-panel.d.ts.map +1 -1
  223. package/dist/components/conversation/thread-panel.js.map +1 -1
  224. package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
  225. package/dist/components/conversation/transcript-composition.js +4 -16
  226. package/dist/components/conversation/transcript-composition.js.map +1 -1
  227. package/dist/components/conversation/transcript-folding.d.ts +0 -1
  228. package/dist/components/conversation/transcript-folding.d.ts.map +1 -1
  229. package/dist/components/conversation/transcript-folding.js +1 -1
  230. package/dist/components/conversation/transcript-folding.js.map +1 -1
  231. package/dist/components/conversation/transcript-grouping.d.ts +8 -0
  232. package/dist/components/conversation/transcript-grouping.d.ts.map +1 -1
  233. package/dist/components/conversation/transcript-grouping.js +17 -3
  234. package/dist/components/conversation/transcript-grouping.js.map +1 -1
  235. package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts +12 -0
  236. package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts.map +1 -1
  237. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +53 -17
  238. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  239. package/dist/components/layout/contextual-sidebar/index.d.ts +1 -1
  240. package/dist/components/layout/contextual-sidebar/index.d.ts.map +1 -1
  241. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
  242. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js.map +1 -1
  243. package/dist/components/layout/floating-preview/index.js +2 -2
  244. package/dist/components/layout/floating-preview/model.d.ts +21 -55
  245. package/dist/components/layout/floating-preview/model.d.ts.map +1 -1
  246. package/dist/components/layout/floating-preview/model.js +33 -88
  247. package/dist/components/layout/floating-preview/model.js.map +1 -1
  248. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
  249. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +11 -5
  250. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  251. package/dist/components/layout/shell-top-bar/shell-top-bar.d.ts +18 -22
  252. package/dist/components/layout/shell-top-bar/shell-top-bar.d.ts.map +1 -1
  253. package/dist/components/layout/shell-top-bar/shell-top-bar.js +4 -2
  254. package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
  255. package/dist/components/layout/side-rail/side-rail-context.d.ts +0 -1
  256. package/dist/components/layout/side-rail/side-rail-context.d.ts.map +1 -1
  257. package/dist/components/layout/side-rail/side-rail-context.js +2 -8
  258. package/dist/components/layout/side-rail/side-rail-context.js.map +1 -1
  259. package/dist/components/layout/side-rail/side-rail.d.ts +0 -9
  260. package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
  261. package/dist/components/layout/side-rail/side-rail.js +148 -128
  262. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  263. package/dist/components/layout/sidebar-nav/index.d.ts +2 -1
  264. package/dist/components/layout/sidebar-nav/index.d.ts.map +1 -1
  265. package/dist/components/layout/sidebar-nav/index.js +2 -1
  266. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.d.ts +10 -0
  267. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.d.ts.map +1 -0
  268. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js +18 -0
  269. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js.map +1 -0
  270. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.d.ts +1 -1
  271. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.d.ts.map +1 -1
  272. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js.map +1 -1
  273. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts +5 -9
  274. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
  275. package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -23
  276. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  277. package/dist/components/layout/split-layout/geometry.d.ts.map +1 -1
  278. package/dist/components/layout/split-layout/geometry.js +2 -2
  279. package/dist/components/layout/split-layout/geometry.js.map +1 -1
  280. package/dist/components/layout/split-layout/index.js +2 -2
  281. package/dist/components/layout/split-layout/model.d.ts.map +1 -1
  282. package/dist/components/layout/split-layout/model.js +4 -4
  283. package/dist/components/layout/split-layout/model.js.map +1 -1
  284. package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts +5 -0
  285. package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts.map +1 -1
  286. package/dist/components/layout/split-layout/resize-controller-core-retry.js +17 -10
  287. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  288. package/dist/components/layout/split-layout/resize-controller-core.d.ts +5 -0
  289. package/dist/components/layout/split-layout/resize-controller-core.d.ts.map +1 -1
  290. package/dist/components/layout/split-layout/resize-controller-core.js +17 -10
  291. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  292. package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
  293. package/dist/components/layout/split-layout/split-layout.js +54 -47
  294. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  295. package/dist/components/layout/split-layout/tree.d.ts +2 -0
  296. package/dist/components/layout/split-layout/tree.d.ts.map +1 -1
  297. package/dist/components/layout/split-layout/tree.js +5 -1
  298. package/dist/components/layout/split-layout/tree.js.map +1 -1
  299. package/dist/components/layout/top-bar/top-bar.d.ts +2 -9
  300. package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
  301. package/dist/components/layout/top-bar/top-bar.js +4 -8
  302. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  303. package/dist/components/layout/top-bar/window-chrome.d.ts +13 -0
  304. package/dist/components/layout/top-bar/window-chrome.d.ts.map +1 -0
  305. package/dist/components/layout/top-bar/window-chrome.js +12 -0
  306. package/dist/components/layout/top-bar/window-chrome.js.map +1 -0
  307. package/dist/components/motion/presence.d.ts +1 -1
  308. package/dist/components/motion/presence.d.ts.map +1 -1
  309. package/dist/components/motion/presence.js +1 -4
  310. package/dist/components/motion/presence.js.map +1 -1
  311. package/dist/components/theme/appearance-panel.d.ts +3 -1
  312. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  313. package/dist/components/theme/appearance-panel.js +17 -9
  314. package/dist/components/theme/appearance-panel.js.map +1 -1
  315. package/dist/components/theme/index.d.ts +1 -1
  316. package/dist/components/theme/index.d.ts.map +1 -1
  317. package/dist/components/theme/index.js +5 -4
  318. package/dist/components/theme/lazy.d.ts +31 -5
  319. package/dist/components/theme/lazy.d.ts.map +1 -1
  320. package/dist/components/theme/lazy.js +39 -6
  321. package/dist/components/theme/lazy.js.map +1 -0
  322. package/dist/components/theme/script-projection.d.ts +17 -0
  323. package/dist/components/theme/script-projection.d.ts.map +1 -0
  324. package/dist/components/theme/script-projection.js +17 -0
  325. package/dist/components/theme/script-projection.js.map +1 -0
  326. package/dist/components/theme/script.js +3 -1
  327. package/dist/components/theme/theme-api.d.ts +14 -0
  328. package/dist/components/theme/theme-api.d.ts.map +1 -0
  329. package/dist/components/theme/theme-catalogue-source.d.ts.map +1 -1
  330. package/dist/components/theme/theme-catalogue-source.js +3 -2
  331. package/dist/components/theme/theme-catalogue-source.js.map +1 -1
  332. package/dist/components/theme/theme-document.d.ts +112 -10
  333. package/dist/components/theme/theme-document.d.ts.map +1 -1
  334. package/dist/components/theme/{theme-document-core.js → theme-document.js} +20 -10
  335. package/dist/components/theme/theme-document.js.map +1 -0
  336. package/dist/components/theme/theme-mode-toggle.d.ts +1 -1
  337. package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -1
  338. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  339. package/dist/components/theme/theme-persistence.d.ts +6 -5
  340. package/dist/components/theme/theme-persistence.d.ts.map +1 -1
  341. package/dist/components/theme/theme-persistence.js +48 -80
  342. package/dist/components/theme/theme-persistence.js.map +1 -1
  343. package/dist/components/theme/theme-picker.d.ts +1 -1
  344. package/dist/components/theme/theme-picker.d.ts.map +1 -1
  345. package/dist/components/theme/theme-picker.js.map +1 -1
  346. package/dist/components/theme/theme-provider-value.d.ts +16 -16
  347. package/dist/components/theme/theme-provider-value.d.ts.map +1 -1
  348. package/dist/components/theme/theme-provider-value.js +33 -42
  349. package/dist/components/theme/theme-provider-value.js.map +1 -1
  350. package/dist/components/theme/theme-provider.d.ts +3 -9
  351. package/dist/components/theme/theme-provider.d.ts.map +1 -1
  352. package/dist/components/theme/theme-provider.js +8 -7
  353. package/dist/components/theme/theme-provider.js.map +1 -1
  354. package/dist/components/theme/theme-script.d.ts +24 -25
  355. package/dist/components/theme/theme-script.d.ts.map +1 -1
  356. package/dist/components/theme/theme-script.js +45 -39
  357. package/dist/components/theme/theme-script.js.map +1 -1
  358. package/dist/components/theme/theme-state.d.ts +241 -9
  359. package/dist/components/theme/theme-state.d.ts.map +1 -1
  360. package/dist/components/theme/{theme-state-core.js → theme-state.js} +10 -11
  361. package/dist/components/theme/theme-state.js.map +1 -0
  362. package/dist/components/theme/theme-toggle.d.ts +1 -1
  363. package/dist/components/theme/theme-toggle.d.ts.map +1 -1
  364. package/dist/components/theme/theme-toggle.js.map +1 -1
  365. package/dist/components/theme/token-projection-options.d.ts +3 -0
  366. package/dist/components/theme/token-projection-options.d.ts.map +1 -0
  367. package/dist/components/theme/token-projection-options.js +9 -0
  368. package/dist/components/theme/token-projection-options.js.map +1 -0
  369. package/dist/components/theme/token-projection.d.ts +22 -0
  370. package/dist/components/theme/token-projection.d.ts.map +1 -0
  371. package/dist/components/theme/token-projection.js +1 -0
  372. package/dist/components/ui/alert-dialog/alert-dialog.d.ts +7 -5
  373. package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -1
  374. package/dist/components/ui/alert-dialog/alert-dialog.js +40 -36
  375. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  376. package/dist/components/ui/attachment/attachment.d.ts.map +1 -1
  377. package/dist/components/ui/attachment/attachment.js +5 -16
  378. package/dist/components/ui/attachment/attachment.js.map +1 -1
  379. package/dist/components/ui/avatar/avatar.d.ts.map +1 -1
  380. package/dist/components/ui/avatar/avatar.js +5 -2
  381. package/dist/components/ui/avatar/avatar.js.map +1 -1
  382. package/dist/components/ui/board/board.d.ts +0 -3
  383. package/dist/components/ui/board/board.d.ts.map +1 -1
  384. package/dist/components/ui/board/board.js +3 -6
  385. package/dist/components/ui/board/board.js.map +1 -1
  386. package/dist/components/ui/button-group/button-group.d.ts +1 -1
  387. package/dist/components/ui/button-group/button-group.d.ts.map +1 -1
  388. package/dist/components/ui/button-group/button-group.js.map +1 -1
  389. package/dist/components/ui/chart/chart.d.ts +0 -3
  390. package/dist/components/ui/chart/chart.d.ts.map +1 -1
  391. package/dist/components/ui/chart/chart.js.map +1 -1
  392. package/dist/components/ui/code-block/code-block.d.ts +0 -2
  393. package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
  394. package/dist/components/ui/code-block/code-block.js +8 -24
  395. package/dist/components/ui/code-block/code-block.js.map +1 -1
  396. package/dist/components/ui/command/command.d.ts.map +1 -1
  397. package/dist/components/ui/command/command.js +56 -48
  398. package/dist/components/ui/command/command.js.map +1 -1
  399. package/dist/components/ui/context-menu/context-menu.d.ts +8 -30
  400. package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -1
  401. package/dist/components/ui/context-menu/context-menu.js +13 -121
  402. package/dist/components/ui/context-menu/context-menu.js.map +1 -1
  403. package/dist/components/ui/dialog/dialog-layer.d.ts +46 -0
  404. package/dist/components/ui/dialog/dialog-layer.d.ts.map +1 -0
  405. package/dist/components/ui/dialog/dialog-layer.js +169 -0
  406. package/dist/components/ui/dialog/dialog-layer.js.map +1 -0
  407. package/dist/components/ui/dialog/dialog.d.ts +20 -26
  408. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  409. package/dist/components/ui/dialog/dialog.js +69 -187
  410. package/dist/components/ui/dialog/dialog.js.map +1 -1
  411. package/dist/components/ui/drawer/drawer.d.ts.map +1 -1
  412. package/dist/components/ui/drawer/drawer.js +5 -8
  413. package/dist/components/ui/drawer/drawer.js.map +1 -1
  414. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +39 -53
  415. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  416. package/dist/components/ui/dropdown-menu/dropdown-menu.js +135 -191
  417. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  418. package/dist/components/ui/dropdown-menu/menu-parts.d.ts +46 -0
  419. package/dist/components/ui/dropdown-menu/menu-parts.d.ts.map +1 -0
  420. package/dist/components/ui/dropdown-menu/menu-parts.js +176 -0
  421. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -0
  422. package/dist/components/ui/field/field.js.map +1 -1
  423. package/dist/components/ui/field/number-field.js.map +1 -1
  424. package/dist/components/ui/hover-card/hover-card.d.ts +1 -2
  425. package/dist/components/ui/hover-card/hover-card.d.ts.map +1 -1
  426. package/dist/components/ui/hover-card/hover-card.js +4 -21
  427. package/dist/components/ui/hover-card/hover-card.js.map +1 -1
  428. package/dist/components/ui/menubar/menubar.d.ts +19 -33
  429. package/dist/components/ui/menubar/menubar.d.ts.map +1 -1
  430. package/dist/components/ui/menubar/menubar.js +21 -116
  431. package/dist/components/ui/menubar/menubar.js.map +1 -1
  432. package/dist/components/ui/message/index.js +2 -1
  433. package/dist/components/ui/message/message.d.ts +0 -1
  434. package/dist/components/ui/message/message.d.ts.map +1 -1
  435. package/dist/components/ui/message/message.js.map +1 -1
  436. package/dist/components/ui/message/parse-message-text.d.ts +20 -2
  437. package/dist/components/ui/message/parse-message-text.d.ts.map +1 -1
  438. package/dist/components/ui/message/parse-message-text.js +94 -28
  439. package/dist/components/ui/message/parse-message-text.js.map +1 -1
  440. package/dist/components/ui/modal-dialog/modal-dialog.d.ts +5 -12
  441. package/dist/components/ui/modal-dialog/modal-dialog.d.ts.map +1 -1
  442. package/dist/components/ui/modal-dialog/modal-dialog.js +61 -77
  443. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
  444. package/dist/components/ui/navigation-menu/navigation-menu.d.ts +0 -1
  445. package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
  446. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  447. package/dist/components/ui/popover/popover.d.ts +1 -3
  448. package/dist/components/ui/popover/popover.d.ts.map +1 -1
  449. package/dist/components/ui/popover/popover.js +1 -22
  450. package/dist/components/ui/popover/popover.js.map +1 -1
  451. package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
  452. package/dist/components/ui/resizable/resizable.js +12 -6
  453. package/dist/components/ui/resizable/resizable.js.map +1 -1
  454. package/dist/components/ui/sheet/sheet.d.ts +4 -6
  455. package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
  456. package/dist/components/ui/sheet/sheet.js +31 -32
  457. package/dist/components/ui/sheet/sheet.js.map +1 -1
  458. package/dist/components/ui/text-link/index.d.ts.map +1 -1
  459. package/dist/components/ui/toggle-group/toggle-group.d.ts +1 -1
  460. package/dist/components/ui/toggle-group/toggle-group.d.ts.map +1 -1
  461. package/dist/components/ui/toggle-group/toggle-group.js +2 -7
  462. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
  463. package/dist/components/ui/tooltip/tooltip.d.ts +17 -1
  464. package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
  465. package/dist/components/ui/tooltip/tooltip.js +40 -20
  466. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  467. package/dist/components/ui/trace/index.d.ts +1 -1
  468. package/dist/components/ui/trace/index.d.ts.map +1 -1
  469. package/dist/components/ui/trace/index.js +1 -1
  470. package/dist/components/ui/trace/trace.d.ts +44 -3
  471. package/dist/components/ui/trace/trace.d.ts.map +1 -1
  472. package/dist/components/ui/trace/trace.js +87 -15
  473. package/dist/components/ui/trace/trace.js.map +1 -1
  474. package/dist/index.js +34 -28
  475. package/dist/lib/accent-presets.d.ts +7 -4
  476. package/dist/lib/accent-presets.d.ts.map +1 -1
  477. package/dist/lib/accent-presets.js +10 -5
  478. package/dist/lib/accent-presets.js.map +1 -1
  479. package/dist/lib/accent-roles.d.ts +20 -1
  480. package/dist/lib/accent-roles.d.ts.map +1 -1
  481. package/dist/lib/accent-roles.js +34 -26
  482. package/dist/lib/accent-roles.js.map +1 -1
  483. package/dist/lib/appearance-font-settings.d.ts.map +1 -1
  484. package/dist/lib/appearance-font-settings.js +4 -4
  485. package/dist/lib/appearance-font-settings.js.map +1 -1
  486. package/dist/lib/async-action.d.ts +42 -0
  487. package/dist/lib/async-action.d.ts.map +1 -0
  488. package/dist/lib/async-action.js +61 -0
  489. package/dist/lib/async-action.js.map +1 -0
  490. package/dist/lib/breakpoints.d.ts +8 -0
  491. package/dist/lib/breakpoints.d.ts.map +1 -0
  492. package/dist/lib/breakpoints.js +11 -0
  493. package/dist/lib/breakpoints.js.map +1 -0
  494. package/dist/lib/bytes.d.ts +8 -0
  495. package/dist/lib/bytes.d.ts.map +1 -0
  496. package/dist/lib/bytes.js +20 -0
  497. package/dist/lib/bytes.js.map +1 -0
  498. package/dist/lib/clipboard.d.ts +13 -0
  499. package/dist/lib/clipboard.d.ts.map +1 -1
  500. package/dist/lib/clipboard.js +32 -1
  501. package/dist/lib/clipboard.js.map +1 -1
  502. package/dist/lib/events.d.ts +14 -0
  503. package/dist/lib/events.d.ts.map +1 -0
  504. package/dist/lib/events.js +16 -0
  505. package/dist/lib/events.js.map +1 -0
  506. package/dist/lib/external-link.d.ts +19 -0
  507. package/dist/lib/external-link.d.ts.map +1 -0
  508. package/dist/lib/external-link.js +27 -0
  509. package/dist/lib/external-link.js.map +1 -0
  510. package/dist/lib/font-catalog.d.ts +3 -6
  511. package/dist/lib/font-catalog.d.ts.map +1 -1
  512. package/dist/lib/font-catalog.js +16 -12
  513. package/dist/lib/font-catalog.js.map +1 -1
  514. package/dist/lib/font-zoom.d.ts +4 -4
  515. package/dist/lib/font-zoom.d.ts.map +1 -1
  516. package/dist/lib/font-zoom.js +9 -12
  517. package/dist/lib/font-zoom.js.map +1 -1
  518. package/dist/lib/overlay.d.ts +29 -1
  519. package/dist/lib/overlay.d.ts.map +1 -1
  520. package/dist/lib/overlay.js +32 -16
  521. package/dist/lib/overlay.js.map +1 -1
  522. package/dist/lib/preference-store.d.ts +13 -3
  523. package/dist/lib/preference-store.d.ts.map +1 -1
  524. package/dist/lib/preference-store.js +27 -37
  525. package/dist/lib/preference-store.js.map +1 -1
  526. package/dist/lib/resize-separator.d.ts +15 -0
  527. package/dist/lib/resize-separator.d.ts.map +1 -0
  528. package/dist/lib/resize-separator.js +23 -0
  529. package/dist/lib/resize-separator.js.map +1 -0
  530. package/dist/lib/safe-script.d.ts +19 -1
  531. package/dist/lib/safe-script.d.ts.map +1 -1
  532. package/dist/lib/safe-script.js +19 -1
  533. package/dist/lib/safe-script.js.map +1 -1
  534. package/dist/lib/scroll-geometry.d.ts +33 -0
  535. package/dist/lib/scroll-geometry.d.ts.map +1 -0
  536. package/dist/lib/scroll-geometry.js +48 -0
  537. package/dist/lib/scroll-geometry.js.map +1 -0
  538. package/dist/lib/text.d.ts +13 -0
  539. package/dist/lib/text.d.ts.map +1 -0
  540. package/dist/lib/text.js +30 -0
  541. package/dist/lib/text.js.map +1 -0
  542. package/dist/lib/theme-accents.d.ts +2 -0
  543. package/dist/lib/theme-accents.d.ts.map +1 -1
  544. package/dist/lib/theme-accents.js +2 -2
  545. package/dist/lib/theme-accents.js.map +1 -1
  546. package/dist/lib/theme-catalogue.d.ts.map +1 -1
  547. package/dist/lib/theme-catalogue.js +3 -4
  548. package/dist/lib/theme-catalogue.js.map +1 -1
  549. package/dist/lib/theme-css.d.ts +14 -1
  550. package/dist/lib/theme-css.d.ts.map +1 -1
  551. package/dist/lib/theme-css.js +25 -48
  552. package/dist/lib/theme-css.js.map +1 -1
  553. package/dist/lib/theme-defaults.d.ts +33 -5
  554. package/dist/lib/theme-defaults.d.ts.map +1 -1
  555. package/dist/lib/theme-defaults.generated.d.ts +1 -1
  556. package/dist/lib/theme-defaults.generated.d.ts.map +1 -1
  557. package/dist/lib/theme-defaults.generated.js.map +1 -1
  558. package/dist/lib/theme-defaults.js +59 -3
  559. package/dist/lib/theme-defaults.js.map +1 -1
  560. package/dist/lib/theme-engine-light.d.ts +6 -0
  561. package/dist/lib/theme-engine-light.d.ts.map +1 -1
  562. package/dist/lib/theme-engine-light.js +71 -57
  563. package/dist/lib/theme-engine-light.js.map +1 -1
  564. package/dist/lib/theme-engine.d.ts +20 -22
  565. package/dist/lib/theme-engine.d.ts.map +1 -1
  566. package/dist/lib/theme-engine.js +19 -6
  567. package/dist/lib/theme-engine.js.map +1 -1
  568. package/dist/lib/theme-records.d.ts +3 -3
  569. package/dist/lib/theme-records.d.ts.map +1 -1
  570. package/dist/lib/theme-records.js +20 -59
  571. package/dist/lib/theme-records.js.map +1 -1
  572. package/dist/lib/theme-types.d.ts +174 -0
  573. package/dist/lib/theme-types.d.ts.map +1 -0
  574. package/dist/lib/theme-types.js +105 -0
  575. package/dist/lib/theme-types.js.map +1 -0
  576. package/dist/lib/themes.d.ts +4 -159
  577. package/dist/lib/themes.d.ts.map +1 -1
  578. package/dist/lib/themes.js +14 -33
  579. package/dist/lib/themes.js.map +1 -1
  580. package/dist/lib/tokens.d.ts.map +1 -1
  581. package/dist/lib/tokens.js +0 -1
  582. package/dist/lib/tokens.js.map +1 -1
  583. package/dist/lib/url.d.ts +9 -0
  584. package/dist/lib/url.d.ts.map +1 -0
  585. package/dist/lib/url.js +24 -0
  586. package/dist/lib/url.js.map +1 -0
  587. package/dist/lib/version-notes.d.ts.map +1 -1
  588. package/dist/lib/version-notes.js +3 -10
  589. package/dist/lib/version-notes.js.map +1 -1
  590. package/dist/r/about-dialog.json +2 -1
  591. package/dist/r/action-button.json +2 -1
  592. package/dist/r/alert-dialog.json +1 -0
  593. package/dist/r/appearance-editor.json +1 -1
  594. package/dist/r/checkpoint.json +0 -2
  595. package/dist/r/code-block.json +1 -0
  596. package/dist/r/confirmation.json +0 -1
  597. package/dist/r/context-menu.json +2 -2
  598. package/dist/r/context.json +0 -1
  599. package/dist/r/conversation.json +6 -5
  600. package/dist/r/dialog.json +5 -0
  601. package/dist/r/drawer.json +0 -1
  602. package/dist/r/dropdown-menu.json +5 -0
  603. package/dist/r/lib.json +51 -1
  604. package/dist/r/menubar.json +2 -2
  605. package/dist/r/model-selector.json +0 -1
  606. package/dist/r/reasoning.json +2 -1
  607. package/dist/r/registry.json +120 -46
  608. package/dist/r/shell-top-bar.json +1 -0
  609. package/dist/r/sidebar-nav.json +5 -0
  610. package/dist/r/sources.json +2 -2
  611. package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +22 -42
  612. package/dist/r/src/components/composites/account-menu/account-menu.tsx +9 -35
  613. package/dist/r/src/components/composites/action-button/action-button.tsx +5 -7
  614. package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -11
  615. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +8 -5
  616. package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +8 -6
  617. package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +30 -82
  618. package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +11 -77
  619. package/dist/r/src/components/composites/appearance-editor/index.ts +1 -0
  620. package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +9 -13
  621. package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +16 -18
  622. package/dist/r/src/components/composites/chat/chat.tsx +2 -2
  623. package/dist/r/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
  624. package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +3 -3
  625. package/dist/r/src/components/composites/confirmation/confirmation-model.ts +9 -17
  626. package/dist/r/src/components/composites/confirmation/confirmation.tsx +2 -2
  627. package/dist/r/src/components/composites/context/context-model.ts +1 -1
  628. package/dist/r/src/components/composites/file-tree/build-file-tree.ts +21 -39
  629. package/dist/r/src/components/composites/file-tree/file-tree.tsx +5 -58
  630. package/dist/r/src/components/composites/file-tree/index.ts +1 -1
  631. package/dist/r/src/components/composites/help-center/help-center.tsx +8 -21
  632. package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +10 -11
  633. package/dist/r/src/components/composites/inline-citation/citation.ts +2 -1
  634. package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +3 -2
  635. package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +30 -30
  636. package/dist/r/src/components/composites/message-scroller/scroll-anchor.ts +5 -5
  637. package/dist/r/src/components/composites/model-selector/model-selector.tsx +3 -2
  638. package/dist/r/src/components/composites/model-selector/models.ts +1 -1
  639. package/dist/r/src/components/composites/plan/plan.tsx +1 -4
  640. package/dist/r/src/components/composites/queue/queue.tsx +8 -11
  641. package/dist/r/src/components/composites/reasoning/reasoning.tsx +5 -23
  642. package/dist/r/src/components/composites/settings/settings-layout.tsx +3 -2
  643. package/dist/r/src/components/composites/settings/settings-navigation.tsx +4 -1
  644. package/dist/r/src/components/composites/sources/source.ts +7 -53
  645. package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +3 -12
  646. package/dist/r/src/components/composites/subagent/subagent.tsx +7 -17
  647. package/dist/r/src/components/composites/suggestion/suggestion.tsx +4 -3
  648. package/dist/r/src/components/composites/task/task.tsx +21 -64
  649. package/dist/r/src/components/composites/terminal/terminal-model.ts +4 -4
  650. package/dist/r/src/components/composites/terminal/terminal.tsx +3 -12
  651. package/dist/r/src/components/composites/test-results/test-results.tsx +3 -12
  652. package/dist/r/src/components/composites/tool/tool.tsx +34 -40
  653. package/dist/r/src/components/composites/tree/tree-navigation.ts +22 -2
  654. package/dist/r/src/components/composites/tree/tree.tsx +47 -3
  655. package/dist/r/src/components/composites/update-dialog/channel-control.tsx +10 -14
  656. package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +66 -200
  657. package/dist/r/src/components/composites/update-dialog/update-model.ts +137 -0
  658. package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
  659. package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +1 -18
  660. package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +16 -19
  661. package/dist/r/src/components/conversation/busy-send-button.tsx +7 -34
  662. package/dist/r/src/components/conversation/chat-composer.tsx +1 -1
  663. package/dist/r/src/components/conversation/composer-core.ts +76 -0
  664. package/dist/r/src/components/conversation/composer-menu.tsx +1 -1
  665. package/dist/r/src/components/conversation/conversation-pane.tsx +4 -1
  666. package/dist/r/src/components/conversation/conversation-surface.tsx +23 -10
  667. package/dist/r/src/components/conversation/ime-guard.ts +6 -0
  668. package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +24 -65
  669. package/dist/r/src/components/conversation/message-composer.tsx +24 -54
  670. package/dist/r/src/components/conversation/message-row.tsx +33 -47
  671. package/dist/r/src/components/conversation/paste-token-editor.tsx +13 -16
  672. package/dist/r/src/components/conversation/paste-tokens.ts +36 -1
  673. package/dist/r/src/components/conversation/scroll-follow-core.ts +66 -137
  674. package/dist/r/src/components/conversation/scroll-follow.ts +26 -67
  675. package/dist/r/src/components/conversation/thread-panel.tsx +2 -4
  676. package/dist/r/src/components/conversation/transcript-composition.tsx +9 -33
  677. package/dist/r/src/components/conversation/transcript-folding.ts +2 -2
  678. package/dist/r/src/components/conversation/transcript-grouping.ts +18 -3
  679. package/dist/r/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +80 -22
  680. package/dist/r/src/components/layout/contextual-sidebar/index.ts +1 -0
  681. package/dist/r/src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx +1 -1
  682. package/dist/r/src/components/layout/floating-preview/model.ts +57 -195
  683. package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +6 -12
  684. package/dist/r/src/components/layout/shell-top-bar/shell-top-bar.tsx +47 -54
  685. package/dist/r/src/components/layout/side-rail/side-rail-context.ts +1 -11
  686. package/dist/r/src/components/layout/side-rail/side-rail.tsx +95 -107
  687. package/dist/r/src/components/layout/sidebar-nav/index.ts +1 -2
  688. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +15 -0
  689. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx +1 -4
  690. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +9 -27
  691. package/dist/r/src/components/layout/split-layout/geometry.ts +2 -9
  692. package/dist/r/src/components/layout/split-layout/model.ts +3 -6
  693. package/dist/r/src/components/layout/split-layout/resize-controller-core-retry.tsx +12 -6
  694. package/dist/r/src/components/layout/split-layout/resize-controller-core.tsx +12 -6
  695. package/dist/r/src/components/layout/split-layout/split-layout.tsx +46 -61
  696. package/dist/r/src/components/layout/split-layout/tree.ts +5 -0
  697. package/dist/r/src/components/layout/top-bar/top-bar.tsx +16 -38
  698. package/dist/r/src/components/layout/top-bar/window-chrome.ts +23 -0
  699. package/dist/r/src/components/motion/presence.tsx +1 -3
  700. package/dist/r/src/components/theme/appearance-panel.tsx +28 -19
  701. package/dist/r/src/components/theme/index.ts +1 -22
  702. package/dist/r/src/components/theme/lazy.ts +36 -26
  703. package/dist/r/src/components/theme/script-projection.ts +40 -0
  704. package/dist/r/src/components/theme/theme-api.ts +30 -0
  705. package/dist/r/src/components/theme/theme-catalogue-source.ts +3 -2
  706. package/dist/r/src/components/theme/theme-document.ts +248 -23
  707. package/dist/r/src/components/theme/theme-mode-toggle.tsx +1 -1
  708. package/dist/r/src/components/theme/theme-persistence.ts +74 -130
  709. package/dist/r/src/components/theme/theme-picker.tsx +2 -2
  710. package/dist/r/src/components/theme/theme-provider-value.ts +64 -69
  711. package/dist/r/src/components/theme/theme-provider.tsx +5 -24
  712. package/dist/r/src/components/theme/theme-script.ts +100 -47
  713. package/dist/r/src/components/theme/theme-state.ts +350 -10
  714. package/dist/r/src/components/theme/theme-toggle.tsx +1 -1
  715. package/dist/r/src/components/theme/token-projection-options.ts +14 -0
  716. package/dist/r/src/components/theme/token-projection.ts +37 -0
  717. package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +43 -43
  718. package/dist/r/src/components/ui/attachment/attachment.tsx +4 -17
  719. package/dist/r/src/components/ui/avatar/avatar.tsx +3 -2
  720. package/dist/r/src/components/ui/board/board.tsx +4 -10
  721. package/dist/r/src/components/ui/button-group/button-group.tsx +1 -1
  722. package/dist/r/src/components/ui/chart/chart.tsx +0 -3
  723. package/dist/r/src/components/ui/code-block/code-block.tsx +7 -26
  724. package/dist/r/src/components/ui/command/command.tsx +43 -39
  725. package/dist/r/src/components/ui/context-menu/context-menu.tsx +18 -168
  726. package/dist/r/src/components/ui/dialog/dialog-layer.tsx +266 -0
  727. package/dist/r/src/components/ui/dialog/dialog.tsx +77 -271
  728. package/dist/r/src/components/ui/drawer/drawer.tsx +5 -23
  729. package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +204 -226
  730. package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +220 -0
  731. package/dist/r/src/components/ui/field/field.tsx +1 -1
  732. package/dist/r/src/components/ui/field/number-field.tsx +1 -1
  733. package/dist/r/src/components/ui/hover-card/hover-card.tsx +4 -11
  734. package/dist/r/src/components/ui/menubar/menubar.tsx +36 -169
  735. package/dist/r/src/components/ui/message/message.tsx +0 -1
  736. package/dist/r/src/components/ui/message/parse-message-text.ts +80 -32
  737. package/dist/r/src/components/ui/modal-dialog/modal-dialog.tsx +9 -39
  738. package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +0 -1
  739. package/dist/r/src/components/ui/popover/popover.tsx +5 -11
  740. package/dist/r/src/components/ui/resizable/resizable.tsx +6 -16
  741. package/dist/r/src/components/ui/sheet/sheet.tsx +30 -42
  742. package/dist/r/src/components/ui/text-link/index.ts +0 -1
  743. package/dist/r/src/components/ui/toggle-group/toggle-group.tsx +3 -11
  744. package/dist/r/src/components/ui/tooltip/tooltip.tsx +47 -26
  745. package/dist/r/src/components/ui/trace/index.ts +7 -0
  746. package/dist/r/src/components/ui/trace/trace.tsx +100 -9
  747. package/dist/r/src/lib/accent-presets.ts +12 -8
  748. package/dist/r/src/lib/accent-roles.ts +43 -29
  749. package/dist/r/src/lib/appearance-font-settings.ts +5 -5
  750. package/dist/r/src/lib/async-action.ts +72 -0
  751. package/dist/r/src/lib/breakpoints.ts +7 -0
  752. package/dist/r/src/lib/bytes.ts +20 -0
  753. package/dist/r/src/lib/clipboard.ts +43 -0
  754. package/dist/r/src/lib/events.ts +17 -0
  755. package/dist/r/src/lib/external-link.ts +42 -0
  756. package/dist/r/src/lib/font-catalog.ts +4 -6
  757. package/dist/r/src/lib/font-zoom.ts +9 -14
  758. package/dist/r/src/lib/overlay.ts +55 -18
  759. package/dist/r/src/lib/preference-store.ts +36 -34
  760. package/dist/r/src/lib/resize-separator.ts +36 -0
  761. package/dist/r/src/lib/safe-script.ts +19 -1
  762. package/dist/r/src/lib/scroll-geometry.ts +69 -0
  763. package/dist/r/src/lib/text.ts +49 -0
  764. package/dist/r/src/lib/theme-accents.ts +1 -1
  765. package/dist/r/src/lib/theme-catalogue.ts +3 -4
  766. package/dist/r/src/lib/theme-css.ts +33 -54
  767. package/dist/r/src/lib/theme-defaults.generated.ts +1 -1
  768. package/dist/r/src/lib/theme-defaults.ts +55 -7
  769. package/dist/r/src/lib/theme-engine-light.ts +88 -72
  770. package/dist/r/src/lib/theme-engine.ts +29 -33
  771. package/dist/r/src/lib/theme-records.ts +33 -69
  772. package/dist/r/src/lib/theme-types.ts +199 -0
  773. package/dist/r/src/lib/themes.ts +33 -196
  774. package/dist/r/src/lib/tokens.ts +0 -1
  775. package/dist/r/src/lib/url.ts +25 -0
  776. package/dist/r/src/lib/version-notes.ts +3 -9
  777. package/dist/r/src/styles/theme-variants.css +32 -32
  778. package/dist/r/src/styles/theme.css +17 -13
  779. package/dist/r/subagent.json +0 -2
  780. package/dist/r/suggestion.json +0 -1
  781. package/dist/r/theming.json +21 -21
  782. package/dist/r/top-bar.json +5 -0
  783. package/dist/r/trace.json +1 -0
  784. package/dist/r/update-dialog.json +5 -0
  785. package/package.json +22 -8
  786. package/registry.json +120 -46
  787. package/src/components/composites/about-dialog/about-dialog.tsx +22 -42
  788. package/src/components/composites/account-menu/account-menu.tsx +9 -35
  789. package/src/components/composites/action-button/action-button.tsx +5 -7
  790. package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -11
  791. package/src/components/composites/appearance-editor/appearance-choices.tsx +8 -5
  792. package/src/components/composites/appearance-editor/appearance-editor.tsx +8 -6
  793. package/src/components/composites/appearance-editor/appearance-rows.tsx +30 -82
  794. package/src/components/composites/appearance-editor/font-settings-group.tsx +11 -77
  795. package/src/components/composites/appearance-editor/index.ts +1 -0
  796. package/src/components/composites/catalog-browser/catalog-browser.tsx +9 -13
  797. package/src/components/composites/chain-of-thought/chain-of-thought.tsx +16 -18
  798. package/src/components/composites/chat/chat.tsx +2 -2
  799. package/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
  800. package/src/components/composites/checkpoint/checkpoint.tsx +3 -3
  801. package/src/components/composites/confirmation/confirmation-model.ts +9 -17
  802. package/src/components/composites/confirmation/confirmation.tsx +2 -2
  803. package/src/components/composites/context/context-model.ts +1 -1
  804. package/src/components/composites/file-tree/build-file-tree.ts +21 -39
  805. package/src/components/composites/file-tree/file-tree.tsx +5 -58
  806. package/src/components/composites/file-tree/index.ts +1 -1
  807. package/src/components/composites/help-center/help-center.tsx +8 -21
  808. package/src/components/composites/icon-picker/icon-picker.tsx +10 -11
  809. package/src/components/composites/inline-citation/citation.ts +2 -1
  810. package/src/components/composites/inline-citation/inline-citation.tsx +3 -2
  811. package/src/components/composites/message-scroller/message-scroller.tsx +30 -30
  812. package/src/components/composites/message-scroller/scroll-anchor.ts +5 -5
  813. package/src/components/composites/model-selector/model-selector.tsx +3 -2
  814. package/src/components/composites/model-selector/models.ts +1 -1
  815. package/src/components/composites/plan/plan.tsx +1 -4
  816. package/src/components/composites/queue/queue.tsx +8 -11
  817. package/src/components/composites/reasoning/reasoning.tsx +5 -23
  818. package/src/components/composites/settings/settings-layout.tsx +3 -2
  819. package/src/components/composites/settings/settings-navigation.tsx +4 -1
  820. package/src/components/composites/sources/source.ts +7 -53
  821. package/src/components/composites/stack-trace/stack-trace.tsx +3 -12
  822. package/src/components/composites/subagent/subagent.tsx +7 -17
  823. package/src/components/composites/suggestion/suggestion.tsx +4 -3
  824. package/src/components/composites/task/task.tsx +21 -64
  825. package/src/components/composites/terminal/terminal-model.ts +4 -4
  826. package/src/components/composites/terminal/terminal.tsx +3 -12
  827. package/src/components/composites/test-results/test-results.tsx +3 -12
  828. package/src/components/composites/tool/tool.tsx +34 -40
  829. package/src/components/composites/tree/tree-navigation.ts +22 -2
  830. package/src/components/composites/tree/tree.tsx +47 -3
  831. package/src/components/composites/update-dialog/channel-control.tsx +10 -14
  832. package/src/components/composites/update-dialog/update-dialog.tsx +66 -200
  833. package/src/components/composites/update-dialog/update-model.ts +137 -0
  834. package/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
  835. package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +1 -18
  836. package/src/components/composites/workspace-switcher/workspace-switcher.tsx +16 -19
  837. package/src/components/conversation/busy-send-button.tsx +7 -34
  838. package/src/components/conversation/chat-composer.tsx +1 -1
  839. package/src/components/conversation/composer-core.ts +76 -0
  840. package/src/components/conversation/composer-menu.tsx +1 -1
  841. package/src/components/conversation/conversation-pane.tsx +4 -1
  842. package/src/components/conversation/conversation-surface.tsx +23 -10
  843. package/src/components/conversation/ime-guard.ts +6 -0
  844. package/src/components/conversation/internal/chat-composer-shell.tsx +24 -65
  845. package/src/components/conversation/message-composer.tsx +24 -54
  846. package/src/components/conversation/message-row.tsx +33 -47
  847. package/src/components/conversation/paste-token-editor.tsx +13 -16
  848. package/src/components/conversation/paste-tokens.ts +36 -1
  849. package/src/components/conversation/scroll-follow-core.ts +66 -137
  850. package/src/components/conversation/scroll-follow.ts +26 -67
  851. package/src/components/conversation/thread-panel.tsx +2 -4
  852. package/src/components/conversation/transcript-composition.tsx +9 -33
  853. package/src/components/conversation/transcript-folding.ts +2 -2
  854. package/src/components/conversation/transcript-grouping.ts +18 -3
  855. package/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +80 -22
  856. package/src/components/layout/contextual-sidebar/index.ts +1 -0
  857. package/src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx +1 -1
  858. package/src/components/layout/floating-preview/model.ts +57 -195
  859. package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +6 -12
  860. package/src/components/layout/shell-top-bar/shell-top-bar.tsx +47 -54
  861. package/src/components/layout/side-rail/side-rail-context.ts +1 -11
  862. package/src/components/layout/side-rail/side-rail.tsx +95 -107
  863. package/src/components/layout/sidebar-nav/index.ts +1 -2
  864. package/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +15 -0
  865. package/src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx +1 -4
  866. package/src/components/layout/sidebar-nav/sidebar-nav.tsx +9 -27
  867. package/src/components/layout/split-layout/geometry.ts +2 -9
  868. package/src/components/layout/split-layout/model.ts +3 -6
  869. package/src/components/layout/split-layout/resize-controller-core-retry.tsx +12 -6
  870. package/src/components/layout/split-layout/resize-controller-core.tsx +12 -6
  871. package/src/components/layout/split-layout/split-layout.tsx +46 -61
  872. package/src/components/layout/split-layout/tree.ts +5 -0
  873. package/src/components/layout/top-bar/top-bar.tsx +16 -38
  874. package/src/components/layout/top-bar/window-chrome.ts +23 -0
  875. package/src/components/motion/presence.tsx +1 -3
  876. package/src/components/theme/appearance-panel.tsx +28 -19
  877. package/src/components/theme/index.ts +1 -22
  878. package/src/components/theme/lazy.ts +36 -26
  879. package/src/components/theme/script-projection.ts +40 -0
  880. package/src/components/theme/theme-api.ts +30 -0
  881. package/src/components/theme/theme-catalogue-source.ts +3 -2
  882. package/src/components/theme/theme-document.ts +248 -23
  883. package/src/components/theme/theme-mode-toggle.tsx +1 -1
  884. package/src/components/theme/theme-persistence.ts +74 -130
  885. package/src/components/theme/theme-picker.tsx +2 -2
  886. package/src/components/theme/theme-provider-value.ts +64 -69
  887. package/src/components/theme/theme-provider.tsx +5 -24
  888. package/src/components/theme/theme-script.ts +100 -47
  889. package/src/components/theme/theme-state.ts +350 -10
  890. package/src/components/theme/theme-toggle.tsx +1 -1
  891. package/src/components/theme/token-projection-options.ts +14 -0
  892. package/src/components/theme/token-projection.ts +37 -0
  893. package/src/components/ui/alert-dialog/alert-dialog.tsx +43 -43
  894. package/src/components/ui/attachment/attachment.tsx +4 -17
  895. package/src/components/ui/avatar/avatar.tsx +3 -2
  896. package/src/components/ui/board/board.tsx +4 -10
  897. package/src/components/ui/button-group/button-group.tsx +1 -1
  898. package/src/components/ui/chart/chart.tsx +0 -3
  899. package/src/components/ui/code-block/code-block.tsx +7 -26
  900. package/src/components/ui/command/command.tsx +43 -39
  901. package/src/components/ui/context-menu/context-menu.tsx +18 -168
  902. package/src/components/ui/dialog/dialog-layer.tsx +266 -0
  903. package/src/components/ui/dialog/dialog.tsx +77 -271
  904. package/src/components/ui/drawer/drawer.tsx +5 -23
  905. package/src/components/ui/dropdown-menu/dropdown-menu.tsx +204 -226
  906. package/src/components/ui/dropdown-menu/menu-parts.tsx +220 -0
  907. package/src/components/ui/field/field.tsx +1 -1
  908. package/src/components/ui/field/number-field.tsx +1 -1
  909. package/src/components/ui/hover-card/hover-card.tsx +4 -11
  910. package/src/components/ui/menubar/menubar.tsx +36 -169
  911. package/src/components/ui/message/message.tsx +0 -1
  912. package/src/components/ui/message/parse-message-text.ts +80 -32
  913. package/src/components/ui/modal-dialog/modal-dialog.tsx +9 -39
  914. package/src/components/ui/navigation-menu/navigation-menu.tsx +0 -1
  915. package/src/components/ui/popover/popover.tsx +5 -11
  916. package/src/components/ui/resizable/resizable.tsx +6 -16
  917. package/src/components/ui/sheet/sheet.tsx +30 -42
  918. package/src/components/ui/text-link/index.ts +0 -1
  919. package/src/components/ui/toggle-group/toggle-group.tsx +3 -11
  920. package/src/components/ui/tooltip/tooltip.tsx +47 -26
  921. package/src/components/ui/trace/index.ts +7 -0
  922. package/src/components/ui/trace/trace.tsx +100 -9
  923. package/src/lib/accent-presets.ts +12 -8
  924. package/src/lib/accent-roles.ts +43 -29
  925. package/src/lib/appearance-font-settings.ts +5 -5
  926. package/src/lib/async-action.ts +72 -0
  927. package/src/lib/breakpoints.ts +7 -0
  928. package/src/lib/bytes.ts +20 -0
  929. package/src/lib/clipboard.ts +43 -0
  930. package/src/lib/events.ts +17 -0
  931. package/src/lib/external-link.ts +42 -0
  932. package/src/lib/font-catalog.ts +4 -6
  933. package/src/lib/font-zoom.ts +9 -14
  934. package/src/lib/overlay.ts +55 -18
  935. package/src/lib/preference-store.ts +36 -34
  936. package/src/lib/resize-separator.ts +36 -0
  937. package/src/lib/safe-script.ts +19 -1
  938. package/src/lib/scroll-geometry.ts +69 -0
  939. package/src/lib/text.ts +49 -0
  940. package/src/lib/theme-accents.ts +1 -1
  941. package/src/lib/theme-catalogue.ts +3 -4
  942. package/src/lib/theme-css.ts +33 -54
  943. package/src/lib/theme-defaults.generated.ts +1 -1
  944. package/src/lib/theme-defaults.ts +55 -7
  945. package/src/lib/theme-engine-light.ts +88 -72
  946. package/src/lib/theme-engine.ts +29 -33
  947. package/src/lib/theme-records.ts +33 -69
  948. package/src/lib/theme-types.ts +199 -0
  949. package/src/lib/themes.ts +33 -196
  950. package/src/lib/tokens.ts +0 -1
  951. package/src/lib/url.ts +25 -0
  952. package/src/lib/version-notes.ts +3 -9
  953. package/src/styles/theme-variants.css +32 -32
  954. package/src/styles/theme.css +17 -13
  955. package/dist/components/conversation/paste-preview.d.ts +0 -11
  956. package/dist/components/conversation/paste-preview.d.ts.map +0 -1
  957. package/dist/components/conversation/paste-preview.js +0 -27
  958. package/dist/components/conversation/paste-preview.js.map +0 -1
  959. package/dist/components/theme/theme-document-core.d.ts +0 -123
  960. package/dist/components/theme/theme-document-core.d.ts.map +0 -1
  961. package/dist/components/theme/theme-document-core.js.map +0 -1
  962. package/dist/components/theme/theme-provider-core.d.ts +0 -19
  963. package/dist/components/theme/theme-provider-core.d.ts.map +0 -1
  964. package/dist/components/theme/theme-provider-core.js +0 -27
  965. package/dist/components/theme/theme-provider-core.js.map +0 -1
  966. package/dist/components/theme/theme-provider-lazy.d.ts +0 -28
  967. package/dist/components/theme/theme-provider-lazy.d.ts.map +0 -1
  968. package/dist/components/theme/theme-provider-lazy.js +0 -35
  969. package/dist/components/theme/theme-provider-lazy.js.map +0 -1
  970. package/dist/components/theme/theme-state-core.d.ts +0 -248
  971. package/dist/components/theme/theme-state-core.d.ts.map +0 -1
  972. package/dist/components/theme/theme-state-core.js.map +0 -1
  973. package/dist/r/src/components/conversation/paste-preview.ts +0 -35
  974. package/dist/r/src/components/theme/theme-document-core.ts +0 -262
  975. package/dist/r/src/components/theme/theme-provider-core.tsx +0 -40
  976. package/dist/r/src/components/theme/theme-provider-lazy.tsx +0 -34
  977. package/dist/r/src/components/theme/theme-state-core.ts +0 -364
  978. package/src/components/conversation/paste-preview.ts +0 -35
  979. package/src/components/theme/theme-document-core.ts +0 -262
  980. package/src/components/theme/theme-provider-core.tsx +0 -40
  981. package/src/components/theme/theme-provider-lazy.tsx +0 -34
  982. package/src/components/theme/theme-state-core.ts +0 -364
@@ -1,248 +0,0 @@
1
- import { type AppearanceEditorFontSettings } from '#lib/appearance-font-settings';
2
- import type { AccentPreset } from '@adea-ai/themes';
3
- import { type AccentRoles } from '#lib/accent-roles';
4
- import { type FontZoomIntent } from '#lib/font-zoom';
5
- import type { ThemeSurface } from '#lib/theme-surface';
6
- import type { ThemeEngine } from '#lib/theme-engine';
7
- import type { ThemeAppearance, ThemeVariant } from '#lib/themes';
8
- /**
9
- * The pure half of the theme provider: what a selection is, how two selections
10
- * merge, and what a selection resolves to.
11
- *
12
- * Nothing here touches the document, storage or a signal, so each rule can be
13
- * tested by calling it. `ThemeProvider` owns the reactivity and wires these to it;
14
- * `theme-document.ts` owns the writes; `theme-persistence.ts` owns the store.
15
- *
16
- * This is the catalogue-free half: it imports no catalogue code or data, so the lazy
17
- * provider can use it at start-up. `theme-state.ts` re-exports it and adds
18
- * {@link accentRolesForState} bound to the full catalogue.
19
- */
20
- /**
21
- * Four independent choices, and keeping them independent is the point:
22
- *
23
- * - **appearance** — light, dark, or follow the system.
24
- * - **a theme per appearance** — so a user can run Catppuccin Mocha by night and
25
- * Solarized Light by day without re-choosing when the system flips.
26
- * - **an accent** — adea's six presets, or one of the accents the selected theme
27
- * pair carries itself (`ansi-blue`…), which re-colour the interactive roles on
28
- * top of whichever theme is active.
29
- * - **fonts** — separate family and size choices for UI, content and code.
30
- */
31
- export type ThemeSelection = {
32
- /** `system` follows `prefers-color-scheme` and updates when it changes. */
33
- appearance: ThemeAppearance | 'system';
34
- /** The variant to use when the resolved appearance is light. */
35
- lightThemeId: string;
36
- /** The variant to use when the resolved appearance is dark. */
37
- darkThemeId: string;
38
- /**
39
- * An `accentPresets` id, a theme accent id from `themeAccents()` (`ansi-blue`…),
40
- * `theme` for the variant's own primary, or a custom colour as `#rrggbb`. A theme
41
- * accent the current pair does not offer falls back to the variant's own primary.
42
- *
43
- * A custom colour is stored lower case and is raised to the contrast floor when it
44
- * is painted, never when it is stored: the selection keeps what the user chose.
45
- * Anything else that is not an id is dropped at paint, not rejected here.
46
- */
47
- accent: string;
48
- /** UI-family alias for consumers of the original single-font preference. */
49
- font: string;
50
- /** UI, content and code font settings. Omitted legacy records are migrated from `font`. */
51
- fonts?: AppearanceEditorFontSettings;
52
- /**
53
- * `comfortable` is the system's default geometry; `compact` moves the control
54
- * ladder down one rung.
55
- *
56
- * Optional, and defaulted on read, so a preference stored before density existed
57
- * keeps working and `ThemeSelection` stays assignable without it.
58
- */
59
- density?: ThemeDensity;
60
- /**
61
- * The terminal either follows the interface theme (`theme`, or absent) or is pinned
62
- * to another theme's terminal palette by that theme's id. The pin is written over
63
- * the interface variant's own `--terminal-*` properties, so a light interface can
64
- * carry a dark terminal.
65
- *
66
- * An id the registry does not hold paints the interface palette and stays in the
67
- * selection, the same rule as an unknown theme id.
68
- *
69
- * Optional and not defaulted: see {@link defaultThemeSelection}.
70
- */
71
- terminalThemeId?: string;
72
- /**
73
- * How opaque elevated panels are. Written to `<html>` only when the provider's
74
- * `surface` prop is on or this is set; absent, a host paints no surface axis at
75
- * all. Resolved against the OS and the host's capability before it is painted —
76
- * see `resolveSurface` — so the value stored is a preference, never the outcome.
77
- */
78
- surface?: ThemeSurface;
79
- /**
80
- * The user's own Reduce Transparency switch, which forces the `opaque` surface the
81
- * same way the operating system's setting does.
82
- */
83
- reduceTransparency?: boolean;
84
- };
85
- /**
86
- * The two density rungs.
87
- *
88
- * `comfortable` is the geometry in `theme.css`, so it is the absence of an
89
- * attribute rather than a value: a document that ships no `data-density` at all
90
- * renders correctly, which is what keeps this additive.
91
- */
92
- export type ThemeDensity = 'comfortable' | 'compact';
93
- /**
94
- * Deliberately lists only the fields every consumer has always had. A field added
95
- * to {@link ThemeSelection} later gets no default here: `JSON.stringify` drops an
96
- * `undefined`, so a store written by a consumer that never sets the field stays
97
- * byte-identical to what it was before the field existed.
98
- */
99
- export declare const defaultThemeSelection: ThemeSelection;
100
- /**
101
- * A stored selection's density, defaulted.
102
- *
103
- * The stored value is read through here rather than trusted, because a preference
104
- * written before density existed has no `density` key and a hand-edited store may
105
- * hold anything.
106
- */
107
- export declare function resolvedDensity(selection: ThemeSelection): ThemeDensity;
108
- export type ThemeContextValue = {
109
- /** The preference as stored. A {@link ThemeContextValue.preview} does not change it. */
110
- selection: () => ThemeSelection;
111
- /** What the preference resolves to right now, after `system`. */
112
- resolvedAppearance: () => ThemeAppearance;
113
- /** The variant in use. */
114
- variant: () => ThemeVariant;
115
- /** Update part of the preference. */
116
- setSelection: (patch: Partial<ThemeSelection>) => void;
117
- /**
118
- * The built-in catalogue, so a picker does not import it separately. A plain
119
- * array: {@link ThemeContextValue.allThemes} is the one that follows a host's
120
- * extra themes. Under the lazy provider it holds only the default pair until
121
- * {@link ThemeContextValue.catalogueReady}; read it again afterwards.
122
- */
123
- themes: readonly ThemeVariant[];
124
- /**
125
- * The accents the selected light/dark pair carries, offered beside the presets.
126
- * Follows the selection: a different theme pair may offer different slots.
127
- */
128
- themeAccents: () => readonly AccentPreset[];
129
- /**
130
- * The built-in catalogue followed by the provider's `themes` prop. Reactive when
131
- * that prop is a function that reads signals.
132
- */
133
- allThemes: () => readonly ThemeVariant[];
134
- /**
135
- * Paint the document from `draft` laid over the stored selection, without
136
- * persisting it or changing what {@link ThemeContextValue.selection} returns.
137
- * `undefined` ends the preview. A {@link ThemeContextValue.setSelection} ends it
138
- * too, because the committed selection is then what should be showing.
139
- */
140
- preview: (draft: Partial<ThemeSelection> | undefined) => void;
141
- /** True while a {@link ThemeContextValue.preview} draft is on the document. */
142
- previewing: () => boolean;
143
- /**
144
- * The roles `accent` paints over `variantId` (default: the variant in use), held
145
- * to the provider's `accentContrastFloor`, for an element-scoped override with
146
- * `paintAccentRoles` — a workspace that carries its own colour. `undefined` for
147
- * `null`, for `theme`, for an id that resolves to nothing, and for a variant the
148
- * registry does not hold: each means "keep the inherited accent".
149
- */
150
- accentRolesFor: (accent: string | null, variantId?: string) => AccentRoles | undefined;
151
- /**
152
- * The surface the committed selection paints, after Reduce Transparency and the
153
- * host's translucency capability. `opaque` when the axis is off. Follows the
154
- * committed selection, not a preview, like {@link ThemeContextValue.variant}.
155
- */
156
- effectiveSurface: () => ThemeSurface;
157
- /**
158
- * True while the operating system or the selection's `reduceTransparency` forces
159
- * opaque surfaces. Always false when the surface axis is off, because nothing is
160
- * then listening to the operating system.
161
- */
162
- reduceTransparencyActive: () => boolean;
163
- /**
164
- * Step the three text sizes together, or put them back to the defaults: what the
165
- * `fontZoom` prop's chords do, for a host that binds its own keys or a menu. Goes
166
- * through {@link ThemeContextValue.setSelection}, so it persists and ends a preview.
167
- */
168
- zoomFonts: (intent: FontZoomIntent) => void;
169
- /**
170
- * True when `themes`, `allThemes()` and the variants they resolve are backed by the
171
- * whole catalogue. Always true under `ThemeProvider`. Under the lazy provider
172
- * (`@adea-ai/ui/components/theme/lazy`) it turns true once the catalogue has loaded,
173
- * and until then only the default light and dark themes are available: a stored
174
- * theme beyond them resolves to its appearance's default (the document keeps painting
175
- * what the stylesheet gave it) until `catalogueReady()` is true. Absent on a context
176
- * a host builds itself, where it should be read as true.
177
- */
178
- catalogueReady?: () => boolean;
179
- /**
180
- * Start loading the whole catalogue (idempotent) and resolve when it is available.
181
- * A picker, a preview or a settings page calls it when it mounts. A no-op under
182
- * `ThemeProvider`, whose catalogue is already loaded.
183
- */
184
- loadCatalogue?: () => Promise<void>;
185
- };
186
- /** Keep the deprecated single-font view synchronized with the UI axis. */
187
- export declare function mergeThemeSelection(base: ThemeSelection, patch: Partial<ThemeSelection>): ThemeSelection;
188
- /**
189
- * The selection a provider starts from: the defaults, then whatever the store
190
- * returned, then `initial`.
191
- *
192
- * `initial` wins over the store on every mount. That precedence is part of the
193
- * contract Cortana relies on (its `initial` pins `appearance` and `font`), and it
194
- * is why the store's answer is only the middle layer. A store that returned
195
- * nothing, or threw, or answered with explicit `undefined`s, leaves the defaults
196
- * standing for those fields.
197
- */
198
- export declare function initialThemeSelection(stored: Partial<ThemeSelection> | undefined, initial: Partial<ThemeSelection> | undefined): ThemeSelection;
199
- /** `system` resolved against what the operating system reports. */
200
- export declare function resolveAppearance(preference: ThemeSelection['appearance'], system: ThemeAppearance): ThemeAppearance;
201
- /** The theme id the selection names for a resolved appearance. */
202
- export declare function selectedThemeId(selection: ThemeSelection, appearance: ThemeAppearance): string;
203
- /**
204
- * What a selection paints: the resolved appearance and the variant for it.
205
- *
206
- * An id the registry does not hold resolves to the appearance's default rather than
207
- * being rewritten (see `resolveVariant`), so the selection a host stores is never
208
- * changed by being unresolvable.
209
- */
210
- export declare function resolveThemeState(selection: ThemeSelection, system: ThemeAppearance, registry: readonly ThemeVariant[]): {
211
- appearance: ThemeAppearance;
212
- variant: ThemeVariant;
213
- };
214
- /**
215
- * The variant whose terminal palette is pinned, or `undefined` when the terminal
216
- * follows the interface theme.
217
- *
218
- * `theme`, an absent id and an id the registry does not hold all mean the interface
219
- * palette: a terminal must never resolve to a blank or half-painted palette because a
220
- * theme was deleted after it was pinned.
221
- */
222
- export declare function resolveTerminalVariant(terminalThemeId: string | undefined, registry: readonly ThemeVariant[]): ThemeVariant | undefined;
223
- /**
224
- * The font settings a zoom chord asks for: one pixel up or down on every axis, or
225
- * the defaults for `reset`.
226
- */
227
- export declare function zoomedFontSettings(selection: ThemeSelection, intent: FontZoomIntent): AppearanceEditorFontSettings;
228
- /**
229
- * The registry a provider resolves against: the catalogue, then the host's extras.
230
- *
231
- * The catalogue wins an id collision, because it is listed first and `resolveVariant`
232
- * takes the first match: a host's variant can add a theme but cannot shadow one.
233
- */
234
- export declare function mergeRegistry(builtin: readonly ThemeVariant[], extra: readonly ThemeVariant[] | undefined): readonly ThemeVariant[];
235
- /**
236
- * The roles an accent paints over a variant, for {@link ThemeContextValue.accentRolesFor}.
237
- *
238
- * Resolved against the committed selection's theme pair, so an `ansi-*` accent means
239
- * the same colour here as it does on `<html>`. `engine` answers the catalogue
240
- * questions; `theme-state.ts` binds the full catalogue for callers that have none.
241
- */
242
- export declare function accentRolesForStateWith(engine: Pick<ThemeEngine, 'accentRolesForSelection'>, accent: string | null, variantId: string | undefined, state: {
243
- selection: ThemeSelection;
244
- variant: ThemeVariant;
245
- registry: readonly ThemeVariant[];
246
- accentContrastFloor?: number;
247
- }): AccentRoles | undefined;
248
- //# sourceMappingURL=theme-state-core.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-state-core.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-state-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAyB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAEhE;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,2EAA2E;IAC3E,UAAU,EAAE,eAAe,GAAG,QAAQ,CAAA;IACtC,gEAAgE;IAChE,YAAY,EAAE,MAAM,CAAA;IACpB,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;;;;OAQG;IACH,MAAM,EAAE,MAAM,CAAA;IACd,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAA;IACZ,2FAA2F;IAC3F,KAAK,CAAC,EAAE,4BAA4B,CAAA;IACpC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,SAAS,CAAA;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,cAQnC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,cAAc,GAAG,YAAY,CAEvE;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wFAAwF;IACxF,SAAS,EAAE,MAAM,cAAc,CAAA;IAC/B,iEAAiE;IACjE,kBAAkB,EAAE,MAAM,eAAe,CAAA;IACzC,0BAA0B;IAC1B,OAAO,EAAE,MAAM,YAAY,CAAA;IAC3B,qCAAqC;IACrC,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,KAAK,IAAI,CAAA;IACtD;;;;;OAKG;IACH,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;IAC/B;;;OAGG;IACH,YAAY,EAAE,MAAM,SAAS,YAAY,EAAE,CAAA;IAC3C;;;OAGG;IACH,SAAS,EAAE,MAAM,SAAS,YAAY,EAAE,CAAA;IACxC;;;;;OAKG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,KAAK,IAAI,CAAA;IAC7D,+EAA+E;IAC/E,UAAU,EAAE,MAAM,OAAO,CAAA;IACzB;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,WAAW,GAAG,SAAS,CAAA;IACtF;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,YAAY,CAAA;IACpC;;;;OAIG;IACH,wBAAwB,EAAE,MAAM,OAAO,CAAA;IACvC;;;;OAIG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAA;IAC3C;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,MAAM,OAAO,CAAA;IAC9B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CACpC,CAAA;AASD,0EAA0E;AAC1E,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,GAC7B,cAAc,CAuBhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,EAC3C,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,GAC3C,cAAc,CAGhB;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,cAAc,CAAC,YAAY,CAAC,EACxC,MAAM,EAAE,eAAe,GACtB,eAAe,CAEjB;AAED,kEAAkE;AAClE,wBAAgB,eAAe,CAAC,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,GAAG,MAAM,CAE9F;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,SAAS,YAAY,EAAE,GAChC;IAAE,UAAU,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAMxD;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,QAAQ,EAAE,SAAS,YAAY,EAAE,GAChC,YAAY,GAAG,SAAS,CAG1B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,cAAc,GACrB,4BAA4B,CAG9B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,KAAK,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,GACzC,SAAS,YAAY,EAAE,CAEzB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,yBAAyB,CAAC,EACpD,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE;IACL,SAAS,EAAE,cAAc,CAAA;IACzB,OAAO,EAAE,YAAY,CAAA;IACrB,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAA;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,GACA,WAAW,GAAG,SAAS,CAYzB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-state-core.js","names":[],"sources":["../../../src/components/theme/theme-state-core.ts"],"sourcesContent":["import {\n DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS,\n normalizeAppearanceEditorFontSettings,\n type AppearanceEditorFontSettings,\n} from '#lib/appearance-font-settings'\nimport type { AccentPreset } from '@adea-ai/themes'\nimport { normalizeCustomAccent, type AccentRoles } from '#lib/accent-roles'\nimport { stepAppearanceFontSizes, type FontZoomIntent } from '#lib/font-zoom'\nimport type { ThemeSurface } from '#lib/theme-surface'\nimport { defaultDarkThemeId, defaultLightThemeId, resolveVariant } from '#lib/theme-defaults'\nimport type { ThemeEngine } from '#lib/theme-engine'\nimport type { ThemeAppearance, ThemeVariant } from '#lib/themes'\n\n/**\n * The pure half of the theme provider: what a selection is, how two selections\n * merge, and what a selection resolves to.\n *\n * Nothing here touches the document, storage or a signal, so each rule can be\n * tested by calling it. `ThemeProvider` owns the reactivity and wires these to it;\n * `theme-document.ts` owns the writes; `theme-persistence.ts` owns the store.\n *\n * This is the catalogue-free half: it imports no catalogue code or data, so the lazy\n * provider can use it at start-up. `theme-state.ts` re-exports it and adds\n * {@link accentRolesForState} bound to the full catalogue.\n */\n\n/**\n * Four independent choices, and keeping them independent is the point:\n *\n * - **appearance** — light, dark, or follow the system.\n * - **a theme per appearance** — so a user can run Catppuccin Mocha by night and\n * Solarized Light by day without re-choosing when the system flips.\n * - **an accent** — adea's six presets, or one of the accents the selected theme\n * pair carries itself (`ansi-blue`…), which re-colour the interactive roles on\n * top of whichever theme is active.\n * - **fonts** — separate family and size choices for UI, content and code.\n */\nexport type ThemeSelection = {\n /** `system` follows `prefers-color-scheme` and updates when it changes. */\n appearance: ThemeAppearance | 'system'\n /** The variant to use when the resolved appearance is light. */\n lightThemeId: string\n /** The variant to use when the resolved appearance is dark. */\n darkThemeId: string\n /**\n * An `accentPresets` id, a theme accent id from `themeAccents()` (`ansi-blue`…),\n * `theme` for the variant's own primary, or a custom colour as `#rrggbb`. A theme\n * accent the current pair does not offer falls back to the variant's own primary.\n *\n * A custom colour is stored lower case and is raised to the contrast floor when it\n * is painted, never when it is stored: the selection keeps what the user chose.\n * Anything else that is not an id is dropped at paint, not rejected here.\n */\n accent: string\n /** UI-family alias for consumers of the original single-font preference. */\n font: string\n /** UI, content and code font settings. Omitted legacy records are migrated from `font`. */\n fonts?: AppearanceEditorFontSettings\n /**\n * `comfortable` is the system's default geometry; `compact` moves the control\n * ladder down one rung.\n *\n * Optional, and defaulted on read, so a preference stored before density existed\n * keeps working and `ThemeSelection` stays assignable without it.\n */\n density?: ThemeDensity\n /**\n * The terminal either follows the interface theme (`theme`, or absent) or is pinned\n * to another theme's terminal palette by that theme's id. The pin is written over\n * the interface variant's own `--terminal-*` properties, so a light interface can\n * carry a dark terminal.\n *\n * An id the registry does not hold paints the interface palette and stays in the\n * selection, the same rule as an unknown theme id.\n *\n * Optional and not defaulted: see {@link defaultThemeSelection}.\n */\n terminalThemeId?: string\n /**\n * How opaque elevated panels are. Written to `<html>` only when the provider's\n * `surface` prop is on or this is set; absent, a host paints no surface axis at\n * all. Resolved against the OS and the host's capability before it is painted —\n * see `resolveSurface` — so the value stored is a preference, never the outcome.\n */\n surface?: ThemeSurface\n /**\n * The user's own Reduce Transparency switch, which forces the `opaque` surface the\n * same way the operating system's setting does.\n */\n reduceTransparency?: boolean\n}\n\n/**\n * The two density rungs.\n *\n * `comfortable` is the geometry in `theme.css`, so it is the absence of an\n * attribute rather than a value: a document that ships no `data-density` at all\n * renders correctly, which is what keeps this additive.\n */\nexport type ThemeDensity = 'comfortable' | 'compact'\n\n/**\n * Deliberately lists only the fields every consumer has always had. A field added\n * to {@link ThemeSelection} later gets no default here: `JSON.stringify` drops an\n * `undefined`, so a store written by a consumer that never sets the field stays\n * byte-identical to what it was before the field existed.\n */\nexport const defaultThemeSelection: ThemeSelection = {\n appearance: 'system',\n lightThemeId: defaultLightThemeId,\n darkThemeId: defaultDarkThemeId,\n accent: 'theme',\n font: 'system',\n fonts: DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS,\n density: 'comfortable',\n}\n\n/**\n * A stored selection's density, defaulted.\n *\n * The stored value is read through here rather than trusted, because a preference\n * written before density existed has no `density` key and a hand-edited store may\n * hold anything.\n */\nexport function resolvedDensity(selection: ThemeSelection): ThemeDensity {\n return selection.density === 'compact' ? 'compact' : 'comfortable'\n}\n\nexport type ThemeContextValue = {\n /** The preference as stored. A {@link ThemeContextValue.preview} does not change it. */\n selection: () => ThemeSelection\n /** What the preference resolves to right now, after `system`. */\n resolvedAppearance: () => ThemeAppearance\n /** The variant in use. */\n variant: () => ThemeVariant\n /** Update part of the preference. */\n setSelection: (patch: Partial<ThemeSelection>) => void\n /**\n * The built-in catalogue, so a picker does not import it separately. A plain\n * array: {@link ThemeContextValue.allThemes} is the one that follows a host's\n * extra themes. Under the lazy provider it holds only the default pair until\n * {@link ThemeContextValue.catalogueReady}; read it again afterwards.\n */\n themes: readonly ThemeVariant[]\n /**\n * The accents the selected light/dark pair carries, offered beside the presets.\n * Follows the selection: a different theme pair may offer different slots.\n */\n themeAccents: () => readonly AccentPreset[]\n /**\n * The built-in catalogue followed by the provider's `themes` prop. Reactive when\n * that prop is a function that reads signals.\n */\n allThemes: () => readonly ThemeVariant[]\n /**\n * Paint the document from `draft` laid over the stored selection, without\n * persisting it or changing what {@link ThemeContextValue.selection} returns.\n * `undefined` ends the preview. A {@link ThemeContextValue.setSelection} ends it\n * too, because the committed selection is then what should be showing.\n */\n preview: (draft: Partial<ThemeSelection> | undefined) => void\n /** True while a {@link ThemeContextValue.preview} draft is on the document. */\n previewing: () => boolean\n /**\n * The roles `accent` paints over `variantId` (default: the variant in use), held\n * to the provider's `accentContrastFloor`, for an element-scoped override with\n * `paintAccentRoles` — a workspace that carries its own colour. `undefined` for\n * `null`, for `theme`, for an id that resolves to nothing, and for a variant the\n * registry does not hold: each means \"keep the inherited accent\".\n */\n accentRolesFor: (accent: string | null, variantId?: string) => AccentRoles | undefined\n /**\n * The surface the committed selection paints, after Reduce Transparency and the\n * host's translucency capability. `opaque` when the axis is off. Follows the\n * committed selection, not a preview, like {@link ThemeContextValue.variant}.\n */\n effectiveSurface: () => ThemeSurface\n /**\n * True while the operating system or the selection's `reduceTransparency` forces\n * opaque surfaces. Always false when the surface axis is off, because nothing is\n * then listening to the operating system.\n */\n reduceTransparencyActive: () => boolean\n /**\n * Step the three text sizes together, or put them back to the defaults: what the\n * `fontZoom` prop's chords do, for a host that binds its own keys or a menu. Goes\n * through {@link ThemeContextValue.setSelection}, so it persists and ends a preview.\n */\n zoomFonts: (intent: FontZoomIntent) => void\n /**\n * True when `themes`, `allThemes()` and the variants they resolve are backed by the\n * whole catalogue. Always true under `ThemeProvider`. Under the lazy provider\n * (`@adea-ai/ui/components/theme/lazy`) it turns true once the catalogue has loaded,\n * and until then only the default light and dark themes are available: a stored\n * theme beyond them resolves to its appearance's default (the document keeps painting\n * what the stylesheet gave it) until `catalogueReady()` is true. Absent on a context\n * a host builds itself, where it should be read as true.\n */\n catalogueReady?: () => boolean\n /**\n * Start loading the whole catalogue (idempotent) and resolve when it is available.\n * A picker, a preview or a settings page calls it when it mounts. A no-op under\n * `ThemeProvider`, whose catalogue is already loaded.\n */\n loadCatalogue?: () => Promise<void>\n}\n\n/** A selection with the `undefined` keys of a patch left out. */\nfunction definedOnly<T extends object>(value: T): Partial<T> {\n return Object.fromEntries(\n Object.entries(value).filter(([, entry]) => entry !== undefined)\n ) as Partial<T>\n}\n\n/** Keep the deprecated single-font view synchronized with the UI axis. */\nexport function mergeThemeSelection(\n base: ThemeSelection,\n patch: Partial<ThemeSelection>\n): ThemeSelection {\n const merged = { ...base, ...patch }\n let fonts: AppearanceEditorFontSettings\n\n if (patch.fonts !== undefined) {\n fonts = normalizeAppearanceEditorFontSettings(patch.fonts).settings\n } else if (patch.font !== undefined) {\n const currentFonts = normalizeAppearanceEditorFontSettings(base.fonts, base.font).settings\n fonts = normalizeAppearanceEditorFontSettings({\n ...currentFonts,\n ui: { ...currentFonts.ui, family: patch.font },\n }).settings\n } else {\n fonts = normalizeAppearanceEditorFontSettings(merged.fonts, merged.font).settings\n }\n\n return {\n ...merged,\n // One spelling for a custom colour, so equal choices compare and store equal.\n accent: normalizeCustomAccent(merged.accent) ?? merged.accent,\n fonts,\n font: fonts.ui.family,\n }\n}\n\n/**\n * The selection a provider starts from: the defaults, then whatever the store\n * returned, then `initial`.\n *\n * `initial` wins over the store on every mount. That precedence is part of the\n * contract Cortana relies on (its `initial` pins `appearance` and `font`), and it\n * is why the store's answer is only the middle layer. A store that returned\n * nothing, or threw, or answered with explicit `undefined`s, leaves the defaults\n * standing for those fields.\n */\nexport function initialThemeSelection(\n stored: Partial<ThemeSelection> | undefined,\n initial: Partial<ThemeSelection> | undefined\n): ThemeSelection {\n const base = mergeThemeSelection(defaultThemeSelection, definedOnly(stored ?? {}))\n return mergeThemeSelection(base, initial ?? {})\n}\n\n/** `system` resolved against what the operating system reports. */\nexport function resolveAppearance(\n preference: ThemeSelection['appearance'],\n system: ThemeAppearance\n): ThemeAppearance {\n return preference === 'system' ? system : preference\n}\n\n/** The theme id the selection names for a resolved appearance. */\nexport function selectedThemeId(selection: ThemeSelection, appearance: ThemeAppearance): string {\n return appearance === 'dark' ? selection.darkThemeId : selection.lightThemeId\n}\n\n/**\n * What a selection paints: the resolved appearance and the variant for it.\n *\n * An id the registry does not hold resolves to the appearance's default rather than\n * being rewritten (see `resolveVariant`), so the selection a host stores is never\n * changed by being unresolvable.\n */\nexport function resolveThemeState(\n selection: ThemeSelection,\n system: ThemeAppearance,\n registry: readonly ThemeVariant[]\n): { appearance: ThemeAppearance; variant: ThemeVariant } {\n const appearance = resolveAppearance(selection.appearance, system)\n return {\n appearance,\n variant: resolveVariant(registry, selectedThemeId(selection, appearance), appearance),\n }\n}\n\n/**\n * The variant whose terminal palette is pinned, or `undefined` when the terminal\n * follows the interface theme.\n *\n * `theme`, an absent id and an id the registry does not hold all mean the interface\n * palette: a terminal must never resolve to a blank or half-painted palette because a\n * theme was deleted after it was pinned.\n */\nexport function resolveTerminalVariant(\n terminalThemeId: string | undefined,\n registry: readonly ThemeVariant[]\n): ThemeVariant | undefined {\n if (terminalThemeId === undefined || terminalThemeId === 'theme') return undefined\n return registry.find((candidate) => candidate.id === terminalThemeId)\n}\n\n/**\n * The font settings a zoom chord asks for: one pixel up or down on every axis, or\n * the defaults for `reset`.\n */\nexport function zoomedFontSettings(\n selection: ThemeSelection,\n intent: FontZoomIntent\n): AppearanceEditorFontSettings {\n if (intent === 'reset') return { ...DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS }\n return stepAppearanceFontSizes(selection.fonts, intent === 'in' ? 1 : -1)\n}\n\n/**\n * The registry a provider resolves against: the catalogue, then the host's extras.\n *\n * The catalogue wins an id collision, because it is listed first and `resolveVariant`\n * takes the first match: a host's variant can add a theme but cannot shadow one.\n */\nexport function mergeRegistry(\n builtin: readonly ThemeVariant[],\n extra: readonly ThemeVariant[] | undefined\n): readonly ThemeVariant[] {\n return extra && extra.length > 0 ? [...builtin, ...extra] : builtin\n}\n\n/**\n * The roles an accent paints over a variant, for {@link ThemeContextValue.accentRolesFor}.\n *\n * Resolved against the committed selection's theme pair, so an `ansi-*` accent means\n * the same colour here as it does on `<html>`. `engine` answers the catalogue\n * questions; `theme-state.ts` binds the full catalogue for callers that have none.\n */\nexport function accentRolesForStateWith(\n engine: Pick<ThemeEngine, 'accentRolesForSelection'>,\n accent: string | null,\n variantId: string | undefined,\n state: {\n selection: ThemeSelection\n variant: ThemeVariant\n registry: readonly ThemeVariant[]\n accentContrastFloor?: number\n }\n): AccentRoles | undefined {\n if (accent === null) return undefined\n const variant =\n variantId === undefined\n ? state.variant\n : state.registry.find((candidate) => candidate.id === variantId)\n if (!variant) return undefined\n return engine.accentRolesForSelection(accent, variant.appearance, state.selection, {\n background: variant.colors.background,\n floor: state.accentContrastFloor,\n variantId: variant.id,\n })\n}\n"],"mappings":";;;;;;;;;;;AA2GA,IAAa,wBAAwC;CACnD,YAAY;CACZ,cAAc;CACd,aAAa;CACb,QAAQ;CACR,MAAM;CACN,OAAO;CACP,SAAS;AACX;;;;;;;;AASA,SAAgB,gBAAgB,WAAyC;CACvE,OAAO,UAAU,YAAY,YAAY,YAAY;AACvD;;AAkFA,SAAS,YAA8B,OAAsB;CAC3D,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,CAAC,CAAC,QAAQ,GAAG,WAAW,UAAU,KAAA,CAAS,CACjE;AACF;;AAGA,SAAgB,oBACd,MACA,OACgB;CAChB,MAAM,SAAS;EAAE,GAAG;EAAM,GAAG;CAAM;CACnC,IAAI;CAEJ,IAAI,MAAM,UAAU,KAAA,GAClB,QAAQ,sCAAsC,MAAM,KAAK,CAAC,CAAC;MACtD,IAAI,MAAM,SAAS,KAAA,GAAW;EACnC,MAAM,eAAe,sCAAsC,KAAK,OAAO,KAAK,IAAI,CAAC,CAAC;EAClF,QAAQ,sCAAsC;GAC5C,GAAG;GACH,IAAI;IAAE,GAAG,aAAa;IAAI,QAAQ,MAAM;GAAK;EAC/C,CAAC,CAAC,CAAC;CACL,OACE,QAAQ,sCAAsC,OAAO,OAAO,OAAO,IAAI,CAAC,CAAC;CAG3E,OAAO;EACL,GAAG;EAEH,QAAQ,sBAAsB,OAAO,MAAM,KAAK,OAAO;EACvD;EACA,MAAM,MAAM,GAAG;CACjB;AACF;;;;;;;;;;;AAYA,SAAgB,sBACd,QACA,SACgB;CAEhB,OAAO,oBADM,oBAAoB,uBAAuB,YAAY,UAAU,CAAC,CAAC,CACrD,GAAM,WAAW,CAAC,CAAC;AAChD;;AAGA,SAAgB,kBACd,YACA,QACiB;CACjB,OAAO,eAAe,WAAW,SAAS;AAC5C;;AAGA,SAAgB,gBAAgB,WAA2B,YAAqC;CAC9F,OAAO,eAAe,SAAS,UAAU,cAAc,UAAU;AACnE;;;;;;;;AASA,SAAgB,kBACd,WACA,QACA,UACwD;CACxD,MAAM,aAAa,kBAAkB,UAAU,YAAY,MAAM;CACjE,OAAO;EACL;EACA,SAAS,eAAe,UAAU,gBAAgB,WAAW,UAAU,GAAG,UAAU;CACtF;AACF;;;;;;;;;AAUA,SAAgB,uBACd,iBACA,UAC0B;CAC1B,IAAI,oBAAoB,KAAA,KAAa,oBAAoB,SAAS,OAAO,KAAA;CACzE,OAAO,SAAS,MAAM,cAAc,UAAU,OAAO,eAAe;AACtE;;;;;AAMA,SAAgB,mBACd,WACA,QAC8B;CAC9B,IAAI,WAAW,SAAS,OAAO,EAAE,GAAG,wCAAwC;CAC5E,OAAO,wBAAwB,UAAU,OAAO,WAAW,OAAO,IAAI,EAAE;AAC1E;;;;;;;AAQA,SAAgB,cACd,SACA,OACyB;CACzB,OAAO,SAAS,MAAM,SAAS,IAAI,CAAC,GAAG,SAAS,GAAG,KAAK,IAAI;AAC9D;;;;;;;;AASA,SAAgB,wBACd,QACA,QACA,WACA,OAMyB;CACzB,IAAI,WAAW,MAAM,OAAO,KAAA;CAC5B,MAAM,UACJ,cAAc,KAAA,IACV,MAAM,UACN,MAAM,SAAS,MAAM,cAAc,UAAU,OAAO,SAAS;CACnE,IAAI,CAAC,SAAS,OAAO,KAAA;CACrB,OAAO,OAAO,wBAAwB,QAAQ,QAAQ,YAAY,MAAM,WAAW;EACjF,YAAY,QAAQ,OAAO;EAC3B,OAAO,MAAM;EACb,WAAW,QAAQ;CACrB,CAAC;AACH"}
@@ -1,35 +0,0 @@
1
- export const PASTE_PREVIEW_MAX_LINES = 12
2
- export const PASTE_PREVIEW_MAX_CHARACTERS = 1200
3
-
4
- export interface PastePreviewSummary {
5
- text: string
6
- hiddenLines: number
7
- hiddenCharacters: number
8
- scannedCharacters: number
9
- }
10
-
11
- /** Build a bounded preview without splitting or joining the full paste content. */
12
- export function summarizePastePreview(content: string, totalLines: number): PastePreviewSummary {
13
- const scanLimit = Math.min(content.length, PASTE_PREVIEW_MAX_CHARACTERS)
14
- let end = 0
15
- let visibleLines = 1
16
- let scannedCharacters = 0
17
-
18
- while (end < scanLimit) {
19
- const character = content.charCodeAt(end)
20
- scannedCharacters += 1
21
- if (character === 10) {
22
- if (visibleLines === PASTE_PREVIEW_MAX_LINES) break
23
- visibleLines += 1
24
- }
25
- end += 1
26
- }
27
-
28
- const text = content.slice(0, end)
29
- return {
30
- text,
31
- hiddenLines: Math.max(0, totalLines - visibleLines),
32
- hiddenCharacters: Math.max(0, content.length - text.length),
33
- scannedCharacters,
34
- }
35
- }
@@ -1,262 +0,0 @@
1
- import {
2
- applyAppearanceFontSettings,
3
- normalizeAppearanceEditorFontSettings,
4
- } from '../../lib/appearance-font-settings'
5
- import { terminalCssVariables } from '../../lib/theme-css'
6
- import type { ThemeEngine } from '../../lib/theme-engine'
7
- import type { EditorRolesMode, ThemeAppearance, ThemeVariant } from '../../lib/themes'
8
- import { isCustomAccent } from '../../lib/accent-roles'
9
- import { surfaceAlpha, type SurfaceState } from '../../lib/theme-surface'
10
- import { resolvedDensity, type ThemeSelection } from './theme-state-core'
11
-
12
- /**
13
- * The document half of the theme provider: the single writer of `<html>`.
14
- *
15
- * Written against the few members of an element it uses, so the rules can be tested
16
- * on a stand-in and the provider's effect stays a one-line call.
17
- *
18
- * This is the engine-parameterised half: every question the catalogue answers goes
19
- * through the {@link ThemeEngine} it is given, so it imports no catalogue code or data.
20
- * `theme-document.ts` binds the full catalogue and keeps the signatures the eager
21
- * provider and the tests have always used.
22
- */
23
- export type ThemeRoot = Pick<
24
- HTMLElement,
25
- 'classList' | 'dataset' | 'style' | 'removeAttribute' | 'setAttribute'
26
- >
27
-
28
- export type ThemeDocumentState = {
29
- /** What the document shows: the committed selection, or a preview laid over it. */
30
- selection: ThemeSelection
31
- appearance: ThemeAppearance
32
- variant: ThemeVariant
33
- /**
34
- * The variant whose terminal palette is pinned over the interface variant's.
35
- * Absent, the terminal follows the interface theme.
36
- */
37
- terminalVariant?: ThemeVariant
38
- /**
39
- * The resolved surface axis. Absent, the axis is off: no attribute and no
40
- * `--surface-alpha` is written, and any this writer wrote before is removed.
41
- */
42
- surface?: SurfaceState
43
- }
44
-
45
- export type ThemeDocumentOptions = {
46
- /**
47
- * Rewrites the custom properties just before they are written: the variant's
48
- * roles with the accent laid over them. It sees every property of the pass and
49
- * must return the full map; a name it drops is not written.
50
- */
51
- transformTokens?: (tokens: Record<string, string>) => Record<string, string>
52
- /**
53
- * The contrast an accent is held to against the variant's background. Absent, a
54
- * preset is painted verbatim (the catalogue measured it for its own themes) and
55
- * only a custom `#rrggbb` is held to the default floor of 3:1.
56
- */
57
- accentContrastFloor?: number
58
- /**
59
- * Where a catalogue variant's palette comes from. `inline` (the default) writes
60
- * every role onto the root. `stylesheet` writes none for a catalogue variant,
61
- * because the host loads a stylesheet that carries a `[data-theme]` block for it;
62
- * a variant the catalogue does not hold (a host's imported theme) is still written
63
- * inline, since no stylesheet can know it. The accent, the terminal pin, the
64
- * surface alpha and the fonts are written the same in both.
65
- *
66
- * Switching from an imported variant back to a catalogue one removes what the
67
- * imported one wrote, so nothing inline outlives it to beat the stylesheet.
68
- */
69
- palette?: 'inline' | 'stylesheet'
70
- /**
71
- * The `--editor-*` projection. `syntax` (the default) is the catalogue's quiet
72
- * syntax roles, which is what `theme-variants.css` carries; `floor` holds every
73
- * editor role to 4.5:1 on the canvas, as hex.
74
- *
75
- * With `palette: 'stylesheet'`, `floor` is the one palette write a catalogue
76
- * variant still gets: the stylesheet is generated for the default projection, so
77
- * the sixteen `--editor-*` properties are written inline over it. The rest of the
78
- * palette stays in the stylesheet.
79
- */
80
- editorRoles?: EditorRolesMode
81
- }
82
-
83
- /**
84
- * What a catalogue variant still writes inline when its palette is the stylesheet's:
85
- * nothing, unless the editor projection is not the one the stylesheet was generated
86
- * for.
87
- */
88
- function stylesheetOverrides(
89
- engine: ThemeEngine,
90
- variant: ThemeVariant,
91
- editorRoles: EditorRolesMode | undefined
92
- ): Record<string, string> {
93
- if (editorRoles !== 'floor') return {}
94
- return Object.fromEntries(
95
- Object.entries(engine.themeCssVariables(variant, { editor: 'floor' })).filter(([name]) =>
96
- name.startsWith('--editor-')
97
- )
98
- )
99
- }
100
-
101
- /**
102
- * The custom properties a state paints: the variant's roles, with the accent
103
- * selection laid over them, the pinned terminal palette over that, the surface
104
- * alpha, then `transformTokens`.
105
- *
106
- * The accent is applied *here* rather than left to the `[data-accent]` blocks in
107
- * `theme.css`, because the properties are written inline and an inline declaration
108
- * outranks every stylesheet selector however specific it is. The blocks still exist
109
- * and are still correct — they are what styles the window before this runs — but
110
- * they cannot win from here, so leaving the accent to them meant the attribute was
111
- * set, the rules were present, and nothing changed on screen.
112
- */
113
- export function themeDocumentTokensWith(
114
- engine: ThemeEngine,
115
- state: ThemeDocumentState,
116
- options: ThemeDocumentOptions = {}
117
- ): { tokens: Record<string, string>; accented: boolean } {
118
- const fromStylesheet =
119
- options.palette === 'stylesheet' && engine.isCatalogueVariant(state.variant)
120
- const properties = fromStylesheet
121
- ? stylesheetOverrides(engine, state.variant, options.editorRoles)
122
- : { ...engine.themeCssVariables(state.variant, { editor: options.editorRoles }) }
123
- const accent = engine.accentVariables(state.selection.accent, state.appearance, state.selection, {
124
- background: state.variant.colors.background,
125
- floor: options.accentContrastFloor,
126
- variantId: state.variant.id,
127
- })
128
- if (accent) Object.assign(properties, accent)
129
- // Written after the variant and the accent, so it wins over the interface
130
- // variant's own terminal ramp (and over the stylesheet's, which it outranks as an
131
- // inline declaration). Dropping the pin needs no removal of its own: the ramp is
132
- // then rewritten by the variant, or swept back to the stylesheet.
133
- if (state.terminalVariant) Object.assign(properties, terminalCssVariables(state.terminalVariant))
134
- if (state.surface) properties['--surface-alpha'] = surfaceAlpha[state.surface.surface]
135
- return {
136
- tokens: options.transformTokens ? options.transformTokens(properties) : properties,
137
- accented: accent !== undefined,
138
- }
139
- }
140
-
141
- /**
142
- * Write a state onto a root and report which custom properties it owns.
143
- *
144
- * Pass the previous call's return as `previous` and any palette property that pass
145
- * wrote and this one does not is removed. For the catalogue the two sets are the
146
- * same, so nothing is ever removed; it matters for a host variant that carries
147
- * `tokens` the catalogue does not, which would otherwise stay inline, beating the
148
- * stylesheet, after the user switched away from it.
149
- */
150
- export function applyThemeToRootWith(
151
- engine: ThemeEngine,
152
- root: ThemeRoot,
153
- state: ThemeDocumentState,
154
- options: ThemeDocumentOptions = {},
155
- previous?: ReadonlySet<string>
156
- ): ReadonlySet<string> {
157
- const { tokens, accented } = themeDocumentTokensWith(engine, state, options)
158
-
159
- for (const [name, value] of Object.entries(tokens)) {
160
- root.style.setProperty(name, value)
161
- }
162
- if (previous) {
163
- for (const name of previous) {
164
- if (!(name in tokens)) root.style.removeProperty(name)
165
- }
166
- }
167
-
168
- root.classList.toggle('dark', state.appearance === 'dark')
169
- root.dataset['theme'] = state.variant.id
170
- root.dataset['appearance'] = state.appearance
171
- root.style.colorScheme = state.appearance
172
-
173
- // A custom colour has no stylesheet block to select, and its value is the
174
- // attribute's worst possible content, so it is reported as `custom`.
175
- if (!accented) root.removeAttribute('data-accent')
176
- else
177
- root.dataset['accent'] = isCustomAccent(state.selection.accent)
178
- ? 'custom'
179
- : state.selection.accent
180
-
181
- // The surface axis is opt-in, so its absence removes rather than defaults: a host
182
- // that never enables it keeps an `<html>` with neither attribute, and one that
183
- // turns it off leaves nothing behind. (`--surface-alpha` is swept with the tokens.)
184
- if (state.surface) {
185
- root.dataset['surface'] = state.surface.surface
186
- root.dataset['reduceTransparency'] = state.surface.reduceTransparencyActive ? 'true' : 'false'
187
- } else {
188
- root.removeAttribute('data-surface')
189
- root.removeAttribute('data-reduce-transparency')
190
- }
191
-
192
- applyAppearanceFontSettings(
193
- root,
194
- normalizeAppearanceEditorFontSettings(state.selection.fonts, state.selection.font).settings
195
- )
196
-
197
- // Density is a pure token shift, so unlike the colour axes there is nothing to
198
- // compute: the attribute selects a block in `theme.css`. It is applied here for
199
- // the same reason as the others — this is the one place that knows what the
200
- // current selection is, and it is the only writer of these attributes.
201
- if (resolvedDensity(state.selection) === 'comfortable') root.removeAttribute('data-density')
202
- else root.dataset['density'] = resolvedDensity(state.selection)
203
-
204
- return new Set(Object.keys(tokens))
205
- }
206
-
207
- /** What {@link applyWithoutTransitions} needs of a document. */
208
- export type TransitionDocument = {
209
- head: { appendChild(node: unknown): unknown }
210
- createElement(tag: 'style'): {
211
- textContent: string | null
212
- offsetHeight?: number
213
- remove(): void
214
- }
215
- }
216
-
217
- /**
218
- * Run `apply` with every CSS transition switched off for the frame that carries
219
- * it, so a theme switch cannot animate page-wide.
220
- *
221
- * Without this, flipping the custom properties on `<html>` starts a transition on
222
- * every element that declares one, and each fades from the old palette to the new
223
- * over its own duration: a theme change that looks like a rendering fault. The
224
- * rule is removed two frames later, after the browser has committed the new styles
225
- * with transitions off, and `restore` runs it early (the provider calls it when it
226
- * is disposed mid-switch).
227
- *
228
- * `schedule` is the frame source; it defaults to `requestAnimationFrame` and falls
229
- * back to running at once where there is none, which leaves transitions on rather
230
- * than off.
231
- */
232
- export function applyWithoutTransitions(
233
- doc: TransitionDocument,
234
- apply: () => void,
235
- schedule: (callback: () => void) => void = defaultSchedule
236
- ): () => void {
237
- const style = doc.createElement('style')
238
- style.textContent = '*{transition:none !important}'
239
- doc.head.appendChild(style)
240
- // Reading a layout property forces the browser to commit the rule before the
241
- // properties change; without it the two can be batched into one style recalc.
242
- void style.offsetHeight
243
- let removed = false
244
- const restore = () => {
245
- if (removed) return
246
- removed = true
247
- style.remove()
248
- }
249
- try {
250
- apply()
251
- } catch (error) {
252
- restore()
253
- throw error
254
- }
255
- schedule(() => schedule(restore))
256
- return restore
257
- }
258
-
259
- function defaultSchedule(callback: () => void): void {
260
- if (typeof requestAnimationFrame === 'function') requestAnimationFrame(callback)
261
- else callback()
262
- }
@@ -1,40 +0,0 @@
1
- import { themeContext } from './theme-context'
2
- import {
3
- createThemeContextValue,
4
- type ThemeCatalogueSource,
5
- type ThemeProviderProps,
6
- } from './theme-provider-value'
7
-
8
- export type { ThemeCatalogueSource, ThemeProviderProps } from './theme-provider-value'
9
- export {
10
- createVersionedPersistence,
11
- localStoragePersistence,
12
- type ThemePersistence,
13
- type ThemeStorageSchema,
14
- type VersionedCodec,
15
- type VersionedPersistenceOptions,
16
- } from './theme-persistence'
17
- export { useOptionalTheme, useTheme } from './theme-context'
18
- export type { ThemeSurface } from '../../lib/theme-surface'
19
- export type { EditorRolesMode } from '../../lib/themes'
20
- export { inlineScriptLiteral, themeScript, type ThemeScriptOptions } from './theme-script'
21
- export {
22
- defaultThemeSelection,
23
- resolvedDensity,
24
- type ThemeContextValue,
25
- type ThemeDensity,
26
- type ThemeSelection,
27
- } from './theme-state-core'
28
-
29
- /**
30
- * The provider, parameterised by where its catalogue comes from.
31
- *
32
- * `ThemeProvider` (`theme-provider.tsx`) and the lazy `ThemeProvider`
33
- * (`theme-provider-lazy.tsx`) are this component with a source; the work is
34
- * `createThemeContextValue`. It imports no catalogue code or data.
35
- */
36
- export function ThemeProviderCore(props: ThemeProviderProps & { catalogue: ThemeCatalogueSource }) {
37
- const value = createThemeContextValue(props)
38
- const Context = themeContext()
39
- return <Context.Provider value={value}>{props.children}</Context.Provider>
40
- }