@agimon-ai/po-web-components 0.0.0-alpha.21 → 0.0.0-alpha.211

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 (855) hide show
  1. package/LICENSE +1 -192
  2. package/NOTICE +61 -0
  3. package/README.md +7 -12
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.d.mts +90 -70
  6. package/dist/index.mjs +1 -1
  7. package/dist/markdownMediaSlot.cjs +1 -0
  8. package/dist/markdownMediaSlot.d.mts +2 -0
  9. package/dist/markdownMediaSlot.mjs +1 -0
  10. package/dist/mcpAppHost.cjs +1 -0
  11. package/dist/mcpAppHost.d.mts +4 -0
  12. package/dist/mcpAppHost.mjs +1 -0
  13. package/dist/mcpWidget.d.mts +2 -2
  14. package/dist/mcpWidget.mjs +1 -1
  15. package/dist/nativeTheme.d.mts +2 -2
  16. package/dist/nativeTheme.mjs +1 -1
  17. package/dist/po-runtime-identity.json +1 -0
  18. package/dist/src/components/Accordion.cjs.map +1 -1
  19. package/dist/src/components/Accordion.d.mts.map +1 -0
  20. package/dist/src/components/Accordion.mjs.map +1 -0
  21. package/dist/src/components/AgentAvatar.cjs +1 -1
  22. package/dist/src/components/AgentAvatar.cjs.map +1 -1
  23. package/dist/{packages/core/po-web-components/src → src}/components/AgentAvatar.d.mts +6 -2
  24. package/dist/src/components/AgentAvatar.d.mts.map +1 -0
  25. package/dist/src/components/AgentAvatar.mjs +2 -0
  26. package/dist/src/components/AgentAvatar.mjs.map +1 -0
  27. package/dist/src/components/AnsiText.cjs.map +1 -1
  28. package/dist/src/components/AnsiText.d.mts.map +1 -0
  29. package/dist/src/components/AnsiText.mjs.map +1 -0
  30. package/dist/src/components/Avatar.cjs.map +1 -1
  31. package/dist/src/components/Avatar.d.mts.map +1 -0
  32. package/dist/src/components/Avatar.mjs.map +1 -0
  33. package/dist/src/components/Badge.cjs.map +1 -1
  34. package/dist/src/components/Badge.d.mts.map +1 -0
  35. package/dist/src/components/Badge.mjs.map +1 -0
  36. package/dist/src/components/Breadcrumb.cjs.map +1 -1
  37. package/dist/src/components/Breadcrumb.d.mts.map +1 -0
  38. package/dist/src/components/Breadcrumb.mjs.map +1 -0
  39. package/dist/src/components/Button.cjs.map +1 -1
  40. package/dist/src/components/Button.d.mts.map +1 -0
  41. package/dist/src/components/Button.mjs.map +1 -0
  42. package/dist/src/components/Checkbox.cjs.map +1 -1
  43. package/dist/src/components/Checkbox.d.mts.map +1 -0
  44. package/dist/src/components/Checkbox.mjs.map +1 -0
  45. package/dist/src/components/CodeBlock.cjs.map +1 -1
  46. package/dist/src/components/CodeBlock.d.mts.map +1 -0
  47. package/dist/src/components/CodeBlock.mjs.map +1 -0
  48. package/dist/src/components/CodeEditor.cjs.map +1 -1
  49. package/dist/src/components/CodeEditor.d.mts.map +1 -0
  50. package/dist/src/components/CodeEditor.mjs.map +1 -0
  51. package/dist/src/components/CodeEditorView.cjs.map +1 -1
  52. package/dist/src/components/CodeEditorView.mjs.map +1 -0
  53. package/dist/src/components/Collapsible.cjs.map +1 -1
  54. package/dist/src/components/Collapsible.d.mts.map +1 -0
  55. package/dist/src/components/Collapsible.mjs.map +1 -0
  56. package/dist/src/components/Command.cjs.map +1 -1
  57. package/dist/src/components/Command.d.mts.map +1 -0
  58. package/dist/src/components/Command.mjs.map +1 -0
  59. package/dist/src/components/CopyButton.cjs +1 -1
  60. package/dist/src/components/CopyButton.cjs.map +1 -1
  61. package/dist/src/components/CopyButton.mjs +2 -0
  62. package/dist/src/components/CopyButton.mjs.map +1 -0
  63. package/dist/src/components/CtaCard.cjs +2 -0
  64. package/dist/src/components/CtaCard.cjs.map +1 -0
  65. package/dist/src/components/CtaCard.d.mts +16 -0
  66. package/dist/src/components/CtaCard.d.mts.map +1 -0
  67. package/dist/src/components/CtaCard.mjs +2 -0
  68. package/dist/src/components/CtaCard.mjs.map +1 -0
  69. package/dist/src/components/Dialog.cjs +1 -1
  70. package/dist/src/components/Dialog.cjs.map +1 -1
  71. package/dist/src/components/Dialog.d.mts.map +1 -0
  72. package/dist/src/components/Dialog.mjs +2 -0
  73. package/dist/src/components/Dialog.mjs.map +1 -0
  74. package/dist/src/components/DiffView.cjs +1 -1
  75. package/dist/src/components/DiffView.cjs.map +1 -1
  76. package/dist/src/components/DiffView.d.mts.map +1 -0
  77. package/dist/src/components/DiffView.mjs +2 -0
  78. package/dist/src/components/DiffView.mjs.map +1 -0
  79. package/dist/src/components/Dot.cjs.map +1 -1
  80. package/dist/src/components/Dot.d.mts.map +1 -0
  81. package/dist/src/components/Dot.mjs.map +1 -0
  82. package/dist/src/components/Drawer.cjs.map +1 -1
  83. package/dist/src/components/Drawer.d.mts.map +1 -0
  84. package/dist/src/components/Drawer.mjs.map +1 -0
  85. package/dist/src/components/DropdownMenu.cjs +1 -1
  86. package/dist/src/components/DropdownMenu.cjs.map +1 -1
  87. package/dist/src/components/DropdownMenu.d.mts.map +1 -0
  88. package/dist/{packages/core/po-web-components/src → src}/components/DropdownMenu.mjs +1 -1
  89. package/dist/src/components/DropdownMenu.mjs.map +1 -0
  90. package/dist/src/components/EmptyState.cjs +1 -1
  91. package/dist/src/components/EmptyState.cjs.map +1 -1
  92. package/dist/src/components/EmptyState.d.mts +41 -0
  93. package/dist/src/components/EmptyState.d.mts.map +1 -0
  94. package/dist/src/components/EmptyState.mjs +2 -0
  95. package/dist/src/components/EmptyState.mjs.map +1 -0
  96. package/dist/src/components/FileBrowser.cjs +2 -0
  97. package/dist/src/components/FileBrowser.cjs.map +1 -0
  98. package/dist/src/components/FileBrowser.d.mts +62 -0
  99. package/dist/src/components/FileBrowser.d.mts.map +1 -0
  100. package/dist/src/components/FileBrowser.mjs +2 -0
  101. package/dist/src/components/FileBrowser.mjs.map +1 -0
  102. package/dist/src/components/FilePreview.cjs +2 -0
  103. package/dist/src/components/FilePreview.cjs.map +1 -0
  104. package/dist/src/components/FilePreview.d.mts +32 -0
  105. package/dist/src/components/FilePreview.d.mts.map +1 -0
  106. package/dist/src/components/FilePreview.mjs +2 -0
  107. package/dist/src/components/FilePreview.mjs.map +1 -0
  108. package/dist/src/components/FlowGraph.cjs +2 -0
  109. package/dist/src/components/FlowGraph.cjs.map +1 -0
  110. package/dist/src/components/FlowGraph.d.mts +119 -0
  111. package/dist/src/components/FlowGraph.d.mts.map +1 -0
  112. package/dist/src/components/FlowGraph.mjs +2 -0
  113. package/dist/src/components/FlowGraph.mjs.map +1 -0
  114. package/dist/src/components/HashlineLines.cjs +1 -1
  115. package/dist/src/components/HashlineLines.cjs.map +1 -1
  116. package/dist/src/components/HashlineLines.d.mts.map +1 -0
  117. package/dist/src/components/HashlineLines.mjs +2 -0
  118. package/dist/src/components/HashlineLines.mjs.map +1 -0
  119. package/dist/src/components/Input.cjs +1 -1
  120. package/dist/src/components/Input.cjs.map +1 -1
  121. package/dist/src/components/Input.d.mts.map +1 -0
  122. package/dist/src/components/Input.mjs +2 -0
  123. package/dist/src/components/Input.mjs.map +1 -0
  124. package/dist/src/components/Kbd.cjs.map +1 -1
  125. package/dist/src/components/Kbd.d.mts.map +1 -0
  126. package/dist/src/components/Kbd.mjs.map +1 -0
  127. package/dist/src/components/Label.cjs.map +1 -1
  128. package/dist/src/components/Label.d.mts.map +1 -0
  129. package/dist/src/components/Label.mjs.map +1 -0
  130. package/dist/src/components/LiveDuration.cjs +2 -0
  131. package/dist/src/components/LiveDuration.cjs.map +1 -0
  132. package/dist/src/components/LiveDuration.d.mts +15 -0
  133. package/dist/src/components/LiveDuration.d.mts.map +1 -0
  134. package/dist/src/components/LiveDuration.mjs +2 -0
  135. package/dist/src/components/LiveDuration.mjs.map +1 -0
  136. package/dist/src/components/LoadingState.cjs +2 -0
  137. package/dist/src/components/LoadingState.cjs.map +1 -0
  138. package/dist/src/components/LoadingState.d.mts +17 -0
  139. package/dist/src/components/LoadingState.d.mts.map +1 -0
  140. package/dist/src/components/LoadingState.mjs +2 -0
  141. package/dist/src/components/LoadingState.mjs.map +1 -0
  142. package/dist/src/components/Markdown.cjs +2 -2
  143. package/dist/src/components/Markdown.cjs.map +1 -1
  144. package/dist/src/components/Markdown.d.mts +38 -0
  145. package/dist/src/components/Markdown.d.mts.map +1 -0
  146. package/dist/src/components/Markdown.mjs +3 -0
  147. package/dist/src/components/Markdown.mjs.map +1 -0
  148. package/dist/src/components/McpApp.cjs +1 -1
  149. package/dist/src/components/McpApp.cjs.map +1 -1
  150. package/dist/{packages/core/po-web-components/src → src}/components/McpApp.d.mts +1 -2
  151. package/dist/src/components/McpApp.d.mts.map +1 -0
  152. package/dist/src/components/McpApp.mjs +2 -0
  153. package/dist/src/components/McpApp.mjs.map +1 -0
  154. package/dist/src/components/McpToolWidget.cjs +2 -2
  155. package/dist/src/components/McpToolWidget.cjs.map +1 -1
  156. package/dist/{packages/core/po-web-components/src → src}/components/McpToolWidget.d.mts +1 -2
  157. package/dist/src/components/McpToolWidget.d.mts.map +1 -0
  158. package/dist/src/components/McpToolWidget.mjs +3 -0
  159. package/dist/src/components/McpToolWidget.mjs.map +1 -0
  160. package/dist/src/components/MediaPreview.cjs +1 -1
  161. package/dist/src/components/MediaPreview.cjs.map +1 -1
  162. package/dist/src/components/MediaPreview.d.mts.map +1 -0
  163. package/dist/src/components/MediaPreview.mjs +2 -0
  164. package/dist/src/components/MediaPreview.mjs.map +1 -0
  165. package/dist/src/components/MediaViewerDialog.cjs +2 -0
  166. package/dist/src/components/MediaViewerDialog.cjs.map +1 -0
  167. package/dist/src/components/MediaViewerDialog.d.mts +20 -0
  168. package/dist/src/components/MediaViewerDialog.d.mts.map +1 -0
  169. package/dist/src/components/MediaViewerDialog.mjs +2 -0
  170. package/dist/src/components/MediaViewerDialog.mjs.map +1 -0
  171. package/dist/src/components/MermaidDiagram.cjs +1 -1
  172. package/dist/src/components/MermaidDiagram.cjs.map +1 -1
  173. package/dist/src/components/MermaidDiagram.mjs +2 -0
  174. package/dist/src/components/MermaidDiagram.mjs.map +1 -0
  175. package/dist/src/components/MessageItem.cjs +1 -1
  176. package/dist/src/components/MessageItem.cjs.map +1 -1
  177. package/dist/{packages/core/po-web-components/src → src}/components/MessageItem.d.mts +9 -2
  178. package/dist/src/components/MessageItem.d.mts.map +1 -0
  179. package/dist/src/components/MessageItem.mjs +2 -0
  180. package/dist/src/components/MessageItem.mjs.map +1 -0
  181. package/dist/src/components/MessageLines.cjs.map +1 -1
  182. package/dist/src/components/MessageLines.d.mts.map +1 -0
  183. package/dist/src/components/MessageLines.mjs.map +1 -0
  184. package/dist/src/components/OptionList.cjs +1 -1
  185. package/dist/src/components/OptionList.cjs.map +1 -1
  186. package/dist/src/components/OptionList.d.mts.map +1 -0
  187. package/dist/src/components/OptionList.mjs +2 -0
  188. package/dist/src/components/OptionList.mjs.map +1 -0
  189. package/dist/src/components/Panel.cjs.map +1 -1
  190. package/dist/src/components/Panel.d.mts.map +1 -0
  191. package/dist/src/components/Panel.mjs.map +1 -0
  192. package/dist/src/components/PathText.cjs +2 -0
  193. package/dist/src/components/PathText.cjs.map +1 -0
  194. package/dist/src/components/PathText.d.mts +15 -0
  195. package/dist/src/components/PathText.d.mts.map +1 -0
  196. package/dist/src/components/PathText.mjs +2 -0
  197. package/dist/src/components/PathText.mjs.map +1 -0
  198. package/dist/src/components/PdfPreview.cjs +1 -1
  199. package/dist/src/components/PdfPreview.cjs.map +1 -1
  200. package/dist/src/components/PdfPreview.d.mts.map +1 -0
  201. package/dist/src/components/PdfPreview.mjs +2 -0
  202. package/dist/src/components/PdfPreview.mjs.map +1 -0
  203. package/dist/src/components/Picker.cjs +1 -1
  204. package/dist/src/components/Picker.cjs.map +1 -1
  205. package/dist/{packages/core/po-web-components/src → src}/components/Picker.d.mts +19 -6
  206. package/dist/src/components/Picker.d.mts.map +1 -0
  207. package/dist/src/components/Picker.mjs +2 -0
  208. package/dist/src/components/Picker.mjs.map +1 -0
  209. package/dist/src/components/Popover.cjs.map +1 -1
  210. package/dist/src/components/Popover.d.mts.map +1 -0
  211. package/dist/src/components/Popover.mjs.map +1 -0
  212. package/dist/src/components/ProfilePicker.cjs +2 -0
  213. package/dist/src/components/ProfilePicker.cjs.map +1 -0
  214. package/dist/src/components/ProfilePicker.d.mts +34 -0
  215. package/dist/src/components/ProfilePicker.d.mts.map +1 -0
  216. package/dist/src/components/ProfilePicker.mjs +2 -0
  217. package/dist/src/components/ProfilePicker.mjs.map +1 -0
  218. package/dist/src/components/Progress.cjs.map +1 -1
  219. package/dist/src/components/Progress.d.mts.map +1 -0
  220. package/dist/src/components/Progress.mjs.map +1 -0
  221. package/dist/src/components/QrCode.cjs +2 -0
  222. package/dist/src/components/QrCode.cjs.map +1 -0
  223. package/dist/src/components/QrCode.d.mts +22 -0
  224. package/dist/src/components/QrCode.d.mts.map +1 -0
  225. package/dist/src/components/QrCode.mjs +2 -0
  226. package/dist/src/components/QrCode.mjs.map +1 -0
  227. package/dist/src/components/RadioGroup.cjs.map +1 -1
  228. package/dist/src/components/RadioGroup.d.mts.map +1 -0
  229. package/dist/src/components/RadioGroup.mjs.map +1 -0
  230. package/dist/src/components/ReferenceChip.cjs +2 -0
  231. package/dist/src/components/ReferenceChip.cjs.map +1 -0
  232. package/dist/src/components/ReferenceChip.d.mts +17 -0
  233. package/dist/src/components/ReferenceChip.d.mts.map +1 -0
  234. package/dist/src/components/ReferenceChip.mjs +2 -0
  235. package/dist/src/components/ReferenceChip.mjs.map +1 -0
  236. package/dist/src/components/ReviewCommentDraft.cjs +1 -1
  237. package/dist/src/components/ReviewCommentDraft.cjs.map +1 -1
  238. package/dist/src/components/ReviewCommentDraft.d.mts.map +1 -0
  239. package/dist/src/components/ReviewCommentDraft.mjs +2 -0
  240. package/dist/src/components/ReviewCommentDraft.mjs.map +1 -0
  241. package/dist/src/components/ScrollArea.cjs.map +1 -1
  242. package/dist/src/components/ScrollArea.d.mts.map +1 -0
  243. package/dist/src/components/ScrollArea.mjs.map +1 -0
  244. package/dist/src/components/SectionLabel.cjs.map +1 -1
  245. package/dist/{packages/core/po-web-components/src → src}/components/SectionLabel.d.mts +1 -1
  246. package/dist/src/components/SectionLabel.d.mts.map +1 -0
  247. package/dist/src/components/SectionLabel.mjs.map +1 -0
  248. package/dist/src/components/Select.cjs.map +1 -1
  249. package/dist/src/components/Select.d.mts.map +1 -0
  250. package/dist/src/components/Select.mjs.map +1 -0
  251. package/dist/src/components/Separator.cjs.map +1 -1
  252. package/dist/src/components/Separator.d.mts.map +1 -0
  253. package/dist/src/components/Separator.mjs.map +1 -0
  254. package/dist/src/components/Settings.cjs.map +1 -1
  255. package/dist/src/components/Settings.d.mts.map +1 -0
  256. package/dist/src/components/Settings.mjs.map +1 -0
  257. package/dist/src/components/SetupRow.cjs +2 -0
  258. package/dist/src/components/SetupRow.cjs.map +1 -0
  259. package/dist/src/components/SetupRow.d.mts +17 -0
  260. package/dist/src/components/SetupRow.d.mts.map +1 -0
  261. package/dist/src/components/SetupRow.mjs +2 -0
  262. package/dist/src/components/SetupRow.mjs.map +1 -0
  263. package/dist/src/components/Sheet.cjs +1 -1
  264. package/dist/src/components/Sheet.cjs.map +1 -1
  265. package/dist/src/components/Sheet.d.mts.map +1 -0
  266. package/dist/src/components/Sheet.mjs +2 -0
  267. package/dist/src/components/Sheet.mjs.map +1 -0
  268. package/dist/src/components/Skeleton.cjs.map +1 -1
  269. package/dist/src/components/Skeleton.d.mts.map +1 -0
  270. package/dist/src/components/Skeleton.mjs.map +1 -0
  271. package/dist/src/components/Spinner.cjs.map +1 -1
  272. package/dist/src/components/Spinner.d.mts.map +1 -0
  273. package/dist/src/components/Spinner.mjs.map +1 -0
  274. package/dist/src/components/StatusBadge.cjs.map +1 -1
  275. package/dist/src/components/StatusBadge.d.mts.map +1 -0
  276. package/dist/src/components/StatusBadge.mjs.map +1 -0
  277. package/dist/src/components/StreamCursor.cjs.map +1 -1
  278. package/dist/src/components/StreamCursor.d.mts.map +1 -0
  279. package/dist/src/components/StreamCursor.mjs.map +1 -0
  280. package/dist/src/components/Switch.cjs.map +1 -1
  281. package/dist/src/components/Switch.d.mts.map +1 -0
  282. package/dist/src/components/Switch.mjs.map +1 -0
  283. package/dist/src/components/SyntaxText.cjs +1 -1
  284. package/dist/src/components/SyntaxText.cjs.map +1 -1
  285. package/dist/src/components/SyntaxText.d.mts.map +1 -0
  286. package/dist/{packages/core/po-web-components/src → src}/components/SyntaxText.mjs +1 -1
  287. package/dist/src/components/SyntaxText.mjs.map +1 -0
  288. package/dist/src/components/Tabs.cjs +1 -1
  289. package/dist/src/components/Tabs.cjs.map +1 -1
  290. package/dist/{packages/core/po-web-components/src → src}/components/Tabs.d.mts +7 -3
  291. package/dist/src/components/Tabs.d.mts.map +1 -0
  292. package/dist/src/components/Tabs.mjs +2 -0
  293. package/dist/src/components/Tabs.mjs.map +1 -0
  294. package/dist/src/components/TerminalView.cjs.map +1 -1
  295. package/dist/src/components/TerminalView.d.mts.map +1 -0
  296. package/dist/src/components/TerminalView.mjs.map +1 -0
  297. package/dist/src/components/Textarea.cjs.map +1 -1
  298. package/dist/src/components/Textarea.d.mts.map +1 -0
  299. package/dist/src/components/Textarea.mjs.map +1 -0
  300. package/dist/src/components/Toast.cjs +1 -1
  301. package/dist/src/components/Toast.cjs.map +1 -1
  302. package/dist/src/components/Toast.d.mts.map +1 -0
  303. package/dist/src/components/Toast.mjs +2 -0
  304. package/dist/src/components/Toast.mjs.map +1 -0
  305. package/dist/src/components/ToolPathLink.cjs +1 -1
  306. package/dist/src/components/ToolPathLink.cjs.map +1 -1
  307. package/dist/src/components/ToolPathLink.d.mts.map +1 -0
  308. package/dist/src/components/ToolPathLink.mjs +2 -0
  309. package/dist/src/components/ToolPathLink.mjs.map +1 -0
  310. package/dist/src/components/Tooltip.cjs.map +1 -1
  311. package/dist/src/components/Tooltip.d.mts.map +1 -0
  312. package/dist/src/components/Tooltip.mjs.map +1 -0
  313. package/dist/src/components/ViewableImage.cjs +2 -0
  314. package/dist/src/components/ViewableImage.cjs.map +1 -0
  315. package/dist/src/components/ViewableImage.d.mts +19 -0
  316. package/dist/src/components/ViewableImage.d.mts.map +1 -0
  317. package/dist/src/components/ViewableImage.mjs +2 -0
  318. package/dist/src/components/ViewableImage.mjs.map +1 -0
  319. package/dist/src/icons/icons.cjs +1 -1
  320. package/dist/src/icons/icons.d.mts +2 -0
  321. package/dist/src/icons/icons.mjs +1 -0
  322. package/dist/src/lib/ansiSpans.cjs.map +1 -1
  323. package/dist/src/lib/ansiSpans.d.mts.map +1 -0
  324. package/dist/src/lib/ansiSpans.mjs.map +1 -0
  325. package/dist/src/lib/cn.cjs.map +1 -1
  326. package/dist/src/lib/cn.d.mts.map +1 -0
  327. package/dist/src/lib/cn.mjs.map +1 -0
  328. package/dist/src/lib/collapse.cjs.map +1 -1
  329. package/dist/src/lib/collapse.d.mts.map +1 -0
  330. package/dist/src/lib/collapse.mjs.map +1 -0
  331. package/dist/src/lib/editorController.cjs.map +1 -1
  332. package/dist/src/lib/editorController.mjs.map +1 -0
  333. package/dist/src/lib/editorLanguage.cjs.map +1 -1
  334. package/dist/src/lib/editorLanguage.d.mts.map +1 -0
  335. package/dist/src/lib/editorLanguage.mjs.map +1 -0
  336. package/dist/src/lib/editorTheme.cjs.map +1 -1
  337. package/dist/src/lib/editorTheme.d.mts.map +1 -0
  338. package/dist/src/lib/editorTheme.mjs.map +1 -0
  339. package/dist/src/lib/fenceGrammar.cjs.map +1 -1
  340. package/dist/src/lib/fenceGrammar.mjs.map +1 -0
  341. package/dist/src/lib/fileDownload.cjs +2 -0
  342. package/dist/src/lib/fileDownload.cjs.map +1 -0
  343. package/dist/src/lib/fileDownload.d.mts +25 -0
  344. package/dist/src/lib/fileDownload.d.mts.map +1 -0
  345. package/dist/src/lib/fileDownload.mjs +2 -0
  346. package/dist/src/lib/fileDownload.mjs.map +1 -0
  347. package/dist/src/lib/files.cjs +2 -0
  348. package/dist/src/lib/files.cjs.map +1 -0
  349. package/dist/src/lib/files.d.mts +61 -0
  350. package/dist/src/lib/files.d.mts.map +1 -0
  351. package/dist/src/lib/files.mjs +2 -0
  352. package/dist/src/lib/files.mjs.map +1 -0
  353. package/dist/src/lib/hashlineHighlight.cjs +1 -1
  354. package/dist/src/lib/hashlineHighlight.cjs.map +1 -1
  355. package/dist/src/lib/hashlineHighlight.d.mts.map +1 -0
  356. package/dist/{packages/core/po-web-components/src → src}/lib/hashlineHighlight.mjs +1 -1
  357. package/dist/src/lib/hashlineHighlight.mjs.map +1 -0
  358. package/dist/src/lib/hashlineView.cjs.map +1 -1
  359. package/dist/src/lib/hashlineView.d.mts.map +1 -0
  360. package/dist/src/lib/hashlineView.mjs.map +1 -0
  361. package/dist/src/lib/markdownMedia.cjs +2 -0
  362. package/dist/src/lib/markdownMedia.cjs.map +1 -0
  363. package/dist/src/lib/markdownMedia.d.mts +56 -0
  364. package/dist/src/lib/markdownMedia.d.mts.map +1 -0
  365. package/dist/src/lib/markdownMedia.mjs +2 -0
  366. package/dist/src/lib/markdownMedia.mjs.map +1 -0
  367. package/dist/src/lib/markdownMediaSlot.cjs +2 -0
  368. package/dist/src/lib/markdownMediaSlot.cjs.map +1 -0
  369. package/dist/src/lib/markdownMediaSlot.d.mts +10 -0
  370. package/dist/src/lib/markdownMediaSlot.d.mts.map +1 -0
  371. package/dist/src/lib/markdownMediaSlot.mjs +2 -0
  372. package/dist/src/lib/markdownMediaSlot.mjs.map +1 -0
  373. package/dist/src/lib/markdownReferences.cjs +2 -0
  374. package/dist/src/lib/markdownReferences.cjs.map +1 -0
  375. package/dist/src/lib/markdownReferences.mjs +2 -0
  376. package/dist/src/lib/markdownReferences.mjs.map +1 -0
  377. package/dist/src/lib/mcpAppFrame.cjs +3 -0
  378. package/dist/src/lib/mcpAppFrame.cjs.map +1 -0
  379. package/dist/src/lib/mcpAppFrame.d.mts +47 -0
  380. package/dist/src/lib/mcpAppFrame.d.mts.map +1 -0
  381. package/dist/src/lib/mcpAppFrame.mjs +3 -0
  382. package/dist/src/lib/mcpAppFrame.mjs.map +1 -0
  383. package/dist/src/lib/mcpAppSandbox.cjs +2 -0
  384. package/dist/src/lib/mcpAppSandbox.cjs.map +1 -0
  385. package/dist/src/lib/mcpAppSandbox.d.mts +19 -0
  386. package/dist/src/lib/mcpAppSandbox.d.mts.map +1 -0
  387. package/dist/src/lib/mcpAppSandbox.mjs +2 -0
  388. package/dist/src/lib/mcpAppSandbox.mjs.map +1 -0
  389. package/dist/src/lib/mcpOpenAiBootstrap.cjs +2 -0
  390. package/dist/src/lib/mcpOpenAiBootstrap.cjs.map +1 -0
  391. package/dist/src/lib/mcpOpenAiBootstrap.d.mts +32 -0
  392. package/dist/src/lib/mcpOpenAiBootstrap.d.mts.map +1 -0
  393. package/dist/src/lib/mcpOpenAiBootstrap.mjs +2 -0
  394. package/dist/src/lib/mcpOpenAiBootstrap.mjs.map +1 -0
  395. package/dist/src/lib/media.cjs.map +1 -1
  396. package/dist/src/lib/media.d.mts.map +1 -0
  397. package/dist/src/lib/media.mjs.map +1 -0
  398. package/dist/src/lib/mediaPlayback.cjs.map +1 -1
  399. package/dist/src/lib/mediaPlayback.mjs.map +1 -0
  400. package/dist/src/lib/mermaidDiagram.cjs +1 -1
  401. package/dist/src/lib/mermaidDiagram.cjs.map +1 -1
  402. package/dist/src/lib/mermaidDiagram.mjs +2 -0
  403. package/dist/src/lib/mermaidDiagram.mjs.map +1 -0
  404. package/dist/src/lib/optionList.cjs.map +1 -1
  405. package/dist/src/lib/optionList.d.mts.map +1 -0
  406. package/dist/src/lib/optionList.mjs.map +1 -0
  407. package/dist/src/lib/pathGroups.cjs.map +1 -1
  408. package/dist/src/lib/pathGroups.d.mts.map +1 -0
  409. package/dist/src/lib/pathGroups.mjs.map +1 -0
  410. package/dist/src/lib/picker.cjs +1 -1
  411. package/dist/src/lib/picker.cjs.map +1 -1
  412. package/dist/src/lib/picker.d.mts.map +1 -0
  413. package/dist/src/lib/picker.mjs +2 -0
  414. package/dist/src/lib/picker.mjs.map +1 -0
  415. package/dist/src/lib/profilePicker.cjs +2 -0
  416. package/dist/src/lib/profilePicker.cjs.map +1 -0
  417. package/dist/src/lib/profilePicker.d.mts +43 -0
  418. package/dist/src/lib/profilePicker.d.mts.map +1 -0
  419. package/dist/src/lib/profilePicker.mjs +2 -0
  420. package/dist/src/lib/profilePicker.mjs.map +1 -0
  421. package/dist/src/lib/qrMatrix.cjs +2 -0
  422. package/dist/src/lib/qrMatrix.cjs.map +1 -0
  423. package/dist/src/lib/qrMatrix.d.mts +5 -0
  424. package/dist/src/lib/qrMatrix.d.mts.map +1 -0
  425. package/dist/src/lib/qrMatrix.mjs +2 -0
  426. package/dist/src/lib/qrMatrix.mjs.map +1 -0
  427. package/dist/src/lib/review.cjs.map +1 -1
  428. package/dist/src/lib/review.d.mts.map +1 -0
  429. package/dist/src/lib/review.mjs.map +1 -0
  430. package/dist/src/lib/runDuration.cjs +2 -0
  431. package/dist/src/lib/runDuration.cjs.map +1 -0
  432. package/dist/src/lib/runDuration.d.mts +12 -0
  433. package/dist/src/lib/runDuration.d.mts.map +1 -0
  434. package/dist/src/lib/runDuration.mjs +2 -0
  435. package/dist/src/lib/runDuration.mjs.map +1 -0
  436. package/dist/src/lib/syntaxHighlight.cjs +1 -1
  437. package/dist/src/lib/syntaxHighlight.cjs.map +1 -1
  438. package/dist/{packages/core/po-web-components/src → src}/lib/syntaxHighlight.d.mts +6 -8
  439. package/dist/src/lib/syntaxHighlight.d.mts.map +1 -0
  440. package/dist/{packages/core/po-web-components/src → src}/lib/syntaxHighlight.mjs +1 -1
  441. package/dist/src/lib/syntaxHighlight.mjs.map +1 -0
  442. package/dist/src/lib/tone.cjs.map +1 -1
  443. package/dist/src/lib/tone.d.mts.map +1 -0
  444. package/dist/src/lib/tone.mjs.map +1 -0
  445. package/dist/src/theme/apply.cjs.map +1 -1
  446. package/dist/src/theme/apply.d.mts.map +1 -0
  447. package/dist/src/theme/apply.mjs.map +1 -0
  448. package/dist/src/theme/builtinThemes.cjs.map +1 -1
  449. package/dist/src/theme/builtinThemes.d.mts.map +1 -0
  450. package/dist/src/theme/builtinThemes.mjs.map +1 -0
  451. package/dist/src/theme/derive.cjs.map +1 -1
  452. package/dist/src/theme/derive.d.mts.map +1 -0
  453. package/dist/src/theme/derive.mjs.map +1 -0
  454. package/dist/src/theme/nativeTheme.cjs.map +1 -1
  455. package/dist/src/theme/nativeTheme.d.mts.map +1 -0
  456. package/dist/src/theme/nativeTheme.mjs.map +1 -0
  457. package/dist/src/theme/parse.cjs.map +1 -1
  458. package/dist/src/theme/parse.d.mts.map +1 -0
  459. package/dist/src/theme/parse.mjs.map +1 -0
  460. package/dist/src/theme/piTheme.cjs.map +1 -1
  461. package/dist/src/theme/piTheme.d.mts.map +1 -0
  462. package/dist/src/theme/piTheme.mjs.map +1 -0
  463. package/dist/src/theme/preference.cjs.map +1 -1
  464. package/dist/src/theme/preference.d.mts.map +1 -0
  465. package/dist/src/theme/preference.mjs.map +1 -0
  466. package/dist/src/types/diff.d.mts.map +1 -0
  467. package/dist/src/types/editor.cjs.map +1 -1
  468. package/dist/src/types/editor.d.mts.map +1 -0
  469. package/dist/src/types/editor.mjs.map +1 -0
  470. package/dist/src/types/theme.cjs.map +1 -1
  471. package/dist/src/types/theme.d.mts.map +1 -0
  472. package/dist/src/types/theme.mjs.map +1 -0
  473. package/dist/src/types/tone.cjs.map +1 -1
  474. package/dist/src/types/tone.d.mts.map +1 -0
  475. package/dist/src/types/tone.mjs.map +1 -0
  476. package/dist/text.cjs +1 -1
  477. package/dist/text.d.mts +13 -4
  478. package/dist/text.mjs +1 -1
  479. package/dist/theme.d.mts +7 -7
  480. package/dist/theme.mjs +1 -1
  481. package/dist/themes/po-nord-dark.cjs +1 -1
  482. package/dist/{packages/core/po-web-components/themes → themes}/po-nord-dark.mjs +1 -1
  483. package/dist/{packages/core/po-web-components/themes → themes}/po-nord-dark.mjs.map +1 -1
  484. package/dist/{packages/core/po-web-components/themes → themes}/po-one-light.mjs.map +1 -1
  485. package/locales/vi.json +168 -0
  486. package/locales/zh-CN.json +168 -0
  487. package/package.json +30 -11
  488. package/styles/theme.css +23 -0
  489. package/themes/po-nord-dark.json +1 -1
  490. package/dist/node_modules/.pnpm/@modelcontextprotocol_server@2.3.1/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D4NN8WsG.d.mts +0 -26
  491. package/dist/node_modules/.pnpm/@modelcontextprotocol_server@2.3.1/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D4NN8WsG.d.mts.map +0 -1
  492. package/dist/node_modules/.pnpm/@modelcontextprotocol_server@2.3.1/node_modules/@modelcontextprotocol/server/dist/index.d.mts +0 -2
  493. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/compat.d.mts +0 -8
  494. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/compat.d.mts.map +0 -1
  495. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/errors.d.mts +0 -21
  496. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/errors.d.mts.map +0 -1
  497. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/parse.d.mts +0 -15
  498. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/parse.d.mts.map +0 -1
  499. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/schemas.d.mts +0 -169
  500. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/schemas.d.mts.map +0 -1
  501. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/api.d.mts +0 -38
  502. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/api.d.mts.map +0 -1
  503. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/checks.d.mts +0 -63
  504. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/checks.d.mts.map +0 -1
  505. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/core.d.mts +0 -50
  506. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/core.d.mts.map +0 -1
  507. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/errors.d.mts +0 -135
  508. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/errors.d.mts.map +0 -1
  509. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/json-schema.d.mts +0 -70
  510. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/json-schema.d.mts.map +0 -1
  511. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/registries.d.mts +0 -31
  512. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/registries.d.mts.map +0 -1
  513. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/schemas.d.mts +0 -806
  514. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/schemas.d.mts.map +0 -1
  515. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/standard-schema.d.mts +0 -120
  516. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/standard-schema.d.mts.map +0 -1
  517. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/to-json-schema.d.mts +0 -128
  518. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/to-json-schema.d.mts.map +0 -1
  519. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/util.d.mts +0 -38
  520. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/util.d.mts.map +0 -1
  521. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/versions.d.mts +0 -8
  522. package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/versions.d.mts.map +0 -1
  523. package/dist/packages/core/po-core/dist/mcpWidget.d.mts +0 -2
  524. package/dist/packages/core/po-core/dist/src/extensions/webPlugin.d.mts +0 -2
  525. package/dist/packages/core/po-core/dist/src/web/models/globalStore.d.mts +0 -1
  526. package/dist/packages/core/po-core/dist/src/web/models/sessionStore.d.mts +0 -1
  527. package/dist/packages/core/po-core/dist/src/web/models/workspaceStore.d.mts +0 -1
  528. package/dist/packages/core/po-core/dist/src/web/schemas/template.d.mts +0 -2
  529. package/dist/packages/core/po-core/dist/src/web/services/mcpWidget.d.mts +0 -1
  530. package/dist/packages/core/po-core/dist/src/web/types/extensionFile.d.mts +0 -3
  531. package/dist/packages/core/po-core/dist/src/web/types/mcpWidget.d.mts +0 -17
  532. package/dist/packages/core/po-core/dist/src/web/types/mcpWidget.d.mts.map +0 -1
  533. package/dist/packages/core/po-core/dist/src/web/types/nativeTemplate.d.mts +0 -2
  534. package/dist/packages/core/po-core/dist/src/web/types/template.d.mts +0 -1
  535. package/dist/packages/core/po-core/dist/src/web/types/webPlugin.d.mts +0 -3
  536. package/dist/packages/core/po-core/dist/web.d.mts +0 -12
  537. package/dist/packages/core/po-web-components/src/components/Accordion.d.mts.map +0 -1
  538. package/dist/packages/core/po-web-components/src/components/Accordion.mjs.map +0 -1
  539. package/dist/packages/core/po-web-components/src/components/AgentAvatar.d.mts.map +0 -1
  540. package/dist/packages/core/po-web-components/src/components/AgentAvatar.mjs +0 -2
  541. package/dist/packages/core/po-web-components/src/components/AgentAvatar.mjs.map +0 -1
  542. package/dist/packages/core/po-web-components/src/components/AnsiText.d.mts.map +0 -1
  543. package/dist/packages/core/po-web-components/src/components/AnsiText.mjs.map +0 -1
  544. package/dist/packages/core/po-web-components/src/components/Avatar.d.mts.map +0 -1
  545. package/dist/packages/core/po-web-components/src/components/Avatar.mjs.map +0 -1
  546. package/dist/packages/core/po-web-components/src/components/Badge.d.mts.map +0 -1
  547. package/dist/packages/core/po-web-components/src/components/Badge.mjs.map +0 -1
  548. package/dist/packages/core/po-web-components/src/components/Breadcrumb.d.mts.map +0 -1
  549. package/dist/packages/core/po-web-components/src/components/Breadcrumb.mjs.map +0 -1
  550. package/dist/packages/core/po-web-components/src/components/Button.d.mts.map +0 -1
  551. package/dist/packages/core/po-web-components/src/components/Button.mjs.map +0 -1
  552. package/dist/packages/core/po-web-components/src/components/Checkbox.d.mts.map +0 -1
  553. package/dist/packages/core/po-web-components/src/components/Checkbox.mjs.map +0 -1
  554. package/dist/packages/core/po-web-components/src/components/CodeBlock.d.mts.map +0 -1
  555. package/dist/packages/core/po-web-components/src/components/CodeBlock.mjs.map +0 -1
  556. package/dist/packages/core/po-web-components/src/components/CodeEditor.d.mts.map +0 -1
  557. package/dist/packages/core/po-web-components/src/components/CodeEditor.mjs.map +0 -1
  558. package/dist/packages/core/po-web-components/src/components/CodeEditorView.mjs.map +0 -1
  559. package/dist/packages/core/po-web-components/src/components/Collapsible.d.mts.map +0 -1
  560. package/dist/packages/core/po-web-components/src/components/Collapsible.mjs.map +0 -1
  561. package/dist/packages/core/po-web-components/src/components/Command.d.mts.map +0 -1
  562. package/dist/packages/core/po-web-components/src/components/Command.mjs.map +0 -1
  563. package/dist/packages/core/po-web-components/src/components/CopyButton.mjs +0 -2
  564. package/dist/packages/core/po-web-components/src/components/CopyButton.mjs.map +0 -1
  565. package/dist/packages/core/po-web-components/src/components/Dialog.d.mts.map +0 -1
  566. package/dist/packages/core/po-web-components/src/components/Dialog.mjs +0 -2
  567. package/dist/packages/core/po-web-components/src/components/Dialog.mjs.map +0 -1
  568. package/dist/packages/core/po-web-components/src/components/DiffView.d.mts.map +0 -1
  569. package/dist/packages/core/po-web-components/src/components/DiffView.mjs +0 -2
  570. package/dist/packages/core/po-web-components/src/components/DiffView.mjs.map +0 -1
  571. package/dist/packages/core/po-web-components/src/components/Dot.d.mts.map +0 -1
  572. package/dist/packages/core/po-web-components/src/components/Dot.mjs.map +0 -1
  573. package/dist/packages/core/po-web-components/src/components/Drawer.d.mts.map +0 -1
  574. package/dist/packages/core/po-web-components/src/components/Drawer.mjs.map +0 -1
  575. package/dist/packages/core/po-web-components/src/components/DropdownMenu.d.mts.map +0 -1
  576. package/dist/packages/core/po-web-components/src/components/DropdownMenu.mjs.map +0 -1
  577. package/dist/packages/core/po-web-components/src/components/EmptyState.d.mts +0 -17
  578. package/dist/packages/core/po-web-components/src/components/EmptyState.d.mts.map +0 -1
  579. package/dist/packages/core/po-web-components/src/components/EmptyState.mjs +0 -2
  580. package/dist/packages/core/po-web-components/src/components/EmptyState.mjs.map +0 -1
  581. package/dist/packages/core/po-web-components/src/components/HashlineLines.d.mts.map +0 -1
  582. package/dist/packages/core/po-web-components/src/components/HashlineLines.mjs +0 -2
  583. package/dist/packages/core/po-web-components/src/components/HashlineLines.mjs.map +0 -1
  584. package/dist/packages/core/po-web-components/src/components/Input.d.mts.map +0 -1
  585. package/dist/packages/core/po-web-components/src/components/Input.mjs +0 -2
  586. package/dist/packages/core/po-web-components/src/components/Input.mjs.map +0 -1
  587. package/dist/packages/core/po-web-components/src/components/Kbd.d.mts.map +0 -1
  588. package/dist/packages/core/po-web-components/src/components/Kbd.mjs.map +0 -1
  589. package/dist/packages/core/po-web-components/src/components/Label.d.mts.map +0 -1
  590. package/dist/packages/core/po-web-components/src/components/Label.mjs.map +0 -1
  591. package/dist/packages/core/po-web-components/src/components/Markdown.d.mts +0 -23
  592. package/dist/packages/core/po-web-components/src/components/Markdown.d.mts.map +0 -1
  593. package/dist/packages/core/po-web-components/src/components/Markdown.mjs +0 -3
  594. package/dist/packages/core/po-web-components/src/components/Markdown.mjs.map +0 -1
  595. package/dist/packages/core/po-web-components/src/components/McpApp.d.mts.map +0 -1
  596. package/dist/packages/core/po-web-components/src/components/McpApp.mjs +0 -2
  597. package/dist/packages/core/po-web-components/src/components/McpApp.mjs.map +0 -1
  598. package/dist/packages/core/po-web-components/src/components/McpToolWidget.d.mts.map +0 -1
  599. package/dist/packages/core/po-web-components/src/components/McpToolWidget.mjs +0 -3
  600. package/dist/packages/core/po-web-components/src/components/McpToolWidget.mjs.map +0 -1
  601. package/dist/packages/core/po-web-components/src/components/MediaPreview.d.mts.map +0 -1
  602. package/dist/packages/core/po-web-components/src/components/MediaPreview.mjs +0 -2
  603. package/dist/packages/core/po-web-components/src/components/MediaPreview.mjs.map +0 -1
  604. package/dist/packages/core/po-web-components/src/components/MermaidDiagram.mjs +0 -2
  605. package/dist/packages/core/po-web-components/src/components/MermaidDiagram.mjs.map +0 -1
  606. package/dist/packages/core/po-web-components/src/components/MessageItem.d.mts.map +0 -1
  607. package/dist/packages/core/po-web-components/src/components/MessageItem.mjs +0 -2
  608. package/dist/packages/core/po-web-components/src/components/MessageItem.mjs.map +0 -1
  609. package/dist/packages/core/po-web-components/src/components/MessageLines.d.mts.map +0 -1
  610. package/dist/packages/core/po-web-components/src/components/MessageLines.mjs.map +0 -1
  611. package/dist/packages/core/po-web-components/src/components/OptionList.d.mts.map +0 -1
  612. package/dist/packages/core/po-web-components/src/components/OptionList.mjs +0 -2
  613. package/dist/packages/core/po-web-components/src/components/OptionList.mjs.map +0 -1
  614. package/dist/packages/core/po-web-components/src/components/Panel.d.mts.map +0 -1
  615. package/dist/packages/core/po-web-components/src/components/Panel.mjs.map +0 -1
  616. package/dist/packages/core/po-web-components/src/components/PdfPreview.d.mts.map +0 -1
  617. package/dist/packages/core/po-web-components/src/components/PdfPreview.mjs +0 -2
  618. package/dist/packages/core/po-web-components/src/components/PdfPreview.mjs.map +0 -1
  619. package/dist/packages/core/po-web-components/src/components/Picker.d.mts.map +0 -1
  620. package/dist/packages/core/po-web-components/src/components/Picker.mjs +0 -2
  621. package/dist/packages/core/po-web-components/src/components/Picker.mjs.map +0 -1
  622. package/dist/packages/core/po-web-components/src/components/Popover.d.mts.map +0 -1
  623. package/dist/packages/core/po-web-components/src/components/Popover.mjs.map +0 -1
  624. package/dist/packages/core/po-web-components/src/components/Progress.d.mts.map +0 -1
  625. package/dist/packages/core/po-web-components/src/components/Progress.mjs.map +0 -1
  626. package/dist/packages/core/po-web-components/src/components/RadioGroup.d.mts.map +0 -1
  627. package/dist/packages/core/po-web-components/src/components/RadioGroup.mjs.map +0 -1
  628. package/dist/packages/core/po-web-components/src/components/ReviewCommentDraft.d.mts.map +0 -1
  629. package/dist/packages/core/po-web-components/src/components/ReviewCommentDraft.mjs +0 -2
  630. package/dist/packages/core/po-web-components/src/components/ReviewCommentDraft.mjs.map +0 -1
  631. package/dist/packages/core/po-web-components/src/components/ScrollArea.d.mts.map +0 -1
  632. package/dist/packages/core/po-web-components/src/components/ScrollArea.mjs.map +0 -1
  633. package/dist/packages/core/po-web-components/src/components/SectionLabel.d.mts.map +0 -1
  634. package/dist/packages/core/po-web-components/src/components/SectionLabel.mjs.map +0 -1
  635. package/dist/packages/core/po-web-components/src/components/Select.d.mts.map +0 -1
  636. package/dist/packages/core/po-web-components/src/components/Select.mjs.map +0 -1
  637. package/dist/packages/core/po-web-components/src/components/Separator.d.mts.map +0 -1
  638. package/dist/packages/core/po-web-components/src/components/Separator.mjs.map +0 -1
  639. package/dist/packages/core/po-web-components/src/components/Settings.d.mts.map +0 -1
  640. package/dist/packages/core/po-web-components/src/components/Settings.mjs.map +0 -1
  641. package/dist/packages/core/po-web-components/src/components/Sheet.d.mts.map +0 -1
  642. package/dist/packages/core/po-web-components/src/components/Sheet.mjs +0 -2
  643. package/dist/packages/core/po-web-components/src/components/Sheet.mjs.map +0 -1
  644. package/dist/packages/core/po-web-components/src/components/Skeleton.d.mts.map +0 -1
  645. package/dist/packages/core/po-web-components/src/components/Skeleton.mjs.map +0 -1
  646. package/dist/packages/core/po-web-components/src/components/Spinner.d.mts.map +0 -1
  647. package/dist/packages/core/po-web-components/src/components/Spinner.mjs.map +0 -1
  648. package/dist/packages/core/po-web-components/src/components/StatusBadge.d.mts.map +0 -1
  649. package/dist/packages/core/po-web-components/src/components/StatusBadge.mjs.map +0 -1
  650. package/dist/packages/core/po-web-components/src/components/StreamCursor.d.mts.map +0 -1
  651. package/dist/packages/core/po-web-components/src/components/StreamCursor.mjs.map +0 -1
  652. package/dist/packages/core/po-web-components/src/components/Switch.d.mts.map +0 -1
  653. package/dist/packages/core/po-web-components/src/components/Switch.mjs.map +0 -1
  654. package/dist/packages/core/po-web-components/src/components/SyntaxText.d.mts.map +0 -1
  655. package/dist/packages/core/po-web-components/src/components/SyntaxText.mjs.map +0 -1
  656. package/dist/packages/core/po-web-components/src/components/Tabs.d.mts.map +0 -1
  657. package/dist/packages/core/po-web-components/src/components/Tabs.mjs +0 -2
  658. package/dist/packages/core/po-web-components/src/components/Tabs.mjs.map +0 -1
  659. package/dist/packages/core/po-web-components/src/components/TerminalView.d.mts.map +0 -1
  660. package/dist/packages/core/po-web-components/src/components/TerminalView.mjs.map +0 -1
  661. package/dist/packages/core/po-web-components/src/components/Textarea.d.mts.map +0 -1
  662. package/dist/packages/core/po-web-components/src/components/Textarea.mjs.map +0 -1
  663. package/dist/packages/core/po-web-components/src/components/Toast.d.mts.map +0 -1
  664. package/dist/packages/core/po-web-components/src/components/Toast.mjs +0 -2
  665. package/dist/packages/core/po-web-components/src/components/Toast.mjs.map +0 -1
  666. package/dist/packages/core/po-web-components/src/components/ToolPathLink.d.mts.map +0 -1
  667. package/dist/packages/core/po-web-components/src/components/ToolPathLink.mjs +0 -2
  668. package/dist/packages/core/po-web-components/src/components/ToolPathLink.mjs.map +0 -1
  669. package/dist/packages/core/po-web-components/src/components/Tooltip.d.mts.map +0 -1
  670. package/dist/packages/core/po-web-components/src/components/Tooltip.mjs.map +0 -1
  671. package/dist/packages/core/po-web-components/src/icons/icons.d.mts +0 -2
  672. package/dist/packages/core/po-web-components/src/icons/icons.mjs +0 -1
  673. package/dist/packages/core/po-web-components/src/lib/ansiSpans.d.mts.map +0 -1
  674. package/dist/packages/core/po-web-components/src/lib/ansiSpans.mjs.map +0 -1
  675. package/dist/packages/core/po-web-components/src/lib/cn.d.mts.map +0 -1
  676. package/dist/packages/core/po-web-components/src/lib/cn.mjs.map +0 -1
  677. package/dist/packages/core/po-web-components/src/lib/collapse.d.mts.map +0 -1
  678. package/dist/packages/core/po-web-components/src/lib/collapse.mjs.map +0 -1
  679. package/dist/packages/core/po-web-components/src/lib/editorController.mjs.map +0 -1
  680. package/dist/packages/core/po-web-components/src/lib/editorLanguage.d.mts.map +0 -1
  681. package/dist/packages/core/po-web-components/src/lib/editorLanguage.mjs.map +0 -1
  682. package/dist/packages/core/po-web-components/src/lib/editorTheme.d.mts.map +0 -1
  683. package/dist/packages/core/po-web-components/src/lib/editorTheme.mjs.map +0 -1
  684. package/dist/packages/core/po-web-components/src/lib/fenceGrammar.mjs.map +0 -1
  685. package/dist/packages/core/po-web-components/src/lib/hashlineHighlight.d.mts.map +0 -1
  686. package/dist/packages/core/po-web-components/src/lib/hashlineHighlight.mjs.map +0 -1
  687. package/dist/packages/core/po-web-components/src/lib/hashlineView.d.mts.map +0 -1
  688. package/dist/packages/core/po-web-components/src/lib/hashlineView.mjs.map +0 -1
  689. package/dist/packages/core/po-web-components/src/lib/media.d.mts.map +0 -1
  690. package/dist/packages/core/po-web-components/src/lib/media.mjs.map +0 -1
  691. package/dist/packages/core/po-web-components/src/lib/mediaPlayback.mjs.map +0 -1
  692. package/dist/packages/core/po-web-components/src/lib/mermaidDiagram.mjs +0 -2
  693. package/dist/packages/core/po-web-components/src/lib/mermaidDiagram.mjs.map +0 -1
  694. package/dist/packages/core/po-web-components/src/lib/optionList.d.mts.map +0 -1
  695. package/dist/packages/core/po-web-components/src/lib/optionList.mjs.map +0 -1
  696. package/dist/packages/core/po-web-components/src/lib/pathGroups.d.mts.map +0 -1
  697. package/dist/packages/core/po-web-components/src/lib/pathGroups.mjs.map +0 -1
  698. package/dist/packages/core/po-web-components/src/lib/picker.d.mts.map +0 -1
  699. package/dist/packages/core/po-web-components/src/lib/picker.mjs +0 -2
  700. package/dist/packages/core/po-web-components/src/lib/picker.mjs.map +0 -1
  701. package/dist/packages/core/po-web-components/src/lib/review.d.mts.map +0 -1
  702. package/dist/packages/core/po-web-components/src/lib/review.mjs.map +0 -1
  703. package/dist/packages/core/po-web-components/src/lib/syntaxHighlight.d.mts.map +0 -1
  704. package/dist/packages/core/po-web-components/src/lib/syntaxHighlight.mjs.map +0 -1
  705. package/dist/packages/core/po-web-components/src/lib/tone.d.mts.map +0 -1
  706. package/dist/packages/core/po-web-components/src/lib/tone.mjs.map +0 -1
  707. package/dist/packages/core/po-web-components/src/theme/apply.d.mts.map +0 -1
  708. package/dist/packages/core/po-web-components/src/theme/apply.mjs.map +0 -1
  709. package/dist/packages/core/po-web-components/src/theme/builtinThemes.d.mts.map +0 -1
  710. package/dist/packages/core/po-web-components/src/theme/builtinThemes.mjs.map +0 -1
  711. package/dist/packages/core/po-web-components/src/theme/derive.d.mts.map +0 -1
  712. package/dist/packages/core/po-web-components/src/theme/derive.mjs.map +0 -1
  713. package/dist/packages/core/po-web-components/src/theme/nativeTheme.d.mts.map +0 -1
  714. package/dist/packages/core/po-web-components/src/theme/nativeTheme.mjs.map +0 -1
  715. package/dist/packages/core/po-web-components/src/theme/parse.d.mts.map +0 -1
  716. package/dist/packages/core/po-web-components/src/theme/parse.mjs.map +0 -1
  717. package/dist/packages/core/po-web-components/src/theme/piTheme.d.mts.map +0 -1
  718. package/dist/packages/core/po-web-components/src/theme/piTheme.mjs.map +0 -1
  719. package/dist/packages/core/po-web-components/src/theme/preference.d.mts.map +0 -1
  720. package/dist/packages/core/po-web-components/src/theme/preference.mjs.map +0 -1
  721. package/dist/packages/core/po-web-components/src/types/diff.d.mts.map +0 -1
  722. package/dist/packages/core/po-web-components/src/types/editor.d.mts.map +0 -1
  723. package/dist/packages/core/po-web-components/src/types/editor.mjs.map +0 -1
  724. package/dist/packages/core/po-web-components/src/types/theme.d.mts.map +0 -1
  725. package/dist/packages/core/po-web-components/src/types/theme.mjs.map +0 -1
  726. package/dist/packages/core/po-web-components/src/types/tone.d.mts.map +0 -1
  727. package/dist/packages/core/po-web-components/src/types/tone.mjs.map +0 -1
  728. /package/dist/{packages/core/po-web-components/src → src}/components/Accordion.d.mts +0 -0
  729. /package/dist/{packages/core/po-web-components/src → src}/components/Accordion.mjs +0 -0
  730. /package/dist/{packages/core/po-web-components/src → src}/components/AnsiText.d.mts +0 -0
  731. /package/dist/{packages/core/po-web-components/src → src}/components/AnsiText.mjs +0 -0
  732. /package/dist/{packages/core/po-web-components/src → src}/components/Avatar.d.mts +0 -0
  733. /package/dist/{packages/core/po-web-components/src → src}/components/Avatar.mjs +0 -0
  734. /package/dist/{packages/core/po-web-components/src → src}/components/Badge.d.mts +0 -0
  735. /package/dist/{packages/core/po-web-components/src → src}/components/Badge.mjs +0 -0
  736. /package/dist/{packages/core/po-web-components/src → src}/components/Breadcrumb.d.mts +0 -0
  737. /package/dist/{packages/core/po-web-components/src → src}/components/Breadcrumb.mjs +0 -0
  738. /package/dist/{packages/core/po-web-components/src → src}/components/Button.d.mts +0 -0
  739. /package/dist/{packages/core/po-web-components/src → src}/components/Button.mjs +0 -0
  740. /package/dist/{packages/core/po-web-components/src → src}/components/Checkbox.d.mts +0 -0
  741. /package/dist/{packages/core/po-web-components/src → src}/components/Checkbox.mjs +0 -0
  742. /package/dist/{packages/core/po-web-components/src → src}/components/CodeBlock.d.mts +0 -0
  743. /package/dist/{packages/core/po-web-components/src → src}/components/CodeBlock.mjs +0 -0
  744. /package/dist/{packages/core/po-web-components/src → src}/components/CodeEditor.d.mts +0 -0
  745. /package/dist/{packages/core/po-web-components/src → src}/components/CodeEditor.mjs +0 -0
  746. /package/dist/{packages/core/po-web-components/src → src}/components/CodeEditorView.mjs +0 -0
  747. /package/dist/{packages/core/po-web-components/src → src}/components/Collapsible.d.mts +0 -0
  748. /package/dist/{packages/core/po-web-components/src → src}/components/Collapsible.mjs +0 -0
  749. /package/dist/{packages/core/po-web-components/src → src}/components/Command.d.mts +0 -0
  750. /package/dist/{packages/core/po-web-components/src → src}/components/Command.mjs +0 -0
  751. /package/dist/{packages/core/po-web-components/src → src}/components/Dialog.d.mts +0 -0
  752. /package/dist/{packages/core/po-web-components/src → src}/components/DiffView.d.mts +0 -0
  753. /package/dist/{packages/core/po-web-components/src → src}/components/Dot.d.mts +0 -0
  754. /package/dist/{packages/core/po-web-components/src → src}/components/Dot.mjs +0 -0
  755. /package/dist/{packages/core/po-web-components/src → src}/components/Drawer.d.mts +0 -0
  756. /package/dist/{packages/core/po-web-components/src → src}/components/Drawer.mjs +0 -0
  757. /package/dist/{packages/core/po-web-components/src → src}/components/DropdownMenu.d.mts +0 -0
  758. /package/dist/{packages/core/po-web-components/src → src}/components/HashlineLines.d.mts +0 -0
  759. /package/dist/{packages/core/po-web-components/src → src}/components/Input.d.mts +0 -0
  760. /package/dist/{packages/core/po-web-components/src → src}/components/Kbd.d.mts +0 -0
  761. /package/dist/{packages/core/po-web-components/src → src}/components/Kbd.mjs +0 -0
  762. /package/dist/{packages/core/po-web-components/src → src}/components/Label.d.mts +0 -0
  763. /package/dist/{packages/core/po-web-components/src → src}/components/Label.mjs +0 -0
  764. /package/dist/{packages/core/po-web-components/src → src}/components/MediaPreview.d.mts +0 -0
  765. /package/dist/{packages/core/po-web-components/src → src}/components/MessageLines.d.mts +0 -0
  766. /package/dist/{packages/core/po-web-components/src → src}/components/MessageLines.mjs +0 -0
  767. /package/dist/{packages/core/po-web-components/src → src}/components/OptionList.d.mts +0 -0
  768. /package/dist/{packages/core/po-web-components/src → src}/components/Panel.d.mts +0 -0
  769. /package/dist/{packages/core/po-web-components/src → src}/components/Panel.mjs +0 -0
  770. /package/dist/{packages/core/po-web-components/src → src}/components/PdfPreview.d.mts +0 -0
  771. /package/dist/{packages/core/po-web-components/src → src}/components/Popover.d.mts +0 -0
  772. /package/dist/{packages/core/po-web-components/src → src}/components/Popover.mjs +0 -0
  773. /package/dist/{packages/core/po-web-components/src → src}/components/Progress.d.mts +0 -0
  774. /package/dist/{packages/core/po-web-components/src → src}/components/Progress.mjs +0 -0
  775. /package/dist/{packages/core/po-web-components/src → src}/components/RadioGroup.d.mts +0 -0
  776. /package/dist/{packages/core/po-web-components/src → src}/components/RadioGroup.mjs +0 -0
  777. /package/dist/{packages/core/po-web-components/src → src}/components/ReviewCommentDraft.d.mts +0 -0
  778. /package/dist/{packages/core/po-web-components/src → src}/components/ScrollArea.d.mts +0 -0
  779. /package/dist/{packages/core/po-web-components/src → src}/components/ScrollArea.mjs +0 -0
  780. /package/dist/{packages/core/po-web-components/src → src}/components/SectionLabel.mjs +0 -0
  781. /package/dist/{packages/core/po-web-components/src → src}/components/Select.d.mts +0 -0
  782. /package/dist/{packages/core/po-web-components/src → src}/components/Select.mjs +0 -0
  783. /package/dist/{packages/core/po-web-components/src → src}/components/Separator.d.mts +0 -0
  784. /package/dist/{packages/core/po-web-components/src → src}/components/Separator.mjs +0 -0
  785. /package/dist/{packages/core/po-web-components/src → src}/components/Settings.d.mts +0 -0
  786. /package/dist/{packages/core/po-web-components/src → src}/components/Settings.mjs +0 -0
  787. /package/dist/{packages/core/po-web-components/src → src}/components/Sheet.d.mts +0 -0
  788. /package/dist/{packages/core/po-web-components/src → src}/components/Skeleton.d.mts +0 -0
  789. /package/dist/{packages/core/po-web-components/src → src}/components/Skeleton.mjs +0 -0
  790. /package/dist/{packages/core/po-web-components/src → src}/components/Spinner.d.mts +0 -0
  791. /package/dist/{packages/core/po-web-components/src → src}/components/Spinner.mjs +0 -0
  792. /package/dist/{packages/core/po-web-components/src → src}/components/StatusBadge.d.mts +0 -0
  793. /package/dist/{packages/core/po-web-components/src → src}/components/StatusBadge.mjs +0 -0
  794. /package/dist/{packages/core/po-web-components/src → src}/components/StreamCursor.d.mts +0 -0
  795. /package/dist/{packages/core/po-web-components/src → src}/components/StreamCursor.mjs +0 -0
  796. /package/dist/{packages/core/po-web-components/src → src}/components/Switch.d.mts +0 -0
  797. /package/dist/{packages/core/po-web-components/src → src}/components/Switch.mjs +0 -0
  798. /package/dist/{packages/core/po-web-components/src → src}/components/SyntaxText.d.mts +0 -0
  799. /package/dist/{packages/core/po-web-components/src → src}/components/TerminalView.d.mts +0 -0
  800. /package/dist/{packages/core/po-web-components/src → src}/components/TerminalView.mjs +0 -0
  801. /package/dist/{packages/core/po-web-components/src → src}/components/Textarea.d.mts +0 -0
  802. /package/dist/{packages/core/po-web-components/src → src}/components/Textarea.mjs +0 -0
  803. /package/dist/{packages/core/po-web-components/src → src}/components/Toast.d.mts +0 -0
  804. /package/dist/{packages/core/po-web-components/src → src}/components/ToolPathLink.d.mts +0 -0
  805. /package/dist/{packages/core/po-web-components/src → src}/components/Tooltip.d.mts +0 -0
  806. /package/dist/{packages/core/po-web-components/src → src}/components/Tooltip.mjs +0 -0
  807. /package/dist/{packages/core/po-web-components/src → src}/lib/ansiSpans.d.mts +0 -0
  808. /package/dist/{packages/core/po-web-components/src → src}/lib/ansiSpans.mjs +0 -0
  809. /package/dist/{packages/core/po-web-components/src → src}/lib/cn.d.mts +0 -0
  810. /package/dist/{packages/core/po-web-components/src → src}/lib/cn.mjs +0 -0
  811. /package/dist/{packages/core/po-web-components/src → src}/lib/collapse.d.mts +0 -0
  812. /package/dist/{packages/core/po-web-components/src → src}/lib/collapse.mjs +0 -0
  813. /package/dist/{packages/core/po-web-components/src → src}/lib/editorController.mjs +0 -0
  814. /package/dist/{packages/core/po-web-components/src → src}/lib/editorLanguage.d.mts +0 -0
  815. /package/dist/{packages/core/po-web-components/src → src}/lib/editorLanguage.mjs +0 -0
  816. /package/dist/{packages/core/po-web-components/src → src}/lib/editorTheme.d.mts +0 -0
  817. /package/dist/{packages/core/po-web-components/src → src}/lib/editorTheme.mjs +0 -0
  818. /package/dist/{packages/core/po-web-components/src → src}/lib/fenceGrammar.mjs +0 -0
  819. /package/dist/{packages/core/po-web-components/src → src}/lib/hashlineHighlight.d.mts +0 -0
  820. /package/dist/{packages/core/po-web-components/src → src}/lib/hashlineView.d.mts +0 -0
  821. /package/dist/{packages/core/po-web-components/src → src}/lib/hashlineView.mjs +0 -0
  822. /package/dist/{packages/core/po-web-components/src → src}/lib/media.d.mts +0 -0
  823. /package/dist/{packages/core/po-web-components/src → src}/lib/media.mjs +0 -0
  824. /package/dist/{packages/core/po-web-components/src → src}/lib/mediaPlayback.mjs +0 -0
  825. /package/dist/{packages/core/po-web-components/src → src}/lib/optionList.d.mts +0 -0
  826. /package/dist/{packages/core/po-web-components/src → src}/lib/optionList.mjs +0 -0
  827. /package/dist/{packages/core/po-web-components/src → src}/lib/pathGroups.d.mts +0 -0
  828. /package/dist/{packages/core/po-web-components/src → src}/lib/pathGroups.mjs +0 -0
  829. /package/dist/{packages/core/po-web-components/src → src}/lib/picker.d.mts +0 -0
  830. /package/dist/{packages/core/po-web-components/src → src}/lib/review.d.mts +0 -0
  831. /package/dist/{packages/core/po-web-components/src → src}/lib/review.mjs +0 -0
  832. /package/dist/{packages/core/po-web-components/src → src}/lib/tone.d.mts +0 -0
  833. /package/dist/{packages/core/po-web-components/src → src}/lib/tone.mjs +0 -0
  834. /package/dist/{packages/core/po-web-components/src → src}/theme/apply.d.mts +0 -0
  835. /package/dist/{packages/core/po-web-components/src → src}/theme/apply.mjs +0 -0
  836. /package/dist/{packages/core/po-web-components/src → src}/theme/builtinThemes.d.mts +0 -0
  837. /package/dist/{packages/core/po-web-components/src → src}/theme/builtinThemes.mjs +0 -0
  838. /package/dist/{packages/core/po-web-components/src → src}/theme/derive.d.mts +0 -0
  839. /package/dist/{packages/core/po-web-components/src → src}/theme/derive.mjs +0 -0
  840. /package/dist/{packages/core/po-web-components/src → src}/theme/nativeTheme.d.mts +0 -0
  841. /package/dist/{packages/core/po-web-components/src → src}/theme/nativeTheme.mjs +0 -0
  842. /package/dist/{packages/core/po-web-components/src → src}/theme/parse.d.mts +0 -0
  843. /package/dist/{packages/core/po-web-components/src → src}/theme/parse.mjs +0 -0
  844. /package/dist/{packages/core/po-web-components/src → src}/theme/piTheme.d.mts +0 -0
  845. /package/dist/{packages/core/po-web-components/src → src}/theme/piTheme.mjs +0 -0
  846. /package/dist/{packages/core/po-web-components/src → src}/theme/preference.d.mts +0 -0
  847. /package/dist/{packages/core/po-web-components/src → src}/theme/preference.mjs +0 -0
  848. /package/dist/{packages/core/po-web-components/src → src}/types/diff.d.mts +0 -0
  849. /package/dist/{packages/core/po-web-components/src → src}/types/editor.d.mts +0 -0
  850. /package/dist/{packages/core/po-web-components/src → src}/types/editor.mjs +0 -0
  851. /package/dist/{packages/core/po-web-components/src → src}/types/theme.d.mts +0 -0
  852. /package/dist/{packages/core/po-web-components/src → src}/types/theme.mjs +0 -0
  853. /package/dist/{packages/core/po-web-components/src → src}/types/tone.d.mts +0 -0
  854. /package/dist/{packages/core/po-web-components/src → src}/types/tone.mjs +0 -0
  855. /package/dist/{packages/core/po-web-components/themes → themes}/po-one-light.mjs +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runDuration.cjs","names":["MINUTE_MS","HOUR_MS","formatRunDuration","elapsedMs","hours","minutes","clockText","clock","now","clockRefreshMs","elapsed","since"],"sources":["../../../src/lib/runDuration.ts"],"sourcesContent":["const MINUTE_MS = 60_000;\nconst HOUR_MS = 3_600_000;\n\n/** How long a run has gone on, to the minute: \"<1m\", \"12m\", \"2h 05m\". */\nexport function formatRunDuration(elapsedMs: number): string {\n if (elapsedMs < MINUTE_MS) return '<1m';\n if (elapsedMs < HOUR_MS) return `${Math.floor(elapsedMs / MINUTE_MS)}m`;\n const hours = Math.floor(elapsedMs / HOUR_MS);\n const minutes = Math.floor((elapsedMs % HOUR_MS) / MINUTE_MS);\n return `${hours}h ${String(minutes).padStart(2, '0')}m`;\n}\n\n/** A status clock read at `now`: \"running · 12m\". */\nexport function clockText(clock: { label: string; since: number }, now: number): string {\n return `${clock.label} · ${formatRunDuration(Math.max(0, now - clock.since))}`;\n}\n\n/** Milliseconds until a clock read at `now` shows a different minute. */\nexport function clockRefreshMs(since: number, now: number): number {\n const elapsed = Math.max(0, now - since);\n return MINUTE_MS - (elapsed % MINUTE_MS);\n}\n"],"mappings":"AAAA,MAAMA,EAAY,IACZC,EAAU,KAGhB,SAAgBC,EAAkB,EAA2B,CAC3D,GAAIC,EAAYH,EAAW,MAAO,MAClC,GAAIG,EAAYF,EAAS,MAAO,GAAG,KAAK,MAAME,EAAYH,CAAS,EAAE,GACrE,IAAMI,EAAQ,KAAK,MAAMD,EAAYF,CAAO,EACtCI,EAAU,KAAK,MAAOF,EAAYF,EAAWD,CAAS,EAC5D,MAAO,GAAGI,EAAM,IAAI,OAAOC,CAAO,CAAC,CAAC,SAAS,EAAG,GAAG,EAAE,EACvD,CAGA,SAAgBC,EAAU,EAAyC,EAAqB,CACtF,MAAO,GAAGC,EAAM,MAAM,KAAKL,EAAkB,KAAK,IAAI,EAAGM,EAAMD,EAAM,KAAK,CAAC,GAC7E,CAGA,SAAgBE,EAAe,EAAe,EAAqB,CACjE,IAAMC,EAAU,KAAK,IAAI,EAAGF,EAAMG,CAAK,EACvC,OAAOX,EAAaU,EAAUV,CAChC,C"}
