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