@promptctl/rich-js 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -110
  3. package/THIRD-PARTY-NOTICES +81 -0
  4. package/dist/core/box.d.ts +0 -1
  5. package/dist/core/box.js +0 -1
  6. package/dist/core/cells.d.ts +0 -1
  7. package/dist/core/cells.js +0 -1
  8. package/dist/core/color.d.ts +6 -1
  9. package/dist/core/color.js +6 -1
  10. package/dist/core/console.d.ts +13 -4
  11. package/dist/core/console.js +78 -87
  12. package/dist/core/emoji.d.ts +0 -1
  13. package/dist/core/emoji.js +0 -1
  14. package/dist/core/export-html.d.ts +24 -0
  15. package/dist/core/export-html.js +106 -0
  16. package/dist/core/export-lines.d.ts +121 -0
  17. package/dist/core/export-lines.js +141 -0
  18. package/dist/core/highlighter.d.ts +0 -1
  19. package/dist/core/highlighter.js +0 -1
  20. package/dist/core/json.d.ts +0 -1
  21. package/dist/core/json.js +0 -1
  22. package/dist/core/markup.d.ts +33 -2
  23. package/dist/core/markup.js +128 -16
  24. package/dist/core/measure.d.ts +0 -1
  25. package/dist/core/measure.js +0 -1
  26. package/dist/core/oklch.d.ts +34 -1
  27. package/dist/core/oklch.js +52 -5
  28. package/dist/core/osc8.d.ts +68 -0
  29. package/dist/core/osc8.js +90 -0
  30. package/dist/core/pretty.d.ts +21 -2
  31. package/dist/core/pretty.js +90 -16
  32. package/dist/core/protocol.d.ts +18 -2
  33. package/dist/core/protocol.js +0 -1
  34. package/dist/core/render.d.ts +0 -1
  35. package/dist/core/render.js +3 -10
  36. package/dist/core/segment.d.ts +0 -1
  37. package/dist/core/segment.js +0 -1
  38. package/dist/core/spinnerData.d.ts +0 -1
  39. package/dist/core/spinnerData.js +0 -1
  40. package/dist/core/strip.d.ts +19 -3
  41. package/dist/core/strip.js +58 -11
  42. package/dist/core/style.d.ts +3 -8
  43. package/dist/core/style.js +85 -68
  44. package/dist/core/subscription.d.ts +0 -1
  45. package/dist/core/subscription.js +0 -1
  46. package/dist/core/text.d.ts +1 -8
  47. package/dist/core/text.js +28 -31
  48. package/dist/core/wrap.d.ts +0 -1
  49. package/dist/core/wrap.js +0 -1
  50. package/dist/host/host-stream.d.ts +0 -1
  51. package/dist/host/host-stream.js +0 -1
  52. package/dist/host/index.d.ts +0 -1
  53. package/dist/host/index.js +0 -1
  54. package/dist/host/terminal-host.d.ts +0 -1
  55. package/dist/host/terminal-host.js +0 -1
  56. package/dist/index.d.ts +6 -5
  57. package/dist/index.js +4 -3
  58. package/dist/node/prompt.d.ts +0 -1
  59. package/dist/node/prompt.js +0 -1
  60. package/dist/node/save.d.ts +2 -7
  61. package/dist/node/save.js +0 -1
  62. package/dist/node/terminal-host.d.ts +0 -1
  63. package/dist/node/terminal-host.js +0 -1
  64. package/dist/node/traceback.d.ts +0 -1
  65. package/dist/node/traceback.js +0 -1
  66. package/dist/renderables/align.d.ts +0 -1
  67. package/dist/renderables/align.js +0 -1
  68. package/dist/renderables/columns.d.ts +12 -1
  69. package/dist/renderables/columns.js +29 -5
  70. package/dist/renderables/constrain.d.ts +0 -1
  71. package/dist/renderables/constrain.js +0 -1
  72. package/dist/renderables/flexStrip.d.ts +0 -1
  73. package/dist/renderables/flexStrip.js +0 -1
  74. package/dist/renderables/group.d.ts +0 -1
  75. package/dist/renderables/group.js +0 -1
  76. package/dist/renderables/layout.d.ts +0 -1
  77. package/dist/renderables/layout.js +20 -7
  78. package/dist/renderables/live.d.ts +0 -1
  79. package/dist/renderables/live.js +0 -1
  80. package/dist/renderables/markdown.d.ts +0 -1
  81. package/dist/renderables/markdown.js +0 -1
  82. package/dist/renderables/padding.d.ts +0 -1
  83. package/dist/renderables/padding.js +0 -1
  84. package/dist/renderables/panel.d.ts +0 -1
  85. package/dist/renderables/panel.js +12 -4
  86. package/dist/renderables/progress.d.ts +0 -1
  87. package/dist/renderables/progress.js +7 -2
  88. package/dist/renderables/progressBar.d.ts +0 -1
  89. package/dist/renderables/progressBar.js +0 -1
  90. package/dist/renderables/prompt.d.ts +0 -1
  91. package/dist/renderables/prompt.js +0 -1
  92. package/dist/renderables/rule.d.ts +0 -1
  93. package/dist/renderables/rule.js +0 -1
  94. package/dist/renderables/spinner.d.ts +0 -1
  95. package/dist/renderables/spinner.js +0 -1
  96. package/dist/renderables/status.d.ts +0 -1
  97. package/dist/renderables/status.js +0 -1
  98. package/dist/renderables/syntax.d.ts +0 -1
  99. package/dist/renderables/syntax.js +0 -1
  100. package/dist/renderables/table.d.ts +0 -1
  101. package/dist/renderables/table.js +8 -3
  102. package/dist/renderables/traceback.d.ts +8 -7
  103. package/dist/renderables/traceback.js +14 -10
  104. package/dist/renderables/tree.d.ts +0 -1
  105. package/dist/renderables/tree.js +0 -1
  106. package/dist/template-bindings/color-funcs.d.ts +0 -1
  107. package/dist/template-bindings/color-funcs.js +0 -1
  108. package/dist/template-bindings/helpers.d.ts +0 -1
  109. package/dist/template-bindings/helpers.js +0 -1
  110. package/dist/template-bindings/index.d.ts +0 -1
  111. package/dist/template-bindings/index.js +0 -1
  112. package/dist/template-bindings/palette-funcs.d.ts +0 -1
  113. package/dist/template-bindings/palette-funcs.js +0 -1
  114. package/dist/template-bindings/style-funcs.d.ts +0 -1
  115. package/dist/template-bindings/style-funcs.js +0 -1
  116. package/dist/themes/buildPalette.d.ts +0 -1
  117. package/dist/themes/buildPalette.js +0 -1
  118. package/dist/themes/colorMath.d.ts +0 -1
  119. package/dist/themes/colorMath.js +0 -1
  120. package/dist/themes/colorRef.d.ts +0 -1
  121. package/dist/themes/colorRef.js +0 -1
  122. package/dist/themes/data/atom-one-dark.d.ts +0 -1
  123. package/dist/themes/data/atom-one-dark.js +0 -1
  124. package/dist/themes/data/atom-one-light.d.ts +0 -1
  125. package/dist/themes/data/atom-one-light.js +0 -1
  126. package/dist/themes/data/catppuccin-frappe.d.ts +0 -1
  127. package/dist/themes/data/catppuccin-frappe.js +0 -1
  128. package/dist/themes/data/catppuccin-latte.d.ts +0 -1
  129. package/dist/themes/data/catppuccin-latte.js +0 -1
  130. package/dist/themes/data/catppuccin-macchiato.d.ts +0 -1
  131. package/dist/themes/data/catppuccin-macchiato.js +0 -1
  132. package/dist/themes/data/catppuccin-mocha.d.ts +0 -1
  133. package/dist/themes/data/catppuccin-mocha.js +0 -1
  134. package/dist/themes/data/cyberpunk.d.ts +0 -1
  135. package/dist/themes/data/cyberpunk.js +0 -1
  136. package/dist/themes/data/default.d.ts +0 -1
  137. package/dist/themes/data/default.js +0 -1
  138. package/dist/themes/data/dracula.d.ts +0 -1
  139. package/dist/themes/data/dracula.js +0 -1
  140. package/dist/themes/data/flexoki.d.ts +0 -1
  141. package/dist/themes/data/flexoki.js +0 -1
  142. package/dist/themes/data/gruvbox.d.ts +0 -1
  143. package/dist/themes/data/gruvbox.js +0 -1
  144. package/dist/themes/data/index.d.ts +0 -1
  145. package/dist/themes/data/index.js +0 -1
  146. package/dist/themes/data/monokai.d.ts +0 -1
  147. package/dist/themes/data/monokai.js +0 -1
  148. package/dist/themes/data/nord.d.ts +0 -1
  149. package/dist/themes/data/nord.js +0 -1
  150. package/dist/themes/data/rose-pine-dawn.d.ts +0 -1
  151. package/dist/themes/data/rose-pine-dawn.js +0 -1
  152. package/dist/themes/data/rose-pine-moon.d.ts +0 -1
  153. package/dist/themes/data/rose-pine-moon.js +0 -1
  154. package/dist/themes/data/rose-pine.d.ts +0 -1
  155. package/dist/themes/data/rose-pine.js +0 -1
  156. package/dist/themes/data/solarized-dark.d.ts +0 -1
  157. package/dist/themes/data/solarized-dark.js +0 -1
  158. package/dist/themes/data/solarized-light.d.ts +0 -1
  159. package/dist/themes/data/solarized-light.js +0 -1
  160. package/dist/themes/data/svg-export.d.ts +0 -1
  161. package/dist/themes/data/svg-export.js +0 -1
  162. package/dist/themes/data/textual-ansi.d.ts +0 -1
  163. package/dist/themes/data/textual-ansi.js +0 -1
  164. package/dist/themes/data/textual-dark.d.ts +0 -1
  165. package/dist/themes/data/textual-dark.js +0 -1
  166. package/dist/themes/data/textual-light.d.ts +0 -1
  167. package/dist/themes/data/textual-light.js +0 -1
  168. package/dist/themes/data/tokyo-night.d.ts +0 -1
  169. package/dist/themes/data/tokyo-night.js +0 -1
  170. package/dist/themes/data/types.d.ts +0 -1
  171. package/dist/themes/data/types.js +0 -1
  172. package/dist/themes/palette.d.ts +0 -1
  173. package/dist/themes/palette.js +0 -1
  174. package/dist/themes/ramp.d.ts +0 -1
  175. package/dist/themes/ramp.js +0 -1
  176. package/dist/themes/registry.d.ts +0 -1
  177. package/dist/themes/registry.js +0 -1
  178. package/dist/themes/terminalThemes.d.ts +0 -1
  179. package/dist/themes/terminalThemes.js +0 -1
  180. package/dist/themes/transpose.d.ts +0 -1
  181. package/dist/themes/transpose.js +0 -1
  182. package/dist/widgets/button.d.ts +0 -1
  183. package/dist/widgets/button.js +0 -1
  184. package/dist/widgets/checkbox.d.ts +0 -1
  185. package/dist/widgets/checkbox.js +0 -1
  186. package/dist/widgets/dropdown.d.ts +0 -1
  187. package/dist/widgets/dropdown.js +0 -1
  188. package/dist/widgets/event-router.d.ts +0 -1
  189. package/dist/widgets/event-router.js +0 -1
  190. package/dist/widgets/focus-manager.d.ts +0 -1
  191. package/dist/widgets/focus-manager.js +0 -1
  192. package/dist/widgets/index.d.ts +0 -1
  193. package/dist/widgets/index.js +0 -1
  194. package/dist/widgets/screen.d.ts +0 -1
  195. package/dist/widgets/screen.js +0 -1
  196. package/dist/widgets/slider.d.ts +0 -1
  197. package/dist/widgets/slider.js +0 -1
  198. package/dist/widgets/static-item.d.ts +0 -1
  199. package/dist/widgets/static-item.js +0 -1
  200. package/dist/widgets/text-input.d.ts +0 -1
  201. package/dist/widgets/text-input.js +0 -1
  202. package/dist/widgets/toggle.d.ts +0 -1
  203. package/dist/widgets/toggle.js +0 -1
  204. package/dist/widgets/types.d.ts +0 -1
  205. package/dist/widgets/types.js +0 -1
  206. package/dist/widgets/widget-base.d.ts +0 -1
  207. package/dist/widgets/widget-base.js +0 -1
  208. package/package.json +4 -3
  209. package/dist/core/box.d.ts.map +0 -1
  210. package/dist/core/box.js.map +0 -1
  211. package/dist/core/cells.d.ts.map +0 -1
  212. package/dist/core/cells.js.map +0 -1
  213. package/dist/core/color.d.ts.map +0 -1
  214. package/dist/core/color.js.map +0 -1
  215. package/dist/core/console.d.ts.map +0 -1
  216. package/dist/core/console.js.map +0 -1
  217. package/dist/core/emoji.d.ts.map +0 -1
  218. package/dist/core/emoji.js.map +0 -1
  219. package/dist/core/highlighter.d.ts.map +0 -1
  220. package/dist/core/highlighter.js.map +0 -1
  221. package/dist/core/json.d.ts.map +0 -1
  222. package/dist/core/json.js.map +0 -1
  223. package/dist/core/markup.d.ts.map +0 -1
  224. package/dist/core/markup.js.map +0 -1
  225. package/dist/core/measure.d.ts.map +0 -1
  226. package/dist/core/measure.js.map +0 -1
  227. package/dist/core/oklch.d.ts.map +0 -1
  228. package/dist/core/oklch.js.map +0 -1
  229. package/dist/core/pretty.d.ts.map +0 -1
  230. package/dist/core/pretty.js.map +0 -1
  231. package/dist/core/protocol.d.ts.map +0 -1
  232. package/dist/core/protocol.js.map +0 -1
  233. package/dist/core/render.d.ts.map +0 -1
  234. package/dist/core/render.js.map +0 -1
  235. package/dist/core/sanitize.d.ts +0 -16
  236. package/dist/core/sanitize.d.ts.map +0 -1
  237. package/dist/core/sanitize.js +0 -19
  238. package/dist/core/sanitize.js.map +0 -1
  239. package/dist/core/segment.d.ts.map +0 -1
  240. package/dist/core/segment.js.map +0 -1
  241. package/dist/core/spinnerData.d.ts.map +0 -1
  242. package/dist/core/spinnerData.js.map +0 -1
  243. package/dist/core/strip.d.ts.map +0 -1
  244. package/dist/core/strip.js.map +0 -1
  245. package/dist/core/style.d.ts.map +0 -1
  246. package/dist/core/style.js.map +0 -1
  247. package/dist/core/subscription.d.ts.map +0 -1
  248. package/dist/core/subscription.js.map +0 -1
  249. package/dist/core/text.d.ts.map +0 -1
  250. package/dist/core/text.js.map +0 -1
  251. package/dist/core/wrap.d.ts.map +0 -1
  252. package/dist/core/wrap.js.map +0 -1
  253. package/dist/host/host-stream.d.ts.map +0 -1
  254. package/dist/host/host-stream.js.map +0 -1
  255. package/dist/host/index.d.ts.map +0 -1
  256. package/dist/host/index.js.map +0 -1
  257. package/dist/host/terminal-host.d.ts.map +0 -1
  258. package/dist/host/terminal-host.js.map +0 -1
  259. package/dist/index.d.ts.map +0 -1
  260. package/dist/index.js.map +0 -1
  261. package/dist/node/prompt.d.ts.map +0 -1
  262. package/dist/node/prompt.js.map +0 -1
  263. package/dist/node/save.d.ts.map +0 -1
  264. package/dist/node/save.js.map +0 -1
  265. package/dist/node/terminal-host.d.ts.map +0 -1
  266. package/dist/node/terminal-host.js.map +0 -1
  267. package/dist/node/traceback.d.ts.map +0 -1
  268. package/dist/node/traceback.js.map +0 -1
  269. package/dist/renderables/align.d.ts.map +0 -1
  270. package/dist/renderables/align.js.map +0 -1
  271. package/dist/renderables/columns.d.ts.map +0 -1
  272. package/dist/renderables/columns.js.map +0 -1
  273. package/dist/renderables/constrain.d.ts.map +0 -1
  274. package/dist/renderables/constrain.js.map +0 -1
  275. package/dist/renderables/flexStrip.d.ts.map +0 -1
  276. package/dist/renderables/flexStrip.js.map +0 -1
  277. package/dist/renderables/group.d.ts.map +0 -1
  278. package/dist/renderables/group.js.map +0 -1
  279. package/dist/renderables/layout.d.ts.map +0 -1
  280. package/dist/renderables/layout.js.map +0 -1
  281. package/dist/renderables/live.d.ts.map +0 -1
  282. package/dist/renderables/live.js.map +0 -1
  283. package/dist/renderables/markdown.d.ts.map +0 -1
  284. package/dist/renderables/markdown.js.map +0 -1
  285. package/dist/renderables/padding.d.ts.map +0 -1
  286. package/dist/renderables/padding.js.map +0 -1
  287. package/dist/renderables/panel.d.ts.map +0 -1
  288. package/dist/renderables/panel.js.map +0 -1
  289. package/dist/renderables/progress.d.ts.map +0 -1
  290. package/dist/renderables/progress.js.map +0 -1
  291. package/dist/renderables/progressBar.d.ts.map +0 -1
  292. package/dist/renderables/progressBar.js.map +0 -1
  293. package/dist/renderables/prompt.d.ts.map +0 -1
  294. package/dist/renderables/prompt.js.map +0 -1
  295. package/dist/renderables/rule.d.ts.map +0 -1
  296. package/dist/renderables/rule.js.map +0 -1
  297. package/dist/renderables/spinner.d.ts.map +0 -1
  298. package/dist/renderables/spinner.js.map +0 -1
  299. package/dist/renderables/status.d.ts.map +0 -1
  300. package/dist/renderables/status.js.map +0 -1
  301. package/dist/renderables/syntax.d.ts.map +0 -1
  302. package/dist/renderables/syntax.js.map +0 -1
  303. package/dist/renderables/table.d.ts.map +0 -1
  304. package/dist/renderables/table.js.map +0 -1
  305. package/dist/renderables/traceback.d.ts.map +0 -1
  306. package/dist/renderables/traceback.js.map +0 -1
  307. package/dist/renderables/tree.d.ts.map +0 -1
  308. package/dist/renderables/tree.js.map +0 -1
  309. package/dist/template-bindings/color-funcs.d.ts.map +0 -1
  310. package/dist/template-bindings/color-funcs.js.map +0 -1
  311. package/dist/template-bindings/helpers.d.ts.map +0 -1
  312. package/dist/template-bindings/helpers.js.map +0 -1
  313. package/dist/template-bindings/index.d.ts.map +0 -1
  314. package/dist/template-bindings/index.js.map +0 -1
  315. package/dist/template-bindings/palette-funcs.d.ts.map +0 -1
  316. package/dist/template-bindings/palette-funcs.js.map +0 -1
  317. package/dist/template-bindings/style-funcs.d.ts.map +0 -1
  318. package/dist/template-bindings/style-funcs.js.map +0 -1
  319. package/dist/themes/buildPalette.d.ts.map +0 -1
  320. package/dist/themes/buildPalette.js.map +0 -1
  321. package/dist/themes/colorMath.d.ts.map +0 -1
  322. package/dist/themes/colorMath.js.map +0 -1
  323. package/dist/themes/colorRef.d.ts.map +0 -1
  324. package/dist/themes/colorRef.js.map +0 -1
  325. package/dist/themes/data/atom-one-dark.d.ts.map +0 -1
  326. package/dist/themes/data/atom-one-dark.js.map +0 -1
  327. package/dist/themes/data/atom-one-light.d.ts.map +0 -1
  328. package/dist/themes/data/atom-one-light.js.map +0 -1
  329. package/dist/themes/data/catppuccin-frappe.d.ts.map +0 -1
  330. package/dist/themes/data/catppuccin-frappe.js.map +0 -1
  331. package/dist/themes/data/catppuccin-latte.d.ts.map +0 -1
  332. package/dist/themes/data/catppuccin-latte.js.map +0 -1
  333. package/dist/themes/data/catppuccin-macchiato.d.ts.map +0 -1
  334. package/dist/themes/data/catppuccin-macchiato.js.map +0 -1
  335. package/dist/themes/data/catppuccin-mocha.d.ts.map +0 -1
  336. package/dist/themes/data/catppuccin-mocha.js.map +0 -1
  337. package/dist/themes/data/cyberpunk.d.ts.map +0 -1
  338. package/dist/themes/data/cyberpunk.js.map +0 -1
  339. package/dist/themes/data/default.d.ts.map +0 -1
  340. package/dist/themes/data/default.js.map +0 -1
  341. package/dist/themes/data/dracula.d.ts.map +0 -1
  342. package/dist/themes/data/dracula.js.map +0 -1
  343. package/dist/themes/data/flexoki.d.ts.map +0 -1
  344. package/dist/themes/data/flexoki.js.map +0 -1
  345. package/dist/themes/data/gruvbox.d.ts.map +0 -1
  346. package/dist/themes/data/gruvbox.js.map +0 -1
  347. package/dist/themes/data/index.d.ts.map +0 -1
  348. package/dist/themes/data/index.js.map +0 -1
  349. package/dist/themes/data/monokai.d.ts.map +0 -1
  350. package/dist/themes/data/monokai.js.map +0 -1
  351. package/dist/themes/data/nord.d.ts.map +0 -1
  352. package/dist/themes/data/nord.js.map +0 -1
  353. package/dist/themes/data/rose-pine-dawn.d.ts.map +0 -1
  354. package/dist/themes/data/rose-pine-dawn.js.map +0 -1
  355. package/dist/themes/data/rose-pine-moon.d.ts.map +0 -1
  356. package/dist/themes/data/rose-pine-moon.js.map +0 -1
  357. package/dist/themes/data/rose-pine.d.ts.map +0 -1
  358. package/dist/themes/data/rose-pine.js.map +0 -1
  359. package/dist/themes/data/solarized-dark.d.ts.map +0 -1
  360. package/dist/themes/data/solarized-dark.js.map +0 -1
  361. package/dist/themes/data/solarized-light.d.ts.map +0 -1
  362. package/dist/themes/data/solarized-light.js.map +0 -1
  363. package/dist/themes/data/svg-export.d.ts.map +0 -1
  364. package/dist/themes/data/svg-export.js.map +0 -1
  365. package/dist/themes/data/textual-ansi.d.ts.map +0 -1
  366. package/dist/themes/data/textual-ansi.js.map +0 -1
  367. package/dist/themes/data/textual-dark.d.ts.map +0 -1
  368. package/dist/themes/data/textual-dark.js.map +0 -1
  369. package/dist/themes/data/textual-light.d.ts.map +0 -1
  370. package/dist/themes/data/textual-light.js.map +0 -1
  371. package/dist/themes/data/tokyo-night.d.ts.map +0 -1
  372. package/dist/themes/data/tokyo-night.js.map +0 -1
  373. package/dist/themes/data/types.d.ts.map +0 -1
  374. package/dist/themes/data/types.js.map +0 -1
  375. package/dist/themes/palette.d.ts.map +0 -1
  376. package/dist/themes/palette.js.map +0 -1
  377. package/dist/themes/ramp.d.ts.map +0 -1
  378. package/dist/themes/ramp.js.map +0 -1
  379. package/dist/themes/registry.d.ts.map +0 -1
  380. package/dist/themes/registry.js.map +0 -1
  381. package/dist/themes/terminalThemes.d.ts.map +0 -1
  382. package/dist/themes/terminalThemes.js.map +0 -1
  383. package/dist/themes/transpose.d.ts.map +0 -1
  384. package/dist/themes/transpose.js.map +0 -1
  385. package/dist/widgets/button.d.ts.map +0 -1
  386. package/dist/widgets/button.js.map +0 -1
  387. package/dist/widgets/checkbox.d.ts.map +0 -1
  388. package/dist/widgets/checkbox.js.map +0 -1
  389. package/dist/widgets/dropdown.d.ts.map +0 -1
  390. package/dist/widgets/dropdown.js.map +0 -1
  391. package/dist/widgets/event-router.d.ts.map +0 -1
  392. package/dist/widgets/event-router.js.map +0 -1
  393. package/dist/widgets/focus-manager.d.ts.map +0 -1
  394. package/dist/widgets/focus-manager.js.map +0 -1
  395. package/dist/widgets/index.d.ts.map +0 -1
  396. package/dist/widgets/index.js.map +0 -1
  397. package/dist/widgets/screen.d.ts.map +0 -1
  398. package/dist/widgets/screen.js.map +0 -1
  399. package/dist/widgets/slider.d.ts.map +0 -1
  400. package/dist/widgets/slider.js.map +0 -1
  401. package/dist/widgets/static-item.d.ts.map +0 -1
  402. package/dist/widgets/static-item.js.map +0 -1
  403. package/dist/widgets/text-input.d.ts.map +0 -1
  404. package/dist/widgets/text-input.js.map +0 -1
  405. package/dist/widgets/toggle.d.ts.map +0 -1
  406. package/dist/widgets/toggle.js.map +0 -1
  407. package/dist/widgets/types.d.ts.map +0 -1
  408. package/dist/widgets/types.js.map +0 -1
  409. package/dist/widgets/widget-base.d.ts.map +0 -1
  410. package/dist/widgets/widget-base.js.map +0 -1
