@n-uf/placement 26.12.2 → 26.12.4
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/CHANGELOG.md +39 -0
- package/dist/stack.d.ts +34 -15
- package/dist/stack.js +40 -22
- package/dist/stack.js.map +1 -1
- package/dist/tiling.d.ts +13 -9
- package/dist/tiling.js +2 -2
- package/dist/tiling.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,45 @@ Versions are calendar versions, `YY.M.R` (year, month of the release, counter wi
|
|
|
5
5
|
|
|
6
6
|
Unreleased entries live in `changes/` until a release joins them.
|
|
7
7
|
|
|
8
|
+
## 26.12.4
|
|
9
|
+
|
|
10
|
+
- **Changed (breaking):** a form pinned by adding 1000 to its rank moves that pin to `level` (`StackForm.level`, a
|
|
11
|
+
whole number 0 or more). Such a form still orders the same on a bar, but in a column drawn as a rail it now counts as
|
|
12
|
+
a rank of 1000 or more, so panel tiles go into the » after it steps, not before. The give-way order reads the level
|
|
13
|
+
first, then the rank, everywhere: giving way, a batch into the » (which never takes a step into a higher level while
|
|
14
|
+
a lower one is open), growing back and the squeeze, so a priority can no longer carry a step past a pin.
|
|
15
|
+
`controlLadder`'s `keep` now sets `level` on the partial folds, `fold`, `menu` and the column's menu, and its ranks
|
|
16
|
+
are the same at every `keep`. `RANK_LEVEL` is removed. A rank may be any finite number, negative included, and ranks
|
|
17
|
+
are relative. See docs/decisions/0021-a-pin-is-a-forms-level.md.
|
|
18
|
+
- **Changed (breaking, behavior):** a bar with a growing title and a pinned group now shrinks the title before the
|
|
19
|
+
pinned group hides a control. While a title holds its natural length, steps are taken only at the lowest open level,
|
|
20
|
+
the title's shrink counted at its own level, so a title given a level shrinks after every step of a lower level,
|
|
21
|
+
whatever its kind; the pinned group's tier steps (level 0) still shorten its controls before the title shrinks.
|
|
22
|
+
Before, the pinned group's partial folds, being `row` steps, were taken while the title kept its natural length.
|
|
23
|
+
- **Added:** `formLevel` and `formRank`, the one reading of a form's level (a whole number, 0 or more; anything else
|
|
24
|
+
0) and rank (any finite number; anything else 0).
|
|
25
|
+
- **Added:** `StackStep.held`, set on a stack with a growing fixed item (a title): whether it still held its natural
|
|
26
|
+
length when the step was taken. A history without it (from an older version) is read by each step's kind: a step to
|
|
27
|
+
a form of the same kind was taken while the title held.
|
|
28
|
+
- **Fixed:** growing back beside a title is the exact reverse of giving way. A step taken after the title shrank came
|
|
29
|
+
back only with the title at its natural length, so growth could stall, and a step into the » that opened only after
|
|
30
|
+
the title shrank could leave items in the » with room to spare. Each step now comes back under the hold it was taken
|
|
31
|
+
with, and a fit whose history has a step taken after the title's shrink starts with the title shrunk, as a fresh fit
|
|
32
|
+
has it.
|
|
33
|
+
- **Fixed:** a batch into the » of a lower level than a title's now comes before the title shrinks, like every other
|
|
34
|
+
step of a lower level.
|
|
35
|
+
|
|
36
|
+
## 26.12.3
|
|
37
|
+
|
|
38
|
+
- **Changed (breaking, behavior):** `decideSplit` and `layoutSplit`: a fixed length that is not kept is now held
|
|
39
|
+
between the two needs, `min(max(length, own need), room − need of its sibling)`. Before, a fixed length under its
|
|
40
|
+
side's need was taken as it is, so a split node pinned shorter than its panes' need was drawn at the pin with its
|
|
41
|
+
panes squeezed at any size; it now lands at that need. Where the two needs don't fit, both sides are squeezed in
|
|
42
|
+
proportion to their needs, whatever the length (before, a fixed side's need in the squeeze was capped at its length).
|
|
43
|
+
A kept length is still exact, and a length across a split is unchanged. A host that wants a length under a pane's
|
|
44
|
+
floor honoured reports the pane's floor as at most that length. `splitNeed` keeps only the kept and across
|
|
45
|
+
exceptions. See docs/decisions/0019-a-fixed-length-is-honoured-between-the-needs.md.
|
|
46
|
+
|
|
8
47
|
## 26.12.2
|
|
9
48
|
|
|
10
49
|
- **Added: `RANK_LEVEL`** (`@n-uf/placement/stack`, 1000), the rank a pin (`keep`) adds per level to a group's later
|
package/dist/stack.d.ts
CHANGED
|
@@ -118,12 +118,21 @@ interface StackForm {
|
|
|
118
118
|
/** Icons only. Default: true for the kind `icons`. A window model's compact (icons-only) edge takes it. */
|
|
119
119
|
readonly compact?: boolean;
|
|
120
120
|
/**
|
|
121
|
-
* Give-way order (default 0)
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
121
|
+
* Give-way order within the form's `level` (default 0): any finite number, negative included; anything else reads 0
|
|
122
|
+
* (`formRank`). When the stack is too long, the step taken is the one into the next form of the lowest level, then of
|
|
123
|
+
* the lowest rank, across all items (the form the item would take, not the one it leaves); ties go unkept before kept,
|
|
124
|
+
* then the item used longest ago, then the later in the stack. Adding one number to every rank of a stack changes
|
|
125
|
+
* nothing.
|
|
125
126
|
*/
|
|
126
127
|
readonly rank?: number;
|
|
128
|
+
/**
|
|
129
|
+
* The form's level (default 0): a whole number, 0 or more; anything else reads 0 (`formLevel`). A level comes before
|
|
130
|
+
* the rank in the order: every step into a form of a lower level is taken before any step into a form of a higher
|
|
131
|
+
* level, whatever their ranks. It is a pin: `controlLadder` sets it from `keep` on a pinned group's partial folds, fold
|
|
132
|
+
* and menu, so every group of a lower level gives way entirely before the pinned one folds a control. Room coming back
|
|
133
|
+
* reads the same order backwards.
|
|
134
|
+
*/
|
|
135
|
+
readonly level?: number;
|
|
127
136
|
/**
|
|
128
137
|
* A form whose length depends on the cross size it gets (meant for a column of words). With it, `main` and `cross` are
|
|
129
138
|
* computed and the given ones ignored: the rows are laid once the stack's cross size is known (beside the lead, a
|
|
@@ -189,6 +198,10 @@ declare const itemSteps: (item: {
|
|
|
189
198
|
readonly fixed?: boolean;
|
|
190
199
|
readonly stepping?: boolean;
|
|
191
200
|
}) => boolean;
|
|
201
|
+
/** A form's rank as the solver reads it: `rank` when it is a finite number, else 0. */
|
|
202
|
+
declare const formRank: (f: StackForm) => number;
|
|
203
|
+
/** A form's level as the solver reads it: `level` when it is a whole number, 0 or more, else 0. */
|
|
204
|
+
declare const formLevel: (f: StackForm) => number;
|
|
192
205
|
/** Whether a form has no room of its own, the » entry standing for it (`menu`, default: the kind `menu`). */
|
|
193
206
|
declare const formMenu: (f: StackForm) => boolean;
|
|
194
207
|
/** Whether a form is drawn at its own size across under `ownCross` (`ownCross`, default: the group kinds). */
|
|
@@ -446,6 +459,13 @@ interface StackStep {
|
|
|
446
459
|
readonly from: number;
|
|
447
460
|
readonly to: number;
|
|
448
461
|
readonly batch?: number;
|
|
462
|
+
/**
|
|
463
|
+
* Set on a stack with a growing fixed item (a title): `true` when the step was taken while it held its natural length,
|
|
464
|
+
* `false` when it came after its shrink. Growing back undoes a step under the same hold, and a fit whose history still
|
|
465
|
+
* holds a step taken after the shrink starts with the title shrunk. Without it (a history from an older version) the
|
|
466
|
+
* step's level and kind stand in.
|
|
467
|
+
*/
|
|
468
|
+
readonly held?: boolean;
|
|
449
469
|
}
|
|
450
470
|
/** What `fitStack` takes besides the input. */
|
|
451
471
|
interface FitOptions {
|
|
@@ -488,7 +508,7 @@ interface FitOptions {
|
|
|
488
508
|
* step that can't be undone stops all growth. So growing back is exactly the reverse of giving way: at every length the
|
|
489
509
|
* way back holds what the way down held. A `previous` without a history (built by hand, or by an older version) grows
|
|
490
510
|
* the old way: a fresh fit that is a pure gain over the kept one, else the item that gave way most recently by its
|
|
491
|
-
* rank, `kept` and age first, one at a time, menu items out only when that keeps the order. A `previous` with no `need`
|
|
511
|
+
* level, rank, `kept` and age first, one at a time, menu items out only when that keeps the order. A `previous` with no `need`
|
|
492
512
|
* (one an app built by hand) is no help and the fresh fit is returned.
|
|
493
513
|
*/
|
|
494
514
|
declare function fitStack(input: StackInput, options?: FitOptions): StackFit;
|
|
@@ -525,6 +545,9 @@ declare function fitStack(input: StackInput, options?: FitOptions): StackFit;
|
|
|
525
545
|
* Ranks are spaced by step type in fixed bands whatever a group's tier count: tier steps in [100, 400), partial folds
|
|
526
546
|
* 400 + k / n, fold 500, menu 600. So the same-tier steps of several groups interleave, and a partial fold never comes
|
|
527
547
|
* before another group's tier step, even when the groups have different tier counts.
|
|
548
|
+
*
|
|
549
|
+
* A pin (`keep`) is a level, not a rank: the pinned group's partial folds, fold and menu carry `level: keep`, so they come
|
|
550
|
+
* after every step of a lower level, and their ranks stay the same.
|
|
528
551
|
*/
|
|
529
552
|
|
|
530
553
|
/** One control of a group: an id and its length along the stack per tier. */
|
|
@@ -562,8 +585,11 @@ interface ControlLadderSpec {
|
|
|
562
585
|
readonly cross?: number;
|
|
563
586
|
};
|
|
564
587
|
/**
|
|
565
|
-
* A pinned primary's level (default 0
|
|
566
|
-
*
|
|
588
|
+
* A pinned primary's level (default 0; a whole number, 0 or more, anything else reads 0, as `StackForm.level`): its
|
|
589
|
+
* partial folds, fold and menu (and the column's menu) carry it as their `level`, so every group of a lower level gives
|
|
590
|
+
* way entirely before it folds a control, and a growing title of a lower level shrinks first, whatever the ranks and
|
|
591
|
+
* priorities. Tier steps and the first row stay at level 0 (they shorten its controls before a title shrinks), and the
|
|
592
|
+
* ranks are the same at every level.
|
|
567
593
|
*/
|
|
568
594
|
readonly keep?: number;
|
|
569
595
|
}
|
|
@@ -572,13 +598,6 @@ interface ControlLadder {
|
|
|
572
598
|
readonly row: readonly StackForm[];
|
|
573
599
|
readonly column?: readonly StackForm[];
|
|
574
600
|
}
|
|
575
|
-
/**
|
|
576
|
-
* One level of give-way ranks: a pin (`ControlLadderSpec.keep`) raises a group's later forms by this much per level, so a
|
|
577
|
-
* form's rank is its level times `RANK_LEVEL` plus its rank within the level (`rank % RANK_LEVEL`, under `RANK_LEVEL`).
|
|
578
|
-
* A consumer that ranks a step of its own after "every shorter drawn form" of a stack reads the forms' ranks within their
|
|
579
|
-
* level, so a pin moves its own item and nothing else.
|
|
580
|
-
*/
|
|
581
|
-
declare const RANK_LEVEL = 1000;
|
|
582
601
|
/** `spec`'s forms: the row ladder, and the column ladder when `spec.column` is given. Pure. */
|
|
583
602
|
declare function controlLadder(spec: ControlLadderSpec): ControlLadder;
|
|
584
603
|
|
|
@@ -733,4 +752,4 @@ interface FloatFitOptions {
|
|
|
733
752
|
}
|
|
734
753
|
declare function fitFloat(want: Rect, stage: Rect, avoid?: readonly Rect[], options?: FloatFitOptions): FloatFit;
|
|
735
754
|
|
|
736
|
-
export { type ControlLadder, type ControlLadderSpec, type CrossLimits, DEFAULT_MENU, DEFAULT_RAIL, type EdgeBand, type EdgeCut, type FitOptions, type FloatFit, type FloatFitOptions, type GroupFormKind, type LadderControl, type MainSize, type PanelFormKind, type PlacedStackItem,
|
|
755
|
+
export { type ControlLadder, type ControlLadderSpec, type CrossLimits, DEFAULT_MENU, DEFAULT_RAIL, type EdgeBand, type EdgeCut, type FitOptions, type FloatFit, type FloatFitOptions, type GroupFormKind, type LadderControl, type MainSize, type PanelFormKind, type PlacedStackItem, type StackAxis, type StackDivider, type StackFit, type StackForm, type StackFormKind, type StackGap, type StackGapOptions, type StackGapRefusal, type StackInput, type StackItem, type StackLengths, type StackMenu, type StackNote, type StackNoteCode, type StackStep, type WrapSpec, controlLadder, cutEdges, dividers, fitFloat, fitStack, formBody, formCompact, formCrossMin, formFitsCross, formFolded, formLevel, formMain, formMenu, formOwnCross, formRank, formSetsCross, formStepGroup, itemSteps, resetBetween, resetLengths, resizeBetween, stackGaps, withItem, wrapCross, wrapLines, wrapRows };
|
package/dist/stack.js
CHANGED
|
@@ -51,6 +51,8 @@ function cutEdges(stage, bands) {
|
|
|
51
51
|
|
|
52
52
|
// src/stack/model.ts
|
|
53
53
|
var itemSteps = (item) => item.fixed !== true || item.stepping === true;
|
|
54
|
+
var formRank = (f) => typeof f.rank === "number" && Number.isFinite(f.rank) ? f.rank : 0;
|
|
55
|
+
var formLevel = (f) => typeof f.level === "number" && Number.isInteger(f.level) && f.level > 0 ? f.level : 0;
|
|
54
56
|
var formMenu = (f) => f.menu ?? f.kind === "menu";
|
|
55
57
|
var formOwnCross = (f) => f.ownCross ?? GROUP_KINDS.has(f.kind);
|
|
56
58
|
var formStepGroup = (f) => f.stepGroup ?? f.kind;
|
|
@@ -166,9 +168,10 @@ var finite2 = (x, fallback = 0) => Number.isFinite(x) ? x : fallback;
|
|
|
166
168
|
var mainOf = formMain;
|
|
167
169
|
var crossMin = formCrossMin;
|
|
168
170
|
var crossNatural = (f) => f.wrap ? wrapCross(f.wrap).natural : finite2(f.cross.natural);
|
|
169
|
-
var
|
|
170
|
-
function givesWayBefore(items, a,
|
|
171
|
-
|
|
171
|
+
var formOrder = (fa, fb) => formLevel(fa) - formLevel(fb) || formRank(fa) - formRank(fb);
|
|
172
|
+
function givesWayBefore(items, a, fa, b, fb) {
|
|
173
|
+
const order = formOrder(fa, fb);
|
|
174
|
+
if (order !== 0) return order;
|
|
172
175
|
const ka = items[a].kept ? 1 : 0;
|
|
173
176
|
const kb = items[b].kept ? 1 : 0;
|
|
174
177
|
if (ka !== kb) return ka - kb;
|
|
@@ -181,7 +184,7 @@ function victim(items, to) {
|
|
|
181
184
|
let best = -1;
|
|
182
185
|
for (let i = 0; i < items.length; i++) {
|
|
183
186
|
if (to[i] < 0 || !itemSteps(items[i])) continue;
|
|
184
|
-
if (best < 0 || givesWayBefore(items, i,
|
|
187
|
+
if (best < 0 || givesWayBefore(items, i, items[i].forms[to[i]], best, items[best].forms[to[best]]) < 0) best = i;
|
|
185
188
|
}
|
|
186
189
|
return best;
|
|
187
190
|
}
|
|
@@ -247,7 +250,7 @@ function solve(input, previous, seed, grow = false) {
|
|
|
247
250
|
const menuOrder = [];
|
|
248
251
|
const step = (i, j, batch) => {
|
|
249
252
|
if (!firstStep.includes(i)) firstStep.push(i);
|
|
250
|
-
hist.push({ id: items[i].id, from: at[i], to: j, ...batch !== void 0 ? { batch } : {} });
|
|
253
|
+
hist.push({ id: items[i].id, from: at[i], to: j, ...batch !== void 0 ? { batch } : {}, ...idx.some(holds) ? { held: hold } : {} });
|
|
251
254
|
withHistory.add(items[i].id);
|
|
252
255
|
at[i] = j;
|
|
253
256
|
if (isMenu(form(i)) && !menuOrder.includes(i)) menuOrder.push(i);
|
|
@@ -269,6 +272,7 @@ function solve(input, previous, seed, grow = false) {
|
|
|
269
272
|
};
|
|
270
273
|
const holds = (i) => !itemSteps(items[i]) && form(i).main.grows === true;
|
|
271
274
|
let hold = idx.some(holds);
|
|
275
|
+
const holdLevel = () => idx.reduce((m, i) => holds(i) ? Math.min(m, formLevel(form(i))) : m, Infinity);
|
|
272
276
|
const minSumWith = (held) => {
|
|
273
277
|
const c = items.some((it) => it.forms.some((f) => f.wrap)) ? crossOf() : 0;
|
|
274
278
|
return idx.reduce((s, i) => s + mainOf(form(i), held && holds(i) ? "natural" : "min", c), 0) + (inMenu() ? menuMain(input) : 0) + gapsOf() + sp.start + sp.end;
|
|
@@ -320,7 +324,7 @@ function solve(input, previous, seed, grow = false) {
|
|
|
320
324
|
};
|
|
321
325
|
if (seed) seed.need = minSumWith(false);
|
|
322
326
|
if (grow) {
|
|
323
|
-
const comesBefore = (a, b) => givesWayBefore(items, b,
|
|
327
|
+
const comesBefore = (a, b) => givesWayBefore(items, b, items[b].forms[at[b]], a, items[a].forms[at[a]]) < 0;
|
|
324
328
|
const index = new Map(items.map((it, i) => [it.id, i]));
|
|
325
329
|
let stuck = false;
|
|
326
330
|
const undoes = (n, c0) => {
|
|
@@ -328,7 +332,8 @@ function solve(input, previous, seed, grow = false) {
|
|
|
328
332
|
const changed = [...new Set(group.map((s) => index.get(s.id)))];
|
|
329
333
|
const was = changed.map((i) => at[i]);
|
|
330
334
|
const forms = (s) => items[index.get(s.id)].forms;
|
|
331
|
-
|
|
335
|
+
const held = (s) => s.held ?? formStepGroup(forms(s)[s.from]) === formStepGroup(forms(s)[s.to]);
|
|
336
|
+
hold = group.every(held) && idx.some(holds);
|
|
332
337
|
for (const s of [...group].reverse()) at[index.get(s.id)] = s.from;
|
|
333
338
|
if (minSum() <= length + EPS && crossOf() === c0 && changed.every((j) => !tooWide(j, c0))) return true;
|
|
334
339
|
changed.forEach((i, k) => at[i] = was[k]);
|
|
@@ -374,7 +379,7 @@ function solve(input, previous, seed, grow = false) {
|
|
|
374
379
|
for (const [q, i] of queue.entries()) {
|
|
375
380
|
if (!isMenu(form(i))) continue;
|
|
376
381
|
const ahead = queue.slice(0, q);
|
|
377
|
-
if (!ahead.every((j) => isMenu(form(j)) || at[i] - 1 - start[i] >= at[j] - start[j] &&
|
|
382
|
+
if (!ahead.every((j) => isMenu(form(j)) || at[i] - 1 - start[i] >= at[j] - start[j] && formOrder(form(i), form(j)) >= 0)) break;
|
|
378
383
|
inside2.push(i);
|
|
379
384
|
}
|
|
380
385
|
let out = false;
|
|
@@ -388,7 +393,7 @@ function solve(input, previous, seed, grow = false) {
|
|
|
388
393
|
if (!out) break;
|
|
389
394
|
}
|
|
390
395
|
}
|
|
391
|
-
hold = idx.some(holds);
|
|
396
|
+
hold = idx.some(holds) && !hist.some((s) => s.held === false);
|
|
392
397
|
let cross = crossOf();
|
|
393
398
|
let overflow = 0;
|
|
394
399
|
const guard = 2 * items.reduce((s, it) => s + it.forms.length, 0) + 2;
|
|
@@ -406,13 +411,24 @@ function solve(input, previous, seed, grow = false) {
|
|
|
406
411
|
if (over <= EPS) break;
|
|
407
412
|
const to = idx.map((i) => itemSteps(items[i]) ? stepTo(i) : -1);
|
|
408
413
|
if (hold) {
|
|
414
|
+
const low = idx.reduce((m, i) => to[i] >= 0 ? Math.min(m, formLevel(items[i].forms[to[i]])) : m, holdLevel());
|
|
409
415
|
const variant = victim(
|
|
410
416
|
items,
|
|
411
|
-
idx.map((i) => to[i] >= 0 && sameKind(i, to[i]) ? to[i] : -1)
|
|
417
|
+
idx.map((i) => to[i] >= 0 && sameKind(i, to[i]) && formLevel(items[i].forms[to[i]]) <= low ? to[i] : -1)
|
|
412
418
|
);
|
|
413
|
-
if (variant >= 0)
|
|
414
|
-
|
|
415
|
-
|
|
419
|
+
if (variant >= 0) {
|
|
420
|
+
step(variant, to[variant]);
|
|
421
|
+
continue;
|
|
422
|
+
}
|
|
423
|
+
const top = holdLevel();
|
|
424
|
+
const below = idx.map((i) => {
|
|
425
|
+
const j = to[i] < 0 && !inMenu() && itemSteps(items[i]) ? menuFormAfter(i) : -1;
|
|
426
|
+
return j >= 0 && formLevel(items[i].forms[j]) < top ? j : -1;
|
|
427
|
+
});
|
|
428
|
+
if (low >= top && menuBatch(below) === null) {
|
|
429
|
+
hold = false;
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
416
432
|
}
|
|
417
433
|
const pool = idx.map((i) => to[i] < 0 && !inMenu() && itemSteps(items[i]) ? menuFormAfter(i) : -1);
|
|
418
434
|
const v = victim(
|
|
@@ -420,7 +436,8 @@ function solve(input, previous, seed, grow = false) {
|
|
|
420
436
|
idx.map((i) => to[i] >= 0 ? to[i] : pool[i])
|
|
421
437
|
);
|
|
422
438
|
if (v >= 0 && to[v] < 0) {
|
|
423
|
-
const
|
|
439
|
+
const open = idx.reduce((m, i) => to[i] >= 0 && itemSteps(items[i]) ? Math.min(m, formLevel(items[i].forms[to[i]])) : m, Infinity);
|
|
440
|
+
const batch = menuBatch(pool.map((j, i) => j >= 0 && formLevel(items[i].forms[j]) <= open ? j : -1));
|
|
424
441
|
if (batch) {
|
|
425
442
|
const id = batches++;
|
|
426
443
|
for (const [i, j] of batch) step(i, j, id);
|
|
@@ -496,7 +513,7 @@ function solve(input, previous, seed, grow = false) {
|
|
|
496
513
|
short -= take;
|
|
497
514
|
};
|
|
498
515
|
const oneByOne = (group) => {
|
|
499
|
-
const order = [...group].sort((a, b) => givesWayBefore(items, a,
|
|
516
|
+
const order = [...group].sort((a, b) => givesWayBefore(items, a, form(a), b, form(b)));
|
|
500
517
|
for (const i of order) {
|
|
501
518
|
if (short <= 0) return;
|
|
502
519
|
const take = Math.min(short, size.get(i));
|
|
@@ -560,16 +577,16 @@ var sizesOf = (fit) => sizes.get(fit);
|
|
|
560
577
|
// src/stack/ladder.ts
|
|
561
578
|
var nonNeg2 = (x) => typeof x === "number" && Number.isFinite(x) ? Math.max(0, x) : 0;
|
|
562
579
|
var RANK_TIER = 100;
|
|
563
|
-
var RANK_LEVEL = 1e3;
|
|
564
580
|
function controlLadder(spec) {
|
|
565
|
-
const
|
|
581
|
+
const level = formLevel({ kind: "row", main: { min: 0, natural: 0 }, cross: { natural: 0 }, ...spec.keep !== void 0 ? { level: spec.keep } : {} });
|
|
582
|
+
const pin = level > 0 ? { level } : {};
|
|
566
583
|
const cross = nonNeg2(spec.cross);
|
|
567
584
|
const grip = nonNeg2(spec.grip);
|
|
568
585
|
const gap = nonNeg2(spec.gap);
|
|
569
586
|
const more = nonNeg2(spec.more);
|
|
570
587
|
const column = spec.column ? [
|
|
571
588
|
{ kind: "icons", main: { min: nonNeg2(spec.column.icons), natural: nonNeg2(spec.column.icons) }, cross: { natural: nonNeg2(spec.column.cross ?? spec.cross) }, ...grip > 0 ? { grip } : {} },
|
|
572
|
-
{ kind: "menu", main: { min: 0, natural: 0 }, cross: { natural: 0 }, ...
|
|
589
|
+
{ kind: "menu", main: { min: 0, natural: 0 }, cross: { natural: 0 }, ...pin }
|
|
573
590
|
] : void 0;
|
|
574
591
|
const controls = spec.controls;
|
|
575
592
|
const n = controls.length;
|
|
@@ -595,10 +612,10 @@ function controlLadder(spec) {
|
|
|
595
612
|
for (let k = 1; k < n; k++) {
|
|
596
613
|
const hidden = new Set(order.slice(0, k));
|
|
597
614
|
const shown = all.filter((i) => !hidden.has(i));
|
|
598
|
-
row.push(form(rowLength(shown, more), { kind: "row", rank: 4 * RANK_TIER + k / n
|
|
615
|
+
row.push(form(rowLength(shown, more), { kind: "row", rank: 4 * RANK_TIER + k / n, ...pin, hides: ids(hidden), tiers: tiersOf(shown) }));
|
|
599
616
|
}
|
|
600
|
-
row.push(form(grip + more, { kind: "fold", rank: 5 * RANK_TIER
|
|
601
|
-
row.push({ kind: "menu", main: { min: 0, natural: 0 }, cross: { natural: 0 }, rank: 6 * RANK_TIER
|
|
617
|
+
row.push(form(grip + more, { kind: "fold", rank: 5 * RANK_TIER, ...pin, hides: ids(new Set(all)) }));
|
|
618
|
+
row.push({ kind: "menu", main: { min: 0, natural: 0 }, cross: { natural: 0 }, rank: 6 * RANK_TIER, ...pin });
|
|
602
619
|
return { row, ...column ? { column } : {} };
|
|
603
620
|
}
|
|
604
621
|
|
|
@@ -882,7 +899,6 @@ function fitFloat(want, stage, avoid = [], options = {}) {
|
|
|
882
899
|
export {
|
|
883
900
|
DEFAULT_MENU,
|
|
884
901
|
DEFAULT_RAIL,
|
|
885
|
-
RANK_LEVEL,
|
|
886
902
|
controlLadder,
|
|
887
903
|
cutEdges,
|
|
888
904
|
dividers,
|
|
@@ -893,9 +909,11 @@ export {
|
|
|
893
909
|
formCrossMin,
|
|
894
910
|
formFitsCross,
|
|
895
911
|
formFolded,
|
|
912
|
+
formLevel,
|
|
896
913
|
formMain,
|
|
897
914
|
formMenu,
|
|
898
915
|
formOwnCross,
|
|
916
|
+
formRank,
|
|
899
917
|
formSetsCross,
|
|
900
918
|
formStepGroup,
|
|
901
919
|
itemSteps,
|