@@ -0,0 +1,12 @@
1
+ //#region src/lib/runDuration.d.ts
2
+ /** How long a run has gone on, to the minute: "<1m", "12m", "2h 05m". */
3
+ export declare function formatRunDuration(elapsedMs: number): string;
4
+ /** A status clock read at `now`: "running · 12m". */
5
+ export declare function clockText(clock: {
6
+ label: string;
7
+ since: number;
8
+ }, now: number): string;
9
+ /** Milliseconds until a clock read at `now` shows a different minute. */
10
+ export declare function clockRefreshMs(since: number, now: number): number;
11
+ //#endregion
12
+ //# sourceMappingURL=runDuration.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runDuration.d.mts","names":[],"sources":["../../../src/lib/runDuration.ts"],"mappings":";;wBAIgB,kBAAkB;;wBASlB,UAAU;EAAS;EAAe;GAAiB;;wBAKnD,eAAe,eAAe"}
@@ -0,0 +1,2 @@
1
+ const e=6e4,t=36e5;function n(n){if(n<e)return`<1m`;if(n<t)return`${Math.floor(n/e)}m`;let r=Math.floor(n/t),i=Math.floor(n%t/e);return`${r}h ${String(i).padStart(2,`0`)}m`}function r(e,t){return`${e.label} · ${n(Math.max(0,t-e.since))}`}function i(t,n){let r=Math.max(0,n-t);return e-r%e}export{i as clockRefreshMs,r as clockText,n as formatRunDuration};
2
+ //# sourceMappingURL=runDuration.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runDuration.mjs","names":["MINUTE_MS","HOUR_MS","formatRunDuration","elapsedMs","hours","minutes","clockText","clock","now","clockRefreshMs","elapsed","since"],"sources":["../../../src/lib/runDuration.ts"],"sourcesContent":["const MINUTE_MS = 60_000;\nconst HOUR_MS = 3_600_000;\n\n/** How long a run has gone on, to the minute: \"<1m\", \"12m\", \"2h 05m\". */\nexport function formatRunDuration(elapsedMs: number): string {\n if (elapsedMs < MINUTE_MS) return '<1m';\n if (elapsedMs < HOUR_MS) return `${Math.floor(elapsedMs / MINUTE_MS)}m`;\n const hours = Math.floor(elapsedMs / HOUR_MS);\n const minutes = Math.floor((elapsedMs % HOUR_MS) / MINUTE_MS);\n return `${hours}h ${String(minutes).padStart(2, '0')}m`;\n}\n\n/** A status clock read at `now`: \"running · 12m\". */\nexport function clockText(clock: { label: string; since: number }, now: number): string {\n return `${clock.label} · ${formatRunDuration(Math.max(0, now - clock.since))}`;\n}\n\n/** Milliseconds until a clock read at `now` shows a different minute. */\nexport function clockRefreshMs(since: number, now: number): number {\n const elapsed = Math.max(0, now - since);\n return MINUTE_MS - (elapsed % MINUTE_MS);\n}\n"],"mappings":"AAAA,MAAMA,EAAY,IACZC,EAAU,KAGhB,SAAgBC,EAAkB,EAA2B,CAC3D,GAAIC,EAAYH,EAAW,MAAO,MAClC,GAAIG,EAAYF,EAAS,MAAO,GAAG,KAAK,MAAME,EAAYH,CAAS,EAAE,GACrE,IAAMI,EAAQ,KAAK,MAAMD,EAAYF,CAAO,EACtCI,EAAU,KAAK,MAAOF,EAAYF,EAAWD,CAAS,EAC5D,MAAO,GAAGI,EAAM,IAAI,OAAOC,CAAO,CAAC,CAAC,SAAS,EAAG,GAAG,EAAE,EACvD,CAGA,SAAgBC,EAAU,EAAyC,EAAqB,CACtF,MAAO,GAAGC,EAAM,MAAM,KAAKL,EAAkB,KAAK,IAAI,EAAGM,EAAMD,EAAM,KAAK,CAAC,GAC7E,CAGA,SAAgBE,EAAe,EAAe,EAAqB,CACjE,IAAMC,EAAU,KAAK,IAAI,EAAGF,EAAMG,CAAK,EACvC,OAAOX,EAAaU,EAAUV,CAChC,C"}
@@ -1,3 +1,3 @@
1
1
  const e=require("./editorLanguage.cjs"),t=require("./editorTheme.cjs"),n=[{pattern:/^#!.*\b(?:bash|sh|zsh|dash|ksh)\b/,grammar:`shell`},{pattern:/^#!.*\bpython[\d.]*\b/,grammar:`python`},{pattern:/^#!.*\b(?:node|bun|deno)\b/,grammar:`javascript`}],r=/^\s*[[{][\s\S]*[\]}]\s*$/;function i(t){let i=t.path===void 0||t.path.length===0?void 0:e.grammarKeyOf(t.path);if(i!==void 0)return i;let a=t.text??``;if(a.length===0)return;let o=a.slice(0,200);if(o.startsWith(`#!`)){let e=o.split(`
2
- `,1)[0]??``;for(let t of n)if(t.pattern.test(e))return t.grammar;return`shell`}return r.test(a)?`json`:void 0}function a(e){return e===void 0?void 0:t.PO_SYNTAX_STYLES[e]}async function o(){let{tagHighlighter:e,tags:t}=await import(`@lezer/highlight`);return e([{tag:t.comment,class:`comment`},{tag:t.keyword,class:`keyword`},{tag:[t.atom,t.bool,t.null,t.self],class:`constant`},{tag:t.number,class:`literal`},{tag:[t.string,t.special(t.string)],class:`string`},{tag:t.regexp,class:`regexp`},{tag:[t.operator,t.operatorKeyword],class:`operator`},{tag:[t.punctuation,t.separator,t.bracket],class:`punctuation`},{tag:[t.variableName,t.definition(t.variableName)],class:`variable`},{tag:[t.propertyName,t.definition(t.propertyName)],class:`property`},{tag:[t.function(t.variableName),t.function(t.propertyName)],class:`callable`},{tag:[t.typeName,t.className,t.namespace],class:`type`},{tag:[t.tagName,t.angleBracket],class:`tag`},{tag:t.attributeName,class:`attribute`},{tag:[t.meta,t.processingInstruction,t.documentMeta],class:`meta`},{tag:t.heading,class:`heading`},{tag:[t.link,t.url],class:`link`},{tag:t.emphasis,class:`emphasis`},{tag:t.strong,class:`strong`},{tag:t.strikethrough,class:`strikethrough`},{tag:t.invalid,class:`invalid`}])}async function s(t){let[{Language:n,LanguageSupport:r},i]=await Promise.all([import(`@codemirror/language`),e.loadGrammar(t)]);if(i instanceof r)return i.language.parser;if(i instanceof n)return i.parser}async function c(e,t){if(e.length===0||e.length>2e5)return;let[{highlightCode:n},r,i]=await Promise.all([import(`@lezer/highlight`),o(),s(t)]);if(i===void 0)return;let a=[[]];return n(e,i.parse(e),r,(e,t)=>{a[a.length-1]?.push(t===``?{text:e}:{text:e,token:t})},()=>a.push([])),a}exports.detectGrammar=i,exports.highlightToLines=c,exports.syntaxStyleOf=a;
2
+ `,1)[0]??``;for(let t of n)if(t.pattern.test(e))return t.grammar;return`shell`}return r.test(a)?`json`:void 0}function a(e){return e===void 0?void 0:t.PO_SYNTAX_STYLES[e]}async function o(){let{tagHighlighter:e,tags:t}=await import(`@lezer/highlight`);return e([{tag:t.comment,class:`comment`},{tag:t.keyword,class:`keyword`},{tag:[t.atom,t.bool,t.null,t.self],class:`constant`},{tag:t.number,class:`literal`},{tag:[t.string,t.special(t.string)],class:`string`},{tag:t.regexp,class:`regexp`},{tag:[t.operator,t.operatorKeyword],class:`operator`},{tag:[t.punctuation,t.separator,t.bracket],class:`punctuation`},{tag:[t.variableName,t.definition(t.variableName)],class:`variable`},{tag:[t.propertyName,t.definition(t.propertyName)],class:`property`},{tag:[t.function(t.variableName),t.function(t.propertyName)],class:`callable`},{tag:[t.typeName,t.className,t.namespace],class:`type`},{tag:[t.tagName,t.angleBracket],class:`tag`},{tag:t.attributeName,class:`attribute`},{tag:[t.meta,t.processingInstruction,t.documentMeta],class:`meta`},{tag:t.heading,class:`heading`},{tag:[t.link,t.url],class:`link`},{tag:t.emphasis,class:`emphasis`},{tag:t.strong,class:`strong`},{tag:t.strikethrough,class:`strikethrough`},{tag:t.invalid,class:`invalid`}])}async function s(t){let[{Language:n,LanguageSupport:r},i]=await Promise.all([import(`@codemirror/language`),e.loadGrammar(t)]);if(i instanceof r)return i.language.parser;if(i instanceof n)return i.parser}async function c(e,t,n){let[{highlightCode:r},i,a]=await Promise.all([import(`@lezer/highlight`),o(),s(t)]);if(n.aborted||a===void 0)return;let c=[[]];return r(e,a.parse(e),i,(e,t)=>{c[c.length-1]?.push(t===``?{text:e}:{text:e,token:t})},()=>c.push([])),c}const l=4194304,u=/* @__PURE__ */ new Map;let d=0;const f=/* @__PURE__ */ new Map;function p(e,t){let n=e.length*2+t.length*64;for(let e of t)for(let t of e)n+=t.text.length*2+64;if(!(n>l)){for(;d+n>l||u.size>=128;){let e=u.entries().next().value;if(e===void 0)break;u.delete(e[0]),d-=e[1].bytes}u.set(e,{lines:t,bytes:n}),d+=n}}async function m(e,t,n){if(n?.aborted||e.length===0||e.length>2e5)return;let r=`${t}\u0000${e}`,i=u.get(r);if(i!==void 0)return u.delete(r),u.set(r,i),i.lines;let a=f.get(r);if(a===void 0){let n=new AbortController;a={controller:n,users:0,promise:c(e,t,n.signal)};let i=a;a.promise=a.promise.then(e=>(!n.signal.aborted&&e!==void 0&&p(r,e),e)).finally(()=>{f.get(r)===i&&f.delete(r)}),f.set(r,a)}let o=a;return o.users+=1,new Promise((e,t)=>{let i=!1,a=()=>!i&&(i=!0,n?.removeEventListener(`abort`,s),--o.users,!0),s=()=>{a()&&(o.users===0&&(o.controller.abort(),f.get(r)===o&&f.delete(r)),e(void 0))};n?.addEventListener(`abort`,s,{once:!0}),o.promise.then(t=>{a()&&e(t)},e=>{a()&&t(e)})})}exports.detectGrammar=i,exports.highlightToLines=m,exports.syntaxStyleOf=a;
3
3
  //# sourceMappingURL=syntaxHighlight.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"syntaxHighlight.cjs","names":["grammarKeyOf","PO_SYNTAX_STYLES","loadGrammar","require_editorLanguage","require_editorTheme","SHEBANG_GRAMMARS","JSON_SHAPE","detectGrammar","byPath","query","text","head","firstLine","entry","syntaxStyleOf","token","poHighlighter","tagHighlighter","tags","parserFor","extension","grammar","LanguageSupport","Language","highlightToLines","highlighter","parser","lines","highlightCode","classes","code"],"sources":["../../../src/lib/syntaxHighlight.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nimport { type GrammarKey, grammarKeyOf, loadGrammar } from './editorLanguage';\nimport { PO_SYNTAX_STYLES } from './editorTheme';\n\n/**\n * Static syntax highlighting for read-only code, the timeline's half of the\n * editor's `syntaxHighlighting`.\n *\n * A tool card shows code it cannot edit, so it needs the colours without the\n * editor: the same grammars `editorLanguage.ts` loads and the same token\n * palette `editorTheme.ts` names, run once over a string and handed back as\n * spans. Everything CodeMirror-shaped is behind a dynamic import, so a session\n * that never opens a code result never downloads a parser, and the caller\n * always has plain text to show first.\n */\n\n/** The palette keys a token can land on; the styles themselves are the editor's. */\nexport type SyntaxToken = keyof typeof PO_SYNTAX_STYLES;\n\n/** One run of same-styled text inside a line. `token` absent means unstyled. */\nexport interface SyntaxSpan {\n text: string;\n token?: SyntaxToken;\n}\n\n/** Lines of spans, one array per source line, so a gutter can pair with them. */\nexport type SyntaxLines = readonly (readonly SyntaxSpan[])[];\n\n/**\n * Above this the parse costs more than the colour is worth. Tool results are\n * bounded well below it; a pasted file is not, and blocking the frame to paint\n * a wall of text nobody reads is the worse outcome.\n */\nconst MAX_HIGHLIGHT_CHARS = 200_000;\n\n/** Only the first line is needed to spot a shebang, and reading more of a big string is waste. */\nconst SNIFF_CHARS = 200;\n\nconst SHEBANG_GRAMMARS: ReadonlyArray<{ readonly pattern: RegExp; readonly grammar: GrammarKey }> = [\n { pattern: /^#!.*\\b(?:bash|sh|zsh|dash|ksh)\\b/, grammar: 'shell' },\n { pattern: /^#!.*\\bpython[\\d.]*\\b/, grammar: 'python' },\n { pattern: /^#!.*\\b(?:node|bun|deno)\\b/, grammar: 'javascript' },\n];\n\n/** JSON is the one shape worth guessing from the body: a document is an object or an array. */\nconst JSON_SHAPE = /^\\s*[[{][\\s\\S]*[\\]}]\\s*$/;\n\nexport interface GrammarQuery {\n /** The file the text came from, when the tool knows one. */\n path?: string | undefined;\n /** The text itself, used only when the path settles nothing. */\n text?: string | undefined;\n}\n\n/**\n * Which grammar to colour a result with.\n *\n * The path decides whenever it can, because a name is evidence and a body is a\n * guess. Sniffing only answers for text that arrived without a usable name: a\n * shebang says what runs the script, and a document that opens and closes with\n * brackets is treated as JSON. Anything else stays plain rather than being\n * coloured as the wrong language.\n */\nexport function detectGrammar(query: GrammarQuery): GrammarKey | undefined {\n const byPath = query.path === undefined || query.path.length === 0 ? undefined : grammarKeyOf(query.path);\n if (byPath !== undefined) return byPath;\n const text = query.text ?? '';\n if (text.length === 0) return undefined;\n const head = text.slice(0, SNIFF_CHARS);\n if (head.startsWith('#!')) {\n const firstLine = head.split('\\n', 1)[0] ?? '';\n for (const entry of SHEBANG_GRAMMARS) {\n if (entry.pattern.test(firstLine)) return entry.grammar;\n }\n // A shebang naming something with no grammar here is still a script.\n return 'shell';\n }\n return JSON_SHAPE.test(text) ? 'json' : undefined;\n}\n\n/** The inline style a token wears. Colours come from the editor palette, which names theme tokens. */\nexport function syntaxStyleOf(token: SyntaxToken | undefined): CSSProperties | undefined {\n return token === undefined ? undefined : PO_SYNTAX_STYLES[token];\n}\n\n/**\n * Every tag the palette answers for, in the order the editor lists them. The\n * class each entry carries is a palette key rather than a CSS class: the\n * result is rendered as inline styles, so nothing has to be mounted in the\n * document for a card to show colour.\n */\nasync function poHighlighter() {\n const { tagHighlighter, tags } = await import('@lezer/highlight');\n return tagHighlighter([\n { tag: tags.comment, class: 'comment' satisfies SyntaxToken },\n { tag: tags.keyword, class: 'keyword' satisfies SyntaxToken },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], class: 'constant' satisfies SyntaxToken },\n { tag: tags.number, class: 'literal' satisfies SyntaxToken },\n { tag: [tags.string, tags.special(tags.string)], class: 'string' satisfies SyntaxToken },\n { tag: tags.regexp, class: 'regexp' satisfies SyntaxToken },\n { tag: [tags.operator, tags.operatorKeyword], class: 'operator' satisfies SyntaxToken },\n { tag: [tags.punctuation, tags.separator, tags.bracket], class: 'punctuation' satisfies SyntaxToken },\n { tag: [tags.variableName, tags.definition(tags.variableName)], class: 'variable' satisfies SyntaxToken },\n { tag: [tags.propertyName, tags.definition(tags.propertyName)], class: 'property' satisfies SyntaxToken },\n {\n tag: [tags.function(tags.variableName), tags.function(tags.propertyName)],\n class: 'callable' satisfies SyntaxToken,\n },\n { tag: [tags.typeName, tags.className, tags.namespace], class: 'type' satisfies SyntaxToken },\n { tag: [tags.tagName, tags.angleBracket], class: 'tag' satisfies SyntaxToken },\n { tag: tags.attributeName, class: 'attribute' satisfies SyntaxToken },\n { tag: [tags.meta, tags.processingInstruction, tags.documentMeta], class: 'meta' satisfies SyntaxToken },\n { tag: tags.heading, class: 'heading' satisfies SyntaxToken },\n { tag: [tags.link, tags.url], class: 'link' satisfies SyntaxToken },\n { tag: tags.emphasis, class: 'emphasis' satisfies SyntaxToken },\n { tag: tags.strong, class: 'strong' satisfies SyntaxToken },\n { tag: tags.strikethrough, class: 'strikethrough' satisfies SyntaxToken },\n { tag: tags.invalid, class: 'invalid' satisfies SyntaxToken },\n ]);\n}\n\n/** The parser behind a grammar. `loadGrammar` hands back an editor extension, which wraps one. */\nasync function parserFor(grammar: GrammarKey) {\n const [{ Language, LanguageSupport }, extension] = await Promise.all([\n import('@codemirror/language'),\n loadGrammar(grammar),\n ]);\n if (extension instanceof LanguageSupport) return extension.language.parser;\n if (extension instanceof Language) return extension.parser;\n return undefined;\n}\n\n/**\n * Colours `text` as `grammar`, as lines of spans.\n *\n * The whole text is parsed at once even though the caller may render it line\n * by line, because a template literal or a block comment only makes sense with\n * its neighbours. Text past the size cap, and a grammar whose extension turns\n * out to carry no parser, come back unhighlighted rather than throwing: colour\n * is decoration, and the caller already has the plain text on screen.\n */\nexport async function highlightToLines(text: string, grammar: GrammarKey): Promise<SyntaxLines | undefined> {\n if (text.length === 0 || text.length > MAX_HIGHLIGHT_CHARS) return undefined;\n const [{ highlightCode }, highlighter, parser] = await Promise.all([\n import('@lezer/highlight'),\n poHighlighter(),\n parserFor(grammar),\n ]);\n if (parser === undefined) return undefined;\n\n const lines: SyntaxSpan[][] = [[]];\n highlightCode(\n text,\n parser.parse(text),\n highlighter,\n (code, classes) => {\n const current = lines[lines.length - 1];\n // `classes` is the palette key this module handed the tag highlighter,\n // or empty for text no tag claimed.\n current?.push(classes === '' ? { text: code } : { text: code, token: classes as SyntaxToken });\n },\n () => lines.push([]),\n );\n return lines;\n}\n"],"mappings":"uEAuCMK,EAA8F,CAClG,CAAE,QAAS,oCAAqC,QAAS,OAAQ,EACjE,CAAE,QAAS,wBAAyB,QAAS,QAAS,EACtD,CAAE,QAAS,6BAA8B,QAAS,YAAa,CACjE,EAGMC,EAAa,2BAkBnB,SAAgBC,EAAc,EAA6C,CACzE,IAAMC,EAASC,EAAM,OAAS,IAAA,IAAaA,EAAM,KAAK,SAAW,EAAI,IAAA,GAAYT,EAAAA,aAAaS,EAAM,IAAI,EACxG,GAAID,IAAW,IAAA,GAAW,OAAOA,EACjC,IAAME,EAAOD,EAAM,MAAQ,GAC3B,GAAIC,EAAK,SAAW,EAAG,OACvB,IAAMC,EAAOD,EAAK,MAAM,EAAG,GAAW,EACtC,GAAIC,EAAK,WAAW,IAAI,EAAG,CACzB,IAAMC,EAAYD,EAAK,MAAM;EAAM,CAAC,CAAC,CAAC,IAAM,GAC5C,IAAK,IAAME,KAASR,EAClB,GAAIQ,EAAM,QAAQ,KAAKD,CAAS,EAAG,OAAOC,EAAM,QAGlD,MAAO,OACT,CACA,OAAOP,EAAW,KAAKI,CAAI,EAAI,OAAS,IAAA,EAC1C,CAGA,SAAgBI,EAAc,EAA2D,CACvF,OAAOC,IAAU,IAAA,GAAY,IAAA,GAAYd,EAAAA,iBAAiBc,EAC5D,CAQA,eAAeC,GAAgB,CAC7B,GAAM,CAAE,iBAAgB,QAAS,MAAM,OAAO,oBAC9C,OAAOC,EAAe,CACpB,CAAE,IAAKC,EAAK,QAAS,MAAO,SAAgC,EAC5D,CAAE,IAAKA,EAAK,QAAS,MAAO,SAAgC,EAC5D,CAAE,IAAK,CAACA,EA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K,QAAS,MAAO,SAAgC,CAC9D,CAAC,CACH,CAGA,eAAeC,EAAU,EAAqB,CAC5C,GAAM,CAAC,CAAE,WAAU,mBAAmBC,GAAa,MAAM,QAAQ,IAAI,CACnE,OAAO,wBACPlB,EAAAA,YAAYmB,CAAO,CACrB,CAAC,EACD,GAAID,aAAqBE,EAAiB,OAAOF,EAAU,SAAS,OACpE,GAAIA,aAAqBG,EAAU,OAAOH,EAAU,MAEtD,CAWA,eAAsBI,EAAiB,EAAc,EAAuD,CAC1G,GAAId,EAAK,SAAW,GAAKA,EAAK,OAAS,IAAqB,OAC5D,GAAM,CAAC,CAAE,iBAAiBe,EAAaC,GAAU,MAAM,QAAQ,IAAI,CACjE,OAAO,oBACPV,EAAc,EACdG,EAAUE,CAAO,CACnB,CAAC,EACD,GAAIK,IAAW,IAAA,GAAW,OAE1B,IAAMC,EAAwB,CAAC,CAAC,CAAC,EAajC,OAZAC,EACElB,EACAgB,EAAO,MAAMhB,CAAI,EACjBe,GACC,EAAM,IAAY,CAIjBE,EAHsBA,EAAM,OAAS,EAG9B,EAAE,KAAKE,IAAY,GAAK,CAAE,KAAMC,CAAK,EAAI,CAAE,KAAMA,EAAM,MAAOD,CAAuB,CAAC,CAC/F,MACMF,EAAM,KAAK,CAAC,CAAC,CACrB,EACOA,CACT"}