@@ -20,7 +20,28 @@ import { cellLen } from "./cells.js";
20
20
  import { RichText } from "./text.js";
21
21
  import { ReprHighlighter } from "./highlighter.js";
22
22
  const reprHighlighter = new ReprHighlighter();
23
- const rootFrame = (maxWidth) => ({ inset: 0, level: 0, maxWidth, open: new WeakSet() });
23
+ const rootFrame = (maxWidth) => ({
24
+ inset: 0,
25
+ level: 0,
26
+ maxWidth,
27
+ column: 0,
28
+ reserve: 0,
29
+ open: new WeakSet(),
30
+ });
31
+ /**
32
+ * The column reached after `text` is appended to a line currently at `column`.
33
+ *
34
+ * A hole's formatted value can itself span multiple lines — a nested
35
+ * container that failed its own compact try. What comes after it (a Map
36
+ * entry's tail, the next hole) sits after `text`'s *last* line, not at
37
+ * `column + cellLen(text)`, so a multi-line insert resets the column to that
38
+ * last line's width instead of accumulating across lines that were never on
39
+ * the same row.
40
+ */
41
+ function lineColumn(column, text) {
42
+ const lastNewline = text.lastIndexOf("\n");
43
+ return lastNewline === -1 ? column + cellLen(text) : cellLen(text.slice(lastNewline + 1));
44
+ }
24
45
  /**
25
46
  * The text, when it is a single line no wider than `budget` — otherwise `null`.
26
47
  *
@@ -111,6 +132,15 @@ function describesItself(value) {
111
132
  }
112
133
  /** What joins a container's positions on one line. Its width is charged for, so it is named once. */
