@n-uf/placement 26.11.19 → 26.11.21
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 +56 -0
- package/README.md +69 -15
- package/dist/{chunk-RUITEOZ7.js → chunk-RL3QB5SM.js} +61 -7
- package/dist/chunk-RL3QB5SM.js.map +1 -0
- package/dist/{chunk-NCHRKLT3.js → chunk-TFM4S3L3.js} +127 -18
- package/dist/chunk-TFM4S3L3.js.map +1 -0
- package/dist/{model-irGEua8T.d.ts → model-DPTu2EtG.d.ts} +24 -10
- package/dist/scene-cases.d.ts +35 -3
- package/dist/scene-cases.js +75 -36
- package/dist/scene-cases.js.map +1 -1
- package/dist/scene.d.ts +3 -3
- package/dist/scene.js +4 -2
- package/dist/stack.d.ts +9 -8
- package/dist/stack.js +1 -1
- package/dist/{targets-50bCVu3K.d.ts → targets-DRFuud5d.d.ts} +40 -5
- package/package.json +1 -1
- package/dist/chunk-NCHRKLT3.js.map +0 -1
- package/dist/chunk-RUITEOZ7.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-DRFuud5d.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, w as SceneRefusal, f as SceneTarget, x as SceneTargetOptions, d as Side, c as StoredScene, y as StoredSceneEdge, z as StoredSceneFloat, A as StoredSceneItem, B as ZONES, Z as Zone, G as ZoneAccepts, H as close, I as dockHome, J as floatAt, L as fold, M as homeFor, N as keep, Q as lift, T as moveTo, U as open, V as orient, W as raise, X as readScene, Y as refusals, _ as reservedRect, $ as resize, a0 as setSide, a1 as stops, a2 as storeScene, a3 as targets, a4 as use, a5 as zoneTakes, a6 as zonesTaking } from './targets-DRFuud5d.js';
|
|
3
3
|
import './geometry-mL-GTRti.js';
|
|
4
4
|
import './target-D3PiLg44.js';
|
|
5
|
-
import './model-
|
|
5
|
+
import './model-DPTu2EtG.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* `solve(scene, { previous })`: the whole window's layout from one scene.
|
package/dist/scene.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
orient,
|
|
17
17
|
raise,
|
|
18
18
|
readScene,
|
|
19
|
+
refusals,
|
|
19
20
|
reservedRect,
|
|
20
21
|
resize,
|
|
21
22
|
setSide,
|
|
@@ -26,8 +27,8 @@ import {
|
|
|
26
27
|
use,
|
|
27
28
|
zoneTakes,
|
|
28
29
|
zonesTaking
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-TFM4S3L3.js";
|
|
31
|
+
import "./chunk-RL3QB5SM.js";
|
|
31
32
|
import "./chunk-QMTNB2C3.js";
|
|
32
33
|
export {
|
|
33
34
|
DEFAULT_FLOAT_SIZE,
|
|
@@ -47,6 +48,7 @@ export {
|
|
|
47
48
|
orient,
|
|
48
49
|
raise,
|
|
49
50
|
readScene,
|
|
51
|
+
refusals,
|
|
50
52
|
reservedRect,
|
|
51
53
|
resize,
|
|
52
54
|
setSide,
|
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-DPTu2EtG.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, k as StackStep, W as WrapSpec, l as formCrossMin, m as formFitsCross, n as formMain, o as formSetsCross, w as withItem, p as wrapCross, q as wrapLines, r as wrapRows } from './model-DPTu2EtG.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
|
|
|
@@ -10,12 +10,13 @@ import { T as Target } from './target-D3PiLg44.js';
|
|
|
10
10
|
* was added or opened. Room that came back is used, but growing never re-ranks. When the stack got wider across (a wider
|
|
11
11
|
* limit lets a panel open wider, and the forms that stepped down for the old width may come back) the fresh fit is
|
|
12
12
|
* taken. When the forms kept leave more spare length than they did (the length grew, a gap or a size shrank; `need` is
|
|
13
|
-
* what each fit says its forms need)
|
|
14
|
-
*
|
|
15
|
-
* that
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
13
|
+
* what each fit says its forms need) room comes back by undoing the give-way history (`steps`, carried on from fit to
|
|
14
|
+
* fit) from its last step, a batch into the » menu together, an item to the nearest earlier form that fits; the first
|
|
15
|
+
* step that can't be undone stops all growth. So growing back is exactly the reverse of giving way: at every length the
|
|
16
|
+
* way back holds what the way down held. A `previous` without a history (built by hand, or by an older version) grows
|
|
17
|
+
* the old way: a fresh fit that is a pure gain over the kept one, else the item that gave way most recently by its
|
|
18
|
+
* rank, `kept` and age first, one at a time, menu items out only when that keeps the order. A `previous` with no `need`
|
|
19
|
+
* (one an app built by hand) is no help and the fresh fit is returned.
|
|
19
20
|
*/
|
|
20
21
|
declare function fitStack(input: StackInput, options?: FitOptions): StackFit;
|
|
21
22
|
|
package/dist/stack.js
CHANGED
|
@@ -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-DPTu2EtG.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
|
|
@@ -52,6 +52,14 @@ interface SceneItem {
|
|
|
52
52
|
readonly closed?: boolean;
|
|
53
53
|
/** Its zone in its edge (default start). */
|
|
54
54
|
readonly align?: Zone;
|
|
55
|
+
/**
|
|
56
|
+
* Its give-way priority in its edge (default: the edge's `priority`, else 0). When an edge runs short, items step down
|
|
57
|
+
* their forms (row, wrap in a column, icons, then the edge's » menu) lowest priority first, ties to the one used longest
|
|
58
|
+
* ago; room coming back brings them up in the exact reverse order, each to its remembered form. It adds to every one
|
|
59
|
+
* of its forms' `rank` (`./stack`), so a host may still rank single forms. Give the controls that must stay out of the
|
|
60
|
+
* menu the highest priority.
|
|
61
|
+
*/
|
|
62
|
+
readonly priority?: number;
|
|
55
63
|
/** Its size as a float: `floatAt` with no rect uses it, and a float drop sets it. */
|
|
56
64
|
readonly floatSize?: Size;
|
|
57
65
|
/**
|
|
@@ -136,6 +144,11 @@ interface Edge {
|
|
|
136
144
|
* into its side's rail, in give-way order with the columns (its items' ages). It is never deleted.
|
|
137
145
|
*/
|
|
138
146
|
readonly giveWay?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* The default give-way priority of its items (`SceneItem.priority` wins; default 0): a title bar given a lower one has
|
|
149
|
+
* its toolbars step down before an item moved in from another bar would.
|
|
150
|
+
*/
|
|
151
|
+
readonly priority?: number;
|
|
139
152
|
}
|
|
140
153
|
/** What a side's new columns are made from. */
|
|
141
154
|
interface ColumnTemplate {
|
|
@@ -370,8 +383,9 @@ interface SceneLayout {
|
|
|
370
383
|
/** The rails shown (a side with a folded column). */
|
|
371
384
|
readonly rails: Readonly<Partial<Record<"left" | "right", SceneRailLayout>>>;
|
|
372
385
|
/**
|
|
373
|
-
* With `contentMin` and dynamic columns: whether one column at its
|
|
374
|
-
* with a `no-column-room` note).
|
|
386
|
+
* With `contentMin` and a dynamic column (or, before any exists, a `columns` template): whether one column at its
|
|
387
|
+
* minimum fits beside the content's minimum (`false` with a `no-column-room` note). Anchors and rails don't count:
|
|
388
|
+
* every column can fold into its rail. A host shows its narrow fallback (one panel over the content) while it is `false`.
|
|
375
389
|
*/
|
|
376
390
|
readonly columnRoom?: boolean;
|
|
377
391
|
readonly notes: readonly SceneNote[];
|
|
@@ -457,7 +471,8 @@ declare function resize(scene: Scene, edgeId: string, size: number): Scene;
|
|
|
457
471
|
/**
|
|
458
472
|
* The edge moved to the other side of its axis (left ⇄ right, top ⇄ bottom), as its side's outermost edge: ring 0, before
|
|
459
473
|
* that side's other edges (whose rings close up behind it; the side it left closes up too). Its items, size and options
|
|
460
|
-
* go with it. Unchanged for an unknown edge, the side it is on, or a side across its axis.
|
|
474
|
+
* 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
|
|
475
|
+
* tick the use clock: a host that moves an edge by hand calls `use()` on its items afterwards, as a drop does.
|
|
461
476
|
*/
|
|
462
477
|
declare function setSide(scene: Scene, edgeId: string, side: Side): Scene;
|
|
463
478
|
/**
|
|
@@ -638,6 +653,26 @@ declare function targets(scene: Scene, dragged: string, options?: SceneTargetOpt
|
|
|
638
653
|
* host that draws "no drop" areas reads them from here.
|
|
639
654
|
*/
|
|
640
655
|
declare function reservedRect(scene: Scene, l: SceneLayout, id: string): Rect;
|
|
656
|
+
/** Where a drop of the dragged item is refused: a host shows "no room here" at the pointer, with no slot anywhere. */
|
|
657
|
+
interface SceneRefusal {
|
|
658
|
+
/** `refuse:<edge>:<zone>`. */
|
|
659
|
+
readonly id: string;
|
|
660
|
+
readonly edge: string;
|
|
661
|
+
readonly zone: Zone;
|
|
662
|
+
/** Where the pointer means it; never over a target's hit. */
|
|
663
|
+
readonly hit: Rect;
|
|
664
|
+
/** `no-room`: the zone takes the kind, but no gap of it fits (a title bar at the title's natural width, say). `not-accepted`: the edge or zone doesn't take the kind. */
|
|
665
|
+
readonly reason: "no-room" | "not-accepted";
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* `refusals(scene, dragged, options?)`: the places a drop of `dragged` is refused, so a host can say so at the pointer
|
|
669
|
+
* (a tint and "No room here") instead of showing a slot elsewhere. A bar's zone (its third, as `targets` picks zones)
|
|
670
|
+
* that has no target is refused: `no-room` when the zone takes the kind, `not-accepted` when it or the bar doesn't; a
|
|
671
|
+
* left or right edge that doesn't take the kind is refused as a whole (zone `start`). Each hit is cut clear of every
|
|
672
|
+
* target's hit (the float target aside), so a pointer over one has no target there but the float. A release over a
|
|
673
|
+
* refusal commits nothing: the item goes home.
|
|
674
|
+
*/
|
|
675
|
+
declare function refusals(scene: Scene, dragged: string, options?: SceneTargetOptions): SceneRefusal[];
|
|
641
676
|
/**
|
|
642
677
|
* `stops(scene, id, options?)`: the places for "Move to ›" and the arrow keys, in reading order, from the same targets
|
|
643
678
|
* (`home` and `none` left out): the left side outer to inner, the top bars, the bottom bars, the right side inner to
|
|
@@ -645,4 +680,4 @@ declare function reservedRect(scene: Scene, l: SceneLayout, id: string): Rect;
|
|
|
645
680
|
*/
|
|
646
681
|
declare function stops(scene: Scene, dragged: string, options?: SceneTargetOptions): SceneTarget[];
|
|
647
682
|
|
|
648
|
-
export {
|
|
683
|
+
export { resize as $, type StoredSceneItem as A, ZONES as B, type ColumnPlace as C, DEFAULT_FLOAT_SIZE as D, type Edge as E, type FloatAnchor as F, type ZoneAccepts as G, close as H, dockHome as I, floatAt as J, type Kind as K, fold as L, homeFor as M, keep as N, type Orient as O, type Place as P, lift as Q, type RailPlace as R, type Scene as S, moveTo as T, open as U, orient as V, raise as W, readScene as X, refusals as Y, type Zone as Z, reservedRect as _, type ScenePlace as a, setSide as a0, stops as a1, storeScene as a2, targets as a3, use as a4, zoneTakes as a5, zonesTaking as a6, 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 SceneRefusal as w, type SceneTargetOptions as x, type StoredSceneEdge as y, type StoredSceneFloat 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.21",
|
|
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",
|