@pilates/core 1.0.0-rc.1 → 1.0.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.
- package/LICENSE +1 -1
- package/README.md +14 -8
- package/dist/algorithm/axis.d.ts +13 -0
- package/dist/algorithm/axis.d.ts.map +1 -1
- package/dist/algorithm/axis.js +24 -0
- package/dist/algorithm/axis.js.map +1 -1
- package/dist/algorithm/cache.d.ts +225 -0
- package/dist/algorithm/cache.d.ts.map +1 -0
- package/dist/algorithm/cache.js +312 -0
- package/dist/algorithm/cache.js.map +1 -0
- package/dist/algorithm/index.d.ts +7 -0
- package/dist/algorithm/index.d.ts.map +1 -1
- package/dist/algorithm/index.js +128 -4
- package/dist/algorithm/index.js.map +1 -1
- package/dist/algorithm/main-axis.d.ts +1 -1
- package/dist/algorithm/main-axis.d.ts.map +1 -1
- package/dist/algorithm/main-axis.js +253 -58
- package/dist/algorithm/main-axis.js.map +1 -1
- package/dist/algorithm/round.d.ts +17 -0
- package/dist/algorithm/round.d.ts.map +1 -1
- package/dist/algorithm/round.js +42 -4
- package/dist/algorithm/round.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layout.d.ts +8 -0
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +1 -1
- package/dist/layout.js.map +1 -1
- package/dist/node.d.ts +179 -6
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +292 -37
- package/dist/node.js.map +1 -1
- package/dist/style.d.ts +20 -1
- package/dist/style.d.ts.map +1 -1
- package/dist/style.js +5 -1
- package/dist/style.js.map +1 -1
- package/package.json +6 -6
package/dist/node.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* - `measure` — optional measure function for leaf intrinsic sizing.
|
|
16
16
|
* - `dirty` — set on style/tree mutation; consumed by the algorithm.
|
|
17
17
|
*/
|
|
18
|
+
import { MeasureCache } from './algorithm/cache.js';
|
|
18
19
|
import { calculateLayout as runCalculateLayout } from './algorithm/index.js';
|
|
19
20
|
import { Edge } from './edge.js';
|
|
20
21
|
import { defaultLayout } from './layout.js';
|
|
@@ -33,14 +34,111 @@ function nonNegativeOrThrow(value, name) {
|
|
|
33
34
|
return value;
|
|
34
35
|
}
|
|
35
36
|
export class Node {
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Backing storage for `style`. Mutated by this class's setters and read
|
|
39
|
+
* by the algorithm via the public `style` getter. The leading `_` and
|
|
40
|
+
* `@internal` mark this as algorithm-only — consumers must use the
|
|
41
|
+
* `setX()` methods.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
_style = defaultStyle();
|
|
46
|
+
/**
|
|
47
|
+
* Backing storage for `layout`. Written by the algorithm in this package
|
|
48
|
+
* (see `algorithm/`); read externally via the public `layout` getter or
|
|
49
|
+
* the safer `getComputedLayout()` snapshot.
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
_layout = defaultLayout();
|
|
54
|
+
/**
|
|
55
|
+
* Horizontal scroll offset. Mutable; defaults to 0. Read by the renderer
|
|
56
|
+
* when painting children of an `overflow !== 'visible'` node — children's
|
|
57
|
+
* paint origin is translated by `(-scrollLeft, -scrollTop)`. NOT clamped
|
|
58
|
+
* by this class — bounds clamping is the consumer's job (`<ScrollView>`
|
|
59
|
+
* clamps before writing). Direct mutation does not mark the node dirty
|
|
60
|
+
* because scroll offset is a paint-time concern, not layout.
|
|
61
|
+
*/
|
|
62
|
+
scrollLeft = 0;
|
|
63
|
+
/** See {@link scrollLeft}. */
|
|
64
|
+
scrollTop = 0;
|
|
65
|
+
/** Read-only view of `_layout.scrollWidth`. See {@link scrollLeft}. */
|
|
66
|
+
get scrollWidth() {
|
|
67
|
+
return this._layout.scrollWidth;
|
|
68
|
+
}
|
|
69
|
+
/** Read-only view of `_layout.scrollHeight`. */
|
|
70
|
+
get scrollHeight() {
|
|
71
|
+
return this._layout.scrollHeight;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Read-only view of this node's style. Mutating the returned object is
|
|
75
|
+
* blocked at the type level — call `setX()` methods to change style so
|
|
76
|
+
* `markDirty()` runs.
|
|
77
|
+
*/
|
|
78
|
+
get style() {
|
|
79
|
+
return this._style;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Read-only view of this node's most recently computed layout. Use
|
|
83
|
+
* `getComputedLayout()` for a stable copy if you need to retain it past
|
|
84
|
+
* the next `calculateLayout()` call.
|
|
85
|
+
*/
|
|
86
|
+
get layout() {
|
|
87
|
+
return this._layout;
|
|
88
|
+
}
|
|
39
89
|
_children = [];
|
|
40
90
|
_parent = null;
|
|
41
91
|
_measure = null;
|
|
42
92
|
/** True if style or tree has changed since the last `calculateLayout()`. */
|
|
43
93
|
_dirty = true;
|
|
94
|
+
/**
|
|
95
|
+
* True if any descendant has been marked dirty (even if dirty propagation
|
|
96
|
+
* was stopped by a relayout boundary before reaching this node). Used by
|
|
97
|
+
* the root cache-hit path to skip `layoutChildren` for subtrees that have
|
|
98
|
+
* no mutations at all — not just subtrees where this node itself is clean.
|
|
99
|
+
*
|
|
100
|
+
* Invariant: `_dirty` implies `_hasDirtyDescendant` on the parent (if any).
|
|
101
|
+
* Cleared by `clearDirty()` after each `calculateLayout()`.
|
|
102
|
+
*/
|
|
103
|
+
_hasDirtyDescendant = false;
|
|
104
|
+
/**
|
|
105
|
+
* Lazy-allocated measure-func result cache. Created the first time
|
|
106
|
+
* `setMeasureFunc()` installs a measurer. Cleared by `markDirty()`
|
|
107
|
+
* (which fires on every style/tree mutation) and by re-installing
|
|
108
|
+
* the measure function. Read by `callMeasureFunc()` in
|
|
109
|
+
* `algorithm/main-axis.ts`.
|
|
110
|
+
*
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
_measureCache;
|
|
114
|
+
/**
|
|
115
|
+
* Lazy-allocated layout-cache. Created the first time `layoutChildren`
|
|
116
|
+
* (or `calculateLayout` at the root) stores a result. Cleared by
|
|
117
|
+
* `markDirty()`. Read by `layoutChildren` and the root
|
|
118
|
+
* `calculateLayout` path in `algorithm/`.
|
|
119
|
+
*
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
_layoutCache;
|
|
123
|
+
/**
|
|
124
|
+
* Pre-rounding (float) left/top position of this node within its parent,
|
|
125
|
+
* as computed by the flex algorithm BEFORE `roundLayout` converts positions
|
|
126
|
+
* to integers.
|
|
127
|
+
*
|
|
128
|
+
* Written by the position-write helpers in `algorithm/main-axis.ts` at the
|
|
129
|
+
* same time as `_layout.left/top`. After `roundLayout` runs, `_layout.left/top`
|
|
130
|
+
* become integers but `_floatLeft/Top` retain the float values. These are
|
|
131
|
+
* captured by `snapshotForCache` and restored by `restoreFromCache` so that
|
|
132
|
+
* `roundLayoutSubtree` can compute the correct absolute float coordinate for
|
|
133
|
+
* a re-laid-out boundary node's children.
|
|
134
|
+
*
|
|
135
|
+
* Initialized to 0 (same as `_layout.left/top`).
|
|
136
|
+
*
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
_floatLeft = 0;
|
|
140
|
+
/** See {@link _floatLeft}. @internal */
|
|
141
|
+
_floatTop = 0;
|
|
44
142
|
/** Construct via `Node.create()` to mirror Yoga's factory style. */
|
|
45
143
|
static create() {
|
|
46
144
|
return new Node();
|
|
@@ -90,6 +188,17 @@ export class Node {
|
|
|
90
188
|
throw new Error('cannot set a measure function on a node with children');
|
|
91
189
|
}
|
|
92
190
|
this._measure = fn;
|
|
191
|
+
if (fn === null) {
|
|
192
|
+
this._measureCache?.clear();
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
if (this._measureCache === undefined) {
|
|
196
|
+
this._measureCache = new MeasureCache();
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
this._measureCache.clear();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
93
202
|
this.markDirty();
|
|
94
203
|
}
|
|
95
204
|
getMeasureFunc() {
|
|
@@ -97,122 +206,144 @@ export class Node {
|
|
|
97
206
|
}
|
|
98
207
|
// ─── flex direction / wrap / flex shorthand ───────────────────────────
|
|
99
208
|
setFlexDirection(value) {
|
|
100
|
-
this.
|
|
209
|
+
this._style.flexDirection = value;
|
|
101
210
|
this.markDirty();
|
|
102
211
|
}
|
|
103
212
|
setFlexWrap(value) {
|
|
104
|
-
this.
|
|
213
|
+
this._style.flexWrap = value;
|
|
105
214
|
this.markDirty();
|
|
106
215
|
}
|
|
107
|
-
/**
|
|
216
|
+
/**
|
|
217
|
+
* CSS `flex` shorthand: grow=value, shrink=1, basis=0 (when value > 0).
|
|
218
|
+
*
|
|
219
|
+
* Note that the implied `shrink: 1` follows CSS, not Yoga: Yoga's
|
|
220
|
+
* default `flexShrink` is 0, and `setFlex(N)` in Yoga also leaves
|
|
221
|
+
* shrink at 0. Pilates intentionally tracks CSS here so consumers
|
|
222
|
+
* who think in CSS terms get the result they expect; consumers
|
|
223
|
+
* porting from Ink (which wraps Yoga) should call `setFlexShrink(0)`
|
|
224
|
+
* after `setFlex` if they need the Yoga behaviour.
|
|
225
|
+
*/
|
|
108
226
|
setFlex(value) {
|
|
109
227
|
if (!Number.isFinite(value))
|
|
110
228
|
throw new RangeError(`flex must be finite, got ${value}`);
|
|
111
229
|
if (value > 0) {
|
|
112
|
-
this.
|
|
113
|
-
this.
|
|
114
|
-
this.
|
|
230
|
+
this._style.flexGrow = value;
|
|
231
|
+
this._style.flexShrink = 1;
|
|
232
|
+
this._style.flexBasis = 0;
|
|
115
233
|
}
|
|
116
234
|
else if (value < 0) {
|
|
117
|
-
this.
|
|
118
|
-
this.
|
|
119
|
-
this.
|
|
235
|
+
this._style.flexGrow = 0;
|
|
236
|
+
this._style.flexShrink = -value;
|
|
237
|
+
this._style.flexBasis = 'auto';
|
|
120
238
|
}
|
|
121
239
|
else {
|
|
122
|
-
this.
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
240
|
+
this._style.flexGrow = 0;
|
|
241
|
+
this._style.flexShrink = 0;
|
|
242
|
+
this._style.flexBasis = 'auto';
|
|
125
243
|
}
|
|
126
244
|
this.markDirty();
|
|
127
245
|
}
|
|
128
246
|
setFlexGrow(value) {
|
|
129
|
-
this.
|
|
247
|
+
this._style.flexGrow = clampNonNegative(value);
|
|
130
248
|
this.markDirty();
|
|
131
249
|
}
|
|
132
250
|
setFlexShrink(value) {
|
|
133
|
-
this.
|
|
251
|
+
this._style.flexShrink = clampNonNegative(value);
|
|
134
252
|
this.markDirty();
|
|
135
253
|
}
|
|
136
254
|
setFlexBasis(value) {
|
|
137
255
|
if (value !== 'auto')
|
|
138
256
|
nonNegativeOrThrow(value, 'flexBasis');
|
|
139
|
-
this.
|
|
257
|
+
this._style.flexBasis = value;
|
|
140
258
|
this.markDirty();
|
|
141
259
|
}
|
|
142
260
|
// ─── sizing ────────────────────────────────────────────────────────────
|
|
143
261
|
setWidth(value) {
|
|
144
262
|
if (value !== 'auto')
|
|
145
263
|
nonNegativeOrThrow(value, 'width');
|
|
146
|
-
this.
|
|
264
|
+
this._style.width = value;
|
|
147
265
|
this.markDirty();
|
|
148
266
|
}
|
|
149
267
|
setHeight(value) {
|
|
150
268
|
if (value !== 'auto')
|
|
151
269
|
nonNegativeOrThrow(value, 'height');
|
|
152
|
-
this.
|
|
270
|
+
this._style.height = value;
|
|
153
271
|
this.markDirty();
|
|
154
272
|
}
|
|
155
273
|
setMinWidth(value) {
|
|
156
|
-
this.
|
|
274
|
+
this._style.minWidth = nonNegativeOrThrow(value, 'minWidth');
|
|
157
275
|
this.markDirty();
|
|
158
276
|
}
|
|
159
277
|
setMinHeight(value) {
|
|
160
|
-
this.
|
|
278
|
+
this._style.minHeight = nonNegativeOrThrow(value, 'minHeight');
|
|
161
279
|
this.markDirty();
|
|
162
280
|
}
|
|
163
281
|
/** Pass `undefined` to remove an upper bound. */
|
|
164
282
|
setMaxWidth(value) {
|
|
165
283
|
if (value !== undefined)
|
|
166
284
|
nonNegativeOrThrow(value, 'maxWidth');
|
|
167
|
-
this.
|
|
285
|
+
this._style.maxWidth = value;
|
|
168
286
|
this.markDirty();
|
|
169
287
|
}
|
|
170
288
|
/** Pass `undefined` to remove an upper bound. */
|
|
171
289
|
setMaxHeight(value) {
|
|
172
290
|
if (value !== undefined)
|
|
173
291
|
nonNegativeOrThrow(value, 'maxHeight');
|
|
174
|
-
this.
|
|
292
|
+
this._style.maxHeight = value;
|
|
293
|
+
this.markDirty();
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Pass `undefined` to clear the constraint. Must be a positive finite
|
|
297
|
+
* number when set. See `style.ts` for the full derivation rules.
|
|
298
|
+
*/
|
|
299
|
+
setAspectRatio(value) {
|
|
300
|
+
if (value !== undefined) {
|
|
301
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
302
|
+
throw new RangeError(`aspectRatio must be a positive finite number, got ${value}`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
this._style.aspectRatio = value;
|
|
175
306
|
this.markDirty();
|
|
176
307
|
}
|
|
177
308
|
// ─── padding / margin / gap ────────────────────────────────────────────
|
|
178
309
|
setPadding(edge, value) {
|
|
179
310
|
nonNegativeOrThrow(value, 'padding');
|
|
180
|
-
writeEdge(this.
|
|
311
|
+
writeEdge(this._style.padding, edge, value);
|
|
181
312
|
this.markDirty();
|
|
182
313
|
}
|
|
183
314
|
setMargin(edge, value) {
|
|
184
315
|
nonNegativeOrThrow(value, 'margin');
|
|
185
|
-
writeEdge(this.
|
|
316
|
+
writeEdge(this._style.margin, edge, value);
|
|
186
317
|
this.markDirty();
|
|
187
318
|
}
|
|
188
319
|
setGap(axis, value) {
|
|
189
320
|
nonNegativeOrThrow(value, 'gap');
|
|
190
321
|
if (axis === 'row')
|
|
191
|
-
this.
|
|
322
|
+
this._style.gapRow = value;
|
|
192
323
|
else
|
|
193
|
-
this.
|
|
324
|
+
this._style.gapColumn = value;
|
|
194
325
|
this.markDirty();
|
|
195
326
|
}
|
|
196
327
|
// ─── alignment ─────────────────────────────────────────────────────────
|
|
197
328
|
setJustifyContent(value) {
|
|
198
|
-
this.
|
|
329
|
+
this._style.justifyContent = value;
|
|
199
330
|
this.markDirty();
|
|
200
331
|
}
|
|
201
332
|
setAlignItems(value) {
|
|
202
|
-
this.
|
|
333
|
+
this._style.alignItems = value;
|
|
203
334
|
this.markDirty();
|
|
204
335
|
}
|
|
205
336
|
setAlignContent(value) {
|
|
206
|
-
this.
|
|
337
|
+
this._style.alignContent = value;
|
|
207
338
|
this.markDirty();
|
|
208
339
|
}
|
|
209
340
|
setAlignSelf(value) {
|
|
210
|
-
this.
|
|
341
|
+
this._style.alignSelf = value;
|
|
211
342
|
this.markDirty();
|
|
212
343
|
}
|
|
213
344
|
// ─── positioning ───────────────────────────────────────────────────────
|
|
214
345
|
setPositionType(value) {
|
|
215
|
-
this.
|
|
346
|
+
this._style.positionType = value;
|
|
216
347
|
this.markDirty();
|
|
217
348
|
}
|
|
218
349
|
/** Pass `undefined` to leave that edge unconstrained. */
|
|
@@ -220,12 +351,27 @@ export class Node {
|
|
|
220
351
|
if (value !== undefined && !Number.isFinite(value)) {
|
|
221
352
|
throw new RangeError(`position must be finite or undefined, got ${value}`);
|
|
222
353
|
}
|
|
223
|
-
writePositionEdge(this.
|
|
354
|
+
writePositionEdge(this._style.position, edge, value);
|
|
224
355
|
this.markDirty();
|
|
225
356
|
}
|
|
226
357
|
// ─── display ───────────────────────────────────────────────────────────
|
|
227
358
|
setDisplay(value) {
|
|
228
|
-
this.
|
|
359
|
+
this._style.display = value;
|
|
360
|
+
this.markDirty();
|
|
361
|
+
}
|
|
362
|
+
// ─── overflow ──────────────────────────────────────────────────────────
|
|
363
|
+
setOverflow(overflow) {
|
|
364
|
+
this._style.overflow = overflow;
|
|
365
|
+
this._style.overflowX = overflow;
|
|
366
|
+
this._style.overflowY = overflow;
|
|
367
|
+
this.markDirty();
|
|
368
|
+
}
|
|
369
|
+
setOverflowX(overflow) {
|
|
370
|
+
this._style.overflowX = overflow;
|
|
371
|
+
this.markDirty();
|
|
372
|
+
}
|
|
373
|
+
setOverflowY(overflow) {
|
|
374
|
+
this._style.overflowY = overflow;
|
|
229
375
|
this.markDirty();
|
|
230
376
|
}
|
|
231
377
|
// ─── layout entry points ───────────────────────────────────────────────
|
|
@@ -252,21 +398,130 @@ export class Node {
|
|
|
252
398
|
return { ...this.layout };
|
|
253
399
|
}
|
|
254
400
|
// ─── dirty tracking ────────────────────────────────────────────────────
|
|
401
|
+
/**
|
|
402
|
+
* A node is a relayout boundary iff its layout size is fully
|
|
403
|
+
* independent of both parent flex distribution and descendant changes:
|
|
404
|
+
*
|
|
405
|
+
* 1. `width` AND `height` are explicit numbers (not `'auto'`) — pins
|
|
406
|
+
* the node's own preferred size on both axes.
|
|
407
|
+
* 2. `flexGrow <= 0` — the node won't be grown by parent free space.
|
|
408
|
+
* 3. `flexShrink <= 0` — the node won't be shrunk by parent overflow.
|
|
409
|
+
*
|
|
410
|
+
* The early spec draft argued (1) alone was sufficient ("flex grow/shrink
|
|
411
|
+
* adjust size based on parent state, not descendant state"). The fuzzer
|
|
412
|
+
* disproved this: with `flexGrow > 0`, the parent's flex distribution
|
|
413
|
+
* gives the boundary a post-grow width different from style.width. After
|
|
414
|
+
* a descendant mutation dirties the boundary but not its ancestors, the
|
|
415
|
+
* cached parent layout reuses the post-grow width, but the cold
|
|
416
|
+
* recompute may produce a different post-grow width if any sibling
|
|
417
|
+
* changed (or even due to micro-rounding interactions). The fuzzer
|
|
418
|
+
* surfaced this with a `setFlexGrow(1)` boundary producing
|
|
419
|
+
* `cached=17 vs cold=16` width drift.
|
|
420
|
+
*
|
|
421
|
+
* Conditions (2) + (3) ensure the boundary's actual size equals its
|
|
422
|
+
* style values exactly, so the cached parent layout stays valid no
|
|
423
|
+
* matter what siblings do.
|
|
424
|
+
*
|
|
425
|
+
* Boundaries stop the upward dirty propagation in `markDirtyFromChild()`
|
|
426
|
+
* so descendant mutations don't invalidate ancestor layout caches.
|
|
427
|
+
*
|
|
428
|
+
* See `docs/superpowers/specs/2026-05-09-relayout-boundaries-design.md`
|
|
429
|
+
* for the full rationale and edge-case analysis.
|
|
430
|
+
*/
|
|
431
|
+
isLayoutBoundary() {
|
|
432
|
+
return (typeof this._style.width === 'number' &&
|
|
433
|
+
typeof this._style.height === 'number' &&
|
|
434
|
+
this._style.flexGrow <= 0 &&
|
|
435
|
+
this._style.flexShrink <= 0);
|
|
436
|
+
}
|
|
255
437
|
/**
|
|
256
438
|
* Walk up the tree marking every ancestor dirty too. The algorithm uses
|
|
257
439
|
* this hint to short-circuit work in subtrees that did not change.
|
|
258
440
|
*/
|
|
259
441
|
markDirty() {
|
|
260
442
|
this._dirty = true;
|
|
443
|
+
// Optional-chain: only fires on leaves with a measure func installed.
|
|
444
|
+
// Ancestor nodes (containers with children) cannot have a MeasureCache
|
|
445
|
+
// because setMeasureFunc rejects nodes with children; the optional-chain
|
|
446
|
+
// is a deliberate no-op as we propagate dirty up the tree.
|
|
447
|
+
this._measureCache?.clear();
|
|
448
|
+
this._layoutCache?.clear();
|
|
449
|
+
if (this._parent !== null && !this._parent._dirty)
|
|
450
|
+
this._parent.markDirtyFromChild(this);
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Called when a child (or descendant via recursion) is mutated. Marks
|
|
454
|
+
* this node dirty and propagates upward — but stops here if this node
|
|
455
|
+
* is a relayout boundary. The boundary semantics apply only when the
|
|
456
|
+
* mutation originates in a descendant, not when this node's own setters
|
|
457
|
+
* call `markDirty()` directly.
|
|
458
|
+
*
|
|
459
|
+
* See `isLayoutBoundary()` for the boundary definition and rationale.
|
|
460
|
+
*/
|
|
461
|
+
markDirtyFromChild(_child) {
|
|
462
|
+
this._dirty = true;
|
|
463
|
+
this._layoutCache?.clear();
|
|
464
|
+
// Stop dirty propagation at relayout boundaries — see isLayoutBoundary
|
|
465
|
+
// and the Phase 3 spec for why explicit width+height makes the
|
|
466
|
+
// boundary's size independent of descendant changes.
|
|
467
|
+
//
|
|
468
|
+
// Even though we stop dirty propagation here, we still need to inform
|
|
469
|
+
// ancestors that some descendant of theirs is dirty (so the root
|
|
470
|
+
// cache-hit path knows to recurse into this subtree). We do this via
|
|
471
|
+
// the separate `_hasDirtyDescendant` signal, which continues upward
|
|
472
|
+
// past this boundary without marking ancestors dirty.
|
|
473
|
+
if (this.isLayoutBoundary()) {
|
|
474
|
+
if (this._parent !== null)
|
|
475
|
+
this._parent.markHasDirtyDescendant();
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
if (this._parent !== null && !this._parent._dirty)
|
|
479
|
+
this._parent.markDirtyFromChild(this);
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Propagate the "has a dirty descendant somewhere below" signal upward
|
|
483
|
+
* without marking ancestors `_dirty`. Called when a relayout boundary
|
|
484
|
+
* stops the dirty propagation but still needs to let the root know that
|
|
485
|
+
* some subtree needs attention. Stops if the parent is already dirty
|
|
486
|
+
* (in which case the root will recompute everything anyway) or already
|
|
487
|
+
* has a dirty descendant flag set.
|
|
488
|
+
*/
|
|
489
|
+
markHasDirtyDescendant() {
|
|
490
|
+
if (this._hasDirtyDescendant)
|
|
491
|
+
return; // already set; further propagation is a no-op
|
|
492
|
+
this._hasDirtyDescendant = true;
|
|
261
493
|
if (this._parent !== null && !this._parent._dirty)
|
|
262
|
-
this._parent.
|
|
494
|
+
this._parent.markHasDirtyDescendant();
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Set dirty + clear caches + propagate up unconditionally, bypassing
|
|
498
|
+
* the layout-boundary short-circuit in `markDirty()`. Used only by
|
|
499
|
+
* `markDirtyDeep` in `algorithm/cache.ts` for differential-mode and
|
|
500
|
+
* fuzzer validation that need to force the full tree onto the cold
|
|
501
|
+
* path regardless of boundary semantics.
|
|
502
|
+
*
|
|
503
|
+
* @internal
|
|
504
|
+
*/
|
|
505
|
+
_forceDirty() {
|
|
506
|
+
this._dirty = true;
|
|
507
|
+
this._measureCache?.clear();
|
|
508
|
+
this._layoutCache?.clear();
|
|
509
|
+
if (this._parent !== null && !this._parent._dirty)
|
|
510
|
+
this._parent._forceDirty();
|
|
263
511
|
}
|
|
264
512
|
isDirty() {
|
|
265
513
|
return this._dirty;
|
|
266
514
|
}
|
|
267
|
-
/**
|
|
515
|
+
/**
|
|
516
|
+
* Called by the algorithm once layout is fresh. Not part of the public
|
|
517
|
+
* API — consumers should treat layout cleanliness as derived state and
|
|
518
|
+
* never reach in to clear the flag themselves.
|
|
519
|
+
*
|
|
520
|
+
* @internal
|
|
521
|
+
*/
|
|
268
522
|
clearDirty() {
|
|
269
523
|
this._dirty = false;
|
|
524
|
+
this._hasDirtyDescendant = false;
|
|
270
525
|
}
|
|
271
526
|
}
|
|
272
527
|
function writeEdge(box, edge, value) {
|
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAuB,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EASL,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,KAAK,GAAG,CAAC,CAAC;AAChB,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,MAAM,IAAI,GAAG,CAAC,CAAC;AAEf,SAAS,gBAAgB,CAAC,CAAS;IACjC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa,EAAE,IAA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ults for the layout engine.
|
|
3
3
|
*
|
|
4
4
|
* The shape mirrors a subset of CSS Flexbox plus a few terminal-specific
|
|
5
|
-
* choices (no
|
|
5
|
+
* choices (no RTL direction, no baseline alignment in v1).
|
|
6
6
|
*
|
|
7
7
|
* String-literal unions are preferred over numeric enums so that user code
|
|
8
8
|
* reads naturally: `node.setFlexDirection('row')`. Internally we still
|
|
@@ -15,6 +15,7 @@ export type Justify = 'flex-start' | 'flex-end' | 'center' | 'space-between' | '
|
|
|
15
15
|
export type Align = 'auto' | 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around';
|
|
16
16
|
export type PositionType = 'relative' | 'absolute';
|
|
17
17
|
export type Display = 'flex' | 'none';
|
|
18
|
+
export type Overflow = 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
18
19
|
/** A length value in terminal cells, or 'auto' to size from content / flex. */
|
|
19
20
|
export type Length = number | 'auto';
|
|
20
21
|
/**
|
|
@@ -48,6 +49,24 @@ export interface Style {
|
|
|
48
49
|
/** [top, right, bottom, left]; undefined means "edge unconstrained". */
|
|
49
50
|
position: [number | undefined, number | undefined, number | undefined, number | undefined];
|
|
50
51
|
display: Display;
|
|
52
|
+
/**
|
|
53
|
+
* CSS `overflow` shorthand. `overflowX` / `overflowY` win when set
|
|
54
|
+
* individually. `'visible'` — the default — is treated as `'hidden'` at
|
|
55
|
+
* paint time (terminal cell grids cannot show overflow without corrupting
|
|
56
|
+
* sibling cells); the keyword exists so migrating code from web/RN reads
|
|
57
|
+
* naturally.
|
|
58
|
+
*/
|
|
59
|
+
overflow: Overflow;
|
|
60
|
+
overflowX: Overflow;
|
|
61
|
+
overflowY: Overflow;
|
|
62
|
+
/**
|
|
63
|
+
* width / height ratio. When set and exactly one of `width` / `height` is a
|
|
64
|
+
* number (the other being `'auto'`), the auto axis is derived as
|
|
65
|
+
* `set / aspectRatio` (height) or `set * aspectRatio` (width). When both
|
|
66
|
+
* dimensions are explicit, the ratio is ignored — explicit values win.
|
|
67
|
+
* Min/max clamps still apply on each axis after derivation.
|
|
68
|
+
*/
|
|
69
|
+
aspectRatio: number | undefined;
|
|
51
70
|
}
|
|
52
71
|
export declare function defaultStyle(): Style;
|
|
53
72
|
//# sourceMappingURL=style.d.ts.map
|
package/dist/style.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEhF,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC;AAE1D,MAAM,MAAM,OAAO,GACf,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,eAAe,GACf,cAAc,GACd,cAAc,CAAC;AAEnB,MAAM,MAAM,KAAK,GACb,MAAM,GACN,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,SAAS,GACT,eAAe,GACf,cAAc,CAAC;AAEnB,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;AAEnD,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtC,+EAA+E;AAC/E,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAElB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,EAAE,M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AAS,CAAC;CACjC;AAED,wBAAgB,YAAY,IAAI,KAAK,CAsCpC"}
|
package/dist/style.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Style types and defaults for the layout engine.
|
|
3
3
|
*
|
|
4
4
|
* The shape mirrors a subset of CSS Flexbox plus a few terminal-specific
|
|
5
|
-
* choices (no
|
|
5
|
+
* choices (no RTL direction, no baseline alignment in v1).
|
|
6
6
|
*
|
|
7
7
|
* String-literal unions are preferred over numeric enums so that user code
|
|
8
8
|
* reads naturally: `node.setFlexDirection('row')`. Internally we still
|
|
@@ -35,6 +35,10 @@ export function defaultStyle() {
|
|
|
35
35
|
positionType: 'relative',
|
|
36
36
|
position: [undefined, undefined, undefined, undefined],
|
|
37
37
|
display: 'flex',
|
|
38
|
+
overflow: 'visible',
|
|
39
|
+
overflowX: 'visible',
|
|
40
|
+
overflowY: 'visible',
|
|
41
|
+
aspectRatio: undefined,
|
|
38
42
|
};
|
|
39
43
|
}
|
|
40
44
|
//# sourceMappingURL=style.js.map
|
package/dist/style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA0FH,MAAM,UAAU,YAAY;IAC1B,OAAO;QACL,aAAa,EAAE,QAAQ;QACvB,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,CAAC;QACX,yEAAyE;QACzE,mDAAmD;QACnD,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,MAAM;QAEjB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,SAAS;QACnB,SAAS,EAAE,SAAS;QAEpB,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACrB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACpB,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,CAAC;QAEZ,cAAc,EAAE,YAAY;QAC5B,UAAU,EAAE,SAAS;QACrB,YAAY,EAAE,YAAY;QAC1B,SAAS,EAAE,MAAM;QAEjB,YAAY,EAAE,UAAU;QACxB,QAAQ,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;QAEtD,OAAO,EAAE,MAAM;QAEf,QAAQ,EAAE,SAAS;QACnB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QAEpB,WAAW,EAAE,SAAS;KACvB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pilates/core",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Headless flex layout engine for terminal UIs. Pure TypeScript, zero dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"author": "Zhijie Wang",
|
|
6
7
|
"type": "module",
|
|
7
8
|
"main": "./dist/index.js",
|
|
8
9
|
"types": "./dist/index.d.ts",
|
|
@@ -19,12 +20,12 @@
|
|
|
19
20
|
"sideEffects": false,
|
|
20
21
|
"repository": {
|
|
21
22
|
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/
|
|
23
|
+
"url": "git+https://github.com/pilatesjs/pilates.git",
|
|
23
24
|
"directory": "packages/core"
|
|
24
25
|
},
|
|
25
|
-
"homepage": "https://github.com/
|
|
26
|
+
"homepage": "https://github.com/pilatesjs/pilates#readme",
|
|
26
27
|
"bugs": {
|
|
27
|
-
"url": "https://github.com/
|
|
28
|
+
"url": "https://github.com/pilatesjs/pilates/issues"
|
|
28
29
|
},
|
|
29
30
|
"keywords": [
|
|
30
31
|
"terminal",
|
|
@@ -32,7 +33,6 @@
|
|
|
32
33
|
"cli",
|
|
33
34
|
"layout",
|
|
34
35
|
"flexbox",
|
|
35
|
-
"yoga",
|
|
36
36
|
"headless"
|
|
37
37
|
],
|
|
38
38
|
"engines": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "tsc -b",
|
|
43
|
-
"typecheck": "tsc
|
|
43
|
+
"typecheck": "tsc -p tsconfig.typecheck.json",
|
|
44
44
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
45
45
|
}
|
|
46
46
|
}
|