1
+ {"version":3,"file":"syntaxHighlight.cjs","names":["grammarKeyOf","PO_SYNTAX_STYLES","loadGrammar","require_editorLanguage","require_editorTheme","SHEBANG_GRAMMARS","JSON_SHAPE","detectGrammar","byPath","query","text","head","firstLine","entry","syntaxStyleOf","token","poHighlighter","tagHighlighter","tags","parserFor","extension","grammar","LanguageSupport","Language","parseToLines","highlighter","parser","signal","lines","highlightCode","classes","code","HIGHLIGHT_CACHE_BYTES","cache","cacheBytes","pending","remember","bytes","key","line","span","oldest","highlightToLines","hit","job","controller","created","shared","finished","release","abort","resolve","reject","error"],"sources":["../../../src/lib/syntaxHighlight.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nimport { type GrammarKey, grammarKeyOf, loadGrammar } from './editorLanguage';\nimport { PO_SYNTAX_STYLES } from './editorTheme';\n\n/**\n * Static syntax highlighting for read-only code, the timeline's half of the\n * editor's `syntaxHighlighting`.\n *\n * A tool card shows code it cannot edit, so it needs the colours without the\n * editor: the same grammars `editorLanguage.ts` loads and the same token\n * palette `editorTheme.ts` names, run once over a string and handed back as\n * spans. Everything CodeMirror-shaped is behind a dynamic import, so a session\n * that never opens a code result never downloads a parser, and the caller\n * always has plain text to show first.\n */\n\n/** The palette keys a token can land on; the styles themselves are the editor's. */\nexport type SyntaxToken = keyof typeof PO_SYNTAX_STYLES;\n\n/** One run of same-styled text inside a line. `token` absent means unstyled. */\nexport interface SyntaxSpan {\n text: string;\n token?: SyntaxToken;\n}\n\n/** Lines of spans, one array per source line, so a gutter can pair with them. */\nexport type SyntaxLines = readonly (readonly SyntaxSpan[])[];\n\n/**\n * Above this the parse costs more than the colour is worth. Tool results are\n * bounded well below it; a pasted file is not, and blocking the frame to paint\n * a wall of text nobody reads is the worse outcome.\n */\nconst MAX_HIGHLIGHT_CHARS = 200_000;\n\n/** Only the first line is needed to spot a shebang, and reading more of a big string is waste. */\nconst SNIFF_CHARS = 200;\n\nconst SHEBANG_GRAMMARS: ReadonlyArray<{ readonly pattern: RegExp; readonly grammar: GrammarKey }> = [\n { pattern: /^#!.*\\b(?:bash|sh|zsh|dash|ksh)\\b/, grammar: 'shell' },\n { pattern: /^#!.*\\bpython[\\d.]*\\b/, grammar: 'python' },\n { pattern: /^#!.*\\b(?:node|bun|deno)\\b/, grammar: 'javascript' },\n];\n\n/** JSON is the one shape worth guessing from the body: a document is an object or an array. */\nconst JSON_SHAPE = /^\\s*[[{][\\s\\S]*[\\]}]\\s*$/;\n\nexport interface GrammarQuery {\n /** The file the text came from, when the tool knows one. */\n path?: string | undefined;\n /** The text itself, used only when the path settles nothing. */\n text?: string | undefined;\n}\n\n/**\n * Which grammar to colour a result with.\n *\n * The path decides whenever it can, because a name is evidence and a body is a\n * guess. Sniffing only answers for text that arrived without a usable name: a\n * shebang says what runs the script, and a document that opens and closes with\n * brackets is treated as JSON. Anything else stays plain rather than being\n * coloured as the wrong language.\n */\nexport function detectGrammar(query: GrammarQuery): GrammarKey | undefined {\n const byPath = query.path === undefined || query.path.length === 0 ? undefined : grammarKeyOf(query.path);\n if (byPath !== undefined) return byPath;\n const text = query.text ?? '';\n if (text.length === 0) return undefined;\n const head = text.slice(0, SNIFF_CHARS);\n if (head.startsWith('#!')) {\n const firstLine = head.split('\\n', 1)[0] ?? '';\n for (const entry of SHEBANG_GRAMMARS) {\n if (entry.pattern.test(firstLine)) return entry.grammar;\n }\n // A shebang naming something with no grammar here is still a script.\n return 'shell';\n }\n return JSON_SHAPE.test(text) ? 'json' : undefined;\n}\n\n/** The inline style a token wears. Colours come from the editor palette, which names theme tokens. */\nexport function syntaxStyleOf(token: SyntaxToken | undefined): CSSProperties | undefined {\n return token === undefined ? undefined : PO_SYNTAX_STYLES[token];\n}\n\n/**\n * Every tag the palette answers for, in the order the editor lists them. The\n * class each entry carries is a palette key rather than a CSS class: the\n * result is rendered as inline styles, so nothing has to be mounted in the\n * document for a card to show colour.\n */\nasync function poHighlighter() {\n const { tagHighlighter, tags } = await import('@lezer/highlight');\n return tagHighlighter([\n { tag: tags.comment, class: 'comment' satisfies SyntaxToken },\n { tag: tags.keyword, class: 'keyword' satisfies SyntaxToken },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], class: 'constant' satisfies SyntaxToken },\n { tag: tags.number, class: 'literal' satisfies SyntaxToken },\n { tag: [tags.string, tags.special(tags.string)], class: 'string' satisfies SyntaxToken },\n { tag: tags.regexp, class: 'regexp' satisfies SyntaxToken },\n { tag: [tags.operator, tags.operatorKeyword], class: 'operator' satisfies SyntaxToken },\n { tag: [tags.punctuation, tags.separator, tags.bracket], class: 'punctuation' satisfies SyntaxToken },\n { tag: [tags.variableName, tags.definition(tags.variableName)], class: 'variable' satisfies SyntaxToken },\n { tag: [tags.propertyName, tags.definition(tags.propertyName)], class: 'property' satisfies SyntaxToken },\n {\n tag: [tags.function(tags.variableName), tags.function(tags.propertyName)],\n class: 'callable' satisfies SyntaxToken,\n },\n { tag: [tags.typeName, tags.className, tags.namespace], class: 'type' satisfies SyntaxToken },\n { tag: [tags.tagName, tags.angleBracket], class: 'tag' satisfies SyntaxToken },\n { tag: tags.attributeName, class: 'attribute' satisfies SyntaxToken },\n { tag: [tags.meta, tags.processingInstruction, tags.documentMeta], class: 'meta' satisfies SyntaxToken },\n { tag: tags.heading, class: 'heading' satisfies SyntaxToken },\n { tag: [tags.link, tags.url], class: 'link' satisfies SyntaxToken },\n { tag: tags.emphasis, class: 'emphasis' satisfies SyntaxToken },\n { tag: tags.strong, class: 'strong' satisfies SyntaxToken },\n { tag: tags.strikethrough, class: 'strikethrough' satisfies SyntaxToken },\n { tag: tags.invalid, class: 'invalid' satisfies SyntaxToken },\n ]);\n}\n\n/** The parser behind a grammar. `loadGrammar` hands back an editor extension, which wraps one. */\nasync function parserFor(grammar: GrammarKey) {\n const [{ Language, LanguageSupport }, extension] = await Promise.all([\n import('@codemirror/language'),\n loadGrammar(grammar),\n ]);\n if (extension instanceof LanguageSupport) return extension.language.parser;\n if (extension instanceof Language) return extension.parser;\n return undefined;\n}\n\n/**\n * Colours `text` as `grammar`, as lines of spans.\n *\n * The whole text is parsed at once even though the caller may render it line\n * by line, because a template literal or a block comment only makes sense with\n * its neighbours. Text past the size cap, and a grammar whose extension turns\n * out to carry no parser, come back unhighlighted rather than throwing: colour\n * is decoration, and the caller already has the plain text on screen.\n */\nasync function parseToLines(text: string, grammar: GrammarKey, signal: AbortSignal): Promise<SyntaxLines | undefined> {\n const [{ highlightCode }, highlighter, parser] = await Promise.all([\n import('@lezer/highlight'),\n poHighlighter(),\n parserFor(grammar),\n ]);\n // Imports may finish after every interested view has gone away. Parsing is\n // synchronous, so cancellation can skip it here but cannot interrupt it.\n if (signal.aborted || parser === undefined) return undefined;\n\n const lines: SyntaxSpan[][] = [[]];\n highlightCode(\n text,\n parser.parse(text),\n highlighter,\n (code, classes) => {\n const current = lines[lines.length - 1];\n // `classes` is the palette key this module handed the tag highlighter,\n // or empty for text no tag claimed.\n current?.push(classes === '' ? { text: code } : { text: code, token: classes as SyntaxToken });\n },\n () => lines.push([]),\n );\n return lines;\n}\n\n/** Account for UTF-16 keys/text and estimated array/object overhead, not just entry count. */\nconst HIGHLIGHT_CACHE_BYTES = 4 * 1024 * 1024;\nconst HIGHLIGHT_CACHE_ENTRIES = 128;\nconst SPAN_OVERHEAD_BYTES = 64;\nconst cache = new Map<string, { lines: SyntaxLines; bytes: number }>();\nlet cacheBytes = 0;\n\ninterface HighlightJob {\n controller: AbortController;\n users: number;\n promise: Promise<SyntaxLines | undefined>;\n}\nconst pending = new Map<string, HighlightJob>();\n\nfunction remember(key: string, lines: SyntaxLines): void {\n let bytes = key.length * 2 + lines.length * SPAN_OVERHEAD_BYTES;\n for (const line of lines) {\n for (const span of line) bytes += span.text.length * 2 + SPAN_OVERHEAD_BYTES;\n }\n if (bytes > HIGHLIGHT_CACHE_BYTES) return;\n while (cacheBytes + bytes > HIGHLIGHT_CACHE_BYTES || cache.size >= HIGHLIGHT_CACHE_ENTRIES) {\n const oldest = cache.entries().next().value;\n if (oldest === undefined) break;\n cache.delete(oldest[0]);\n cacheBytes -= oldest[1].bytes;\n }\n cache.set(key, { lines, bytes });\n cacheBytes += bytes;\n}\n\n/**\n * Shared whole-block highlighting, keyed by grammar and exact text. Completed\n * spans use a byte-accounted LRU; concurrent readers share one parse. A caller\n * can cancel without cancelling another reader. Once all readers cancel, skip\n * parsing after grammar loading. Cancelled or failed work is never cached.\n * The existing size cap and plain-text fallback are unchanged.\n */\nexport async function highlightToLines(\n text: string,\n grammar: GrammarKey,\n signal?: AbortSignal,\n): Promise<SyntaxLines | undefined> {\n if (signal?.aborted || text.length === 0 || text.length > MAX_HIGHLIGHT_CHARS) return undefined;\n const key = `${grammar}\\u0000${text}`;\n const hit = cache.get(key);\n if (hit !== undefined) {\n cache.delete(key);\n cache.set(key, hit);\n return hit.lines;\n }\n let job = pending.get(key);\n if (job === undefined) {\n const controller = new AbortController();\n job = { controller, users: 0, promise: parseToLines(text, grammar, controller.signal) };\n const created = job;\n job.promise = job.promise\n .then((lines) => {\n if (!controller.signal.aborted && lines !== undefined) remember(key, lines);\n return lines;\n })\n .finally(() => {\n if (pending.get(key) === created) pending.delete(key);\n });\n pending.set(key, job);\n }\n const shared = job;\n shared.users += 1;\n return new Promise((resolve, reject) => {\n let finished = false;\n const release = () => {\n if (finished) return false;\n finished = true;\n signal?.removeEventListener('abort', abort);\n shared.users -= 1;\n return true;\n };\n const abort = () => {\n if (!release()) return;\n if (shared.users === 0) {\n shared.controller.abort();\n if (pending.get(key) === shared) pending.delete(key);\n }\n resolve(undefined);\n };\n signal?.addEventListener('abort', abort, { once: true });\n void shared.promise.then(\n (lines) => {\n if (release()) resolve(lines);\n },\n (error: unknown) => {\n if (release()) reject(error);\n },\n );\n });\n}\n"],"mappings":"A,uEAuCMK,EAA8F,CAClG,CAAE,QAAS,oCAAqC,QAAS,OAAQ,EACjE,CAAE,QAAS,wBAAyB,QAAS,QAAS,EACtD,CAAE,QAAS,6BAA8B,QAAS,YAAa,CACjE,EAGMC,EAAa,2BAkBnB,SAAgBC,EAAc,EAA6C,CACzE,IAAMC,EAASC,EAAM,OAAS,IAAA,IAAaA,EAAM,KAAK,SAAW,EAAI,IAAA,GAAYT,EAAAA,aAAaS,EAAM,IAAI,EACxG,GAAID,IAAW,IAAA,GAAW,OAAOA,EACjC,IAAME,EAAOD,EAAM,MAAQ,GAC3B,GAAIC,EAAK,SAAW,EAAG,OACvB,IAAMC,EAAOD,EAAK,MAAM,EAAG,GAAW,EACtC,GAAIC,EAAK,WAAW,IAAI,EAAG,CACzB,IAAMC,EAAYD,EAAK,MAAM;EAAM,CAAC,CAAC,CAAC,IAAM,GAC5C,IAAK,IAAME,KAASR,EAClB,GAAIQ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AAOG,CAAG,CACtD,CAAC,EACHH,EAAQ,IAAIG,EAAKM,CAAG,CACtB,CACA,IAAMG,EAASH,EAEf,MADA,GAAO,OAAS,EACT,IAAI,SAAS,EAAS,IAAW,CACtC,IAAII,EAAW,GACTC,MACJ,CAAID,IACJ,EAAW,GACXrB,GAAQ,oBAAoB,QAASuB,CAAK,EAC1C,IAAO,MACA,IAEHA,MAAc,CACbD,EAAQ,IACTF,EAAO,QAAU,IACnBA,EAAO,WAAW,MAAM,EACpBZ,EAAQ,IAAIG,CAAG,IAAMS,GAAQZ,EAAQ,OAAOG,CAAG,GAErDa,EAAQ,IAAA,EAAS,EACnB,EACAxB,GAAQ,iBAAiB,QAASuB,EAAO,CAAE,KAAM,EAAK,CAAC,EACvDH,EAAY,QAAQ,KACjB,GAAU,CACLE,EAAQ,GAAGE,EAAQvB,CAAK,CAC9B,EACC,GAAmB,CACdqB,EAAQ,GAAGG,EAAOC,CAAK,CAC7B,CACF,CACF,CAAC,CACH,C"}
@@ -41,14 +41,12 @@ export declare function detectGrammar(query: GrammarQuery): GrammarKey | undefin
41
41
  /** The inline style a token wears. Colours come from the editor palette, which names theme tokens. */
