@n-uf/placement 26.12.1 → 26.12.3
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 +16 -0
- package/dist/stack.d.ts +8 -1
- package/dist/stack.js +3 -2
- 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,22 @@ 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.3
|
|
9
|
+
|
|
10
|
+
- **Changed (breaking, behavior):** `decideSplit` and `layoutSplit`: a fixed length that is not kept is now held
|
|
11
|
+
between the two needs, `min(max(length, own need), room − need of its sibling)`. Before, a fixed length under its
|
|
12
|
+
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
|
|
13
|
+
panes squeezed at any size; it now lands at that need. Where the two needs don't fit, both sides are squeezed in
|
|
14
|
+
proportion to their needs, whatever the length (before, a fixed side's need in the squeeze was capped at its length).
|
|
15
|
+
A kept length is still exact, and a length across a split is unchanged. A host that wants a length under a pane's
|
|
16
|
+
floor honoured reports the pane's floor as at most that length. `splitNeed` keeps only the kept and across
|
|
17
|
+
exceptions. See docs/decisions/0019-a-fixed-length-is-honoured-between-the-needs.md.
|
|
18
|
+
|
|
19
|
+
## 26.12.2
|
|
20
|
+
|
|
21
|
+
- **Added: `RANK_LEVEL`** (`@n-uf/placement/stack`, 1000), the rank a pin (`keep`) adds per level to a group's later
|
|
22
|
+
forms in `controlLadder`. A caller that ranks its own forms reads a rank within its level as `rank % RANK_LEVEL`.
|
|
23
|
+
|
|
8
24
|
## 26.12.1
|
|
9
25
|
|
|
10
26
|
No changes in `@n-uf/placement`. Released in step with `@n-uf/motion` and `@n-uf/docking`, which share the version.
|
package/dist/stack.d.ts
CHANGED
|
@@ -572,6 +572,13 @@ interface ControlLadder {
|
|
|
572
572
|
readonly row: readonly StackForm[];
|
|
573
573
|
readonly column?: readonly StackForm[];
|
|
574
574
|
}
|
|
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;
|
|
575
582
|
/** `spec`'s forms: the row ladder, and the column ladder when `spec.column` is given. Pure. */
|
|
576
583
|
declare function controlLadder(spec: ControlLadderSpec): ControlLadder;
|
|
577
584
|
|
|
@@ -726,4 +733,4 @@ interface FloatFitOptions {
|
|
|
726
733
|
}
|
|
727
734
|
declare function fitFloat(want: Rect, stage: Rect, avoid?: readonly Rect[], options?: FloatFitOptions): FloatFit;
|
|
728
735
|
|
|
729
|
-
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, formMain, formMenu, formOwnCross, formSetsCross, formStepGroup, itemSteps, resetBetween, resetLengths, resizeBetween, stackGaps, withItem, wrapCross, wrapLines, wrapRows };
|
|
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, RANK_LEVEL, 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, formMain, formMenu, formOwnCross, formSetsCross, formStepGroup, itemSteps, resetBetween, resetLengths, resizeBetween, stackGaps, withItem, wrapCross, wrapLines, wrapRows };
|
package/dist/stack.js
CHANGED
|
@@ -560,9 +560,9 @@ var sizesOf = (fit) => sizes.get(fit);
|
|
|
560
560
|
// src/stack/ladder.ts
|
|
561
561
|
var nonNeg2 = (x) => typeof x === "number" && Number.isFinite(x) ? Math.max(0, x) : 0;
|
|
562
562
|
var RANK_TIER = 100;
|
|
563
|
-
var
|
|
563
|
+
var RANK_LEVEL = 1e3;
|
|
564
564
|
function controlLadder(spec) {
|
|
565
|
-
const keep = Math.max(0, Number.isFinite(spec.keep) ? spec.keep : 0) *
|
|
565
|
+
const keep = Math.max(0, Number.isFinite(spec.keep) ? spec.keep : 0) * RANK_LEVEL;
|
|
566
566
|
const cross = nonNeg2(spec.cross);
|
|
567
567
|
const grip = nonNeg2(spec.grip);
|
|
568
568
|
const gap = nonNeg2(spec.gap);
|
|
@@ -882,6 +882,7 @@ function fitFloat(want, stage, avoid = [], options = {}) {
|
|
|
882
882
|
export {
|
|
883
883
|
DEFAULT_MENU,
|
|
884
884
|
DEFAULT_RAIL,
|
|
885
|
+
RANK_LEVEL,
|
|
885
886
|
controlLadder,
|
|
886
887
|
cutEdges,
|
|
887
888
|
dividers,
|