@n-uf/docking 0.0.0-stage → 26.11.54
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 +98 -0
- package/LICENSE +129 -0
- package/README.md +96 -2
- package/dist/chunk-KGNFLHSC.js +4280 -0
- package/dist/chunk-KGNFLHSC.js.map +1 -0
- package/dist/index.d.ts +283 -0
- package/dist/index.js +125 -0
- package/dist/index.js.map +1 -0
- package/dist/lanes-CGg4iMPw.d.ts +1327 -0
- package/dist/testing.d.ts +820 -0
- package/dist/testing.js +3091 -0
- package/dist/testing.js.map +1 -0
- package/package.json +72 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
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 DockEdge, S as Side, R as RailMode, e as SolveOptions, f as DockLayout, g as DockRefusal, h as DockDropOptions, i as DockDrop } from './lanes-CGg4iMPw.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 DockEdgeLayout, p as DockFloat, q as DockItemLayout, r as DockLane, s as DockLaneOptions, t as DockMark, u as DockNote, v as DockNoteCode, w as DockPlace, x as DockRailLayout, y as DockRegions, z as DockSpot, A as DockStateRead, B as DropPlace, E as DropResult, G as EDGE_ROOM_HOLD, H as EmptyLanes, I as FLOAT_ANCHORS, J as FloatAnchorOffset, L as FloatPlace, M as FloatResize, N as HATCH_EDGE, P as HATCH_END, Q as KeepClear, T as LaneRefusal, U as LaneSlide, V as Place, W as RAIL_MODES, X as RAIL_STRIP_MIN, Y as RAIL_VISIBILITIES, _ as RailDropPolicy, $ as RailPlace, a0 as RailSpec, a1 as RailVisibility, a2 as ResizeEdges, a3 as ResizeLimit, a4 as SIDES, a5 as SPOT_PITCH, a6 as StoredDockState, a7 as StoredDockStateEdge, a8 as StoredDockStateFloat, a9 as StoredDockStateItem, aa as ZONES, ab as canFold, ac as closeItem, ad as dockHome, ae as fitResize, af as floatAt, ag as foldItem, ah as homeFor, ai as keepItem, aj as lanes, ak as liftItem, al as markUsed, am as mergeSideColumns, an as moveTo, ao as openItem, ap as orientFloat, aq as raiseFloat, ar as readDockState, as as resizeEdge, at as resizeFloat, au as setRailMode, av as setSide, aw as storeDockState } from './lanes-CGg4iMPw.js';
|
|
3
|
+
import { Size, Point, Rect, Target } from '@n-uf/placement';
|
|
4
|
+
import '@n-uf/placement/stack';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What the state's shapes (`./model`) tell on their own: which zones of an edge take a kind, an edge's axis, an item's
|
|
8
|
+
* zone and forms, whether a side edge is a toolbar bar, and how an item floats (its orient, size and form). Pure.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Where item `id`, of `size`, held at `grab` (the pointer's offset from its top-left corner) lies with the pointer at
|
|
13
|
+
* `pointer`: the grip under the pointer where it fits, else moved just enough to lie wholly inside the float region (the
|
|
14
|
+
* stage less the inset at its left and right). With `floatFromHeld` the float target starts from this rect, so an item
|
|
15
|
+
* held clear of everything lands where it is drawn.
|
|
16
|
+
*/
|
|
17
|
+
declare const heldRect: (state: DockState, id: string, size: Size, pointer: Point, grab: Point) => Rect;
|
|
18
|
+
/** The name of a float's anchor, with or without an offset: `"content-top-right"` for `{ at: "content-top-right", dy: 12 }`. */
|
|
19
|
+
declare const anchorName: (anchor: FloatAnchorAt) => FloatAnchor;
|
|
20
|
+
/** What the zone tests read of an edge (or a column template): what it takes, per zone, and the zones it has. */
|
|
21
|
+
type ZoneDecl = {
|
|
22
|
+
readonly accepts: readonly Kind[];
|
|
23
|
+
readonly zoneAccepts?: ZoneAccepts;
|
|
24
|
+
readonly zones?: readonly Zone[];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Whether `edge` takes kind `kind` in `zone`: a zone the edge has (`zones`), its `accepts`, narrowed by `zoneAccepts`
|
|
28
|
+
* when given (a zone not listed takes nothing).
|
|
29
|
+
*/
|
|
30
|
+
declare const zoneTakes: (edge: ZoneDecl, zone: Zone, kind: Kind) => boolean;
|
|
31
|
+
/** The zones of `edge` that take `kind`, in order. */
|
|
32
|
+
declare const zonesTaking: (edge: ZoneDecl, kind: Kind) => Zone[];
|
|
33
|
+
/**
|
|
34
|
+
* Whether `edge` takes `kind` anywhere: its `accepts` lists it and at least one of its zones takes it (`zoneTakes`). An
|
|
35
|
+
* edge whose zones take nothing for the kind (`zoneAccepts: {}`) takes it nowhere, exactly as one whose `accepts` lacks
|
|
36
|
+
* it: the one test drop targets and refusals ask. The stored form and `readDockState` keep reading `accepts` itself.
|
|
37
|
+
*/
|
|
38
|
+
declare const edgeTakes: (edge: ZoneDecl, kind: Kind) => boolean;
|
|
39
|
+
/** How the rails of `side` show their items (`DockState.railModes`, default `"titles"`); top and bottom have no rails. */
|
|
40
|
+
declare const railModeOf: (state: DockState, side: Side) => RailMode;
|
|
41
|
+
/**
|
|
42
|
+
* The zone `item` lies in on `edge`: its own (`align`) where the edge takes its kind there, else the first zone that
|
|
43
|
+
* does; one the edge takes nowhere, in its own. A fixed item lies in its own where the edge has that zone (`zones`),
|
|
44
|
+
* 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`
|
|
45
|
+
* stays as it was, so it is back in its own zone on an edge that takes it there.
|
|
46
|
+
*/
|
|
47
|
+
declare function zoneIn(edge: DockEdge, item: DockItem): Zone;
|
|
48
|
+
/**
|
|
49
|
+
* Whether a drop on `edge` names a zone for `kind`: the edge offers a choice, more than one of its zones taking the
|
|
50
|
+
* 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
|
|
51
|
+
* at its start only) the item keeps its own, and lies in that one zone there (`zoneIn`).
|
|
52
|
+
*/
|
|
53
|
+
declare const namesZone: (edge: ZoneDecl, kind: Kind) => boolean;
|
|
54
|
+
/**
|
|
55
|
+
* A left or right toolbar bar outside the inset (`isSideBar` with `outsideInset`). It lies outermost on its side,
|
|
56
|
+
* before the side's rail.
|
|
57
|
+
*/
|
|
58
|
+
declare function isOutsideSideBar(state: DockState, e: DockEdge): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* A left or right toolbar bar: told from a column edge by its kinds, it takes something and nothing the side's columns
|
|
61
|
+
* or its rail take (`DockState.columns[side].accepts`, `DockState.rails[side].accepts`); an anchor takes nothing. A side with
|
|
62
|
+
* neither a column template nor a rail has nothing to tell them apart by, so no edge there is a bar.
|
|
63
|
+
*/
|
|
64
|
+
declare function isSideBar(state: DockState, e: DockEdge): boolean;
|
|
65
|
+
/** A left or right column: a side edge that takes something, not a compact rail and not a toolbar bar (`isSideBar`). */
|
|
66
|
+
declare const isSideColumn: (state: DockState, e: DockEdge) => boolean;
|
|
67
|
+
/**
|
|
68
|
+
* The orient a float of `item` takes when it names none: its `floatOrient`, else the axis of its first form (the first
|
|
69
|
+
* of `forms.row` / `forms.column` it declares with any form), else column.
|
|
70
|
+
*/
|
|
71
|
+
declare const floatOrientOf: (item: DockItem) => Orient;
|
|
72
|
+
/**
|
|
73
|
+
* Whether `item` declares `floatSizes` (the per-orient float sizes). Only such an item is sized per orient; one that
|
|
74
|
+
* declares none is framed as before them: a float at its first form keeps its stored rect.
|
|
75
|
+
*/
|
|
76
|
+
declare const declaresFloatSizes: (item: DockItem) => boolean;
|
|
77
|
+
/**
|
|
78
|
+
* A float's size along `orient` (default `floatOrientOf`) when nothing else gives one: the item's `floatSizes` for that
|
|
79
|
+
* orient, else its first form's natural size along `orient`, or `DEFAULT_FLOAT_SIZE` when that form grows (a panel's
|
|
80
|
+
* card has no natural float length) or the item has no form there.
|
|
81
|
+
*/
|
|
82
|
+
declare function floatSizeOf(item: DockItem, orient?: Orient): Size;
|
|
83
|
+
|
|
84
|
+
declare function solve(given: DockState, options?: SolveOptions): DockLayout;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Generation, the real edges: each edge's zones and their extents, its slots (insertion lines, each with the drop it
|
|
88
|
+
* makes, settled), its reserved stretches and its band across, as the tiler reads them (`EdgeSpec`).
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* What a fixed item reserves in `l`: its drawn rect, or for a form that grows only its natural length, placed by its
|
|
93
|
+
* zone (from its start, from its end in the end zone, centered in the center zone). No hit or slot ever lies there, so a
|
|
94
|
+
* host that draws "no drop" areas reads them from here.
|
|
95
|
+
*/
|
|
96
|
+
declare function reservedRect(state: DockState, l: DockLayout, id: string): Rect;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The one id scheme of the DockState's targets and refusals: every id `targets`, `refusals` and `stops` give is built here,
|
|
100
|
+
* and a host reads one back with `parseTargetId` instead of splitting strings.
|
|
101
|
+
*
|
|
102
|
+
* | Id | What it names | Priority |
|
|
103
|
+
* |---|---|---|
|
|
104
|
+
* | `gap:<edge>:<zone>:<at>` | a slot before the `at`-th item of an edge's zone | 2 |
|
|
105
|
+
* | `strip:<edge>:<zone>` | a zone's one slot on an edge with no members at all | 2 |
|
|
106
|
+
* | `column:<side>:<ring>` | a new column on a side's column line | 2 |
|
|
107
|
+
* | `rail:<side>:<ring>` | docking folded into a side's rail | 1 |
|
|
108
|
+
* | `side:<side>` | a fixed anchor's edge moved to the other side of its axis (`DockEdge.moves: "side"`) | 2 |
|
|
109
|
+
* | `home:<item>` | the item's own place (a release there puts it back) | 1 |
|
|
110
|
+
* | `float:<item>` | floating anywhere | 3 |
|
|
111
|
+
* | `none:<i>` | the `i`-th `blocked` rect | 1 |
|
|
112
|
+
* | `refuse:<edge>:<zone>[:<n>]` | a refusal; `:<n>` from a zone's second refused tile on, by where it lies | — |
|
|
113
|
+
*
|
|
114
|
+
* An edge id may hold `:` (the zone and the numbers are read from the right). The virtual edges a refusal can name are
|
|
115
|
+
* `column:<side>` (a side's column lines) and `rail:<side>` (its rail): `virtualEdgeId`.
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
type ColumnSide = "left" | "right";
|
|
119
|
+
/** A `DropPlace`, as much of it as an id reads (this module imports no more of the state, so `solve` may use it). */
|
|
120
|
+
type PlaceLike = {
|
|
121
|
+
readonly kind: "gap";
|
|
122
|
+
readonly edge: string;
|
|
123
|
+
readonly zone: Zone;
|
|
124
|
+
readonly at: number;
|
|
125
|
+
} | {
|
|
126
|
+
readonly kind: "column" | "rail";
|
|
127
|
+
readonly side: ColumnSide;
|
|
128
|
+
readonly ring: number;
|
|
129
|
+
} | {
|
|
130
|
+
readonly kind: "side";
|
|
131
|
+
readonly side: Side;
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: "float" | "home" | "none";
|
|
134
|
+
};
|
|
135
|
+
/** A target or refusal id, read. */
|
|
136
|
+
type TargetIdParts = {
|
|
137
|
+
readonly kind: "gap";
|
|
138
|
+
readonly edge: string;
|
|
139
|
+
readonly zone: Zone;
|
|
140
|
+
readonly at: number;
|
|
141
|
+
} | {
|
|
142
|
+
readonly kind: "strip";
|
|
143
|
+
readonly edge: string;
|
|
144
|
+
readonly zone: Zone;
|
|
145
|
+
} | {
|
|
146
|
+
readonly kind: "column" | "rail";
|
|
147
|
+
readonly side: ColumnSide;
|
|
148
|
+
readonly ring: number;
|
|
149
|
+
} | {
|
|
150
|
+
readonly kind: "side";
|
|
151
|
+
readonly side: Side;
|
|
152
|
+
} | {
|
|
153
|
+
readonly kind: "home" | "float";
|
|
154
|
+
readonly item: string;
|
|
155
|
+
} | {
|
|
156
|
+
readonly kind: "none";
|
|
157
|
+
readonly index: number;
|
|
158
|
+
} | {
|
|
159
|
+
readonly kind: "refuse";
|
|
160
|
+
readonly edge: string;
|
|
161
|
+
readonly zone: Zone;
|
|
162
|
+
readonly n: number;
|
|
163
|
+
};
|
|
164
|
+
/** The id of the target or refusal `parts` names. */
|
|
165
|
+
declare function targetId(parts: TargetIdParts): string;
|
|
166
|
+
/** What `id` names, or null when it is no id of the scheme. `targetId(parseTargetId(id)!) === id` for every id it reads. */
|
|
167
|
+
declare function parseTargetId(id: string): TargetIdParts | null;
|
|
168
|
+
/** The id of a side's virtual edge: its column lines (`column:<side>`) or its rail (`rail:<side>`), as a refusal names it. */
|
|
169
|
+
declare const virtualEdgeId: (kind: "column" | "rail", side: ColumnSide) => string;
|
|
170
|
+
/**
|
|
171
|
+
* The id `targets` gives the target at `place` for `item`, or null for a place with no fixed id (`none`). A gap's id is
|
|
172
|
+
* its `gap:` one; on an edge with no members its slot is `strip:<edge>:<zone>`.
|
|
173
|
+
*/
|
|
174
|
+
declare function placeTargetId(place: PlaceLike, item: string): string | null;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* `targets(state, dragged, { previous, endReach, floatSize })`: every drop target for one dragged item, in the shape
|
|
178
|
+
* `@n-uf/motion/drag` takes (`id`, `priority`, `hit`, `slot?`, `free?`). Each target's `after(point, grab)` is the state
|
|
179
|
+
* a release there commits and its layout, `solve(after.state, { previous })`: the host draws every item from that layout
|
|
180
|
+
* during the preview (C22), so the preview is the result by construction.
|
|
181
|
+
*
|
|
182
|
+
* One model makes every docked target and refusal: **edge → zones → slots → tiles**, then one ordered
|
|
183
|
+
* filter.
|
|
184
|
+
*
|
|
185
|
+
* - **Edges.** Every edge, empty or occupied, and two virtual edges per side: the column lines and the rail.
|
|
186
|
+
* - **Zones.** Each edge's start, center and end zones have an extent along it. Where items keep their length and the
|
|
187
|
+
* zones only align them (bars, compact rails, side toolbar bars) the extents are the edge's thirds; where items fill
|
|
188
|
+
* the edge (panel columns) a zone's extent is the span the solver gives it: a plain column is one zone, a tray column
|
|
189
|
+
* its panels' span and its tray's (`EDGE_KINDS`, the only data keyed on the kind of edge). The outer extents reach
|
|
190
|
+
* `endReach` past the edge's ends.
|
|
191
|
+
* - **The seen geometry.** Every tile is laid in one layout: the committed one, the item in place, as the user sees it
|
|
192
|
+
* (lines, zone extents, ownership, bands). A place counts in the state with the item lifted (a gap's `at`, a column's
|
|
193
|
+
* or rail's `ring`); its `after` is the solved drop. An edge the lift deletes offers nothing: the item's own column
|
|
194
|
+
* collapses into home. A zone where items keep their length reaches over the cards seen in it.
|
|
195
|
+
* - **Slots.** A zone's insertion lines (`gap:<edge>:<zone>:<at>`; on an edge with no members at all a zone has one,
|
|
196
|
+
* `strip:<edge>:<zone>`). The item's own place is an interval, its own rect along the edge (its » entry in the menu):
|
|
197
|
+
* home. The home slot's line lies at both ends of it, so the gaps right beside it are home's (the same move).
|
|
198
|
+
* - **Tiles.** A zone's extent split halfway between its slots' lines (lines that lie past the extent are spread into
|
|
199
|
+
* it); the own interval keeps exactly its length. Panel bodies don't split the tiling: clipping takes them out, and a
|
|
200
|
+
* slot whose tile is all body has no room. Across: the edge's thickness (the larger of seen and after the drop), an
|
|
201
|
+
* empty edge's strip depth (`DockEdge.strip`, default 24, inward), a compact rail's `RAIL_REACH` further inward.
|
|
202
|
+
* - **Filter**, in order: (i) the edge and zone take the kind (`accepts`, `zoneAccepts`), and an empty side column opens
|
|
203
|
+
* only through its start zone; (ii) the drop fits (C29: no » entry, no new overflow or `too-wide`, every fixed item
|
|
204
|
+
* keeps its form, place and least length, a title bar's title its natural width with the toolbar in its first form;
|
|
205
|
+
* the slot covers no chrome or reserved rect). A slot (i) or (ii) removes is a refusal over its own tile, with that
|
|
206
|
+
* reason (`refusals()`). (iii) Space ownership and clipping (`EDGE_KINDS`): owned > virtual > overreach. A zone's
|
|
207
|
+
* room loses its reserved rects and what edges ranked before it own (in `solve`'s laying order); a zone with no room,
|
|
208
|
+
* or a slot with none in reach, isn't offered. Each tile's owned part is cut clear of the tiles before it, of what
|
|
209
|
+
* outranks its edge, of its panel bodies, of every fixed item that doesn't grow and of the chrome; clipping changes a
|
|
210
|
+
* slot's shape, never who owns it, so every piece left is the slot's (`hits`, `hit` the largest); then the virtual
|
|
211
|
+
* edges take what no edge owns; then each overreach takes what is left and joins its owned part where it meets it
|
|
212
|
+
* whole. Refused places own nothing: they take what the surviving tiles and the other edges' seen rects leave. A
|
|
213
|
+
* stretch is owned by what the user sees there; if the owner has no slot there, it refuses. Slots that are the same
|
|
214
|
+
* move are one (home's, where one of them is home). (iv) `blocked` rects are `none:<i>`.
|
|
215
|
+
*
|
|
216
|
+
* Ids: `gap:<edge>:<zone>:<at>` (priority 2), `strip:<edge>:<zone>` (2), `column:<side>:<ring>` (2), `rail:<side>:<ring>`
|
|
217
|
+
* (1), `none:<i>` (1), `float:<id>` (3, free). A slot that would put the item back where it is keeps its id with place
|
|
218
|
+
* `home` (no slot, nothing committed); `home:<id>` (1) is emitted too, over the same tile (its own rect when no slot is
|
|
219
|
+
* its home), for hosts that read it. A floating item has no home: a move inside its own rect is a float move.
|
|
220
|
+
*
|
|
221
|
+
* - `column:<side>:<ring>`: a new column on each column line of a side whose `state.columns[side]` takes the kind
|
|
222
|
+
* (outside the outermost open column, between two, inside the innermost; on a side with none, at the content's
|
|
223
|
+
* edge), up to `COLUMN_REACH` px each way (two lines nearer than that meet halfway), only where the new column shows
|
|
224
|
+
* open (elsewhere refused).
|
|
225
|
+
* - `rail:<side>:<ring>`: docking folded into a side's rail (its rail and its template take the kind), before each
|
|
226
|
+
* folded column's segments and after the last, or, with no rail shown, the outer `RAIL_EDGE` px from the side's
|
|
227
|
+
* outer edge (the window's, an inset's strip included; flush after the side's outside bars), landing where the rail
|
|
228
|
+
* lands (`DockLayout.railPlaces`). The outermost column line's zone starts where it ends. For a kind with a rail
|
|
229
|
+
* drop policy (`DockState.railDrop`), the side's rail is a drop strip instead, spring-loaded, owning its rect
|
|
230
|
+
* (`./targets/rail-strip`); on a side with no declared rail, its rail is its outermost column that takes the kind,
|
|
231
|
+
* drawn as a rail once the item docks in it folded.
|
|
232
|
+
* - `float:<id>`: when `floatKinds` lists the kind, the whole plane: the landing is the float with the pointer holding
|
|
233
|
+
* it at `grab` (default its middle), in the stage and clear of the docked items, the bars and the chrome. Its orient:
|
|
234
|
+
* `options.floatOrient`, else its float's, else the item's (`floatOrientOf`). Its size: `options.floatSize`, else its
|
|
235
|
+
* float's size where it lands in the orient that float is in, else `floatSizeOf` for the orient it lands in.
|
|
236
|
+
*
|
|
237
|
+
* `stops(state, id)` orders the same targets (no home, no none) for "Move to ›" and the arrow keys.
|
|
238
|
+
*
|
|
239
|
+
* A dropped item counts as just used (`markUsed`). An unknown or closed item has no targets; a fixed item has none either,
|
|
240
|
+
* but on an edge that `moves: "side"` (an anchor): `side:<other side>` (2), over the place its edge takes there
|
|
241
|
+
* (`setSide`), and `home:<id>` over its own rect (`./targets/anchor`).
|
|
242
|
+
*
|
|
243
|
+
* The phases live in `./targets/`: `kinds` (`EDGE_KINDS`), `model` (the shapes), `filter` (the drag's context and
|
|
244
|
+
* filter ii), `edges` and `virtual` (generation), `ownership` and `tiles` (filter iii and clipping).
|
|
245
|
+
*/
|
|
246
|
+
|
|
247
|
+
declare function targets(state: DockState, dragged: string, options?: DockDropOptions): DockDrop[];
|
|
248
|
+
/**
|
|
249
|
+
* `refusals(state, dragged, options?)`: the places a drop of `dragged` is refused, so a host can say so at the pointer
|
|
250
|
+
* ("Can't go here"; the place itself is never drawn) instead of showing a slot elsewhere: each slot the filter removed, over its own tile,
|
|
251
|
+
* `not-accepted` where the edge or zone doesn't take the kind, `no-room` where the drop wouldn't fit along the edge, `too-thick` where no form of the item fits across it (the bar is thinner than every form but the » menu's). An edge that takes
|
|
252
|
+
* the kind in no zone is one refusal over its drawn rect (fixed items included) less what targets own; every refusal
|
|
253
|
+
* lies in the stage, a zone's inside its edge's ends. A release over a refusal commits nothing: the item goes home.
|
|
254
|
+
*/
|
|
255
|
+
declare function refusals(state: DockState, dragged: string, options?: DockDropOptions): DockRefusal[];
|
|
256
|
+
/**
|
|
257
|
+
* A refusal in the pick's shape: `refuse: true`, which ranks it at `REFUSAL_RANK` (after every target of priority 1 and
|
|
258
|
+
* 2, so a target wins wherever the two meet or overlap, before the float). Its `priority` is 2 for a pick rule that
|
|
259
|
+
* doesn't know refusals.
|
|
260
|
+
*/
|
|
261
|
+
interface DockRefusalTarget extends Target {
|
|
262
|
+
readonly refuse: true;
|
|
263
|
+
readonly refusal: DockRefusal;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* `refusalTargets(refusals)`: each refusal as a target for `@n-uf/motion/drag`'s drag intent (`refuse: true`, its
|
|
267
|
+
* pieces as `hits`). Pass them with the targets: the intent never holds or shows one, a release over one lands nowhere,
|
|
268
|
+
* and the frame's `refused` says which the pointer is over (`refused.refusal` is the `DockRefusal`).
|
|
269
|
+
*/
|
|
270
|
+
declare function refusalTargets(list: readonly DockRefusal[]): DockRefusalTarget[];
|
|
271
|
+
/**
|
|
272
|
+
* `stops(state, id, options?)`: the places for "Move to ›" and the arrow keys, in reading order, from the same targets
|
|
273
|
+
* (`home` and `none` left out): the left side outer to inner, the top bars, the bottom bars, the right side inner to
|
|
274
|
+
* outer, floating last. Each stop is a target, so its `after` is the move.
|
|
275
|
+
*
|
|
276
|
+
* Remembered per state: a state is an immutable value (every change returns a new one), so the stops of one item of one
|
|
277
|
+
* state with the same options are solved once, and asking again (a menu redrawn, every group's list on each render) costs
|
|
278
|
+
* nothing until the state is another object. The options count by value, `previous` by identity. The list is yours: a
|
|
279
|
+
* new array each call, over the same targets.
|
|
280
|
+
*/
|
|
281
|
+
declare function stops(state: DockState, dragged: string, options?: DockDropOptions): DockDrop[];
|
|
282
|
+
|
|
283
|
+
export { DockDrop, DockDropOptions, DockEdge, DockItem, DockLayout, DockRefusal, type DockRefusalTarget, DockState, FloatAnchor, FloatAnchorAt, Kind, Orient, RailMode, Side, SolveOptions, type TargetIdParts, Zone, ZoneAccepts, anchorName, declaresFloatSizes, edgeTakes, floatOrientOf, floatSizeOf, heldRect, isOutsideSideBar, isSideBar, isSideColumn, namesZone, parseTargetId, placeTargetId, railModeOf, refusalTargets, refusals, reservedRect, solve, stops, targetId, targets, virtualEdgeId, zoneIn, zoneTakes, zonesTaking };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_FLOAT_SIZE,
|
|
3
|
+
DEFAULT_HIT_BAND,
|
|
4
|
+
DEFAULT_RAIL_MAGNET,
|
|
5
|
+
DEFAULT_STRIP,
|
|
6
|
+
EDGE_ROOM_HOLD,
|
|
7
|
+
FLOAT_ANCHORS,
|
|
8
|
+
HATCH_EDGE,
|
|
9
|
+
HATCH_END,
|
|
10
|
+
RAIL_MODES,
|
|
11
|
+
RAIL_STRIP_MIN,
|
|
12
|
+
RAIL_VISIBILITIES,
|
|
13
|
+
SIDES,
|
|
14
|
+
SPOT_PITCH,
|
|
15
|
+
ZONES,
|
|
16
|
+
anchorName,
|
|
17
|
+
canFold,
|
|
18
|
+
closeItem,
|
|
19
|
+
declaresFloatSizes,
|
|
20
|
+
dockHome,
|
|
21
|
+
edgeTakes,
|
|
22
|
+
fitResize,
|
|
23
|
+
floatAt,
|
|
24
|
+
floatOrientOf,
|
|
25
|
+
floatSizeOf,
|
|
26
|
+
foldItem,
|
|
27
|
+
heldRect,
|
|
28
|
+
homeFor,
|
|
29
|
+
isOutsideSideBar,
|
|
30
|
+
isSideBar,
|
|
31
|
+
isSideColumn,
|
|
32
|
+
keepItem,
|
|
33
|
+
lanes,
|
|
34
|
+
liftItem,
|
|
35
|
+
markUsed,
|
|
36
|
+
mergeSideColumns,
|
|
37
|
+
moveTo,
|
|
38
|
+
namesZone,
|
|
39
|
+
openItem,
|
|
40
|
+
orientFloat,
|
|
41
|
+
parseTargetId,
|
|
42
|
+
placeTargetId,
|
|
43
|
+
railModeOf,
|
|
44
|
+
raiseFloat,
|
|
45
|
+
readDockState,
|
|
46
|
+
refusalTargets,
|
|
47
|
+
refusals,
|
|
48
|
+
reservedRect,
|
|
49
|
+
resizeEdge,
|
|
50
|
+
resizeFloat,
|
|
51
|
+
setRailMode,
|
|
52
|
+
setSide,
|
|
53
|
+
solve,
|
|
54
|
+
stops,
|
|
55
|
+
storeDockState,
|
|
56
|
+
targetId,
|
|
57
|
+
targets,
|
|
58
|
+
virtualEdgeId,
|
|
59
|
+
zoneIn,
|
|
60
|
+
zoneTakes,
|
|
61
|
+
zonesTaking
|
|
62
|
+
} from "./chunk-KGNFLHSC.js";
|
|
63
|
+
export {
|
|
64
|
+
DEFAULT_FLOAT_SIZE,
|
|
65
|
+
DEFAULT_HIT_BAND,
|
|
66
|
+
DEFAULT_RAIL_MAGNET,
|
|
67
|
+
DEFAULT_STRIP,
|
|
68
|
+
EDGE_ROOM_HOLD,
|
|
69
|
+
FLOAT_ANCHORS,
|
|
70
|
+
HATCH_EDGE,
|
|
71
|
+
HATCH_END,
|
|
72
|
+
RAIL_MODES,
|
|
73
|
+
RAIL_STRIP_MIN,
|
|
74
|
+
RAIL_VISIBILITIES,
|
|
75
|
+
SIDES,
|
|
76
|
+
SPOT_PITCH,
|
|
77
|
+
ZONES,
|
|
78
|
+
anchorName,
|
|
79
|
+
canFold,
|
|
80
|
+
closeItem,
|
|
81
|
+
declaresFloatSizes,
|
|
82
|
+
dockHome,
|
|
83
|
+
edgeTakes,
|
|
84
|
+
fitResize,
|
|
85
|
+
floatAt,
|
|
86
|
+
floatOrientOf,
|
|
87
|
+
floatSizeOf,
|
|
88
|
+
foldItem,
|
|
89
|
+
heldRect,
|
|
90
|
+
homeFor,
|
|
91
|
+
isOutsideSideBar,
|
|
92
|
+
isSideBar,
|
|
93
|
+
isSideColumn,
|
|
94
|
+
keepItem,
|
|
95
|
+
lanes,
|
|
96
|
+
liftItem,
|
|
97
|
+
markUsed,
|
|
98
|
+
mergeSideColumns,
|
|
99
|
+
moveTo,
|
|
100
|
+
namesZone,
|
|
101
|
+
openItem,
|
|
102
|
+
orientFloat,
|
|
103
|
+
parseTargetId,
|
|
104
|
+
placeTargetId,
|
|
105
|
+
railModeOf,
|
|
106
|
+
raiseFloat,
|
|
107
|
+
readDockState,
|
|
108
|
+
refusalTargets,
|
|
109
|
+
refusals,
|
|
110
|
+
reservedRect,
|
|
111
|
+
resizeEdge,
|
|
112
|
+
resizeFloat,
|
|
113
|
+
setRailMode,
|
|
114
|
+
setSide,
|
|
115
|
+
solve,
|
|
116
|
+
stops,
|
|
117
|
+
storeDockState,
|
|
118
|
+
targetId,
|
|
119
|
+
targets,
|
|
120
|
+
virtualEdgeId,
|
|
121
|
+
zoneIn,
|
|
122
|
+
zoneTakes,
|
|
123
|
+
zonesTaking
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|