@promptctl/rich-js 0.9.0 → 0.11.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 +0 -1
  27. package/dist/core/oklch.js +0 -1
  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 +0 -1
  41. package/dist/core/strip.js +12 -1
  42. package/dist/core/style.d.ts +1 -7
  43. package/dist/core/style.js +84 -67
  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 +25 -29
  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 +4 -3
  57. package/dist/index.js +3 -2
  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 +4 -6
  184. package/dist/widgets/checkbox.d.ts +0 -1
  185. package/dist/widgets/checkbox.js +3 -5
  186. package/dist/widgets/dropdown.d.ts +0 -1
  187. package/dist/widgets/dropdown.js +4 -6
  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 -2
  191. package/dist/widgets/focus-manager.js +3 -8
  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 +2 -5
  196. package/dist/widgets/slider.d.ts +0 -1
  197. package/dist/widgets/slider.js +7 -9
  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 +5 -7
  202. package/dist/widgets/toggle.d.ts +0 -1
  203. package/dist/widgets/toggle.js +4 -6
  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 +3 -4
  207. package/dist/widgets/widget-base.js +4 -7
  208. package/package.json +14 -13
  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
@@ -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
@@ -102,4 +102,3 @@ export declare class GradientJoiner<T extends StyledRenderable = StyledRenderabl
102
102
  constructor(options?: GradientJoinerOptions);
103
103
  join(left: T | null, right: T | null): Renderable;
104
104
  }
105
- //# sourceMappingURL=strip.d.ts.map
@@ -51,6 +51,18 @@ export class Strip {
51
51
  const next = i + 1 < items.length ? items[i + 1] : null;
52
52
  yield* this.joiner.join(item, next).render(options);
53
53
  }
54
+ // [LAW:one-source-of-truth] `Strip`'s sibling `FlexStrip` ends every line
55
+ // it emits, including the last, and the other block-level renderables
56
+ // (`Panel`/`Rule`/`Table` structurally, `RichText` via `end`) do too — so
57
+ // `Group` can emit children back to back with nothing in between
58
+ // (docs/group.md). A `Strip` that left its last line open broke only
59
+ // under composition: printed alone, Console's own "close whatever the
60
+ // renderable left open" step (console.ts) papered over it, and a `Group`
61
+ // of a Strip and a RichText ran the RichText onto the Strip's line
62
+ // instead of below it. (Not every renderable follows this — a `Spinner`
63
+ // or `ProgressBar` is a line *fragment*, not a block; see
64
+ // rich-flexstrip-5kf.4cq for the open question of formalizing that split.)
65
+ yield Segment.line();
54
66
  }
55
67
  }
56
68
  // --- Helpers ---
@@ -206,4 +218,3 @@ export class GradientJoiner {
206
218
  });
207
219
  }
208
220
  }
209
- //# sourceMappingURL=strip.js.map
@@ -2,7 +2,6 @@
2
2
  * Immutable style descriptors — colors, text attributes, links, metadata.
3
3
  */
4
4
  import { ColorSpec, ColorDepth } from "./color.js";
5
- import type { TerminalTheme } from "./color.js";
6
5
  /**
7
6
  * Canonical text-attribute inventory. Single source of truth consumed by
8
7
  * `Style.parse` / `Style.toString` and the template bindings — adding an
@@ -38,7 +37,7 @@ export interface StyleOptions {
38
37
  meta?: Record<string, unknown>;
39
38
  }
40
39
  export declare class StyleSyntaxError extends Error {
41
- constructor(message: string);
40
+ constructor(message: string, options?: ErrorOptions);
42
41
  }
43
42
  export declare class Style {
44
43
  readonly color: ColorSpec | undefined;
@@ -85,10 +84,6 @@ export declare class Style {
85
84
  * Render text with this style's ANSI escape codes.
86
85
  */
87
86
  render(text: string, colorSystem?: ColorDepth): string;
