@n-uf/motion 26.11.54 → 26.11.56
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 +69 -0
- package/README.md +1 -1
- package/dist/{chunk-IT2FMZOM.js → chunk-WSW2DNRW.js} +240 -339
- package/dist/chunk-WSW2DNRW.js.map +1 -0
- package/dist/drag.d.ts +125 -125
- package/dist/drag.js +5 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/package.json +1 -1
- package/dist/chunk-IT2FMZOM.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,75 @@
|
|
|
3
3
|
Versions are calendar versions, `YY.M.R` (year, month of the release, counter
|
|
4
4
|
within the month), the same scheme as `@n-uf/hypr-tiling`.
|
|
5
5
|
|
|
6
|
+
Unreleased entries live in `changes/` until a release joins them.
|
|
7
|
+
|
|
8
|
+
## 26.11.56
|
|
9
|
+
|
|
10
|
+
### Landing model: less to wire
|
|
11
|
+
|
|
12
|
+
- `./drag`, **changed (breaking): `createLandingModel`'s `placeGuides` option is now `preview`.** The guide level lives in
|
|
13
|
+
one place, the preview, the same `DragPreview` (or `PreviewMode`) the host gives `previewPlan`: the model names its
|
|
14
|
+
lanes by `guidesOf(preview)` (the preview's `placeGuides`, else its mode's default), so the level is stated once.
|
|
15
|
+
Old: `createLandingModel({ ..., placeGuides: "near" })` beside `previewPlan(frame, { mode, placeGuides: "near" })`.
|
|
16
|
+
New: `createLandingModel({ ..., preview })` and `previewPlan(frame, preview)`. With no `preview` the model uses the
|
|
17
|
+
default preview, Glide, which asks for no guides, as the old default `"off"` did; a mode alone now brings its own
|
|
18
|
+
default level (Snap and Placeholder near), as `previewPlan` already read it.
|
|
19
|
+
- `./drag`, **added: `guidesOf(preview)`**, the one reading of a preview's guide level (`previewPlan` reads it too; its
|
|
20
|
+
plans are unchanged).
|
|
21
|
+
- `./drag`, **added: the landing model's `modifiers`** (`LandingModifiers` = `{ on, floatKey }`, default
|
|
22
|
+
`LANDING_MODIFIERS`), the drag intent's `modifiers` shape less the arm key, in place of the fixed `keys.shift`. A variable
|
|
23
|
+
holding the intent's `modifiers` passes as it is (an inline literal with `armKey` does not). The default is the intent's float key, Shift, so nothing moves unless a host sets it;
|
|
24
|
+
`floatKey: "mod"` (⌘ or Ctrl) and the other keys now work, and `on: false` turns the key off. `frame.shift` says the
|
|
25
|
+
float key is held.
|
|
26
|
+
- `./drag`, **removed (type only): `LandingRegions.item`.** The model never read it; `@n-uf/docking`'s regions keep
|
|
27
|
+
theirs. A host that built regions with an `item` field drops it.
|
|
28
|
+
- `./drag`, **`pickRank` and `REFUSAL_RANK` have one owner: here.** `@n-uf/placement` no longer exports them (see its
|
|
29
|
+
changelog); nothing changes for a host that imported them from `./drag`.
|
|
30
|
+
|
|
31
|
+
## 26.11.55
|
|
32
|
+
|
|
33
|
+
- Fixed: **a float pressed inside an empty lane's band no longer takes that lane when the drag starts.** A lift is a
|
|
34
|
+
float's when it has no `home` option and no lane has a spot marked home (new optional `LandingSpot.home`; docking marks a
|
|
35
|
+
docked item's, so a docked item lifted without `home` stays docked). A float lift now has the lift zone a docked item has, `margins.lift` (16 px)
|
|
36
|
+
around the press: within it no lane takes the pointer, and the frame is judged as if the regions had no lanes, so a nudge
|
|
37
|
+
moves the float, a float over a blocked or refused place is refused as on any frame, and no lane's path counts. The zone is
|
|
38
|
+
left once, past `lift` from the press, and never re-entered, so sliding back through the press point while a lane is held
|
|
39
|
+
changes nothing. After the zone the lanes act by their gates as before.
|
|
40
|
+
|
|
41
|
+
### One layout: the landing model takes a held place (breaking; with `@n-uf/docking`'s `dockDrag`)
|
|
42
|
+
|
|
43
|
+
The landing model picks a held place and does no layout: every rect of a held place is the host's geometry's, so a held frame draws
|
|
44
|
+
exactly what its release commits. `@n-uf/docking`'s `dockDrag(...)` is that geometry as it is.
|
|
45
|
+
|
|
46
|
+
- **Options.** `createLandingModel({ regions, landingOf, spotsOf?, home?, lift?, margins?, gates?, approach?, placeGuides? })`
|
|
47
|
+
(`LandingOptions` extends the new `LandingGeometry`: `regions` for hit-testing, `landingOf(held)`, the one rect the
|
|
48
|
+
model reads of a held place, and `spotsOf(spot)`, a held lane's stretches in that spot's layout). Removed: `regionsFor`
|
|
49
|
+
(use `spotsOf`), `floatLanding` (`landingOf({ kind: "float", point })`), `grab` (the geometry's: `dockDrag`'s option).
|
|
50
|
+
`setRegions(regions, regionsFor?)` → `setGeometry(geometry)`, whole.
|
|
51
|
+
- **Held places.** New `LandingHeld`: `{ kind: "spot", lane, spot, point }` or `{ kind: "float", point }`. `LandingFrame`
|
|
52
|
+
gains `held` (the held place a release lands now, or null); its `landing` is `landingOf(held)`; its `guides` are now
|
|
53
|
+
`{ lane, held }[]`, each lane shown with the held place its guide stands for (the geometry draws them: docking's
|
|
54
|
+
`guides(frame)`). `LandingRelease` is `{ kind: "spot", lane, spot, point, home }`, `{ kind: "float", point }` or null:
|
|
55
|
+
`at` and `rect` are gone; commit `after(release).state`.
|
|
56
|
+
- **Removed types and fields.** `LandingGuide`, `LandingMark`, `LandingSlide`, `SNAP_DISTANCE`; `LandingLane.marks`,
|
|
57
|
+
`entry` and `corners`; `LandingSpot.slide`. `LandingLane.owns` stays (a hit-testing rule). The model's own sliding
|
|
58
|
+
arithmetic (`landingAt`), its guide geometry and corner owner, and its `guideRects` call are gone: the geometry draws.
|
|
59
|
+
- **Behavior.** Under `"all"` with no Near lane, the lane nearest the pointer within `reach` names its would-land held place,
|
|
60
|
+
for the corner only, switching exactly at `reach`. The trail gate reads `landingOf` the spot held (a sliding spot's
|
|
61
|
+
landing where the hand holds it, not its listed one). `release().home` holds where the geometry lands the item
|
|
62
|
+
home. Hit-testing reads the stage, the lanes' rects, refused, blocked and content as seen (`regions`) on every frame;
|
|
63
|
+
only the held lane's spot stretches come from `spotsOf` (before, all of it came from the held spot's regions,
|
|
64
|
+
`regionsFor`). `LandingRegions.item` is optional: the model doesn't read it. New type: `LandingGuideRef`.
|
|
65
|
+
|
|
66
|
+
### Docs only
|
|
67
|
+
|
|
68
|
+
- **The design page and the reference catch up with the code.** No behavior, type or export change. Docking's marks (a
|
|
69
|
+
panel drag's lines, boxes and empty columns) are written up on docking's design page, not here; the draw rule for a
|
|
70
|
+
held frame (the state's layout while its room is open, else the window at rest) is stated once there. The unit rule
|
|
71
|
+
names its three exceptions (`DOUBLE_CLICK` and `multiClick`, `longPress.ms`, `WheelPanOptions.speed`). The
|
|
72
|
+
reference covers behavior, with the exported types as the contract, and adds entries for `DragFrame`, `DragTuning`,
|
|
73
|
+
`LandingFrame`, `LandingRelease`, `LandingGates` and the other landing option types.
|
|
74
|
+
|
|
6
75
|
## 26.11.54
|
|
7
76
|
|
|
8
77
|
**The breaking release of the SDK: structure and names, and the few behavior changes they bring.** The drag intent goes
|
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ console.log(intent.release({ x: 100, y: 50 }, 300, [slot])?.id); // "slot"
|
|
|
68
68
|
## Documentation
|
|
69
69
|
|
|
70
70
|
- [Design page](https://github.com/n-uf/motion/blob/main/docs/motion.md): the concept, the parts, the rules a consumer relies on.
|
|
71
|
-
- [Reference](https://github.com/n-uf/motion/blob/main/docs/motion-reference.md): every entry point's
|
|
71
|
+
- [Reference](https://github.com/n-uf/motion/blob/main/docs/motion-reference.md): every entry point's behavior, rules and longer examples; the exported types are the contract.
|
|
72
72
|
- [CHANGELOG](https://github.com/n-uf/motion/blob/main/packages/motion/CHANGELOG.md)
|
|
73
73
|
- Site and live demos: [motion.n-uf.com](https://motion.n-uf.com)
|
|
74
74
|
|