@alchemy.run/sigil 0.0.0-alpha.3 → 0.0.0-alpha.5

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 (207) hide show
  1. package/README.md +23 -13
  2. package/THIRD_PARTY_NOTICES.md +70 -23
  3. package/dist/Text-D5HUf3Fj.d.ts +452 -0
  4. package/dist/ansi.d.ts +137 -143
  5. package/dist/ansi.js +87 -2
  6. package/dist/capabilities.d.ts +5 -0
  7. package/dist/capabilities.js +3 -0
  8. package/dist/cell-_ZVhbfl0.js +44 -0
  9. package/dist/color-CkbalRqK.js +2 -0
  10. package/dist/color-policy-BMzMwV7Q.d.ts +22 -0
  11. package/dist/color-policy-SVj1pYTA.js +560 -0
  12. package/dist/color-profile-DHhQHY55.js +36 -0
  13. package/dist/color-profile-u0Nhe9Nv.d.ts +97 -0
  14. package/dist/color.d.ts +21 -0
  15. package/dist/color.js +3 -0
  16. package/dist/cursor-position-D2LAkRG0.d.ts +7 -0
  17. package/dist/detect-Bh4yGP6w.d.ts +186 -0
  18. package/dist/detect-BuTXtY6e.js +373 -0
  19. package/dist/{devtools-BhYGjb7h.js → devtools-DbthxoD1.js} +22 -23
  20. package/dist/env-YVw64yZS.js +9 -0
  21. package/dist/escapes-CB_6CWOE.d.ts +72 -0
  22. package/dist/geometry-BxXOzJgo.d.ts +11 -0
  23. package/dist/index-Bmc2tRPk.d.ts +21 -0
  24. package/dist/index.d.ts +235 -754
  25. package/dist/index.js +1362 -3001
  26. package/dist/osc-CCH7xDoS.js +71 -0
  27. package/dist/osc-Cn0fw77g.d.ts +23 -0
  28. package/dist/paint-C19minOS.d.ts +81 -0
  29. package/dist/query-vaIeGOkH.d.ts +152 -0
  30. package/dist/router.d.ts +392 -0
  31. package/dist/router.js +709 -0
  32. package/dist/sample-Cqw1bjUL.js +445 -0
  33. package/dist/screen-BOh__-65.js +324 -0
  34. package/dist/screen-BReKIheE.d.ts +40 -0
  35. package/dist/screen.d.ts +5 -0
  36. package/dist/screen.js +5 -0
  37. package/dist/semantic-text-style-DIMzC7xt.js +91 -0
  38. package/dist/serialize-BTkAZgw1.js +79 -0
  39. package/dist/session-BJmzX2NJ.js +664 -0
  40. package/dist/sgr-BhwaWAJB.js +246 -0
  41. package/dist/store-CgrG9K4y.d.ts +72 -0
  42. package/dist/string-width-CijQwpIk.js +69 -0
  43. package/dist/strip-BvU4toXG.js +6 -0
  44. package/dist/terminal.d.ts +118 -0
  45. package/dist/terminal.js +2 -0
  46. package/dist/tokenize-AjqbvtiT.js +1242 -0
  47. package/dist/tokenize-Dx1y_l5H.d.ts +57 -0
  48. package/dist/truncate-D31fhU6i.js +562 -0
  49. package/dist/use-focus-C2sciZOo.js +1335 -0
  50. package/package.json +43 -17
  51. package/src/ansi/chalk.ts +12 -53
  52. package/src/ansi/cursor.ts +2 -4
  53. package/src/ansi/east-asian-width.ts +44 -0
  54. package/src/ansi/escapes.ts +18 -26
  55. package/src/ansi/graphemes.ts +8 -0
  56. package/src/ansi/hyperlink.ts +44 -0
  57. package/src/ansi/index.ts +14 -14
  58. package/src/ansi/osc.ts +77 -0
  59. package/src/ansi/sgr.ts +2 -5
  60. package/src/ansi/slice.ts +1 -1
  61. package/src/ansi/string-width.ts +91 -206
  62. package/src/ansi/strip.ts +13 -33
  63. package/src/ansi/tokenize.ts +96 -169
  64. package/src/ansi/truncate.ts +5 -3
  65. package/src/ansi/wrap.ts +13 -14
  66. package/src/ansi-tokenizer.ts +1 -1
  67. package/src/capabilities/color-policy.ts +34 -0
  68. package/src/capabilities/detect.ts +594 -0
  69. package/src/capabilities/index.ts +37 -0
  70. package/src/capabilities/query.ts +657 -0
  71. package/src/capabilities/store.ts +379 -0
  72. package/src/color/index.ts +3 -0
  73. package/src/color/paint.ts +169 -0
  74. package/src/color/palette.ts +48 -0
  75. package/src/color/sample.ts +323 -0
  76. package/src/color.ts +1 -0
  77. package/src/components/AnsiText.tsx +42 -0
  78. package/src/components/App.tsx +109 -22
  79. package/src/components/BackgroundContext.ts +2 -3
  80. package/src/components/Box.tsx +43 -60
  81. package/src/components/CursorContext.ts +1 -1
  82. package/src/components/ErrorBoundary.tsx +1 -1
  83. package/src/components/ErrorOverview.tsx +8 -7
  84. package/src/components/Hyperlink.tsx +56 -0
  85. package/src/components/Spacer.tsx +1 -1
  86. package/src/components/Static.tsx +1 -1
  87. package/src/components/StderrContext.ts +0 -2
  88. package/src/components/StdinContext.ts +0 -1
  89. package/src/components/StdoutContext.ts +1 -3
  90. package/src/components/TerminalOscContext.ts +25 -0
  91. package/src/components/Text.tsx +23 -46
  92. package/src/components/Transform.tsx +2 -2
  93. package/src/cursor-position.ts +1 -1
  94. package/src/devtools.ts +84 -24
  95. package/src/dom.ts +11 -8
  96. package/src/env.ts +12 -0
  97. package/src/get-max-width.ts +1 -1
  98. package/src/global.d.ts +6 -4
  99. package/src/{boxes.ts → glyphs.ts} +17 -18
  100. package/src/hooks/use-animation.ts +1 -1
  101. package/src/hooks/use-app.ts +1 -1
  102. package/src/hooks/use-box-metrics.ts +1 -1
  103. package/src/hooks/use-capabilities.ts +73 -0
  104. package/src/hooks/use-cursor.ts +3 -3
  105. package/src/hooks/use-focus-manager.ts +1 -1
  106. package/src/hooks/use-focus.ts +5 -6
  107. package/src/hooks/use-input.ts +4 -4
  108. package/src/hooks/use-is-screen-reader-enabled.ts +1 -1
  109. package/src/hooks/use-paste.ts +2 -2
  110. package/src/hooks/use-stderr.ts +1 -1
  111. package/src/hooks/use-stdin.ts +1 -1
  112. package/src/hooks/use-stdout.ts +1 -1
  113. package/src/hooks/use-terminal-osc.ts +59 -0
  114. package/src/hooks/use-window-size.ts +2 -2
  115. package/src/index.ts +88 -44
  116. package/src/ink.tsx +620 -745
  117. package/src/input-parser.ts +1 -1
  118. package/src/instances.ts +1 -1
  119. package/src/kitty-keyboard.ts +128 -0
  120. package/src/measure-element.ts +1 -1
  121. package/src/measure-text.ts +2 -2
  122. package/src/{render-node-to-output.ts → paint-tree.ts} +78 -53
  123. package/src/parse-keypress.ts +4 -5
  124. package/src/parse-stack-line.ts +0 -1
  125. package/src/patch-console.ts +44 -0
  126. package/src/reconciler.ts +36 -62
  127. package/src/render-background.ts +37 -16
  128. package/src/render-border.ts +97 -64
  129. package/src/render-frame.ts +83 -0
  130. package/src/render-to-string.ts +24 -9
  131. package/src/render.ts +24 -16
  132. package/src/router/components.tsx +343 -0
  133. package/src/router/context.ts +41 -0
  134. package/src/router/history.ts +194 -0
  135. package/src/router/hooks.tsx +391 -0
  136. package/src/router/index.ts +34 -0
  137. package/src/router/matcher.ts +571 -0
  138. package/src/sanitize-ansi.ts +1 -1
  139. package/src/screen/ansi.ts +184 -0
  140. package/src/screen/canvas.ts +137 -0
  141. package/src/screen/cell.ts +138 -0
  142. package/src/screen/color-profile.ts +47 -0
  143. package/src/screen/geometry.ts +9 -0
  144. package/src/screen/index.ts +6 -0
  145. package/src/screen/screen.ts +272 -0
  146. package/src/screen/serialize.ts +129 -0
  147. package/src/screen.ts +1 -0
  148. package/src/semantic-text-style.ts +118 -0
  149. package/src/signal-exit.ts +4 -5
  150. package/src/squash-text-nodes.ts +4 -7
  151. package/src/stream.ts +2 -4
  152. package/src/structured-text.ts +321 -0
  153. package/src/styles.ts +16 -17
  154. package/src/terminal/index.ts +2 -0
  155. package/src/terminal/inline-presenter.ts +120 -0
  156. package/src/terminal/input.ts +86 -0
  157. package/src/terminal/render-scheduler.ts +37 -0
  158. package/src/terminal/screen-presenter.ts +188 -0
  159. package/src/terminal/session.ts +407 -0
  160. package/src/terminal-size.ts +9 -8
  161. package/src/terminal.ts +1 -0
  162. package/src/testing/browser.ts +588 -0
  163. package/src/testing/emulators.ts +205 -0
  164. package/src/testing/explorer-app/index.html +12 -0
  165. package/src/testing/explorer-app/main.ts +381 -0
  166. package/src/testing/explorer-app/style.css +194 -0
  167. package/src/testing/explorer-app/tsconfig.json +15 -0
  168. package/src/testing/explorer-app/vite-env.d.ts +1 -0
  169. package/src/testing/index.ts +26 -0
  170. package/src/testing/keys.ts +56 -0
  171. package/src/testing/live.ts +85 -0
  172. package/src/testing/matchers.ts +70 -0
  173. package/src/testing/public.ts +94 -0
  174. package/src/testing/terminal.ts +349 -0
  175. package/src/testing/vitest.ts +157 -0
  176. package/src/transform-adapter.ts +14 -0
  177. package/src/types.ts +1 -6
  178. package/src/utils.ts +2 -2
  179. package/src/wrap-text.ts +4 -4
  180. package/src/yoga/config.ts +2 -2
  181. package/src/yoga/core/absoluteLayout.ts +15 -15
  182. package/src/yoga/core/baseline.ts +3 -3
  183. package/src/yoga/core/cache.ts +4 -4
  184. package/src/yoga/core/calculateLayout.ts +33 -27
  185. package/src/yoga/core/config.ts +1 -1
  186. package/src/yoga/core/flexLine.ts +3 -3
  187. package/src/yoga/core/helpers.ts +3 -3
  188. package/src/yoga/core/layoutResults.ts +4 -4
  189. package/src/yoga/core/node.ts +16 -16
  190. package/src/yoga/core/pixelGrid.ts +4 -4
  191. package/src/yoga/core/style.ts +11 -11
  192. package/src/yoga/core/types.ts +2 -2
  193. package/src/yoga/index.ts +6 -6
  194. package/src/yoga/node.ts +8 -8
  195. package/dist/sgr-CMfEpjSk.d.ts +0 -91
  196. package/dist/truncate-CBiyyZzw.js +0 -2156
  197. package/src/ansi/supports-color.ts +0 -213
  198. package/src/ansi/widest-line.ts +0 -12
  199. package/src/auto-bind.ts +0 -41
  200. package/src/colorize.ts +0 -60
  201. package/src/devtools-window-polyfill.ts +0 -73
  202. package/src/indent-string.ts +0 -16
  203. package/src/is-in-ci.ts +0 -7
  204. package/src/log-update.ts +0 -370
  205. package/src/output.ts +0 -308
  206. package/src/renderer.ts +0 -73
  207. package/src/write-synchronized.ts +0 -9
