@n-uf/placement 26.11.33 → 26.11.34
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 +29 -0
- package/README.md +16 -6
- package/dist/{chunk-IOTKOYKW.js → chunk-VKB3UWKX.js} +21 -3
- package/dist/{chunk-IOTKOYKW.js.map → chunk-VKB3UWKX.js.map} +1 -1
- package/dist/scene-cases.d.ts +13 -1
- package/dist/scene-cases.js +26 -15
- package/dist/scene-cases.js.map +1 -1
- package/dist/scene.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,35 @@
|
|
|
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.34
|
|
7
|
+
|
|
8
|
+
- `./scene`, **over an unarmed strip** (docs and a property test, no behavior change). A kit reported that at 700 px
|
|
9
|
+
with a flush 200 px card window, x 0–4 showed the rail's `no-room` refusal and x 5–10 showed nothing. The library
|
|
10
|
+
doesn't reproduce it: with those numbers (Annotations lifted, the left column folded into its rail), x 0–9 is the
|
|
11
|
+
refusal and x 10 on the new-column line, and across widths 560–1400, both hit bands, both window shapes and every
|
|
12
|
+
item, no refusal lies under an armable strip and no edge point is a hole. Nothing shown over a strip that hasn't armed
|
|
13
|
+
is the pre-arm state: the README's host contract now says a host draws the strip's highlight from the intent frame's
|
|
14
|
+
`arming`, and that a refusal never lies under an armable strip (the new property test). The README's paragraph on the
|
|
15
|
+
new outermost column's line inside a strip now matches its band rule.
|
|
16
|
+
- `./scene/cases`, **`resolvePlace` aims outside the dragged item's own rect** whenever a point there reaches the
|
|
17
|
+
target, as a person aims; a drag intent's home gate then never holds the aim. `AimArea.own` (additive) is that rect
|
|
18
|
+
(a held float's too); without it, the list's `home` target's hit. The reference host passes it.
|
|
19
|
+
- `./scene/cases`, **P9-to-the-other-rail shows both rails in either window.** At 600 px window B's left column (200 px
|
|
20
|
+
card, flush, 32 px rail, `contentMin` 320: 552 px) still fits, so Pages stayed open. The row's width is now derived
|
|
21
|
+
from the windows (the least width at which A's or B's left column no longer fits, less a step: 540 px), so both rails
|
|
22
|
+
show on a host at either window's numbers; a test plays it at both.
|
|
23
|
+
- `./scene`, fixed: **with card halves (`hitBand: "middle"`) and a rail drop strip, the new outermost column was
|
|
24
|
+
missing.** Moved inside the strip, the line for `column:<side>:0` was cut again by every other target, and a column's
|
|
25
|
+
card halves cover its whole width, so nothing was left: neither `targets()` nor `stops()` offered it. The line now keeps
|
|
26
|
+
the band it owns, as without a strip (it beats the inner column it would push, card halves included); only home, a
|
|
27
|
+
blocked rect and the other column lines take from it, and the inner columns' gaps and refusals on its side stop short
|
|
28
|
+
of it. With default bands, the gap between two panels at the side's edge now also gives the line its band.
|
|
29
|
+
- `./scene/cases`, **rows that mean a new outermost column aim by place.** P6-new-outer-column-from-outside (now
|
|
30
|
+
reached from the content, resting on the float first) and P6-left-outer-edge aim at `column:<side>:0` with
|
|
31
|
+
`resolvePlace` instead of 11 px from the window's edge, so they hold with a rail drop strip (a UI kit's panel
|
|
32
|
+
`railDrop`) as without. The 11 px pixel check is its own row, **P6-outer-line-at-11-px**, with its precondition:
|
|
33
|
+
`requires: { railDrop: "scene" }` (new, additive), so a host that lays its own strips skips it.
|
|
34
|
+
|
|
6
35
|
## 26.11.33
|
|
7
36
|
|
|
8
37
|
- `./scene`, fixed: **a float stored taller than the clear stage was drawn over the bars.** `solve` sized a float to the
|
package/README.md
CHANGED
|
@@ -1210,9 +1210,10 @@ side's outermost column's start zone as a collapsed header ("the column drawn as
|
|
|
1210
1210
|
in that column sets its width. The slot is that landing, so the preview is the drop. The strip
|
|
1211
1211
|
owns its rect: every other target and refusal of the drag gives it up, home's included (an item alone in its column
|
|
1212
1212
|
reaches its side's rail from its home), and an empty column's own drop strip moves just inside it, as does the line for a
|
|
1213
|
-
new outermost column on an occupied side (flush, the strip owns the window's edge): it
|
|
1214
|
-
|
|
1215
|
-
|
|
1213
|
+
new outermost column on an occupied side (flush, the strip owns the window's edge): it keeps the band it owns, as with
|
|
1214
|
+
no strip (it beats the inner column it would push, card halves included), giving way only to home, a blocked rect and
|
|
1215
|
+
the other column lines, and the inner columns' gaps and refusals on its side stop short of it; it is one of `stops`,
|
|
1216
|
+
so a host's "Move to ›" reaches it. Before the
|
|
1216
1217
|
strip arms, a drop there is the float's. A kind with no policy keeps its targets exactly as before; tuning one kind
|
|
1217
1218
|
never changes another. The policy's fields, each default with its reason:
|
|
1218
1219
|
|
|
@@ -1226,6 +1227,11 @@ never changes another. The policy's fields, each default with its reason:
|
|
|
1226
1227
|
The time and the keys are the drag intent's (`@n-uf/motion/drag`): `railArmDwellMs` (200 ms) arms a target marked
|
|
1227
1228
|
`arm: "dwell"` (spring-loading), and `modifiers` let Shift float anywhere and ⌘/Ctrl collapse into the nearest rail (Alt stays free: it unfreezes a frozen layout).
|
|
1228
1229
|
|
|
1230
|
+
**Over an unarmed strip.** While the pointer is in a strip that hasn't armed yet, the intent shows no target there (a
|
|
1231
|
+
drop is the float's), and its frame's `arming` names the strip being dwelt on. The host draws the strip's pre-arm
|
|
1232
|
+
highlight from `arming` (and the armed growth from the shown target), so that stretch never looks dead. A refusal never
|
|
1233
|
+
lies under an armable strip: the strip owns its rect, and every refusal gives it up (a property test holds it).
|
|
1234
|
+
|
|
1229
1235
|
A gap, column or rail target exists only where the drop keeps the whole scene sound: it adds no `overflow` or
|
|
1230
1236
|
`too-wide` note to any edge, changes no fixed item's form, squeezes none under its `main.min` anywhere (a between bar
|
|
1231
1237
|
under a new column included), and lands its slot on no chrome. The rule compares notes: in an edge that already
|
|
@@ -1333,11 +1339,15 @@ a gesture the row doesn't have fails the row. `createSceneHost()` is the referen
|
|
|
1333
1339
|
session that lifts past 4 px, asks `targets` for every target, takes the one under the pointer by its pick rule,
|
|
1334
1340
|
draws the preview from its `after.layout` and commits `after.scene` on release, every solve carrying the layout before
|
|
1335
1341
|
it as `previous`. An integrating app's host does the same with its own pointer; `resolvePlace(targets, place, item, { stage, content
|
|
1336
|
-
}, pick)` turns a `place` into a point that reaches the target.
|
|
1342
|
+
}, pick)` turns a `place` into a point that reaches the target. It aims outside the dragged item's own rect whenever a
|
|
1343
|
+
point there reaches the target, as a person aims, so a drag intent's home gate never holds the aim: `AimArea.own` is that
|
|
1344
|
+
rect (a held float's too), and without it the list's `home` target's hit is used; the reference host passes it. Every row
|
|
1337
1345
|
passes on the in-memory host except its DOM checks, which it skips, and the rows with `lacks`, which fail on it until the
|
|
1338
1346
|
library rule lands. A row with `requires: { intent: true }` checks what a drag intent adds to the pick at a point (a
|
|
1339
|
-
shown gap held a band's width past its hit): a host without one, the in-memory host among them, skips it.
|
|
1340
|
-
|
|
1347
|
+
shown gap held a band's width past its hit): a host without one, the in-memory host among them, skips it. A row with
|
|
1348
|
+
`requires: { railDrop: "scene" }` aims at a pixel whose meaning depends on the scene's own rail drop strips: a host that
|
|
1349
|
+
lays its own skips it. A row that only means a place aims by place (`resolvePlace`), so it holds either way.
|
|
1350
|
+
`CASE_GROUPS` lists the groups.
|
|
1341
1351
|
|
|
1342
1352
|
The rows run on any host, a page's included: the reference host and a page's host play one list of steps and agree on every
|
|
1343
1353
|
row, the rows that were disputed between them now being host-independent. Two pure helpers keep a page's host equal to the
|
|
@@ -2339,6 +2339,7 @@ function withRailStrips(c, targets2, refusals2) {
|
|
|
2339
2339
|
const sides = new Set(strips.map((s) => s.side));
|
|
2340
2340
|
const rects = strips.map((s) => s.rect);
|
|
2341
2341
|
const out = [];
|
|
2342
|
+
const lines = [];
|
|
2342
2343
|
for (const t of targets2) {
|
|
2343
2344
|
if (t.place.kind === "rail" && sides.has(t.place.side)) continue;
|
|
2344
2345
|
if (t.free || t.place.kind === "none") {
|
|
@@ -2351,9 +2352,10 @@ function withRailStrips(c, targets2, refusals2) {
|
|
|
2351
2352
|
let moved = t.id.startsWith("strip:") || t.place.kind === "column" ? insideStrips(t.hit, strips) : null;
|
|
2352
2353
|
let movedPieces = moved ? [moved] : [];
|
|
2353
2354
|
if (moved && t.place.kind === "column") {
|
|
2354
|
-
const others =
|
|
2355
|
+
const others = targets2.filter((x) => x !== t && (x.place.kind === "home" || x.place.kind === "column" || x.place.kind === "none" && !x.free)).flatMap((x) => x.hits ?? [x.hit]);
|
|
2355
2356
|
movedPieces = outside([moved], others);
|
|
2356
2357
|
moved = movedPieces.length ? largest2(movedPieces) : null;
|
|
2358
|
+
if (moved) lines.push({ side: t.place.side, pieces: movedPieces });
|
|
2357
2359
|
}
|
|
2358
2360
|
if (moved) out.push({ ...withoutHits(t), hit: moved, ...movedPieces.length > 1 ? { hits: movedPieces } : {} });
|
|
2359
2361
|
continue;
|
|
@@ -2364,11 +2366,27 @@ function withRailStrips(c, targets2, refusals2) {
|
|
|
2364
2366
|
}
|
|
2365
2367
|
out.push({ ...withoutHits(t), hit: largest2(pieces), ...pieces.length > 1 ? { hits: pieces } : {} });
|
|
2366
2368
|
}
|
|
2369
|
+
const columnSide = (edge) => {
|
|
2370
|
+
const e = c.scene.edges.find((x) => x.id === edge);
|
|
2371
|
+
return e?.column && (e.side === "left" || e.side === "right") ? e.side : null;
|
|
2372
|
+
};
|
|
2373
|
+
const lineCut = (edge) => lines.filter((l) => l.side === columnSide(edge)).flatMap((l) => l.pieces);
|
|
2374
|
+
for (let i = 0; i < out.length; i++) {
|
|
2375
|
+
const t = out[i];
|
|
2376
|
+
if (t.place.kind !== "gap") continue;
|
|
2377
|
+
const cut = lineCut(t.place.edge);
|
|
2378
|
+
if (!cut.length) continue;
|
|
2379
|
+
const was = t.hits ?? [t.hit];
|
|
2380
|
+
const pieces = outside(was, cut);
|
|
2381
|
+
if (sameRects(pieces, was)) continue;
|
|
2382
|
+
if (pieces.length === 0) out.splice(i--, 1);
|
|
2383
|
+
else out[i] = { ...withoutHits(t), hit: largest2(pieces), ...pieces.length > 1 ? { hits: pieces } : {} };
|
|
2384
|
+
}
|
|
2367
2385
|
const refused = [];
|
|
2368
2386
|
const railEdges = new Set([...sides].map((side) => virtualEdgeId("rail", side)));
|
|
2369
2387
|
for (const r of refusals2) {
|
|
2370
2388
|
if (railEdges.has(r.edge)) continue;
|
|
2371
|
-
const pieces = outside([r.hit], rects);
|
|
2389
|
+
const pieces = outside([r.hit], [...rects, ...lineCut(r.edge)]);
|
|
2372
2390
|
if (pieces.length) refused.push(pieces.length === 1 && sameRects(pieces, [r.hit]) ? r : { ...r, hit: largest2(pieces) });
|
|
2373
2391
|
}
|
|
2374
2392
|
const vertical = (r) => {
|
|
@@ -2654,4 +2672,4 @@ export {
|
|
|
2654
2672
|
refusals,
|
|
2655
2673
|
stops
|
|
2656
2674
|
};
|
|
2657
|
-
//# sourceMappingURL=chunk-
|
|
2675
|
+
//# sourceMappingURL=chunk-VKB3UWKX.js.map
|