@n-uf/placement 26.11.40 → 26.11.41
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 +17 -0
- package/README.md +20 -2
- package/dist/{chunk-PADZWK3H.js → chunk-NRARI4Q2.js} +28 -5
- package/dist/chunk-NRARI4Q2.js.map +1 -0
- package/dist/{model-YDXCs2N_.d.ts → model-C-Z5PDBp.d.ts} +19 -0
- package/dist/scene-cases.d.ts +1 -1
- package/dist/scene-cases.js +1 -1
- package/dist/scene.d.ts +17 -20
- package/dist/scene.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-PADZWK3H.js.map +0 -1
|
@@ -156,6 +156,20 @@ interface Edge {
|
|
|
156
156
|
* its start zone takes (a panel gets its top third; a group none, the rail's instead).
|
|
157
157
|
*/
|
|
158
158
|
readonly zoneAccepts?: ZoneAccepts;
|
|
159
|
+
/**
|
|
160
|
+
* The zones the edge has, in any order (default all three). `["start"]` makes it one stack along its whole length, as
|
|
161
|
+
* a side rail drawn in order: its whole length offers the start zone's gaps, ordered by position along it, with no
|
|
162
|
+
* center or end gaps and no refusal of a kind it takes; a drop on it names no zone (`namesZone`), so the item keeps
|
|
163
|
+
* its own `align`; and an item whose `align` names a zone it doesn't have lies in its zone (`zoneIn`), its stored
|
|
164
|
+
* `align` unchanged (so it is back in its own zone when lent to a bar through `showIn`). Two zones (`["start", "end"]`)
|
|
165
|
+
* split the length between them as three split it in thirds, the boundary at the middle, moved past the cards seen in
|
|
166
|
+
* them. Setting `zones`, even to all three, always splits the length evenly among its zones (each boundary then moved
|
|
167
|
+
* past the cards seen on either side); leaving it out keeps the edge kind's own spans, a column's as the solver lays
|
|
168
|
+
* its zones out. Entries that aren't zones and repeats are ignored; a list with no zone counts as all three. With
|
|
169
|
+
* `zoneAccepts`, a zone takes a kind only where both say so. Like `zoneAccepts`, a declaration: never stored, from
|
|
170
|
+
* `base` on `readScene`.
|
|
171
|
+
*/
|
|
172
|
+
readonly zones?: readonly Zone[];
|
|
159
173
|
/** The drop strip's depth while the edge is empty, px (default {@link DEFAULT_STRIP}). */
|
|
160
174
|
readonly strip?: number;
|
|
161
175
|
/**
|
|
@@ -731,6 +745,11 @@ declare function floatAt(scene: Scene, id: string, at?: Rect, orient?: Orient):
|
|
|
731
745
|
*/
|
|
732
746
|
declare function canFold(scene: Scene, id: string): boolean;
|
|
733
747
|
declare function fold(scene: Scene, id: string, on: boolean): Scene;
|
|
748
|
+
/**
|
|
749
|
+
* The item made the newest (`used`: the newest age plus one). Idempotent: an item already strictly newer than every
|
|
750
|
+
* other gives back the scene itself, so a press on it changes nothing (a tie with another item is not newest, and
|
|
751
|
+
* bumps). A drop's result is `use`d the same way.
|
|
752
|
+
*/
|
|
734
753
|
declare function use(scene: Scene, id: string): Scene;
|
|
735
754
|
declare function keep(scene: Scene, id: string, on: boolean): Scene;
|
|
736
755
|
declare function open(scene: Scene, id: string): Scene;
|
package/dist/scene-cases.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as Point, R as Rect } from './geometry-Bf37LbCT.js';
|
|
2
2
|
import { S as StackFormKind } from './model-X7eUaKlA.js';
|
|
3
|
-
import { S as Scene, a as ScenePlace, b as SceneLayout, c as StoredScene, Z as Zone, d as Side, e as SceneNoteCode, f as SceneTarget, g as SceneRefusal } from './model-
|
|
3
|
+
import { S as Scene, a as ScenePlace, b as SceneLayout, c as StoredScene, Z as Zone, d as Side, e as SceneNoteCode, f as SceneTarget, g as SceneRefusal } from './model-C-Z5PDBp.js';
|
|
4
4
|
import './target-Db9z1bWt.js';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/scene-cases.js
CHANGED
package/dist/scene.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FloatAnchorAt, h as FloatAnchor, K as Kind, i as ZoneAccepts, j as SceneItem, O as Orient, S as Scene, E as Edge, d as Side, R as RailMode,
|
|
2
|
-
export { C as ColumnPlace, m as ColumnTemplate, D as DEFAULT_FLOAT_SIZE, n as DEFAULT_HIT_BAND, o as DEFAULT_RAIL_MAGNET, p as DEFAULT_STRIP, q as DockPlace, r as FLOAT_ANCHORS, s as FloatAnchorOffset, t as FloatPlace, u as FloatResize, P as Place, v as RAIL_MODES, w as RAIL_STRIP_MIN, x as RAIL_VISIBILITIES, y as RailDropPolicy, z as RailPlace, A as RailSpec, B as RailVisibility, G as ResizeEdges, H as ResizeLimit, I as SIDES, J as SceneAfter, L as SceneChrome, M as SceneEdgeLayout, N as SceneFloat, Q as SceneItemLayout, T as SceneNote, e as SceneNoteCode, a as ScenePlace, U as SceneRailLayout, V as SceneRead, c as StoredScene, W as StoredSceneEdge, X as StoredSceneFloat, Y as StoredSceneItem, _ as ZONES, $ as canFold, a0 as close, a1 as dockHome, a2 as fitResize, a3 as floatAt, a4 as fold, a5 as homeFor, a6 as keep, a7 as lift, a8 as moveTo, a9 as open, aa as orient, ab as raise, ac as readScene, ad as resize, ae as setRailMode, af as setSide, ag as storeScene, ah as use } from './model-
|
|
1
|
+
import { F as FloatAnchorAt, h as FloatAnchor, K as Kind, i as ZoneAccepts, Z as Zone, j as SceneItem, O as Orient, S as Scene, E as Edge, d as Side, R as RailMode, k as SolveOptions, b as SceneLayout, g as SceneRefusal, l as SceneTargetOptions, f as SceneTarget } from './model-C-Z5PDBp.js';
|
|
2
|
+
export { C as ColumnPlace, m as ColumnTemplate, D as DEFAULT_FLOAT_SIZE, n as DEFAULT_HIT_BAND, o as DEFAULT_RAIL_MAGNET, p as DEFAULT_STRIP, q as DockPlace, r as FLOAT_ANCHORS, s as FloatAnchorOffset, t as FloatPlace, u as FloatResize, P as Place, v as RAIL_MODES, w as RAIL_STRIP_MIN, x as RAIL_VISIBILITIES, y as RailDropPolicy, z as RailPlace, A as RailSpec, B as RailVisibility, G as ResizeEdges, H as ResizeLimit, I as SIDES, J as SceneAfter, L as SceneChrome, M as SceneEdgeLayout, N as SceneFloat, Q as SceneItemLayout, T as SceneNote, e as SceneNoteCode, a as ScenePlace, U as SceneRailLayout, V as SceneRead, c as StoredScene, W as StoredSceneEdge, X as StoredSceneFloat, Y as StoredSceneItem, _ as ZONES, $ as canFold, a0 as close, a1 as dockHome, a2 as fitResize, a3 as floatAt, a4 as fold, a5 as homeFor, a6 as keep, a7 as lift, a8 as moveTo, a9 as open, aa as orient, ab as raise, ac as readScene, ad as resize, ae as setRailMode, af as setSide, ag as storeScene, ah as use } from './model-C-Z5PDBp.js';
|
|
3
3
|
import { S as Size, R as Rect } from './geometry-Bf37LbCT.js';
|
|
4
4
|
export { F as FloatFit, f as fitFloat } from './float-fit-DCYxRMru.js';
|
|
5
5
|
import { T as Target } from './target-Db9z1bWt.js';
|
|
@@ -12,32 +12,32 @@ import './model-X7eUaKlA.js';
|
|
|
12
12
|
|
|
13
13
|
/** The name of a float's anchor, with or without an offset: `"content-top-right"` for `{ at: "content-top-right", dy: 12 }`. */
|
|
14
14
|
declare const anchorName: (anchor: FloatAnchorAt) => FloatAnchor;
|
|
15
|
-
/**
|
|
16
|
-
|
|
15
|
+
/** What the zone tests read of an edge (or a column template): what it takes, per zone, and the zones it has. */
|
|
16
|
+
type ZoneDecl = {
|
|
17
17
|
readonly accepts: readonly Kind[];
|
|
18
18
|
readonly zoneAccepts?: ZoneAccepts;
|
|
19
|
-
|
|
19
|
+
readonly zones?: readonly Zone[];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Whether `edge` takes kind `kind` in `zone`: a zone the edge has (`zones`), its `accepts`, narrowed by `zoneAccepts`
|
|
23
|
+
* when given (a zone not listed takes nothing).
|
|
24
|
+
*/
|
|
25
|
+
declare const zoneTakes: (edge: ZoneDecl, zone: Zone, kind: Kind) => boolean;
|
|
20
26
|
/** The zones of `edge` that take `kind`, in order. */
|
|
21
|
-
declare const zonesTaking: (edge:
|
|
22
|
-
readonly accepts: readonly Kind[];
|
|
23
|
-
readonly zoneAccepts?: ZoneAccepts;
|
|
24
|
-
}, kind: Kind) => Zone[];
|
|
27
|
+
declare const zonesTaking: (edge: ZoneDecl, kind: Kind) => Zone[];
|
|
25
28
|
/**
|
|
26
29
|
* Whether `edge` takes `kind` anywhere: its `accepts` lists it and at least one of its zones takes it (`zoneTakes`). An
|
|
27
30
|
* edge whose zones take nothing for the kind (`zoneAccepts: {}`) takes it nowhere, exactly as one whose `accepts` lacks
|
|
28
31
|
* it: the one test drop targets and refusals ask. The stored form and `readScene` keep reading `accepts` itself.
|
|
29
32
|
*/
|
|
30
|
-
declare const edgeTakes: (edge:
|
|
31
|
-
readonly accepts: readonly Kind[];
|
|
32
|
-
readonly zoneAccepts?: ZoneAccepts;
|
|
33
|
-
}, kind: Kind) => boolean;
|
|
33
|
+
declare const edgeTakes: (edge: ZoneDecl, kind: Kind) => boolean;
|
|
34
34
|
/** How the rails of `side` show their items (`Scene.railModes`, default `"titles"`); top and bottom have no rails. */
|
|
35
35
|
declare const railModeOf: (scene: Scene, side: Side) => RailMode;
|
|
36
36
|
/**
|
|
37
37
|
* The zone `item` lies in on `edge`: its own (`align`) where the edge takes its kind there, else the first zone that
|
|
38
|
-
* does
|
|
39
|
-
* this is where it is laid out and targeted, while its stored `align`
|
|
40
|
-
* on an edge that takes it there.
|
|
38
|
+
* does; one the edge takes nowhere, in its own. A fixed item lies in its own where the edge has that zone (`zones`),
|
|
39
|
+
* else in the edge's first zone, as a movable item lies in a zone the edge has. The item's zone is its own fact, not the edge's: this is where it is laid out and targeted, while its stored `align`
|
|
40
|
+
* stays as it was, so it is back in its own zone on an edge that takes it there.
|
|
41
41
|
*/
|
|
42
42
|
declare function zoneIn(edge: Edge, item: SceneItem): Zone;
|
|
43
43
|
/**
|
|
@@ -45,10 +45,7 @@ declare function zoneIn(edge: Edge, item: SceneItem): Zone;
|
|
|
45
45
|
* kind. Only then does the zone a drop gives become the item's `align`; on a one-zone edge (a rail that takes the kind
|
|
46
46
|
* at its start only) the item keeps its own, and lies in that one zone there (`zoneIn`).
|
|
47
47
|
*/
|
|
48
|
-
declare const namesZone: (edge:
|
|
49
|
-
readonly accepts: readonly Kind[];
|
|
50
|
-
readonly zoneAccepts?: ZoneAccepts;
|
|
51
|
-
}, kind: Kind) => boolean;
|
|
48
|
+
declare const namesZone: (edge: ZoneDecl, kind: Kind) => boolean;
|
|
52
49
|
/**
|
|
53
50
|
* A left or right toolbar bar outside the inset (`isSideBar` with `outsideInset`). It lies outermost on its side,
|
|
54
51
|
* before the side's rail.
|
package/dist/scene.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n-uf/placement",
|
|
3
|
-
"version": "26.11.
|
|
3
|
+
"version": "26.11.41",
|
|
4
4
|
"description": "Where things go: desk docks, rails and palettes, panel columns, toolbar groups, and the drop targets for each. Pure state in, rects out. No DOM, no framework, no motion.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"layout",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"tsup": "^8.5.1",
|
|
85
85
|
"typescript": "^6.0.3",
|
|
86
86
|
"vitest": "^4.1.12",
|
|
87
|
-
"@n-uf/motion": "26.11.
|
|
87
|
+
"@n-uf/motion": "26.11.41"
|
|
88
88
|
},
|
|
89
89
|
"scripts": {
|
|
90
90
|
"build": "tsup && node ./scripts/check-dist.mjs",
|