@@ -0,0 +1,72 @@
1
+ //#region src/ansi/escapes.d.ts
2
+ declare const ESC = "";
3
+ declare const BEL = "";
4
+ declare const DEL = "";
5
+ /** Control Sequence Introducer. */
6
+ declare const CSI = "[";
7
+ /** Operating System Command. */
8
+ declare const OSC = "]";
9
+ /** String Terminator. */
10
+ declare const ST = "\\";
11
+ /** Single-byte C1 forms of CSI and ST. */
12
+ declare const C1_CSI = "›";
13
+ declare const C1_ST = "œ";
14
+ declare const cursorTo: (x: number, y?: number) => string;
15
+ declare const cursorUp: (count?: number) => string;
16
+ declare const cursorDown: (count?: number) => string;
17
+ declare const cursorLeft: string;
18
+ declare const cursorNextLine: string;
19
+ declare const eraseEndLine: string;
20
+ declare const eraseLine: string;
21
+ declare const eraseScreen: string;
22
+ declare const eraseLines: (count: number) => string;
23
+ declare const clearTerminal = "";
24
+ declare const enterAlternativeScreen: string;
25
+ declare const exitAlternativeScreen: string;
26
+ declare const cursorShow: string;
27
+ declare const cursorHide: string;
28
+ type CursorShape = "block" | "underline" | "bar";
29
+ declare const cursorShape: (shape: CursorShape, blinking?: boolean) => string;
30
+ declare const cursorColor: (color: string) => string;
31
+ declare const resetCursorColor = "]112";
32
+ declare const enableBracketedPaste: string;
33
+ declare const disableBracketedPaste: string;
34
+ declare const pasteStart: string;
35
+ declare const pasteEnd: string;
36
+ declare const bsu: string;
37
+ declare const esu: string;
38
+ declare const kittyQuery: string;
39
+ declare const pushKittyKeyboard: (flags: number) => string;
40
+ declare const popKittyKeyboard: string;
41
+ declare const link: (text: string, url: string) => string;
42
+ declare const ansiEscapes: {
43
+ cursorTo: typeof cursorTo;
44
+ cursorUp: typeof cursorUp;
45
+ cursorDown: typeof cursorDown;
46
+ cursorLeft: string;
47
+ cursorNextLine: string;
48
+ eraseEndLine: string;
49
+ eraseLine: string;
50
+ eraseScreen: string;
51
+ eraseLines: typeof eraseLines;
52
+ clearTerminal: string;
53
+ enterAlternativeScreen: string;
54
+ exitAlternativeScreen: string;
55
+ cursorShow: string;
56
+ cursorHide: string;
57
+ cursorShape: typeof cursorShape;
58
+ cursorColor: typeof cursorColor;
59
+ resetCursorColor: string;
60
+ enableBracketedPaste: string;
61
+ disableBracketedPaste: string;
62
+ pasteStart: string;
63
+ pasteEnd: string;
64
+ bsu: string;
65
+ esu: string;
66
+ kittyQuery: string;
67
+ pushKittyKeyboard: typeof pushKittyKeyboard;
68
+ popKittyKeyboard: string;
69
+ link: typeof link;
70
+ };
71
+ //#endregion
72
+ export { exitAlternativeScreen as A, enableBracketedPaste as C, eraseLines as D, eraseLine as E, popKittyKeyboard as F, pushKittyKeyboard as I, resetCursorColor as L, link as M, pasteEnd as N, eraseScreen as O, pasteStart as P, disableBracketedPaste as S, eraseEndLine as T, cursorNextLine as _, CursorShape as a, cursorTo as b, OSC as c, bsu as d, clearTerminal as f, cursorLeft as g, cursorHide as h, CSI as i, kittyQuery as j, esu as k, ST as l, cursorDown as m, C1_CSI as n, DEL as o, cursorColor as p, C1_ST as r, ESC as s, BEL as t, ansiEscapes as u, cursorShape as v, enterAlternativeScreen as w, cursorUp as x, cursorShow as y };
@@ -0,0 +1,11 @@
1
+ //#region src/screen/geometry.d.ts
2
+ type Point = {
3
+ readonly x: number;
4
+ readonly y: number;
5
+ };
6
+ type Rect = Point & {
7
+ readonly width: number;
8
+ readonly height: number;
9
+ };
10
+ //#endregion
11
+ export { Rect as n, Point as t };
@@ -0,0 +1,21 @@
1
+ import { a as StyledChar } from "./tokenize-Dx1y_l5H.js";
2
+ import { i as Cell, t as ColorProfile } from "./color-profile-u0Nhe9Nv.js";
3
+ import { n as Screen, t as Line } from "./screen-BReKIheE.js";
4
+ //#region src/screen/ansi.d.ts
5
+ /** Converts the renderer's canonical ANSI state into backend-neutral cells. */
6
+ declare function cellsFromAnsi(text: string): Cell[];
7
+ declare function cellFromStyledChar(character: StyledChar, width?: number): Cell;
8
+ //#endregion
9
+ //#region src/screen/serialize.d.ts
10
+ type SerializeOptions = {
11
+ readonly colorProfile: ColorProfile;
12
+ readonly trimEnd?: boolean;
13
+ readonly styles?: boolean;
14
+ };
15
+ /** Serializes one structured cell run with minimal style transitions. */
16
+ declare function serializeLine(line: Line, options: SerializeOptions): string;
17
+ declare function serializeScreen(screen: Screen, options: SerializeOptions): string;
18
+ /** Converts a semantic cell to the canonical ANSI compatibility style state. */
19
+ declare function styledCharFromCell(cell: Cell, profile: ColorProfile, styles?: boolean): StyledChar;
20
+ //#endregion
21
+ export { cellFromStyledChar as a, styledCharFromCell as i, serializeLine as n, cellsFromAnsi as o, serializeScreen as r, SerializeOptions as t };