88
- /**
89
- * Returns a CSS style string for HTML rendering.
90
- */
91
- getHtmlStyle(theme?: TerminalTheme): string;
92
87
  /**
93
88
  * Serializes to a canonical string that round-trips through `Style.parse()`.
94
89
  */
@@ -141,4 +136,3 @@ export declare const DEFAULT_STYLES: Record<string, Style>;
141
136
  * a renderable sees outside a `Console`, as in `renderToString`.
142
137
  */
143
138
  export declare const DEFAULT_THEME: Theme;
144
- //# sourceMappingURL=style.d.ts.map
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Immutable style descriptors — colors, text attributes, links, metadata.
3
3
  */
4
- import { ColorRgba, ColorSpec, } from "./color.js";
5
- import { stripOscTerminators } from "./sanitize.js";
4
+ import { COLOR_NAMES, ColorRgba, ColorSpec, } from "./color.js";
5
+ import { OSC8_CLOSE, osc8Open } from "./osc8.js";
6
6
  // [LAW:one-way-deps] `core/style` depends only on `core/color` and the leaf
7
- // `core/sanitize` (a dep-free utility module). The substrate fallback is the
7
+ // `core/osc8` (the link wire grammar). The substrate fallback is the
8
8
  // canonical canvas color (black), inlined to avoid pulling in any preset
9
9
  // theme constants. Preset themes live in `src/themes/` and depend on core,
10
10
  // never the reverse.
@@ -64,8 +64,8 @@ export const ATTRIBUTE_SHORT_ALIASES = {
64
64
  uu: "underline2",
65
65
  };
