@alchemy.run/sigil 0.0.0-alpha.1 → 0.0.0-alpha.2
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.
- package/README.md +299 -299
- package/dist/ansi.d.ts +223 -0
- package/dist/ansi.js +2 -0
- package/dist/{devtools-QpCMm9JH.mjs → devtools-BhYGjb7h.js} +1 -1
- package/dist/index-DDVME65c.d.ts +919 -0
- package/dist/index.d.ts +1657 -0
- package/dist/index.js +4643 -0
- package/dist/sgr-CMfEpjSk.d.ts +91 -0
- package/dist/truncate-CBiyyZzw.js +2156 -0
- package/dist/yoga-5jKhYCJC.js +3465 -0
- package/dist/yoga.d.ts +2 -0
- package/dist/yoga.js +2 -0
- package/package.json +37 -17
- package/src/ansi/chalk.ts +179 -0
- package/src/ansi/cursor.ts +48 -0
- package/src/ansi/east-asian-width.ts +215 -0
- package/src/ansi/escapes.ts +128 -0
- package/src/ansi/index.ts +27 -0
- package/src/ansi/sgr.ts +237 -0
- package/src/ansi/slice.ts +43 -0
- package/src/ansi/string-width.ts +236 -0
- package/src/ansi/strip.ts +33 -0
- package/src/ansi/supports-color.ts +213 -0
- package/src/ansi/tokenize.ts +453 -0
- package/src/ansi/truncate.ts +194 -0
- package/src/ansi/widest-line.ts +12 -0
- package/src/ansi/wrap.ts +766 -0
- package/src/ansi-tokenizer.ts +510 -0
- package/src/auto-bind.ts +41 -0
- package/src/boxes.ts +100 -0
- package/src/code-excerpt.ts +39 -0
- package/src/colorize.ts +60 -0
- package/src/components/AccessibilityContext.ts +5 -0
- package/src/components/AnimationContext.ts +24 -0
- package/src/components/App.tsx +781 -0
- package/src/components/AppContext.ts +111 -0
- package/src/components/BackgroundContext.ts +8 -0
- package/src/components/Box.tsx +116 -0
- package/src/components/CursorContext.ts +19 -0
- package/src/components/ErrorBoundary.tsx +38 -0
- package/src/components/ErrorOverview.tsx +133 -0
- package/src/components/FocusContext.ts +30 -0
- package/src/components/Newline.tsx +15 -0
- package/src/components/Spacer.tsx +10 -0
- package/src/components/Static.tsx +59 -0
- package/src/components/StderrContext.ts +26 -0
- package/src/components/StdinContext.ts +49 -0
- package/src/components/StdoutContext.ts +28 -0
- package/src/components/Text.tsx +144 -0
- package/src/components/Transform.tsx +37 -0
- package/src/cursor-position.ts +103 -0
- package/src/devtools-window-polyfill.ts +73 -0
- package/src/devtools.ts +43 -0
- package/src/dom.ts +292 -0
- package/src/get-max-width.ts +11 -0
- package/src/global.d.ts +36 -0
- package/src/hooks/use-animation.ts +142 -0
- package/src/hooks/use-app.ts +8 -0
- package/src/hooks/use-box-metrics.ts +134 -0
- package/src/hooks/use-cursor.ts +33 -0
- package/src/hooks/use-focus-manager.ts +62 -0
- package/src/hooks/use-focus.ts +83 -0
- package/src/hooks/use-input.ts +267 -0
- package/src/hooks/use-is-screen-reader-enabled.ts +12 -0
- package/src/hooks/use-paste.ts +78 -0
- package/src/hooks/use-stderr.ts +8 -0
- package/src/hooks/use-stdin.ts +10 -0
- package/src/hooks/use-stdout.ts +8 -0
- package/src/hooks/use-window-size.ts +41 -0
- package/src/indent-string.ts +16 -0
- package/src/index.ts +44 -0
- package/src/ink.tsx +1506 -0
- package/src/input-parser.ts +283 -0
- package/src/instances.ts +9 -0
- package/src/is-in-ci.ts +7 -0
- package/src/kitty-keyboard.ts +57 -0
- package/src/log-update.ts +370 -0
- package/src/measure-element.ts +62 -0
- package/src/measure-text.ts +31 -0
- package/src/output.ts +308 -0
- package/src/parse-keypress.ts +516 -0
- package/src/parse-stack-line.ts +139 -0
- package/src/patch-console.ts +62 -0
- package/src/quick-lru.ts +85 -0
- package/src/reconciler.ts +451 -0
- package/src/render-background.ts +38 -0
- package/src/render-border.ts +134 -0
- package/src/render-node-to-output.ts +191 -0
- package/src/render-to-string.ts +131 -0
- package/src/render.ts +276 -0
- package/src/renderer.ts +73 -0
- package/src/sanitize-ansi.ts +33 -0
- package/src/signal-exit.ts +107 -0
- package/src/squash-text-nodes.ts +40 -0
- package/src/stream.ts +30 -0
- package/src/styles.ts +748 -0
- package/src/terminal-size.ts +57 -0
- package/src/throttle.ts +73 -0
- package/src/types.ts +15 -0
- package/src/utils.ts +40 -0
- package/src/wrap-text.ts +50 -0
- package/src/write-synchronized.ts +9 -0
- package/src/yoga/config.ts +57 -0
- package/src/yoga/core/absoluteLayout.ts +626 -0
- package/src/yoga/core/baseline.ts +66 -0
- package/src/yoga/core/cache.ts +136 -0
- package/src/yoga/core/calculateLayout.ts +2920 -0
- package/src/yoga/core/config.ts +104 -0
- package/src/yoga/core/flexLine.ts +177 -0
- package/src/yoga/core/helpers.ts +293 -0
- package/src/yoga/core/layoutResults.ts +167 -0
- package/src/yoga/core/node.ts +611 -0
- package/src/yoga/core/numeric.ts +44 -0
- package/src/yoga/core/pixelGrid.ts +151 -0
- package/src/yoga/core/style.ts +887 -0
- package/src/yoga/core/types.ts +224 -0
- package/src/yoga/generated/YGEnums.ts +263 -0
- package/src/yoga/index.ts +19 -0
- package/src/yoga/node.ts +1140 -0
- package/dist/index.d.mts +0 -2379
- package/dist/index.mjs +0 -10072
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Derived from Yoga. See THIRD_PARTY_NOTICES.md.
|
|
3
|
+
|
|
4
|
+
// Port of yoga/style/StyleLength.h and yoga/style/StyleSizeLength.h.
|
|
5
|
+
|
|
6
|
+
import { Unit } from "../generated/YGEnums.ts";
|
|
7
|
+
import { isUndefined, optionalEquals, inexactEquals } from "./numeric.ts";
|
|
8
|
+
|
|
9
|
+
function isInvalidValue(value: number): boolean {
|
|
10
|
+
return isUndefined(value) || !Number.isFinite(value);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A CSS <length-percentage> or keyword. `value` is NaN for keyword units.
|
|
15
|
+
* Instances are immutable and may be shared.
|
|
16
|
+
*/
|
|
17
|
+
export class StyleLength {
|
|
18
|
+
readonly value: number;
|
|
19
|
+
readonly unit: Unit;
|
|
20
|
+
|
|
21
|
+
protected constructor(value: number, unit: Unit) {
|
|
22
|
+
this.value = value;
|
|
23
|
+
this.unit = unit;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static points(value: number): StyleLength {
|
|
27
|
+
return isInvalidValue(value) ? StyleLength.undefined() : new StyleLength(value, Unit.Point);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static percent(value: number): StyleLength {
|
|
31
|
+
return isInvalidValue(value) ? StyleLength.undefined() : new StyleLength(value, Unit.Percent);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static ofAuto(): StyleLength {
|
|
35
|
+
return AUTO;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static undefined(): StyleLength {
|
|
39
|
+
return UNDEFINED;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
isAuto(): boolean {
|
|
43
|
+
return this.unit === Unit.Auto;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
isUndefined(): boolean {
|
|
47
|
+
return this.unit === Unit.Undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
isDefined(): boolean {
|
|
51
|
+
return !this.isUndefined();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
isPoints(): boolean {
|
|
55
|
+
return this.unit === Unit.Point;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
isPercent(): boolean {
|
|
59
|
+
return this.unit === Unit.Percent;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
resolve(referenceLength: number): number {
|
|
63
|
+
switch (this.unit) {
|
|
64
|
+
case Unit.Point:
|
|
65
|
+
return this.value;
|
|
66
|
+
case Unit.Percent:
|
|
67
|
+
return this.value * referenceLength * 0.01;
|
|
68
|
+
default:
|
|
69
|
+
return NaN;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
equals(other: StyleLength): boolean {
|
|
74
|
+
return optionalEquals(this.value, other.value) && this.unit === other.unit;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
inexactEquals(other: StyleLength): boolean {
|
|
78
|
+
return this.unit === other.unit && inexactEquals(this.value, other.value);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const AUTO = new (class extends StyleLength {
|
|
83
|
+
constructor() {
|
|
84
|
+
super(NaN, Unit.Auto);
|
|
85
|
+
}
|
|
86
|
+
})();
|
|
87
|
+
|
|
88
|
+
const UNDEFINED = new (class extends StyleLength {
|
|
89
|
+
constructor() {
|
|
90
|
+
super(NaN, Unit.Undefined);
|
|
91
|
+
}
|
|
92
|
+
})();
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* A CSS value for sizes (width, min-width, flex-basis, ...) which additionally
|
|
96
|
+
* allows the auto/max-content/fit-content/stretch keywords.
|
|
97
|
+
*/
|
|
98
|
+
export class StyleSizeLength {
|
|
99
|
+
readonly value: number;
|
|
100
|
+
readonly unit: Unit;
|
|
101
|
+
|
|
102
|
+
protected constructor(value: number, unit: Unit) {
|
|
103
|
+
this.value = value;
|
|
104
|
+
this.unit = unit;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
static points(value: number): StyleSizeLength {
|
|
108
|
+
return isInvalidValue(value)
|
|
109
|
+
? StyleSizeLength.undefined()
|
|
110
|
+
: new StyleSizeLength(value, Unit.Point);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
static percent(value: number): StyleSizeLength {
|
|
114
|
+
return isInvalidValue(value)
|
|
115
|
+
? StyleSizeLength.undefined()
|
|
116
|
+
: new StyleSizeLength(value, Unit.Percent);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
static ofAuto(): StyleSizeLength {
|
|
120
|
+
return SIZE_AUTO;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
static ofMaxContent(): StyleSizeLength {
|
|
124
|
+
return SIZE_MAX_CONTENT;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
static ofFitContent(): StyleSizeLength {
|
|
128
|
+
return SIZE_FIT_CONTENT;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
static ofStretch(): StyleSizeLength {
|
|
132
|
+
return SIZE_STRETCH;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
static undefined(): StyleSizeLength {
|
|
136
|
+
return SIZE_UNDEFINED;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
isAuto(): boolean {
|
|
140
|
+
return this.unit === Unit.Auto;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
isMaxContent(): boolean {
|
|
144
|
+
return this.unit === Unit.MaxContent;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
isFitContent(): boolean {
|
|
148
|
+
return this.unit === Unit.FitContent;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
isStretch(): boolean {
|
|
152
|
+
return this.unit === Unit.Stretch;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
isUndefined(): boolean {
|
|
156
|
+
return this.unit === Unit.Undefined;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
isDefined(): boolean {
|
|
160
|
+
return !this.isUndefined();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
isPoints(): boolean {
|
|
164
|
+
return this.unit === Unit.Point;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
isPercent(): boolean {
|
|
168
|
+
return this.unit === Unit.Percent;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
resolve(referenceLength: number): number {
|
|
172
|
+
switch (this.unit) {
|
|
173
|
+
case Unit.Point:
|
|
174
|
+
return this.value;
|
|
175
|
+
case Unit.Percent:
|
|
176
|
+
return this.value * referenceLength * 0.01;
|
|
177
|
+
default:
|
|
178
|
+
return NaN;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
equals(other: StyleSizeLength): boolean {
|
|
183
|
+
return optionalEquals(this.value, other.value) && this.unit === other.unit;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
inexactEquals(other: StyleSizeLength): boolean {
|
|
187
|
+
return this.unit === other.unit && inexactEquals(this.value, other.value);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const SIZE_AUTO = new (class extends StyleSizeLength {
|
|
192
|
+
constructor() {
|
|
193
|
+
super(NaN, Unit.Auto);
|
|
194
|
+
}
|
|
195
|
+
})();
|
|
196
|
+
|
|
197
|
+
const SIZE_MAX_CONTENT = new (class extends StyleSizeLength {
|
|
198
|
+
constructor() {
|
|
199
|
+
super(NaN, Unit.MaxContent);
|
|
200
|
+
}
|
|
201
|
+
})();
|
|
202
|
+
|
|
203
|
+
const SIZE_FIT_CONTENT = new (class extends StyleSizeLength {
|
|
204
|
+
constructor() {
|
|
205
|
+
super(NaN, Unit.FitContent);
|
|
206
|
+
}
|
|
207
|
+
})();
|
|
208
|
+
|
|
209
|
+
const SIZE_STRETCH = new (class extends StyleSizeLength {
|
|
210
|
+
constructor() {
|
|
211
|
+
super(NaN, Unit.Stretch);
|
|
212
|
+
}
|
|
213
|
+
})();
|
|
214
|
+
|
|
215
|
+
const SIZE_UNDEFINED = new (class extends StyleSizeLength {
|
|
216
|
+
constructor() {
|
|
217
|
+
super(NaN, Unit.Undefined);
|
|
218
|
+
}
|
|
219
|
+
})();
|
|
220
|
+
|
|
221
|
+
export interface Size {
|
|
222
|
+
width: number;
|
|
223
|
+
height: number;
|
|
224
|
+
}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Derived from Yoga. See THIRD_PARTY_NOTICES.md.
|
|
3
|
+
|
|
4
|
+
// @generated by enums.py
|
|
5
|
+
|
|
6
|
+
export const Align = {
|
|
7
|
+
Auto: 0,
|
|
8
|
+
FlexStart: 1,
|
|
9
|
+
Center: 2,
|
|
10
|
+
FlexEnd: 3,
|
|
11
|
+
Stretch: 4,
|
|
12
|
+
Baseline: 5,
|
|
13
|
+
SpaceBetween: 6,
|
|
14
|
+
SpaceAround: 7,
|
|
15
|
+
SpaceEvenly: 8,
|
|
16
|
+
Start: 9,
|
|
17
|
+
End: 10,
|
|
18
|
+
} as const;
|
|
19
|
+
export type Align = (typeof Align)[keyof typeof Align];
|
|
20
|
+
|
|
21
|
+
export const BoxSizing = {
|
|
22
|
+
BorderBox: 0,
|
|
23
|
+
ContentBox: 1,
|
|
24
|
+
} as const;
|
|
25
|
+
export type BoxSizing = (typeof BoxSizing)[keyof typeof BoxSizing];
|
|
26
|
+
|
|
27
|
+
export const Dimension = {
|
|
28
|
+
Width: 0,
|
|
29
|
+
Height: 1,
|
|
30
|
+
} as const;
|
|
31
|
+
export type Dimension = (typeof Dimension)[keyof typeof Dimension];
|
|
32
|
+
|
|
33
|
+
export const Direction = {
|
|
34
|
+
Inherit: 0,
|
|
35
|
+
LTR: 1,
|
|
36
|
+
RTL: 2,
|
|
37
|
+
} as const;
|
|
38
|
+
export type Direction = (typeof Direction)[keyof typeof Direction];
|
|
39
|
+
|
|
40
|
+
export const Display = {
|
|
41
|
+
Flex: 0,
|
|
42
|
+
None: 1,
|
|
43
|
+
Contents: 2,
|
|
44
|
+
Grid: 3,
|
|
45
|
+
} as const;
|
|
46
|
+
export type Display = (typeof Display)[keyof typeof Display];
|
|
47
|
+
|
|
48
|
+
export const Edge = {
|
|
49
|
+
Left: 0,
|
|
50
|
+
Top: 1,
|
|
51
|
+
Right: 2,
|
|
52
|
+
Bottom: 3,
|
|
53
|
+
Start: 4,
|
|
54
|
+
End: 5,
|
|
55
|
+
Horizontal: 6,
|
|
56
|
+
Vertical: 7,
|
|
57
|
+
All: 8,
|
|
58
|
+
} as const;
|
|
59
|
+
export type Edge = (typeof Edge)[keyof typeof Edge];
|
|
60
|
+
|
|
61
|
+
export const Errata = {
|
|
62
|
+
None: 0,
|
|
63
|
+
StretchFlexBasis: 1,
|
|
64
|
+
AbsolutePositionWithoutInsetsExcludesPadding: 2,
|
|
65
|
+
AbsolutePercentAgainstInnerSize: 4,
|
|
66
|
+
MinSizeUndefinedInsteadOfAuto: 8,
|
|
67
|
+
All: 2147483647,
|
|
68
|
+
Classic: 2147483646,
|
|
69
|
+
} as const;
|
|
70
|
+
// Bit-flag set: values are combined with bitwise operators.
|
|
71
|
+
export type Errata = number;
|
|
72
|
+
|
|
73
|
+
export const ExperimentalFeature = {
|
|
74
|
+
WebFlexBasis: 0,
|
|
75
|
+
FixFlexBasisFitContent: 1,
|
|
76
|
+
} as const;
|
|
77
|
+
export type ExperimentalFeature = (typeof ExperimentalFeature)[keyof typeof ExperimentalFeature];
|
|
78
|
+
|
|
79
|
+
export const FlexDirection = {
|
|
80
|
+
Column: 0,
|
|
81
|
+
ColumnReverse: 1,
|
|
82
|
+
Row: 2,
|
|
83
|
+
RowReverse: 3,
|
|
84
|
+
} as const;
|
|
85
|
+
export type FlexDirection = (typeof FlexDirection)[keyof typeof FlexDirection];
|
|
86
|
+
|
|
87
|
+
export const GridTrackType = {
|
|
88
|
+
Auto: 0,
|
|
89
|
+
Points: 1,
|
|
90
|
+
Percent: 2,
|
|
91
|
+
Fr: 3,
|
|
92
|
+
Minmax: 4,
|
|
93
|
+
} as const;
|
|
94
|
+
export type GridTrackType = (typeof GridTrackType)[keyof typeof GridTrackType];
|
|
95
|
+
|
|
96
|
+
export const Gutter = {
|
|
97
|
+
Column: 0,
|
|
98
|
+
Row: 1,
|
|
99
|
+
All: 2,
|
|
100
|
+
} as const;
|
|
101
|
+
export type Gutter = (typeof Gutter)[keyof typeof Gutter];
|
|
102
|
+
|
|
103
|
+
export const Justify = {
|
|
104
|
+
Auto: 0,
|
|
105
|
+
FlexStart: 1,
|
|
106
|
+
Center: 2,
|
|
107
|
+
FlexEnd: 3,
|
|
108
|
+
SpaceBetween: 4,
|
|
109
|
+
SpaceAround: 5,
|
|
110
|
+
SpaceEvenly: 6,
|
|
111
|
+
Stretch: 7,
|
|
112
|
+
Start: 8,
|
|
113
|
+
End: 9,
|
|
114
|
+
} as const;
|
|
115
|
+
export type Justify = (typeof Justify)[keyof typeof Justify];
|
|
116
|
+
|
|
117
|
+
export const LogLevel = {
|
|
118
|
+
Error: 0,
|
|
119
|
+
Warn: 1,
|
|
120
|
+
Info: 2,
|
|
121
|
+
Debug: 3,
|
|
122
|
+
Verbose: 4,
|
|
123
|
+
Fatal: 5,
|
|
124
|
+
} as const;
|
|
125
|
+
export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
126
|
+
|
|
127
|
+
export const MeasureMode = {
|
|
128
|
+
Undefined: 0,
|
|
129
|
+
Exactly: 1,
|
|
130
|
+
AtMost: 2,
|
|
131
|
+
} as const;
|
|
132
|
+
export type MeasureMode = (typeof MeasureMode)[keyof typeof MeasureMode];
|
|
133
|
+
|
|
134
|
+
export const NodeType = {
|
|
135
|
+
Default: 0,
|
|
136
|
+
Text: 1,
|
|
137
|
+
} as const;
|
|
138
|
+
export type NodeType = (typeof NodeType)[keyof typeof NodeType];
|
|
139
|
+
|
|
140
|
+
export const Overflow = {
|
|
141
|
+
Visible: 0,
|
|
142
|
+
Hidden: 1,
|
|
143
|
+
Scroll: 2,
|
|
144
|
+
} as const;
|
|
145
|
+
export type Overflow = (typeof Overflow)[keyof typeof Overflow];
|
|
146
|
+
|
|
147
|
+
export const PositionType = {
|
|
148
|
+
Static: 0,
|
|
149
|
+
Relative: 1,
|
|
150
|
+
Absolute: 2,
|
|
151
|
+
} as const;
|
|
152
|
+
export type PositionType = (typeof PositionType)[keyof typeof PositionType];
|
|
153
|
+
|
|
154
|
+
export const Unit = {
|
|
155
|
+
Undefined: 0,
|
|
156
|
+
Point: 1,
|
|
157
|
+
Percent: 2,
|
|
158
|
+
Auto: 3,
|
|
159
|
+
MaxContent: 4,
|
|
160
|
+
FitContent: 5,
|
|
161
|
+
Stretch: 6,
|
|
162
|
+
} as const;
|
|
163
|
+
export type Unit = (typeof Unit)[keyof typeof Unit];
|
|
164
|
+
|
|
165
|
+
export const Wrap = {
|
|
166
|
+
NoWrap: 0,
|
|
167
|
+
Wrap: 1,
|
|
168
|
+
WrapReverse: 2,
|
|
169
|
+
} as const;
|
|
170
|
+
export type Wrap = (typeof Wrap)[keyof typeof Wrap];
|
|
171
|
+
|
|
172
|
+
export const constants = {
|
|
173
|
+
ALIGN_AUTO: Align.Auto,
|
|
174
|
+
ALIGN_FLEX_START: Align.FlexStart,
|
|
175
|
+
ALIGN_CENTER: Align.Center,
|
|
176
|
+
ALIGN_FLEX_END: Align.FlexEnd,
|
|
177
|
+
ALIGN_STRETCH: Align.Stretch,
|
|
178
|
+
ALIGN_BASELINE: Align.Baseline,
|
|
179
|
+
ALIGN_SPACE_BETWEEN: Align.SpaceBetween,
|
|
180
|
+
ALIGN_SPACE_AROUND: Align.SpaceAround,
|
|
181
|
+
ALIGN_SPACE_EVENLY: Align.SpaceEvenly,
|
|
182
|
+
ALIGN_START: Align.Start,
|
|
183
|
+
ALIGN_END: Align.End,
|
|
184
|
+
BOX_SIZING_BORDER_BOX: BoxSizing.BorderBox,
|
|
185
|
+
BOX_SIZING_CONTENT_BOX: BoxSizing.ContentBox,
|
|
186
|
+
DIMENSION_WIDTH: Dimension.Width,
|
|
187
|
+
DIMENSION_HEIGHT: Dimension.Height,
|
|
188
|
+
DIRECTION_INHERIT: Direction.Inherit,
|
|
189
|
+
DIRECTION_LTR: Direction.LTR,
|
|
190
|
+
DIRECTION_RTL: Direction.RTL,
|
|
191
|
+
DISPLAY_FLEX: Display.Flex,
|
|
192
|
+
DISPLAY_NONE: Display.None,
|
|
193
|
+
DISPLAY_CONTENTS: Display.Contents,
|
|
194
|
+
DISPLAY_GRID: Display.Grid,
|
|
195
|
+
EDGE_LEFT: Edge.Left,
|
|
196
|
+
EDGE_TOP: Edge.Top,
|
|
197
|
+
EDGE_RIGHT: Edge.Right,
|
|
198
|
+
EDGE_BOTTOM: Edge.Bottom,
|
|
199
|
+
EDGE_START: Edge.Start,
|
|
200
|
+
EDGE_END: Edge.End,
|
|
201
|
+
EDGE_HORIZONTAL: Edge.Horizontal,
|
|
202
|
+
EDGE_VERTICAL: Edge.Vertical,
|
|
203
|
+
EDGE_ALL: Edge.All,
|
|
204
|
+
ERRATA_NONE: Errata.None,
|
|
205
|
+
ERRATA_STRETCH_FLEX_BASIS: Errata.StretchFlexBasis,
|
|
206
|
+
ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING:
|
|
207
|
+
Errata.AbsolutePositionWithoutInsetsExcludesPadding,
|
|
208
|
+
ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: Errata.AbsolutePercentAgainstInnerSize,
|
|
209
|
+
ERRATA_MIN_SIZE_UNDEFINED_INSTEAD_OF_AUTO: Errata.MinSizeUndefinedInsteadOfAuto,
|
|
210
|
+
ERRATA_ALL: Errata.All,
|
|
211
|
+
ERRATA_CLASSIC: Errata.Classic,
|
|
212
|
+
EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: ExperimentalFeature.WebFlexBasis,
|
|
213
|
+
EXPERIMENTAL_FEATURE_FIX_FLEX_BASIS_FIT_CONTENT: ExperimentalFeature.FixFlexBasisFitContent,
|
|
214
|
+
FLEX_DIRECTION_COLUMN: FlexDirection.Column,
|
|
215
|
+
FLEX_DIRECTION_COLUMN_REVERSE: FlexDirection.ColumnReverse,
|
|
216
|
+
FLEX_DIRECTION_ROW: FlexDirection.Row,
|
|
217
|
+
FLEX_DIRECTION_ROW_REVERSE: FlexDirection.RowReverse,
|
|
218
|
+
GRID_TRACK_TYPE_AUTO: GridTrackType.Auto,
|
|
219
|
+
GRID_TRACK_TYPE_POINTS: GridTrackType.Points,
|
|
220
|
+
GRID_TRACK_TYPE_PERCENT: GridTrackType.Percent,
|
|
221
|
+
GRID_TRACK_TYPE_FR: GridTrackType.Fr,
|
|
222
|
+
GRID_TRACK_TYPE_MINMAX: GridTrackType.Minmax,
|
|
223
|
+
GUTTER_COLUMN: Gutter.Column,
|
|
224
|
+
GUTTER_ROW: Gutter.Row,
|
|
225
|
+
GUTTER_ALL: Gutter.All,
|
|
226
|
+
JUSTIFY_AUTO: Justify.Auto,
|
|
227
|
+
JUSTIFY_FLEX_START: Justify.FlexStart,
|
|
228
|
+
JUSTIFY_CENTER: Justify.Center,
|
|
229
|
+
JUSTIFY_FLEX_END: Justify.FlexEnd,
|
|
230
|
+
JUSTIFY_SPACE_BETWEEN: Justify.SpaceBetween,
|
|
231
|
+
JUSTIFY_SPACE_AROUND: Justify.SpaceAround,
|
|
232
|
+
JUSTIFY_SPACE_EVENLY: Justify.SpaceEvenly,
|
|
233
|
+
JUSTIFY_STRETCH: Justify.Stretch,
|
|
234
|
+
JUSTIFY_START: Justify.Start,
|
|
235
|
+
JUSTIFY_END: Justify.End,
|
|
236
|
+
LOG_LEVEL_ERROR: LogLevel.Error,
|
|
237
|
+
LOG_LEVEL_WARN: LogLevel.Warn,
|
|
238
|
+
LOG_LEVEL_INFO: LogLevel.Info,
|
|
239
|
+
LOG_LEVEL_DEBUG: LogLevel.Debug,
|
|
240
|
+
LOG_LEVEL_VERBOSE: LogLevel.Verbose,
|
|
241
|
+
LOG_LEVEL_FATAL: LogLevel.Fatal,
|
|
242
|
+
MEASURE_MODE_UNDEFINED: MeasureMode.Undefined,
|
|
243
|
+
MEASURE_MODE_EXACTLY: MeasureMode.Exactly,
|
|
244
|
+
MEASURE_MODE_AT_MOST: MeasureMode.AtMost,
|
|
245
|
+
NODE_TYPE_DEFAULT: NodeType.Default,
|
|
246
|
+
NODE_TYPE_TEXT: NodeType.Text,
|
|
247
|
+
OVERFLOW_VISIBLE: Overflow.Visible,
|
|
248
|
+
OVERFLOW_HIDDEN: Overflow.Hidden,
|
|
249
|
+
OVERFLOW_SCROLL: Overflow.Scroll,
|
|
250
|
+
POSITION_TYPE_STATIC: PositionType.Static,
|
|
251
|
+
POSITION_TYPE_RELATIVE: PositionType.Relative,
|
|
252
|
+
POSITION_TYPE_ABSOLUTE: PositionType.Absolute,
|
|
253
|
+
UNIT_UNDEFINED: Unit.Undefined,
|
|
254
|
+
UNIT_POINT: Unit.Point,
|
|
255
|
+
UNIT_PERCENT: Unit.Percent,
|
|
256
|
+
UNIT_AUTO: Unit.Auto,
|
|
257
|
+
UNIT_MAX_CONTENT: Unit.MaxContent,
|
|
258
|
+
UNIT_FIT_CONTENT: Unit.FitContent,
|
|
259
|
+
UNIT_STRETCH: Unit.Stretch,
|
|
260
|
+
WRAP_NO_WRAP: Wrap.NoWrap,
|
|
261
|
+
WRAP_WRAP: Wrap.Wrap,
|
|
262
|
+
WRAP_WRAP_REVERSE: Wrap.WrapReverse,
|
|
263
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Derived from Yoga. See THIRD_PARTY_NOTICES.md.
|
|
3
|
+
|
|
4
|
+
import { Config } from "./config.ts";
|
|
5
|
+
import { constants as YGEnums } from "./generated/YGEnums.ts";
|
|
6
|
+
import { Node } from "./node.ts";
|
|
7
|
+
|
|
8
|
+
export type { Config } from "./config.ts";
|
|
9
|
+
export type { DirtiedFunction, MeasureFunction, Node } from "./node.ts";
|
|
10
|
+
|
|
11
|
+
export const Yoga = {
|
|
12
|
+
Config,
|
|
13
|
+
Node,
|
|
14
|
+
...YGEnums,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type Yoga = typeof Yoga;
|
|
18
|
+
|
|
19
|
+
export * from "./generated/YGEnums.ts";
|