42
42
  export declare function syntaxStyleOf(token: SyntaxToken | undefined): CSSProperties | undefined;
43
43
  /**
44
- * Colours `text` as `grammar`, as lines of spans.
45
- *
46
- * The whole text is parsed at once even though the caller may render it line
47
- * by line, because a template literal or a block comment only makes sense with
48
- * its neighbours. Text past the size cap, and a grammar whose extension turns
49
- * out to carry no parser, come back unhighlighted rather than throwing: colour
50
- * is decoration, and the caller already has the plain text on screen.
44
+ * Shared whole-block highlighting, keyed by grammar and exact text. Completed
45
+ * spans use a byte-accounted LRU; concurrent readers share one parse. A caller
46
+ * can cancel without cancelling another reader. Once all readers cancel, skip
47
+ * parsing after grammar loading. Cancelled or failed work is never cached.
48
+ * The existing size cap and plain-text fallback are unchanged.
51
49
  */
52
- export declare function highlightToLines(text: string, grammar: GrammarKey): Promise<SyntaxLines | undefined>;
50
+ export declare function highlightToLines(text: string, grammar: GrammarKey, signal?: AbortSignal): Promise<SyntaxLines | undefined>;
53
51
  //#endregion
54
52
  //# sourceMappingURL=syntaxHighlight.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syntaxHighlight.d.mts","names":[],"sources":["../../../src/lib/syntaxHighlight.ts"],"mappings":";;;;;;;;;;;;;;;;YAkBY,2BAA2B;;iBAGtB;EACf;EACA,QAAQ;;;YAIE,iCAAiC;iBAqB5B;;EAEf;;EAEA;;;;;;;;;;;wBAYc,cAAc,OAAO,eAAe;;wBAkBpC,cAAc,OAAO,0BAA0B;;;;;;;;wBA2HzC,iBACpB,cACA,SAAS,YACT,SAAS,cACR,QAAQ"}