113
134
  const SEPARATOR = ", ";
135
+ /**
136
+ * What joins a container's positions across lines, once it has expanded —
137
+ * `SEPARATOR` without the trailing space a newline already provides.
138
+ * rich-pretty-xms: named, and derived rather than a second hand-typed
139
+ * literal, so the width it costs a non-last slot's own compact try —
140
+ * reserved via `Frame.reserve` — cannot drift from what `_formatObject`
141
+ * actually joins with.
142
+ */
143
+ const EXPAND_SEPARATOR = SEPARATOR.trimEnd();
114
144
  /** The marker for positions the bound dropped, or nothing when it dropped none. */
115
145
  const elided = (dropped) => dropped > 0 ? [{ head: `... +${dropped}`, holes: [] }] : [];
116
146
  export class Pretty {
@@ -165,11 +195,15 @@ export class Pretty {
165
195
  return "undefined";
166
196
  switch (typeof value) {
167
197
  case "string": {
168
- let str = value;
169
- if (this.maxString !== undefined && str.length > this.maxString) {
170
- str = str.slice(0, this.maxString) + `+${value.length - this.maxString}`;
198
+ // The dropped count is an annotation about the value, not part of it,
199
+ // so it goes after the closing quote — the way `maxLength`'s `... +N`
200
+ // sits beside the kept entries rather than inside the last one. Inside
201
+ // the quotes it reads as content, and copying it out yields a string
202
+ // the program never held.
203
+ if (this.maxString === undefined || value.length <= this.maxString) {
204
+ return JSON.stringify(value);
171
205
  }
172
- return JSON.stringify(str);
206
+ return JSON.stringify(value.slice(0, this.maxString)) + `+${value.length - this.maxString}`;
173
207
  }
174
208
  case "number":
175
209
  case "bigint":
@@ -281,35 +315,76 @@ export class Pretty {
281
315
  const shape = this._shape(value, at.level, Infinity);
282
316
  if (shape.kind === "text")
283
317
  return shape.text;
284
- const indentStr = " ".repeat(this.indent * at.inset);
285
318
  if (!this.expandAll) {
319
+ // rich-pretty-xms: budget from `at.column` and `at.reserve`, not from
320
+ // `at.inset` alone. `at.column` is where *this* value's text actually
321
+ // starts on its line, which already includes whatever `_expandSlot`
322
+ // prepended for us (a key and its separator, a Map entry's `" => "`,
323
+ // ...); `at.reserve` is what a fixed piece of literal text — the rest
324
+ // of this hole's own tail, or the trailing `,` a non-last slot gets
325
+ // joined with — is known to cost right after, before this value's own
326
+ // text even starts. Deriving the budget from the indent alone assumed
327
+ // nothing precedes *or follows* the value on its line, which is only
328
+ // true at the root and for the last hole of an array's last element.
286
329
  const compact = this._joinOneLine(shape, {
287
330
  level: at.level + 1,
288
- budget: at.maxWidth - cellLen(indentStr),
331
+ budget: at.maxWidth - at.column - at.reserve,
289
332
  open: at.open,
290
333
  });
291
334
  if (compact !== null)
292
335
  return compact;
293
336
  }
337
+ const indentStr = " ".repeat(this.indent * at.inset);
294
338
  const innerIndent = " ".repeat(this.indent * (at.inset + 1));
295
- const deeper = { inset: at.inset + 1, level: at.level + 1, maxWidth: at.maxWidth, open: at.open };
296
- const parts = shape.slots.map((slot) => innerIndent + this._expandSlot(slot, deeper));
297
- return shape.open + "\n" + parts.join(",\n") + "\n" + indentStr + shape.close;
339
+ // Every non-last slot gets `EXPAND_SEPARATOR` appended right after it
340
+ // below, on the same line as whatever its own last character was — the
341
+ // last slot doesn't. Two frames, not one per slot: `reserve` is the only
342
+ // field that varies, and it only ever takes these two values.
343
+ const base = { inset: at.inset + 1, level: at.level + 1, maxWidth: at.maxWidth, column: cellLen(innerIndent), open: at.open };
344
+ const midFrame = { ...base, reserve: cellLen(EXPAND_SEPARATOR) };
345
+ const lastFrame = { ...base, reserve: 0 };
346
+ const lastSlot = shape.slots.length - 1;
347
+ const parts = shape.slots.map((slot, i) => innerIndent + this._expandSlot(slot, i === lastSlot ? lastFrame : midFrame));
348
+ return shape.open + "\n" + parts.join(EXPAND_SEPARATOR + "\n") + "\n" + indentStr + shape.close;
298
349
  }
299
- /** One position, with every value in it laid out. */
350
+ /**
351
+ * One position, with every value in it laid out.
352
+ *
353
+ * `at.column` is where `slot.head` begins. Rather than hand-tracking a
354
+ * second, parallel "column so far" alongside `out` — two values a future
355
+ * edit could update out of step, silently reintroducing a stale-budget bug
356
+ * of the same shape this file just fixed — each hole derives its own
357
+ * column fresh from `out` via `lineColumn`, the one place "text just
358
+ * emitted" becomes "column now". [LAW:one-source-of-truth] `out` is
359
+ * already the complete record; `column` is a read of it, not a second copy
360
+ * of the same fact. `_joinOneLine`'s probe sibling tracks the analogous
361
+ * thing via `budget` shrinking instead, because a probe already discards
362
+ * anything that overruns and so never needs to know where a multi-line
363
+ * insert's last line ends.
364
+ *
365
+ * Each hole's `reserve` is its own `tail` plus, only for the slot's last
366
+ * hole, whatever `at.reserve` already asked this whole slot to leave room
367
+ * for (`_formatObject`'s trailing `,`). An earlier hole's tail is never
368
+ * folded into a later hole's reserve — it is spent, not carried, the moment
369
+ * `out` grows past it.
370
+ */
300
371
  _expandSlot(slot, at) {
301
372
  let out = slot.head;
302
- for (const hole of slot.holes) {
373
+ const lastHole = slot.holes.length - 1;
374
+ for (let i = 0; i < slot.holes.length; i++) {
375
+ const hole = slot.holes[i];
303
376
  // This is the read that costs the least when it fails: neighbours are
304
377
  // unaffected, so `{ a: 1, b: [Threw: …], c: 3 }` still shows everything
305
378
  // that could be read.
379
+ let text;
306
380
  try {
307
- out += this._format(hole.read(), at);
381
+ const reserve = cellLen(hole.tail) + (i === lastHole ? at.reserve : 0);
382
+ text = this._format(hole.read(), { ...at, column: lineColumn(at.column, out), reserve });
308
383
  }
309
384
  catch (error) {
310
- out += threw(error);
385
+ text = threw(error);
311
386
  }
312
- out += hole.tail;
387
+ out += text + hole.tail;
313
388
  }
314
389
  return out;
315
390
  }
@@ -395,4 +470,3 @@ export class Pretty {
395
470
  }
396
471
  }
397
472
  }
398
- //# sourceMappingURL=pretty.js.map
@@ -3,7 +3,7 @@
3
3
  * [LAW:one-source-of-truth] These interfaces are the single authority for the rendering contract.
4
4
  */
5
5
  import type { Segment } from "./segment.js";
6
- import { type Style, type Theme } from "./style.js";
6
+ import { type Style, type StyleSyntaxError, type Theme } from "./style.js";
7
7
  export interface RenderOptions {
8
8
  /**
9
9
  * The cells this renderable may occupy. A count of cells, so a non-negative
@@ -30,7 +30,24 @@ export interface RenderOptions {
30
30
  * built-in defaults apply. Read it through `getStyle` rather than directly.
31
31
  */
32
32
  theme?: Theme;
33
+ /**
34
+ * Called each time a render degrades a style string it cannot parse to
35
+ * unstyled, once per resolution — a style the render reads twice is reported
36
+ * twice. Absent, the failure passes silently. A handler that throws makes
37
+ * the render strict: the error leaves `render`.
38
+ */
39
+ onStyleError?: StyleErrorHandler;
33
40
  }
41
+ /**
42
+ * Receives a style error a render would otherwise absorb: the parse failure,
43
+ * and the whole style string it came from — the error names only the token
44
+ * that failed, and `"bold rd"` loses its `bold` too.
45
+ *
46
+ * [LAW:no-mode-explosion] Strict mode is not a second option beside this one.
47
+ * It is a handler that throws, so there is no "strict and a callback" state
48
+ * whose order anyone has to define.
49
+ */
50
+ export type StyleErrorHandler = (error: StyleSyntaxError, style: string) => void;
34
51
  /**
35
52
  * The style a `string | Style` stands for in this render.
36
53
  *
@@ -109,4 +126,3 @@ export interface Measurable {
109
126
  }
110
127
  export declare function isRenderable(obj: unknown): obj is Renderable;
111
128
  export declare function isMeasurable(obj: unknown): obj is Measurable;
112
- //# sourceMappingURL=protocol.d.ts.map
@@ -99,4 +99,3 @@ export function isMeasurable(obj) {
99
99
  "measure" in obj &&
100
100
  typeof obj.measure === "function");
101
101
  }
102
- //# sourceMappingURL=protocol.js.map
@@ -67,4 +67,3 @@ export declare function segmentToString(segment: Segment, colorSystem: ColorDept
67
67
  */
68
68
  export declare function segmentsToString(segments: Iterable<Segment>, colorSystem: ColorDepth | null): string;
69
69
  export declare function renderToString(renderable: Renderable, options?: RenderToStringOptions): string;
70
- //# sourceMappingURL=render.d.ts.map
@@ -29,7 +29,7 @@
29
29
  * mechanical fold over it.
30
30
  */
31
31
  import { ColorDepth, resolveColorSystem } from "./color.js";
32
- import { stripOscTerminators } from "./sanitize.js";
32
+ import { OSC8_CLOSE, osc8Open } from "./osc8.js";
33
33
  const DEFAULT_WIDTH = 80;
34
34
  function segmentToPiece(segment, colorSystem) {
35
35
  if (segment.isControl)
@@ -86,16 +86,10 @@ export function segmentsToString(segments, colorSystem) {
86
86
  while (l < j && pieces[l].link === link)
87
87
  l++;
88
88
  if (link) {
89
- // [LAW:single-enforcer] Wire-byte trust boundary — sanitize the URL
90
- // at the one place it becomes an OSC 8 sequence, regardless of which
91
- // upstream API attached it to the Style. Defense-in-depth for the
92
- // RichText data-model boundary in text.ts; also covers Style paths
93
- // that don't go through RichText (Console.print({style: ...}), any
94
- // direct `Segment.applyStyle(... new Style({ link })) ...`).
95
- parts.push(`\x1b]8;;${stripOscTerminators(link)}\x1b\\`);
89
+ parts.push(osc8Open(link));
96
90
  for (let m = k; m < l; m++)
97
91
  parts.push(pieces[m].text);
98
- parts.push("\x1b]8;;\x1b\\");
92
+ parts.push(OSC8_CLOSE);
99
93
  }
100
94
  else {
101
95
  for (let m = k; m < l; m++)
@@ -141,4 +135,3 @@ export function renderToString(renderable, options) {
141
135
  };
142
136
  return segmentsToString(renderable.render(renderOptions), colorSystem);
143
137
  }
144
- //# sourceMappingURL=render.js.map
@@ -140,4 +140,3 @@ export declare class Segment {
140
140
  */
141
141
  static splitAndCropLines(segments: Iterable<Segment>, width: number, pad?: boolean, includeNewLines?: boolean, style?: Style): Segment[][];
142
142
  }
143
- //# sourceMappingURL=segment.d.ts.map
@@ -431,4 +431,3 @@ function stylesEqual(a, b) {
431
431
  return false;
432
432
  return a.equals(b);
433
433
  }
434
- //# sourceMappingURL=segment.js.map
@@ -8,4 +8,3 @@ export interface SpinnerData {
8
8
  }
9
9
  export declare const SPINNERS: Record<string, SpinnerData>;
10
10
  export declare const DEFAULT_SPINNER = "dots";
11
- //# sourceMappingURL=spinnerData.d.ts.map
@@ -113,4 +113,3 @@ export const SPINNERS = {
113
113
  ], interval: 80 },
114
114
  };
115
115
  export const DEFAULT_SPINNER = "dots";
116
- //# sourceMappingURL=spinnerData.js.map
@@ -58,12 +58,29 @@ export declare class Strip<T extends StyledRenderable = StyledRenderable> implem
58
58
  constructor(items: readonly T[], joiner: Joiner<T>);
59
59
  render(options: RenderOptions): Iterable<Segment>;
60
60
  }
61
+ /**
62
+ * The least ΔE_OK two neighbouring backgrounds must differ by for the powerline
63
+ * arrow between them to be seen. Below it the arrow is drawn in a colour the
64
+ * eye cannot tell from its own background, so the joiner draws the divider
65
+ * instead. Twice the ~.02 threshold of a visible difference, because a seam is
66
+ * one cell wide.
67
+ */
68
+ export declare const SEAM_MIN_DELTA_E = 0.04;
61
69
  export interface PowerlineJoinerOptions {
62
- /** Glyph used for every join (default: U+E0B0, the powerline right-arrow). */
63
- glyph?: string;
70
+ /** Glyph used for every join. */
71
+ glyph: string;
72
+ /**
73
+ * Glyph drawn between neighbours whose backgrounds the eye cannot tell apart,
74
+ * in the left item's text colour — the arrow itself would vanish into the
75
+ * shared background.
76
+ */
77
+ divider: string;
64
78
  }
79
+ /** The powerline pair: U+E0B0 (right-arrow) divided by U+E0B1 (thin right-arrow). */
80
+ export declare const POWERLINE_JOINER_GLYPHS: Readonly<PowerlineJoinerOptions>;
65
81
  export declare class PowerlineJoiner<T extends StyledRenderable = StyledRenderable> implements Joiner<T> {
66
82
  private readonly _glyph;
83
+ private readonly _divider;
67
84
  constructor(options?: PowerlineJoinerOptions);
68
85
  join(left: T | null, right: T | null): Renderable;
69
86
  }
@@ -102,4 +119,3 @@ export declare class GradientJoiner<T extends StyledRenderable = StyledRenderabl
102
119
  constructor(options?: GradientJoinerOptions);
103
120
  join(left: T | null, right: T | null): Renderable;
104
121
  }
105
- //# sourceMappingURL=strip.d.ts.map
@@ -26,8 +26,9 @@
26
26
  * styling, so the cell type does too.
27
27
  */
28
28
  import { Segment } from "./segment.js";
29
- import { Style } from "./style.js";
29
+ import { Style, SURFACE_BLACK } from "./style.js";
30
30
  import { ColorSpec, blendRgb } from "./color.js";
31
+ import { Oklch } from "./oklch.js";
31
32
  // --- Strip ---
32
33
  export class Strip {
33
34
  items;
@@ -51,6 +52,18 @@ export class Strip {
51
52
  const next = i + 1 < items.length ? items[i + 1] : null;
52
53
  yield* this.joiner.join(item, next).render(options);
53
54
  }
55
+ // [LAW:one-source-of-truth] `Strip`'s sibling `FlexStrip` ends every line
56
+ // it emits, including the last, and the other block-level renderables
57
+ // (`Panel`/`Rule`/`Table` structurally, `RichText` via `end`) do too — so
58
+ // `Group` can emit children back to back with nothing in between
59
+ // (docs/group.md). A `Strip` that left its last line open broke only
60
+ // under composition: printed alone, Console's own "close whatever the
61
+ // renderable left open" step (console.ts) papered over it, and a `Group`
62
+ // of a Strip and a RichText ran the RichText onto the Strip's line
63
+ // instead of below it. (Not every renderable follows this — a `Spinner`
64
+ // or `ProgressBar` is a line *fragment*, not a block; see
65
+ // rich-flexstrip-5kf.4cq for the open question of formalizing that split.)
66
+ yield Segment.line();
54
67
  }
55
68
  }
