@n-uf/placement 26.11.37 → 26.11.39

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/dist/scene.d.ts CHANGED
@@ -1,8 +1,8 @@
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, Z as Zone, k as SolveOptions, b as SceneLayout, g as SceneRefusal, l as SceneTargetOptions, f as SceneTarget } from './model-CuE-ML-f.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-CuE-ML-f.js';
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, Z as Zone, k as SolveOptions, b as SceneLayout, g as SceneRefusal, l as SceneTargetOptions, f as SceneTarget } from './model-gUF8juqt.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-gUF8juqt.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
- import { T as Target } from './target-fhD5UVlt.js';
5
+ import { T as Target } from './target-Db9z1bWt.js';
6
6
  import './model-X7eUaKlA.js';
7
7
 
8
8
  /**
@@ -33,6 +33,13 @@ declare const edgeTakes: (edge: {
33
33
  }, 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
+ /**
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. A fixed item, or one the edge takes nowhere, lies in its own. The item's zone is its own fact, not the edge's:
39
+ * this is where it is laid out and targeted, while its stored `align` stays as it was, so it is back in its own zone
40
+ * on an edge that takes it there.
41
+ */
42
+ declare function zoneIn(edge: Edge, item: SceneItem): Zone;
36
43
  /**
37
44
  * A left or right toolbar bar outside the inset (`isSideBar` with `outsideInset`). It lies outermost on its side,
38
45
  * before the side's rail.
@@ -228,7 +235,11 @@ declare function targets(scene: Scene, dragged: string, options?: SceneTargetOpt
228
235
  * lies in the stage, a zone's inside its edge's ends. A release over a refusal commits nothing: the item goes home.
229
236
  */
230
237
  declare function refusals(scene: Scene, dragged: string, options?: SceneTargetOptions): SceneRefusal[];
231
- /** A refusal in the pick's shape: `refuse: true`, at priority 2 (it never lies under a target, so only the float is less precise). */
238
+ /**
239
+ * A refusal in the pick's shape: `refuse: true`, which ranks it at `REFUSAL_RANK` (after every target of priority 1 and
240
+ * 2, so a target wins wherever the two meet or overlap, before the float). Its `priority` is 2 for a pick rule that
241
+ * doesn't know refusals.
242
+ */
232
243
  interface SceneRefusalTarget extends Target {
233
244
  readonly refuse: true;
234
245
  readonly refusal: SceneRefusal;
@@ -251,4 +262,4 @@ declare function refusalTargets(list: readonly SceneRefusal[]): SceneRefusalTarg
251
262
  */
252
263
  declare function stops(scene: Scene, dragged: string, options?: SceneTargetOptions): SceneTarget[];
253
264
 
254
- export { Edge, FloatAnchor, FloatAnchorAt, Kind, Orient, RailMode, Scene, SceneItem, SceneLayout, SceneRefusal, type SceneRefusalTarget, SceneTarget, SceneTargetOptions, Side, SolveOptions, type TargetIdParts, Zone, ZoneAccepts, anchorName, edgeTakes, floatOrientOf, floatSizeOf, isOutsideSideBar, isSideBar, parseTargetId, placeTargetId, railModeOf, refusalTargets, refusals, reservedRect, solve, stops, targetId, targets, virtualEdgeId, zoneTakes, zonesTaking };
265
+ export { Edge, FloatAnchor, FloatAnchorAt, Kind, Orient, RailMode, Scene, SceneItem, SceneLayout, SceneRefusal, type SceneRefusalTarget, SceneTarget, SceneTargetOptions, Side, SolveOptions, type TargetIdParts, Zone, ZoneAccepts, anchorName, edgeTakes, floatOrientOf, floatSizeOf, isOutsideSideBar, isSideBar, parseTargetId, placeTargetId, railModeOf, refusalTargets, refusals, reservedRect, solve, stops, targetId, targets, virtualEdgeId, zoneIn, zoneTakes, zonesTaking };
package/dist/scene.js CHANGED
@@ -45,9 +45,10 @@ import {
45
45
  targets,
46
46
  use,
47
47
  virtualEdgeId,
48
+ zoneIn,
48
49
  zoneTakes,
49
50
  zonesTaking
50
- } from "./chunk-2PWDUBPG.js";
51
+ } from "./chunk-US2TGS3W.js";
51
52
  import {
52
53
  fitFloat
53
54
  } from "./chunk-AE3BWTAE.js";
@@ -100,6 +101,7 @@ export {
100
101
  targets,
101
102
  use,
102
103
  virtualEdgeId,
104
+ zoneIn,
103
105
  zoneTakes,
104
106
  zonesTaking
105
107
  };
package/dist/stack.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { d as StackInput, F as FitOptions, b as StackFit, e as StackItem } from './model-X7eUaKlA.js';
2
2
  export { C as CrossLimits, D as DEFAULT_MENU, f as DEFAULT_RAIL, G as GroupFormKind, M as MainSize, P as PanelFormKind, g as PlacedStackItem, h as StackAxis, a as StackForm, S as StackFormKind, i as StackMenu, c as StackNote, j as StackNoteCode, k as StackStep, W as WrapSpec, l as formCrossMin, m as formFitsCross, n as formMain, o as formSetsCross, w as withItem, p as wrapCross, q as wrapLines, r as wrapRows } from './model-X7eUaKlA.js';
3
3
  import { R as Rect, P as Point, S as Size } from './geometry-Bf37LbCT.js';
4
- import { T as Target } from './target-fhD5UVlt.js';
4
+ import { T as Target } from './target-Db9z1bWt.js';
5
5
  import { F as FloatFit$1 } from './float-fit-DCYxRMru.js';