66
66
  export class StyleSyntaxError extends Error {
67
- constructor(message) {
68
- super(message);
67
+ constructor(message, options) {
68
+ super(message, options);
69
69
  this.name = "StyleSyntaxError";
70
70
  }
71
71
  }
@@ -315,57 +315,11 @@ export class Style {
315
315
  const codes = this.toSgrCodes(colorSystem);
316
316
  let result = codes.length > 0 ? `\x1b[${codes}m${text}\x1b[0m` : text;
317
317
  if (this.link) {
318
- // [LAW:types-are-the-program] OSC 8 emits with empty params so the
319
- // byte stream is a pure function of (style, text, colorSystem) — no
320
- // global counter, no construction-order dependence. Tradeoff: terminals
321
- // can no longer hover-group non-adjacent same-URL spans (when linked
322
- // segments are separated by other content, each becomes its own OSC 8
323
- // pair instead of sharing an id). The coalescer in render.ts already
324
- // merges adjacent same-link runs into one wrap, so the common case is
325
- // unaffected; non-adjacent hover-grouping is the intentional sacrifice.
326
- //
327
- // [LAW:single-enforcer] Wire-byte sanitization at the OSC 8 emit site
328
- // — paired with the same call in render.ts:segmentsToString so every
329
- // path that turns `Style.link` into bytes goes through one rule. Style
330
- // itself stays a faithful container (this.link is unchanged); only the
331
- // bytes going out the door are stripped.
332
- result = `\x1b]8;;${stripOscTerminators(this.link)}\x1b\\${result}\x1b]8;;\x1b\\`;
318
+ // [LAW:single-enforcer] One OSC 8 spelling, shared with segmentsToString.
319
+ result = `${osc8Open(this.link)}${result}${OSC8_CLOSE}`;
333
320
  }
334
321
  return result;
335
322
  }
336
- /**
337
- * Returns a CSS style string for HTML rendering.
338
- */
339
- getHtmlStyle(theme) {
340
- if (this.isNull)
341
- return "";
342
- const parts = [];
343
- if (this.color) {
344
- const triplet = this.color.getTruecolor(theme, true);
345
- parts.push(`color: ${triplet.hex}`);
346
- }
347
- if (this.bgcolor) {
348
- const triplet = this.bgcolor.getTruecolor(theme, false);
349
- parts.push(`background-color: ${triplet.hex}`);
350
- }
351
- if (this.bold)
352
- parts.push("font-weight: bold");
353
- if (this.italic)
354
- parts.push("font-style: italic");
355
- const decorations = [];
356
- if (this.underline)
357
- decorations.push("underline");
358
- if (this.strike)
359
- decorations.push("line-through");
360
- if (this.overline)
361
- decorations.push("overline");
362
- if (decorations.length > 0) {
363
- parts.push(`text-decoration: ${decorations.join(" ")}`);
364
- }
365
- if (this.dim)
366
- parts.push("opacity: 0.5");
367
- return parts.join("; ");
368
- }
369
323
  /**
370
324
  * Serializes to a canonical string that round-trips through `Style.parse()`.
371
325
  */
@@ -503,6 +457,80 @@ export class Theme {
503
457
  }
504
458
  // --- Parse helpers ---
505
459
  const ATTRIBUTE_SET = new Set(ATTRIBUTE_NAMES);
460
+ // The words each position of a definition can hold: a bare token is a keyword,
461
+ // an attribute or a colour name; `on` takes a colour name; `not` an attribute.
462
+ // The short aliases are left out, since `b` is no help to someone who typed
463
+ // `bolt` and a one-letter name sits one edit from every other short word.
464
+ // [LAW:one-source-of-truth] Derived from the lists the parser accepts from; the
465
+ // keywords are the three `parseStyleDefinition` reads before anything else.
466
+ const FOREGROUND_WORDS = ["not", "on", "link", ...ATTRIBUTE_NAMES, ...COLOR_NAMES];
467
+ /**
468
+ * Optimal string alignment distance: insertions, deletions, substitutions, and
469
+ * swaps of two neighbouring letters each cost one edit, so `cyna` is as near
470
+ * `cyan` as `rd` is to `red`. Kept to three rows, since only the two before the
471
+ * current one are ever read.
472
+ */
473
+ function editDistance(a, b) {
474
+ let before = [];
475
+ let previous = Array.from({ length: b.length + 1 }, (_, j) => j);
476
+ for (let i = 1; i <= a.length; i++) {
477
+ const current = [i];
478
+ for (let j = 1; j <= b.length; j++) {
479
+ const swap = i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1];
480
+ current[j] = Math.min(previous[j] + 1, current[j - 1] + 1, previous[j - 1] + Number(a[i - 1] !== b[j - 1]), swap ? before[j - 2] + 1 : Infinity);
481
+ }
482
+ [before, previous] = [previous, current];
483
+ }
484
+ return previous[b.length];
485
+ }
486
+ /**
487
+ * The ` (did you mean …?)` clause for a word no position accepted, or `""`
488
+ * when nothing in `words` is a plausible typo of it.
489
+ *
490
+ * Plausible means within one edit per three letters, at least one, which lets
491
+ * `rd` reach `red` and keeps `hello` from reaching `yellow`. Every name tied
492
+ * for nearest is offered: `gold` is one edit from `bold` and from three
493
+ * `goldN` colours, and choosing among them would be a guess the reader cannot
494
+ * tell from a finding. Case is not an edit, because the colour parser ignores
495
+ * it: `Cyna` is as near `cyan` as `cyna` is.
496
+ *
497
+ * This runs on every render that meets the bad style, since only successful
498
+ * parses are cached. Two words differ by at least their difference in length,
499
+ * so a name outside the budget on length alone is never measured — which is
500
+ * also what keeps a long garbage token from costing length × length per name.
501
+ */
502
+ function nearMiss(word, words) {
503
+ const typed = word.toLowerCase();
504
+ const budget = Math.max(1, Math.floor(typed.length / 3));
505
+ const scored = words
506
+ .filter((name) => Math.abs(name.length - typed.length) <= budget)
507
+ .map((name) => ({ name, distance: editDistance(typed, name) }));
508
+ const nearest = Math.min(budget, ...scored.map((s) => s.distance));
509
+ const names = scored
510
+ .filter((s) => s.distance === nearest)
511
+ .map((s) => `"${s.name}"`)
512
+ .sort();
513
+ return names.length === 0 ? "" : ` (did you mean ${names.join(" or ")}?)`;
514
+ }
515
+ /**
516
+ * A style token read as a colour. The colour parser's own error is the reason
517
+ * the token failed, so it rides along twice: in the message, for a reader with
518
+ * only the text, and as `cause`, for code that wants the original error.
519
+ *
520
+ * [LAW:single-enforcer] Both colour positions in a definition rewrap here, and
521
+ * the near miss is named here rather than by the colour parser: only a
522
+ * definition knows whether the token could also have been an attribute.
523
+ */
524
+ function parseStyleColor(token, failure, words) {
525
+ try {
526
+ return ColorSpec.parse(token);
527
+ }
528
+ catch (cause) {
529
+ throw new StyleSyntaxError(`${failure} "${token}"${nearMiss(token, words)}: ${String(cause)}`, {
530
+ cause,
531
+ });
532
+ }
533
+ }
506
534
  function parseStyleDefinition(definition) {
507
535
  const tokens = definition.split(/\s+/);
508
536
  const opts = {};
@@ -518,7 +546,7 @@ function parseStyleDefinition(definition) {
518
546
  }
519
547
  const attrName = ATTRIBUTE_SHORT_ALIASES[next] ?? next;
520
548
  if (!ATTRIBUTE_SET.has(attrName)) {
521
- throw new StyleSyntaxError(`Invalid attribute: "${next}"`);
549
+ throw new StyleSyntaxError(`Invalid attribute: "${next}"${nearMiss(next, ATTRIBUTE_NAMES)}`);
522
550
  }
523
551
  opts[attrName] = false;
524
552
  i++;
@@ -531,12 +559,7 @@ function parseStyleDefinition(definition) {
531
559
  if (!next) {
532
560
  throw new StyleSyntaxError(`Expected color after "on" in style definition`);
533
561
  }
534
- try {
535
- opts.bgcolor = ColorSpec.parse(next);
536
- }
537
- catch {
538
- throw new StyleSyntaxError(`Invalid background color: "${next}"`);
539
- }
562
+ opts.bgcolor = parseStyleColor(next, "Invalid background color", COLOR_NAMES);
540
563
  i++;
541
564
  continue;
542
565
  }
@@ -558,12 +581,7 @@ function parseStyleDefinition(definition) {
558
581
  continue;
559
582
  }
560
583
  // Must be a color
561
- try {
562
- opts.color = ColorSpec.parse(token);
563
- }
564
- catch {
565
- throw new StyleSyntaxError(`Invalid style definition: "${token}"`);
566
- }
584
+ opts.color = parseStyleColor(token, "Invalid style definition", FOREGROUND_WORDS);
567
585
  i++;
568
586
  }
