@n-uf/docking 26.11.58 → 26.11.59
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 +51 -0
- package/dist/{chunk-7QOY2URO.js → chunk-Y3RK6BQT.js} +585 -352
- package/dist/chunk-Y3RK6BQT.js.map +1 -0
- package/dist/{drag-BGcY5DGm.d.ts → drag-DpoWfEc7.d.ts} +12 -3
- package/dist/index.d.ts +30 -7
- package/dist/index.js +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +12 -9
- package/dist/testing.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-7QOY2URO.js.map +0 -1
|
@@ -1190,6 +1190,17 @@ interface DockDropOptions {
|
|
|
1190
1190
|
readonly floatOrient?: Orient;
|
|
1191
1191
|
/** As `solve`'s: edge or item ids solved without `previous`, in every `after` too. */
|
|
1192
1192
|
readonly fresh?: readonly string[];
|
|
1193
|
+
/**
|
|
1194
|
+
* Where the pointer holds the item, from its top left corner as it is now, px (what a target's `after(point, grab)`
|
|
1195
|
+
* takes): the press's, constant for the drag. On a bar or a toolbar rail, where the landings either side of a neighbor
|
|
1196
|
+
* overlap, the tiles are cut there by it, as `lanes()` cuts its spots (`aimCut`); default the item's middle.
|
|
1197
|
+
*/
|
|
1198
|
+
readonly grab?: Point;
|
|
1199
|
+
/**
|
|
1200
|
+
* The pitch of a bar's free-stretch spots, px (default `SPOT_PITCH`), as `DockLaneOptions.pitch`: half of it is how far
|
|
1201
|
+
* past the overlap of two overlapping landings their cut may lie (`aimCut`), for the tiles and the lanes alike.
|
|
1202
|
+
*/
|
|
1203
|
+
readonly pitch?: number;
|
|
1193
1204
|
}
|
|
1194
1205
|
/** Where a drop of the dragged item is refused: a host draws nothing there and may say "Can't go here" at the pointer. */
|
|
1195
1206
|
interface DockRefusal {
|
|
@@ -1252,8 +1263,6 @@ interface DockRefusal {
|
|
|
1252
1263
|
* is `dockDrag`'s (./drag), built on these.
|
|
1253
1264
|
*/
|
|
1254
1265
|
|
|
1255
|
-
/** The pitch of the spots over a bar's free stretches, px: a quarter of a typical toolbar's length (158 px in the lab). */
|
|
1256
|
-
declare const SPOT_PITCH = 40;
|
|
1257
1266
|
/**
|
|
1258
1267
|
* A sliding spot's range (`DockLaneOptions.stretchPositions: "free"`): where the landing's start may lie along the lane,
|
|
1259
1268
|
* from flush against the neighbor before the stretch to flush against the one after it, and the starts it snaps to.
|
|
@@ -1555,4 +1564,4 @@ interface DockDrag {
|
|
|
1555
1564
|
*/
|
|
1556
1565
|
declare function dockDrag(state: DockState, dragged: string, options?: DockLaneOptions): DockDrag;
|
|
1557
1566
|
|
|
1558
|
-
export { type KeepClearRegion as $, type AnchoredKeepClear as A, type DockMark as B, type ColumnPlace as C, type DockItem as D, type DockNote as E, type FloatAnchorAt as F, type DockNoteCode as G, type DockPlace as H, type DockRailLayout as I, type DockRegions as J, type Kind as K, type DockSpot as L, type DockStateRead as M, type DropPlace as N, type Orient as O, type DropResult as P, EDGE_ROOM_HOLD as Q, type RailMode as R, type SolveOptions as S, type EmptyLanes as T, FLOAT_ANCHORS as U, type FloatAnchorOffset as V, type FloatPlace as W, type FloatResize as X, HATCH_EDGE as Y, type ZoneAccepts as Z, HATCH_END as _, type FloatAnchor as a, type LaneRefusal as a0, type LaneSlide as a1, type Place as a2, RAIL_MODES as a3, RAIL_STRIP_MIN as a4, RAIL_VISIBILITIES as a5, type RailDropPolicy as a6, type RailPlace as a7, type RailSpec as a8, type RailVisibility as a9,
|
|
1567
|
+
export { type KeepClearRegion as $, type AnchoredKeepClear as A, type DockMark as B, type ColumnPlace as C, type DockItem as D, type DockNote as E, type FloatAnchorAt as F, type DockNoteCode as G, type DockPlace as H, type DockRailLayout as I, type DockRegions as J, type Kind as K, type DockSpot as L, type DockStateRead as M, type DropPlace as N, type Orient as O, type DropResult as P, EDGE_ROOM_HOLD as Q, type RailMode as R, type SolveOptions as S, type EmptyLanes as T, FLOAT_ANCHORS as U, type FloatAnchorOffset as V, type FloatPlace as W, type FloatResize as X, HATCH_EDGE as Y, type ZoneAccepts as Z, HATCH_END as _, type FloatAnchor as a, type LaneRefusal as a0, type LaneSlide as a1, type Place as a2, RAIL_MODES as a3, RAIL_STRIP_MIN as a4, RAIL_VISIBILITIES as a5, type RailDropPolicy as a6, type RailPlace as a7, type RailSpec as a8, type RailVisibility as a9, resizeEdge as aA, resizeFloat as aB, setRailMode as aC, setSide as aD, storeDockState as aE, type ResizeEdges as aa, type ResizeLimit as ab, SIDES as ac, type StoredDockState as ad, type StoredDockStateEdge as ae, type StoredDockStateFloat as af, type StoredDockStateItem as ag, ZONES as ah, canFold as ai, closeItem as aj, dockDrag as ak, dockHome as al, fitResize as am, floatAt as an, foldItem as ao, homeFor as ap, keepItem as aq, lanes as ar, liftItem as as, markUsed as at, mergeSideColumns as au, moveTo as av, openItem as aw, orientFloat as ax, raiseFloat as ay, readDockState as az, type Zone as b, type DockState as c, type KeepClear as d, type DockEdge as e, type DockLayout as f, type DockRefusal as g, type DockDropOptions as h, type DockDrop as i, type ColumnTemplate as j, DEFAULT_FLOAT_SIZE as k, DEFAULT_HIT_BAND as l, DEFAULT_RAIL_MAGNET as m, DEFAULT_STRIP as n, type DockAfter as o, type DockDrag as p, type DockEdgeLayout as q, type DockFloat as r, type DockGuideFrame as s, type DockGuideRef as t, type DockHeld as u, type DockItemLayout as v, type DockKeepClearLayout as w, type DockLane as x, type DockLaneMark as y, type DockLaneOptions as z };
|
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 DockGuideFrame, t as DockGuideRef, u as DockHeld, v as DockItemLayout, w as DockKeepClearLayout, x as DockLane, y as DockLaneMark, z as DockLaneOptions, B as DockMark, E as DockNote, G as DockNoteCode, H as DockPlace, I as DockRailLayout, J as DockRegions, L as DockSpot, M as DockStateRead, N as DropPlace, P as DropResult, Q as EDGE_ROOM_HOLD, T as EmptyLanes, U as FLOAT_ANCHORS, V as FloatAnchorOffset, W as FloatPlace, X as FloatResize, Y as HATCH_EDGE, _ as HATCH_END, $ as KeepClearRegion, a0 as LaneRefusal, a1 as LaneSlide, a2 as Place, a3 as RAIL_MODES, a4 as RAIL_STRIP_MIN, a5 as RAIL_VISIBILITIES, a6 as RailDropPolicy, a7 as RailPlace, a8 as RailSpec, a9 as RailVisibility, aa as ResizeEdges, ab as ResizeLimit, ac as SIDES, ad as
|
|
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-DpoWfEc7.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 DockGuideFrame, t as DockGuideRef, u as DockHeld, v as DockItemLayout, w as DockKeepClearLayout, x as DockLane, y as DockLaneMark, z as DockLaneOptions, B as DockMark, E as DockNote, G as DockNoteCode, H as DockPlace, I as DockRailLayout, J as DockRegions, L as DockSpot, M as DockStateRead, N as DropPlace, P as DropResult, Q as EDGE_ROOM_HOLD, T as EmptyLanes, U as FLOAT_ANCHORS, V as FloatAnchorOffset, W as FloatPlace, X as FloatResize, Y as HATCH_EDGE, _ as HATCH_END, $ as KeepClearRegion, a0 as LaneRefusal, a1 as LaneSlide, a2 as Place, a3 as RAIL_MODES, a4 as RAIL_STRIP_MIN, a5 as RAIL_VISIBILITIES, a6 as RailDropPolicy, a7 as RailPlace, a8 as RailSpec, a9 as RailVisibility, aa as ResizeEdges, ab as ResizeLimit, ac as SIDES, ad as StoredDockState, ae as StoredDockStateEdge, af as StoredDockStateFloat, ag as StoredDockStateItem, ah as ZONES, ai as canFold, aj as closeItem, ak as dockDrag, al as dockHome, am as fitResize, an as floatAt, ao as foldItem, ap as homeFor, aq as keepItem, ar as lanes, as as liftItem, at as markUsed, au as mergeSideColumns, av as moveTo, aw as openItem, ax as orientFloat, ay as raiseFloat, az as readDockState, aA as resizeEdge, aB as resizeFloat, aC as setRailMode, aD as setSide, aE as storeDockState } from './drag-DpoWfEc7.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';
|
|
@@ -295,7 +295,8 @@ declare function placeTargetId(place: PlaceLike, item: string): string | null;
|
|
|
295
295
|
* `options.floatOrient`, else its float's, else the item's (`floatOrientOf`). Its size: `options.floatSize`, else its
|
|
296
296
|
* float's size where it lands in the orient that float is in, else `floatSizeOf` for the orient it lands in.
|
|
297
297
|
*
|
|
298
|
-
* `stops(state, id)` orders the
|
|
298
|
+
* `stops(state, id)` orders the places (no home, no none) for "Move to ›" and the arrow keys: every place the item lands,
|
|
299
|
+
* whether or not the pointer reaches it (the pointer takes the nearest landing, so a place may have no hit of its own).
|
|
299
300
|
*
|
|
300
301
|
* A dropped item counts as just used (`markUsed`). An unknown or closed item has no targets; a fixed item has none either,
|
|
301
302
|
* but on an edge that `moves: "side"` (an anchor): `side:<other side>` (2), over the place its edge takes there
|
|
@@ -330,9 +331,11 @@ interface DockRefusalTarget extends Target {
|
|
|
330
331
|
*/
|
|
331
332
|
declare function refusalTargets(list: readonly DockRefusal[]): DockRefusalTarget[];
|
|
332
333
|
/**
|
|
333
|
-
* `stops(state, id, options?)`: the places for "Move to ›" and the arrow keys, in reading order
|
|
334
|
-
*
|
|
335
|
-
*
|
|
334
|
+
* `stops(state, id, options?)`: the places for "Move to ›" and the arrow keys, in reading order (`home` and `none` left
|
|
335
|
+
* out): the left side outer to inner, the top bars, the bottom bars, the right side inner to outer, floating last. Stops
|
|
336
|
+
* are the places; the pointer takes the nearest. So a stop is every place the item lands, the targets and the gaps no
|
|
337
|
+
* pointer reaches (a landing nearer every pointer than theirs: their `hit` is their landing, no part of `targets()`).
|
|
338
|
+
* Its `after` is the move.
|
|
336
339
|
*
|
|
337
340
|
* Remembered per state: a state is an immutable value (every change returns a new one), so the stops of one item of one
|
|
338
341
|
* state with the same options are solved once, and asking again (a menu redrawn, every group's list on each render) costs
|
|
@@ -341,4 +344,24 @@ declare function refusalTargets(list: readonly DockRefusal[]): DockRefusalTarget
|
|
|
341
344
|
*/
|
|
342
345
|
declare function stops(state: DockState, dragged: string, options?: DockDropOptions): DockDrop[];
|
|
343
346
|
|
|
344
|
-
|
|
347
|
+
/**
|
|
348
|
+
* Aim order: where a drag along an edge stops meaning one place and starts meaning the next. The one rule both
|
|
349
|
+
* `targets()` (its tiles) and `lanes()` (its spots' stretches) cut by, so a pointer picks the same side of a neighbor
|
|
350
|
+
* whichever a host reads.
|
|
351
|
+
*
|
|
352
|
+
* - A panel column (a side edge that is not compact) takes a panel by halves: between two places that share a
|
|
353
|
+
* neighbor, the cut is that neighbor's middle as drawn.
|
|
354
|
+
* - A bar or a toolbar rail takes the nearest landing (decision 0001, the hand rule): halfway across the gap between
|
|
355
|
+
* the two landings, so the pointer is at the landing it picks. Where the two landings overlap (the neighbor between
|
|
356
|
+
* them shorter than the item), the cut is made where the item is held (`grab`): halfway between the points the pointer
|
|
357
|
+
* would hold in each, kept within `slack` of their overlap.
|
|
358
|
+
*
|
|
359
|
+
* Each landing lies in the layout its own drop commits (a growing neighbor as that commit draws it, given way); a place
|
|
360
|
+
* over free room cuts from its range's ends, the room its drop makes. Which places exist is read in the room, growth
|
|
361
|
+
* off; no cut is read from insertion lines, as drawn or with the growth off; what is drawn is `shown(frame)`.
|
|
362
|
+
*/
|
|
363
|
+
|
|
364
|
+
/** The pitch of the spots over a bar's free stretches, px: a quarter of a typical toolbar's length (158 px in the lab). */
|
|
365
|
+
declare const SPOT_PITCH = 40;
|
|
366
|
+
|
|
367
|
+
export { AnchoredKeepClear, type DockDivider, DockDrop, DockDropOptions, DockEdge, DockItem, DockLayout, DockRefusal, type DockRefusalTarget, DockState, FloatAnchor, FloatAnchorAt, KeepClear, Kind, Orient, RailMode, SPOT_PITCH, SolveOptions, type TargetIdParts, Zone, ZoneAccepts, anchorName, declaresFloatSizes, dividers, edgeTakes, floatOrientOf, floatSizeOf, heldRect, isAnchoredKeepClear, isOutsideSideBar, isSideBar, isSideColumn, namesZone, parseTargetId, placeTargetId, railModeOf, refusalTargets, refusals, reservedRect, resetBetween, resetLengths, resizeBetween, solve, stops, targetId, targets, virtualEdgeId, zoneIn, zoneTakes, zonesTaking };
|
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, N as DropPlace, f as DockLayout,
|
|
3
|
+
import { c as DockState, N as DropPlace, f as DockLayout, ad as StoredDockState, b as Zone, G as DockNoteCode, i as DockDrop, g as DockRefusal, z as DockLaneOptions, u as DockHeld, t as DockGuideRef, J as DockRegions, L as DockSpot } from './drag-DpoWfEc7.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-Y3RK6BQT.js";
|
|
22
22
|
|
|
23
23
|
// src/testing/rows-docking.ts
|
|
24
24
|
import { rect as r } from "@n-uf/placement";
|
|
@@ -935,13 +935,16 @@ var RULE_ROWS = [
|
|
|
935
935
|
expectDom: [{ select: "[data-drag-slot]", count: 0, note: "no slot over a body" }]
|
|
936
936
|
},
|
|
937
937
|
{
|
|
938
|
-
id: "R4-bar-
|
|
939
|
-
title: "A bar's
|
|
940
|
-
expect: "In a bar the
|
|
938
|
+
id: "R4-bar-items-take-the-nearest-landing",
|
|
939
|
+
title: "A bar's items take the nearest landing",
|
|
940
|
+
expect: "In a bar a toolbar takes the nearest landing: the gap before Views and the gap after it meet halfway between their landings (the one before it, Views moved on, and Zoom's own place). Over Views, as long as Zoom, it is the gap before it on either side of Views' middle; past the cut, Zoom's own place.",
|
|
941
941
|
group: "bands",
|
|
942
942
|
state: doc(),
|
|
943
|
-
gestures: [g.press("zoom"), g.at(100, 50), g.hold(), g.at(160, 50), g.hold()],
|
|
944
|
-
checkpoints: [
|
|
943
|
+
gestures: [g.press("zoom"), g.at(100, 50), g.hold(), g.at(160, 50), g.hold(), g.at(260, 50), g.hold()],
|
|
944
|
+
checkpoints: [
|
|
945
|
+
{ at: 2, layout: { items: { views: { rect: r3(212, 32, 200, 36) }, zoom: { rect: r3(8, 32, 200, 36) }, tools: { rect: r3(416, 32, 200, 36) } }, order: { toolbar: ["zoom", "views", "tools"] } }, note: "over Views' leading half: before it" },
|
|
946
|
+
{ at: 4, layout: { items: { views: { rect: r3(212, 32, 200, 36) }, zoom: { rect: r3(8, 32, 200, 36) }, tools: { rect: r3(416, 32, 200, 36) } }, order: { toolbar: ["zoom", "views", "tools"] } }, note: "over Views' trailing half, nearer the landing before it: still before it" }
|
|
947
|
+
],
|
|
945
948
|
expectLayout: { items: { views: { rect: r3(8, 32, 200, 36) }, zoom: { rect: r3(212, 32, 200, 36) }, tools: { rect: r3(416, 32, 200, 36) } }, order: { toolbar: ["views", "zoom", "tools"] } }
|
|
946
949
|
},
|
|
947
950
|
{
|
|
@@ -1062,15 +1065,15 @@ var RULE_ROWS = [
|
|
|
1062
1065
|
id: `R7-end-zone-pushes-fixed-behind-a-movable-${half}`,
|
|
1063
1066
|
title: `Fixed items behind a movable one are pushed: Zoom's ${half} half`,
|
|
1064
1067
|
expect: {
|
|
1065
|
-
leading: "In a title bar whose end zone is State and Page (fixed) then Zoom, Tools let go over Zoom's leading half
|
|
1068
|
+
leading: "In a title bar whose end zone is State and Page (fixed) then Zoom, Tools let go over Zoom's leading half takes the nearest landing, Zoom's place (gap end:3), as over its trailing half: Zoom, as long as Tools, moves left, and State and Page, placed only by Zoom's size, move left with it.",
|
|
1066
1069
|
trailing: "The same title bar: Tools let go over Zoom's trailing half lands after Zoom (gap end:3), State, Page and Zoom moving left to make room."
|
|
1067
1070
|
}[half],
|
|
1068
1071
|
group: "groups",
|
|
1069
1072
|
state: titleEnd(["state", "page", "zoom"]),
|
|
1070
1073
|
gestures: [g.press("tools"), g.at(half === "leading" ? 1050 : 1150, 16), g.hold(), g.release()],
|
|
1071
1074
|
expectLayout: {
|
|
1072
|
-
items:
|
|
1073
|
-
order: { titlebar:
|
|
1075
|
+
items: { tools: { edge: "titlebar", zone: "end", rect: r3(1e3, 0, 200, 32) }, state: { rect: r3(662, 0, 96, 32) }, page: { rect: r3(758, 0, 42, 32) }, zoom: { rect: r3(800, 0, 200, 32) } },
|
|
1076
|
+
order: { titlebar: ["title", "state", "page", "zoom", "tools"] }
|
|
1074
1077
|
}
|
|
1075
1078
|
})
|
|
1076
1079
|
),
|