6
6
 
7
7
  /**
@@ -0,0 +1,50 @@
1
+ import { R as Rect } from './geometry-Bf37LbCT.js';
2
+
3
+ /**
4
+ * A drop target in the shape @n-uf/motion/drag takes: an id, a priority (1 most precise: a rail or a tab strip;
5
+ * 2 a slot; 3 a broad area such as floating anywhere), the zone the pointer hits, and optionally where the item
6
+ * lands, a label and whether it lands freely (no room is made for it). `hits`, when given, is the whole zone as several
7
+ * rects (a zone that isn't one rect), `hit` the largest of them: the pointer is in the zone when it is in any of them.
8
+ * `arm: "dwell"` marks a spring-loaded target (the drag intent arms it once the pointer dwells in it), `armedHit` its
9
+ * zone once armed.
10
+ */
11
+ interface Target {
12
+ readonly id: string;
13
+ readonly priority: 1 | 2 | 3;
14
+ readonly hit: Rect;
15
+ readonly hits?: readonly Rect[];
16
+ /** Spring-loaded: no target until the pointer dwells in it. */
17
+ readonly arm?: "dwell";
18
+ /** Its zone once armed (the strip grown by its magnet). */
19
+ readonly armedHit?: Rect;
20
+ readonly slot?: Rect;
21
+ readonly label?: string;
22
+ readonly free?: boolean;
23
+ /**
24
+ * A refusal, not a target: it takes part in the pick under the pointer, ranked after every target of priority 1 and 2
25
+ * and before priority 3 (`REFUSAL_RANK`, whatever its `priority`), but nothing lands on it (`refusalTargets`).
26
+ */
27
+ readonly refuse?: true;
28
+ /**
29
+ * The drawn space the zone belongs to (the window's stage): the zone, and a drag intent's band and gap grace about
30
+ * it, hold only points strictly inside it. The window's boundary belongs only to the targets drawn against it: the
31
+ * scene gives `bounds` to every refusal and to the float (whole-plane), never to a gap or a slot, so a pointer clamped
32
+ * onto the window's edge picks a gap that reaches it, else nothing. That relies on the host clamping exactly onto the
33
+ * stage's edge (`x + width`, `y + height`): a host that clamps to `width - 0.5` still picks inside the window.
34
+ */
35
+ readonly bounds?: Rect;
36
+ }
37
+ /**
38
+ * Where a refusal ranks in the pick (the drag intent's `REFUSAL_RANK`, the same value): an ordering rank, not a
39
+ * priority. Priorities stay the integers 1, 2 and 3; a refusal's tier is `refuse: true`, ordered by this rank on the
40
+ * same scale: after every target of priority 1 and 2, so a real target wins wherever the two meet or overlap, and
41
+ * before priority 3 (the float).
42
+ */
43
+ declare const REFUSAL_RANK = 2.5;
44
+ /** A target's rank in the pick: its `priority`, a refusal's {@link REFUSAL_RANK}. Lower wins. */
45
+ declare const pickRank: (t: {
46
+ readonly priority: number;
47
+ readonly refuse?: true;
48
+ }) => number;
49
+
50
+ export { REFUSAL_RANK as R, type Target as T, pickRank as p };
@@ -1,5 +1,5 @@
1
1
  import { S as Size, R as Rect, P as Point } from './geometry-Bf37LbCT.js';
2
- import { T as Target } from './target-fhD5UVlt.js';
2
+ import { T as Target } from './target-Db9z1bWt.js';
3
3
 
4
4
  /**
5
5
  * The panels model: plain data and the pure changes on it.
package/dist/targets.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { T as Target } from './target-fhD5UVlt.js';
1
+ import { T as Target } from './target-Db9z1bWt.js';
2
2
  import { R as Rect, P as Point, S as Size } from './geometry-Bf37LbCT.js';
3
3
  import { D as DeskState, g as Layout, a as Construction, O as Options } from './constructions-Cbz7uEAZ.js';
4
4
  import { Place, Arrangement, HostId, HostSpec, GroupSize } from './toolbar.js';
5
- import { d as PanelTarget, s as PanelStopsOptions, r as PanelStop } from './targets-DnVNZVQW.js';
5
+ import { d as PanelTarget, s as PanelStopsOptions, r as PanelStop } from './targets-CYs16P4K.js';
6
6
  import { P as PaneSide, a as PaneCenter, b as PaneRegion } from './regions-Db_RyT4P.js';
7
7
 
8
8
  /**
package/dist/tiling.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { R as Rect, S as Size } from './geometry-Bf37LbCT.js';
2
2
  import { b as PaneRegion, P as PaneSide } from './regions-Db_RyT4P.js';
3
3
  export { c as PANE_REGION_DEFAULTS, d as PANE_SIDES, a as PaneCenter, e as PaneRegionOptions, p as paneCenter, f as paneRegion } from './regions-Db_RyT4P.js';
4
- import { T as Target } from './target-fhD5UVlt.js';
4
+ import { T as Target } from './target-Db9z1bWt.js';
5
5
 
6
6
  /**
7
7
  * The order layouts: panes in order and an area in, a rect per pane out. Pure rect functions; a drop on one reorders
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n-uf/placement",
3
- "version": "26.11.37",
3
+ "version": "26.11.39",
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.37"
87
+ "@n-uf/motion": "26.11.39"
88
88
  },
89
89
  "scripts": {
90
90
  "build": "tsup && node ./scripts/check-dist.mjs",