@n-uf/placement 26.11.39 → 26.11.40

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.
@@ -69,7 +69,8 @@ interface SceneItem {
69
69
  readonly closed?: boolean;
70
70
  /**
71
71
  * Its zone (default start): the item's own, not its edge's. It lies there where its edge takes its kind there, else in
72
- * the first zone that does (`zoneIn`). Only a drop that names a zone (a gap in a zone, `moveTo` with `zone`) sets it.
72
+ * the first zone that does (`zoneIn`). Only a drop that names a zone (a gap in a zone, `moveTo` with `zone`) on an edge
73
+ * offering a choice (`namesZone`: more than one of its zones takes the kind) sets it.
73
74
  */
74
75
  readonly align?: Zone;
75
76
  /**
@@ -666,8 +667,9 @@ declare function fitResize(scene: Scene, id: string, rect: Rect, moving: ResizeE
666
667
  * given, the same object, so `after === before` says nothing changed.
667
668
  *
668
669
  * - `moveTo(scene, id, { edge, zone?, at })`: docks the item in that edge, before the `at`-th item of the zone (counting
669
- * the zone's items without it, closed ones included), or at the zone's end. A zone named becomes the item's `align`;
670
- * with none, the item keeps its own and docks in the zone it lies in there (`zoneIn`: its own where the edge takes it
670
+ * the zone's items without it, closed ones included), or at the zone's end. A zone named becomes the item's `align`
671
+ * where the edge offers a choice (`namesZone`: more than one zone takes the kind); on a one-zone edge, or with none
672
+ * named, the item keeps its own and docks in the zone it lies in there (`zoneIn`: its own where the edge takes it
671
673
  * there, else the first that does). A new column, a rail and `dockHome` name none either: the item's zone is its own.
672
674
  * `{ kind: "column", side, ring }` makes a new column from `scene.columns[side]` at that ring (`Infinity`: the side's
673
675
  * inner end, "Move to › Dock left"); `{ kind: "rail", side, ring }` does the same with the item folded by hand, so it
@@ -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-gUF8juqt.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-YDXCs2N_.js';
4
4
  import './target-Db9z1bWt.js';
5
5
 
6
6
  /**
@@ -19,7 +19,7 @@ import {
19
19
  storeScene,
20
20
  targets,
21
21
  use
22
- } from "./chunk-US2TGS3W.js";
22
+ } from "./chunk-PADZWK3H.js";
23
23
  import "./chunk-AE3BWTAE.js";
24
24
  import {
25
25
  centre,
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, 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';
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-YDXCs2N_.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-YDXCs2N_.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';
@@ -40,6 +40,15 @@ declare const railModeOf: (scene: Scene, side: Side) => RailMode;
40
40
  * on an edge that takes it there.
41
41
  */
42
42
  declare function zoneIn(edge: Edge, item: SceneItem): Zone;
43
+ /**
44
+ * Whether a drop on `edge` names a zone for `kind`: the edge offers a choice, more than one of its zones taking the
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
+ * at its start only) the item keeps its own, and lies in that one zone there (`zoneIn`).
47
+ */
48
+ declare const namesZone: (edge: {
49
+ readonly accepts: readonly Kind[];
50
+ readonly zoneAccepts?: ZoneAccepts;
51
+ }, kind: Kind) => boolean;
43
52
  /**
44
53
  * A left or right toolbar bar outside the inset (`isSideBar` with `outsideInset`). It lies outermost on its side,
45
54
  * before the side's rail.
@@ -262,4 +271,4 @@ declare function refusalTargets(list: readonly SceneRefusal[]): SceneRefusalTarg
262
271
  */
263
272
  declare function stops(scene: Scene, dragged: string, options?: SceneTargetOptions): SceneTarget[];
264
273
 
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 };
274
+ 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, namesZone, parseTargetId, placeTargetId, railModeOf, refusalTargets, refusals, reservedRect, solve, stops, targetId, targets, virtualEdgeId, zoneIn, zoneTakes, zonesTaking };
package/dist/scene.js CHANGED
@@ -25,6 +25,7 @@ import {
25
25
  keep,
26
26
  lift,
27
27
  moveTo,
28
+ namesZone,
28
29
  open,
29
30
  orient,
30
31
  parseTargetId,
@@ -48,7 +49,7 @@ import {
48
49
  zoneIn,
49
50
  zoneTakes,
50
51
  zonesTaking
51
- } from "./chunk-US2TGS3W.js";
52
+ } from "./chunk-PADZWK3H.js";
52
53
  import {
53
54
  fitFloat
54
55
  } from "./chunk-AE3BWTAE.js";
@@ -81,6 +82,7 @@ export {
81
82
  keep,
82
83
  lift,
83
84
  moveTo,
85
+ namesZone,
84
86
  open,
85
87
  orient,
86
88
  parseTargetId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n-uf/placement",
3
- "version": "26.11.39",
3
+ "version": "26.11.40",
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.39"
87
+ "@n-uf/motion": "26.11.40"
88
88
  },
89
89
  "scripts": {
90
90
  "build": "tsup && node ./scripts/check-dist.mjs",