@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
@@ -4,26 +4,10 @@
4
4
  // Port of yoga/algorithm/CalculateLayout.cpp. The event system and
5
5
  // LayoutPassReason-keyed instrumentation are reduced to plain counters.
6
6
 
7
- import {
8
- Align,
9
- Dimension,
10
- Direction,
11
- Display,
12
- Edge,
13
- Errata,
14
- ExperimentalFeature,
15
- FlexDirection,
16
- Gutter,
17
- Justify,
18
- MeasureMode,
19
- Overflow,
20
- PositionType,
21
- Wrap,
22
- } from "../generated/YGEnums.ts";
23
- import { layoutAbsoluteDescendants } from "./absoluteLayout.ts";
24
- import { calculateBaseline, isBaselineLayout } from "./baseline.ts";
25
- import { canUseCachedMeasurement } from "./cache.ts";
26
- import { type FlexLine, calculateFlexLine } from "./flexLine.ts";
7
+ import { layoutAbsoluteDescendants } from "#/yoga/core/absoluteLayout.ts";
8
+ import { calculateBaseline, isBaselineLayout } from "#/yoga/core/baseline.ts";
9
+ import { canUseCachedMeasurement } from "#/yoga/core/cache.ts";
10
+ import { type FlexLine, calculateFlexLine } from "#/yoga/core/flexLine.ts";
27
11
  import {
28
12
  PhysicalEdge,
29
13
  SizingMode,
@@ -42,13 +26,35 @@ import {
42
26
  resolveCrossDirection,
43
27
  resolveDirection,
44
28
  setChildTrailingPosition,
45
- } from "./helpers.ts";
46
- import { CachedMeasurement, LayoutResults } from "./layoutResults.ts";
47
- import type { Node } from "./node.ts";
48
- import { isDefined, isUndefined, inexactEquals, maxOrDefined, minOrDefined } from "./numeric.ts";
49
- import { roundLayoutResultsToPixelGrid } from "./pixelGrid.ts";
50
- import type { Style } from "./style.ts";
51
- import type { StyleLength } from "./types.ts";
29
+ } from "#/yoga/core/helpers.ts";
30
+ import { CachedMeasurement, LayoutResults } from "#/yoga/core/layoutResults.ts";
31
+ import type { Node } from "#/yoga/core/node.ts";
32
+ import {
33
+ isDefined,
34
+ isUndefined,
35
+ inexactEquals,
36
+ maxOrDefined,
37
+ minOrDefined,
38
+ } from "#/yoga/core/numeric.ts";
39
+ import { roundLayoutResultsToPixelGrid } from "#/yoga/core/pixelGrid.ts";
40
+ import type { Style } from "#/yoga/core/style.ts";
41
+ import type { StyleLength } from "#/yoga/core/types.ts";
42
+ import {
43
+ Align,
44
+ Dimension,
45
+ Direction,
46
+ Display,
47
+ Edge,
48
+ Errata,
49
+ ExperimentalFeature,
50
+ FlexDirection,
51
+ Gutter,
52
+ Justify,
53
+ MeasureMode,
54
+ Overflow,
55
+ PositionType,
56
+ Wrap,
57
+ } from "#/yoga/generated/YGEnums.ts";
52
58
 
