@n-uf/placement 26.11.23 → 26.11.24
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 +8 -0
- package/README.md +6 -3
- package/dist/{chunk-6WFVXHA3.js → chunk-XUC5BU4N.js} +8 -3
- package/dist/chunk-XUC5BU4N.js.map +1 -0
- package/dist/scene-cases.d.ts +1 -1
- package/dist/scene-cases.js +1 -1
- package/dist/scene.d.ts +2 -2
- package/dist/scene.js +3 -1
- package/dist/{targets-DgmHP5PY.d.ts → targets-DwwIWPpN.d.ts} +9 -5
- package/package.json +1 -1
- package/dist/chunk-6WFVXHA3.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
Versions are calendar versions, `YY.M.R` (year, month of the release, counter within the month), shared with
|
|
4
4
|
`@n-uf/motion`: both packages carry the same version, and a release bumps both.
|
|
5
5
|
|
|
6
|
+
## 26.11.24
|
|
7
|
+
|
|
8
|
+
- `@n-uf/placement/scene`, **fixed:** `columnRoom` counts a side toolbar bar. A left or right bar that lays out an item
|
|
9
|
+
never folds (unless it gives way), so its width (and the gutter after it, when it lies inside the inset) comes off the room before the
|
|
10
|
+
column's minimum is tested, and the `no-column-room` note's `width` is the room left after it. Anchors and rails
|
|
11
|
+
still don't count (they fold into the rail), nor do empty or all-closed bars. Layouts don't change. New
|
|
12
|
+
**`isSideBar(scene, edge)`** (a side toolbar bar, by its kinds; `isOutsideSideBar` is it with `outsideInset`).
|
|
13
|
+
|
|
6
14
|
## 26.11.23
|
|
7
15
|
|
|
8
16
|
- `@n-uf/placement/scene`, **fixed:** a side bar outside the inset counts for the side's order only while it lays out
|
package/README.md
CHANGED
|
@@ -883,7 +883,9 @@ none lays out as before.
|
|
|
883
883
|
in a side bar. With nothing docked, the content is the whole stage.
|
|
884
884
|
- **`layout.columnRoom`** and the note **`no-column-room`** (`{ width, need }`): with `contentMin` and a dynamic column,
|
|
885
885
|
whether one column at its minimum fits beside the content's minimum. Anchors and rails don't count: every column, an
|
|
886
|
-
anchor included, can fold into its rail. A
|
|
886
|
+
anchor included, can fold into its rail. A side toolbar bar that lays out an item does count: it never folds (unless it gives way), so its
|
|
887
|
+
width (and the gutter after it, when it lies inside the inset) comes off the room before the column's minimum is
|
|
888
|
+
tested, and the note's `width` is the room left after it; an empty or all-closed bar counts for nothing. A docked column counts whether or not its side has a rail. Before any column
|
|
887
889
|
holds an item, the `Scene.columns` template answers, with the larger of its `cross.min` and the least width the items
|
|
888
890
|
it takes need, so docking a panel doesn't flip the answer. It answers as if the one column were open: under
|
|
889
891
|
`insetWhen: "docked"` with nothing docked it counts the inset that column would bring, and a column folded whole by hand
|
|
@@ -896,8 +898,9 @@ none lays out as before.
|
|
|
896
898
|
- **The order of a side's outer edges.** A side's rail is its outermost *panel* edge. With a side bar, from the window's
|
|
897
899
|
edge inward a side lies: its toolbar bars with `outsideInset`, the rail, its static column edges with `outsideInset`
|
|
898
900
|
(anchors), then the inset, then the columns. The kinds tell them apart, with no new option: a side bar takes something
|
|
899
|
-
and nothing the side's columns take (`Scene.columns[side].accepts`), an anchor takes nothing; `
|
|
900
|
-
|
|
901
|
+
and nothing the side's columns or rail take (`Scene.columns[side].accepts`, `Scene.rails[side].accepts`), an anchor takes nothing; `isSideBar(scene, edge)`
|
|
902
|
+
says whether an edge is a side toolbar bar (only on a side that has a column template or a rail), and
|
|
903
|
+
`isOutsideSideBar(scene, edge)` whether it is one with `outsideInset`. On a side with no side
|
|
901
904
|
bar the rail stays inside the inset, as before. With no rail shown, the `rail:` strip lies past the side's bars too.
|
|
902
905
|
- **Static edges keep their place.** A new column (a `column:` or `rail:` target, `moveTo` with a column or rail place,
|
|
903
906
|
`dockHome`) goes no further out than just inside the static edges that lie outer to the side's dynamic columns, so a
|
|
@@ -23,7 +23,10 @@ var axisOf = (side) => side === "left" || side === "right" ? "column" : "row";
|
|
|
23
23
|
var zoneOf = (item) => item?.align === "center" || item?.align === "end" ? item.align : "start";
|
|
24
24
|
var formsOf = (item, axis) => item.forms[axis] ?? [];
|
|
25
25
|
function isOutsideSideBar(scene, e) {
|
|
26
|
-
|
|
26
|
+
return e.outsideInset === true && isSideBar(scene, e);
|
|
27
|
+
}
|
|
28
|
+
function isSideBar(scene, e) {
|
|
29
|
+
if (e.side !== "left" && e.side !== "right" || e.column === true || e.accepts.length === 0) return false;
|
|
27
30
|
const template = scene.columns?.[e.side];
|
|
28
31
|
const rail = scene.rails?.[e.side];
|
|
29
32
|
if (!template && !rail) return false;
|
|
@@ -471,7 +474,8 @@ function solve(given, options = {}) {
|
|
|
471
474
|
});
|
|
472
475
|
const colMins = open2.length > 0 ? open2 : templates;
|
|
473
476
|
if (cmin !== void 0 && colMins.length > 0) {
|
|
474
|
-
const
|
|
477
|
+
const bars = cols.filter((c) => c.width > 0 && !c.dyn && isSideBar(scene, c.edge)).reduce((s, c) => s + c.width + (c.edge.outsideInset === true ? 0 : gutter), 0);
|
|
478
|
+
const width = area3.width - bars - (scene.insetWhen === "docked" && !docked ? px(scene.inset?.left) + px(scene.inset?.right) : 0);
|
|
475
479
|
const need = cmin + Math.min(...colMins) + gutter;
|
|
476
480
|
columnRoom = width >= need - EPS;
|
|
477
481
|
if (!columnRoom) notes.push({ code: "no-column-room", width, need });
|
|
@@ -1637,6 +1641,7 @@ export {
|
|
|
1637
1641
|
DEFAULT_HIT_BAND,
|
|
1638
1642
|
DEFAULT_FLOAT_SIZE,
|
|
1639
1643
|
isOutsideSideBar,
|
|
1644
|
+
isSideBar,
|
|
1640
1645
|
floatOrientOf,
|
|
1641
1646
|
floatSizeOf,
|
|
1642
1647
|
solve,
|
|
@@ -1661,4 +1666,4 @@ export {
|
|
|
1661
1666
|
refusals,
|
|
1662
1667
|
stops
|
|
1663
1668
|
};
|
|
1664
|
-
//# sourceMappingURL=chunk-
|
|
1669
|
+
//# sourceMappingURL=chunk-XUC5BU4N.js.map
|