56
69
  // --- Helpers ---
@@ -88,10 +101,38 @@ function bgAsFg(edge) {
88
101
  function paintableBg(bg) {
89
102
  return bg !== undefined && !bg.isDefault ? bg : undefined;
90
103
  }
104
+ // --- PowerlineJoiner ---
105
+ /**
106
+ * The least ΔE_OK two neighbouring backgrounds must differ by for the powerline
107
+ * arrow between them to be seen. Below it the arrow is drawn in a colour the
108
+ * eye cannot tell from its own background, so the joiner draws the divider
109
+ * instead. Twice the ~.02 threshold of a visible difference, because a seam is
110
+ * one cell wide.
111
+ */
112
+ export const SEAM_MIN_DELTA_E = 0.04;
113
+ // Two backgrounds the eye cannot tell apart. What is measured is what is
114
+ // drawn: each colour flattened onto the substrate Style.toSgrCodes flattens it
115
+ // onto, so two alphas over one RGB are the two greys they render as. A palette
116
+ // colour has no value here, so two of them are the same only when they are the
117
+ // same palette slot — `type` + `number`, never the name, which spells one slot
118
+ // many ways ("red", "color(1)").
119
+ function indistinct(a, b) {
120
+ if (b === undefined)
121
+ return false;
122
+ const av = a.flattenAlpha(SURFACE_BLACK).value;
123
+ const bv = b.flattenAlpha(SURFACE_BLACK).value;
124
+ return av !== undefined && bv !== undefined
125
+ ? Oklch.fromRgba(av).deltaE(Oklch.fromRgba(bv)) < SEAM_MIN_DELTA_E
126
+ : a.type === b.type && a.number === b.number;
127
+ }
128
+ /** The powerline pair: U+E0B0 (right-arrow) divided by U+E0B1 (thin right-arrow). */
129
+ export const POWERLINE_JOINER_GLYPHS = Object.freeze({ glyph: "\ue0b0", divider: "\ue0b1" });
91
130
  export class PowerlineJoiner {
92
131
  _glyph;
93
- constructor(options) {
94
- this._glyph = options?.glyph ?? "";
132
+ _divider;
133
+ constructor(options = POWERLINE_JOINER_GLYPHS) {
134
+ this._glyph = options.glyph;
135
+ this._divider = options.divider;
95
136
  }
96
137
  join(left, right) {
97
138
  // [LAW:dataflow-not-control-flow] One expression for all three positions
@@ -105,20 +146,27 @@ export class PowerlineJoiner {
105
146
  // colourless arrow is not drawn.)
106
147
  // • no right bg — the end cap — bleeds the left colour out over the
107
148
  // terminal background (fg = left bg, no bg).
108
- // Equal REAL bgs still emit: the glyph is drawn in its own background colour
109
- // and is invisible, but the cell is present — a same-bg seam between two
110
- // distinct items is a structural boundary, never suppressed. Background
111
- // colour is paint, not structure; its ABSENCE (nothing to paint) is the only
112
- // thing that elides the separator, and that is paint logic, not structure.
149
+ // Equal REAL bgs still emit: a same-bg seam between two distinct items is a
150
+ // structural boundary, never suppressed. The arrow would be drawn in its own
151
+ // background colour there and vanish, so the seam is the DIVIDER instead, in
152
+ // the left item's text colour — the vim-airline convention for neighbours
153
+ // that share a background. "Equal" is perceptual (SEAM_MIN_DELTA_E): an
154
+ // arrow a hair off its background is as invisible as one exactly on it.
155
+ // Background colour is paint, not structure; its ABSENCE (nothing to paint)
156
+ // is the only thing that elides the separator, and that is paint logic.
113
157
  // "Absent" = no bg OR the terminal default (transparent) — paintableBg folds
114
158
  // both to undefined so an explicit `… on default` cannot smuggle a separator.
115
159
  const glyph = this._glyph;
160
+ const divider = this._divider;
116
161
  return deferred(function* (options) {
117
- const leftBg = paintableBg(left?.edgeStyle("right", options).bgcolor);
162
+ const leftEdge = left?.edgeStyle("right", options);
163
+ const leftBg = paintableBg(leftEdge?.bgcolor);
118
164
  if (leftBg === undefined)
119
165
  return;
120
166
  const rightBg = paintableBg(right?.edgeStyle("left", options).bgcolor);
121
- yield new Segment(glyph, new Style({ color: leftBg, bgcolor: rightBg }));
167
+ yield indistinct(leftBg, rightBg)
168
+ ? new Segment(divider, new Style({ color: leftEdge?.color, bgcolor: rightBg }))
169
+ : new Segment(glyph, new Style({ color: leftBg, bgcolor: rightBg }));
122
170
  });
123
171
  }
124
172
  }
@@ -206,4 +254,3 @@ export class GradientJoiner {
206
254
  });
207
255
  }
208
256
  }