569
587
  return new Style(opts);
@@ -713,4 +731,3 @@ export const DEFAULT_STYLES = {
713
731
  * a renderable sees outside a `Console`, as in `renderToString`.
714
732
  */
715
733
  export const DEFAULT_THEME = new Theme();
716
- //# sourceMappingURL=style.js.map
@@ -10,4 +10,3 @@
10
10
  * `widgets/types.ts` and the host seam was importing it from there.
11
11
  */
12
12
  export type Unsubscribe = () => void;
13
- //# sourceMappingURL=subscription.d.ts.map
@@ -10,4 +10,3 @@
10
10
  * `widgets/types.ts` and the host seam was importing it from there.
11
11
  */
12
12
  export {};
13
- //# sourceMappingURL=subscription.js.map
@@ -104,8 +104,7 @@ export declare class RichText implements Renderable, Measurable {
104
104
  setLength(length: number): this;
105
105
  extendStyle(count: number): this;
106
106
  /**
107
- * Truncate to a fixed cell-column width. Three modes, plus a back-compat
108
- * `overflow` form.
107
+ * Truncate to a fixed cell-column width, in one of three modes.
109
108
  *
110
109
  * - `mode: "right"` (default) \u2014 drop characters from the right; append
111
110
  * `marker` (if any) at the cut.
@@ -117,10 +116,6 @@ export declare class RichText implements Renderable, Measurable {
117
116
  * Marker default is `"\u2026"`. Pass `marker: ""` for raw cropping without an
118
117
  * indicator glyph.
119
118
  *
120
- * Legacy form: `{ overflow: "ellipsis" }` is equivalent to
121
- * `{ mode: "right", marker: "\u2026" }`; `{ overflow: "crop" | "fold" }` is
122
- * equivalent to `{ marker: "" }`.
123
- *
124
119
  * Spans are preserved through the cut: characters that survive keep their
125
120
  * styling; the marker (if any) is inserted as plain text with no span.
126
121
  * Use `stylize(...)` on the result to color the marker if needed.
@@ -130,7 +125,6 @@ export declare class RichText implements Renderable, Measurable {
130
125
  * branch \u2014 the unchanged path just early-returns when content fits.
131
126
  */
132
127
  truncate(width: number, options?: {
133
- overflow?: "fold" | "crop" | "ellipsis";
134
128
  mode?: "right" | "left" | "middle";
135
129
  marker?: string;
136
130
  }): this;
@@ -259,4 +253,3 @@ export declare class RichText implements Renderable, Measurable {
259
253
  */
260
254
  private _fitLine;
261
255
  }
262
- //# sourceMappingURL=text.d.ts.map
package/dist/core/text.js CHANGED
@@ -5,7 +5,7 @@ import { cellLen, cellCount } from "./cells.js";
5
5
  import { divideLine } from "./wrap.js";
6
6
  import { Segment } from "./segment.js";
7
7
  import { Style, NULL_STYLE, StyleSyntaxError } from "./style.js";
8
- import { stripOscTerminators } from "./sanitize.js";
8
+ import { stripOscTerminators } from "./osc8.js";
9
9
  import { getStyle, withBoundedWidth } from "./protocol.js";
10
10
  // Strip control characters except \t and \n
11
11
  // [LAW:single-enforcer] Single place where control chars are sanitized
@@ -76,21 +76,29 @@ function isEmptyStyle(style) {
76
76
  /**
77
77
  * The style a stored `string | Style` stands for in this render.
78
78
  *
79
+ * A parsed string can carry a link, so the result is sanitized on the way out
80
+ * as well.
81
+ */
82
+ function resolveStyle(options, style) {
83
+ return sanitizeStyleLink(style instanceof Style ? style : resolveDefinition(options, style));
84
+ }
85
+ /**
79
86
  * [LAW:single-enforcer] Styling is non-critical — an unrecognized style name
80
87
  * (typo, missing theme key, bad concatenation) degrades to unstyled rather
81
88
  * than crashing, as the reference's `Text.render` resolves with a null
82
89
  * default. Absorb only StyleSyntaxError here; other errors are genuine bugs
83
- * and must surface. A parsed string can carry a link, so the result is
84
- * sanitized on the way out as well.
90
+ * and must surface. The render's `onStyleError` hears about each one first,
91
+ * and a handler that throws turns the degrade into a failure.
85
92
  */
86
- function resolveStyle(options, style) {
93
+ function resolveDefinition(options, style) {
87
94
  try {
88
- return sanitizeStyleLink(getStyle(options, style));
95
+ return getStyle(options, style);
89
96
  }
90
97
  catch (err) {
91
- if (err instanceof StyleSyntaxError)
92
- return NULL_STYLE;
93
- throw err;
98
+ if (!(err instanceof StyleSyntaxError))
99
+ throw err;
100
+ options.onStyleError?.(err, style);
101
+ return NULL_STYLE;
94
102
  }
95
103
  }
96
104
  // --- Span ---
@@ -467,8 +475,7 @@ export class RichText {
467
475
  }
468
476
  // --- Truncation ---
469
477
  /**
470
- * Truncate to a fixed cell-column width. Three modes, plus a back-compat
471
- * `overflow` form.
478
+ * Truncate to a fixed cell-column width, in one of three modes.
472
479
  *
473
480
  * - `mode: "right"` (default) \u2014 drop characters from the right; append
474
481
  * `marker` (if any) at the cut.
@@ -480,10 +487,6 @@ export class RichText {
480
487
  * Marker default is `"\u2026"`. Pass `marker: ""` for raw cropping without an
481
488
  * indicator glyph.
482
489
  *
483
- * Legacy form: `{ overflow: "ellipsis" }` is equivalent to
484
- * `{ mode: "right", marker: "\u2026" }`; `{ overflow: "crop" | "fold" }` is
485
- * equivalent to `{ marker: "" }`.
486
- *
487
490
  * Spans are preserved through the cut: characters that survive keep their
488
491
  * styling; the marker (if any) is inserted as plain text with no span.
489
492
  * Use `stylize(...)` on the result to color the marker if needed.
@@ -495,15 +498,8 @@ export class RichText {
495
498
  truncate(width, options) {
496
499
  if (this.cellLength <= width)
497
500
  return this;
498
- const overflow = options?.overflow;
499
501
  const mode = options?.mode ?? "right";
500
- const marker = options?.marker !== undefined
501
- ? options.marker
502
- : overflow === "ellipsis"
503
- ? "\u2026"
504
- : overflow === undefined && options?.mode !== undefined
505
- ? "\u2026"
506
- : "";
502
+ const marker = options?.marker ?? "\u2026";
507
503
  const markerWidth = cellLen(marker);
508
504
  if (width <= 0) {
509
505
  this.plain = "";
@@ -697,11 +693,6 @@ export class RichText {
697
693
  // --- Renderable ---
698
694
  *render(options) {
699
695
  const text = this._expandTabs(this._text);
700
- if (text.length === 0) {
701
- if (this._end)
702
- yield new Segment(this._end);
703
- return;
704
- }
705
696
  const base = this.resolvedStyle(options);
706
697
  const allSegments = this._buildSegments(text, base, options);
707
698
  const logicalLines = Segment.splitLines(allSegments);
@@ -744,7 +735,13 @@ export class RichText {
744
735
  }
745
736
  }
746
737
  }
747
- if (this._end && this._end !== "\n") {
738
+ // [LAW:single-enforcer] The one place `end` is emitted, for empty and
739
+ // non-empty text alike — the pre-fix code checked it once for empty text
740
+ // (truthy) and again for non-empty text (truthy and not the default
741
+ // "\n"), which gave `end` two meanings depending on whether the text was
742
+ // empty (rich-text-5ai). Empty text takes zero iterations of the loop
743
+ // above, so this is reached either way with nothing yielded but this.
744
+ if (this._end) {
748
745
  yield new Segment(this._end);
749
746
  }
750
747
  }
@@ -990,4 +987,3 @@ export class RichText {
990
987
  yield* Segment.adjustLineLength(line, maxWidth, undefined, false);
991
988
  }
992
989
  }
993
- //# sourceMappingURL=text.js.map
@@ -39,4 +39,3 @@ import { type CellCol } from "./cells.js";
39
39
  export declare function divideLine(text: string, width: CellCol, options: {
40
40
  fold: boolean;
41
41
  }): CellCol[];
42
- //# sourceMappingURL=wrap.d.ts.map
package/dist/core/wrap.js CHANGED
@@ -125,4 +125,3 @@ export function divideLine(text, width, options) {
125
125
  }
126
126
  return cuts;
127
127
  }
128
- //# sourceMappingURL=wrap.js.map
@@ -28,4 +28,3 @@ import type { TerminalHost } from "./terminal-host.js";
28
28
  * defeats the point.
29
29
  */
30
30
  export declare function hostStream(host: TerminalHost): ConsoleSink;
31
- //# sourceMappingURL=host-stream.d.ts.map
@@ -33,4 +33,3 @@ export function hostStream(host) {
33
33
  },
34
34
  };
35
35
  }
36
- //# sourceMappingURL=host-stream.js.map
@@ -1,4 +1,3 @@
1
1
  export { BrowserTerminalHost } from "./terminal-host.js";
2
2
  export type { TerminalHost, TerminalSize, DataHandler, ResizeHandler, BrowserTerminalHostOptions, XtermTerminal, XtermDisposable, XtermResizeEvent, } from "./terminal-host.js";
3
3
  export { hostStream } from "./host-stream.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { BrowserTerminalHost } from "./terminal-host.js";
2
2
  export { hostStream } from "./host-stream.js";
3
- //# sourceMappingURL=index.js.map
@@ -141,4 +141,3 @@ export declare class BrowserTerminalHost implements TerminalHost {
141
141
  start(): void;
142
142
  stop(): void;
143
143
  }
144
- //# sourceMappingURL=terminal-host.d.ts.map
@@ -130,4 +130,3 @@ export class BrowserTerminalHost {
130
130
  this.resizeHandlers.clear();
131
131
  }
132
132
  }
133
- //# sourceMappingURL=terminal-host.js.map
package/dist/index.d.ts CHANGED
@@ -23,7 +23,7 @@ export { Box } from "./core/box.js";
23
23
  export type { EdgeChars, ContentChars, RowLevel, SubstituteOptions } from "./core/box.js";
24
24
  export { ASCII, ASCII2, ASCII_DOUBLE_HEAD, SQUARE, SQUARE_DOUBLE_HEAD, MINIMAL, MINIMAL_HEAVY_HEAD, MINIMAL_DOUBLE_HEAD, SIMPLE, SIMPLE_HEAD, SIMPLE_HEAVY, HORIZONTALS, ROUNDED, HEAVY, HEAVY_EDGE, HEAVY_HEAD, DOUBLE, DOUBLE_EDGE, MARKDOWN, } from "./core/box.js";
25
25
  export { isRenderable, isMeasurable, withCellWidth, withBoundedWidth, } from "./core/protocol.js";
26
- export type { RenderOptions, Renderable, Measurable, } from "./core/protocol.js";
26
+ export type { RenderOptions, Renderable, Measurable, StyleErrorHandler, } from "./core/protocol.js";
27
27
  export type { Unsubscribe } from "./core/subscription.js";
28
28
  export { Measurement, measureRenderables } from "./core/measure.js";
29
29
  export { Span, RichText } from "./core/text.js";
@@ -32,10 +32,12 @@ export { Strip, PowerlineJoiner, CapsuleJoiner, PlainJoiner, GradientJoiner, } f
32
32
  export type { StyledRenderable, Joiner, PowerlineJoinerOptions, CapsuleJoinerOptions, PlainJoinerOptions, GradientJoinerOptions, } from "./core/strip.js";
33
33
  export { renderToString, segmentToString, segmentsToString, } from "./core/render.js";
34
34
  export type { RenderToStringOptions } from "./core/render.js";
35
+ export { OSC8, osc8Sequences } from "./core/osc8.js";
36
+ export type { Osc8Sequence } from "./core/osc8.js";
35
37
  export { MarkupRegistry, globalMarkupRegistry, renderMarkup, } from "./core/markup.js";
36
38
  export type { MarkupTagContext, MarkupTagHandler, RenderMarkupOptions, } from "./core/markup.js";
37
39
  export { EMOJI, emojiReplace, Emoji, NoEmoji } from "./core/emoji.js";
38
- export { MarkupError, escape as escapeMarkup } from "./core/markup.js";
40
+ export { MarkupError, MarkupSyntaxError, escape as escapeMarkup } from "./core/markup.js";
39
41
  export { Highlighter, NullHighlighter, RegexHighlighter, ReprHighlighter, JSONHighlighter, ISO8601Highlighter, } from "./core/highlighter.js";
40
42
  export { Pretty } from "./core/pretty.js";
41
43
  export type { PrettyOptions } from "./core/pretty.js";
@@ -83,4 +85,3 @@ export { Markdown } from "./renderables/markdown.js";
83
85
  export type { MarkdownOptions } from "./renderables/markdown.js";
84
86
  export { Layout } from "./renderables/layout.js";
85
87
  export type { LayoutOptions } from "./renderables/layout.js";
86
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -41,12 +41,14 @@ export { Span, RichText } from "./core/text.js";
41
41
  export { Strip, PowerlineJoiner, CapsuleJoiner, PlainJoiner, GradientJoiner, } from "./core/strip.js";
42
42
  // renderToString — stateless one-shot emission
43
43
  export { renderToString, segmentToString, segmentsToString, } from "./core/render.js";
44
+ // OSC 8 hyperlink wire grammar — for consumers that read rendered bytes back
45
+ export { OSC8, osc8Sequences } from "./core/osc8.js";
44
46
  // Markup plugin tags
45
47
  export { MarkupRegistry, globalMarkupRegistry, renderMarkup, } from "./core/markup.js";
46
48
  // Emoji
47
49
  export { EMOJI, emojiReplace, Emoji, NoEmoji } from "./core/emoji.js";
48
50
  // Markup
49
- export { MarkupError, escape as escapeMarkup } from "./core/markup.js";
51
+ export { MarkupError, MarkupSyntaxError, escape as escapeMarkup } from "./core/markup.js";
50
52
  // Highlighter
51
53
  export { Highlighter, NullHighlighter, RegexHighlighter, ReprHighlighter, JSONHighlighter, ISO8601Highlighter, } from "./core/highlighter.js";
52
54
  // Pretty
@@ -100,4 +102,3 @@ export { Layout } from "./renderables/layout.js";
100
102
  //
101
103
  // This is also why there is no widget list here to keep in sync: `src/widgets/index.ts`
102
104
  // is that list, and a copy of it in this file would be a second one to drift from.
103
- //# sourceMappingURL=index.js.map
@@ -19,4 +19,3 @@
19
19
  */
20
20
  import type { PromptInput } from "../renderables/prompt.js";
21
21
  export declare const nodeAsk: PromptInput;
22
- //# sourceMappingURL=prompt.d.ts.map
@@ -28,4 +28,3 @@ export const nodeAsk = (prompt) => new Promise((resolve) => {
28
28
  resolve(answer);
29
29
  });
30
30
  });
