@n-uf/placement 26.11.18 → 26.11.20
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 +66 -0
- package/README.md +74 -2
- package/dist/{chunk-HQE2DOWA.js → chunk-GCSVZGVX.js} +183 -49
- package/dist/chunk-GCSVZGVX.js.map +1 -0
- package/dist/{model-irGEua8T.d.ts → model-DU7MovDa.d.ts} +1 -1
- package/dist/scene-cases.d.ts +35 -3
- package/dist/scene-cases.js +89 -40
- package/dist/scene-cases.js.map +1 -1
- package/dist/scene.d.ts +3 -3
- package/dist/scene.js +3 -1
- package/dist/stack.d.ts +2 -2
- package/dist/{targets-CZOYu8mG.d.ts → targets-CYJN0Hba.d.ts} +62 -7
- package/package.json +1 -1
- package/dist/chunk-HQE2DOWA.js.map +0 -1
package/dist/scene.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { S as Scene, g as SolveOptions,
|
|
2
|
-
export { C as ColumnPlace, h as ColumnTemplate, D as DEFAULT_FLOAT_SIZE, i as DEFAULT_HIT_BAND, j as DEFAULT_STRIP, k as DockPlace, E as Edge, F as FloatAnchor, l as FloatPlace, K as Kind, O as Orient, P as Place, R as RailPlace, m as RailSpec, n as SIDES, o as SceneAfter, p as SceneEdgeLayout, q as SceneFloat, r as SceneItem, s as SceneItemLayout, t as SceneNote,
|
|
1
|
+
import { S as Scene, g as SolveOptions, b as SceneLayout } from './targets-CYJN0Hba.js';
|
|
2
|
+
export { C as ColumnPlace, h as ColumnTemplate, D as DEFAULT_FLOAT_SIZE, i as DEFAULT_HIT_BAND, j as DEFAULT_STRIP, k as DockPlace, E as Edge, F as FloatAnchor, l as FloatPlace, K as Kind, O as Orient, P as Place, R as RailPlace, m as RailSpec, n as SIDES, o as SceneAfter, p as SceneEdgeLayout, q as SceneFloat, r as SceneItem, s as SceneItemLayout, t as SceneNote, e as SceneNoteCode, a as ScenePlace, u as SceneRailLayout, v as SceneRead, f as SceneTarget, w as SceneTargetOptions, d as Side, c as StoredScene, x as StoredSceneEdge, y as StoredSceneFloat, z as StoredSceneItem, A as ZONES, Z as Zone, B as ZoneAccepts, G as close, H as dockHome, I as floatAt, J as fold, L as homeFor, M as keep, N as lift, Q as moveTo, T as open, U as orient, V as raise, W as readScene, X as reservedRect, Y as resize, _ as setSide, $ as stops, a0 as storeScene, a1 as targets, a2 as use, a3 as zoneTakes, a4 as zonesTaking } from './targets-CYJN0Hba.js';
|
|
3
3
|
import './geometry-mL-GTRti.js';
|
|
4
4
|
import './target-D3PiLg44.js';
|
|
5
|
-
import './model-
|
|
5
|
+
import './model-DU7MovDa.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* `solve(scene, { previous })`: the whole window's layout from one scene.
|
package/dist/scene.js
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
readScene,
|
|
19
19
|
reservedRect,
|
|
20
20
|
resize,
|
|
21
|
+
setSide,
|
|
21
22
|
solve,
|
|
22
23
|
stops,
|
|
23
24
|
storeScene,
|
|
@@ -25,7 +26,7 @@ import {
|
|
|
25
26
|
use,
|
|
26
27
|
zoneTakes,
|
|
27
28
|
zonesTaking
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-GCSVZGVX.js";
|
|
29
30
|
import "./chunk-RUITEOZ7.js";
|
|
30
31
|
import "./chunk-QMTNB2C3.js";
|
|
31
32
|
export {
|
|
@@ -48,6 +49,7 @@ export {
|
|
|
48
49
|
readScene,
|
|
49
50
|
reservedRect,
|
|
50
51
|
resize,
|
|
52
|
+
setSide,
|
|
51
53
|
solve,
|
|
52
54
|
stops,
|
|
53
55
|
storeScene,
|
package/dist/stack.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as StackInput, F as FitOptions,
|
|
2
|
-
export { C as CrossLimits, D as DEFAULT_MENU, f as DEFAULT_RAIL, G as GroupFormKind, M as MainSize, P as PanelFormKind, g as PlacedStackItem, h as StackAxis, a as StackForm, S as StackFormKind, i as StackMenu,
|
|
1
|
+
import { d as StackInput, F as FitOptions, b as StackFit, e as StackItem } from './model-DU7MovDa.js';
|
|
2
|
+
export { C as CrossLimits, D as DEFAULT_MENU, f as DEFAULT_RAIL, G as GroupFormKind, M as MainSize, P as PanelFormKind, g as PlacedStackItem, h as StackAxis, a as StackForm, S as StackFormKind, i as StackMenu, c as StackNote, j as StackNoteCode, W as WrapSpec, k as formCrossMin, l as formFitsCross, m as formMain, n as formSetsCross, w as withItem, o as wrapCross, p as wrapLines, q as wrapRows } from './model-DU7MovDa.js';
|
|
3
3
|
import { R as Rect, P as Point, S as Size } from './geometry-mL-GTRti.js';
|
|
4
4
|
import { T as Target } from './target-D3PiLg44.js';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { R as Rect, S as Size, P as Point } from './geometry-mL-GTRti.js';
|
|
2
2
|
import { T as Target } from './target-D3PiLg44.js';
|
|
3
|
-
import { C as CrossLimits, a as StackForm,
|
|
3
|
+
import { C as CrossLimits, a as StackForm, S as StackFormKind, b as StackFit, c as StackNote } from './model-DU7MovDa.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The scene's shapes: one model of a whole window. A scene is a stage (the window's inner rect), the edges along its
|
|
@@ -54,6 +54,13 @@ interface SceneItem {
|
|
|
54
54
|
readonly align?: Zone;
|
|
55
55
|
/** Its size as a float: `floatAt` with no rect uses it, and a float drop sets it. */
|
|
56
56
|
readonly floatSize?: Size;
|
|
57
|
+
/**
|
|
58
|
+
* The least a float of it is shrunk to: a float larger than the region floats lie in is laid out at
|
|
59
|
+
* `max(floatMin, min(its size, the region))` each way. A floor wider than the region keeps it at the region's left
|
|
60
|
+
* edge; one taller than the stage keeps it at the stage's top and runs past its bottom. A folded float (its header
|
|
61
|
+
* form) keeps its height. Without it, a shrink stops at the form's own minimums.
|
|
62
|
+
*/
|
|
63
|
+
readonly floatMin?: Size;
|
|
57
64
|
}
|
|
58
65
|
interface Edge {
|
|
59
66
|
readonly id: string;
|
|
@@ -119,6 +126,16 @@ interface Edge {
|
|
|
119
126
|
* `cross`, `gap`, `pad` and `menu` come from `Scene.columns[side]` when the changes make it.
|
|
120
127
|
*/
|
|
121
128
|
readonly column?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* An anchor edge (a left or right edge that takes nothing, holding a fixed item such as a thumbnail strip) lies outside
|
|
131
|
+
* `Scene.inset` and the gutter: at the window's side, the inset after it, toward the content.
|
|
132
|
+
*/
|
|
133
|
+
readonly outsideInset?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* A static left or right edge that gives way like a dynamic column: it shrinks toward its minimum, then folds whole
|
|
136
|
+
* into its side's rail, in give-way order with the columns (its items' ages). It is never deleted.
|
|
137
|
+
*/
|
|
138
|
+
readonly giveWay?: boolean;
|
|
122
139
|
}
|
|
123
140
|
/** What a side's new columns are made from. */
|
|
124
141
|
interface ColumnTemplate {
|
|
@@ -190,17 +207,27 @@ interface Scene {
|
|
|
190
207
|
readonly height: number;
|
|
191
208
|
};
|
|
192
209
|
/**
|
|
193
|
-
* How a
|
|
194
|
-
* as a title bar over the first open column of its side, at that column's width,
|
|
210
|
+
* How a column folded by hand shows (default `"bar"`): `"bar"` sends it to its side's rail; `"ride"` draws each of its
|
|
211
|
+
* members as a title bar over the first open column of its side (stacked, in zone order), at that column's width,
|
|
212
|
+
* taking no width of their own.
|
|
195
213
|
*/
|
|
196
214
|
readonly handFold?: "bar" | "ride";
|
|
197
|
-
/**
|
|
215
|
+
/**
|
|
216
|
+
* Space kept clear inside the stage's edges, px (default 0 each). Floats are clamped into the stage less its left and
|
|
217
|
+
* right (the stage's full height), and shrunk to fit that region when larger.
|
|
218
|
+
*/
|
|
198
219
|
readonly inset?: {
|
|
199
220
|
readonly top?: number;
|
|
200
221
|
readonly right?: number;
|
|
201
222
|
readonly bottom?: number;
|
|
202
223
|
readonly left?: number;
|
|
203
224
|
};
|
|
225
|
+
/**
|
|
226
|
+
* When `inset` applies (default `"always"`): `"docked"` keeps it only while something is docked beside the content (an
|
|
227
|
+
* open column or a rail: a left or right edge that takes something, with an item that isn't closed; an anchor alone
|
|
228
|
+
* doesn't count); with nothing there, the content is the whole stage.
|
|
229
|
+
*/
|
|
230
|
+
readonly insetWhen?: "always" | "docked";
|
|
204
231
|
/** Space after each left or right edge and each rail that takes room, toward the content, px (default 0). */
|
|
205
232
|
readonly gutter?: number;
|
|
206
233
|
}
|
|
@@ -280,6 +307,8 @@ interface SceneRailLayout {
|
|
|
280
307
|
* - `float-covers`: no clear place exists, and it covers the least it can.
|
|
281
308
|
* - `column-shrunk`, `column-folded`, `kept-folded`: give-way by `contentMin.width`, in give-way order;
|
|
282
309
|
* - `content-narrow`, `content-short`: the content is still under `contentMin` (overlay bars count against the height).
|
|
310
|
+
* - `no-column-room`: not even one column at its minimum fits beside `contentMin.width` (`layout.columnRoom` false):
|
|
311
|
+
* `width` is the room the stage leaves, `need` the content's minimum plus that column and its gutter.
|
|
283
312
|
* - `content-changed`: under `previous`, `content` is not the rect `previous.content` was (`from`, `to`). A host refits
|
|
284
313
|
* its zoom only on this note.
|
|
285
314
|
* - `no-vertical-form`: an item left out of a vertical place (a rail, a vertical float) because only `wrap` forms are
|
|
@@ -304,6 +333,10 @@ type SceneNote = ({
|
|
|
304
333
|
} | {
|
|
305
334
|
readonly code: "column-folded" | "kept-folded";
|
|
306
335
|
readonly edge: string;
|
|
336
|
+
} | {
|
|
337
|
+
readonly code: "no-column-room";
|
|
338
|
+
readonly width: number;
|
|
339
|
+
readonly need: number;
|
|
307
340
|
} | {
|
|
308
341
|
readonly code: "content-narrow";
|
|
309
342
|
readonly width: number;
|
|
@@ -336,6 +369,12 @@ interface SceneLayout {
|
|
|
336
369
|
readonly floats: readonly string[];
|
|
337
370
|
/** The rails shown (a side with a folded column). */
|
|
338
371
|
readonly rails: Readonly<Partial<Record<"left" | "right", SceneRailLayout>>>;
|
|
372
|
+
/**
|
|
373
|
+
* With `contentMin` and a dynamic column (or, before any exists, a `columns` template): whether one column at its
|
|
374
|
+
* minimum fits beside the content's minimum (`false` with a `no-column-room` note). Anchors and rails don't count:
|
|
375
|
+
* every column can fold into its rail. A host shows its narrow fallback (one panel over the content) while it is `false`.
|
|
376
|
+
*/
|
|
377
|
+
readonly columnRoom?: boolean;
|
|
339
378
|
readonly notes: readonly SceneNote[];
|
|
340
379
|
}
|
|
341
380
|
interface SolveOptions {
|
|
@@ -416,10 +455,18 @@ declare function close(scene: Scene, id: string): Scene;
|
|
|
416
455
|
declare function raise(scene: Scene, id: string): Scene;
|
|
417
456
|
declare function orient(scene: Scene, id: string, to: Orient): Scene;
|
|
418
457
|
declare function resize(scene: Scene, edgeId: string, size: number): Scene;
|
|
458
|
+
/**
|
|
459
|
+
* The edge moved to the other side of its axis (left ⇄ right, top ⇄ bottom), as its side's outermost edge: ring 0, before
|
|
460
|
+
* that side's other edges (whose rings close up behind it; the side it left closes up too). Its items, size and options
|
|
461
|
+
* go with it. Unchanged for an unknown edge, the side it is on, or a side across its axis. Like every change it does not
|
|
462
|
+
* tick the use clock: a host that moves an edge by hand calls `use()` on its items afterwards, as a drop does.
|
|
463
|
+
*/
|
|
464
|
+
declare function setSide(scene: Scene, edgeId: string, side: Side): Scene;
|
|
419
465
|
/**
|
|
420
466
|
* The place `start` (a scene as it began: the host's start or reset scene) gives an item, for Dock, Put back and Reset
|
|
421
467
|
* position: its zone and place in the same edge (before the first item that followed it there and is still there), a
|
|
422
|
-
* new column at its ring when its column is gone
|
|
468
|
+
* new column at its ring when its column is gone (a column under the same id that holds none of the start column's
|
|
469
|
+
* items is another column), or its float rect (and anchor). Null when `start` places it nowhere
|
|
423
470
|
* or in an edge `scene` no longer has that isn't a column. `moveTo(scene, id, place)` puts it there.
|
|
424
471
|
*/
|
|
425
472
|
declare function homeFor(scene: Scene, id: string, start: Scene): Place | null;
|
|
@@ -444,7 +491,8 @@ declare function dockHome(scene: Scene, id: string, start: Scene): Scene;
|
|
|
444
491
|
* ```
|
|
445
492
|
*
|
|
446
493
|
* Nothing about kinds, forms or limits is stored: those are the host's (`base`). An edge is matched by its id: its
|
|
447
|
-
* side, ring and limits come from `base`, its order of items and its `size` from the store
|
|
494
|
+
* side, ring and limits come from `base`, its order of items and its `size` from the store; a static edge stored on
|
|
495
|
+
* the other side of its axis is moved there (`setSide`, as its side's outermost edge). Dynamic columns
|
|
448
496
|
* (`column: true`) are the store's: one `base` lacks is made from `base.columns[side]`, its ring is the stored one, and
|
|
449
497
|
* columns left empty are deleted, the rings closed up. No float has a pinned field: one an old store has is listed and
|
|
450
498
|
* ignored.
|
|
@@ -519,6 +567,13 @@ declare function readScene(data: unknown, base: Scene): SceneRead;
|
|
|
519
567
|
* beside it at its side. It is cut clear of every fixed item that doesn't grow and of the chrome rects (a gap whose
|
|
520
568
|
* line lies inside one has no target); a growing fixed item (a title) is not cut out, so a pointer over it picks the
|
|
521
569
|
* nearest gap. `marker` is the insertion line after the drop, across the edge; `slot` the item's rect after the drop.
|
|
570
|
+
* A horizontal bar (top or bottom, not compact) has a hit per zone by thirds: its left third is the leading (start)
|
|
571
|
+
* zone's, the middle the center zone's, the right the trailing (end) zone's, each split among its own gaps (their
|
|
572
|
+
* lines taken inside the third). A title bar (a bar with a fixed item that grows) is a constrained host: a gap there
|
|
573
|
+
* is a target only when the item lands in its first form, nothing in the bar changes form for it, and the title keeps
|
|
574
|
+
* its natural width.
|
|
575
|
+
* - `strip:<bar>:<zone>` (2): an empty horizontal bar that accepts the kind: its strip along the content in thirds, one
|
|
576
|
+
* target per zone that takes the kind.
|
|
522
577
|
* - `strip:<edge>` (2): an empty edge that accepts the kind (its start zone takes it): a strip `Edge.strip` px (default
|
|
523
578
|
* 24) deep along its side, inside the content and clear of overlay edges, so never over a docked edge or a panel's
|
|
524
579
|
* body (a compact rail's strip alone stays at the window edge, its own place); a gap hit that spans it trims its ends,
|
|
@@ -592,4 +647,4 @@ declare function reservedRect(scene: Scene, l: SceneLayout, id: string): Rect;
|
|
|
592
647
|
*/
|
|
593
648
|
declare function stops(scene: Scene, dragged: string, options?: SceneTargetOptions): SceneTarget[];
|
|
594
649
|
|
|
595
|
-
export {
|
|
650
|
+
export { stops as $, ZONES as A, type ZoneAccepts as B, type ColumnPlace as C, DEFAULT_FLOAT_SIZE as D, type Edge as E, type FloatAnchor as F, close as G, dockHome as H, floatAt as I, fold as J, type Kind as K, homeFor as L, keep as M, lift as N, type Orient as O, type Place as P, moveTo as Q, type RailPlace as R, type Scene as S, open as T, orient as U, raise as V, readScene as W, reservedRect as X, resize as Y, type Zone as Z, setSide as _, type ScenePlace as a, storeScene as a0, targets as a1, use as a2, zoneTakes as a3, zonesTaking as a4, type SceneLayout as b, type StoredScene as c, type Side as d, type SceneNoteCode as e, type SceneTarget as f, type SolveOptions as g, type ColumnTemplate as h, DEFAULT_HIT_BAND as i, DEFAULT_STRIP as j, type DockPlace as k, type FloatPlace as l, type RailSpec as m, SIDES as n, type SceneAfter as o, type SceneEdgeLayout as p, type SceneFloat as q, type SceneItem as r, type SceneItemLayout as s, type SceneNote as t, type SceneRailLayout as u, type SceneRead as v, type SceneTargetOptions as w, type StoredSceneEdge as x, type StoredSceneFloat as y, type StoredSceneItem as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n-uf/placement",
|
|
3
|
-
"version": "26.11.
|
|
3
|
+
"version": "26.11.20",
|
|
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",
|