@@ -1,3 +1,3 @@
1
1
  import{grammarKeyOf as e,loadGrammar as t}from"./editorLanguage.mjs";import{PO_SYNTAX_STYLES as n}from"./editorTheme.mjs";const r=[{pattern:/^#!.*\b(?:bash|sh|zsh|dash|ksh)\b/,grammar:`shell`},{pattern:/^#!.*\bpython[\d.]*\b/,grammar:`python`},{pattern:/^#!.*\b(?:node|bun|deno)\b/,grammar:`javascript`}],i=/^\s*[[{][\s\S]*[\]}]\s*$/;function a(t){let n=t.path===void 0||t.path.length===0?void 0:e(t.path);if(n!==void 0)return n;let a=t.text??``;if(a.length===0)return;let o=a.slice(0,200);if(o.startsWith(`#!`)){let e=o.split(`
2
- `,1)[0]??``;for(let t of r)if(t.pattern.test(e))return t.grammar;return`shell`}return i.test(a)?`json`:void 0}function o(e){return e===void 0?void 0:n[e]}async function s(){let{tagHighlighter:e,tags:t}=await import(`@lezer/highlight`);return e([{tag:t.comment,class:`comment`},{tag:t.keyword,class:`keyword`},{tag:[t.atom,t.bool,t.null,t.self],class:`constant`},{tag:t.number,class:`literal`},{tag:[t.string,t.special(t.string)],class:`string`},{tag:t.regexp,class:`regexp`},{tag:[t.operator,t.operatorKeyword],class:`operator`},{tag:[t.punctuation,t.separator,t.bracket],class:`punctuation`},{tag:[t.variableName,t.definition(t.variableName)],class:`variable`},{tag:[t.propertyName,t.definition(t.propertyName)],class:`property`},{tag:[t.function(t.variableName),t.function(t.propertyName)],class:`callable`},{tag:[t.typeName,t.className,t.namespace],class:`type`},{tag:[t.tagName,t.angleBracket],class:`tag`},{tag:t.attributeName,class:`attribute`},{tag:[t.meta,t.processingInstruction,t.documentMeta],class:`meta`},{tag:t.heading,class:`heading`},{tag:[t.link,t.url],class:`link`},{tag:t.emphasis,class:`emphasis`},{tag:t.strong,class:`strong`},{tag:t.strikethrough,class:`strikethrough`},{tag:t.invalid,class:`invalid`}])}async function c(e){let[{Language:n,LanguageSupport:r},i]=await Promise.all([import(`@codemirror/language`),t(e)]);if(i instanceof r)return i.language.parser;if(i instanceof n)return i.parser}async function l(e,t){if(e.length===0||e.length>2e5)return;let[{highlightCode:n},r,i]=await Promise.all([import(`@lezer/highlight`),s(),c(t)]);if(i===void 0)return;let a=[[]];return n(e,i.parse(e),r,(e,t)=>{a[a.length-1]?.push(t===``?{text:e}:{text:e,token:t})},()=>a.push([])),a}export{a as detectGrammar,l as highlightToLines,o as syntaxStyleOf};
2
+ `,1)[0]??``;for(let t of r)if(t.pattern.test(e))return t.grammar;return`shell`}return i.test(a)?`json`:void 0}function o(e){return e===void 0?void 0:n[e]}async function s(){let{tagHighlighter:e,tags:t}=await import(`@lezer/highlight`);return e([{tag:t.comment,class:`comment`},{tag:t.keyword,class:`keyword`},{tag:[t.atom,t.bool,t.null,t.self],class:`constant`},{tag:t.number,class:`literal`},{tag:[t.string,t.special(t.string)],class:`string`},{tag:t.regexp,class:`regexp`},{tag:[t.operator,t.operatorKeyword],class:`operator`},{tag:[t.punctuation,t.separator,t.bracket],class:`punctuation`},{tag:[t.variableName,t.definition(t.variableName)],class:`variable`},{tag:[t.propertyName,t.definition(t.propertyName)],class:`property`},{tag:[t.function(t.variableName),t.function(t.propertyName)],class:`callable`},{tag:[t.typeName,t.className,t.namespace],class:`type`},{tag:[t.tagName,t.angleBracket],class:`tag`},{tag:t.attributeName,class:`attribute`},{tag:[t.meta,t.processingInstruction,t.documentMeta],class:`meta`},{tag:t.heading,class:`heading`},{tag:[t.link,t.url],class:`link`},{tag:t.emphasis,class:`emphasis`},{tag:t.strong,class:`strong`},{tag:t.strikethrough,class:`strikethrough`},{tag:t.invalid,class:`invalid`}])}async function c(e){let[{Language:n,LanguageSupport:r},i]=await Promise.all([import(`@codemirror/language`),t(e)]);if(i instanceof r)return i.language.parser;if(i instanceof n)return i.parser}async function l(e,t,n){let[{highlightCode:r},i,a]=await Promise.all([import(`@lezer/highlight`),s(),c(t)]);if(n.aborted||a===void 0)return;let o=[[]];return r(e,a.parse(e),i,(e,t)=>{o[o.length-1]?.push(t===``?{text:e}:{text:e,token:t})},()=>o.push([])),o}const u=4194304,d=/* @__PURE__ */ new Map;let f=0;const p=/* @__PURE__ */ new Map;function m(e,t){let n=e.length*2+t.length*64;for(let e of t)for(let t of e)n+=t.text.length*2+64;if(!(n>u)){for(;f+n>u||d.size>=128;){let e=d.entries().next().value;if(e===void 0)break;d.delete(e[0]),f-=e[1].bytes}d.set(e,{lines:t,bytes:n}),f+=n}}async function h(e,t,n){if(n?.aborted||e.length===0||e.length>2e5)return;let r=`${t}\u0000${e}`,i=d.get(r);if(i!==void 0)return d.delete(r),d.set(r,i),i.lines;let a=p.get(r);if(a===void 0){let n=new AbortController;a={controller:n,users:0,promise:l(e,t,n.signal)};let i=a;a.promise=a.promise.then(e=>(!n.signal.aborted&&e!==void 0&&m(r,e),e)).finally(()=>{p.get(r)===i&&p.delete(r)}),p.set(r,a)}let o=a;return o.users+=1,new Promise((e,t)=>{let i=!1,a=()=>!i&&(i=!0,n?.removeEventListener(`abort`,s),--o.users,!0),s=()=>{a()&&(o.users===0&&(o.controller.abort(),p.get(r)===o&&p.delete(r)),e(void 0))};n?.addEventListener(`abort`,s,{once:!0}),o.promise.then(t=>{a()&&e(t)},e=>{a()&&t(e)})})}export{a as detectGrammar,h as highlightToLines,o as syntaxStyleOf};
3
3
  //# sourceMappingURL=syntaxHighlight.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syntaxHighlight.mjs","names":["SHEBANG_GRAMMARS","JSON_SHAPE","detectGrammar","byPath","query","grammarKeyOf","text","head","firstLine","entry","syntaxStyleOf","token","PO_SYNTAX_STYLES","poHighlighter","tagHighlighter","tags","parserFor","extension","loadGrammar","grammar","LanguageSupport","Language","parseToLines","highlighter","parser","signal","lines","highlightCode","classes","code","HIGHLIGHT_CACHE_BYTES","cache","cacheBytes","pending","remember","bytes","key","line","span","oldest","highlightToLines","hit","job","controller","created","shared","finished","release","abort","resolve","reject","error"],"sources":["../../../src/lib/syntaxHighlight.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nimport { type GrammarKey, grammarKeyOf, loadGrammar } from './editorLanguage';\nimport { PO_SYNTAX_STYLES } from './editorTheme';\n\n/**\n * Static syntax highlighting for read-only code, the timeline's half of the\n * editor's `syntaxHighlighting`.\n *\n * A tool card shows code it cannot edit, so it needs the colours without the\n * editor: the same grammars `editorLanguage.ts` loads and the same token\n * palette `editorTheme.ts` names, run once over a string and handed back as\n * spans. Everything CodeMirror-shaped is behind a dynamic import, so a session\n * that never opens a code result never downloads a parser, and the caller\n * always has plain text to show first.\n */\n\n/** The palette keys a token can land on; the styles themselves are the editor's. */\nexport type SyntaxToken = keyof typeof PO_SYNTAX_STYLES;\n\n/** One run of same-styled text inside a line. `token` absent means unstyled. */\nexport interface SyntaxSpan {\n text: string;\n token?: SyntaxToken;\n}\n\n/** Lines of spans, one array per source line, so a gutter can pair with them. */\nexport type SyntaxLines = readonly (readonly SyntaxSpan[])[];\n\n/**\n * Above this the parse costs more than the colour is worth. Tool results are\n * bounded well below it; a pasted file is not, and blocking the frame to paint\n * a wall of text nobody reads is the worse outcome.\n */\nconst MAX_HIGHLIGHT_CHARS = 200_000;\n\n/** Only the first line is needed to spot a shebang, and reading more of a big string is waste. */\nconst SNIFF_CHARS = 200;\n\nconst SHEBANG_GRAMMARS: ReadonlyArray<{ readonly pattern: RegExp; readonly grammar: GrammarKey }> = [\n { pattern: /^#!.*\\b(?:bash|sh|zsh|dash|ksh)\\b/, grammar: 'shell' },\n { pattern: /^#!.*\\bpython[\\d.]*\\b/, grammar: 'python' },\n { pattern: /^#!.*\\b(?:node|bun|deno)\\b/, grammar: 'javascript' },\n];\n\n/** JSON is the one shape worth guessing from the body: a document is an object or an array. */\nconst JSON_SHAPE = /^\\s*[[{][\\s\\S]*[\\]}]\\s*$/;\n\nexport interface GrammarQuery {\n /** The file the text came from, when the tool knows one. */\n path?: string | undefined;\n /** The text itself, used only when the path settles nothing. */\n text?: string | undefined;\n}\n\n/**\n * Which grammar to colour a result with.\n *\n * The path decides whenever it can, because a name is evidence and a body is a\n * guess. Sniffing only answers for text that arrived without a usable name: a\n * shebang says what runs the script, and a document that opens and closes with\n * brackets is treated as JSON. Anything else stays plain rather than being\n * coloured as the wrong language.\n */\nexport function detectGrammar(query: GrammarQuery): GrammarKey | undefined {\n const byPath = query.path === undefined || query.path.length === 0 ? undefined : grammarKeyOf(query.path);\n if (byPath !== undefined) return byPath;\n const text = query.text ?? '';\n if (text.length === 0) return undefined;\n const head = text.slice(0, SNIFF_CHARS);\n if (head.startsWith('#!')) {\n const firstLine = head.split('\\n', 1)[0] ?? '';\n for (const entry of SHEBANG_GRAMMARS) {\n if (entry.pattern.test(firstLine)) return entry.grammar;\n }\n // A shebang naming something with no grammar here is still a script.\n return 'shell';\n }\n return JSON_SHAPE.test(text) ? 'json' : undefined;\n}\n\n/** The inline style a token wears. Colours come from the editor palette, which names theme tokens. */\nexport function syntaxStyleOf(token: SyntaxToken | undefined): CSSProperties | undefined {\n return token === undefined ? undefined : PO_SYNTAX_STYLES[token];\n}\n\n/**\n * Every tag the palette answers for, in the order the editor lists them. The\n * class each entry carries is a palette key rather than a CSS class: the\n * result is rendered as inline styles, so nothing has to be mounted in the\n * document for a card to show colour.\n */\nasync function poHighlighter() {\n const { tagHighlighter, tags } = await import('@lezer/highlight');\n return tagHighlighter([\n { tag: tags.comment, class: 'comment' satisfies SyntaxToken },\n { tag: tags.keyword, class: 'keyword' satisfies SyntaxToken },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], class: 'constant' satisfies SyntaxToken },\n { tag: tags.number, class: 'literal' satisfies SyntaxToken },\n { tag: [tags.string, tags.special(tags.string)], class: 'string' satisfies SyntaxToken },\n { tag: tags.regexp, class: 'regexp' satisfies SyntaxToken },\n { tag: [tags.operator, tags.operatorKeyword], class: 'operator' satisfies SyntaxToken },\n { tag: [tags.punctuation, tags.separator, tags.bracket], class: 'punctuation' satisfies SyntaxToken },\n { tag: [tags.variableName, tags.definition(tags.variableName)], class: 'variable' satisfies SyntaxToken },\n { tag: [tags.propertyName, tags.definition(tags.propertyName)], class: 'property' satisfies SyntaxToken },\n {\n tag: [tags.function(tags.variableName), tags.function(tags.propertyName)],\n class: 'callable' satisfies SyntaxToken,\n },\n { tag: [tags.typeName, tags.className, tags.namespace], class: 'type' satisfies SyntaxToken },\n { tag: [tags.tagName, tags.angleBracket], class: 'tag' satisfies SyntaxToken },\n { tag: tags.attributeName, class: 'attribute' satisfies SyntaxToken },\n { tag: [tags.meta, tags.processingInstruction, tags.documentMeta], class: 'meta' satisfies SyntaxToken },\n { tag: tags.heading, class: 'heading' satisfies SyntaxToken },\n { tag: [tags.link, tags.url], class: 'link' satisfies SyntaxToken },\n { tag: tags.emphasis, class: 'emphasis' satisfies SyntaxToken },\n { tag: tags.strong, class: 'strong' satisfies SyntaxToken },\n { tag: tags.strikethrough, class: 'strikethrough' satisfies SyntaxToken },\n { tag: tags.invalid, class: 'invalid' satisfies SyntaxToken },\n ]);\n}\n\n/** The parser behind a grammar. `loadGrammar` hands back an editor extension, which wraps one. */\nasync function parserFor(grammar: GrammarKey) {\n const [{ Language, LanguageSupport }, extension] = await Promise.all([\n import('@codemirror/language'),\n loadGrammar(grammar),\n ]);\n if (extension instanceof LanguageSupport) return extension.language.parser;\n if (extension instanceof Language) return extension.parser;\n return undefined;\n}\n\n/**\n * Colours `text` as `grammar`, as lines of spans.\n *\n * The whole text is parsed at once even though the caller may render it line\n * by line, because a template literal or a block comment only makes sense with\n * its neighbours. Text past the size cap, and a grammar whose extension turns\n * out to carry no parser, come back unhighlighted rather than throwing: colour\n * is decoration, and the caller already has the plain text on screen.\n */\nasync function parseToLines(text: string, grammar: GrammarKey, signal: AbortSignal): Promise<SyntaxLines | undefined> {\n const [{ highlightCode }, highlighter, parser] = await Promise.all([\n import('@lezer/highlight'),\n poHighlighter(),\n parserFor(grammar),\n ]);\n // Imports may finish after every interested view has gone away. Parsing is\n // synchronous, so cancellation can skip it here but cannot interrupt it.\n if (signal.aborted || parser === undefined) return undefined;\n\n const lines: SyntaxSpan[][] = [[]];\n highlightCode(\n text,\n parser.parse(text),\n highlighter,\n (code, classes) => {\n const current = lines[lines.length - 1];\n // `classes` is the palette key this module handed the tag highlighter,\n // or empty for text no tag claimed.\n current?.push(classes === '' ? { text: code } : { text: code, token: classes as SyntaxToken });\n },\n () => lines.push([]),\n );\n return lines;\n}\n\n/** Account for UTF-16 keys/text and estimated array/object overhead, not just entry count. */\nconst HIGHLIGHT_CACHE_BYTES = 4 * 1024 * 1024;\nconst HIGHLIGHT_CACHE_ENTRIES = 128;\nconst SPAN_OVERHEAD_BYTES = 64;\nconst cache = new Map<string, { lines: SyntaxLines; bytes: number }>();\nlet cacheBytes = 0;\n\ninterface HighlightJob {\n controller: AbortController;\n users: number;\n promise: Promise<SyntaxLines | undefined>;\n}\nconst pending = new Map<string, HighlightJob>();\n\nfunction remember(key: string, lines: SyntaxLines): void {\n let bytes = key.length * 2 + lines.length * SPAN_OVERHEAD_BYTES;\n for (const line of lines) {\n for (const span of line) bytes += span.text.length * 2 + SPAN_OVERHEAD_BYTES;\n }\n if (bytes > HIGHLIGHT_CACHE_BYTES) return;\n while (cacheBytes + bytes > HIGHLIGHT_CACHE_BYTES || cache.size >= HIGHLIGHT_CACHE_ENTRIES) {\n const oldest = cache.entries().next().value;\n if (oldest === undefined) break;\n cache.delete(oldest[0]);\n cacheBytes -= oldest[1].bytes;\n }\n cache.set(key, { lines, bytes });\n cacheBytes += bytes;\n}\n\n/**\n * Shared whole-block highlighting, keyed by grammar and exact text. Completed\n * spans use a byte-accounted LRU; concurrent readers share one parse. A caller\n * can cancel without cancelling another reader. Once all readers cancel, skip\n * parsing after grammar loading. Cancelled or failed work is never cached.\n * The existing size cap and plain-text fallback are unchanged.\n */\nexport async function highlightToLines(\n text: string,\n grammar: GrammarKey,\n signal?: AbortSignal,\n): Promise<SyntaxLines | undefined> {\n if (signal?.aborted || text.length === 0 || text.length > MAX_HIGHLIGHT_CHARS) return undefined;\n const key = `${grammar}\\u0000${text}`;\n const hit = cache.get(key);\n if (hit !== undefined) {\n cache.delete(key);\n cache.set(key, hit);\n return hit.lines;\n }\n let job = pending.get(key);\n if (job === undefined) {\n const controller = new AbortController();\n job = { controller, users: 0, promise: parseToLines(text, grammar, controller.signal) };\n const created = job;\n job.promise = job.promise\n .then((lines) => {\n if (!controller.signal.aborted && lines !== undefined) remember(key, lines);\n return lines;\n })\n .finally(() => {\n if (pending.get(key) === created) pending.delete(key);\n });\n pending.set(key, job);\n }\n const shared = job;\n shared.users += 1;\n return new Promise((resolve, reject) => {\n let finished = false;\n const release = () => {\n if (finished) return false;\n finished = true;\n signal?.removeEventListener('abort', abort);\n shared.users -= 1;\n return true;\n };\n const abort = () => {\n if (!release()) return;\n if (shared.users === 0) {\n shared.controller.abort();\n if (pending.get(key) === shared) pending.delete(key);\n }\n resolve(undefined);\n };\n signal?.addEventListener('abort', abort, { once: true });\n void shared.promise.then(\n (lines) => {\n if (release()) resolve(lines);\n },\n (error: unknown) => {\n if (release()) reject(error);\n },\n );\n });\n}\n"],"mappings":"A,0HAkCA,MAKMA,EAA8F,CAClG,CAAE,QAAS,oCAAqC,QAAS,OAAQ,EACjE,CAAE,QAAS,wBAAyB,QAAS,QAAS,EACtD,CAAE,QAAS,6BAA8B,QAA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BL,EAAM,IAAIK,EAAKK,CAAG,EACXA,EAAI,MAEb,IAAIC,EAAMT,EAAQ,IAAIG,CAAG,EACzB,GAAIM,IAAQ,IAAA,GAAW,CACrB,IAAMC,EAAa,IAAI,gBACvB,EAAM,CAAE,aAAY,MAAO,EAAG,QAASrB,EAAahB,EAAMa,EAASwB,EAAW,MAAM,CAAE,EACtF,IAAMC,EAAUF,EAChB,EAAI,QAAUA,EAAI,QACf,KAAM,IACD,CAACC,EAAW,OAAO,SAAWjB,IAAU,IAAA,IAAWQ,EAASE,EAAKV,CAAK,EACnEA,EACR,CAAC,CACD,YAAc,CACTO,EAAQ,IAAIG,CAAG,IAAMQ,GAASX,EAAQ,OAAOG,CAAG,CACtD,CAAC,EACHH,EAAQ,IAAIG,EAAKM,CAAG,CACtB,CACA,IAAMG,EAASH,EAEf,MADA,GAAO,OAAS,EACT,IAAI,SAAS,EAAS,IAAW,CACtC,IAAII,EAAW,GACTC,MACJ,CAAID,IACJ,EAAW,GACXrB,GAAQ,oBAAoB,QAASuB,CAAK,EAC1C,IAAO,MACA,IAEHA,MAAc,CACbD,EAAQ,IACTF,EAAO,QAAU,IACnBA,EAAO,WAAW,MAAM,EACpBZ,EAAQ,IAAIG,CAAG,IAAMS,GAAQZ,EAAQ,OAAOG,CAAG,GAErDa,EAAQ,IAAA,EAAS,EACnB,EACAxB,GAAQ,iBAAiB,QAASuB,EAAO,CAAE,KAAM,EAAK,CAAC,EACvDH,EAAY,QAAQ,KACjB,GAAU,CACLE,EAAQ,GAAGE,EAAQvB,CAAK,CAC9B,EACC,GAAmB,CACdqB,EAAQ,GAAGG,EAAOC,CAAK,CAC7B,CACF,CACF,CAAC,CACH,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"tone.cjs","names":["STATUS_TO_CHIP","STATUS_TO_DOT","CHIP_TO_STATUS","LINE_TONE_TO_STATUS"],"sources":["../../../src/lib/tone.ts"],"sourcesContent":["import type { ChipTone, DotTone, MessageLineTone, StatusTone } from '../types/tone';\n\n/**\n * Translations between the tone vocabularies.\n *\n * Every surface that shows an outcome used to carry its own\n * `Record<Tone, string>` table mapping a state onto a colour class. Those\n * tables disagreed as often as they agreed. These maps are the one place the\n * translation lives, so a card picks a status tone from its own domain and\n * asks here what colour that reads as.\n */\n\n/** The colour a status reads as, for the chip and border families. */\nexport const STATUS_TO_CHIP: Readonly<Record<StatusTone, ChipTone>> = {\n neutral: 'neutral',\n running: 'yellow',\n ok: 'green',\n error: 'red',\n info: 'blue',\n accent: 'magenta',\n};\n\n/** The dot a status reads as; a neutral status is present but not live. */\nexport const STATUS_TO_DOT: Readonly<Record<StatusTone, DotTone>> = {\n neutral: 'muted',\n running: 'yellow',\n ok: 'green',\n error: 'red',\n info: 'blue',\n accent: 'magenta',\n};\n\n/**\n * The status a colour stands for, for a caller that has only a chip tone.\n * Lossy on purpose: the palette has more colours than there are outcomes, and\n * a colour with no outcome of its own reads as neutral.\n */\nexport const CHIP_TO_STATUS: Readonly<Record<ChipTone, StatusTone>> = {\n neutral: 'neutral',\n blue: 'info',\n green: 'ok',\n yellow: 'running',\n red: 'error',\n magenta: 'accent',\n violet: 'accent',\n cyan: 'info',\n orange: 'running',\n teal: 'info',\n};\n\n/** The status a body line's role corresponds to, for a card that badges its worst line. */\nexport const LINE_TONE_TO_STATUS: Readonly<Record<MessageLineTone, StatusTone>> = {\n hi: 'neutral',\n text: 'neutral',\n dim: 'neutral',\n muted: 'neutral',\n success: 'ok',\n error: 'error',\n warning: 'running',\n accent: 'info',\n};\n"],"mappings":"AAaA,MAAaA,EAAyD,CACpE,QAAS,UACT,QAAS,SACT,GAAI,QACJ,MAAO,MACP,KAAM,OACN,OAAQ,SACV,EAGaC,EAAuD,CAClE,QAAS,QACT,QAAS,SACT,GAAI,QACJ,MAAO,MACP,KAAM,OACN,OAAQ,SACV,EAOaC,EAAyD,CACpE,QAAS,UACT,KAAM,OACN,MAAO,KACP,OAAQ,UACR,IAAK,QACL,QAAS,SACT,OAAQ,SACR,KAAM,OACN,OAAQ,UACR,KAAM,MACR,EAGaC,EAAqE,CAChF,GAAI,UACJ,KAAM,UACN,IAAK,UACL,MAAO,UACP,QAAS,KACT,MAAO,QACP,QAAS,UACT,OAAQ,MACV"}
