@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,6 +1,6 @@
1
- import { accentPresets } from "../../lib/accent-presets.js";
2
- import { themesForAppearance } from "../../lib/themes.js";
1
+ import { accentPresets, isPresetAccentId } from "../../lib/accent-presets.js";
3
2
  import { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from "../../lib/appearance-font-settings.js";
3
+ import { THEME_DEFAULT_ID } from "../../lib/theme-defaults.js";
4
4
  import { cn } from "../../lib/utils.js";
5
5
  import { AccentSwatchGroups } from "../composites/appearance-editor/accent-swatch-groups.js";
6
6
  import { AppearanceFontSettingsGroup } from "../composites/appearance-editor/font-settings-group.js";
@@ -9,17 +9,21 @@ import { ThemePicker } from "./theme-picker.js";
9
9
  import { useTheme } from "./theme-context.js";
10
10
  import { Heading } from "../ui/typography/typography.js";
11
11
  import { createComponent, insert, mergeProps, spread, template } from "solid-js/web";
12
- import { Show, splitProps } from "solid-js";
12
+ import { Show, onMount, splitProps } from "solid-js";
13
13
  import { RadioGroup } from "@kobalte/core/radio-group";
14
14
  // src/components/theme/appearance-panel.tsx
15
15
  var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=appearance-panel><section class="flex flex-col gap-3"><header class="flex flex-col gap-0.5"><p class="max-w-prose text-sm text-muted-foreground">Follow the system, or pin one. The theme below is chosen per appearance, so switching at sunset does not make you choose again.</p></header></section><section class="flex flex-col gap-3"><header class="flex flex-col gap-0.5"><p class="max-w-prose text-sm text-muted-foreground">Colours the interactive roles — the primary button, the focus ring, a selected row — on top of the theme above — one of the presets, or a colour the theme carries itself. Every option is measured against the surface it lands on, so none of them can make a label unreadable.</p></header></section><section class="flex flex-col gap-3"><header class="flex flex-col gap-0.5"><p class="max-w-prose text-sm text-muted-foreground">Choose separate families and sizes for the interface, reading, and code. Font families come from the shared catalogue and are self-hosted.`);
16
16
  var _tmpl$2 = /*#__PURE__*/ template(`<section class="flex flex-col gap-3"><header class="flex flex-col gap-0.5"><p class="max-w-prose text-sm text-muted-foreground">`);
17
- var LIGHT_THEMES = themesForAppearance("light");
18
- var DARK_THEMES = themesForAppearance("dark");
19
17
  function AppearancePanel(props) {
20
18
  const [local, rest] = splitProps(props, ["class"]);
21
- const { selection, setSelection, resolvedAppearance, themeAccents } = useTheme();
22
- const selectedAccent = () => accentPresets.some((option) => option.id === selection().accent) || themeAccents().some((option) => option.id === selection().accent) ? selection().accent : "theme";
19
+ const context = useTheme();
20
+ const { selection, setSelection, resolvedAppearance, themeAccents } = context;
21
+ onMount(() => void context.loadCatalogue?.());
22
+ const themesFor = (appearance) => context.themes.filter((variant) => variant.appearance === appearance);
23
+ const selectedAccent = () => {
24
+ const accent = selection().accent;
25
+ return accent === "theme" || isPresetAccentId(accent) || themeAccents().some((option) => option.id === accent) ? accent : THEME_DEFAULT_ID;
26
+ };
23
27
  return (() => {
24
28
  var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$5.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild;
25
29
  spread(_el$, mergeProps({ get ["class"]() {
@@ -66,7 +70,9 @@ function AppearancePanel(props) {
66
70
  return createComponent(ThemeSection, {
67
71
  title: "Light theme",
68
72
  description: "Shown when the appearance resolves to light.",
69
- themes: LIGHT_THEMES,
73
+ get themes() {
74
+ return themesFor("light");
75
+ },
70
76
  get selectedId() {
71
77
  return selection().lightThemeId;
72
78
  },
@@ -82,7 +88,9 @@ function AppearancePanel(props) {
82
88
  return createComponent(ThemeSection, {
83
89
  title: "Dark theme",
84
90
  description: "Shown when the appearance resolves to dark.",
85
- themes: DARK_THEMES,
91
+ get themes() {
92
+ return themesFor("dark");
93
+ },
86
94
  get selectedId() {
87
95
  return selection().darkThemeId;
88
96
  },
@@ -1 +1 @@
1
- {"version":3,"file":"appearance-panel.js","names":["ComponentProps","Show","splitProps","RadioGroup","Radio","accentPresets","themesForAppearance","DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS","cn","AccentSwatchGroups","AppearanceFontSettingsGroup","RadioGroupItem","ThemePicker","useTheme","Heading","AppearancePanelProps","LIGHT_THEMES","DARK_THEMES","AppearancePanel","props","local","rest","selection","setSelection","resolvedAppearance","themeAccents","selectedAccent","some","option","id","accent","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","_el$5","nextSibling","_el$6","_el$7","_el$8","_el$9","_el$0","_$spread","_$mergeProps","class","_$insert","_$createComponent","as","size","children","value","appearance","onChange","label","description","when","ThemeSection","title","themes","selectedId","lightThemeId","onThemeSelect","theme","darkThemeId","orientation","accentOptions","themeDefaultColor","settings","fonts","ReturnType","_el$1","_tmpl$2","_el$10","_el$11","_$mergeProps","_$createComponent","RadioGroup","Radio"],"sources":["../../../src/components/theme/appearance-panel.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { RadioGroup as Radio } from '@kobalte/core/radio-group'\nimport { accentPresets } from '#lib/tokens'\nimport { themesForAppearance } from '#lib/themes'\nimport { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from '#lib/appearance-font-settings'\nimport { cn } from '#lib/utils'\nimport { AccentSwatchGroups } from '../composites/appearance-editor/accent-swatch-groups'\nimport { AppearanceFontSettingsGroup } from '../composites/appearance-editor/font-settings-group'\nimport { RadioGroup, RadioGroupItem } from '../ui/radio-group/radio-group'\nimport { ThemePicker } from './theme-picker'\nimport { useTheme } from './theme-provider'\nimport { Heading } from '../ui/typography'\n\n/**\n * AppearancePanel.\n *\n * The appearance page, as a component rather than as a screen each application\n * draws for itself. Two applications that both let a user choose a theme should\n * offer the *same* choices in the *same* arrangement — otherwise \"Adea\" and\n * \"Cortana\" are two products that happen to share a component library, which is\n * the opposite of what this system is for.\n *\n * Four axes, in the order a user thinks about them:\n *\n * 1. **Appearance** — light, dark, or follow the system.\n * 2. **Themes** — one for each appearance. Both are shown at once, because the\n * choice is per-appearance and hiding the other half makes it feel like one\n * setting that keeps changing.\n * 3. **Accent** — adea's presets, then the accents the selected theme pair\n * carries itself, layered on whichever theme is active.\n * 4. **Fonts** — separate families and sizes for interface, content and code.\n *\n * The panel reads and writes the provider's preference and keeps no state of its\n * own, so it cannot disagree with what is applied.\n */\nexport type AppearancePanelProps = ComponentProps<'div'>\n\nconst LIGHT_THEMES = themesForAppearance('light')\nconst DARK_THEMES = themesForAppearance('dark')\n\nexport function AppearancePanel(props: AppearancePanelProps) {\n const [local, rest] = splitProps(props, ['class'])\n const { selection, setSelection, resolvedAppearance, themeAccents } = useTheme()\n const selectedAccent = () =>\n accentPresets.some((option) => option.id === selection().accent) ||\n themeAccents().some((option) => option.id === selection().accent)\n ? selection().accent\n : 'theme'\n\n return (\n <div data-slot=\"appearance-panel\" class={cn('flex flex-col gap-8', local.class)} {...rest}>\n {/* --- 1. Appearance ------------------------------------------------- */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Appearance\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Follow the system, or pin one. The theme below is chosen per appearance, so switching at\n sunset does not make you choose again.\n </p>\n </header>\n <RadioGroup\n value={selection().appearance}\n onChange={(value) => setSelection({ appearance: value as 'light' | 'dark' | 'system' })}\n aria-label=\"Appearance\"\n >\n <RadioGroupItem value=\"light\" label=\"Light\" description=\"Always the light theme.\" />\n <RadioGroupItem value=\"dark\" label=\"Dark\" description=\"Always the dark theme.\" />\n <RadioGroupItem\n value=\"system\"\n label=\"Match the system\"\n description={`Currently resolving to ${resolvedAppearance()}.`}\n />\n </RadioGroup>\n </section>\n\n {/* --- 2. Themes ------------------------------------------------------ */}\n <Show when={resolvedAppearance() === 'light'}>\n <ThemeSection\n title=\"Light theme\"\n description=\"Shown when the appearance resolves to light.\"\n themes={LIGHT_THEMES}\n selectedId={selection().lightThemeId}\n onThemeSelect={(theme) => setSelection({ lightThemeId: theme.id })}\n />\n </Show>\n <Show when={resolvedAppearance() === 'dark'}>\n <ThemeSection\n title=\"Dark theme\"\n description=\"Shown when the appearance resolves to dark.\"\n themes={DARK_THEMES}\n selectedId={selection().darkThemeId}\n onThemeSelect={(theme) => setSelection({ darkThemeId: theme.id })}\n />\n </Show>\n\n {/* --- 3. Accent ------------------------------------------------------ */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Accent\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Colours the interactive roles — the primary button, the focus ring, a selected row — on\n top of the theme above — one of the presets, or a colour the theme carries itself. Every\n option is measured against the surface it lands on, so none of them can make a label\n unreadable.\n </p>\n </header>\n <Radio\n value={selectedAccent()}\n onChange={(accent) => setSelection({ accent })}\n orientation=\"horizontal\"\n aria-label=\"Accent\"\n class=\"flex flex-col items-start gap-3\"\n >\n <AccentSwatchGroups\n accentOptions={accentPresets}\n resolvedAppearance={resolvedAppearance()}\n themeDefaultColor=\"var(--primary)\"\n />\n </Radio>\n </section>\n\n {/* --- 4. Fonts ------------------------------------------------------- */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Fonts\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Choose separate families and sizes for the interface, reading, and code. Font families\n come from the shared catalogue and are self-hosted.\n </p>\n </header>\n <AppearanceFontSettingsGroup\n settings={selection().fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n onChange={(fonts) => setSelection({ fonts })}\n />\n </section>\n </div>\n )\n}\n\nfunction ThemeSection(props: {\n title: string\n description: string\n themes: ReturnType<typeof themesForAppearance>\n selectedId: string\n onThemeSelect: (theme: ReturnType<typeof themesForAppearance>[number]) => void\n}) {\n return (\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n {props.title}\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">{props.description}</p>\n </header>\n <ThemePicker\n themes={props.themes}\n selectedId={props.selectedId}\n onThemeSelect={props.onThemeSelect}\n />\n </section>\n )\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"appearance-panel.js","names":["ComponentProps","Show","onMount","splitProps","RadioGroup","Radio","accentPresets","isPresetAccentId","DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS","THEME_DEFAULT_ID","ThemeAppearance","ThemeVariant","cn","AccentSwatchGroups","AppearanceFontSettingsGroup","RadioGroupItem","ThemePicker","useTheme","Heading","AppearancePanelProps","AppearancePanel","props","local","rest","context","selection","setSelection","resolvedAppearance","themeAccents","loadCatalogue","themesFor","appearance","themes","filter","variant","selectedAccent","accent","some","option","id","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","_el$5","nextSibling","_el$6","_el$7","_el$8","_el$9","_el$0","_$spread","_$mergeProps","class","_$insert","_$createComponent","as","size","children","value","onChange","label","description","when","ThemeSection","title","selectedId","lightThemeId","onThemeSelect","theme","darkThemeId","orientation","accentOptions","themeDefaultColor","settings","fonts","_el$1","_tmpl$2","_el$10","_el$11","_$mergeProps","_$createComponent","RadioGroup","Radio"],"sources":["../../../src/components/theme/appearance-panel.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { Show, onMount, splitProps } from 'solid-js'\nimport { RadioGroup as Radio } from '@kobalte/core/radio-group'\nimport { accentPresets, isPresetAccentId } from '#lib/accent-presets'\nimport { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from '#lib/appearance-font-settings'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\nimport type { ThemeAppearance, ThemeVariant } from '#lib/theme-types'\nimport { cn } from '#lib/utils'\n// Direct modules, not the appearance-editor barrel, which would load the whole\n// editor, its sheet and its switch into every theme import (lint allows these two).\nimport { AccentSwatchGroups } from '../composites/appearance-editor/accent-swatch-groups'\nimport { AppearanceFontSettingsGroup } from '../composites/appearance-editor/font-settings-group'\nimport { RadioGroup, RadioGroupItem } from '../ui/radio-group'\nimport { ThemePicker } from './theme-picker'\nimport { useTheme } from './theme-context'\nimport { Heading } from '../ui/typography'\n\n/**\n * AppearancePanel.\n *\n * The appearance page, as a component rather than as a screen each application\n * draws for itself. Two applications that both let a user choose a theme should\n * offer the *same* choices in the *same* arrangement — otherwise \"Adea\" and\n * \"Cortana\" are two products that happen to share a component library, which is\n * the opposite of what this system is for.\n *\n * Four axes, in the order a user thinks about them:\n *\n * 1. **Appearance** — light, dark, or follow the system.\n * 2. **Themes** — one for each appearance. Both are shown at once, because the\n * choice is per-appearance and hiding the other half makes it feel like one\n * setting that keeps changing.\n * 3. **Accent** — adea's presets, then the accents the selected theme pair\n * carries itself, layered on whichever theme is active.\n * 4. **Fonts** — separate families and sizes for interface, content and code.\n *\n * The panel reads and writes the provider's preference and keeps no state of its\n * own, so it cannot disagree with what is applied. Its themes are the provider's, so\n * under the lazy provider it asks for the catalogue when it mounts and lists the rest\n * when it arrives.\n */\nexport type AppearancePanelProps = ComponentProps<'div'>\n\nexport function AppearancePanel(props: AppearancePanelProps) {\n const [local, rest] = splitProps(props, ['class'])\n const context = useTheme()\n const { selection, setSelection, resolvedAppearance, themeAccents } = context\n onMount(() => void context.loadCatalogue?.())\n const themesFor = (appearance: ThemeAppearance) =>\n context.themes.filter((variant) => variant.appearance === appearance)\n const selectedAccent = () => {\n const accent = selection().accent\n return accent === THEME_DEFAULT_ID ||\n isPresetAccentId(accent) ||\n themeAccents().some((option) => option.id === accent)\n ? accent\n : THEME_DEFAULT_ID\n }\n\n return (\n <div data-slot=\"appearance-panel\" class={cn('flex flex-col gap-8', local.class)} {...rest}>\n {/* --- 1. Appearance ------------------------------------------------- */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Appearance\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Follow the system, or pin one. The theme below is chosen per appearance, so switching at\n sunset does not make you choose again.\n </p>\n </header>\n <RadioGroup\n value={selection().appearance}\n onChange={(value) => setSelection({ appearance: value as 'light' | 'dark' | 'system' })}\n aria-label=\"Appearance\"\n >\n <RadioGroupItem value=\"light\" label=\"Light\" description=\"Always the light theme.\" />\n <RadioGroupItem value=\"dark\" label=\"Dark\" description=\"Always the dark theme.\" />\n <RadioGroupItem\n value=\"system\"\n label=\"Match the system\"\n description={`Currently resolving to ${resolvedAppearance()}.`}\n />\n </RadioGroup>\n </section>\n\n {/* --- 2. Themes ------------------------------------------------------ */}\n <Show when={resolvedAppearance() === 'light'}>\n <ThemeSection\n title=\"Light theme\"\n description=\"Shown when the appearance resolves to light.\"\n themes={themesFor('light')}\n selectedId={selection().lightThemeId}\n onThemeSelect={(theme) => setSelection({ lightThemeId: theme.id })}\n />\n </Show>\n <Show when={resolvedAppearance() === 'dark'}>\n <ThemeSection\n title=\"Dark theme\"\n description=\"Shown when the appearance resolves to dark.\"\n themes={themesFor('dark')}\n selectedId={selection().darkThemeId}\n onThemeSelect={(theme) => setSelection({ darkThemeId: theme.id })}\n />\n </Show>\n\n {/* --- 3. Accent ------------------------------------------------------ */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Accent\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Colours the interactive roles — the primary button, the focus ring, a selected row — on\n top of the theme above — one of the presets, or a colour the theme carries itself. Every\n option is measured against the surface it lands on, so none of them can make a label\n unreadable.\n </p>\n </header>\n <Radio\n value={selectedAccent()}\n onChange={(accent) => setSelection({ accent })}\n orientation=\"horizontal\"\n aria-label=\"Accent\"\n class=\"flex flex-col items-start gap-3\"\n >\n <AccentSwatchGroups\n accentOptions={accentPresets}\n resolvedAppearance={resolvedAppearance()}\n themeDefaultColor=\"var(--primary)\"\n />\n </Radio>\n </section>\n\n {/* --- 4. Fonts ------------------------------------------------------- */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Fonts\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Choose separate families and sizes for the interface, reading, and code. Font families\n come from the shared catalogue and are self-hosted.\n </p>\n </header>\n <AppearanceFontSettingsGroup\n settings={selection().fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n onChange={(fonts) => setSelection({ fonts })}\n />\n </section>\n </div>\n )\n}\n\nfunction ThemeSection(props: {\n title: string\n description: string\n themes: readonly ThemeVariant[]\n selectedId: string\n onThemeSelect: (theme: ThemeVariant) => void\n}) {\n return (\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n {props.title}\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">{props.description}</p>\n </header>\n <ThemePicker\n themes={props.themes}\n selectedId={props.selectedId}\n onThemeSelect={props.onThemeSelect}\n />\n </section>\n )\n}\n"],"mappings":"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"}
@@ -1,6 +1,6 @@
1
1
  export { AppearancePanel, type AppearancePanelProps } from './appearance-panel';
2
2
  export { ThemePicker, ThemePreview, ThemeSwatch, type ThemePickerProps, type ThemePreviewProps, type ThemeSwatchProps, } from './theme-picker';
3
- export { ThemeProvider, createVersionedPersistence, defaultThemeSelection, inlineScriptLiteral, localStoragePersistence, resolvedDensity, themeScript, useOptionalTheme, useTheme, type EditorRolesMode, type ThemeContextValue, type ThemeDensity, type ThemePersistence, type ThemeProviderProps, type ThemeScriptOptions, type ThemeSelection, type ThemeStorageSchema, type ThemeSurface, type VersionedCodec, type VersionedPersistenceOptions, } from './theme-provider';
3
+ export * from './theme-provider';
4
4
  export { ThemeToggle, type ThemeToggleProps } from './theme-toggle';
5
5
  export { ThemeModeToggle, type ThemeModeToggleProps } from './theme-mode-toggle';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,2BAA2B,GACjC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -1,10 +1,11 @@
1
+ import { safeScriptStringLiteral } from "../../lib/safe-script.js";
1
2
  import { AppearancePanel } from "./appearance-panel.js";
2
3
  import { useOptionalTheme, useTheme } from "./theme-context.js";
3
- import { defaultThemeSelection, resolvedDensity } from "./theme-state-core.js";
4
- import { createVersionedPersistence, localStoragePersistence } from "./theme-persistence.js";
5
- import { inlineScriptLiteral, themeScript } from "./theme-script.js";
6
4
  import { ThemePicker, ThemePreview, ThemeSwatch } from "./theme-picker.js";
5
+ import { defaultThemeSelection, resolvedDensity } from "./theme-state.js";
6
+ import { createVersionedPersistence, localStoragePersistence } from "./theme-persistence.js";
7
+ import { themeScript } from "./theme-script.js";
7
8
  import { ThemeProvider } from "./theme-provider.js";
8
9
  import { ThemeToggle } from "./theme-toggle.js";
9
10
  import { ThemeModeToggle } from "./theme-mode-toggle.js";
10
- export { AppearancePanel, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, createVersionedPersistence, defaultThemeSelection, inlineScriptLiteral, localStoragePersistence, resolvedDensity, themeScript, useOptionalTheme, useTheme };
11
+ export { AppearancePanel, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, createVersionedPersistence, defaultThemeSelection, safeScriptStringLiteral as inlineScriptLiteral, localStoragePersistence, resolvedDensity, themeScript, useOptionalTheme, useTheme };
@@ -1,15 +1,41 @@
1
+ import { type JSX } from 'solid-js';
2
+ import { type ThemeProviderProps } from './theme-provider-value';
1
3
  /**
2
4
  * The theme provider with the catalogue out of the start-up path.
3
5
  *
4
6
  * Everything here is free of the 34-theme catalogue: `import` this entry instead of
5
7
  * `@adea-ai/ui/components/theme` in a host that paints its theme from a stylesheet.
6
- * The catalogue loads, in a chunk of its own, the first time a stored or previewed
7
- * theme needs it. See {@link ThemeProvider} for the rules and `docs/consumption.md`
8
- * for the setup.
8
+ * See {@link ThemeProvider} for the rules and `docs/consumption.md` for the setup.
9
9
  */
10
+ export * from './theme-api';
10
11
  export { loadThemeCatalogue } from './theme-catalogue-source';
11
- export { ThemeProvider } from './theme-provider-lazy';
12
- export { createVersionedPersistence, defaultThemeSelection, inlineScriptLiteral, localStoragePersistence, resolvedDensity, themeScript, useOptionalTheme, useTheme, type EditorRolesMode, type ThemeCatalogueSource, type ThemeContextValue, type ThemeDensity, type ThemePersistence, type ThemeProviderProps, type ThemeScriptOptions, type ThemeSelection, type ThemeStorageSchema, type ThemeSurface, type VersionedCodec, type VersionedPersistenceOptions, } from './theme-provider-core';
12
+ export type { ThemeCatalogueSource } from './theme-provider-value';
13
13
  export { ThemeToggle, type ThemeToggleProps } from './theme-toggle';
14
14
  export { ThemeModeToggle, type ThemeModeToggleProps } from './theme-mode-toggle';
15
+ /**
16
+ * ThemeProvider, with the theme catalogue out of the start-up path.
17
+ *
18
+ * Same props, same context and same behaviour as `ThemeProvider` for everything the
19
+ * shipped default pair covers: the default light and dark themes, a host's own
20
+ * `themes`, every accent preset and custom colour, the surface axis, fonts and
21
+ * density. Only the 32 other catalogue themes are not in the start-up chunk. The first
22
+ * time the selection (or a preview) names one, or a theme-derived `ansi-*` accent over
23
+ * such a pair, this provider imports the catalogue in a chunk of its own:
24
+ *
25
+ * - until it arrives the document keeps what is on it (set before first paint by
26
+ * `themeScript`, painted by the stylesheet under `palette="stylesheet"`), and
27
+ * `variant()` is the default of the appearance;
28
+ * - when it arrives the provider re-resolves and paints the stored theme, and
29
+ * `useTheme().catalogueReady()` turns true;
30
+ * - a preview of a theme that has not loaded starts the load and shows when it ends.
31
+ *
32
+ * Pair it with `palette="stylesheet"` and `themeScript`: inline palettes of catalogue
33
+ * themes need the catalogue to compute, so under the default `inline` palette every
34
+ * stored theme but the defaults waits for the import.
35
+ *
36
+ * `useTheme().themes` and `allThemes()` list only the default pair until
37
+ * `catalogueReady()`; a picker calls `useTheme().loadCatalogue()` when it mounts, as
38
+ * `AppearancePanel` does.
39
+ */
40
+ export declare function ThemeProvider(props: ThemeProviderProps): JSX.Element;
15
41
  //# sourceMappingURL=lazy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../src/components/theme/lazy.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,2BAA2B,GACjC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../src/components/theme/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAEhE,OAAO,EAAqB,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEnF;;;;;;GAMG;AACH,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAEpE"}
@@ -1,9 +1,42 @@
1
- import { loadThemeCatalogue } from "./theme-catalogue-source.js";
2
- import { ThemeProvider } from "./theme-provider-lazy.js";
3
- import { createVersionedPersistence, localStoragePersistence } from "./theme-persistence.js";
4
- import { defaultThemeSelection, resolvedDensity } from "./theme-state-core.js";
5
- import { inlineScriptLiteral, themeScript } from "./theme-script.js";
1
+ import { safeScriptStringLiteral } from "../../lib/safe-script.js";
6
2
  import { useOptionalTheme, useTheme } from "./theme-context.js";
3
+ import { defaultThemeSelection, resolvedDensity } from "./theme-state.js";
4
+ import { createVersionedPersistence, localStoragePersistence } from "./theme-persistence.js";
5
+ import { createLazyCatalogue, loadThemeCatalogue } from "./theme-catalogue-source.js";
6
+ import { themeScript } from "./theme-script.js";
7
+ import { ThemeProviderWith } from "./theme-provider-value.js";
7
8
  import { ThemeToggle } from "./theme-toggle.js";
8
9
  import { ThemeModeToggle } from "./theme-mode-toggle.js";
9
- export { ThemeModeToggle, ThemeProvider, ThemeToggle, createVersionedPersistence, defaultThemeSelection, inlineScriptLiteral, loadThemeCatalogue, localStoragePersistence, resolvedDensity, themeScript, useOptionalTheme, useTheme };
10
+ import { createComponent, mergeProps } from "solid-js";
11
+ // src/components/theme/lazy.ts
12
+ /**
13
+ * ThemeProvider, with the theme catalogue out of the start-up path.
14
+ *
15
+ * Same props, same context and same behaviour as `ThemeProvider` for everything the
16
+ * shipped default pair covers: the default light and dark themes, a host's own
17
+ * `themes`, every accent preset and custom colour, the surface axis, fonts and
18
+ * density. Only the 32 other catalogue themes are not in the start-up chunk. The first
19
+ * time the selection (or a preview) names one, or a theme-derived `ansi-*` accent over
20
+ * such a pair, this provider imports the catalogue in a chunk of its own:
21
+ *
22
+ * - until it arrives the document keeps what is on it (set before first paint by
23
+ * `themeScript`, painted by the stylesheet under `palette="stylesheet"`), and
24
+ * `variant()` is the default of the appearance;
25
+ * - when it arrives the provider re-resolves and paints the stored theme, and
26
+ * `useTheme().catalogueReady()` turns true;
27
+ * - a preview of a theme that has not loaded starts the load and shows when it ends.
28
+ *
29
+ * Pair it with `palette="stylesheet"` and `themeScript`: inline palettes of catalogue
30
+ * themes need the catalogue to compute, so under the default `inline` palette every
31
+ * stored theme but the defaults waits for the import.
32
+ *
33
+ * `useTheme().themes` and `allThemes()` list only the default pair until
34
+ * `catalogueReady()`; a picker calls `useTheme().loadCatalogue()` when it mounts, as
35
+ * `AppearancePanel` does.
36
+ */
37
+ function ThemeProvider(props) {
38
+ return createComponent(ThemeProviderWith, mergeProps(props, { catalogue: createLazyCatalogue() }));
39
+ }
40
+ export { ThemeModeToggle, ThemeProvider, ThemeToggle, createVersionedPersistence, defaultThemeSelection, safeScriptStringLiteral as inlineScriptLiteral, loadThemeCatalogue, localStoragePersistence, resolvedDensity, themeScript, useOptionalTheme, useTheme };
41
+
42
+ //# sourceMappingURL=lazy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy.js","names":[],"sources":["../../../src/components/theme/lazy.ts"],"sourcesContent":["import { createComponent, mergeProps, type JSX } from 'solid-js'\nimport { createLazyCatalogue } from './theme-catalogue-source'\nimport { ThemeProviderWith, type ThemeProviderProps } from './theme-provider-value'\n\n/**\n * The theme provider with the catalogue out of the start-up path.\n *\n * Everything here is free of the 34-theme catalogue: `import` this entry instead of\n * `@adea-ai/ui/components/theme` in a host that paints its theme from a stylesheet.\n * See {@link ThemeProvider} for the rules and `docs/consumption.md` for the setup.\n */\nexport * from './theme-api'\nexport { loadThemeCatalogue } from './theme-catalogue-source'\nexport type { ThemeCatalogueSource } from './theme-provider-value'\nexport { ThemeToggle, type ThemeToggleProps } from './theme-toggle'\nexport { ThemeModeToggle, type ThemeModeToggleProps } from './theme-mode-toggle'\n\n/**\n * ThemeProvider, with the theme catalogue out of the start-up path.\n *\n * Same props, same context and same behaviour as `ThemeProvider` for everything the\n * shipped default pair covers: the default light and dark themes, a host's own\n * `themes`, every accent preset and custom colour, the surface axis, fonts and\n * density. Only the 32 other catalogue themes are not in the start-up chunk. The first\n * time the selection (or a preview) names one, or a theme-derived `ansi-*` accent over\n * such a pair, this provider imports the catalogue in a chunk of its own:\n *\n * - until it arrives the document keeps what is on it (set before first paint by\n * `themeScript`, painted by the stylesheet under `palette=\"stylesheet\"`), and\n * `variant()` is the default of the appearance;\n * - when it arrives the provider re-resolves and paints the stored theme, and\n * `useTheme().catalogueReady()` turns true;\n * - a preview of a theme that has not loaded starts the load and shows when it ends.\n *\n * Pair it with `palette=\"stylesheet\"` and `themeScript`: inline palettes of catalogue\n * themes need the catalogue to compute, so under the default `inline` palette every\n * stored theme but the defaults waits for the import.\n *\n * `useTheme().themes` and `allThemes()` list only the default pair until\n * `catalogueReady()`; a picker calls `useTheme().loadCatalogue()` when it mounts, as\n * `AppearancePanel` does.\n */\nexport function ThemeProvider(props: ThemeProviderProps): JSX.Element {\n return createComponent(ThemeProviderWith, mergeProps(props, { catalogue: createLazyCatalogue() }))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,cAAc,OAAwC;CACpE,OAAO,gBAAgB,mBAAmB,WAAW,OAAO,EAAE,WAAW,oBAAoB,EAAE,CAAC,CAAC;AACnG"}
@@ -0,0 +1,17 @@
1
+ import { inlineScriptLiteral, type ThemeScriptOptions as BaseThemeScriptOptions, type ThemeTokenProjectionFallback } from './theme-script';
2
+ import type { ThemeTokenProjection } from './token-projection';
3
+ /** Options for the projection-enabled boot script. */
4
+ export type ThemeScriptOptions = Omit<BaseThemeScriptOptions, 'libraryKey'> & {
5
+ libraryKey: string;
6
+ tokenProjection: ThemeTokenProjection;
7
+ /** Optional serialized-record sources for projection tokens omitted by flatTokens. */
8
+ tokenProjectionFallbacks?: readonly ThemeTokenProjectionFallback[];
9
+ };
10
+ /** Alias that makes the opt-in projection requirement explicit at call sites. */
11
+ export type ThemeScriptProjectionOptions = ThemeScriptOptions;
12
+ /** Emit a no-flash script with the same projector used by provider hydration. */
13
+ export declare function themeScript(options: ThemeScriptOptions): string;
14
+ export { inlineScriptLiteral };
15
+ export type { ThemeTokenProjectionFallback };
16
+ export type { ThemeStorageSchema } from './theme-persistence';
17
+ //# sourceMappingURL=script-projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-projection.d.ts","sourceRoot":"","sources":["../../../src/components/theme/script-projection.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,mBAAmB,EAEnB,KAAK,kBAAkB,IAAI,sBAAsB,EACjD,KAAK,4BAA4B,EAClC,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAI9D,sDAAsD;AACtD,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,sBAAsB,EAAE,YAAY,CAAC,GAAG;IAC5E,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,oBAAoB,CAAA;IACrC,sFAAsF;IACtF,wBAAwB,CAAC,EAAE,SAAS,4BAA4B,EAAE,CAAA;CACnE,CAAA;AAED,iFAAiF;AACjF,MAAM,MAAM,4BAA4B,GAAG,kBAAkB,CAAA;AAE7D,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAO/D;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA;AAC9B,YAAY,EAAE,4BAA4B,EAAE,CAAA;AAC5C,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { safeScriptStringLiteral } from "../../lib/safe-script.js";
2
+ import { themeScriptWithProjection } from "./theme-script.js";
3
+ import { themeTokenProjectionBundle } from "@adea-ai/themes/theme-token-projection/script";
4
+ // src/components/theme/script-projection.ts
5
+ /**
6
+ * Opt-in no-flash script entry that can project imported token maps synchronously.
7
+ * Import this path only when the host supplies declarative projection rules; the
8
+ * ordinary `components/theme/script` entry stays free of the browser bundle.
9
+ */
10
+ var tokenProjectionFallbackScript = `if(storedTheme&&tokenProjectionFallbacks.length){var sourceTokens=Object.create(null);for(var sourceName in tokens){if(Object.prototype.hasOwnProperty.call(tokens,sourceName))sourceTokens[sourceName]=tokens[sourceName]}for(var fi=0;fi<tokenProjectionFallbacks.length;fi++){var fallbackToken=tokenProjectionFallbacks[fi];if(!fallbackToken||typeof fallbackToken.token!=='string'||!/^--[A-Za-z0-9_-]+$/.test(fallbackToken.token)||Object.prototype.hasOwnProperty.call(sourceTokens,fallbackToken.token)||!Array.isArray(fallbackToken.path)||fallbackToken.path.length===0)continue;var sourceValue=storedTheme;for(var pi=0;pi<fallbackToken.path.length;pi++){var pathKey=fallbackToken.path[pi];if(typeof pathKey!=='string'||!sourceValue||typeof sourceValue!=='object'||!Object.prototype.hasOwnProperty.call(sourceValue,pathKey)){sourceValue=undefined;break}sourceValue=sourceValue[pathKey]}if(typeof sourceValue==='string')sourceTokens[fallbackToken.token]=sourceValue}tokens=sourceTokens}`;
11
+ /** Emit a no-flash script with the same projector used by provider hydration. */
12
+ function themeScript(options) {
13
+ return themeScriptWithProjection(options, options.tokenProjection, themeTokenProjectionBundle, tokenProjectionFallbackScript);
14
+ }
15
+ export { safeScriptStringLiteral as inlineScriptLiteral, themeScript };
16
+
17
+ //# sourceMappingURL=script-projection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-projection.js","names":[],"sources":["../../../src/components/theme/script-projection.ts"],"sourcesContent":["/**\n * Opt-in no-flash script entry that can project imported token maps synchronously.\n * Import this path only when the host supplies declarative projection rules; the\n * ordinary `components/theme/script` entry stays free of the browser bundle.\n */\nimport { themeTokenProjectionBundle } from '@adea-ai/themes/theme-token-projection/script'\nimport {\n inlineScriptLiteral,\n themeScriptWithProjection,\n type ThemeScriptOptions as BaseThemeScriptOptions,\n type ThemeTokenProjectionFallback,\n} from './theme-script'\nimport type { ThemeTokenProjection } from './token-projection'\n\nconst tokenProjectionFallbackScript = `if(storedTheme&&tokenProjectionFallbacks.length){var sourceTokens=Object.create(null);for(var sourceName in tokens){if(Object.prototype.hasOwnProperty.call(tokens,sourceName))sourceTokens[sourceName]=tokens[sourceName]}for(var fi=0;fi<tokenProjectionFallbacks.length;fi++){var fallbackToken=tokenProjectionFallbacks[fi];if(!fallbackToken||typeof fallbackToken.token!=='string'||!/^--[A-Za-z0-9_-]+$/.test(fallbackToken.token)||Object.prototype.hasOwnProperty.call(sourceTokens,fallbackToken.token)||!Array.isArray(fallbackToken.path)||fallbackToken.path.length===0)continue;var sourceValue=storedTheme;for(var pi=0;pi<fallbackToken.path.length;pi++){var pathKey=fallbackToken.path[pi];if(typeof pathKey!=='string'||!sourceValue||typeof sourceValue!=='object'||!Object.prototype.hasOwnProperty.call(sourceValue,pathKey)){sourceValue=undefined;break}sourceValue=sourceValue[pathKey]}if(typeof sourceValue==='string')sourceTokens[fallbackToken.token]=sourceValue}tokens=sourceTokens}`\n\n/** Options for the projection-enabled boot script. */\nexport type ThemeScriptOptions = Omit<BaseThemeScriptOptions, 'libraryKey'> & {\n libraryKey: string\n tokenProjection: ThemeTokenProjection\n /** Optional serialized-record sources for projection tokens omitted by flatTokens. */\n tokenProjectionFallbacks?: readonly ThemeTokenProjectionFallback[]\n}\n\n/** Alias that makes the opt-in projection requirement explicit at call sites. */\nexport type ThemeScriptProjectionOptions = ThemeScriptOptions\n\n/** Emit a no-flash script with the same projector used by provider hydration. */\nexport function themeScript(options: ThemeScriptOptions): string {\n return themeScriptWithProjection(\n options,\n options.tokenProjection,\n themeTokenProjectionBundle,\n tokenProjectionFallbackScript\n )\n}\n\nexport { inlineScriptLiteral }\nexport type { ThemeTokenProjectionFallback }\nexport type { ThemeStorageSchema } from './theme-persistence'\n"],"mappings":";;;;;;;;;AAcA,IAAM,gCAAgC;;AActC,SAAgB,YAAY,SAAqC;CAC/D,OAAO,0BACL,SACA,QAAQ,iBACR,4BACA,6BACF;AACF"}
@@ -1 +1,3 @@
1
- export { inlineScriptLiteral, themeScript } from "./theme-script.js";
1
+ import { safeScriptStringLiteral } from "../../lib/safe-script.js";
2
+ import { themeScript } from "./theme-script.js";
3
+ export { safeScriptStringLiteral as inlineScriptLiteral, themeScript };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * What both provider entries export beside their `ThemeProvider`: the context hooks,
3
+ * the persistence, the boot script and the selection types. One list, so the eager
4
+ * entry (`./index.ts` via `./theme-provider`) and the lazy one (`./lazy.ts`) cannot
5
+ * drift. Nothing here imports the catalogue.
6
+ */
7
+ export { useOptionalTheme, useTheme } from './theme-context';
8
+ export { createVersionedPersistence, localStoragePersistence, type ThemePersistence, type VersionedCodec, type VersionedPersistenceOptions, } from './theme-persistence';
9
+ export { inlineScriptLiteral, themeScript, type ThemeScriptOptions, type ThemeStorageSchema, } from './script';
10
+ export { defaultThemeSelection, resolvedDensity, type ThemeContextValue, type ThemeDensity, type ThemeSelection, } from './theme-state';
11
+ export type { ThemeProviderProps } from './theme-provider-value';
12
+ export type { ThemeSurface } from '#lib/theme-surface';
13
+ export type { EditorRolesMode } from '#lib/theme-types';
14
+ //# sourceMappingURL=theme-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-api.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,2BAA2B,GACjC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,eAAe,CAAA;AACtB,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"theme-catalogue-source.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-catalogue-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAUlE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,WAAW,CAAC,CAazD;AAED,yFAAyF;AACzF,wBAAgB,mBAAmB,IAAI,oBAAoB,CAoB1D"}
1
+ {"version":3,"file":"theme-catalogue-source.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-catalogue-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAUlE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,WAAW,CAAC,CAazD;AAED,yFAAyF;AACzF,wBAAgB,mBAAmB,IAAI,oBAAoB,CAqB1D"}
@@ -1,4 +1,4 @@
1
- import { lightThemeEngine } from "../../lib/theme-engine-light.js";
1
+ import { createLightThemeEngine } from "../../lib/theme-engine-light.js";
2
2
  import { createSignal } from "solid-js";