31
- //# sourceMappingURL=prompt.js.map
@@ -13,10 +13,5 @@
13
13
  * the IO sink.
14
14
  */
15
15
  import type { Console } from "../core/console.js";
16
- export declare function saveText(out: Console, path: string, options?: {
17
- clear?: boolean;
18
- }): void;
19
- export declare function saveHtml(out: Console, path: string, options?: {
20
- clear?: boolean;
21
- }): void;
22
- //# sourceMappingURL=save.d.ts.map
16
+ export declare function saveText(out: Console, path: string, options?: Parameters<Console["exportText"]>[0]): void;
17
+ export declare function saveHtml(out: Console, path: string, options?: Parameters<Console["exportHtml"]>[0]): void;
package/dist/node/save.js CHANGED
@@ -19,4 +19,3 @@ export function saveText(out, path, options) {
19
19
  export function saveHtml(out, path, options) {
20
20
  writeFileSync(path, out.exportHtml(options), "utf-8");
21
21
  }
22
- //# sourceMappingURL=save.js.map
@@ -82,4 +82,3 @@ export declare class NodeTerminalHost implements TerminalHost {
82
82
  stop(): void;
83
83
  }
84
84
  export {};
85
- //# sourceMappingURL=terminal-host.d.ts.map
@@ -158,4 +158,3 @@ export class NodeTerminalHost {
158
158
  }
159
159
  }
160
160
  }
161
- //# sourceMappingURL=terminal-host.js.map
@@ -25,4 +25,3 @@ import type { TracebackOptions } from "../renderables/traceback.js";
25
25
  * renderer no matter how many entry points reach for it.
26
26
  */
27
27
  export declare function installTraceback(options?: TracebackOptions): void;
28
- //# sourceMappingURL=traceback.d.ts.map