1
+ {"version":3,"file":"tone.cjs","names":["STATUS_TO_CHIP","STATUS_TO_DOT","CHIP_TO_STATUS","LINE_TONE_TO_STATUS"],"sources":["../../../src/lib/tone.ts"],"sourcesContent":["import type { ChipTone, DotTone, MessageLineTone, StatusTone } from '../types/tone';\n\n/**\n * Translations between the tone vocabularies.\n *\n * Every surface that shows an outcome used to carry its own\n * `Record<Tone, string>` table mapping a state onto a colour class. Those\n * tables disagreed as often as they agreed. These maps are the one place the\n * translation lives, so a card picks a status tone from its own domain and\n * asks here what colour that reads as.\n */\n\n/** The colour a status reads as, for the chip and border families. */\nexport const STATUS_TO_CHIP: Readonly<Record<StatusTone, ChipTone>> = {\n neutral: 'neutral',\n running: 'yellow',\n ok: 'green',\n error: 'red',\n info: 'blue',\n accent: 'magenta',\n};\n\n/** The dot a status reads as; a neutral status is present but not live. */\nexport const STATUS_TO_DOT: Readonly<Record<StatusTone, DotTone>> = {\n neutral: 'muted',\n running: 'yellow',\n ok: 'green',\n error: 'red',\n info: 'blue',\n accent: 'magenta',\n};\n\n/**\n * The status a colour stands for, for a caller that has only a chip tone.\n * Lossy on purpose: the palette has more colours than there are outcomes, and\n * a colour with no outcome of its own reads as neutral.\n */\nexport const CHIP_TO_STATUS: Readonly<Record<ChipTone, StatusTone>> = {\n neutral: 'neutral',\n blue: 'info',\n green: 'ok',\n yellow: 'running',\n red: 'error',\n magenta: 'accent',\n violet: 'accent',\n cyan: 'info',\n orange: 'running',\n teal: 'info',\n};\n\n/** The status a body line's role corresponds to, for a card that badges its worst line. */\nexport const LINE_TONE_TO_STATUS: Readonly<Record<MessageLineTone, StatusTone>> = {\n hi: 'neutral',\n text: 'neutral',\n dim: 'neutral',\n muted: 'neutral',\n success: 'ok',\n error: 'error',\n warning: 'running',\n accent: 'info',\n};\n"],"mappings":"AAaA,MAAaA,EAAyD,CACpE,QAAS,UACT,QAAS,SACT,GAAI,QACJ,MAAO,MACP,KAAM,OACN,OAAQ,SACV,EAGaC,EAAuD,CAClE,QAAS,QACT,QAAS,SACT,GAAI,QACJ,MAAO,MACP,KAAM,OACN,OAAQ,SACV,EAOaC,EAAyD,CACpE,QAAS,UACT,KAAM,OACN,MAAO,KACP,OAAQ,UACR,IAAK,QACL,QAAS,SACT,OAAQ,SACR,KAAM,OACN,OAAQ,UACR,KAAM,MACR,EAGaC,EAAqE,CAChF,GAAI,UACJ,KAAM,UACN,IAAK,UACL,MAAO,UACP,QAAS,KACT,MAAO,QACP,QAAS,UACT,OAAQ,MACV,E"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tone.d.mts","names":[],"sources":["../../../src/lib/tone.ts"],"mappings":";;;;;;;;;;;;qBAaa,gBAAgB,SAAS,OAAO,YAAY;;qBAU5C,eAAe,SAAS,OAAO,YAAY;;;;;;qBAc3C,gBAAgB,SAAS,OAAO,UAAU;;qBAc1C,qBAAqB,SAAS,OAAO,iBAAiB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tone.mjs","names":["STATUS_TO_CHIP","STATUS_TO_DOT","CHIP_TO_STATUS","LINE_TONE_TO_STATUS"],"sources":["../../../src/lib/tone.ts"],"sourcesContent":["import type { ChipTone, DotTone, MessageLineTone, StatusTone } from '../types/tone';\n\n/**\n * Translations between the tone vocabularies.\n *\n * Every surface that shows an outcome used to carry its own\n * `Record<Tone, string>` table mapping a state onto a colour class. Those\n * tables disagreed as often as they agreed. These maps are the one place the\n * translation lives, so a card picks a status tone from its own domain and\n * asks here what colour that reads as.\n */\n\n/** The colour a status reads as, for the chip and border families. */\nexport const STATUS_TO_CHIP: Readonly<Record<StatusTone, ChipTone>> = {\n neutral: 'neutral',\n running: 'yellow',\n ok: 'green',\n error: 'red',\n info: 'blue',\n accent: 'magenta',\n};\n\n/** The dot a status reads as; a neutral status is present but not live. */\nexport const STATUS_TO_DOT: Readonly<Record<StatusTone, DotTone>> = {\n neutral: 'muted',\n running: 'yellow',\n ok: 'green',\n error: 'red',\n info: 'blue',\n accent: 'magenta',\n};\n\n/**\n * The status a colour stands for, for a caller that has only a chip tone.\n * Lossy on purpose: the palette has more colours than there are outcomes, and\n * a colour with no outcome of its own reads as neutral.\n */\nexport const CHIP_TO_STATUS: Readonly<Record<ChipTone, StatusTone>> = {\n neutral: 'neutral',\n blue: 'info',\n green: 'ok',\n yellow: 'running',\n red: 'error',\n magenta: 'accent',\n violet: 'accent',\n cyan: 'info',\n orange: 'running',\n teal: 'info',\n};\n\n/** The status a body line's role corresponds to, for a card that badges its worst line. */\nexport const LINE_TONE_TO_STATUS: Readonly<Record<MessageLineTone, StatusTone>> = {\n hi: 'neutral',\n text: 'neutral',\n dim: 'neutral',\n muted: 'neutral',\n success: 'ok',\n error: 'error',\n warning: 'running',\n accent: 'info',\n};\n"],"mappings":"AAaA,MAAaA,EAAyD,CACpE,QAAS,UACT,QAAS,SACT,GAAI,QACJ,MAAO,MACP,KAAM,OACN,OAAQ,SACV,EAGaC,EAAuD,CAClE,QAAS,QACT,QAAS,SACT,GAAI,QACJ,MAAO,MACP,KAAM,OACN,OAAQ,SACV,EAOaC,EAAyD,CACpE,QAAS,UACT,KAAM,OACN,MAAO,KACP,OAAQ,UACR,IAAK,QACL,QAAS,SACT,OAAQ,SACR,KAAM,OACN,OAAQ,UACR,KAAM,MACR,EAGaC,EAAqE,CAChF,GAAI,UACJ,KAAM,UACN,IAAK,UACL,MAAO,UACP,QAAS,KACT,MAAO,QACP,QAAS,UACT,OAAQ,MACV,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"apply.cjs","names":["PALETTE_TOKENS","themeVariable","derivedTokens","tokenValue","require_theme","require_derive","THEME_ATTRIBUTE","themeCssVariables","variables","token","theme","themeCssText","declarations","name","value","selector","applyTheme","root"],"sources":["../../../src/theme/apply.ts"],"sourcesContent":["import { PALETTE_TOKENS, type ThemeConfig, themeVariable } from '../types/theme';\nimport { derivedTokens, tokenValue } from './derive';\n\n/** The attribute the active theme's name is stamped on, for CSS that keys off a theme. */\nexport const THEME_ATTRIBUTE = 'data-theme';\n\n/** Every custom property a theme publishes, keyed by property name. */\nexport function themeCssVariables(theme: ThemeConfig): Record<string, string> {\n const variables: Record<string, string> = {};\n for (const token of PALETTE_TOKENS) variables[themeVariable(token)] = theme.tokens[token];\n for (const token of derivedTokens()) variables[themeVariable(token)] = tokenValue(theme, token);\n return variables;\n}\n\n/** The theme as a stylesheet rule, for a server that wants to inline it. */\nexport function themeCssText(theme: ThemeConfig, selector = ':root'): string {\n const declarations = Object.entries(themeCssVariables(theme)).map(([name, value]) => ` ${name}: ${value};`);\n return `${selector} {\\n color-scheme: ${theme.scheme};\\n${declarations.join('\\n')}\\n}\\n`;\n}\n\n/** The subset of an element the theme touches, so tests can pass a plain object. */\nexport interface ThemeRoot {\n style: { setProperty(name: string, value: string): void; colorScheme: string };\n setAttribute(name: string, value: string): void;\n}\n\n/**\n * Applies a theme to the page: every token becomes a custom property on the\n * root, the colour scheme follows, and the theme name is stamped so a style\n * may key off it. Idempotent and synchronous, so calling it before the first\n * render avoids a flash of the default theme.\n */\nexport function applyTheme(theme: ThemeConfig, root: ThemeRoot): void {\n for (const [name, value] of Object.entries(themeCssVariables(theme))) root.style.setProperty(name, value);\n root.style.colorScheme = theme.scheme;\n root.setAttribute(THEME_ATTRIBUTE, theme.name);\n}\n"],"mappings":"gEAIaM,EAAkB,aAG/B,SAAgBC,EAAkB,EAA4C,CAC5E,IAAMC,EAAoC,CAAC,EAC3C,IAAK,IAAMC,KAAST,EAAAA,eAAgB,EAAUC,EAAAA,cAAcQ,CAAK,GAAKC,EAAM,OAAOD,GACnF,IAAK,IAAMA,KAASP,EAAAA,cAAc,EAAG,EAAUD,EAAAA,cAAcQ,CAAK,GAAKN,EAAAA,WAAWO,EAAOD,CAAK,EAC9F,OAAOD,CACT,CAGA,SAAgBG,EAAa,EAAoB,EAAW,QAAiB,CAC3E,IAAMC,EAAe,OAAO,QAAQL,EAAkBG,CAAK,CAAC,CAAC,CAAC,KAAK,CAACG,EAAMC,KAAW,KAAKD,EAAK,IAAIC,EAAM,EAAE,EAC3G,MAAO,GAAGC,EAAS,sBAAsBL,EAAM,OAAO,KAAKE,EAAa,KAAK;CAAI,EAAE,MACrF,CAcA,SAAgBI,EAAW,EAAoB,EAAuB,CACpE,IAAK,GAAM,CAACH,EAAMC,KAAU,OAAO,QAAQP,EAAkBG,CAAK,CAAC,EAAGO,EAAK,MAAM,YAAYJ,EAAMC,CAAK,EACxG,EAAK,MAAM,YAAcJ,EAAM,OAC/BO,EAAK,aAAaX,EAAiBI,EAAM,IAAI,CAC/C"}
1
+ {"version":3,"file":"apply.cjs","names":["PALETTE_TOKENS","themeVariable","derivedTokens","tokenValue","require_theme","require_derive","THEME_ATTRIBUTE","themeCssVariables","variables","token","theme","themeCssText","declarations","name","value","selector","applyTheme","root"],"sources":["../../../src/theme/apply.ts"],"sourcesContent":["import { PALETTE_TOKENS, type ThemeConfig, themeVariable } from '../types/theme';\nimport { derivedTokens, tokenValue } from './derive';\n\n/** The attribute the active theme's name is stamped on, for CSS that keys off a theme. */\nexport const THEME_ATTRIBUTE = 'data-theme';\n\n/** Every custom property a theme publishes, keyed by property name. */\nexport function themeCssVariables(theme: ThemeConfig): Record<string, string> {\n const variables: Record<string, string> = {};\n for (const token of PALETTE_TOKENS) variables[themeVariable(token)] = theme.tokens[token];\n for (const token of derivedTokens()) variables[themeVariable(token)] = tokenValue(theme, token);\n return variables;\n}\n\n/** The theme as a stylesheet rule, for a server that wants to inline it. */\nexport function themeCssText(theme: ThemeConfig, selector = ':root'): string {\n const declarations = Object.entries(themeCssVariables(theme)).map(([name, value]) => ` ${name}: ${value};`);\n return `${selector} {\\n color-scheme: ${theme.scheme};\\n${declarations.join('\\n')}\\n}\\n`;\n}\n\n/** The subset of an element the theme touches, so tests can pass a plain object. */\nexport interface ThemeRoot {\n style: { setProperty(name: string, value: string): void; colorScheme: string };\n setAttribute(name: string, value: string): void;\n}\n\n/**\n * Applies a theme to the page: every token becomes a custom property on the\n * root, the colour scheme follows, and the theme name is stamped so a style\n * may key off it. Idempotent and synchronous, so calling it before the first\n * render avoids a flash of the default theme.\n */\nexport function applyTheme(theme: ThemeConfig, root: ThemeRoot): void {\n for (const [name, value] of Object.entries(themeCssVariables(theme))) root.style.setProperty(name, value);\n root.style.colorScheme = theme.scheme;\n root.setAttribute(THEME_ATTRIBUTE, theme.name);\n}\n"],"mappings":"A,gEAIaM,EAAkB,aAG/B,SAAgBC,EAAkB,EAA4C,CAC5E,IAAMC,EAAoC,CAAC,EAC3C,IAAK,IAAMC,KAAST,EAAAA,eAAgB,EAAUC,EAAAA,cAAcQ,CAAK,GAAKC,EAAM,OAAOD,GACnF,IAAK,IAAMA,KAASP,EAAAA,cAAc,EAAG,EAAUD,EAAAA,cAAcQ,CAAK,GAAKN,EAAAA,WAAWO,EAAOD,CAAK,EAC9F,OAAOD,CACT,CAGA,SAAgBG,EAAa,EAAoB,EAAW,QAAiB,CAC3E,IAAMC,EAAe,OAAO,QAAQL,EAAkBG,CAAK,CAAC,CAAC,CAAC,KAAK,CAACG,EAAMC,KAAW,KAAKD,EAAK,IAAIC,EAAM,EAAE,EAC3G,MAAO,GAAGC,EAAS,sBAAsBL,EAAM,OAAO,KAAKE,EAAa,KAAK;CAAI,EAAE,MACrF,CAcA,SAAgBI,EAAW,EAAoB,EAAuB,CACpE,IAAK,GAAM,CAACH,EAAMC,KAAU,OAAO,QAAQP,EAAkBG,CAAK,CAAC,EAAGO,EAAK,MAAM,YAAYJ,EAAMC,CAAK,EACxG,EAAK,MAAM,YAAcJ,EAAM,OAC/BO,EAAK,aAAaX,EAAiBI,EAAM,IAAI,CAC/C,C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.d.mts","names":[],"sources":["../../../src/theme/apply.ts"],"mappings":";;;qBAIa;;wBAGG,kBAAkB,OAAO,cAAc;;wBAQvC,aAAa,OAAO,aAAa;;iBAMhC;EACf;IAAS,YAAY,cAAc;IAAsB;;EACzD,aAAa,cAAc;;;;;;;;wBASb,WAAW,OAAO,aAAa,MAAM"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.mjs","names":["THEME_ATTRIBUTE","themeCssVariables","variables","token","PALETTE_TOKENS","themeVariable","theme","derivedTokens","tokenValue","themeCssText","declarations","name","value","selector","applyTheme","root"],"sources":["../../../src/theme/apply.ts"],"sourcesContent":["import { PALETTE_TOKENS, type ThemeConfig, themeVariable } from '../types/theme';\nimport { derivedTokens, tokenValue } from './derive';\n\n/** The attribute the active theme's name is stamped on, for CSS that keys off a theme. */\nexport const THEME_ATTRIBUTE = 'data-theme';\n\n/** Every custom property a theme publishes, keyed by property name. */\nexport function themeCssVariables(theme: ThemeConfig): Record<string, string> {\n const variables: Record<string, string> = {};\n for (const token of PALETTE_TOKENS) variables[themeVariable(token)] = theme.tokens[token];\n for (const token of derivedTokens()) variables[themeVariable(token)] = tokenValue(theme, token);\n return variables;\n}\n\n/** The theme as a stylesheet rule, for a server that wants to inline it. */\nexport function themeCssText(theme: ThemeConfig, selector = ':root'): string {\n const declarations = Object.entries(themeCssVariables(theme)).map(([name, value]) => ` ${name}: ${value};`);\n return `${selector} {\\n color-scheme: ${theme.scheme};\\n${declarations.join('\\n')}\\n}\\n`;\n}\n\n/** The subset of an element the theme touches, so tests can pass a plain object. */\nexport interface ThemeRoot {\n style: { setProperty(name: string, value: string): void; colorScheme: string };\n setAttribute(name: string, value: string): void;\n}\n\n/**\n * Applies a theme to the page: every token becomes a custom property on the\n * root, the colour scheme follows, and the theme name is stamped so a style\n * may key off it. Idempotent and synchronous, so calling it before the first\n * render avoids a flash of the default theme.\n */\nexport function applyTheme(theme: ThemeConfig, root: ThemeRoot): void {\n for (const [name, value] of Object.entries(themeCssVariables(theme))) root.style.setProperty(name, value);\n root.style.colorScheme = theme.scheme;\n root.setAttribute(THEME_ATTRIBUTE, theme.name);\n}\n"],"mappings":"A,oIAIA,MAAaA,EAAkB,aAG/B,SAAgBC,EAAkB,EAA4C,CAC5E,IAAMC,EAAoC,CAAC,EAC3C,IAAK,IAAMC,KAASC,EAAgB,EAAUC,EAAcF,CAAK,GAAKG,EAAM,OAAOH,GACnF,IAAK,IAAMA,KAASI,EAAc,EAAG,EAAUF,EAAcF,CAAK,GAAKK,EAAWF,EAAOH,CAAK,EAC9F,OAAOD,CACT,CAGA,SAAgBO,EAAa,EAAoB,EAAW,QAAiB,CAC3E,IAAMC,EAAe,OAAO,QAAQT,EAAkBK,CAAK,CAAC,CAAC,CAAC,KAAK,CAACK,EAAMC,KAAW,KAAKD,EAAK,IAAIC,EAAM,EAAE,EAC3G,MAAO,GAAGC,EAAS,sBAAsBP,EAAM,OAAO,KAAKI,EAAa,KAAK;CAAI,EAAE,MACrF,CAcA,SAAgBI,EAAW,EAAoB,EAAuB,CACpE,IAAK,GAAM,CAACH,EAAMC,KAAU,OAAO,QAAQX,EAAkBK,CAAK,CAAC,EAAGS,EAAK,MAAM,YAAYJ,EAAMC,CAAK,EACxG,EAAK,MAAM,YAAcN,EAAM,OAC/BS,EAAK,aAAaf,EAAiBM,EAAM,IAAI,CAC/C,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"builtinThemes.cjs","names":["parseThemeConfig","poOneLight","poNordDark","require_po_nord_dark","require_po_one_light","require_parse","shipped","theme","input","file","BUILTIN_THEMES","DEFAULT_THEME","builtinTheme","name"],"sources":["../../../src/theme/builtinThemes.ts"],"sourcesContent":["import poNordDark from '../../themes/po-nord-dark.json' with { type: 'json' };\nimport poOneLight from '../../themes/po-one-light.json' with { type: 'json' };\nimport type { ThemeConfig } from '../types/theme';\nimport { parseThemeConfig } from './parse';\n\nfunction shipped(input: unknown, file: string): ThemeConfig {\n const theme = parseThemeConfig(input);\n if (theme === null) throw new Error(`The shipped theme ${file} is malformed.`);\n return theme;\n}\n\n/** The theme the cockpit renders with until a preference says otherwise. */\nexport const DEFAULT_THEME_NAME = 'po-one-light';\n\n/** The themes this package ships, default first. */\nexport const BUILTIN_THEMES: readonly ThemeConfig[] = [\n shipped(poOneLight, 'po-one-light.json'),\n shipped(poNordDark, 'po-nord-dark.json'),\n];\n\nexport const DEFAULT_THEME: ThemeConfig = BUILTIN_THEMES[0];\n\n/** A shipped theme by name, or undefined for a name nothing shipped under. */\nexport function builtinTheme(name: string): ThemeConfig | undefined {\n return BUILTIN_THEMES.find((theme) => theme.name === name);\n}\n"],"mappings":"qHAKA,SAASM,EAAQ,EAAgB,EAA2B,CAC1D,IAAMC,EAAQP,EAAAA,iBAAiBQ,CAAK,EACpC,GAAID,IAAU,KAAM,MAAU,MAAM,qBAAqBE,EAAK,eAAe,EAC7E,OAAOF,CACT,CAGA,MAGaG,EAAyC,CACpDJ,EAAQL,EAAAA,QAAY,mBAAmB,EACvCK,EAAQJ,EAAAA,QAAY,mBAAmB,CACzC,EAEaS,EAA6BD,EAAe,GAGzD,SAAgBE,EAAa,EAAuC,CAClE,OAAOF,EAAe,KAAM,GAAUH,EAAM,OAASM,CAAI,CAC3D"}
1
+ {"version":3,"file":"builtinThemes.cjs","names":["parseThemeConfig","poOneLight","poNordDark","require_po_nord_dark","require_po_one_light","require_parse","shipped","theme","input","file","BUILTIN_THEMES","DEFAULT_THEME","builtinTheme","name"],"sources":["../../../src/theme/builtinThemes.ts"],"sourcesContent":["import poNordDark from '../../themes/po-nord-dark.json' with { type: 'json' };\nimport poOneLight from '../../themes/po-one-light.json' with { type: 'json' };\nimport type { ThemeConfig } from '../types/theme';\nimport { parseThemeConfig } from './parse';\n\nfunction shipped(input: unknown, file: string): ThemeConfig {\n const theme = parseThemeConfig(input);\n if (theme === null) throw new Error(`The shipped theme ${file} is malformed.`);\n return theme;\n}\n\n/** The theme the cockpit renders with until a preference says otherwise. */\nexport const DEFAULT_THEME_NAME = 'po-one-light';\n\n/** The themes this package ships, default first. */\nexport const BUILTIN_THEMES: readonly ThemeConfig[] = [\n shipped(poOneLight, 'po-one-light.json'),\n shipped(poNordDark, 'po-nord-dark.json'),\n];\n\nexport const DEFAULT_THEME: ThemeConfig = BUILTIN_THEMES[0];\n\n/** A shipped theme by name, or undefined for a name nothing shipped under. */\nexport function builtinTheme(name: string): ThemeConfig | undefined {\n return BUILTIN_THEMES.find((theme) => theme.name === name);\n}\n"],"mappings":"A,qHAKA,SAASM,EAAQ,EAAgB,EAA2B,CAC1D,IAAMC,EAAQP,EAAAA,iBAAiBQ,CAAK,EACpC,GAAID,IAAU,KAAM,MAAU,MAAM,qBAAqBE,EAAK,eAAe,EAC7E,OAAOF,CACT,CAGA,MAGaG,EAAyC,CACpDJ,EAAQL,EAAAA,QAAY,mBAAmB,EACvCK,EAAQJ,EAAAA,QAAY,mBAAmB,CACzC,EAEaS,EAA6BD,EAAe,GAGzD,SAAgBE,EAAa,EAAuC,CAClE,OAAOF,EAAe,KAAM,GAAUH,EAAM,OAASM,CAAI,CAC3D,C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtinThemes.d.mts","names":[],"sources":["../../../src/theme/builtinThemes.ts"],"mappings":";;;qBAYa;;qBAGA,yBAAyB;qBAKzB,eAAe;;wBAGZ,aAAa,eAAe"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtinThemes.mjs","names":["poOneLight","poNordDark","po_nord_dark_default","po_one_light_default","shipped","theme","parseThemeConfig","input","file","DEFAULT_THEME_NAME","BUILTIN_THEMES","DEFAULT_THEME","builtinTheme","name"],"sources":["../../../src/theme/builtinThemes.ts"],"sourcesContent":["import poNordDark from '../../themes/po-nord-dark.json' with { type: 'json' };\nimport poOneLight from '../../themes/po-one-light.json' with { type: 'json' };\nimport type { ThemeConfig } from '../types/theme';\nimport { parseThemeConfig } from './parse';\n\nfunction shipped(input: unknown, file: string): ThemeConfig {\n const theme = parseThemeConfig(input);\n if (theme === null) throw new Error(`The shipped theme ${file} is malformed.`);\n return theme;\n}\n\n/** The theme the cockpit renders with until a preference says otherwise. */\nexport const DEFAULT_THEME_NAME = 'po-one-light';\n\n/** The themes this package ships, default first. */\nexport const BUILTIN_THEMES: readonly ThemeConfig[] = [\n shipped(poOneLight, 'po-one-light.json'),\n shipped(poNordDark, 'po-nord-dark.json'),\n];\n\nexport const DEFAULT_THEME: ThemeConfig = BUILTIN_THEMES[0];\n\n/** A shipped theme by name, or undefined for a name nothing shipped under. */\nexport function builtinTheme(name: string): ThemeConfig | undefined {\n return BUILTIN_THEMES.find((theme) => theme.name === name);\n}\n"],"mappings":"A,yIAKA,SAASI,EAAQ,EAAgB,EAA2B,CAC1D,IAAMC,EAAQC,EAAiBC,CAAK,EACpC,GAAIF,IAAU,KAAM,MAAU,MAAM,qBAAqBG,EAAK,eAAe,EAC7E,OAAOH,CACT,CAGA,MAAaI,EAAqB,eAGrBC,EAAyC,CACpDN,EAAQJ,EAAY,mBAAmB,EACvCI,EAAQH,EAAY,mBAAmB,CACzC,EAEaU,EAA6BD,EAAe,GAGzD,SAAgBE,EAAa,EAAuC,CAClE,OAAOF,EAAe,KAAM,GAAUL,EAAM,OAASQ,CAAI,CAC3D,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"derive.cjs","names":["ACCENT_TOKENS","require_theme","DEFAULT_FONT_MONO","derivedFallback","token","kind","accent","derivedTokens","tokens","tokenValue","own","theme"],"sources":["../../../src/theme/derive.ts"],"sourcesContent":["import { ACCENT_TOKENS, type AccentToken, type DerivedToken, type ThemeConfig, type ThemeToken } from '../types/theme';\n\n/** How much of an accent goes into its tinted background; the rest is the panel. */\nexport const TINT_MIX_PERCENT = 16;\n/** How much of an accent goes into its accented border; the rest is the border. */\nexport const EDGE_MIX_PERCENT = 40;\n/** How much of the selection tints its foreground; the rest is white, so the label stays legible on it. */\nexport const ON_SELECTED_MIX_PERCENT = 12;\n\nexport const DEFAULT_FONT_MONO =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace\";\n\n/**\n * A derived token's fallback: a CSS colour expression over the palette, so a\n * theme that supplies only its palette still gets coherent tints and edges.\n */\nexport function derivedFallback(token: DerivedToken): string {\n if (token === 'font-mono') return DEFAULT_FONT_MONO;\n if (token === 'on-selected')\n return `color-mix(in srgb, var(--po-selected) ${String(ON_SELECTED_MIX_PERCENT)}%, white)`;\n const [kind, accent] = token.split('-') as ['tint' | 'edge', AccentToken];\n return kind === 'tint'\n ? `color-mix(in srgb, var(--po-${accent}) ${String(TINT_MIX_PERCENT)}%, var(--po-panel))`\n : `color-mix(in srgb, var(--po-${accent}) ${String(EDGE_MIX_PERCENT)}%, var(--po-border))`;\n}\n\n/** Every derived token, in a stable order. */\nexport function derivedTokens(): DerivedToken[] {\n const tokens: DerivedToken[] = [];\n for (const accent of ACCENT_TOKENS) tokens.push(`tint-${accent}`);\n for (const accent of ACCENT_TOKENS) tokens.push(`edge-${accent}`);\n tokens.push('on-selected', 'font-mono');\n return tokens;\n}\n\n/** The value a theme publishes for a token: its own, or the derived fallback. */\nexport function tokenValue(theme: ThemeConfig, token: ThemeToken): string {\n const own = (theme.tokens as Partial<Record<ThemeToken, string>>)[token];\n if (own !== undefined) return own;\n return derivedFallback(token as DerivedToken);\n}\n"],"mappings":"sCASaE,EACX,mHAMF,SAAgBC,EAAgB,EAA6B,CAC3D,GAAIC,IAAU,YAAa,OAAOF,EAClC,GAAIE,IAAU,cACZ,MAAO,oDACT,GAAM,CAACC,EAAMC,GAAUF,EAAM,MAAM,GAAG,EACtC,OAAOC,IAAS,OACZ,+BAA+BC,EAAO,yBACtC,+BAA+BA,EAAO,yBAC5C,CAGA,SAAgBC,GAAgC,CAC9C,IAAMC,EAAyB,CAAC,EAChC,IAAK,IAAMF,KAAUN,EAAAA,cAAeQ,EAAO,KAAK,QAAQF,GAAQ,EAChE,IAAK,IAAMA,KAAUN,EAAAA,cAAeQ,EAAO,KAAK,QAAQF,GAAQ,EAEhE,OADAE,EAAO,KAAK,cAAe,WAAW,EAC/BA,CACT,CAGA,SAAgBC,EAAW,EAAoB,EAA2B,CACxE,IAAMC,EAAOC,EAAM,OAA+CP,GAElE,OADIM,IAAQ,IAAA,GACLP,EAAgBC,CAAqB,EADdM,CAEhC"}
1
+ {"version":3,"file":"derive.cjs","names":["ACCENT_TOKENS","require_theme","DEFAULT_FONT_MONO","derivedFallback","token","kind","accent","derivedTokens","tokens","tokenValue","own","theme"],"sources":["../../../src/theme/derive.ts"],"sourcesContent":["import { ACCENT_TOKENS, type AccentToken, type DerivedToken, type ThemeConfig, type ThemeToken } from '../types/theme';\n\n/** How much of an accent goes into its tinted background; the rest is the panel. */\nexport const TINT_MIX_PERCENT = 16;\n/** How much of an accent goes into its accented border; the rest is the border. */\nexport const EDGE_MIX_PERCENT = 40;\n/** How much of the selection tints its foreground; the rest is white, so the label stays legible on it. */\nexport const ON_SELECTED_MIX_PERCENT = 12;\n\nexport const DEFAULT_FONT_MONO =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace\";\n\n/**\n * A derived token's fallback: a CSS colour expression over the palette, so a\n * theme that supplies only its palette still gets coherent tints and edges.\n */\nexport function derivedFallback(token: DerivedToken): string {\n if (token === 'font-mono') return DEFAULT_FONT_MONO;\n if (token === 'on-selected')\n return `color-mix(in srgb, var(--po-selected) ${String(ON_SELECTED_MIX_PERCENT)}%, white)`;\n const [kind, accent] = token.split('-') as ['tint' | 'edge', AccentToken];\n return kind === 'tint'\n ? `color-mix(in srgb, var(--po-${accent}) ${String(TINT_MIX_PERCENT)}%, var(--po-panel))`\n : `color-mix(in srgb, var(--po-${accent}) ${String(EDGE_MIX_PERCENT)}%, var(--po-border))`;\n}\n\n/** Every derived token, in a stable order. */\nexport function derivedTokens(): DerivedToken[] {\n const tokens: DerivedToken[] = [];\n for (const accent of ACCENT_TOKENS) tokens.push(`tint-${accent}`);\n for (const accent of ACCENT_TOKENS) tokens.push(`edge-${accent}`);\n tokens.push('on-selected', 'font-mono');\n return tokens;\n}\n\n/** The value a theme publishes for a token: its own, or the derived fallback. */\nexport function tokenValue(theme: ThemeConfig, token: ThemeToken): string {\n const own = (theme.tokens as Partial<Record<ThemeToken, string>>)[token];\n if (own !== undefined) return own;\n return derivedFallback(token as DerivedToken);\n}\n"],"mappings":"A,sCASaE,EACX,mHAMF,SAAgBC,EAAgB,EAA6B,CAC3D,GAAIC,IAAU,YAAa,OAAOF,EAClC,GAAIE,IAAU,cACZ,MAAO,oDACT,GAAM,CAACC,EAAMC,GAAUF,EAAM,MAAM,GAAG,EACtC,OAAOC,IAAS,OACZ,+BAA+BC,EAAO,yBACtC,+BAA+BA,EAAO,yBAC5C,CAGA,SAAgBC,GAAgC,CAC9C,IAAMC,EAAyB,CAAC,EAChC,IAAK,IAAMF,KAAUN,EAAAA,cAAeQ,EAAO,KAAK,QAAQF,GAAQ,EAChE,IAAK,IAAMA,KAAUN,EAAAA,cAAeQ,EAAO,KAAK,QAAQF,GAAQ,EAEhE,OADAE,EAAO,KAAK,cAAe,WAAW,EAC/BA,CACT,CAGA,SAAgBC,EAAW,EAAoB,EAA2B,CACxE,IAAMC,EAAOC,EAAM,OAA+CP,GAElE,OADIM,IAAQ,IAAA,GACLP,EAAgBC,CAAqB,EADdM,CAEhC,C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derive.d.mts","names":[],"sources":["../../../src/theme/derive.ts"],"mappings":";;qBASa;;;;;wBAOG,gBAAgB,OAAO;;wBAWvB,iBAAiB;;wBASjB,WAAW,OAAO,aAAa,OAAO"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derive.mjs","names":["DEFAULT_FONT_MONO","derivedFallback","token","kind","accent","derivedTokens","tokens","ACCENT_TOKENS","tokenValue","own","theme"],"sources":["../../../src/theme/derive.ts"],"sourcesContent":["import { ACCENT_TOKENS, type AccentToken, type DerivedToken, type ThemeConfig, type ThemeToken } from '../types/theme';\n\n/** How much of an accent goes into its tinted background; the rest is the panel. */\nexport const TINT_MIX_PERCENT = 16;\n/** How much of an accent goes into its accented border; the rest is the border. */\nexport const EDGE_MIX_PERCENT = 40;\n/** How much of the selection tints its foreground; the rest is white, so the label stays legible on it. */\nexport const ON_SELECTED_MIX_PERCENT = 12;\n\nexport const DEFAULT_FONT_MONO =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace\";\n\n/**\n * A derived token's fallback: a CSS colour expression over the palette, so a\n * theme that supplies only its palette still gets coherent tints and edges.\n */\nexport function derivedFallback(token: DerivedToken): string {\n if (token === 'font-mono') return DEFAULT_FONT_MONO;\n if (token === 'on-selected')\n return `color-mix(in srgb, var(--po-selected) ${String(ON_SELECTED_MIX_PERCENT)}%, white)`;\n const [kind, accent] = token.split('-') as ['tint' | 'edge', AccentToken];\n return kind === 'tint'\n ? `color-mix(in srgb, var(--po-${accent}) ${String(TINT_MIX_PERCENT)}%, var(--po-panel))`\n : `color-mix(in srgb, var(--po-${accent}) ${String(EDGE_MIX_PERCENT)}%, var(--po-border))`;\n}\n\n/** Every derived token, in a stable order. */\nexport function derivedTokens(): DerivedToken[] {\n const tokens: DerivedToken[] = [];\n for (const accent of ACCENT_TOKENS) tokens.push(`tint-${accent}`);\n for (const accent of ACCENT_TOKENS) tokens.push(`edge-${accent}`);\n tokens.push('on-selected', 'font-mono');\n return tokens;\n}\n\n/** The value a theme publishes for a token: its own, or the derived fallback. */\nexport function tokenValue(theme: ThemeConfig, token: ThemeToken): string {\n const own = (theme.tokens as Partial<Record<ThemeToken, string>>)[token];\n if (own !== undefined) return own;\n return derivedFallback(token as DerivedToken);\n}\n"],"mappings":"A,mDASA,MAAaA,EACX,mHAMF,SAAgBC,EAAgB,EAA6B,CAC3D,GAAIC,IAAU,YAAa,OAAOF,EAClC,GAAIE,IAAU,cACZ,MAAO,oDACT,GAAM,CAACC,EAAMC,GAAUF,EAAM,MAAM,GAAG,EACtC,OAAOC,IAAS,OACZ,+BAA+BC,EAAO,yBACtC,+BAA+BA,EAAO,yBAC5C,CAGA,SAAgBC,GAAgC,CAC9C,IAAMC,EAAyB,CAAC,EAChC,IAAK,IAAMF,KAAUG,EAAeD,EAAO,KAAK,QAAQF,GAAQ,EAChE,IAAK,IAAMA,KAAUG,EAAeD,EAAO,KAAK,QAAQF,GAAQ,EAEhE,OADAE,EAAO,KAAK,cAAe,WAAW,EAC/BA,CACT,CAGA,SAAgBE,EAAW,EAAoB,EAA2B,CACxE,IAAMC,EAAOC,EAAM,OAA+CR,GAElE,OADIO,IAAQ,IAAA,GACLR,EAAgBC,CAAqB,EADdO,CAEhC,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"nativeTheme.cjs","names":["PALETTE_TOKENS","ACCENT_TOKENS","builtinTheme","require_theme","require_builtinThemes","NATIVE_RADII","NATIVE_BORDER_RADIUS","NATIVE_TYPE_RAMP","NATIVE_LETTER_SPACING_EM","NATIVE_LEADING_RELAXED","NATIVE_FONT_WEIGHT","NATIVE_MOTION","NATIVE_FONT_FAMILY","HEX_COLOR","hexChannels","hex","digits","digit","offset","mixHex","weight","percent","a","first","b","second","mixed","channel","index","withAlpha","alpha","rampValues","values","step","pick","nativeTheme","pinned","config","colors","token","resolve","fallback","accent","steps","em","shippedNative","theme","name","NATIVE_THEMES"],"sources":["../../../src/theme/nativeTheme.ts"],"sourcesContent":["import { ACCENT_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme, type ThemeToken } from '../types/theme';\nimport { builtinTheme } from './builtinThemes';\nimport { EDGE_MIX_PERCENT, ON_SELECTED_MIX_PERCENT, TINT_MIX_PERCENT } from './derive';\n\n/*\n * The React Native copy of the web theme. Native styles cannot read CSS\n * custom properties or evaluate color-mix(), so this module resolves the same\n * tokens to plain values. The scales below mirror styles/theme.css by hand\n * (CSS cannot import TypeScript); tests/nativeTheme.test.ts fails when the two\n * drift.\n *\n * ponytail: bundle IBM Plex Sans and JetBrains Mono through expo-font when the\n * native visual review starts; until then the named families fall back to the\n * platform fonts below.\n * ponytail: add a native theme picker later; the shell follows the system\n * scheme between `light` and `dark` for now.\n * ponytail: `--tracking-*` (tracked uppercase micro-labels) is not ported;\n * docs/design.md bans tracked uppercase on new surfaces.\n * ponytail: `shadow-2xl` is not ported; native surfaces (sheets, modals,\n * headers) draw their own platform shadows.\n */\n\n/** The spacing unit, matching `--spacing: 0.25rem` at a 16px root. */\nexport const NATIVE_SPACING_BASE = 4;\n\n/** Corner radii in px, matching `--radius-*`. */\nexport const NATIVE_RADII = { xs: 2, sm: 3, md: 5, lg: 10 } as const;\n\n/**\n * Every radius a native style may name: the retunable `--radius-*` steps, plus\n * Tailwind's hardcoded bare `rounded` (4px) and `rounded-full`.\n */\nexport const NATIVE_BORDER_RADIUS = { ...NATIVE_RADII, DEFAULT: 4, full: 9999 } as const;\n\n/** The type ramp, matching `--text-*` (px) and `--text-*--line-height` (a multiple of the size). */\nexport const NATIVE_TYPE_RAMP = {\n '2xs': { size: 9, leading: 1.45 },\n xs: { size: 10, leading: 1.45 },\n sm: { size: 12, leading: 1.45 },\n base: { size: 13, leading: 1.5 },\n lg: { size: 15, leading: 1.4 },\n xl: { size: 18, leading: 1.3 },\n '2xl': { size: 22, leading: 1.25 },\n '3xl': { size: 28, leading: 1.2 },\n} as const;\n\n/** Title tracking in em, matching `--text-*--letter-spacing`; steps not listed track at 0. */\nexport const NATIVE_LETTER_SPACING_EM = { xl: -0.01, '2xl': -0.01, '3xl': -0.01 } as const;\n\n/** Tailwind's `leading-relaxed` multiple, which theme.css does not override. */\nexport const NATIVE_LEADING_RELAXED = 1.625;\n\n/** Font weights as React Native takes them, matching `font-normal`, `font-medium` and `font-semibold`. */\nexport const NATIVE_FONT_WEIGHT = { regular: '400', medium: '500', semibold: '600' } as const;\n\n/**\n * Durations in ms and the shared easing curve of `--animate-po-*`. `slide`\n * covers both slide directions; `easing` is the `cubic-bezier()` control points\n * for Reanimated's `Easing.bezier`.\n */\nexport const NATIVE_MOTION = {\n fade: 140,\n pop: 160,\n rise: 160,\n slide: 180,\n easing: [0.16, 1, 0.3, 1],\n} as const;\n\n/** A font as native styles name it: one family, plus the platform font to use until it is bundled. */\nexport interface NativeFontStack {\n family: string;\n ios: string;\n android: string;\n}\n\n/** The sans and mono families of `--font-sans` and `--po-font-mono`, with system fallbacks. */\nexport const NATIVE_FONT_FAMILY: { readonly sans: NativeFontStack; readonly mono: NativeFontStack } = {\n sans: { family: 'IBM Plex Sans', ios: 'System', android: 'sans-serif' },\n mono: { family: 'JetBrains Mono', ios: 'Menlo', android: 'monospace' },\n};\n\n/** The foreground `on-selected` mixes toward, as `white` in derive.ts. */\nconst ON_SELECTED_BASE = '#ffffff';\nconst HEX_COLOR = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\nconst PERCENT = 100;\nconst CHANNEL_MAX = 255;\n/** Rounds px values to hundredths so `18 * -0.01` reads -0.18, not a float tail. */\nconst PX_PRECISION = 100;\n\nexport type NativeColorToken = Exclude<ThemeToken, 'font-mono'>;\nexport type NativeTypeStep = keyof typeof NATIVE_TYPE_RAMP;\nexport type NativeNamedTheme = 'dark' | 'light';\n\nexport interface PoNativeTheme {\n scheme: ThemeScheme;\n colors: Record<NativeColorToken, string>;\n /** `spacing(n)` is n steps of the 4px base, as Tailwind's `p-n`. */\n spacing: (steps: number) => number;\n borderRadius: typeof NATIVE_BORDER_RADIUS;\n fontSize: Record<NativeTypeStep, number>;\n /** Absolute line heights in px, since native styles take no unitless multiple. */\n lineHeight: Record<NativeTypeStep, number>;\n /** `leading-relaxed` line heights in px, for reading text such as markdown bodies. */\n lineHeightRelaxed: Record<NativeTypeStep, number>;\n /** Letter spacing in px per step; titles track slightly tight, the rest at 0. */\n letterSpacing: Record<NativeTypeStep, number>;\n fontWeight: typeof NATIVE_FONT_WEIGHT;\n fontFamily: typeof NATIVE_FONT_FAMILY;\n motion: typeof NATIVE_MOTION;\n}\n\nfunction hexChannels(hex: string): [number, number, number] {\n if (!HEX_COLOR.test(hex)) throw new Error(`Native themes need hex colours; got \"${hex}\".`);\n const digits =\n hex.length === 4\n ? hex\n .slice(1)\n .split('')\n .map((digit) => digit + digit)\n .join('')\n : hex.slice(1);\n return [0, 2, 4].map((offset) => Number.parseInt(digits.slice(offset, offset + 2), 16)) as [number, number, number];\n}\n\n/**\n * `color-mix(in srgb, first percent%, second)` for hex inputs: a straight\n * per-channel blend, rounded to the nearest 8-bit value.\n */\nexport function mixHex(first: string, percent: number, second: string): string {\n const weight = percent / PERCENT;\n const a = hexChannels(first);\n const b = hexChannels(second);\n return `#${a\n .map((channel, index) => {\n const mixed = Math.round(channel * weight + b[index]! * (1 - weight));\n return Math.min(CHANNEL_MAX, Math.max(0, mixed)).toString(16).padStart(2, '0');\n })\n .join('')}`;\n}\n\n/**\n * A hex colour at `percent` opacity as `#rrggbbaa`: the native form of\n * Tailwind's `/40`-style opacity modifiers.\n */\nexport function withAlpha(hex: string, percent: number): string {\n const alpha = Math.min(CHANNEL_MAX, Math.max(0, Math.round((percent / PERCENT) * CHANNEL_MAX)));\n const channels = [...hexChannels(hex), alpha];\n return `#${channels.map((channel) => channel.toString(16).padStart(2, '0')).join('')}`;\n}\n\nfunction rampValues(pick: (step: NativeTypeStep) => number): Record<NativeTypeStep, number> {\n const values = {} as Record<NativeTypeStep, number>;\n for (const step of Object.keys(NATIVE_TYPE_RAMP) as NativeTypeStep[]) values[step] = pick(step);\n return values;\n}\n\n/** Resolves a web theme config to native values; tokens the theme pins win over the derived mix. */\nexport function nativeTheme(config: ThemeConfig): PoNativeTheme {\n const pinned = config.tokens as Partial<Record<ThemeToken, string>>;\n const colors = {} as Record<NativeColorToken, string>;\n for (const token of PALETTE_TOKENS) colors[token] = config.tokens[token];\n const resolve = (token: NativeColorToken, fallback: () => string): void => {\n colors[token] = pinned[token] ?? fallback();\n };\n for (const accent of ACCENT_TOKENS) {\n resolve(`tint-${accent}`, () => mixHex(colors[accent], TINT_MIX_PERCENT, colors.panel));\n }\n for (const accent of ACCENT_TOKENS) {\n resolve(`edge-${accent}`, () => mixHex(colors[accent], EDGE_MIX_PERCENT, colors.border));\n }\n resolve('on-selected', () => mixHex(colors.selected, ON_SELECTED_MIX_PERCENT, ON_SELECTED_BASE));\n\n return {\n scheme: config.scheme,\n colors,\n spacing: (steps) => steps * NATIVE_SPACING_BASE,\n borderRadius: NATIVE_BORDER_RADIUS,\n fontSize: rampValues((step) => NATIVE_TYPE_RAMP[step].size),\n lineHeight: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_TYPE_RAMP[step].leading)),\n lineHeightRelaxed: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_LEADING_RELAXED)),\n letterSpacing: rampValues((step) => {\n const em = (NATIVE_LETTER_SPACING_EM as Partial<Record<NativeTypeStep, number>>)[step] ?? 0;\n return Math.round(NATIVE_TYPE_RAMP[step].size * em * PX_PRECISION) / PX_PRECISION;\n }),\n fontWeight: NATIVE_FONT_WEIGHT,\n fontFamily: NATIVE_FONT_FAMILY,\n motion: NATIVE_MOTION,\n };\n}\n\nfunction shippedNative(name: string): PoNativeTheme {\n const theme = builtinTheme(name);\n if (theme === undefined) throw new Error(`The shipped theme ${name} is missing.`);\n return nativeTheme(theme);\n}\n\n/** The native themes by the names the native shell registers: `dark` and `light`. */\nexport const NATIVE_THEMES: Readonly<Record<NativeNamedTheme, PoNativeTheme>> = {\n dark: shippedNative('po-nord-dark'),\n light: shippedNative('po-one-light'),\n};\n"],"mappings":"+FAuBA,MAGaK,EAAe,CAAE,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,EAM7CC,EAAuB,CAAE,GAAGD,EAAc,QAAS,EAAG,KAAM,IAAK,EAGjEE,EAAmB,CAC9B,MAAO,CAAE,KAAM,EAAG,QAAS,IAAK,EAChC,GAAI,CAAE,KAAM,GAAI,QAAS,IAAK,EAC9B,GAAI,CAAE,KAAM,GAAI,QAAS,IAAK,EAC9B,KAAM,CAAE,KAAM,GAAI,QAAS,GAAI,EAC/B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I,EAC1D,WAAYF,EAAY,GAAS,KAAK,MAAMxB,EAAiB0B,EAAK,CAAC,KAAO1B,EAAiB0B,EAAK,CAAC,OAAO,CAAC,EACzG,kBAAmBF,EAAY,GAAS,KAAK,MAAMxB,EAAiB0B,EAAK,CAAC,KAAOxB,CAAsB,CAAC,EACxG,cAAesB,EAAY,GAAS,CAClC,IAAMa,EAAMpC,EAAqEyB,IAAS,EAC1F,OAAO,KAAK,MAAM1B,EAAiB0B,EAAK,CAAC,KAAOW,EAAK,GAAY,EAAI,GACvE,CAAC,EACD,WAAYlC,EACZ,WAAYE,EACZ,OAAQD,CACV,CACF,CAEA,SAASkC,EAAc,EAA6B,CAClD,IAAMC,EAAQ5C,EAAAA,aAAa6C,CAAI,EAC/B,GAAID,IAAU,IAAA,GAAW,MAAU,MAAM,qBAAqBC,EAAK,aAAa,EAChF,OAAOZ,EAAYW,CAAK,CAC1B,CAGA,MAAaE,EAAmE,CAC9E,KAAMH,EAAc,cAAc,EAClC,MAAOA,EAAc,cAAc,CACrC"}
1
+ {"version":3,"file":"nativeTheme.cjs","names":["PALETTE_TOKENS","ACCENT_TOKENS","builtinTheme","require_theme","require_builtinThemes","NATIVE_RADII","NATIVE_BORDER_RADIUS","NATIVE_TYPE_RAMP","NATIVE_LETTER_SPACING_EM","NATIVE_LEADING_RELAXED","NATIVE_FONT_WEIGHT","NATIVE_MOTION","NATIVE_FONT_FAMILY","HEX_COLOR","hexChannels","hex","digits","digit","offset","mixHex","weight","percent","a","first","b","second","mixed","channel","index","withAlpha","alpha","rampValues","values","step","pick","nativeTheme","pinned","config","colors","token","resolve","fallback","accent","steps","em","shippedNative","theme","name","NATIVE_THEMES"],"sources":["../../../src/theme/nativeTheme.ts"],"sourcesContent":["import { ACCENT_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme, type ThemeToken } from '../types/theme';\nimport { builtinTheme } from './builtinThemes';\nimport { EDGE_MIX_PERCENT, ON_SELECTED_MIX_PERCENT, TINT_MIX_PERCENT } from './derive';\n\n/*\n * The React Native copy of the web theme. Native styles cannot read CSS\n * custom properties or evaluate color-mix(), so this module resolves the same\n * tokens to plain values. The scales below mirror styles/theme.css by hand\n * (CSS cannot import TypeScript); tests/nativeTheme.test.ts fails when the two\n * drift.\n *\n * ponytail: bundle IBM Plex Sans and JetBrains Mono through expo-font when the\n * native visual review starts; until then the named families fall back to the\n * platform fonts below.\n * ponytail: add a native theme picker later; the shell follows the system\n * scheme between `light` and `dark` for now.\n * ponytail: `--tracking-*` (tracked uppercase micro-labels) is not ported;\n * docs/architecture.md#type bans tracked uppercase on new surfaces.\n * ponytail: `shadow-2xl` is not ported; native surfaces (sheets, modals,\n * headers) draw their own platform shadows.\n */\n\n/** The spacing unit, matching `--spacing: 0.25rem` at a 16px root. */\nexport const NATIVE_SPACING_BASE = 4;\n\n/** Corner radii in px, matching `--radius-*`. */\nexport const NATIVE_RADII = { xs: 2, sm: 3, md: 5, lg: 10 } as const;\n\n/**\n * Every radius a native style may name: the retunable `--radius-*` steps, plus\n * Tailwind's hardcoded bare `rounded` (4px) and `rounded-full`.\n */\nexport const NATIVE_BORDER_RADIUS = { ...NATIVE_RADII, DEFAULT: 4, full: 9999 } as const;\n\n/** The type ramp, matching `--text-*` (px) and `--text-*--line-height` (a multiple of the size). */\nexport const NATIVE_TYPE_RAMP = {\n '2xs': { size: 9, leading: 1.45 },\n xs: { size: 10, leading: 1.45 },\n sm: { size: 12, leading: 1.45 },\n base: { size: 13, leading: 1.5 },\n lg: { size: 15, leading: 1.4 },\n xl: { size: 18, leading: 1.3 },\n '2xl': { size: 22, leading: 1.25 },\n '3xl': { size: 28, leading: 1.2 },\n} as const;\n\n/** Title tracking in em, matching `--text-*--letter-spacing`; steps not listed track at 0. */\nexport const NATIVE_LETTER_SPACING_EM = { xl: -0.01, '2xl': -0.01, '3xl': -0.01 } as const;\n\n/** Tailwind's `leading-relaxed` multiple, which theme.css does not override. */\nexport const NATIVE_LEADING_RELAXED = 1.625;\n\n/** Font weights as React Native takes them, matching `font-normal`, `font-medium` and `font-semibold`. */\nexport const NATIVE_FONT_WEIGHT = { regular: '400', medium: '500', semibold: '600' } as const;\n\n/**\n * Durations in ms and the shared easing curve of `--animate-po-*`. `slide`\n * covers both slide directions; `easing` is the `cubic-bezier()` control points\n * for Reanimated's `Easing.bezier`.\n */\nexport const NATIVE_MOTION = {\n fade: 140,\n pop: 160,\n rise: 160,\n slide: 180,\n easing: [0.16, 1, 0.3, 1],\n} as const;\n\n/** A font as native styles name it: one family, plus the platform font to use until it is bundled. */\nexport interface NativeFontStack {\n family: string;\n ios: string;\n android: string;\n}\n\n/** The sans and mono families of `--font-sans` and `--po-font-mono`, with system fallbacks. */\nexport const NATIVE_FONT_FAMILY: { readonly sans: NativeFontStack; readonly mono: NativeFontStack } = {\n sans: { family: 'IBM Plex Sans', ios: 'System', android: 'sans-serif' },\n mono: { family: 'JetBrains Mono', ios: 'Menlo', android: 'monospace' },\n};\n\n/** The foreground `on-selected` mixes toward, as `white` in derive.ts. */\nconst ON_SELECTED_BASE = '#ffffff';\nconst HEX_COLOR = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\nconst PERCENT = 100;\nconst CHANNEL_MAX = 255;\n/** Rounds px values to hundredths so `18 * -0.01` reads -0.18, not a float tail. */\nconst PX_PRECISION = 100;\n\nexport type NativeColorToken = Exclude<ThemeToken, 'font-mono'>;\nexport type NativeTypeStep = keyof typeof NATIVE_TYPE_RAMP;\nexport type NativeNamedTheme = 'dark' | 'light';\n\nexport interface PoNativeTheme {\n scheme: ThemeScheme;\n colors: Record<NativeColorToken, string>;\n /** `spacing(n)` is n steps of the 4px base, as Tailwind's `p-n`. */\n spacing: (steps: number) => number;\n borderRadius: typeof NATIVE_BORDER_RADIUS;\n fontSize: Record<NativeTypeStep, number>;\n /** Absolute line heights in px, since native styles take no unitless multiple. */\n lineHeight: Record<NativeTypeStep, number>;\n /** `leading-relaxed` line heights in px, for reading text such as markdown bodies. */\n lineHeightRelaxed: Record<NativeTypeStep, number>;\n /** Letter spacing in px per step; titles track slightly tight, the rest at 0. */\n letterSpacing: Record<NativeTypeStep, number>;\n fontWeight: typeof NATIVE_FONT_WEIGHT;\n fontFamily: typeof NATIVE_FONT_FAMILY;\n motion: typeof NATIVE_MOTION;\n}\n\nfunction hexChannels(hex: string): [number, number, number] {\n if (!HEX_COLOR.test(hex)) throw new Error(`Native themes need hex colours; got \"${hex}\".`);\n const digits =\n hex.length === 4\n ? hex\n .slice(1)\n .split('')\n .map((digit) => digit + digit)\n .join('')\n : hex.slice(1);\n return [0, 2, 4].map((offset) => Number.parseInt(digits.slice(offset, offset + 2), 16)) as [number, number, number];\n}\n\n/**\n * `color-mix(in srgb, first percent%, second)` for hex inputs: a straight\n * per-channel blend, rounded to the nearest 8-bit value.\n */\nexport function mixHex(first: string, percent: number, second: string): string {\n const weight = percent / PERCENT;\n const a = hexChannels(first);\n const b = hexChannels(second);\n return `#${a\n .map((channel, index) => {\n const mixed = Math.round(channel * weight + b[index]! * (1 - weight));\n return Math.min(CHANNEL_MAX, Math.max(0, mixed)).toString(16).padStart(2, '0');\n })\n .join('')}`;\n}\n\n/**\n * A hex colour at `percent` opacity as `#rrggbbaa`: the native form of\n * Tailwind's `/40`-style opacity modifiers.\n */\nexport function withAlpha(hex: string, percent: number): string {\n const alpha = Math.min(CHANNEL_MAX, Math.max(0, Math.round((percent / PERCENT) * CHANNEL_MAX)));\n const channels = [...hexChannels(hex), alpha];\n return `#${channels.map((channel) => channel.toString(16).padStart(2, '0')).join('')}`;\n}\n\nfunction rampValues(pick: (step: NativeTypeStep) => number): Record<NativeTypeStep, number> {\n const values = {} as Record<NativeTypeStep, number>;\n for (const step of Object.keys(NATIVE_TYPE_RAMP) as NativeTypeStep[]) values[step] = pick(step);\n return values;\n}\n\n/** Resolves a web theme config to native values; tokens the theme pins win over the derived mix. */\nexport function nativeTheme(config: ThemeConfig): PoNativeTheme {\n const pinned = config.tokens as Partial<Record<ThemeToken, string>>;\n const colors = {} as Record<NativeColorToken, string>;\n for (const token of PALETTE_TOKENS) colors[token] = config.tokens[token];\n const resolve = (token: NativeColorToken, fallback: () => string): void => {\n colors[token] = pinned[token] ?? fallback();\n };\n for (const accent of ACCENT_TOKENS) {\n resolve(`tint-${accent}`, () => mixHex(colors[accent], TINT_MIX_PERCENT, colors.panel));\n }\n for (const accent of ACCENT_TOKENS) {\n resolve(`edge-${accent}`, () => mixHex(colors[accent], EDGE_MIX_PERCENT, colors.border));\n }\n resolve('on-selected', () => mixHex(colors.selected, ON_SELECTED_MIX_PERCENT, ON_SELECTED_BASE));\n\n return {\n scheme: config.scheme,\n colors,\n spacing: (steps) => steps * NATIVE_SPACING_BASE,\n borderRadius: NATIVE_BORDER_RADIUS,\n fontSize: rampValues((step) => NATIVE_TYPE_RAMP[step].size),\n lineHeight: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_TYPE_RAMP[step].leading)),\n lineHeightRelaxed: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_LEADING_RELAXED)),\n letterSpacing: rampValues((step) => {\n const em = (NATIVE_LETTER_SPACING_EM as Partial<Record<NativeTypeStep, number>>)[step] ?? 0;\n return Math.round(NATIVE_TYPE_RAMP[step].size * em * PX_PRECISION) / PX_PRECISION;\n }),\n fontWeight: NATIVE_FONT_WEIGHT,\n fontFamily: NATIVE_FONT_FAMILY,\n motion: NATIVE_MOTION,\n };\n}\n\nfunction shippedNative(name: string): PoNativeTheme {\n const theme = builtinTheme(name);\n if (theme === undefined) throw new Error(`The shipped theme ${name} is missing.`);\n return nativeTheme(theme);\n}\n\n/** The native themes by the names the native shell registers: `dark` and `light`. */\nexport const NATIVE_THEMES: Readonly<Record<NativeNamedTheme, PoNativeTheme>> = {\n dark: shippedNative('po-nord-dark'),\n light: shippedNative('po-one-light'),\n};\n"],"mappings":"A,+FAuBA,MAGaK,EAAe,CAAE,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,E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WACnB;aAAS;aAAU;;;;qBAIR;WAA6B;WAAW;WAAc;;;qBAGtD;;qBAGA;WAAuB;WAAgB;WAAe;;;;;;;qBAOtD;WACX;WACA;WACA;WACA;WACA;;;iBAIe;EACf;EACA;EACA;;;qBAIW;WAA+B,MAAM;WAA0B,MAAM;;YAatE,mBAAmB,QAAQ;YAC3B,8BAA8B;YAC9B;iBAEK;EACf,QAAQ;EACR,QAAQ,OAAO;;EAEf,UAAU;EACV,qBAAqB;EACrB,UAAU,OAAO;;EAEjB,YAAY,OAAO;;EAEnB,mBAAmB,OAAO;;EAE1B,eAAe,OAAO;EACtB,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;;;;;;wBAoBD,OAAO,eAAe,iBAAiB;;;;;wBAgBvC,UAAU,aAAa;;wBAavB,YAAY,QAAQ,cAAc;;qBAwCrC,eAAe,SAAS,OAAO,kBAAkB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeTheme.mjs","names":["NATIVE_SPACING_BASE","NATIVE_RADII","NATIVE_BORDER_RADIUS","NATIVE_TYPE_RAMP","NATIVE_LETTER_SPACING_EM","NATIVE_LEADING_RELAXED","NATIVE_FONT_WEIGHT","NATIVE_MOTION","NATIVE_FONT_FAMILY","HEX_COLOR","hexChannels","hex","digits","digit","offset","mixHex","weight","percent","a","first","b","second","mixed","channel","index","withAlpha","alpha","rampValues","values","step","pick","nativeTheme","pinned","config","colors","token","PALETTE_TOKENS","resolve","fallback","accent","ACCENT_TOKENS","steps","em","shippedNative","theme","builtinTheme","name","NATIVE_THEMES"],"sources":["../../../src/theme/nativeTheme.ts"],"sourcesContent":["import { ACCENT_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme, type ThemeToken } from '../types/theme';\nimport { builtinTheme } from './builtinThemes';\nimport { EDGE_MIX_PERCENT, ON_SELECTED_MIX_PERCENT, TINT_MIX_PERCENT } from './derive';\n\n/*\n * The React Native copy of the web theme. Native styles cannot read CSS\n * custom properties or evaluate color-mix(), so this module resolves the same\n * tokens to plain values. The scales below mirror styles/theme.css by hand\n * (CSS cannot import TypeScript); tests/nativeTheme.test.ts fails when the two\n * drift.\n *\n * ponytail: bundle IBM Plex Sans and JetBrains Mono through expo-font when the\n * native visual review starts; until then the named families fall back to the\n * platform fonts below.\n * ponytail: add a native theme picker later; the shell follows the system\n * scheme between `light` and `dark` for now.\n * ponytail: `--tracking-*` (tracked uppercase micro-labels) is not ported;\n * docs/architecture.md#type bans tracked uppercase on new surfaces.\n * ponytail: `shadow-2xl` is not ported; native surfaces (sheets, modals,\n * headers) draw their own platform shadows.\n */\n\n/** The spacing unit, matching `--spacing: 0.25rem` at a 16px root. */\nexport const NATIVE_SPACING_BASE = 4;\n\n/** Corner radii in px, matching `--radius-*`. */\nexport const NATIVE_RADII = { xs: 2, sm: 3, md: 5, lg: 10 } as const;\n\n/**\n * Every radius a native style may name: the retunable `--radius-*` steps, plus\n * Tailwind's hardcoded bare `rounded` (4px) and `rounded-full`.\n */\nexport const NATIVE_BORDER_RADIUS = { ...NATIVE_RADII, DEFAULT: 4, full: 9999 } as const;\n\n/** The type ramp, matching `--text-*` (px) and `--text-*--line-height` (a multiple of the size). */\nexport const NATIVE_TYPE_RAMP = {\n '2xs': { size: 9, leading: 1.45 },\n xs: { size: 10, leading: 1.45 },\n sm: { size: 12, leading: 1.45 },\n base: { size: 13, leading: 1.5 },\n lg: { size: 15, leading: 1.4 },\n xl: { size: 18, leading: 1.3 },\n '2xl': { size: 22, leading: 1.25 },\n '3xl': { size: 28, leading: 1.2 },\n} as const;\n\n/** Title tracking in em, matching `--text-*--letter-spacing`; steps not listed track at 0. */\nexport const NATIVE_LETTER_SPACING_EM = { xl: -0.01, '2xl': -0.01, '3xl': -0.01 } as const;\n\n/** Tailwind's `leading-relaxed` multiple, which theme.css does not override. */\nexport const NATIVE_LEADING_RELAXED = 1.625;\n\n/** Font weights as React Native takes them, matching `font-normal`, `font-medium` and `font-semibold`. */\nexport const NATIVE_FONT_WEIGHT = { regular: '400', medium: '500', semibold: '600' } as const;\n\n/**\n * Durations in ms and the shared easing curve of `--animate-po-*`. `slide`\n * covers both slide directions; `easing` is the `cubic-bezier()` control points\n * for Reanimated's `Easing.bezier`.\n */\nexport const NATIVE_MOTION = {\n fade: 140,\n pop: 160,\n rise: 160,\n slide: 180,\n easing: [0.16, 1, 0.3, 1],\n} as const;\n\n/** A font as native styles name it: one family, plus the platform font to use until it is bundled. */\nexport interface NativeFontStack {\n family: string;\n ios: string;\n android: string;\n}\n\n/** The sans and mono families of `--font-sans` and `--po-font-mono`, with system fallbacks. */\nexport const NATIVE_FONT_FAMILY: { readonly sans: NativeFontStack; readonly mono: NativeFontStack } = {\n sans: { family: 'IBM Plex Sans', ios: 'System', android: 'sans-serif' },\n mono: { family: 'JetBrains Mono', ios: 'Menlo', android: 'monospace' },\n};\n\n/** The foreground `on-selected` mixes toward, as `white` in derive.ts. */\nconst ON_SELECTED_BASE = '#ffffff';\nconst HEX_COLOR = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\nconst PERCENT = 100;\nconst CHANNEL_MAX = 255;\n/** Rounds px values to hundredths so `18 * -0.01` reads -0.18, not a float tail. */\nconst PX_PRECISION = 100;\n\nexport type NativeColorToken = Exclude<ThemeToken, 'font-mono'>;\nexport type NativeTypeStep = keyof typeof NATIVE_TYPE_RAMP;\nexport type NativeNamedTheme = 'dark' | 'light';\n\nexport interface PoNativeTheme {\n scheme: ThemeScheme;\n colors: Record<NativeColorToken, string>;\n /** `spacing(n)` is n steps of the 4px base, as Tailwind's `p-n`. */\n spacing: (steps: number) => number;\n borderRadius: typeof NATIVE_BORDER_RADIUS;\n fontSize: Record<NativeTypeStep, number>;\n /** Absolute line heights in px, since native styles take no unitless multiple. */\n lineHeight: Record<NativeTypeStep, number>;\n /** `leading-relaxed` line heights in px, for reading text such as markdown bodies. */\n lineHeightRelaxed: Record<NativeTypeStep, number>;\n /** Letter spacing in px per step; titles track slightly tight, the rest at 0. */\n letterSpacing: Record<NativeTypeStep, number>;\n fontWeight: typeof NATIVE_FONT_WEIGHT;\n fontFamily: typeof NATIVE_FONT_FAMILY;\n motion: typeof NATIVE_MOTION;\n}\n\nfunction hexChannels(hex: string): [number, number, number] {\n if (!HEX_COLOR.test(hex)) throw new Error(`Native themes need hex colours; got \"${hex}\".`);\n const digits =\n hex.length === 4\n ? hex\n .slice(1)\n .split('')\n .map((digit) => digit + digit)\n .join('')\n : hex.slice(1);\n return [0, 2, 4].map((offset) => Number.parseInt(digits.slice(offset, offset + 2), 16)) as [number, number, number];\n}\n\n/**\n * `color-mix(in srgb, first percent%, second)` for hex inputs: a straight\n * per-channel blend, rounded to the nearest 8-bit value.\n */\nexport function mixHex(first: string, percent: number, second: string): string {\n const weight = percent / PERCENT;\n const a = hexChannels(first);\n const b = hexChannels(second);\n return `#${a\n .map((channel, index) => {\n const mixed = Math.round(channel * weight + b[index]! * (1 - weight));\n return Math.min(CHANNEL_MAX, Math.max(0, mixed)).toString(16).padStart(2, '0');\n })\n .join('')}`;\n}\n\n/**\n * A hex colour at `percent` opacity as `#rrggbbaa`: the native form of\n * Tailwind's `/40`-style opacity modifiers.\n */\nexport function withAlpha(hex: string, percent: number): string {\n const alpha = Math.min(CHANNEL_MAX, Math.max(0, Math.round((percent / PERCENT) * CHANNEL_MAX)));\n const channels = [...hexChannels(hex), alpha];\n return `#${channels.map((channel) => channel.toString(16).padStart(2, '0')).join('')}`;\n}\n\nfunction rampValues(pick: (step: NativeTypeStep) => number): Record<NativeTypeStep, number> {\n const values = {} as Record<NativeTypeStep, number>;\n for (const step of Object.keys(NATIVE_TYPE_RAMP) as NativeTypeStep[]) values[step] = pick(step);\n return values;\n}\n\n/** Resolves a web theme config to native values; tokens the theme pins win over the derived mix. */\nexport function nativeTheme(config: ThemeConfig): PoNativeTheme {\n const pinned = config.tokens as Partial<Record<ThemeToken, string>>;\n const colors = {} as Record<NativeColorToken, string>;\n for (const token of PALETTE_TOKENS) colors[token] = config.tokens[token];\n const resolve = (token: NativeColorToken, fallback: () => string): void => {\n colors[token] = pinned[token] ?? fallback();\n };\n for (const accent of ACCENT_TOKENS) {\n resolve(`tint-${accent}`, () => mixHex(colors[accent], TINT_MIX_PERCENT, colors.panel));\n }\n for (const accent of ACCENT_TOKENS) {\n resolve(`edge-${accent}`, () => mixHex(colors[accent], EDGE_MIX_PERCENT, colors.border));\n }\n resolve('on-selected', () => mixHex(colors.selected, ON_SELECTED_MIX_PERCENT, ON_SELECTED_BASE));\n\n return {\n scheme: config.scheme,\n colors,\n spacing: (steps) => steps * NATIVE_SPACING_BASE,\n borderRadius: NATIVE_BORDER_RADIUS,\n fontSize: rampValues((step) => NATIVE_TYPE_RAMP[step].size),\n lineHeight: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_TYPE_RAMP[step].leading)),\n lineHeightRelaxed: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_LEADING_RELAXED)),\n letterSpacing: rampValues((step) => {\n const em = (NATIVE_LETTER_SPACING_EM as Partial<Record<NativeTypeStep, number>>)[step] ?? 0;\n return Math.round(NATIVE_TYPE_RAMP[step].size * em * PX_PRECISION) / PX_PRECISION;\n }),\n fontWeight: NATIVE_FONT_WEIGHT,\n fontFamily: NATIVE_FONT_FAMILY,\n motion: NATIVE_MOTION,\n };\n}\n\nfunction shippedNative(name: string): PoNativeTheme {\n const theme = builtinTheme(name);\n if (theme === undefined) throw new Error(`The shipped theme ${name} is missing.`);\n return nativeTheme(theme);\n}\n\n/** The native themes by the names the native shell registers: `dark` and `light`. */\nexport const NATIVE_THEMES: Readonly<Record<NativeNamedTheme, PoNativeTheme>> = {\n dark: shippedNative('po-nord-dark'),\n light: shippedNative('po-one-light'),\n};\n"],"mappings":"A,+IAuBA,MAAaA,EAAsB,EAGtBC,EAAe,CAAE,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,EAM7CC,EAAuB,CAAE,GAAGD,EAAc,QAAS,EAAG,KAAM,IA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BtB,EAAOmB,EAAO,SAAA,GAAmC,SAAgB,CAAC,EAExF,CACL,OAAQD,EAAO,OACf,SACA,QAAU,GAAUQ,EAAA,EACpB,aAAcvC,EACd,SAAUyB,EAAY,GAASxB,EAAiB0B,EAAK,CAAC,IAAI,EAC1D,WAAYF,EAAY,GAAS,KAAK,MAAMxB,EAAiB0B,EAAK,CAAC,KAAO1B,EAAiB0B,EAAK,CAAC,OAAO,CAAC,EACzG,kBAAmBF,EAAY,GAAS,KAAK,MAAMxB,EAAiB0B,EAAK,CAAC,KAAOxB,CAAsB,CAAC,EACxG,cAAesB,EAAY,GAAS,CAClC,IAAMe,EAAMtC,EAAqEyB,IAAS,EAC1F,OAAO,KAAK,MAAM1B,EAAiB0B,EAAK,CAAC,KAAOa,EAAK,GAAY,EAAI,GACvE,CAAC,EACD,WAAYpC,EACZ,WAAYE,EACZ,OAAQD,CACV,CACF,CAEA,SAASoC,EAAc,EAA6B,CAClD,IAAMC,EAAQC,EAAaC,CAAI,EAC/B,GAAIF,IAAU,IAAA,GAAW,MAAU,MAAM,qBAAqBE,EAAK,aAAa,EAChF,OAAOf,EAAYa,CAAK,CAC1B,CAGA,MAAaG,EAAmE,CAC9E,KAAMJ,EAAc,cAAc,EAClC,MAAOA,EAAc,cAAc,CACrC,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"parse.cjs","names":["PALETTE_TOKENS","DERIVED_TOKENS","require_theme","THEME_NAME","CSS_COLOR","isRecord","value","parseThemeConfig","input","name","label","scheme","tokens","accepted","token"],"sources":["../../../src/theme/parse.ts"],"sourcesContent":["import { DERIVED_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme } from '../types/theme';\n\nconst THEME_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\n/** A CSS colour as a theme may spell it: hex, a colour function, or a named colour; never a url or an image. */\nconst CSS_COLOR =\n /^(?:#[0-9a-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\\((?:[^()]|\\([^()]*\\))*\\)|[a-z]+)$/i;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Validates a theme config read from JSON. Returns null rather than throwing\n * because a bad theme file must never take the cockpit down; the caller falls\n * back to the shipped default and says so.\n */\nexport function parseThemeConfig(input: unknown): ThemeConfig | null {\n if (!isRecord(input)) return null;\n const { name, label, scheme, tokens } = input;\n if (typeof name !== 'string' || !THEME_NAME.test(name)) return null;\n if (typeof label !== 'string' || label.trim() === '') return null;\n if (scheme !== 'dark' && scheme !== 'light') return null;\n if (!isRecord(tokens)) return null;\n\n const accepted: Record<string, string> = {};\n for (const token of PALETTE_TOKENS) {\n const value = tokens[token];\n if (typeof value !== 'string' || !CSS_COLOR.test(value.trim())) return null;\n accepted[token] = value.trim();\n }\n for (const token of DERIVED_TOKENS) {\n const value = tokens[token];\n if (value === undefined) continue;\n if (typeof value !== 'string' || value.trim() === '') return null;\n accepted[token] = value.trim();\n }\n return { name, label, scheme: scheme as ThemeScheme, tokens: accepted as ThemeConfig['tokens'] };\n}\n"],"mappings":"sCAEMG,EAAa,6BAEbC,EACJ,iIAEF,SAASC,EAAS,EAAkD,CAClE,OAAO,OAAOC,GAAU,YAAYA,GAAkB,CAAC,MAAM,QAAQA,CAAK,CAC5E,CAOA,SAAgBC,EAAiB,EAAoC,CACnE,GAAI,CAACF,EAASG,CAAK,EAAG,OAAO,KAC7B,GAAM,CAAE,OAAM,QAAO,SAAQ,UAAWA,EAIxC,GAHI,OAAOC,GAAS,UAAY,CAACN,EAAW,KAAKM,CAAI,GACjD,OAAOC,GAAU,UAAYA,EAAM,KAAK,IAAM,IAC9CC,IAAW,QAAUA,IAAW,SAChC,CAACN,EAASO,CAAM,EAAG,OAAO,KAE9B,IAAMC,EAAmC,CAAC,EAC1C,IAAK,IAAMC,KAASd,EAAAA,eAAgB,CAClC,IAAMM,EAAQM,EAAOE,GACrB,GAAI,OAAOR,GAAU,UAAY,CAACF,EAAU,KAAKE,EAAM,KAAK,CAAC,EAAG,OAAO,KACvE,EAASQ,GAASR,EAAM,KAAK,CAC/B,CACA,IAAK,IAAMQ,KAASb,EAAAA,eAAgB,CAClC,IAAMK,EAAQM,EAAOE,GACrB,GAAIR,IAAU,IAAA,GACd,IAAI,OAAOA,GAAU,UAAYA,EAAM,KAAK,IAAM,GAAI,OAAO,KAC7D,EAASQ,GAASR,EAAM,KAAK,CADgC,CAE/D,CACA,MAAO,CAAE,OAAM,QAAe,SAAuB,OAAQO,CAAkC,CACjG"}
1
+ {"version":3,"file":"parse.cjs","names":["PALETTE_TOKENS","DERIVED_TOKENS","require_theme","THEME_NAME","CSS_COLOR","isRecord","value","parseThemeConfig","input","name","label","scheme","tokens","accepted","token"],"sources":["../../../src/theme/parse.ts"],"sourcesContent":["import { DERIVED_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme } from '../types/theme';\n\nconst THEME_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\n/** A CSS colour as a theme may spell it: hex, a colour function, or a named colour; never a url or an image. */\nconst CSS_COLOR =\n /^(?:#[0-9a-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\\((?:[^()]|\\([^()]*\\))*\\)|[a-z]+)$/i;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Validates a theme config read from JSON. Returns null rather than throwing\n * because a bad theme file must never take the cockpit down; the caller falls\n * back to the shipped default and says so.\n */\nexport function parseThemeConfig(input: unknown): ThemeConfig | null {\n if (!isRecord(input)) return null;\n const { name, label, scheme, tokens } = input;\n if (typeof name !== 'string' || !THEME_NAME.test(name)) return null;\n if (typeof label !== 'string' || label.trim() === '') return null;\n if (scheme !== 'dark' && scheme !== 'light') return null;\n if (!isRecord(tokens)) return null;\n\n const accepted: Record<string, string> = {};\n for (const token of PALETTE_TOKENS) {\n const value = tokens[token];\n if (typeof value !== 'string' || !CSS_COLOR.test(value.trim())) return null;\n accepted[token] = value.trim();\n }\n for (const token of DERIVED_TOKENS) {\n const value = tokens[token];\n if (value === undefined) continue;\n if (typeof value !== 'string' || value.trim() === '') return null;\n accepted[token] = value.trim();\n }\n return { name, label, scheme: scheme as ThemeScheme, tokens: accepted as ThemeConfig['tokens'] };\n}\n"],"mappings":"A,sCAEMG,EAAa,6BAEbC,EACJ,iIAEF,SAASC,EAAS,EAAkD,CAClE,OAAO,OAAOC,GAAU,YAAYA,GAAkB,CAAC,MAAM,QAAQA,CAAK,CAC5E,CAOA,SAAgBC,EAAiB,EAAoC,CACnE,GAAI,CAACF,EAASG,CAAK,EAAG,OAAO,KAC7B,GAAM,CAAE,OAAM,QAAO,SAAQ,UAAWA,EAIxC,GAHI,OAAOC,GAAS,UAAY,CAACN,EAAW,KAAKM,CAAI,GACjD,OAAOC,GAAU,UAAYA,EAAM,KAAK,IAAM,IAC9CC,IAAW,QAAUA,IAAW,SAChC,CAACN,EAASO,CAAM,EAAG,OAAO,KAE9B,IAAMC,EAAmC,CAAC,EAC1C,IAAK,IAAMC,KAASd,EAAAA,eAAgB,CAClC,IAAMM,EAAQM,EAAOE,GACrB,GAAI,OAAOR,GAAU,UAAY,CAACF,EAAU,KAAKE,EAAM,KAAK,CAAC,EAAG,OAAO,KACvE,EAASQ,GAASR,EAAM,KAAK,CAC/B,CACA,IAAK,IAAMQ,KAASb,EAAAA,eAAgB,CAClC,IAAMK,EAAQM,EAAOE,GACrB,GAAIR,IAAU,IAAA,GACd,IAAI,OAAOA,GAAU,UAAYA,EAAM,KAAK,IAAM,GAAI,OAAO,KAC7D,EAASQ,GAASR,EAAM,KAAK,CADgC,CAE/D,CACA,MAAO,CAAE,OAAM,QAAe,SAAuB,OAAQO,CAAkC,CACjG,C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.mts","names":[],"sources":["../../../src/theme/parse.ts"],"mappings":";;;;;;;wBAgBgB,iBAAiB,iBAAiB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.mjs","names":["THEME_NAME","CSS_COLOR","isRecord","value","parseThemeConfig","input","name","label","scheme","tokens","accepted","token","PALETTE_TOKENS","DERIVED_TOKENS"],"sources":["../../../src/theme/parse.ts"],"sourcesContent":["import { DERIVED_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme } from '../types/theme';\n\nconst THEME_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\n/** A CSS colour as a theme may spell it: hex, a colour function, or a named colour; never a url or an image. */\nconst CSS_COLOR =\n /^(?:#[0-9a-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\\((?:[^()]|\\([^()]*\\))*\\)|[a-z]+)$/i;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Validates a theme config read from JSON. Returns null rather than throwing\n * because a bad theme file must never take the cockpit down; the caller falls\n * back to the shipped default and says so.\n */\nexport function parseThemeConfig(input: unknown): ThemeConfig | null {\n if (!isRecord(input)) return null;\n const { name, label, scheme, tokens } = input;\n if (typeof name !== 'string' || !THEME_NAME.test(name)) return null;\n if (typeof label !== 'string' || label.trim() === '') return null;\n if (scheme !== 'dark' && scheme !== 'light') return null;\n if (!isRecord(tokens)) return null;\n\n const accepted: Record<string, string> = {};\n for (const token of PALETTE_TOKENS) {\n const value = tokens[token];\n if (typeof value !== 'string' || !CSS_COLOR.test(value.trim())) return null;\n accepted[token] = value.trim();\n }\n for (const token of DERIVED_TOKENS) {\n const value = tokens[token];\n if (value === undefined) continue;\n if (typeof value !== 'string' || value.trim() === '') return null;\n accepted[token] = value.trim();\n }\n return { name, label, scheme: scheme as ThemeScheme, tokens: accepted as ThemeConfig['tokens'] };\n}\n"],"mappings":"A,wEAEA,MAAMA,EAAa,6BAEbC,EACJ,iIAEF,SAASC,EAAS,EAAkD,CAClE,OAAO,OAAOC,GAAU,YAAYA,GAAkB,CAAC,MAAM,QAAQA,CAAK,CAC5E,CAOA,SAAgBC,EAAiB,EAAoC,CACnE,GAAI,CAACF,EAASG,CAAK,EAAG,OAAO,KAC7B,GAAM,CAAE,OAAM,QAAO,SAAQ,UAAWA,EAIxC,GAHI,OAAOC,GAAS,UAAY,CAACN,EAAW,KAAKM,CAAI,GACjD,OAAOC,GAAU,UAAYA,EAAM,KAAK,IAAM,IAC9CC,IAAW,QAAUA,IAAW,SAChC,CAACN,EAASO,CAAM,EAAG,OAAO,KAE9B,IAAMC,EAAmC,CAAC,EAC1C,IAAK,IAAMC,KAASC,EAAgB,CAClC,IAAMT,EAAQM,EAAOE,GACrB,GAAI,OAAOR,GAAU,UAAY,CAACF,EAAU,KAAKE,EAAM,KAAK,CAAC,EAAG,OAAO,KACvE,EAASQ,GAASR,EAAM,KAAK,CAC/B,CACA,IAAK,IAAMQ,KAASE,EAAgB,CAClC,IAAMV,EAAQM,EAAOE,GACrB,GAAIR,IAAU,IAAA,GACd,IAAI,OAAOA,GAAU,UAAYA,EAAM,KAAK,IAAM,GAAI,OAAO,KAC7D,EAASQ,GAASR,EAAM,KAAK,CADgC,CAE/D,CACA,MAAO,CAAE,OAAM,QAAe,SAAuB,OAAQO,CAAkC,CACjG,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"piTheme.cjs","names":["parseThemeConfig","require_parse","isRecord","value","hexLuminance","match","hex","g","b","resolve","reference","vars","themeFromPiTheme","input","palette","key","semantic","colors","bg","bgAlt","fg","luminance","scheme","options","deep","border","themeName","name"],"sources":["../../../src/theme/piTheme.ts"],"sourcesContent":["import type { ThemeConfig, ThemeScheme } from '../types/theme';\nimport { parseThemeConfig } from './parse';\n\n/**\n * The Pi TUI theme shape (theme-schema.json): a palette of named vars and\n * semantic colours that name a var or spell a colour.\n */\ninterface PiThemeLike {\n name?: unknown;\n vars?: unknown;\n colors?: unknown;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction hexLuminance(hex: string): number | null {\n const match = /^#([0-9a-f]{6})$/i.exec(hex.trim());\n if (!match) return null;\n const value = Number.parseInt(match[1], 16);\n const r = (value >> 16) & 0xff;\n const g = (value >> 8) & 0xff;\n const b = value & 0xff;\n return (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;\n}\n\n/** Resolves a Pi colour reference: a var name, or a literal colour. */\nfunction resolve(vars: Record<string, string>, reference: string | undefined): string | undefined {\n if (reference === undefined) return undefined;\n return vars[reference] ?? reference;\n}\n\nexport interface PiThemeBridgeOptions {\n /** The web theme's id; defaults to the Pi theme's name. */\n name?: string;\n label?: string;\n /** Forced scheme; otherwise inferred from the background luminance. */\n scheme?: ThemeScheme;\n}\n\n/**\n * Builds a web theme from a Pi TUI theme, so the palette Po ships for\n * the terminal (po-ui/themes/po-dark.json) drives the browser too.\n * The mapping is by role, not by name: Pi has no cockpit \"deep\" surface or\n * \"border-soft\" line, so those are mixed from the nearest vars. Returns null\n * when the input is not a Pi theme with a complete palette.\n */\nexport function themeFromPiTheme(input: unknown, options: PiThemeBridgeOptions = {}): ThemeConfig | null {\n if (!isRecord(input)) return null;\n const { name, vars, colors } = input as PiThemeLike;\n if (!isRecord(vars)) return null;\n const palette: Record<string, string> = {};\n for (const [key, value] of Object.entries(vars)) if (typeof value === 'string') palette[key] = value;\n const semantic: Record<string, string> = {};\n if (isRecord(colors))\n for (const [key, value] of Object.entries(colors)) if (typeof value === 'string') semantic[key] = value;\n\n const bg = palette.bg;\n const bgAlt = palette.bgAlt ?? bg;\n const fg = palette.fg;\n if (bg === undefined || fg === undefined) return null;\n\n const luminance = hexLuminance(bg);\n const scheme: ThemeScheme = options.scheme ?? (luminance !== null && luminance > 0.5 ? 'light' : 'dark');\n const towards = scheme === 'dark' ? 'black' : 'white';\n const deep = `color-mix(in srgb, ${bgAlt} 84%, ${towards})`;\n const border = resolve(palette, semantic.borderMuted) ?? palette.grey ?? `color-mix(in srgb, ${fg} 25%, ${bg})`;\n const themeName = options.name ?? (typeof name === 'string' ? name : 'pi-theme');\n\n return parseThemeConfig({\n name: themeName,\n label: options.label ?? themeName,\n scheme,\n tokens: {\n bg,\n rail: bgAlt,\n panel: `color-mix(in srgb, ${bgAlt} 70%, ${bg})`,\n deep,\n border,\n 'border-soft': `color-mix(in srgb, ${border} 55%, ${bg})`,\n hi: `color-mix(in srgb, ${fg} 65%, ${scheme === 'dark' ? 'white' : 'black'})`,\n text: fg,\n dim: resolve(palette, semantic.muted) ?? palette.fgAlt ?? fg,\n faint: resolve(palette, semantic.dim) ?? palette.comment ?? palette.greyAlt ?? fg,\n blue: palette.blue ?? resolve(palette, semantic.accent) ?? fg,\n green: palette.green ?? resolve(palette, semantic.success) ?? fg,\n yellow: palette.yellow ?? resolve(palette, semantic.warning) ?? fg,\n red: palette.red ?? resolve(palette, semantic.error) ?? fg,\n magenta: palette.magenta ?? palette.violet ?? fg,\n violet: palette.violet ?? palette.magenta ?? fg,\n cyan: palette.cyan ?? palette.blue ?? fg,\n orange: palette.orange ?? palette.yellow ?? fg,\n teal: palette.teal ?? palette.cyan ?? fg,\n selected: palette.darkBlue ?? palette.blue ?? fg,\n },\n });\n}\n"],"mappings":"+BAaA,SAASE,EAAS,EAAkD,CAClE,OAAO,OAAOC,GAAU,YAAYA,GAAkB,CAAC,MAAM,QAAQA,CAAK,CAC5E,CAEA,SAASC,EAAa,EAA4B,CAChD,IAAMC,EAAQ,oBAAoB,KAAKC,EAAI,KAAK,CAAC,EACjD,GAAI,CAACD,EAAO,OAAO,KACnB,IAAMF,EAAQ,OAAO,SAASE,EAAM,GAAI,EAAE,EACpC,EAAKF,GAAS,GAAM,IACpBI,EAAKJ,GAAS,EAAK,IACnBK,EAAIL,EAAQ,IAClB,OAAQ,MAAS,EAAI,MAASI,EAAI,MAASC,GAAK,GAClD,CAGA,SAASC,EAAQ,EAA8B,EAAm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X,EAAQK,EAASE,EAAS,KAAK,GAAKF,EAAQ,OAASM,EAC1D,MAAOX,EAAQK,EAASE,EAAS,GAAG,GAAKF,EAAQ,SAAWA,EAAQ,SAAWM,EAC/E,KAAMN,EAAQ,MAAQL,EAAQK,EAASE,EAAS,MAAM,GAAKI,EAC3D,MAAON,EAAQ,OAASL,EAAQK,EAASE,EAAS,OAAO,GAAKI,EAC9D,OAAQN,EAAQ,QAAUL,EAAQK,EAASE,EAAS,OAAO,GAAKI,EAChE,IAAKN,EAAQ,KAAOL,EAAQK,EAASE,EAAS,KAAK,GAAKI,EACxD,QAASN,EAAQ,SAAWA,EAAQ,QAAUM,EAC9C,OAAQN,EAAQ,QAAUA,EAAQ,SAAWM,EAC7C,KAAMN,EAAQ,MAAQA,EAAQ,MAAQM,EACtC,OAAQN,EAAQ,QAAUA,EAAQ,QAAUM,EAC5C,KAAMN,EAAQ,MAAQA,EAAQ,MAAQM,EACtC,SAAUN,EAAQ,UAAYA,EAAQ,MAAQM,CAChD,CACF,CAAC,CACH"}
1
+ {"version":3,"file":"piTheme.cjs","names":["parseThemeConfig","require_parse","isRecord","value","hexLuminance","match","hex","g","b","resolve","reference","vars","themeFromPiTheme","input","palette","key","semantic","colors","bg","bgAlt","fg","luminance","scheme","options","deep","border","themeName","name"],"sources":["../../../src/theme/piTheme.ts"],"sourcesContent":["import type { ThemeConfig, ThemeScheme } from '../types/theme';\nimport { parseThemeConfig } from './parse';\n\n/**\n * The Pi TUI theme shape (theme-schema.json): a palette of named vars and\n * semantic colours that name a var or spell a colour.\n */\ninterface PiThemeLike {\n name?: unknown;\n vars?: unknown;\n colors?: unknown;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction hexLuminance(hex: string): number | null {\n const match = /^#([0-9a-f]{6})$/i.exec(hex.trim());\n if (!match) return null;\n const value = Number.parseInt(match[1], 16);\n const r = (value >> 16) & 0xff;\n const g = (value >> 8) & 0xff;\n const b = value & 0xff;\n return (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;\n}\n\n/** Resolves a Pi colour reference: a var name, or a literal colour. */\nfunction resolve(vars: Record<string, string>, reference: string | undefined): string | undefined {\n if (reference === undefined) return undefined;\n return vars[reference] ?? reference;\n}\n\nexport interface PiThemeBridgeOptions {\n /** The web theme's id; defaults to the Pi theme's name. */\n name?: string;\n label?: string;\n /** Forced scheme; otherwise inferred from the background luminance. */\n scheme?: ThemeScheme;\n}\n\n/**\n * Builds a web theme from a Pi TUI theme, so the palette Po ships for\n * the terminal (po-ui/themes/po-dark.json) drives the browser too.\n * The mapping is by role, not by name: Pi has no cockpit \"deep\" surface or\n * \"border-soft\" line, so those are mixed from the nearest vars. Returns null\n * when the input is not a Pi theme with a complete palette.\n */\nexport function themeFromPiTheme(input: unknown, options: PiThemeBridgeOptions = {}): ThemeConfig | null {\n if (!isRecord(input)) return null;\n const { name, vars, colors } = input as PiThemeLike;\n if (!isRecord(vars)) return null;\n const palette: Record<string, string> = {};\n for (const [key, value] of Object.entries(vars)) if (typeof value === 'string') palette[key] = value;\n const semantic: Record<string, string> = {};\n if (isRecord(colors))\n for (const [key, value] of Object.entries(colors)) if (typeof value === 'string') semantic[key] = value;\n\n const bg = palette.bg;\n const bgAlt = palette.bgAlt ?? bg;\n const fg = palette.fg;\n if (bg === undefined || fg === undefined) return null;\n\n const luminance = hexLuminance(bg);\n const scheme: ThemeScheme = options.scheme ?? (luminance !== null && luminance > 0.5 ? 'light' : 'dark');\n const towards = scheme === 'dark' ? 'black' : 'white';\n const deep = `color-mix(in srgb, ${bgAlt} 84%, ${towards})`;\n const border = resolve(palette, semantic.borderMuted) ?? palette.grey ?? `color-mix(in srgb, ${fg} 25%, ${bg})`;\n const themeName = options.name ?? (typeof name === 'string' ? name : 'pi-theme');\n\n return parseThemeConfig({\n name: themeName,\n label: options.label ?? themeName,\n scheme,\n tokens: {\n bg,\n rail: bgAlt,\n panel: `color-mix(in srgb, ${bgAlt} 70%, ${bg})`,\n deep,\n border,\n 'border-soft': `color-mix(in srgb, ${border} 55%, ${bg})`,\n hi: `color-mix(in srgb, ${fg} 65%, ${scheme === 'dark' ? 'white' : 'black'})`,\n text: fg,\n dim: resolve(palette, semantic.muted) ?? palette.fgAlt ?? fg,\n faint: resolve(palette, semantic.dim) ?? palette.comment ?? palette.greyAlt ?? fg,\n blue: palette.blue ?? resolve(palette, semantic.accent) ?? fg,\n green: palette.green ?? resolve(palette, semantic.success) ?? fg,\n yellow: palette.yellow ?? resolve(palette, semantic.warning) ?? fg,\n red: palette.red ?? resolve(palette, semantic.error) ?? fg,\n magenta: palette.magenta ?? palette.violet ?? fg,\n violet: palette.violet ?? palette.magenta ?? fg,\n cyan: palette.cyan ?? palette.blue ?? fg,\n orange: palette.orange ?? palette.yellow ?? fg,\n teal: palette.teal ?? palette.cyan ?? fg,\n selected: palette.darkBlue ?? palette.blue ?? fg,\n },\n });\n}\n"],"mappings":"A,+BAaA,SAASE,EAAS,EAAkD,CAClE,OAAO,OAAOC,GAAU,YAAYA,GAAkB,CAAC,MAAM,QAAQA,CAAK,CAC5E,CAEA,SAASC,EAAa,EAA4B,CAChD,IAAMC,EAAQ,oBAAoB,KAAKC,EAAI,KAAK,CAAC,EACjD,GAAI,CAACD,EAAO,OAAO,KACnB,IAAMF,EAAQ,OAAO,SAASE,EAAM,GAAI,EAAE,EACpC,EAAKF,GAAS,GAAM,IACpBI,EAAKJ,GAAS,EAAK,IACnBK,EAAIL,EAAQ,IAClB,OAAQ,MAAS,EAAI,MAASI,EAAI,MAASC,GAAK,GAClD,CAGA,SAASC,EAAQ,EAA8B,EAAmD,CAChG,GAAIC,IAAc,IAAA,GAClB,OAAOC,EAAKD,IAAcA,CAC5B,CAiBA,SAAgBE,EAAiB,EAAgB,EAAgC,CAAC,EAAuB,CACvG,GAAI,CAACV,EAASW,CAAK,EAAG,OAAO,KAC7B,GAAM,CAAE,OAAM,OAAM,UAAWA,EAC/B,GAAI,C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ASL,EAAQK,EAASE,EAAS,OAAO,GAAKI,EAC9D,OAAQN,EAAQ,QAAUL,EAAQK,EAASE,EAAS,OAAO,GAAKI,EAChE,IAAKN,EAAQ,KAAOL,EAAQK,EAASE,EAAS,KAAK,GAAKI,EACxD,QAASN,EAAQ,SAAWA,EAAQ,QAAUM,EAC9C,OAAQN,EAAQ,QAAUA,EAAQ,SAAWM,EAC7C,KAAMN,EAAQ,MAAQA,EAAQ,MAAQM,EACtC,OAAQN,EAAQ,QAAUA,EAAQ,QAAUM,EAC5C,KAAMN,EAAQ,MAAQA,EAAQ,MAAQM,EACtC,SAAUN,EAAQ,UAAYA,EAAQ,MAAQM,CAChD,CACF,CAAC,CACH,C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"piTheme.d.mts","names":[],"sources":["../../../src/theme/piTheme.ts"],"mappings":";;iBAiCiB;;EAEf;EACA;;EAEA,SAAS;;;;;;;;;wBAUK,iBAAiB,gBAAgB,UAAS,uBAA4B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"piTheme.mjs","names":["isRecord","value","hexLuminance","match","hex","g","b","resolve","reference","vars","themeFromPiTheme","input","palette","key","semantic","colors","bg","bgAlt","fg","luminance","scheme","options","deep","border","themeName","name","parseThemeConfig"],"sources":["../../../src/theme/piTheme.ts"],"sourcesContent":["import type { ThemeConfig, ThemeScheme } from '../types/theme';\nimport { parseThemeConfig } from './parse';\n\n/**\n * The Pi TUI theme shape (theme-schema.json): a palette of named vars and\n * semantic colours that name a var or spell a colour.\n */\ninterface PiThemeLike {\n name?: unknown;\n vars?: unknown;\n colors?: unknown;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction hexLuminance(hex: string): number | null {\n const match = /^#([0-9a-f]{6})$/i.exec(hex.trim());\n if (!match) return null;\n const value = Number.parseInt(match[1], 16);\n const r = (value >> 16) & 0xff;\n const g = (value >> 8) & 0xff;\n const b = value & 0xff;\n return (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;\n}\n\n/** Resolves a Pi colour reference: a var name, or a literal colour. */\nfunction resolve(vars: Record<string, string>, reference: string | undefined): string | undefined {\n if (reference === undefined) return undefined;\n return vars[reference] ?? reference;\n}\n\nexport interface PiThemeBridgeOptions {\n /** The web theme's id; defaults to the Pi theme's name. */\n name?: string;\n label?: string;\n /** Forced scheme; otherwise inferred from the background luminance. */\n scheme?: ThemeScheme;\n}\n\n/**\n * Builds a web theme from a Pi TUI theme, so the palette Po ships for\n * the terminal (po-ui/themes/po-dark.json) drives the browser too.\n * The mapping is by role, not by name: Pi has no cockpit \"deep\" surface or\n * \"border-soft\" line, so those are mixed from the nearest vars. Returns null\n * when the input is not a Pi theme with a complete palette.\n */\nexport function themeFromPiTheme(input: unknown, options: PiThemeBridgeOptions = {}): ThemeConfig | null {\n if (!isRecord(input)) return null;\n const { name, vars, colors } = input as PiThemeLike;\n if (!isRecord(vars)) return null;\n const palette: Record<string, string> = {};\n for (const [key, value] of Object.entries(vars)) if (typeof value === 'string') palette[key] = value;\n const semantic: Record<string, string> = {};\n if (isRecord(colors))\n for (const [key, value] of Object.entries(colors)) if (typeof value === 'string') semantic[key] = value;\n\n const bg = palette.bg;\n const bgAlt = palette.bgAlt ?? bg;\n const fg = palette.fg;\n if (bg === undefined || fg === undefined) return null;\n\n const luminance = hexLuminance(bg);\n const scheme: ThemeScheme = options.scheme ?? (luminance !== null && luminance > 0.5 ? 'light' : 'dark');\n const towards = scheme === 'dark' ? 'black' : 'white';\n const deep = `color-mix(in srgb, ${bgAlt} 84%, ${towards})`;\n const border = resolve(palette, semantic.borderMuted) ?? palette.grey ?? `color-mix(in srgb, ${fg} 25%, ${bg})`;\n const themeName = options.name ?? (typeof name === 'string' ? name : 'pi-theme');\n\n return parseThemeConfig({\n name: themeName,\n label: options.label ?? themeName,\n scheme,\n tokens: {\n bg,\n rail: bgAlt,\n panel: `color-mix(in srgb, ${bgAlt} 70%, ${bg})`,\n deep,\n border,\n 'border-soft': `color-mix(in srgb, ${border} 55%, ${bg})`,\n hi: `color-mix(in srgb, ${fg} 65%, ${scheme === 'dark' ? 'white' : 'black'})`,\n text: fg,\n dim: resolve(palette, semantic.muted) ?? palette.fgAlt ?? fg,\n faint: resolve(palette, semantic.dim) ?? palette.comment ?? palette.greyAlt ?? fg,\n blue: palette.blue ?? resolve(palette, semantic.accent) ?? fg,\n green: palette.green ?? resolve(palette, semantic.success) ?? fg,\n yellow: palette.yellow ?? resolve(palette, semantic.warning) ?? fg,\n red: palette.red ?? resolve(palette, semantic.error) ?? fg,\n magenta: palette.magenta ?? palette.violet ?? fg,\n violet: palette.violet ?? palette.magenta ?? fg,\n cyan: palette.cyan ?? palette.blue ?? fg,\n orange: palette.orange ?? palette.yellow ?? fg,\n teal: palette.teal ?? palette.cyan ?? fg,\n selected: palette.darkBlue ?? palette.blue ?? fg,\n },\n });\n}\n"],"mappings":"A,+CAaA,SAASA,EAAS,EAAkD,CAClE,OAAO,OAAOC,GAAU,YAAYA,GAAkB,CAAC,MAAM,QAAQA,CAAK,CAC5E,CAEA,SAASC,EAAa,EAA4B,CAChD,IAAMC,EAAQ,oBAAoB,KAAKC,EAAI,KAAK,CAAC,EACjD,GAAI,CAACD,EAAO,OAAO,KACnB,IAAMF,EAAQ,OAAO,SAASE,EAAM,GAAI,EAAE,EACpC,EAAKF,GAAS,GAAM,IACpBI,EAAKJ,GAAS,EAAK,IACnBK,EAAIL,EAAQ,IAClB,OAAQ,MAAS,EAAI,MAASI,EAAI,MAASC,GAAK,GAClD,CAGA,SAASC,EAAQ,EAA8B,EAAmD,CAChG,GAAIC,IAAc,IAAA,GAClB,OAAOC,EAAKD,IAAcA,CAC5B,CAiBA,SAAgBE,EAAiB,EAAgB,EAAgC,CAAC,EAAuB,CACvG,GAAI,CAACV,EAASW,CAAK,EAAG,OAAO,KAC7B,GAAM,CAAE,OAAM,OAAM,UAAWA,EAC/B,GAAI,CAACX,EAASS,CAAI,EAAG,O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,EAC9D,OAAQN,EAAQ,QAAUL,EAAQK,EAASE,EAAS,OAAO,GAAKI,EAChE,IAAKN,EAAQ,KAAOL,EAAQK,EAASE,EAAS,KAAK,GAAKI,EACxD,QAASN,EAAQ,SAAWA,EAAQ,QAAUM,EAC9C,OAAQN,EAAQ,QAAUA,EAAQ,SAAWM,EAC7C,KAAMN,EAAQ,MAAQA,EAAQ,MAAQM,EACtC,OAAQN,EAAQ,QAAUA,EAAQ,QAAUM,EAC5C,KAAMN,EAAQ,MAAQA,EAAQ,MAAQM,EACtC,SAAUN,EAAQ,UAAYA,EAAQ,MAAQM,CAChD,CACF,CAAC,CACH,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"preference.cjs","names":["THEME_STORAGE_KEY","readThemePreference","value","storage","writeThemePreference","name"],"sources":["../../../src/theme/preference.ts"],"sourcesContent":["/** Where the page remembers the chosen theme; one key, machine-local. */\nexport const THEME_STORAGE_KEY = 'po.web.theme';\n\n/** The two Storage calls the preference needs, so tests pass a plain map. */\nexport interface PreferenceStorage {\n getItem(key: string): string | null;\n setItem(key: string, value: string): void;\n removeItem(key: string): void;\n}\n\n/** The stored theme name, or null when nothing was chosen or storage is unavailable. */\nexport function readThemePreference(storage: PreferenceStorage | undefined): string | null {\n try {\n const value = storage?.getItem(THEME_STORAGE_KEY) ?? null;\n return value === null || value === '' ? null : value;\n } catch {\n return null;\n }\n}\n\n/** Remembers a theme name; null forgets it. Storage failures are swallowed: a theme is a convenience. */\nexport function writeThemePreference(storage: PreferenceStorage | undefined, name: string | null): void {\n try {\n if (name === null) storage?.removeItem(THEME_STORAGE_KEY);\n else storage?.setItem(THEME_STORAGE_KEY, name);\n } catch {\n // Private mode or a full quota: the theme still applies for this page load.\n }\n}\n"],"mappings":"AACA,MAAaA,EAAoB,eAUjC,SAAgBC,EAAoB,EAAuD,CACzF,GAAI,CACF,IAAMC,EAAQC,GAAS,QAAA,cAAyB,GAAK,KACrD,OAAOD,IAAU,MAAQA,IAAU,GAAK,KAAOA,CACjD,MAAQ,CACN,OAAO,IACT,CACF,CAGA,SAAgBE,EAAqB,EAAwC,EAA2B,CACtG,GAAI,CACEC,IAAS,KAAMF,GAAS,WAAWH,CAAiB,EACnDG,GAAS,QAAQH,EAAmBK,CAAI,CAC/C,MAAQ,CAER,CACF"}
1
+ {"version":3,"file":"preference.cjs","names":["THEME_STORAGE_KEY","readThemePreference","value","storage","writeThemePreference","name"],"sources":["../../../src/theme/preference.ts"],"sourcesContent":["/** Where the page remembers the chosen theme; one key, machine-local. */\nexport const THEME_STORAGE_KEY = 'po.web.theme';\n\n/** The two Storage calls the preference needs, so tests pass a plain map. */\nexport interface PreferenceStorage {\n getItem(key: string): string | null;\n setItem(key: string, value: string): void;\n removeItem(key: string): void;\n}\n\n/** The stored theme name, or null when nothing was chosen or storage is unavailable. */\nexport function readThemePreference(storage: PreferenceStorage | undefined): string | null {\n try {\n const value = storage?.getItem(THEME_STORAGE_KEY) ?? null;\n return value === null || value === '' ? null : value;\n } catch {\n return null;\n }\n}\n\n/** Remembers a theme name; null forgets it. Storage failures are swallowed: a theme is a convenience. */\nexport function writeThemePreference(storage: PreferenceStorage | undefined, name: string | null): void {\n try {\n if (name === null) storage?.removeItem(THEME_STORAGE_KEY);\n else storage?.setItem(THEME_STORAGE_KEY, name);\n } catch {\n // Private mode or a full quota: the theme still applies for this page load.\n }\n}\n"],"mappings":"AACA,MAAaA,EAAoB,eAUjC,SAAgBC,EAAoB,EAAuD,CACzF,GAAI,CACF,IAAMC,EAAQC,GAAS,QAAA,cAAyB,GAAK,KACrD,OAAOD,IAAU,MAAQA,IAAU,GAAK,KAAOA,CACjD,MAAQ,CACN,OAAO,IACT,CACF,CAGA,SAAgBE,EAAqB,EAAwC,EAA2B,CACtG,GAAI,CACEC,IAAS,KAAMF,GAAS,WAAWH,CAAiB,EACnDG,GAAS,QAAQH,EAAmBK,CAAI,CAC/C,MAAQ,CAER,CACF,C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preference.d.mts","names":[],"sources":["../../../src/theme/preference.ts"],"mappings":";;qBACa;;iBAGI;EACf,QAAQ;EACR,QAAQ,aAAa;EACrB,WAAW;;;wBAIG,oBAAoB,SAAS;;wBAU7B,qBAAqB,SAAS,+BAA+B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preference.mjs","names":["THEME_STORAGE_KEY","readThemePreference","value","storage","writeThemePreference","name"],"sources":["../../../src/theme/preference.ts"],"sourcesContent":["/** Where the page remembers the chosen theme; one key, machine-local. */\nexport const THEME_STORAGE_KEY = 'po.web.theme';\n\n/** The two Storage calls the preference needs, so tests pass a plain map. */\nexport interface PreferenceStorage {\n getItem(key: string): string | null;\n setItem(key: string, value: string): void;\n removeItem(key: string): void;\n}\n\n/** The stored theme name, or null when nothing was chosen or storage is unavailable. */\nexport function readThemePreference(storage: PreferenceStorage | undefined): string | null {\n try {\n const value = storage?.getItem(THEME_STORAGE_KEY) ?? null;\n return value === null || value === '' ? null : value;\n } catch {\n return null;\n }\n}\n\n/** Remembers a theme name; null forgets it. Storage failures are swallowed: a theme is a convenience. */\nexport function writeThemePreference(storage: PreferenceStorage | undefined, name: string | null): void {\n try {\n if (name === null) storage?.removeItem(THEME_STORAGE_KEY);\n else storage?.setItem(THEME_STORAGE_KEY, name);\n } catch {\n // Private mode or a full quota: the theme still applies for this page load.\n }\n}\n"],"mappings":"AACA,MAAaA,EAAoB,eAUjC,SAAgBC,EAAoB,EAAuD,CACzF,GAAI,CACF,IAAMC,EAAQC,GAAS,QAAA,cAAyB,GAAK,KACrD,OAAOD,IAAU,MAAQA,IAAU,GAAK,KAAOA,CACjD,MAAQ,CACN,OAAO,IACT,CACF,CAGA,SAAgBE,EAAqB,EAAwC,EAA2B,CACtG,GAAI,CACEC,IAAS,KAAMF,GAAS,WAAWH,CAAiB,EACnDG,GAAS,QAAQH,EAAmBK,CAAI,CAC/C,MAAQ,CAER,CACF,C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.mts","names":[],"sources":["../../../src/types/diff.ts"],"mappings":";;;;;;;;;;YAUY;YAEA;;iBAGK;EACf,QAAQ;EACR;EACA;;;iBAIe;EACf;EACA,eAAe;;;iBAIA;EACf,MAAM;EACN;EACA;EACA;;;iBAIe;EACf;;EAEA;;EAEA;;EAEA,OAAO;EACP;EACA;EACA;EACA"}