@n-uf/placement 26.11.21 → 26.11.22
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 +48 -0
- package/README.md +31 -8
- package/dist/{chunk-TFM4S3L3.js → chunk-4DEXHBXT.js} +104 -36
- package/dist/chunk-4DEXHBXT.js.map +1 -0
- package/dist/scene-cases.d.ts +1 -1
- package/dist/scene-cases.js +1 -1
- package/dist/scene.d.ts +2 -2
- package/dist/scene.js +7 -1
- package/dist/{targets-DRFuud5d.d.ts → targets-DgmHP5PY.d.ts} +48 -12
- package/package.json +1 -1
- package/dist/chunk-TFM4S3L3.js.map +0 -1
package/dist/scene-cases.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as Point, R as Rect } from './geometry-mL-GTRti.js';
|
|
2
2
|
import { S as StackFormKind } from './model-DPTu2EtG.js';
|
|
3
|
-
import { S as Scene, a as ScenePlace, b as SceneLayout, c as StoredScene, Z as Zone, d as Side, e as SceneNoteCode, f as SceneTarget } from './targets-
|
|
3
|
+
import { S as Scene, a as ScenePlace, b as SceneLayout, c as StoredScene, Z as Zone, d as Side, e as SceneNoteCode, f as SceneTarget } from './targets-DgmHP5PY.js';
|
|
4
4
|
import './target-D3PiLg44.js';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/scene-cases.js
CHANGED
package/dist/scene.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Scene, g as SolveOptions, b as SceneLayout } from './targets-
|
|
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
|
|
1
|
+
import { S as Scene, g as SolveOptions, b as SceneLayout } from './targets-DgmHP5PY.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 floatOrientOf, M as floatSizeOf, N as fold, Q as homeFor, T as isOutsideSideBar, U as keep, V as lift, W as moveTo, X as open, Y as orient, _ as raise, $ as readScene, a0 as refusals, a1 as reservedRect, a2 as resize, a3 as setSide, a4 as stops, a5 as storeScene, a6 as targets, a7 as use, a8 as zoneTakes, a9 as zonesTaking } from './targets-DgmHP5PY.js';
|
|
3
3
|
import './geometry-mL-GTRti.js';
|
|
4
4
|
import './target-D3PiLg44.js';
|
|
5
5
|
import './model-DPTu2EtG.js';
|
package/dist/scene.js
CHANGED
|
@@ -7,8 +7,11 @@ import {
|
|
|
7
7
|
close,
|
|
8
8
|
dockHome,
|
|
9
9
|
floatAt,
|
|
10
|
+
floatOrientOf,
|
|
11
|
+
floatSizeOf,
|
|
10
12
|
fold,
|
|
11
13
|
homeFor,
|
|
14
|
+
isOutsideSideBar,
|
|
12
15
|
keep,
|
|
13
16
|
lift,
|
|
14
17
|
moveTo,
|
|
@@ -27,7 +30,7 @@ import {
|
|
|
27
30
|
use,
|
|
28
31
|
zoneTakes,
|
|
29
32
|
zonesTaking
|
|
30
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-4DEXHBXT.js";
|
|
31
34
|
import "./chunk-RL3QB5SM.js";
|
|
32
35
|
import "./chunk-QMTNB2C3.js";
|
|
33
36
|
export {
|
|
@@ -39,8 +42,11 @@ export {
|
|
|
39
42
|
close,
|
|
40
43
|
dockHome,
|
|
41
44
|
floatAt,
|
|
45
|
+
floatOrientOf,
|
|
46
|
+
floatSizeOf,
|
|
42
47
|
fold,
|
|
43
48
|
homeFor,
|
|
49
|
+
isOutsideSideBar,
|
|
44
50
|
keep,
|
|
45
51
|
lift,
|
|
46
52
|
moveTo,
|
|
@@ -60,8 +60,16 @@ interface SceneItem {
|
|
|
60
60
|
* menu the highest priority.
|
|
61
61
|
*/
|
|
62
62
|
readonly priority?: number;
|
|
63
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Its size as a float: `floatAt` with no rect uses it, and a float drop sets it. Without it, a float takes its first
|
|
65
|
+
* form's natural size along its orient (`floatSizeOf`), or `DEFAULT_FLOAT_SIZE` when that form grows (a panel's card).
|
|
66
|
+
*/
|
|
64
67
|
readonly floatSize?: Size;
|
|
68
|
+
/**
|
|
69
|
+
* Which of its forms it uses as a float when the float names no `orient` (`floatOrientOf`). Default: the axis of its
|
|
70
|
+
* first form, the first of `forms.row` / `forms.column` it declares (a group declared row first floats as a row).
|
|
71
|
+
*/
|
|
72
|
+
readonly floatOrient?: Orient;
|
|
65
73
|
/**
|
|
66
74
|
* The least a float of it is shrunk to: a float larger than the region floats lie in is laid out at
|
|
67
75
|
* `max(floatMin, min(its size, the region))` each way. A floor wider than the region keeps it at the region's left
|
|
@@ -136,7 +144,10 @@ interface Edge {
|
|
|
136
144
|
readonly column?: boolean;
|
|
137
145
|
/**
|
|
138
146
|
* An anchor edge (a left or right edge that takes nothing, holding a fixed item such as a thumbnail strip) lies outside
|
|
139
|
-
* `Scene.inset` and the gutter: at the window's side, the inset after it, toward the content.
|
|
147
|
+
* `Scene.inset` and the gutter: at the window's side, the inset after it, toward the content. A full top or bottom bar
|
|
148
|
+
* with it lies at the window's edge, full width, the inset after it; the side edges then run between such bars (an
|
|
149
|
+
* anchor through the inset beside them). On a left or right side, from the window's side inward: its toolbar bars
|
|
150
|
+
* with it (`isOutsideSideBar`), the side's rail, its anchors, the inset, the columns.
|
|
140
151
|
*/
|
|
141
152
|
readonly outsideInset?: boolean;
|
|
142
153
|
/**
|
|
@@ -190,7 +201,7 @@ interface SceneFloat {
|
|
|
190
201
|
readonly rect: Rect;
|
|
191
202
|
/** Follow the content's side or corner until a drop gives it a real rect. */
|
|
192
203
|
readonly anchor?: FloatAnchor;
|
|
193
|
-
/** Which of the item's forms it uses (default `
|
|
204
|
+
/** Which of the item's forms it uses (default: the item's `floatOrientOf`). */
|
|
194
205
|
readonly orient?: Orient;
|
|
195
206
|
}
|
|
196
207
|
interface Scene {
|
|
@@ -236,9 +247,10 @@ interface Scene {
|
|
|
236
247
|
readonly left?: number;
|
|
237
248
|
};
|
|
238
249
|
/**
|
|
239
|
-
* When `inset` applies (default `"always"`): `"docked"` keeps it only while
|
|
240
|
-
* open column or a rail: a left or right edge that takes something, with an item that isn't
|
|
241
|
-
*
|
|
250
|
+
* When `inset` applies (default `"always"`): `"docked"` keeps it only while a panel is docked beside the content (an
|
|
251
|
+
* open panel column or a rail showing panels: a left or right edge that takes something, with an item that isn't
|
|
252
|
+
* closed or fixed and whose first column form is `open`, `header` or `rail`). Bars, toolbar groups and an anchor
|
|
253
|
+
* never count, wherever they sit; with no panel there, the content is the whole stage.
|
|
242
254
|
*/
|
|
243
255
|
readonly insetWhen?: "always" | "docked";
|
|
244
256
|
/** Space after each left or right edge and each rail that takes room, toward the content, px (default 0). */
|
|
@@ -406,6 +418,24 @@ declare const DEFAULT_STRIP = 24;
|
|
|
406
418
|
declare const DEFAULT_HIT_BAND = 24;
|
|
407
419
|
/** A float's size when neither the item nor the call gives one, px. */
|
|
408
420
|
declare const DEFAULT_FLOAT_SIZE: Size;
|
|
421
|
+
/**
|
|
422
|
+
* A left or right toolbar bar outside the inset: told from a column edge by its kinds, it takes something and nothing
|
|
423
|
+
* the side's columns or its rail take (`Scene.columns[side].accepts`, `Scene.rails[side].accepts`); an anchor takes
|
|
424
|
+
* nothing. A side with neither a column template nor a rail has nothing to tell them apart by, so no edge there is a
|
|
425
|
+
* bar. It lies outermost on its side, before the side's rail.
|
|
426
|
+
*/
|
|
427
|
+
declare function isOutsideSideBar(scene: Scene, e: Edge): boolean;
|
|
428
|
+
/**
|
|
429
|
+
* The orient a float of `item` takes when it names none: its `floatOrient`, else the axis of its first form (the first
|
|
430
|
+
* of `forms.row` / `forms.column` it declares with any form), else column.
|
|
431
|
+
*/
|
|
432
|
+
declare const floatOrientOf: (item: SceneItem) => Orient;
|
|
433
|
+
/**
|
|
434
|
+
* A float's size when nothing gives one: the item's `floatSize`, else its first form's natural size along `orient`
|
|
435
|
+
* (default `floatOrientOf`), else `DEFAULT_FLOAT_SIZE` when that form grows (a panel's card has no natural float length)
|
|
436
|
+
* or the item has no form there.
|
|
437
|
+
*/
|
|
438
|
+
declare function floatSizeOf(item: SceneItem, orient?: Orient): Size;
|
|
409
439
|
|
|
410
440
|
/**
|
|
411
441
|
* The scene's pure changes. Each returns a new scene and leaves the one it was given as it was; a change that can't
|
|
@@ -420,7 +450,8 @@ declare const DEFAULT_FLOAT_SIZE: Size;
|
|
|
420
450
|
* and its side's rings are closed up.
|
|
421
451
|
* - `homeFor(scene, id, start)`: the place a start scene gives the item, for `moveTo`.
|
|
422
452
|
* - `floatAt(scene, id, rect?, orient?)`: floats it on top at `rect` (its size becomes `floatSize`); with no rect, at
|
|
423
|
-
* its `
|
|
453
|
+
* its `floatSizeOf` size anchored to the content's top-right corner: its `floatSize`, else its form's natural size
|
|
454
|
+
* along its orient (the float's, `orient`, else `floatOrientOf`), else the default size.
|
|
424
455
|
* - `fold(scene, id, on)`: folded by hand starts it at its second form (`from: 1`); unfolding clears `from`.
|
|
425
456
|
* - `use(scene, id)`: the newest age. Under `previous` it reshapes nothing.
|
|
426
457
|
* - `keep(scene, id, on)`, `open(scene, id)`, `close(scene, id)`.
|
|
@@ -590,16 +621,19 @@ declare function readScene(data: unknown, base: Scene): SceneRead;
|
|
|
590
621
|
* - `strip:<edge>` (2): an empty edge that accepts the kind (its start zone takes it): a strip `Edge.strip` px (default
|
|
591
622
|
* 24) deep along its side, inside the content and clear of overlay edges, so never over a docked edge or a panel's
|
|
592
623
|
* body (a compact rail's strip alone stays at the window edge, its own place); a gap hit that spans it trims its ends,
|
|
593
|
-
* and
|
|
624
|
+
* and under 1 px left it has no target. Home covers all of the dragged item's own rect: a strip (a `rail:` strip
|
|
625
|
+
* too) keeps only what lies outside it. `after` shows the edge holding the item.
|
|
594
626
|
* - `float:<id>` (3, free): when `floatKinds` lists the kind. The hit covers the whole plane; the landing is the float
|
|
595
627
|
* with the pointer holding it at `grab` (default its middle), in the stage and clear of the docked items, the bars
|
|
596
|
-
* and the chrome. Its
|
|
628
|
+
* and the chrome. Its orient: `options.floatOrient`, else its float's, else the item's (`floatOrientOf`). Its size:
|
|
629
|
+
* `options.floatSize`, else its float's size, else `floatSizeOf` (the item's `floatSize`, else its form's natural
|
|
630
|
+
* size along that orient, else the default).
|
|
597
631
|
* - `column:<side>:<ring>` (2): a new column on each column line of a side whose `scene.columns[side]` takes the kind
|
|
598
632
|
* (outside the outermost open column, between two, inside the innermost; on a side with none, at the content's
|
|
599
633
|
* edge), `COLUMN_REACH` px each way, only where the new column shows open.
|
|
600
634
|
* - `rail:<side>:<ring>` (1): docking folded into a side's rail (its rail and its template take the kind), before each
|
|
601
|
-
* folded column's segments and after the last, or a strip `RAIL_EDGE` px deep
|
|
602
|
-
* shows.
|
|
635
|
+
* folded column's segments and after the last, or a strip `RAIL_EDGE` px deep where the rail lands (flush after its
|
|
636
|
+
* outside toolbar bars, `isOutsideSideBar`, else at the window's side less the inset) when no rail shows.
|
|
603
637
|
* - `none:<i>` (1): over each `scene.blocked` rect. It takes the pointer, and a release there commits nothing.
|
|
604
638
|
* - `home:<id>` (1): over a docked item's own rect (or its » entry); a floating item has none, so a move inside its own
|
|
605
639
|
* rect is a float move. A release there commits nothing. A gap, column line or rail drop that
|
|
@@ -643,6 +677,8 @@ interface SceneTargetOptions {
|
|
|
643
677
|
readonly endReach?: number;
|
|
644
678
|
/** The float's size for the float target. */
|
|
645
679
|
readonly floatSize?: Size;
|
|
680
|
+
/** The float's orient for the float target (default: its float's, else the item's `floatOrientOf`). */
|
|
681
|
+
readonly floatOrient?: Orient;
|
|
646
682
|
/** As `solve`'s: edge or item ids solved without `previous`, in every `after` too. */
|
|
647
683
|
readonly fresh?: readonly string[];
|
|
648
684
|
}
|
|
@@ -680,4 +716,4 @@ declare function refusals(scene: Scene, dragged: string, options?: SceneTargetOp
|
|
|
680
716
|
*/
|
|
681
717
|
declare function stops(scene: Scene, dragged: string, options?: SceneTargetOptions): SceneTarget[];
|
|
682
718
|
|
|
683
|
-
export {
|
|
719
|
+
export { readScene 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, floatOrientOf as L, floatSizeOf as M, fold as N, type Orient as O, type Place as P, homeFor as Q, type RailPlace as R, type Scene as S, isOutsideSideBar as T, keep as U, lift as V, moveTo as W, open as X, orient as Y, type Zone as Z, raise as _, type ScenePlace as a, refusals as a0, reservedRect as a1, resize as a2, setSide as a3, stops as a4, storeScene as a5, targets as a6, use as a7, zoneTakes as a8, zonesTaking as a9, 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.22",
|
|
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",
|