53
59
  export const LayoutPassReason = {
54
60
  Initial: 0,
@@ -3,7 +3,7 @@
3
3
 
4
4
  // Port of yoga/config/Config.h and yoga/config/Config.cpp.
5
5
 
6
- import { Errata, ExperimentalFeature } from "../generated/YGEnums.ts";
6
+ import { Errata, ExperimentalFeature } from "#/yoga/generated/YGEnums.ts";
7
7
 
8
8
  // Whether moving a node from an old to new config should dirty previously
9
9
  // calculated layout results.
@@ -8,9 +8,9 @@
8
8
  // receives the start index, returning the index of the first child of the next
9
9
  // line alongside the line itself.
10
10
 
11
- import { Direction, Display, PositionType, Wrap } from "../generated/YGEnums.ts";
12
- import { boundAxisWithinMinAndMax, resolveDirection } from "./helpers.ts";
13
- import type { Node } from "./node.ts";
11
+ import { boundAxisWithinMinAndMax, resolveDirection } from "#/yoga/core/helpers.ts";
12
+ import type { Node } from "#/yoga/core/node.ts";
13
+ import { Direction, Display, PositionType, Wrap } from "#/yoga/generated/YGEnums.ts";
14
14
 
15
15
  export interface FlexLineRunningLayout {
16
16
  // Total flex grow factors of flex items which are to be laid in the current
@@ -5,6 +5,8 @@
5
5
  // yoga/algorithm/SizingMode.h, yoga/algorithm/TrailingPosition.h and
6
6
  // yoga/algorithm/BoundAxis.h, plus the internal PhysicalEdge enum.
7
7
 
8
+ import type { Node } from "#/yoga/core/node.ts";
9
+ import { maxOrDefined } from "#/yoga/core/numeric.ts";
8
10
  import {
9
11
  Align,
10
12
  Dimension,
@@ -13,9 +15,7 @@ import {
13
15
  FlexDirection,
14
16
  Justify,
15
17
  MeasureMode,
16
- } from "../generated/YGEnums.ts";
17
- import type { Node } from "./node.ts";
18
- import { maxOrDefined } from "./numeric.ts";
18
+ } from "#/yoga/generated/YGEnums.ts";
19
19
 
20
20
  export const PhysicalEdge = {
21
21
  Left: 0,
@@ -3,10 +3,10 @@
3
3
 
4
4
  // Port of yoga/node/LayoutResults.h and yoga/node/CachedMeasurement.h.
5
5
 
6
- import { Dimension, Direction } from "../generated/YGEnums.ts";
7
- import type { FlexLine } from "./flexLine.ts";
8
- import { PhysicalEdge, SizingMode } from "./helpers.ts";
9
- import { isUndefined } from "./numeric.ts";
6
+ import type { FlexLine } from "#/yoga/core/flexLine.ts";
7
+ import { PhysicalEdge, SizingMode } from "#/yoga/core/helpers.ts";
8
+ import { isUndefined } from "#/yoga/core/numeric.ts";
9
+ import { Dimension, Direction } from "#/yoga/generated/YGEnums.ts";
10
10
 
11
11
  export class CachedMeasurement {
12
12
  availableWidth = -1;
@@ -8,6 +8,21 @@
8
8
  // callbacks) is not exposed through the JS binding, so children are always
9
9
  // uniquely owned and cloneChildrenIfNeeded is a no-op.
10
10
 
11
+ import { Config, configUpdateInvalidatesLayout, getDefaultConfig } from "#/yoga/core/config.ts";
12
+ import {
13
+ PhysicalEdge,
14
+ dimension,
15
+ inlineStartEdge,
16
+ inlineEndEdge,
17
+ isRow,
18
+ resolveCrossDirection,
19
+ resolveDirection,
20
+ } from "#/yoga/core/helpers.ts";
21
+ import { LayoutResults } from "#/yoga/core/layoutResults.ts";
22
+ import { isDefined, isUndefined, maxOrDefined } from "#/yoga/core/numeric.ts";
23
+ import { Style } from "#/yoga/core/style.ts";
24
+ import type { Size, StyleSizeLength } from "#/yoga/core/types.ts";
25
+ import { StyleSizeLength as SizeLength } from "#/yoga/core/types.ts";
11
26
  import {
12
27
  Align,
13
28
  BoxSizing,
@@ -18,22 +33,7 @@ import {
18
33
  MeasureMode,
19
34
  NodeType,
20
35
  PositionType,
21
- } from "../generated/YGEnums.ts";
22
- import { Config, configUpdateInvalidatesLayout, getDefaultConfig } from "./config.ts";
23
- import {
24
- PhysicalEdge,
25
- dimension,
26
- inlineStartEdge,
27
- inlineEndEdge,
28
- isRow,
29
- resolveCrossDirection,
30
- resolveDirection,
31
- } from "./helpers.ts";
32
- import { LayoutResults } from "./layoutResults.ts";
33
- import { isDefined, isUndefined, maxOrDefined } from "./numeric.ts";
34
- import { Style } from "./style.ts";
35
- import type { Size, StyleSizeLength } from "./types.ts";
36
- import { StyleSizeLength as SizeLength } from "./types.ts";
36
+ } from "#/yoga/generated/YGEnums.ts";
37
37
 
38
38
  export type MeasureFunc = (
39
39
  width: number,
@@ -3,10 +3,10 @@
3
3
 
4
4
  // Port of yoga/algorithm/PixelGrid.cpp.
5
5
 
6
- import { Dimension, NodeType } from "../generated/YGEnums.ts";
7
- import { PhysicalEdge } from "./helpers.ts";
8
- import type { Node } from "./node.ts";
9
- import { inexactEquals } from "./numeric.ts";
6
+ import { PhysicalEdge } from "#/yoga/core/helpers.ts";
7
+ import type { Node } from "#/yoga/core/node.ts";
8
+ import { inexactEquals } from "#/yoga/core/numeric.ts";
9
+ import { Dimension, NodeType } from "#/yoga/generated/YGEnums.ts";
10
10
 
11
11
  export function roundValueToPixelGrid(
12
12
  value: number,
@@ -4,6 +4,16 @@
4
4
  // Port of yoga/style/Style.h (grid properties omitted — the JS binding does
5
5
  // not expose them and no algorithm consumes them).
6
6
 
7
+ import {
8
+ PhysicalEdge,
9
+ flexStartEdge,
10
+ flexEndEdge,
11
+ inlineStartEdge,
12
+ inlineEndEdge,
13
+ isRow,
14
+ } from "#/yoga/core/helpers.ts";
15
+ import { isDefined, maxOrDefined } from "#/yoga/core/numeric.ts";
16
+ import { StyleLength, StyleSizeLength } from "#/yoga/core/types.ts";
7
17
  import {
8
18
  Align,
9
19
  BoxSizing,
@@ -18,17 +28,7 @@ import {
18
28
  PositionType,
19
29
  Unit,
20
30
  Wrap,
21
- } from "../generated/YGEnums.ts";
22
- import {
23
- PhysicalEdge,
24
- flexStartEdge,
25
- flexEndEdge,
26
- inlineStartEdge,
27
- inlineEndEdge,
28
- isRow,
29
- } from "./helpers.ts";
30
- import { isDefined, maxOrDefined } from "./numeric.ts";
31
- import { StyleLength, StyleSizeLength } from "./types.ts";
31
+ } from "#/yoga/generated/YGEnums.ts";
32
32
 
33
33
  const EDGE_COUNT = 9;
34
34
  const GUTTER_COUNT = 3;
@@ -3,8 +3,8 @@
3
3
 
4
4
  // Port of yoga/style/StyleLength.h and yoga/style/StyleSizeLength.h.
5
5
 
6
- import { Unit } from "../generated/YGEnums.ts";
7
- import { isUndefined, optionalEquals, inexactEquals } from "./numeric.ts";
6
+ import { isUndefined, optionalEquals, inexactEquals } from "#/yoga/core/numeric.ts";
7
+ import { Unit } from "#/yoga/generated/YGEnums.ts";
8
8
 
9
9
  function isInvalidValue(value: number): boolean {
10
10
  return isUndefined(value) || !Number.isFinite(value);
package/src/yoga/index.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
  // Derived from Yoga. See THIRD_PARTY_NOTICES.md.
3
3
 
4
- import { Config } from "./config.ts";
5
- import { constants as YGEnums } from "./generated/YGEnums.ts";
6
- import { Node } from "./node.ts";
4
+ import { Config } from "#/yoga/config.ts";
5
+ import { constants as YGEnums } from "#/yoga/generated/YGEnums.ts";
6
+ import { Node } from "#/yoga/node.ts";
7
7
 
8
- export type { Config } from "./config.ts";
9
- export type { DirtiedFunction, MeasureFunction, Node } from "./node.ts";
8
+ export type { Config } from "#/yoga/config.ts";
9
+ export type { DirtiedFunction, MeasureFunction, Node } from "#/yoga/node.ts";
10
10
 
11
11
  export const Yoga = {
12
12
  Config,
@@ -16,4 +16,4 @@ export const Yoga = {
16
16
 
17
17
  export type Yoga = typeof Yoga;
18
18
 
19
- export * from "./generated/YGEnums.ts";
19
+ export * from "#/yoga/generated/YGEnums.ts";
package/src/yoga/node.ts CHANGED
@@ -4,13 +4,13 @@
4
4
  // Public Yoga API on the engine node itself. This keeps the WASM-compatible
5
5
  // surface without allocating a separate binding wrapper for every node.
6
6
 
7
- import { Config } from "./config.ts";
8
- import { calculateLayout } from "./core/calculateLayout.ts";
9
- import { getDefaultConfig } from "./core/config.ts";
10
- import { PhysicalEdge } from "./core/helpers.ts";
11
- import { LayoutResults } from "./core/layoutResults.ts";
12
- import { Node as CoreNode } from "./core/node.ts";
13
- import { StyleLength, StyleSizeLength } from "./core/types.ts";
7
+ import { Config } from "#/yoga/config.ts";
8
+ import { calculateLayout } from "#/yoga/core/calculateLayout.ts";
9
+ import { getDefaultConfig } from "#/yoga/core/config.ts";
10
+ import { PhysicalEdge } from "#/yoga/core/helpers.ts";
11
+ import { LayoutResults } from "#/yoga/core/layoutResults.ts";
12
+ import { Node as CoreNode } from "#/yoga/core/node.ts";
13
+ import { StyleLength, StyleSizeLength } from "#/yoga/core/types.ts";
14
14
  import {
15
15
  Align,
16
16
  BoxSizing,
@@ -26,7 +26,7 @@ import {
26
26
  PositionType,
27
27
  Unit,
28
28
  Wrap,
29
- } from "./generated/YGEnums.ts";
29
+ } from "#/yoga/generated/YGEnums.ts";
30
30
 
31
31
  type Layout = {
32
32
  left: number;
@@ -1,91 +0,0 @@
1
- //#region src/ansi/sgr.d.ts
2
- type StylePair = {
3
- readonly open: string;
4
- readonly close: string;
5
- };
6
- declare const modifierCodes: {
7
- readonly reset: readonly [0, 0];
8
- readonly bold: readonly [1, 22];
9
- readonly dim: readonly [2, 22];
10
- readonly italic: readonly [3, 23];
11
- readonly underline: readonly [4, 24];
12
- readonly overline: readonly [53, 55];
13
- readonly inverse: readonly [7, 27];
14
- readonly hidden: readonly [8, 28];
15
- readonly strikethrough: readonly [9, 29];
16
- };
17
- declare const colorCodes: {
18
- readonly black: readonly [30, 39];
19
- readonly red: readonly [31, 39];
20
- readonly green: readonly [32, 39];
21
- readonly yellow: readonly [33, 39];
22
- readonly blue: readonly [34, 39];
23
- readonly magenta: readonly [35, 39];
24
- readonly cyan: readonly [36, 39];
25
- readonly white: readonly [37, 39];
26
- readonly blackBright: readonly [90, 39];
27
- readonly gray: readonly [90, 39];
28
- readonly grey: readonly [90, 39];
29
- readonly redBright: readonly [91, 39];
30
- readonly greenBright: readonly [92, 39];
31
- readonly yellowBright: readonly [93, 39];
32
- readonly blueBright: readonly [94, 39];
33
- readonly magentaBright: readonly [95, 39];
34
- readonly cyanBright: readonly [96, 39];
35
- readonly whiteBright: readonly [97, 39];
36
- };
37
- declare const bgColorCodes: {
38
- readonly bgBlack: readonly [40, 49];
39
- readonly bgRed: readonly [41, 49];
40
- readonly bgGreen: readonly [42, 49];
41
- readonly bgYellow: readonly [43, 49];
42
- readonly bgBlue: readonly [44, 49];
43
- readonly bgMagenta: readonly [45, 49];
44
- readonly bgCyan: readonly [46, 49];
45
- readonly bgWhite: readonly [47, 49];
46
- readonly bgBlackBright: readonly [100, 49];
47
- readonly bgGray: readonly [100, 49];
48
- readonly bgGrey: readonly [100, 49];
49
- readonly bgRedBright: readonly [101, 49];
50
- readonly bgGreenBright: readonly [102, 49];
51
- readonly bgYellowBright: readonly [103, 49];
52
- readonly bgBlueBright: readonly [104, 49];
53
- readonly bgMagentaBright: readonly [105, 49];
54
- readonly bgCyanBright: readonly [106, 49];
55
- readonly bgWhiteBright: readonly [107, 49];
56
- };
57
- type ModifierName = keyof typeof modifierCodes;
58
- type ForegroundColorName = keyof typeof colorCodes;
59
- type BackgroundColorName = keyof typeof bgColorCodes;
60
- type StyleName = ModifierName | ForegroundColorName | BackgroundColorName;
61
- declare const modifierNames: ModifierName[];
62
- declare const foregroundColorNames: ForegroundColorName[];
63
- declare const backgroundColorNames: BackgroundColorName[];
64
- /**
65
- Named SGR styles as `{open, close}` escape sequence pairs.
66
- */
67
- declare const styles: Record<StyleName, StylePair>;
68
- /**
69
- Raw SGR code numbers: open code → close code.
70
- */
71
- declare const codes: ReadonlyMap<number, number>;
72
- declare const foreground: {
73
- close: string;
74
- ansi: (code: number) => string;
75
- ansi256: (code: number) => string;
76
- ansi16m: (red: number, green: number, blue: number) => string;
77
- };
78
- declare const background: {
79
- close: string;
80
- ansi: (code: number) => string;
81
- ansi256: (code: number) => string;
82
- ansi16m: (red: number, green: number, blue: number) => string;
83
- };
84
- declare const rgbToAnsi256: (red: number, green: number, blue: number) => number;
85
- declare const hexToRgb: (hex: string) => [number, number, number];
86
- declare const hexToAnsi256: (hex: string) => number;
87
- declare const ansi256ToAnsi: (code: number) => number;
88
- declare const rgbToAnsi: (red: number, green: number, blue: number) => number;
89
- declare const hexToAnsi: (hex: string) => number;
90
- //#endregion
91
- export { rgbToAnsi256 as _, StylePair as a, backgroundColorNames as c, foregroundColorNames as d, hexToAnsi as f, rgbToAnsi as g, modifierNames as h, StyleName as i, codes as l, hexToRgb as m, ForegroundColorName as n, ansi256ToAnsi as o, hexToAnsi256 as p, ModifierName as r, background as s, BackgroundColorName as t, foreground as u, styles as v };