3
3
  // src/components/theme/theme-catalogue-source.ts
4
4
  /**
@@ -38,8 +38,9 @@ function createLazyCatalogue() {
38
38
  }, () => {
39
39
  setFailed(true);
40
40
  });
41
+ const shipped = createLightThemeEngine(() => void load());
41
42
  return {
42
- engine: () => full() ?? lightThemeEngine,
43
+ engine: () => full() ?? shipped,
43
44
  loaded: () => full() !== void 0,
44
45
  failed,
45
46
  load
@@ -1 +1 @@
1
- {"version":3,"file":"theme-catalogue-source.js","names":[],"sources":["../../../src/components/theme/theme-catalogue-source.ts"],"sourcesContent":["import { createSignal } from 'solid-js'\nimport type { ThemeEngine } from '#lib/theme-engine'\nimport { lightThemeEngine } from '#lib/theme-engine-light'\nimport type { ThemeCatalogueSource } from './theme-provider-value'\n\n/**\n * The full catalogue engine once something has asked for it, shared by every lazy\n * provider and every caller of {@link loadThemeCatalogue} in the page. A provider\n * created after the load starts with it already in hand.\n */\nlet loadedEngine: ThemeEngine | undefined\nlet loading: Promise<ThemeEngine> | undefined\n\n/**\n * Load the whole theme catalogue (about 129 KB raw, 34 KB gzipped) and resolve to the\n * engine backed by it. Idempotent: every call shares one import, and a failed import is\n * forgotten so the next call retries.\n *\n * The lazy provider calls this itself the moment a selection needs a theme beyond the\n * default pair. Call it earlier — when a settings page mounts, or on hover of its\n * entry — to have the picker ready by the time it opens.\n */\nexport function loadThemeCatalogue(): Promise<ThemeEngine> {\n if (loadedEngine) return Promise.resolve(loadedEngine)\n loading ??= import('#lib/theme-catalogue').then(\n (module) => {\n loadedEngine = module.catalogueThemeEngine\n return loadedEngine\n },\n (error: unknown) => {\n loading = undefined\n throw error\n }\n )\n return loading\n}\n\n/** A catalogue source for one provider: the shipped defaults until the load resolves. */\nexport function createLazyCatalogue(): ThemeCatalogueSource {\n const [full, setFull] = createSignal<ThemeEngine | undefined>(loadedEngine)\n const [failed, setFailed] = createSignal(false)\n const load = () =>\n loadThemeCatalogue().then(\n (loaded) => {\n setFailed(false)\n setFull(() => loaded)\n },\n () => {\n // The theme the stylesheet painted stays; the next request retries.\n setFailed(true)\n }\n )\n return {\n engine: () => full() ?? lightThemeEngine,\n loaded: () => full() !== undefined,\n failed,\n load,\n }\n}\n"],"mappings":";;;;;;;;AAUA,IAAI;AACJ,IAAI;;;;;;;;;;AAWJ,SAAgB,qBAA2C;CACzD,IAAI,cAAc,OAAO,QAAQ,QAAQ,YAAY;CACrD,YAAY,OAAO,+BAAuB,CAAC,MACxC,WAAW;EACV,eAAe,OAAO;EACtB,OAAO;CACT,IACC,UAAmB;EAClB,UAAU,KAAA;EACV,MAAM;CACR,CACF;CACA,OAAO;AACT;;AAGA,SAAgB,sBAA4C;CAC1D,MAAM,CAAC,MAAM,WAAW,aAAsC,YAAY;CAC1E,MAAM,CAAC,QAAQ,aAAa,aAAa,KAAK;CAC9C,MAAM,aACJ,mBAAmB,CAAC,CAAC,MAClB,WAAW;EACV,UAAU,KAAK;EACf,cAAc,MAAM;CACtB,SACM;EAEJ,UAAU,IAAI;CAChB,CACF;CACF,OAAO;EACL,cAAc,KAAK,KAAK;EACxB,cAAc,KAAK,MAAM,KAAA;EACzB;EACA;CACF;AACF"}
1
+ {"version":3,"file":"theme-catalogue-source.js","names":[],"sources":["../../../src/components/theme/theme-catalogue-source.ts"],"sourcesContent":["import { createSignal } from 'solid-js'\nimport type { ThemeEngine } from '#lib/theme-engine'\nimport { createLightThemeEngine } from '#lib/theme-engine-light'\nimport type { ThemeCatalogueSource } from './theme-provider-value'\n\n/**\n * The full catalogue engine once something has asked for it, shared by every lazy\n * provider and every caller of {@link loadThemeCatalogue} in the page. A provider\n * created after the load starts with it already in hand.\n */\nlet loadedEngine: ThemeEngine | undefined\nlet loading: Promise<ThemeEngine> | undefined\n\n/**\n * Load the whole theme catalogue (about 129 KB raw, 34 KB gzipped) and resolve to the\n * engine backed by it. Idempotent: every call shares one import, and a failed import is\n * forgotten so the next call retries.\n *\n * The lazy provider calls this itself the moment a selection needs a theme beyond the\n * default pair. Call it earlier — when a settings page mounts, or on hover of its\n * entry — to have the picker ready by the time it opens.\n */\nexport function loadThemeCatalogue(): Promise<ThemeEngine> {\n if (loadedEngine) return Promise.resolve(loadedEngine)\n loading ??= import('#lib/theme-catalogue').then(\n (module) => {\n loadedEngine = module.catalogueThemeEngine\n return loadedEngine\n },\n (error: unknown) => {\n loading = undefined\n throw error\n }\n )\n return loading\n}\n\n/** A catalogue source for one provider: the shipped defaults until the load resolves. */\nexport function createLazyCatalogue(): ThemeCatalogueSource {\n const [full, setFull] = createSignal<ThemeEngine | undefined>(loadedEngine)\n const [failed, setFailed] = createSignal(false)\n const load = () =>\n loadThemeCatalogue().then(\n (loaded) => {\n setFailed(false)\n setFull(() => loaded)\n },\n () => {\n // The theme the stylesheet painted stays; the next request retries.\n setFailed(true)\n }\n )\n const shipped = createLightThemeEngine(() => void load())\n return {\n engine: () => full() ?? shipped,\n loaded: () => full() !== undefined,\n failed,\n load,\n }\n}\n"],"mappings":";;;;;;;;AAUA,IAAI;AACJ,IAAI;;;;;;;;;;AAWJ,SAAgB,qBAA2C;CACzD,IAAI,cAAc,OAAO,QAAQ,QAAQ,YAAY;CACrD,YAAY,OAAO,+BAAuB,CAAC,MACxC,WAAW;EACV,eAAe,OAAO;EACtB,OAAO;CACT,IACC,UAAmB;EAClB,UAAU,KAAA;EACV,MAAM;CACR,CACF;CACA,OAAO;AACT;;AAGA,SAAgB,sBAA4C;CAC1D,MAAM,CAAC,MAAM,WAAW,aAAsC,YAAY;CAC1E,MAAM,CAAC,QAAQ,aAAa,aAAa,KAAK;CAC9C,MAAM,aACJ,mBAAmB,CAAC,CAAC,MAClB,WAAW;EACV,UAAU,KAAK;EACf,cAAc,MAAM;CACtB,SACM;EAEJ,UAAU,IAAI;CAChB,CACF;CACF,MAAM,UAAU,6BAA6B,KAAK,KAAK,CAAC;CACxD,OAAO;EACL,cAAc,KAAK,KAAK;EACxB,cAAc,KAAK,MAAM,KAAA;EACzB;EACA;CACF;AACF"}
@@ -1,18 +1,120 @@
1
- import { type ThemeDocumentOptions, type ThemeDocumentState, type ThemeRoot } from './theme-document-core';
2
- export { applyWithoutTransitions, type ThemeDocumentOptions, type ThemeDocumentState, type ThemeRoot, type TransitionDocument, } from './theme-document-core';
1
+ import type { ThemeTokenProjectionOptions } from './token-projection';
2
+ import type { ThemeEngine } from '#lib/theme-engine';
3
+ import type { EditorRolesMode, ThemeAppearance, ThemeVariant } from '#lib/theme-types';
4
+ import { type SurfaceState } from '#lib/theme-surface';
5
+ import { type ThemeSelection } from './theme-state';
3
6
  /**
4
- * The custom properties a state paints, resolved against the whole catalogue: the
5
- * variant's roles, with the accent selection laid over them, the pinned terminal
6
- * palette over that, the surface alpha, then `transformTokens`. See
7
- * {@link themeDocumentTokensWith} for the rules.
7
+ * The document half of the theme provider: the single writer of `<html>`.
8
+ *
9
+ * Written against the few members of an element it uses, so the rules can be tested
10
+ * on a stand-in. Every question the catalogue answers goes through the
11
+ * {@link ThemeEngine} it is given, so it imports no catalogue code or data.
8
12
  */
9
- export declare function themeDocumentTokens(state: ThemeDocumentState, options?: ThemeDocumentOptions): {
13
+ export type ThemeRoot = Pick<HTMLElement, 'classList' | 'dataset' | 'style' | 'removeAttribute' | 'setAttribute'>;
14
+ export type ThemeDocumentState = {
15
+ /** What the document shows: the committed selection, or a preview laid over it. */
16
+ selection: ThemeSelection;
17
+ appearance: ThemeAppearance;
18
+ variant: ThemeVariant;
19
+ /**
20
+ * The variant whose terminal palette is pinned over the interface variant's.
21
+ * Absent, the terminal follows the interface theme.
22
+ */
23
+ terminalVariant?: ThemeVariant;
24
+ /**
25
+ * The resolved surface axis. Absent, the axis is off: no attribute and no
26
+ * `--surface-alpha` is written, and any this writer wrote before is removed.
27
+ */
28
+ surface?: SurfaceState;
29
+ };
30
+ export type ThemeDocumentOptions = {
31
+ /**
32
+ * Rewrites the custom properties just before they are written: the variant's
33
+ * roles with the accent laid over them. It sees every property of the pass and
34
+ * must return the full map; a name it drops is not written.
35
+ */
36
+ transformTokens?: (tokens: Record<string, string>) => Record<string, string>;
37
+ /**
38
+ * The contrast an accent is held to against the variant's background. Absent, a
39
+ * preset is painted verbatim (the catalogue measured it for its own themes) and
40
+ * only a custom `#rrggbb` is held to the default floor of 3:1.
41
+ */
42
+ accentContrastFloor?: number;
43
+ /**
44
+ * Where a catalogue variant's palette comes from. `inline` (the default) writes
45
+ * every role onto the root. `stylesheet` writes none for a catalogue variant,
46
+ * because the host loads a stylesheet that carries a `[data-theme]` block for it;
47
+ * a variant the catalogue does not hold (a host's imported theme) is still written
48
+ * inline, since no stylesheet can know it. The accent, the terminal pin, the
49
+ * surface alpha and the fonts are written the same in both.
50
+ *
51
+ * Switching from an imported variant back to a catalogue one removes what the
52
+ * imported one wrote, so nothing inline outlives it to beat the stylesheet.
53
+ */
54
+ palette?: 'inline' | 'stylesheet';
55
+ /**
56
+ * The `--editor-*` projection. `syntax` (the default) is the catalogue's quiet
57
+ * syntax roles, which is what `theme-variants.css` carries; `floor` holds every
58
+ * editor role to 4.5:1 on the canvas, as hex.
59
+ *
60
+ * With `palette: 'stylesheet'`, `floor` is the one palette write a catalogue
61
+ * variant still gets: the stylesheet is generated for the default projection, so
62
+ * the sixteen `--editor-*` properties are written inline over it. The rest of the
63
+ * palette stays in the stylesheet.
64
+ */
65
+ editorRoles?: EditorRolesMode;
66
+ } & ThemeTokenProjectionOptions;
67
+ /**
68
+ * The custom properties a state paints: the variant's roles, an optional projection
69
+ * from the raw host map, the accent, the pinned terminal palette, the surface alpha,
70
+ * then `transformTokens`.
71
+ *
72
+ * The accent is applied *here* rather than left to the `[data-accent]` blocks in
73
+ * `theme.css`, because the properties are written inline and an inline declaration
74
+ * outranks every stylesheet selector however specific it is. The blocks still exist
75
+ * and are still correct — they are what styles the window before this runs — but
76
+ * they cannot win from here, so leaving the accent to them meant the attribute was
77
+ * set, the rules were present, and nothing changed on screen.
78
+ */
79
+ export declare function themeDocumentTokens(engine: ThemeEngine, state: ThemeDocumentState, options?: ThemeDocumentOptions): {
10
80
  tokens: Record<string, string>;
11
81
  accented: boolean;
12
82
  };
13
83
  /**
14
- * Write a state onto a root and report which custom properties it owns, resolved
15
- * against the whole catalogue. See {@link applyThemeToRootWith} for the rules.
84
+ * Write a state onto a root and report which custom properties it owns.
85
+ *
86
+ * Pass the previous call's return as `previous` and any palette property that pass
87
+ * wrote and this one does not is removed. For the catalogue the two sets are the
88
+ * same, so nothing is ever removed; it matters for a host variant that carries
89
+ * `tokens` the catalogue does not, which would otherwise stay inline, beating the
90
+ * stylesheet, after the user switched away from it.
91
+ */
92
+ export declare function applyThemeToRoot(engine: ThemeEngine, root: ThemeRoot, state: ThemeDocumentState, options?: ThemeDocumentOptions, previous?: ReadonlySet<string>): ReadonlySet<string>;
93
+ /** What {@link applyWithoutTransitions} needs of a document. */
94
+ export type TransitionDocument = {
95
+ head: {
96
+ appendChild(node: unknown): unknown;
97
+ };
98
+ createElement(tag: 'style'): {
99
+ textContent: string | null;
100
+ offsetHeight?: number;
101
+ remove(): void;
102
+ };
103
+ };
104
+ /**
105
+ * Run `apply` with every CSS transition switched off for the frame that carries
106
+ * it, so a theme switch cannot animate page-wide.
107
+ *
108
+ * Without this, flipping the custom properties on `<html>` starts a transition on
109
+ * every element that declares one, and each fades from the old palette to the new
110
+ * over its own duration: a theme change that looks like a rendering fault. The
111
+ * rule is removed two frames later, after the browser has committed the new styles
112
+ * with transitions off, and `restore` runs it early (the provider calls it when it
113
+ * is disposed mid-switch).
114
+ *
115
+ * `schedule` is the frame source; it defaults to `requestAnimationFrame` and falls
116
+ * back to running at once where there is none, which leaves transitions on rather
117
+ * than off.
16
118
  */
17
- export declare function applyThemeToRoot(root: ThemeRoot, state: ThemeDocumentState, options?: ThemeDocumentOptions, previous?: ReadonlySet<string>): ReadonlySet<string>;
119
+ export declare function applyWithoutTransitions(doc: TransitionDocument, apply: () => void, schedule?: (callback: () => void) => void): () => void;
18
120
  //# sourceMappingURL=theme-document.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme-document.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-document.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACf,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,kBAAkB,GACxB,MAAM,uBAAuB,CAAA;AAE9B;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,oBAAyB,GACjC;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAEvD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,oBAAyB,EAClC,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAC7B,WAAW,CAAC,MAAM,CAAC,CAErB"}
1
+ {"version":3,"file":"theme-document.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-document.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEtF,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACpE,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAA;AAEpE;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,WAAW,EACX,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,iBAAiB,GAAG,cAAc,CACvE,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,mFAAmF;IACnF,SAAS,EAAE,cAAc,CAAA;IACzB,UAAU,EAAE,eAAe,CAAA;IAC3B,OAAO,EAAE,YAAY,CAAA;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,YAAY,CAAA;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5E;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAA;IACjC;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,eAAe,CAAA;CAC9B,GAAG,2BAA2B,CAAA;AAoB/B;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,oBAAyB,GACjC;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAiCvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,oBAAyB,EAClC,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAC7B,WAAW,CAAC,MAAM,CAAC,CA6CrB;AAED,gEAAgE;AAChE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE;QAAE,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAA;KAAE,CAAA;IAC7C,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG;QAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,MAAM,IAAI,IAAI,CAAA;KACf,CAAA;CACF,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,MAAM,IAAI,EACjB,QAAQ,GAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAsB,GACzD,MAAM,IAAI,CAqBZ"}
@@ -1,9 +1,10 @@
1
1
  import { applyAppearanceFontSettings, normalizeAppearanceEditorFontSettings } from "../../lib/appearance-font-settings.js";
2
2
  import { terminalCssVariables } from "../../lib/theme-css.js";
3
+ import { assertThemeTokenProjectionConfig } from "./token-projection-options.js";
3
4
  import { isCustomAccent } from "../../lib/accent-roles.js";
4
5
  import { surfaceAlpha } from "../../lib/theme-surface.js";
5
- import { resolvedDensity } from "./theme-state-core.js";
6
- // src/components/theme/theme-document-core.ts
6
+ import { resolvedDensity } from "./theme-state.js";
7
+ // src/components/theme/theme-document.ts
7
8
  /**
8
9
  * What a catalogue variant still writes inline when its palette is the stylesheet's:
9
10
  * nothing, unless the editor projection is not the one the stylesheet was generated
@@ -14,9 +15,9 @@ function stylesheetOverrides(engine, variant, editorRoles) {
14
15
  return Object.fromEntries(Object.entries(engine.themeCssVariables(variant, { editor: "floor" })).filter(([name]) => name.startsWith("--editor-")));
15
16
  }
16
17
  /**
17
- * The custom properties a state paints: the variant's roles, with the accent
18
- * selection laid over them, the pinned terminal palette over that, the surface
19
- * alpha, then `transformTokens`.
18
+ * The custom properties a state paints: the variant's roles, an optional projection
19
+ * from the raw host map, the accent, the pinned terminal palette, the surface alpha,
20
+ * then `transformTokens`.
20
21
  *
21
22
  * The accent is applied *here* rather than left to the `[data-accent]` blocks in
22
23
  * `theme.css`, because the properties are written inline and an inline declaration
@@ -25,8 +26,17 @@ function stylesheetOverrides(engine, variant, editorRoles) {
25
26
  * they cannot win from here, so leaving the accent to them meant the attribute was
26
27
  * set, the rules were present, and nothing changed on screen.
27
28
  */
28
- function themeDocumentTokensWith(engine, state, options = {}) {
29
+ function themeDocumentTokens(engine, state, options = {}) {
30
+ assertThemeTokenProjectionConfig(options.tokenProjection);
29
31
  const properties = options.palette === "stylesheet" && engine.isCatalogueVariant(state.variant) ? stylesheetOverrides(engine, state.variant, options.editorRoles) : { ...engine.themeCssVariables(state.variant, { editor: options.editorRoles }) };
32
+ if (options.tokenProjection && !engine.isCatalogueVariant(state.variant)) {
33
+ const rawTokens = state.variant.tokens ?? {};
34
+ const projected = options.tokenProjection.project(rawTokens, options.tokenProjection.rules);
35
+ for (const rule of options.tokenProjection.rules) {
36
+ if (!rule || typeof rule.target !== "string") continue;
37
+ if (Object.hasOwn(projected, rule.target)) properties[rule.target] = projected[rule.target];
38
+ }
39
+ }
30
40
  const accent = engine.accentVariables(state.selection.accent, state.appearance, state.selection, {
31
41
  background: state.variant.colors.background,
32
42
  floor: options.accentContrastFloor,
@@ -49,8 +59,8 @@ function themeDocumentTokensWith(engine, state, options = {}) {
49
59
  * `tokens` the catalogue does not, which would otherwise stay inline, beating the
50
60
  * stylesheet, after the user switched away from it.
51
61
  */
52
- function applyThemeToRootWith(engine, root, state, options = {}, previous) {
53
- const { tokens, accented } = themeDocumentTokensWith(engine, state, options);
62
+ function applyThemeToRoot(engine, root, state, options = {}, previous) {
63
+ const { tokens, accented } = themeDocumentTokens(engine, state, options);
54
64
  for (const [name, value] of Object.entries(tokens)) root.style.setProperty(name, value);
55
65
  if (previous) {
56
66
  for (const name of previous) if (!(name in tokens)) root.style.removeProperty(name);
@@ -112,6 +122,6 @@ function defaultSchedule(callback) {
112
122
  if (typeof requestAnimationFrame === "function") requestAnimationFrame(callback);
113
123
  else callback();
114
124
  }
115
- export { applyThemeToRootWith, applyWithoutTransitions, themeDocumentTokensWith };
125
+ export { applyThemeToRoot, applyWithoutTransitions, themeDocumentTokens };
116
126
 
117
- //# sourceMappingURL=theme-document-core.js.map
127
+ //# sourceMappingURL=theme-document.js.map