209
- //# sourceMappingURL=strip.js.map
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Immutable style descriptors — colors, text attributes, links, metadata.
3
3
  */
4
- import { ColorSpec, ColorDepth } from "./color.js";
5
- import type { TerminalTheme } from "./color.js";
4
+ import { ColorRgba, ColorSpec, ColorDepth } from "./color.js";
5
+ export declare const SURFACE_BLACK: ColorRgba;
6
6
  /**
7
7
  * Canonical text-attribute inventory. Single source of truth consumed by
8
8
  * `Style.parse` / `Style.toString` and the template bindings — adding an
@@ -38,7 +38,7 @@ export interface StyleOptions {
38
38
  meta?: Record<string, unknown>;
39
39
  }
40
40
  export declare class StyleSyntaxError extends Error {
41
- constructor(message: string);
41
+ constructor(message: string, options?: ErrorOptions);
42
42
  }
43
43
  export declare class Style {
44
44
  readonly color: ColorSpec | undefined;
@@ -85,10 +85,6 @@ export declare class Style {
85
85
  * Render text with this style's ANSI escape codes.
86
86
  */
87
87
  render(text: string, colorSystem?: ColorDepth): string;
88
- /**
89
- * Returns a CSS style string for HTML rendering.
90
- */
91
- getHtmlStyle(theme?: TerminalTheme): string;
92
88
  /**
93
89
  * Serializes to a canonical string that round-trips through `Style.parse()`.
94
90
  */
@@ -141,4 +137,3 @@ export declare const DEFAULT_STYLES: Record<string, Style>;
141
137
  * a renderable sees outside a `Console`, as in `renderToString`.
142
138
  */
143
139
  export declare const DEFAULT_THEME: Theme;
144
- //# sourceMappingURL=style.d.ts.map