@n-uf/docking 26.12.0 → 26.12.2
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 +30 -0
- package/dist/{chunk-GWRE7UD7.js → chunk-2SIB26V3.js} +131 -51
- package/dist/chunk-2SIB26V3.js.map +1 -0
- package/dist/{drag-CEdu7jFG.d.ts → drag-CO0-d_ga.d.ts} +36 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/dist/testing.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-GWRE7UD7.js.map +0 -1
|
@@ -328,12 +328,19 @@ type ZoneAccepts = Readonly<Partial<Record<Zone, readonly Kind[]>>>;
|
|
|
328
328
|
/** How a side's rails show their items: their titles while they fit (the default), or their tiles only. */
|
|
329
329
|
type RailMode = "titles" | "icons";
|
|
330
330
|
declare const RAIL_MODES: readonly RailMode[];
|
|
331
|
-
/**
|
|
331
|
+
/**
|
|
332
|
+
* A side's one rail strip: folded columns show in it as segments, in ring order. When their tiles don't fit, the tiles
|
|
333
|
+
* that give way first go into a » at its end, as on a bar (`DockRailLayout.menu`).
|
|
334
|
+
*/
|
|
332
335
|
interface RailSpec {
|
|
333
336
|
/** Its width, px. */
|
|
334
337
|
readonly width: number;
|
|
335
338
|
/** The kinds a drop on the rail may bring (it docks folded). */
|
|
336
339
|
readonly accepts: readonly Kind[];
|
|
340
|
+
/** The » entry's size along the rail, px (default `@n-uf/placement`'s `DEFAULT_MENU`, 28, as for an edge). */
|
|
341
|
+
readonly menu?: {
|
|
342
|
+
readonly main: number;
|
|
343
|
+
};
|
|
337
344
|
}
|
|
338
345
|
/** When a host draws a side's rail drop strip: while an item of the kind is held (the default), always, or never. */
|
|
339
346
|
type RailVisibility = "whileDragging" | "always" | "never";
|
|
@@ -574,13 +581,25 @@ interface DockItemLayout {
|
|
|
574
581
|
* forms of this axis. Hosts read it here, never from `formKind`.
|
|
575
582
|
*/
|
|
576
583
|
readonly axis: Orient;
|
|
577
|
-
/**
|
|
584
|
+
/**
|
|
585
|
+
* The form it took: an index into the forms of its axis, always one of the host's forms, the one the host draws the
|
|
586
|
+
* item in. In an edge's » that is the item's own menu form; in a rail's » (a side's rail strip, or a column drawn as a
|
|
587
|
+
* rail) its tile, the form it is drawn in once out of the », since the » form there is docking's own; a rail member with
|
|
588
|
+
* no tile reports the form it starts in. `formKind` is that form's kind, with one exception: a side's rail member with
|
|
589
|
+
* no tile is drawn as a square of the rail's width (a tile docking makes for it, not a host form), and reports
|
|
590
|
+
* `formKind: "rail"` beside the `form` it starts in.
|
|
591
|
+
*/
|
|
578
592
|
readonly form: number;
|
|
579
593
|
readonly formKind: StackFormKind;
|
|
580
594
|
/** Docked: its edge and zone. */
|
|
581
595
|
readonly edge?: string;
|
|
582
596
|
readonly zone?: Zone;
|
|
583
597
|
readonly floating?: boolean;
|
|
598
|
+
/**
|
|
599
|
+
* It lies in a » (an edge's or a rail's), at the » entry's rect. A host tells "in a »" by this, never by
|
|
600
|
+
* `formKind === "menu"`: a rail's » member reports its tile. Lifted, it is held at the nearest form at or before `form`
|
|
601
|
+
* that isn't a menu form, and its home is the » entry.
|
|
602
|
+
*/
|
|
584
603
|
readonly inMenu?: boolean;
|
|
585
604
|
/** A rail tab (its column is a rail). */
|
|
586
605
|
readonly tab?: boolean;
|
|
@@ -661,20 +680,30 @@ interface DockEdgeLayout {
|
|
|
661
680
|
/** Riding on this column (its rect is the bars'). */
|
|
662
681
|
readonly rides?: string;
|
|
663
682
|
}
|
|
664
|
-
/**
|
|
683
|
+
/**
|
|
684
|
+
* A side's rail as laid out. Its members (each folded column's items) are one stack along the rail: titles step down to
|
|
685
|
+
* tiles first; then, within one level, the tiles that give way first go into a » at its end, as on a bar, and come back
|
|
686
|
+
* in exact reverse. Every drawn tile is whole. Every member is in `segments` or in `menu.items`, never both.
|
|
687
|
+
*/
|
|
665
688
|
interface DockRailLayout {
|
|
666
689
|
readonly rect: Rect;
|
|
667
|
-
/**
|
|
690
|
+
/** The members drawn on the rail, one each, in ring order (each folded column's in zone order). A member in the » has none. */
|
|
668
691
|
readonly segments: readonly {
|
|
669
692
|
readonly id: string;
|
|
670
693
|
readonly edge: string;
|
|
671
694
|
readonly rect: Rect;
|
|
672
695
|
}[];
|
|
673
696
|
/**
|
|
674
|
-
*
|
|
675
|
-
*
|
|
697
|
+
* Its » entry (stage px: the rail's width, `RailSpec.menu.main` long, flush with the rail's end) and the members in it
|
|
698
|
+
* in rail order, or null while every member is drawn: the same shape as an edge's `menu`. A host draws the key at
|
|
699
|
+
* `rect` and lists `items`, each like its tile.
|
|
676
700
|
*/
|
|
677
|
-
readonly
|
|
701
|
+
readonly menu: {
|
|
702
|
+
readonly rect: Rect;
|
|
703
|
+
readonly items: readonly string[];
|
|
704
|
+
} | null;
|
|
705
|
+
/** The members' fit along the rail, in rail-local px: `solve`'s `previous` reads it; a host needs it not. */
|
|
706
|
+
readonly stack: StackFit;
|
|
678
707
|
}
|
|
679
708
|
/**
|
|
680
709
|
* Why the layout looks as it does:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FloatAnchorAt, a as FloatAnchor, D as DockItem, K as Kind, Z as ZoneAccepts, b as Zone, O as Orient, c as DockState, d as KeepClear, A as AnchoredKeepClear, e as DockEdge, R as RailMode, S as SolveOptions, f as DockLayout, g as DockRefusal, h as DockDropOptions, i as DockDrop } from './drag-
|
|
2
|
-
export { C as ColumnPlace, j as ColumnTemplate, k as DEFAULT_FLOAT_SIZE, l as DEFAULT_HIT_BAND, m as DEFAULT_RAIL_MAGNET, n as DEFAULT_STRIP, o as DockAfter, p as DockDrag, q as DockEdgeLayout, r as DockFloat, s as DockGrab, t as DockGrabForm, u as DockGrabNote, v as DockGrabPlace, w as DockGuideFrame, x as DockGuideRef, y as DockHeld, z as DockItemLayout, B as DockKeepClearLayout, E as DockLane, G as DockLaneMark, H as DockLaneOptions, I as DockMark, J as DockNote, L as DockNoteCode, M as DockPlace, N as DockRailLayout, P as DockRegions, Q as DockSpot, T as DockStateRead, U as DropPlace, V as DropResult, W as EDGE_ROOM_HOLD, X as EmptyLanes, Y as FLOAT_ANCHORS, _ as FloatAnchorOffset, $ as FloatPlace, a0 as FloatResize, a1 as HATCH_EDGE, a2 as HATCH_END, a3 as KeepClearRegion, a4 as LaneRefusal, a5 as LaneSlide, a6 as Place, a7 as RAIL_MODES, a8 as RAIL_STRIP_MIN, a9 as RAIL_VISIBILITIES, aa as RailDropPolicy, ab as RailPlace, ac as RailSpec, ad as RailVisibility, ae as ResizeEdges, af as ResizeLimit, ag as SIDES, ah as StoredDockState, ai as StoredDockStateEdge, aj as StoredDockStateFloat, ak as StoredDockStateItem, al as ZONES, am as canFold, an as closeItem, ao as dockDrag, ap as dockHome, aq as fitResize, ar as floatAt, as as foldItem, at as homeFor, au as keepItem, av as lanes, aw as liftItem, ax as markUsed, ay as mergeSideColumns, az as moveTo, aA as openItem, aB as orientFloat, aC as raiseFloat, aD as readDockState, aE as resizeEdge, aF as resizeFloat, aG as setRailMode, aH as setSide, aI as storeDockState } from './drag-
|
|
1
|
+
import { F as FloatAnchorAt, a as FloatAnchor, D as DockItem, K as Kind, Z as ZoneAccepts, b as Zone, O as Orient, c as DockState, d as KeepClear, A as AnchoredKeepClear, e as DockEdge, R as RailMode, S as SolveOptions, f as DockLayout, g as DockRefusal, h as DockDropOptions, i as DockDrop } from './drag-CO0-d_ga.js';
|
|
2
|
+
export { C as ColumnPlace, j as ColumnTemplate, k as DEFAULT_FLOAT_SIZE, l as DEFAULT_HIT_BAND, m as DEFAULT_RAIL_MAGNET, n as DEFAULT_STRIP, o as DockAfter, p as DockDrag, q as DockEdgeLayout, r as DockFloat, s as DockGrab, t as DockGrabForm, u as DockGrabNote, v as DockGrabPlace, w as DockGuideFrame, x as DockGuideRef, y as DockHeld, z as DockItemLayout, B as DockKeepClearLayout, E as DockLane, G as DockLaneMark, H as DockLaneOptions, I as DockMark, J as DockNote, L as DockNoteCode, M as DockPlace, N as DockRailLayout, P as DockRegions, Q as DockSpot, T as DockStateRead, U as DropPlace, V as DropResult, W as EDGE_ROOM_HOLD, X as EmptyLanes, Y as FLOAT_ANCHORS, _ as FloatAnchorOffset, $ as FloatPlace, a0 as FloatResize, a1 as HATCH_EDGE, a2 as HATCH_END, a3 as KeepClearRegion, a4 as LaneRefusal, a5 as LaneSlide, a6 as Place, a7 as RAIL_MODES, a8 as RAIL_STRIP_MIN, a9 as RAIL_VISIBILITIES, aa as RailDropPolicy, ab as RailPlace, ac as RailSpec, ad as RailVisibility, ae as ResizeEdges, af as ResizeLimit, ag as SIDES, ah as StoredDockState, ai as StoredDockStateEdge, aj as StoredDockStateFloat, ak as StoredDockStateItem, al as ZONES, am as canFold, an as closeItem, ao as dockDrag, ap as dockHome, aq as fitResize, ar as floatAt, as as foldItem, at as homeFor, au as keepItem, av as lanes, aw as liftItem, ax as markUsed, ay as mergeSideColumns, az as moveTo, aA as openItem, aB as orientFloat, aC as raiseFloat, aD as readDockState, aE as resizeEdge, aF as resizeFloat, aG as setRailMode, aH as setSide, aI as storeDockState } from './drag-CO0-d_ga.js';
|
|
3
3
|
import { Size, Point, Rect, Side, Target } from '@n-uf/placement';
|
|
4
4
|
export { Axis, Side } from '@n-uf/placement';
|
|
5
5
|
import '@n-uf/placement/stack';
|
package/dist/index.js
CHANGED
package/dist/testing.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Point, Rect, Side } from '@n-uf/placement';
|
|
2
2
|
import { StackFormKind } from '@n-uf/placement/stack';
|
|
3
|
-
import { c as DockState, U as DropPlace, f as DockLayout, ah as StoredDockState, b as Zone, L as DockNoteCode, i as DockDrop, g as DockRefusal, H as DockLaneOptions, y as DockHeld, x as DockGuideRef, P as DockRegions, Q as DockSpot } from './drag-
|
|
3
|
+
import { c as DockState, U as DropPlace, f as DockLayout, ah as StoredDockState, b as Zone, L as DockNoteCode, i as DockDrop, g as DockRefusal, H as DockLaneOptions, y as DockHeld, x as DockGuideRef, P as DockRegions, Q as DockSpot } from './drag-CO0-d_ga.js';
|
|
4
4
|
import { LandingGeometry, LandingRegions } from '@n-uf/motion/drag';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/testing.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
stops,
|
|
19
19
|
storeDockState,
|
|
20
20
|
targets
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-2SIB26V3.js";
|
|
22
22
|
|
|
23
23
|
// src/testing/rows-docking.ts
|
|
24
24
|
import { rect as r } from "@n-uf/placement";
|
|
@@ -2071,7 +2071,7 @@ function mapLayout(l, f2) {
|
|
|
2071
2071
|
const rails = {};
|
|
2072
2072
|
for (const side of ["left", "right"]) {
|
|
2073
2073
|
const r5 = l.rails[side];
|
|
2074
|
-
if (r5) rails[side] = { ...r5, segments: r5.segments.map((s) => ({ ...s, id: f2(s.id), edge: f2(s.edge) })) };
|
|
2074
|
+
if (r5) rails[side] = { ...r5, segments: r5.segments.map((s) => ({ ...s, id: f2(s.id), edge: f2(s.edge) })), menu: r5.menu ? { ...r5.menu, items: r5.menu.items.map(f2) } : null, stack: mapFit(r5.stack, f2) };
|
|
2075
2075
|
}
|
|
2076
2076
|
return {
|
|
2077
2077
|
...l,
|