@n-uf/placement 26.11.24 → 26.11.25
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 +74 -0
- package/README.md +66 -28
- package/dist/{chunk-LPMZ2FFR.js → chunk-3P6VOXA6.js} +2 -2
- package/dist/chunk-3P6VOXA6.js.map +1 -0
- package/dist/{chunk-CJA6LRHN.js → chunk-7ASCUAGV.js} +5 -7
- package/dist/chunk-7ASCUAGV.js.map +1 -0
- package/dist/{chunk-RL3QB5SM.js → chunk-KGZCYLQN.js} +10 -10
- package/dist/chunk-KGZCYLQN.js.map +1 -0
- package/dist/{chunk-2H3CSPEH.js → chunk-OYGOJWAX.js} +2 -2
- package/dist/{chunk-XUC5BU4N.js → chunk-SZKU7CRX.js} +575 -499
- package/dist/chunk-SZKU7CRX.js.map +1 -0
- package/dist/chunk-WM5FJ3IS.js +47 -0
- package/dist/chunk-WM5FJ3IS.js.map +1 -0
- package/dist/{constructions-VDK_mwmz.d.ts → constructions-DSEjvWMP.d.ts} +1 -1
- package/dist/desk.d.ts +3 -3
- package/dist/desk.js +3 -3
- package/dist/dock.d.ts +3 -3
- package/dist/dock.js +2 -2
- package/dist/geometry-CkZ6Fcfb.d.ts +48 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/{model-DPTu2EtG.d.ts → model-mm16NrSX.d.ts} +1 -1
- package/dist/panels.d.ts +5 -4
- package/dist/panels.js +6 -5
- package/dist/scene-cases.d.ts +4 -4
- package/dist/scene-cases.js +15 -16
- package/dist/scene-cases.js.map +1 -1
- package/dist/scene.d.ts +5 -39
- package/dist/scene.js +3 -3
- package/dist/stack.d.ts +4 -4
- package/dist/stack.js +2 -2
- package/dist/stack.js.map +1 -1
- package/dist/{target-D3PiLg44.d.ts → target-C-HJjPcz.d.ts} +1 -1
- package/dist/{targets-B6eLC-52.d.ts → targets-CBpO_LEy.d.ts} +4 -6
- package/dist/{targets-DwwIWPpN.d.ts → targets-CDR5Towj.d.ts} +74 -60
- package/dist/targets.d.ts +4 -4
- package/dist/targets.js +6 -7
- package/dist/targets.js.map +1 -1
- package/dist/toolbar.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-CJA6LRHN.js.map +0 -1
- package/dist/chunk-LPMZ2FFR.js.map +0 -1
- package/dist/chunk-QMTNB2C3.js +0 -17
- package/dist/chunk-QMTNB2C3.js.map +0 -1
- package/dist/chunk-RL3QB5SM.js.map +0 -1
- package/dist/chunk-XUC5BU4N.js.map +0 -1
- package/dist/geometry-mL-GTRti.d.ts +0 -28
- /package/dist/{chunk-2H3CSPEH.js.map → chunk-OYGOJWAX.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,80 @@
|
|
|
3
3
|
Versions are calendar versions, `YY.M.R` (year, month of the release, counter within the month), shared with
|
|
4
4
|
`@n-uf/motion`: both packages carry the same version, and a release bumps both.
|
|
5
5
|
|
|
6
|
+
## 26.11.25
|
|
7
|
+
|
|
8
|
+
- `@n-uf/placement` (root), **one geometry** (additive): the rect math every entry shares is the root's: `EPS`,
|
|
9
|
+
`PLANE`, `area`, `overlaps`, `contains`, `clamp`, `subtract` (a rect less another, as disjoint rects), and the hit
|
|
10
|
+
sizes `COLUMN_REACH` and `RAIL_EDGE`, next to `rect`, `overlap`, `clampInto` and `centre`. The **`Target`** type
|
|
11
|
+
(a drop target's shape) is the root's too. **What moved:** `Target` from `./targets` (which still exports it) to
|
|
12
|
+
the root; `COLUMN_REACH` and `RAIL_EDGE` from `./panels` (which still exports them) to the root; the private copies
|
|
13
|
+
in `./scene`, `./stack`, `./panels` and `./targets` are gone. Nothing else changes.
|
|
14
|
+
|
|
15
|
+
- `@n-uf/placement/scene`, **Changed: one target model**. `targets` and `refusals` come from one
|
|
16
|
+
generation: edge → zones → slots → tiles, then one ordered filter (accepts and zones, fit, clipping, `blocked`). Every
|
|
17
|
+
point of an edge that takes the dragged kind is one target or one refusal of its own zone (a property check over
|
|
18
|
+
generated windows: no hole, no overlap, no other zone, the item's own rect only home, every slot its landing).
|
|
19
|
+
`targets`, `after`, `refusals`, `stops`, `SceneTarget` and the priorities keep their shape. Some ids change, as
|
|
20
|
+
listed below; no id is given twice by one call. What changes:
|
|
21
|
+
- A zone's extent is where its items lie: the thirds of a bar, a compact rail or a side toolbar bar (compact bars and
|
|
22
|
+
rails too, now); the solver's spans where items fill the edge (a plain panel column is one zone, its whole length;
|
|
23
|
+
a tray column its panels' span and its tray's).
|
|
24
|
+
- Home's tile is the item's own interval: no ±12 px band, no 16 px kept per gap. A stretch with no slot of its own
|
|
25
|
+
is refused, never home's and never another zone's: beside an item alone in its zone with the new reason
|
|
26
|
+
**`own-place`** (there is room, but the zone's only place is the item's own), elsewhere `no-room`.
|
|
27
|
+
- A refused slot is refused over its own tile; a zone may have more than one refusal: `refuse:<edge>:<zone>`, then
|
|
28
|
+
`refuse:<edge>:<zone>:<n>`, numbered by where they lie along the edge (then across it), so an id holds from one
|
|
29
|
+
frame to the next.
|
|
30
|
+
- `strip:<edge>:<zone>` names a slot only on an edge with no members at all. On an edge that draws nothing but holds
|
|
31
|
+
closed members (or the dragged item's own place), every slot keeps its `gap:<edge>:<zone>:<at>` id.
|
|
32
|
+
- A place that would move a fixed item of its edge (before a title, after the window controls) is no slot.
|
|
33
|
+
- With no rail shown, the `rail:` strip is `RAIL_EDGE` px of `SceneLayout.railPlaces` (where the rail lands).
|
|
34
|
+
- The column lines and the rail are edges like the others, tiled by the same rule: two column lines nearer than
|
|
35
|
+
`2 × COLUMN_REACH` meet halfway; a column line or rail stop whose drop wouldn't land or fit, and any piece clipping
|
|
36
|
+
cuts off its tile, is refused (`refuse:column:<side>:start`, `refuse:rail:<side>:start`, `no-room`) instead of
|
|
37
|
+
being left to the float.
|
|
38
|
+
- **Space ownership** decides where tiles meet: owned, then virtual, then overreach.
|
|
39
|
+
- A drawn edge owns its rect. An empty edge owns only a thin band of its place, half the hit band (12 px), at the
|
|
40
|
+
boundary where it would appear; so does the side's rail where none shows. The item's own place (home's tile) is
|
|
41
|
+
owned before everything.
|
|
42
|
+
- Owned rects rank in the order the layout lays edges out: an edge laid first, whose filling pushes the other, wins
|
|
43
|
+
(outer before inner on one side, full bars before the sides, the rail before its side's columns). Between edges
|
|
44
|
+
laid independently, a drawn rect wins over an empty edge's band.
|
|
45
|
+
- A zone loses what an edge ranked before it owns, its panel bodies and its reserved rects before it is tiled; a
|
|
46
|
+
zone left with no room offers no slot. Every slot that is offered keeps a hit.
|
|
47
|
+
- A column line is where a new column would appear, so it owns a place band like an empty edge: half the hit band
|
|
48
|
+
(12 px) in all, centred on its line, ranked where that new column would be laid (it wins over the inner column it
|
|
49
|
+
would push, not over the outer one). Past that band its tile takes only space no edge owns. Two columns that
|
|
50
|
+
touch keep the line at their seam; a narrow column keeps its gaps in the rest of its own rect.
|
|
51
|
+
- Overreach, the part of a tile past what its edge owns (the depth a column will have after the drop, an empty
|
|
52
|
+
strip past its band, a compact rail's inward reach), comes last: it yields to the column lines and to every other
|
|
53
|
+
edge's owned rect, and it stays a tile's only where it meets the owned part along its whole length. A compact
|
|
54
|
+
rail's reach no longer covers the next column's rect.
|
|
55
|
+
- Slots that are the same move (one line and one landing, or both putting the item back) are one slot, the lowest
|
|
56
|
+
`at` keeping its id.
|
|
57
|
+
- An overlay column is drawn on top, and what shows on top wins: an empty rail's place under an overlay column
|
|
58
|
+
offers no `rail:` stop there, and a column line beside an overlay column yields to it.
|
|
59
|
+
|
|
60
|
+
- Typing: `SceneRefusal["reason"]` gains `own-place`; an exhaustive `switch` over it needs the case.
|
|
61
|
+
|
|
62
|
+
**Migration:** match refusals by `refuse:<edge>:<zone>` prefix and read `own-place` as "back to its place"; read
|
|
63
|
+
`home:<id>` (unchanged, over the own rect) for "back to its place"; expect no target over a stretch beside a lone
|
|
64
|
+
item, a refusal there instead; match `gap:<edge>:<zone>:<at>` for an edge that holds only closed members.
|
|
65
|
+
|
|
66
|
+
- `@n-uf/placement/scene`, **`SceneLayout.railPlaces`** (additive): where each side's rail lies, or would lie were one
|
|
67
|
+
shown, for every side with a rail (`Scene.rails`): the shown rail's rect, else where a drop into the rail lands.
|
|
68
|
+
`targets` reads it. Hosts draw `rails` (only shown rails, unchanged), never `railPlaces`.
|
|
69
|
+
|
|
70
|
+
- `@n-uf/placement/scene`, **Changed:** every empty edge's strip is by zone, as an empty bar's has been since
|
|
71
|
+
26.11.19: `strip:<edge>:start|center|end`, by thirds along the edge (a side edge's or a compact rail's height), the
|
|
72
|
+
item docking aligned in that third (top, middle or bottom of a side). It used to be one `strip:<edge>` landing at the
|
|
73
|
+
start, so an empty rail took every drop at its top. Affected: left and right edges (static columns, column trays,
|
|
74
|
+
side toolbar bars) and compact rails on any side. Only the thirds whose zone takes the kind (`Edge.zoneAccepts`) are
|
|
75
|
+
strips; the others are refusals (`refusals()`). A kind still never opens an empty side column its start zone doesn't
|
|
76
|
+
take (a group gets the rail, never a column of one toolbar). The strips keep every strip rule
|
|
77
|
+
(clipped, clear of home, no sliver, preview = landing). **Migration:** match `strip:<edge>:<zone>` where a host
|
|
78
|
+
matched `strip:<edge>`.
|
|
79
|
+
|
|
6
80
|
## 26.11.24
|
|
7
81
|
|
|
8
82
|
- `@n-uf/placement/scene`, **fixed:** `columnRoom` counts a side toolbar bar. A left or right bar that lays out an item
|
package/README.md
CHANGED
|
@@ -22,8 +22,12 @@ Its sibling [`@n-uf/motion`](https://www.npmjs.com/package/@n-uf/motion) owns ho
|
|
|
22
22
|
without importing each other: a target list from `@n-uf/placement/targets` is exactly what
|
|
23
23
|
`@n-uf/motion/drag`'s drag intent takes, and a rect from any layout here is what `@n-uf/motion/layout` glides to.
|
|
24
24
|
|
|
25
|
-
- **`@n-uf/placement`**: the shapes (`Rect`, `Size`, `Point`) and a popup positioner,
|
|
26
|
-
point, gravity and offset, then flip, slide and resize, each only when the
|
|
25
|
+
- **`@n-uf/placement`**: the shapes (`Rect`, `Size`, `Point`), the geometry every entry shares, and a popup positioner,
|
|
26
|
+
as Wayland's xdg-positioner: an anchor point, gravity and offset, then flip, slide and resize, each only when the
|
|
27
|
+
rule allows it. The geometry is `rect`, `overlap`, `clampInto`, `centre`, `EPS`, `PLANE`, `area`, `overlaps`,
|
|
28
|
+
`contains`, `clamp` and `subtract` (a rect less another, as disjoint rects), with the hit sizes `COLUMN_REACH` (22 px,
|
|
29
|
+
each way of a column line) and `RAIL_EDGE` (10 px). The `Target` type (a drop target's shape, as
|
|
30
|
+
`@n-uf/motion/drag` takes it) is exported here too; `./targets` and `./panels` still export it and the hit sizes.
|
|
27
31
|
- **`/dock`**: a desk of documents and tool panels. Side docks and a bottom dock (between the side docks or across
|
|
28
32
|
the full width), rails, natural-height sections whose last one takes the rest, fold and unfold, the give-way
|
|
29
33
|
rules (sections fold least recently used first, docks fold to their rails), floating palettes with corner stacks,
|
|
@@ -796,7 +800,8 @@ is over the leading zone (`start`), in the middle third over the center zone, in
|
|
|
796
800
|
(`end`), and within the zone the nearest of its gaps wins, each zone's gaps splitting only that zone's third. A zone whose
|
|
797
801
|
toolbars run past its third spreads its gap lines inside the third, so its last gap keeps a slice of it. An empty bar's
|
|
798
802
|
strip is three targets, `strip:<bar>:start`, `strip:<bar>:center` and `strip:<bar>:end` (it was one `strip:<bar>`), one
|
|
799
|
-
per third.
|
|
803
|
+
per third. Every empty edge does the same along its own axis: a side edge or a compact rail by thirds of its height
|
|
804
|
+
(`strip:<edge>:start|center|end`, top, middle, bottom).
|
|
800
805
|
|
|
801
806
|
A **title bar**, a bar with a fixed item that grows (the window title), is a constrained host: a toolbar dropped there
|
|
802
807
|
must land in its first form, nothing else in the bar may change form for it, and the title keeps its natural width (it may
|
|
@@ -844,9 +849,11 @@ out of it with a `no-icons-form` note.
|
|
|
844
849
|
the kinds each zone takes, and a zone not listed takes nothing. A panel column with `{ start: ["panel"], end: ["group"] }`
|
|
845
850
|
has its panels at the top and a tray of toolbars at its foot (the end zone, one toolbar per row): a toolbar in the tray
|
|
846
851
|
takes only its `wrap` or `icons` form, never the menu, and the panels give way first. Gaps are offered only in the zones
|
|
847
|
-
that take the dragged kind, `moveTo` puts an item in the zone asked for, else in its own zone if that takes its kind, else in the first that does
|
|
848
|
-
|
|
849
|
-
|
|
852
|
+
that take the dragged kind, `moveTo` puts an item in the zone asked for, else in its own zone if that takes its kind, else in the first that does. An empty edge offers
|
|
853
|
+
each third of its strip only to the kinds that third's zone takes (the other thirds are refusals), and a group never
|
|
854
|
+
opens such a column on its own: an empty side column offers its strip only to the kinds its start zone takes, so a
|
|
855
|
+
group's drag gets the compact rail's strips but none for an empty panel column, and a panel's gets the column's top
|
|
856
|
+
third.
|
|
850
857
|
|
|
851
858
|
**Columns and rails.** A left or right edge with `column: true` is a dynamic column: drops make it (a `column` place, from
|
|
852
859
|
`scene.columns[side]`: `accepts`, `cross`, `gap`, `pad`, `menu`), and it is deleted, its side's rings closed up, when it
|
|
@@ -962,14 +969,15 @@ edges without `previous`.
|
|
|
962
969
|
by is spare room: the drop shrinks it toward its natural size (to its `min` if the room needs it), so a group moved
|
|
963
970
|
out of a title bar can always go back while the room allows. No slot lies over a fixed item's reserved rect. `slot`
|
|
964
971
|
is the item's rect after the drop and `marker` the insertion line across the edge.
|
|
965
|
-
- `strip:<edge>` (2;
|
|
966
|
-
Bar alignment zones): an
|
|
972
|
+
- `strip:<edge>:<zone>` (2; three per empty edge, `:start`, `:center` and `:end`, one per third along the edge: a bar's
|
|
973
|
+
width, a side edge's height, see Bar alignment zones): an accepting edge with no members at all (one that holds only
|
|
974
|
+
closed members keeps its `gap:` ids), a strip `Edge.strip` px deep (default 24) along its side, inside the
|
|
967
975
|
content and clear of the other edges (overlay ones included), so never over a docked edge or a panel's body: a
|
|
968
976
|
full-width empty bar's strip covers only the content between the columns. A compact rail's strip alone stays at the
|
|
969
977
|
window edge, its own place. A gap hit that spans it across trims its start or end (a bar's strip along the top never
|
|
970
978
|
covers the columns' first gaps); one across its middle is left to the smaller-hit tie-break. With nothing left (an
|
|
971
|
-
empty outer bar on a non-empty inner one, a bar's strip all under an overlay column) it has no target.
|
|
972
|
-
kind its
|
|
979
|
+
empty outer bar on a non-empty inner one, a bar's strip all under an overlay column) it has no target. A third is
|
|
980
|
+
offered only for a kind its zone takes (`Edge.zoneAccepts`); the others are refusals.
|
|
973
981
|
- `float:<id>` (3, free) when `floatKinds` lists the kind: the whole plane, landing with the pointer holding the float
|
|
974
982
|
at `grab`, clamped and moved clear. It has no fixed `slot`: the slot to draw is
|
|
975
983
|
`after(point, grab).layout.items[id].rect`, for the pointer at the time.
|
|
@@ -983,24 +991,54 @@ edges without `previous`.
|
|
|
983
991
|
too: no slot, nothing committed. Every rail target on the side whose rail already holds the item is a home: a segment
|
|
984
992
|
dropped on its own rail, even below the last segment, never splits or reorders it (P9).
|
|
985
993
|
|
|
986
|
-
**
|
|
987
|
-
(
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
994
|
+
**The target model.** `targets` and `refusals` come from one generation: edge, then zones, then slots, then tiles, then
|
|
995
|
+
one ordered filter (accepts and zones, fit, clipping, `blocked`). A target wins only where its own hit is, and every point
|
|
996
|
+
of an edge that takes the dragged kind is one target or one refusal of its own zone, never a hole, an overlap or another
|
|
997
|
+
zone's.
|
|
998
|
+
|
|
999
|
+
- **Zones.** A zone's extent is where its items lie: the thirds of a bar, of a compact rail or of a side toolbar bar;
|
|
1000
|
+
the solver's spans where items fill the edge (a plain panel column is one zone, its whole length; a tray column its
|
|
1001
|
+
panels' span and its tray's). An **empty zone is one slot**, a single place that takes the drop.
|
|
1002
|
+
- **Slots and tiles.** A zone's slots are the places a drop can land (before each item, after the last); the zone's
|
|
1003
|
+
extent is cut into one tile per slot, each tile meeting its neighbour halfway. Slots that are the same move (one line
|
|
1004
|
+
and one landing, or both putting the item back) are one slot, the lowest `at` keeping its id. A place that would move a
|
|
1005
|
+
fixed item of its edge (before a title, after the window controls) is no slot.
|
|
1006
|
+
- **Home.** Home's tile is the item's own interval, with no band around it: a stretch with no slot of its own is refused,
|
|
1007
|
+
never home's and never another zone's. Beside an item alone in its zone it is refused as `own-place`.
|
|
1008
|
+
- **Space ownership** decides where tiles of different edges meet: owned, then virtual, then overreach.
|
|
1009
|
+
- A drawn edge owns its rect. An empty edge owns only a thin place band of 12 px (half the hit band) at the boundary
|
|
1010
|
+
where it would appear; so does the side's rail where none shows. The item's own place is owned before everything.
|
|
1011
|
+
- A column line is where a new column would appear, so it owns a 12 px place band too, centred on its line. Owned rects
|
|
1012
|
+
are ranked by the order the layout lays edges out: an edge laid first, whose filling pushes the other, wins (outer
|
|
1013
|
+
before inner on one side, full bars before the sides, the rail before its side's columns, a column line over the
|
|
1014
|
+
inner column it would push but not the outer one). Between edges laid independently a drawn rect wins over an empty
|
|
1015
|
+
edge's band. Two columns that touch keep the line at their seam.
|
|
1016
|
+
- A zone loses what an edge ranked before it owns, and its panel bodies and reserved rects before it is tiled; a zone
|
|
1017
|
+
left with no room offers no slot.
|
|
1018
|
+
- Overreach, the part of a tile past what its edge owns (the depth a column will have after the drop, an empty
|
|
1019
|
+
strip past its band, a compact rail's inward reach), comes last: it yields to the column lines and to every other
|
|
1020
|
+
edge's owned rect.
|
|
1021
|
+
- An overlay column is drawn on top, and what shows on top wins: an empty rail's place under it offers no `rail:` stop
|
|
1022
|
+
there, and a column line beside it yields to it.
|
|
1023
|
+
- **The column lines and the rail are edges like the others**, tiled by the same rule. A column line or rail stop whose
|
|
1024
|
+
drop wouldn't land or fit, and any piece clipping cuts off its tile, is refused (`refuse:column:<side>:start`,
|
|
1025
|
+
`refuse:rail:<side>:start`, `no-room`) rather than left to the float.
|
|
1026
|
+
- **Strips.** `strip:<edge>:<zone>` names a slot only on an edge with no members at all. On an edge that draws nothing
|
|
1027
|
+
but holds closed members (or the dragged item's own place), every slot keeps its `gap:<edge>:<zone>:<at>` id.
|
|
1028
|
+
- **`SceneLayout.railPlaces`:** where each side's rail lies, or would lie were one shown, for every side with a rail
|
|
1029
|
+
(`Scene.rails`): the shown rail's rect, else where a drop into the rail lands. With no rail shown, the `rail:` strip is
|
|
1030
|
+
`RAIL_EDGE` px of it. Targets read it; a host draws `rails` (the shown rails), never `railPlaces`.
|
|
1031
|
+
|
|
1032
|
+
**Refusals.** `refusals(scene, dragged, options?)` gives the places a drop is refused, as `{ id, edge, zone, hit,
|
|
1033
|
+
reason }[]` (type `SceneRefusal`): the stretches of a zone with no slot of their own, and the side edges that don't take
|
|
1034
|
+
the kind (as a whole, zone `start`). `reason` is `"no-room"` when the zone takes the kind but no place of it fits (a
|
|
1035
|
+
title bar at the title's natural width say), `"not-accepted"` when the zone or the edge doesn't take the kind, and
|
|
1036
|
+
**`"own-place"`** for the stretch beside an item alone in its zone: there is room, but the zone's only place is the item's
|
|
1037
|
+
own. An exhaustive `switch` over `SceneRefusal["reason"]` needs the `own-place` case. Ids are `refuse:<edge>:<zone>` and,
|
|
1038
|
+
when a zone has more than one refusal, `refuse:<edge>:<zone>:<n>`, numbered by where they lie along the edge (then
|
|
1039
|
+
across it), so an id holds from one frame to the next; no id is given twice by one call. A refused slot is refused over
|
|
1040
|
+
its own tile. A host shows "no room here" at the pointer over one, with no slot anywhere; a release there commits
|
|
1041
|
+
nothing, the item goes home. It takes the same `previous` and `fresh` as `targets`.
|
|
1004
1042
|
|
|
1005
1043
|
A gap, column or rail target exists only where the drop keeps the whole scene sound (C29): it adds no `overflow` or
|
|
1006
1044
|
`too-wide` note to any edge, changes no fixed item's form, squeezes none under its `main.min` anywhere (a between bar
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clampInto,
|
|
3
3
|
rect
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WM5FJ3IS.js";
|
|
5
5
|
|
|
6
6
|
// src/dock/model.ts
|
|
7
7
|
var G = 6;
|
|
@@ -466,4 +466,4 @@ export {
|
|
|
466
466
|
pillBetween,
|
|
467
467
|
aroundDocs
|
|
468
468
|
};
|
|
469
|
-
//# sourceMappingURL=chunk-
|
|
469
|
+
//# sourceMappingURL=chunk-3P6VOXA6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dock/model.ts","../src/dock/arrange.ts","../src/dock/parts.ts"],"sourcesContent":["/**\n * The desk's model: panels and documents, the options, the state every construction keeps, and what a layout\n * returns (a placed rect per item). The panels themselves (their titles and natural heights) come from the\n * consumer as a catalog; see `createDesk`.\n */\nimport type { Rect, Size } from \"../geometry\";\n\nexport type Side = \"left\" | \"right\";\n\n/** Gaps and sizes, in stage px. */\nexport const G = 6;\n/** A toolbar bar's height (the pill is 4 px thinner). */\nexport const BAR = 34;\n/** A rail's width. */\nexport const RAIL = 34;\n/** A folded section's (or a shaded palette's) height: its title bar. */\nexport const TITLE = 22;\n/** A tab row's height (navigator sides and drawers). */\nexport const TABS = 28;\n/** The smallest a tiled document may be where a construction promises it (the tiling tree, the strip). */\nexport const DOC_MIN: Size = { width: 240, height: 160 };\n\n/** Items are keyed \"panel:<id>\" and \"doc:<id>\". */\nexport const panelKey = (id: number): string => `panel:${id}`;\nexport const docKey = (id: number): string => `doc:${id}`;\nexport const isPanelKey = (key: string): boolean => key.startsWith(\"panel:\");\nexport const isDocKey = (key: string): boolean => key.startsWith(\"doc:\");\nexport const idOf = (key: string): number => Number(key.slice(key.indexOf(\":\") + 1));\n\n/** A tool panel: its title and the height its content needs (its natural height, title bar included). */\nexport interface PanelSpec {\n readonly id: number;\n readonly title: string;\n readonly natural: number;\n}\n\n/** Where the panels start. Unset parts follow from the sides (see `createDesk`). */\nexport interface DeskStart {\n readonly left: readonly number[];\n readonly right: readonly number[];\n readonly bottom: readonly number[];\n readonly active?: { readonly left: number | null; readonly right: number | null };\n readonly tree?: DeskState[\"tree\"];\n readonly cols?: DeskState[\"cols\"];\n readonly stacks?: DeskState[\"stacks\"];\n}\n\n/** What a desk is made of: its panels, its documents' titles and where the panels start. */\nexport interface DeskSpec {\n readonly panels: readonly PanelSpec[];\n /** A document's title (default \"Document <id>\"). */\n readonly docTitle?: (id: number) => string;\n readonly start: DeskStart;\n /** The panels in the order they were opened (default: as listed); the tiling tree floats the newest first. */\n readonly opened?: readonly number[];\n}\n\n/** The catalog every part reads: a panel's natural height, an item's title and age. */\nexport interface Catalog {\n readonly panelIds: readonly number[];\n readonly natural: (id: number) => number;\n /** An item's title by key (\"panel:<id>\", \"doc:<id>\"); any other key is its own title. */\n readonly title: (key: string) => string;\n /** An item's age: higher is newer (panels in the order they were opened, then the documents). */\n readonly born: (key: string) => number;\n readonly start: Required<DeskStart>;\n}\n\n/** The catalog for a spec (unset start parts filled in). */\nexport function catalogOf(spec: DeskSpec): Catalog {\n const byId = new Map(spec.panels.map((p) => [p.id, p]));\n const opened = spec.opened ?? spec.panels.map((p) => p.id);\n const docTitle = spec.docTitle ?? ((id: number) => `Document ${id}`);\n const { left, right, bottom } = spec.start;\n const rest = [...right, ...bottom];\n const start: Required<DeskStart> = {\n left,\n right,\n bottom,\n active: spec.start.active ?? { left: left[0] ?? null, right: right.at(-1) ?? null },\n tree: spec.start.tree ?? { L: left.map(panelKey), R: rest.map(panelKey), C: [] },\n cols: spec.start.cols ?? [left.map(panelKey), rest.map(panelKey)].filter((c) => c.length > 0),\n stacks: spec.start.stacks ?? { left, right: rest },\n };\n return {\n panelIds: spec.panels.map((p) => p.id),\n natural: (id) => byId.get(id)?.natural ?? TITLE,\n title: (key) => (isPanelKey(key) ? (byId.get(idOf(key))?.title ?? key) : isDocKey(key) ? docTitle(idOf(key)) : key),\n born: (key) => (isDocKey(key) ? 1000 + idOf(key) : opened.indexOf(idOf(key)) + 1),\n start,\n };\n}\n\n/** Where the toolbar floats (top or bottom) and whether the documents keep a band clear for it; the bottom dock's mode. */\nexport interface Options {\n readonly toolbar: \"top\" | \"bottom\";\n readonly toolbarSpace: \"reserved\" | \"overlay\";\n readonly bottom: \"reserved\" | \"overlay\" | \"off\";\n /** The pill's width when its contents need more than the default; unset: the default. */\n readonly toolbarWidth?: number;\n /** The pill holds nothing: it takes no space and isn't shown. */\n readonly toolbarHidden?: boolean;\n}\nexport const DEFAULT_OPTIONS: Options = { toolbar: \"top\", toolbarSpace: \"reserved\", bottom: \"reserved\" };\n\n/** A panel placed freely (torn off, or a palette out of its stack): its top-left corner, null for the default spot. */\nexport interface Free {\n readonly id: number;\n readonly at: { readonly x: number; readonly y: number } | null;\n}\n\n/**\n * Everything any construction keeps. Each construction has its own copy (its own arrangement) and reads only what\n * it uses; the open documents are the same in all of them.\n */\nexport interface DeskState {\n /** Open document ids, in open order. */\n readonly docs: readonly number[];\n readonly focus: number | null;\n /** Panel ids, least recently used first: what folds or shades first when height runs out. */\n readonly recent: readonly number[];\n /** Sections folded (palettes shaded) by hand. */\n readonly folded: readonly number[];\n /** Docks, navigator sides and drawers: the panels on each side, top to bottom (tabs: left to right). */\n readonly left: readonly number[];\n readonly right: readonly number[];\n /** The bottom dock's panels (edge docks only). */\n readonly bottom: readonly number[];\n /** Docks or drawers folded to their rail by hand. */\n readonly closed: readonly Side[];\n /** The side opened last by hand: when width runs out it folds last. */\n readonly opened: Side | null;\n /** The panel showing on each side (navigator, drawers). */\n readonly active: { readonly left: number | null; readonly right: number | null };\n /** Panels torn off a dock, floating (edge docks + tear-off). */\n readonly torn: readonly Free[];\n /** The tiling tree: item keys in the left column, the right column and the centre (dwindle order). */\n readonly tree: { readonly L: readonly string[]; readonly R: readonly string[]; readonly C: readonly string[] };\n /** The scrolling strip: its columns, left to right, each a list of item keys top to bottom. */\n readonly cols: readonly (readonly string[])[];\n /** The strip scrolled by hand, or null: it scrolls to the focus. */\n readonly stripScroll: number | null;\n /** Palettes: the corner stacks, top to bottom, and the ones placed anywhere. */\n readonly stacks: { readonly left: readonly number[]; readonly right: readonly number[] };\n readonly free: readonly Free[];\n}\n\n/** How an item is drawn. */\nexport type Look =\n | \"pill\" // the toolbar floating as a rounded pill\n | \"bar\" // the toolbar as a bar across the top\n | \"section\" // a panel open in a dock\n | \"header\" // a section folded (or a palette shaded) to its title bar\n | \"float\" // a panel floating over the documents\n | \"palette\" // a floating panel that reserves its footprint\n | \"tile\" // a panel tiled like a document\n | \"bare\" // a panel under a tab row: no title bar of its own\n | \"doc\"\n | \"rail\"\n | \"tabs\"\n | \"track\"\n | \"thumb\";\n\n/** Stacking layers, bottom to top. */\nexport const LAYER = { doc: 1, dock: 2, palette: 3, overlay: 4, float: 5, toolbar: 6 } as const;\n\n/** One item as a layout places it. */\nexport interface Placed {\n readonly rect: Rect;\n readonly look: Look;\n readonly layer: number;\n /** Folded away (into a rail, behind a tab): it goes to `rect`, hidden. */\n readonly hidden?: boolean;\n /** Never laid out below this (where the construction promises it). */\n readonly min?: Partial<Size>;\n /** It may lie outside the stage (the strip scrolls). */\n readonly offStage?: boolean;\n /** A rail's icons or a tab row's tabs (panel ids), and the active tab. */\n readonly icons?: readonly number[];\n readonly tabs?: readonly number[];\n readonly active?: number | null;\n /** Drawn with an accent outline (the bottom dock). */\n readonly accent?: boolean;\n /** Drawn with a shadow (it floats over something). */\n readonly shadow?: boolean;\n}\n\n/**\n * How a layout gave way (or what it is worth knowing about it):\n *\n * - `bottom-folded`: the bottom dock folded to its header; `dock-folded`: a side dock folded to its rail (`side`);\n * - `sections-folded`: sections folded to their headers by themselves, least recently used first;\n * - `torn-floating`: panels torn off a dock float (`items`); `torn-shaded`: some shade because they don't fit;\n * - `columns-railed`: the tiling tree's side columns are folded to rails (`side` when only one);\n * - `tiles-float`: tiles that broke a minimum float, newest first (`items`);\n * - `tabs-folded`: a tabbed side folded to icon tabs (`side`); `drawer-over`: a drawer slides over the\n * documents (`side`);\n * - `column-split`: a strip column split in two (`items`); `strip-scrolls`: the strip is wider than the stage;\n * - `stacks-merged`: both palette stacks share one corner; `palettes-shaded`: palettes shaded to title bars;\n * - `palettes-cover`, `docs-room`: how much of the documents palettes cover, and how much room they leave.\n */\nexport type NoteCode =\n | \"bottom-folded\"\n | \"dock-folded\"\n | \"sections-folded\"\n | \"torn-floating\"\n | \"torn-shaded\"\n | \"columns-railed\"\n | \"tiles-float\"\n | \"tabs-folded\"\n | \"drawer-over\"\n | \"column-split\"\n | \"strip-scrolls\"\n | \"stacks-merged\"\n | \"palettes-shaded\"\n | \"palettes-cover\"\n | \"docs-room\";\n\n/**\n * One note on a layout. `code` (and `side`, `items` where they apply) is the contract; `text` says it in English for\n * people, and its wording may change in any release.\n */\nexport interface Note {\n readonly code: NoteCode;\n readonly text: string;\n readonly side?: Side;\n /** The item keys it is about. */\n readonly items?: readonly string[];\n}\n\n/** Where everything is (\"toolbar\", \"panel:<id>\", \"doc:<id>\", \"rail:<side>\", \"tabs:<side>\", \"track\", \"thumb\"), and how it gave way. */\nexport interface Layout {\n readonly items: ReadonlyMap<string, Placed>;\n readonly notes: readonly Note[];\n}\n\n// --- state changes -------------------------------------------------------------------------------------------------\n\n/** The arrangement a catalog starts from, with these documents open (none by default). */\nexport function startState(cat: Catalog, docs: readonly number[] = []): DeskState {\n const st = cat.start;\n const base: DeskState = {\n docs: [],\n focus: null,\n recent: [...cat.panelIds],\n folded: [],\n left: [...st.left],\n right: [...st.right],\n bottom: [...st.bottom],\n closed: [],\n opened: null,\n active: st.active,\n torn: [],\n tree: st.tree,\n cols: st.cols,\n stripScroll: null,\n stacks: st.stacks,\n free: [],\n };\n return withDocs(base, docs, docs.at(-1) ?? null);\n}\n\n/**\n * The same state with these documents open: new ones join the tiling tree's centre (the first one at its front)\n * and get a strip column of their own after the last document column; closed ones leave both.\n */\nexport function withDocs(s: DeskState, docs: readonly number[], focus: number | null): DeskState {\n const keys = docs.map(docKey);\n const gone = (k: string): boolean => isDocKey(k) && !keys.includes(k);\n let C = s.tree.C.filter((k) => !gone(k));\n let cols = s.cols.map((c) => c.filter((k) => !gone(k))).filter((c) => c.length > 0);\n const has = (k: string): boolean => [...s.tree.L, ...s.tree.R, ...C].includes(k);\n for (const k of keys) {\n if (!has(k)) C = C.some(isDocKey) || C.length === 0 ? [...C, k] : [k, ...C];\n if (!cols.some((c) => c.includes(k))) {\n const lastDoc = cols.map((c) => c.some(isDocKey)).lastIndexOf(true);\n const at = lastDoc >= 0 ? lastDoc + 1 : Math.min(1, cols.length);\n cols = [...cols.slice(0, at), [k], ...cols.slice(at)];\n }\n }\n const L = s.tree.L.filter((k) => !gone(k));\n const R = s.tree.R.filter((k) => !gone(k));\n const f = focus !== null && docs.includes(focus) ? focus : (docs.at(-1) ?? null);\n // A new focus: the strip scrolls to it again.\n return { ...s, docs: [...docs], focus: f, tree: { L, R, C }, cols, stripScroll: f === s.focus ? s.stripScroll : null };\n}\n\n/** Panel `id` was used: it is the last to fold when height runs out. */\nexport const touch = (s: DeskState, id: number): DeskState => ({ ...s, recent: [...s.recent.filter((x) => x !== id), id] });\n\n/** Fold or unfold a section (shade or unshade a palette) by hand; unfolding is a use. */\nexport function toggleFold(s: DeskState, id: number): DeskState {\n const folded = s.folded.includes(id);\n const next = { ...s, folded: folded ? s.folded.filter((x) => x !== id) : [...s.folded, id] };\n return folded ? touch(next, id) : next;\n}\n\n/** Fold a dock (or drawer) to its rail by hand, or open it again (then it folds last when width runs out). */\nexport function toggleClosed(s: DeskState, side: Side): DeskState {\n const closed = s.closed.includes(side);\n return closed ? { ...s, closed: s.closed.filter((x) => x !== side), opened: side } : { ...s, closed: [...s.closed, side] };\n}\n\n/** Show panel `id` on its side (navigator, drawers). */\nexport const withActive = (s: DeskState, side: Side, id: number): DeskState => touch({ ...s, active: { ...s.active, [side]: id } }, id);\n\n/** The state with `key` lifted out of wherever it is (before a drop puts it somewhere). */\nexport function liftOut(s: DeskState, key: string): DeskState {\n const dropK = (l: readonly string[]): string[] => l.filter((k) => k !== key);\n const base: DeskState = { ...s, tree: { L: dropK(s.tree.L), R: dropK(s.tree.R), C: dropK(s.tree.C) }, cols: s.cols.map(dropK).filter((c) => c.length > 0) };\n if (!isPanelKey(key)) return base;\n const id = idOf(key);\n const drop = (l: readonly number[]): number[] => l.filter((x) => x !== id);\n return {\n ...base,\n left: drop(s.left),\n right: drop(s.right),\n bottom: drop(s.bottom),\n torn: s.torn.filter((f) => f.id !== id),\n free: s.free.filter((f) => f.id !== id),\n stacks: { left: drop(s.stacks.left), right: drop(s.stacks.right) },\n active: { left: s.active.left === id ? null : s.active.left, right: s.active.right === id ? null : s.active.right },\n };\n}\n","/**\n * The arrangers the desk constructions build on, internal to `./dock`: master and stack for the documents, dwindle\n * for the tiling tree's centre, stacked columns at natural heights, and the minimum-size give-way (the newest tile\n * that breaks a minimum floats). A public `./tiling` will come from a merge with a full split-tree model; these stay\n * the dock's own until then.\n */\nimport type { Rect, Size } from \"../geometry\";\n\n/**\n * Master and stack: the first id takes the left part (`ratio` of the width less the gap), the rest stack on the\n * right in equal rows. One id takes the whole area.\n */\nexport function masterStack<K>(ids: readonly K[], area: Rect, gap: number, ratio = 0.5): Map<K, Rect> {\n const out = new Map<K, Rect>();\n if (ids.length === 0) return out;\n if (ids.length === 1) {\n out.set(ids[0]!, { ...area });\n return out;\n }\n const mw = (area.width - gap) * ratio;\n out.set(ids[0]!, { x: area.x, y: area.y, width: mw, height: area.height });\n const k = ids.length - 1;\n const sh = (area.height - gap * (k - 1)) / k;\n ids.slice(1).forEach((id, i) => out.set(id, { x: area.x + mw + gap, y: area.y + i * (sh + gap), width: area.width - mw - gap, height: sh }));\n return out;\n}\n\n/** Dwindle over an order: each tile but the last splits the space left in two along its longer side. */\nexport function dwindle(area: Rect, n: number, gap: number): Rect[] {\n const out: Rect[] = [];\n let cur = { ...area };\n for (let i = 0; i < n; i++) {\n if (i === n - 1) {\n out.push(cur);\n break;\n }\n if (cur.width >= cur.height) {\n const w = (cur.width - gap) / 2;\n out.push({ x: cur.x, y: cur.y, width: w, height: cur.height });\n cur = { x: cur.x + w + gap, y: cur.y, width: w, height: cur.height };\n } else {\n const h = (cur.height - gap) / 2;\n out.push({ x: cur.x, y: cur.y, width: cur.width, height: h });\n cur = { x: cur.x, y: cur.y + h + gap, width: cur.width, height: h };\n }\n }\n return out;\n}\n\n/**\n * Heights for a column of items stacked in `avail` with gaps: each at its minimum (its natural height), the last\n * taking the rest. When the minimums don't fit, an even share instead, so the ones that break their minimum show.\n */\nexport function columnHeights(avail: number, mins: readonly number[], gap: number): number[] {\n const room = avail - gap * (mins.length - 1);\n const need = mins.reduce((a, b) => a + b, 0);\n if (need > room) return mins.map(() => room / mins.length);\n return mins.map((m, i) => (i === mins.length - 1 ? room - need + m : m));\n}\n\n/**\n * Lengths for items sharing `avail`: each gets at least its minimum, the rest of the room is shared in proportion\n * to the minimums (when the minimums don't fit, each gets its minimum).\n */\nexport function share(avail: number, mins: readonly number[]): number[] {\n const need = mins.reduce((a, b) => a + b, 0);\n const spare = Math.max(0, avail - need);\n return mins.map((m) => m + (need > 0 ? (spare * m) / need : spare / mins.length));\n}\n\n/**\n * The minimum-size give-way: while a tile is laid out below its minimum, the newest tile (highest `age`) floats and\n * the rest are laid out again. Stops when every tile keeps its minimum or one tile is left. `layout` lays out the\n * kept keys; the result says which are kept (in their order) and which float (newest first).\n */\nexport function giveWay<K>(keys: readonly K[], layout: (kept: readonly K[]) => ReadonlyMap<K, Rect>, min: (key: K) => Size, age: (key: K) => number): { kept: K[]; floats: K[] } {\n let kept = [...keys];\n const floats: K[] = [];\n for (;;) {\n const res = layout(kept);\n const broken = [...res].some(([k, r]) => r.width < min(k).width - 0.5 || r.height < min(k).height - 0.5);\n if (!broken || kept.length <= 1) return { kept, floats };\n const newest = kept.reduce((a, b) => (age(b) > age(a) ? b : a));\n kept = kept.filter((k) => k !== newest);\n floats.push(newest);\n }\n}\n","/**\n * The parts the desk constructions are built from, each pure: the toolbar pill, the documents' tiles, natural-height\n * sections (the last open one takes the rest; the least recently used fold to headers), rails, the edge docks'\n * geometry, the tiling tree's columns, the scrolling strip, tabbed sides and floating palettes.\n */\nimport { clampInto, rect, type Rect, type Size } from \"../geometry\";\nimport { columnHeights, dwindle, giveWay, masterStack } from \"./arrange\";\nimport { BAR, DOC_MIN, G, LAYER, RAIL, TABS, TITLE, docKey, idOf, isDocKey, panelKey, type Catalog, type DeskState, type Note, type Options, type Placed, type Side } from \"./model\";\n\nexport type Out = Map<string, Placed>;\n\nexport const plural = (n: number, one: string, many: string): string => `${n} ${n > 1 ? many : one}`;\n\n// --- the toolbar pill and the documents ----------------------------------------------------------------------------\n\n/** The shortest a pill gets (unless there is less room than that). */\nexport const PILL_MIN = 60;\n\n/**\n * The toolbar pill, floating at the top or the bottom of the band [y0, y1] above a region `cx`..`cx + cw`; returns\n * the pill and the band left for the documents (reserved: they keep clear of it; overlay: it floats over them).\n */\nexport function pill(opt: Options, cx: number, cw: number, y0: number, y1: number): { placed: Placed; top: number; bottom: number } {\n const pw = Math.max(PILL_MIN, Math.min(opt.toolbarWidth ?? 320, cw - 24));\n const ph = BAR - 4;\n const atTop = opt.toolbar === \"top\";\n // A hidden pill keeps no band clear, as if it floated.\n const overlay = opt.toolbarSpace === \"overlay\" || !!opt.toolbarHidden;\n return {\n placed: { rect: rect(cx + cw / 2 - pw / 2, atTop ? y0 + G : y1 - G - ph, pw, ph), look: \"pill\", layer: LAYER.toolbar, shadow: overlay, ...(opt.toolbarHidden ? { hidden: true } : {}) },\n top: atTop && !overlay ? y0 + BAR + 2 * G : y0 + G,\n bottom: !atTop && !overlay ? y1 - BAR - 2 * G : y1 - G,\n };\n}\n\n/** The toolbar as a bar across the top of the stage. */\nexport const bar = (W: number): Placed => ({ rect: rect(0, 0, W, BAR), look: \"bar\", layer: LAYER.toolbar });\n\n/** The documents in `r`, master and stack: the first takes 56 % of the width, the rest stack on the right. */\nexport function tiles(out: Out, r: Rect, ids: readonly number[], min?: Size): void {\n for (const [id, rr] of masterStack(ids, r, G, 0.56)) out.set(docKey(id), { rect: rr, look: \"doc\", layer: LAYER.doc, ...(min ? { min } : {}) });\n}\n\n// --- sections and rails --------------------------------------------------------------------------------------------\n\n/**\n * The ones of `ids` to fold, least recently used first, until what stays open fits `avail`. An accordion keeps one\n * section open whatever (`keepOne`); a palette stack shades even its last palette rather than run off the stage.\n */\nfunction lruFold(s: DeskState, ids: readonly number[], avail: number, open: (id: number) => number, closed: number, keepOne = true): number[] {\n const byHand = ids.filter((id) => s.folded.includes(id));\n const auto: number[] = [];\n const isOpen = (id: number): boolean => !byHand.includes(id) && !auto.includes(id);\n const need = (): number => ids.reduce((sum, id) => sum + (isOpen(id) ? open(id) : closed), 0) + G * (ids.length - 1);\n const order = [...s.recent].filter((id) => ids.includes(id));\n for (const id of order) {\n if (need() <= avail || (keepOne && ids.filter(isOpen).length <= 1)) break;\n if (isOpen(id)) auto.push(id);\n }\n return [...byHand, ...auto];\n}\n\n/**\n * Natural-height sections in x, y, w, h: each open section takes its natural height and the last open one takes\n * the rest; the least recently used fold to headers until the open ones fit. Returns how many folded by themselves.\n */\nexport function accordion(cat: Catalog, out: Out, s: DeskState, x: number, y: number, w: number, h: number, ids: readonly number[]): number {\n const folded = lruFold(s, ids, h, cat.natural, TITLE);\n const open = ids.filter((id) => !folded.includes(id));\n const room = h - G * (ids.length - 1) - TITLE * (ids.length - open.length);\n const last = open.at(-1);\n const rest = room - open.reduce((sum, id) => sum + (id === last ? 0 : cat.natural(id)), 0);\n let cy = y;\n for (const id of ids) {\n const i = open.indexOf(id);\n const n = cat.natural(id);\n const hh = i < 0 ? TITLE : id === last ? Math.max(n, rest) : n;\n out.set(panelKey(id), { rect: rect(x, cy, w, hh), look: i >= 0 ? \"section\" : \"header\", layer: LAYER.dock, ...(i >= 0 ? { min: { height: n } } : {}) });\n cy += hh + G;\n }\n return folded.filter((id) => !s.folded.includes(id)).length;\n}\n\n/** A rail of icons at x, y; the rect of its icon `i`. */\nconst railIcon =(x: number, y: number, i: number): Rect => rect(x + 6, y + 10 + i * 32, RAIL - 12, 24);\n\n/** A rail (a column whose panels are all folded) at x, y, h: one icon per panel. */\nexport function rail(out: Out, side: Side, x: number, y: number, h: number, ids: readonly number[], hidden = false): void {\n out.set(`rail:${side}`, { rect: rect(x, y, RAIL, h), look: \"rail\", layer: LAYER.dock, icons: ids, ...(hidden ? { hidden } : {}) });\n}\n\n/** Panels folded into a rail: hidden, each at its icon at `w` × its natural height. */\nexport function intoRail(cat: Catalog, out: Out, x: number, y: number, w: number, ids: readonly number[], side: Side): void {\n ids.forEach((id, i) => {\n const icon = railIcon(x, y, i);\n out.set(panelKey(id), { rect: rect(side === \"left\" ? icon.x : icon.x + icon.width - w, icon.y, w, cat.natural(id)), look: \"section\", layer: LAYER.dock, hidden: true });\n });\n}\n\n// --- edge docks ----------------------------------------------------------------------------------------------------\n\n/**\n * The dock width (rail excluded, its sections 240 px wide after the gap) and the narrowest the documents may get\n * before a dock folds.\n */\nexport const DOCK = 246;\nconst WORK_MIN = 380;\n/** The bottom dock's height when open, and the most of the stage's height it takes. */\nconst BOTTOM = 190;\nconst BOTTOM_SHARE = 0.36;\n\n/** What the edge docks put where: shared by their layouts and their drop targets. */\nexport interface DockGeometry {\n /** The side docks' height (less the bottom dock's in full-width mode). */\n readonly h: number;\n /** The bottom dock's height (its header's when folded; 0 when off). */\n readonly bh: number;\n readonly lOpen: boolean;\n readonly rOpen: boolean;\n /** The right dock's panels (the bottom dock's join them when it is off). */\n readonly right: readonly number[];\n readonly bottomOn: boolean;\n readonly bottomRect: Rect | null;\n /** The documents' band, left to right. */\n readonly x0: number;\n readonly x1: number;\n}\n\n/**\n * The edge docks' give-way: the bottom dock folds to its header when the stage is short, and a whole side dock\n * folds to its rail when the documents would get narrower than WORK_MIN (the right one first, unless it was opened\n * last by hand). `mode`: the bottom dock between the side docks, or across the full width under them.\n */\nexport function dockGeometry(cat: Catalog, s: DeskState, size: Size, opt: Options, mode: \"between\" | \"full\", notes: Note[] = []): DockGeometry {\n const { width: W, height: H } = size;\n const bottomOn = opt.bottom !== \"off\" && s.bottom.length > 0;\n const right = bottomOn ? s.right : [...s.right, ...s.bottom];\n const bottomFolded = bottomOn && (H < 480 || s.bottom.every((id) => s.folded.includes(id)));\n // Open, it is BOTTOM tall, never more than BOTTOM_SHARE of the stage (but never below what its panels need).\n const bh = !bottomOn ? 0 : bottomFolded ? TITLE : Math.max(...s.bottom.map(cat.natural), Math.min(BOTTOM, BOTTOM_SHARE * H));\n if (bottomOn && H < 480) notes.push({ code: \"bottom-folded\", text: \"bottom dock folded to its header\" });\n const full = mode === \"full\";\n const h = full && bottomOn ? H - bh - G : H;\n let lOpen = s.left.length > 0 && !s.closed.includes(\"left\");\n let rOpen = right.length > 0 && !s.closed.includes(\"right\");\n const work = (): number => W - 2 * RAIL - (lOpen ? DOCK : 0) - (rOpen ? DOCK : 0) - 2 * G;\n for (const side of s.opened === \"right\" ? ([\"left\", \"right\"] as const) : ([\"right\", \"left\"] as const)) {\n if (work() >= WORK_MIN) break;\n if (side === \"right\" && rOpen) {\n rOpen = false;\n notes.push({ code: \"dock-folded\", side: \"right\", text: \"right dock folded to its rail\" });\n } else if (side === \"left\" && lOpen) {\n lOpen = false;\n notes.push({ code: \"dock-folded\", side: \"left\", text: \"left dock folded to its rail\" });\n }\n }\n const x0 = RAIL + (lOpen ? DOCK : 0) + G;\n const x1 = W - RAIL - (rOpen ? DOCK : 0) - G;\n const bottomRect = bottomOn ? (full ? rect(G, H - G - bh, W - 2 * G, bh) : rect(x0, H - G - bh, x1 - x0, bh)) : null;\n return { h, bh, lOpen, rOpen, right, bottomOn, bottomRect, x0, x1 };\n}\n\n/** The width of a torn-off panel (its height is its natural height). */\nexport const TORN_W = 200;\n\n// --- the tiling tree -----------------------------------------------------------------------------------------------\n\n/** The smallest a tile may be: a document's minimum, or a panel at its natural height. */\nexport const tileMin = (cat: Catalog, key: string): Size => (isDocKey(key) ? DOC_MIN : { width: 150, height: cat.natural(idOf(key)) });\n/** A side column's width. */\nexport const TREE_COLUMN = 180;\n\n/** The tree's tiles laid out (no floating): the left and right columns, the centre by dwindle. */\nexport function treeTiles(cat: Catalog, tree: DeskState[\"tree\"], area: Rect): Map<string, Rect> {\n const res = new Map<string, Rect>();\n let x0 = area.x;\n let x1 = area.x + area.width;\n // A side column's tiles take their natural height, the last one the rest.\n const column = (list: readonly string[], x: number): void => {\n const heights = columnHeights(area.height, list.map((k) => tileMin(cat, k).height), G);\n let y = area.y;\n list.forEach((k, i) => {\n res.set(k, rect(x, y, TREE_COLUMN, heights[i]!));\n y += heights[i]! + G;\n });\n };\n if (tree.L.length) {\n column(tree.L, x0);\n x0 += TREE_COLUMN + G;\n }\n if (tree.R.length) {\n column(tree.R, x1 - TREE_COLUMN);\n x1 -= TREE_COLUMN + G;\n }\n dwindle(rect(x0, area.y, x1 - x0, area.height), tree.C.length, G).forEach((r, i) => res.set(tree.C[i]!, r));\n return res;\n}\n\n/** The sides of the tree whose column is folded to a rail at the stage's edge (closed by hand, or at a narrow start). */\nexport const treeRails = (s: DeskState): { readonly left: boolean; readonly right: boolean } => ({\n left: s.closed.includes(\"left\") && s.tree.L.length > 0,\n right: s.closed.includes(\"right\") && s.tree.R.length > 0,\n});\n\n/** The area the tree tiles: the stage under the bar, less the rails of folded columns. */\nexport const treeArea = (size: Size, s?: DeskState): Rect => {\n const r = s ? treeRails(s) : { left: false, right: false };\n const x0 = r.left ? RAIL + G : G;\n const x1 = size.width - (r.right ? RAIL + G : G);\n return rect(x0, BAR + G, x1 - x0, size.height - BAR - 2 * G);\n};\n\n/** The tree as tiled: a column folded to its rail tiles nothing. */\nexport const treeShown = (s: DeskState): DeskState[\"tree\"] => {\n const r = treeRails(s);\n return { L: r.left ? [] : s.tree.L, R: r.right ? [] : s.tree.R, C: s.tree.C };\n};\n\n/** Which tiles float: the newest tile that breaks a minimum floats, then the tree is laid out again. */\nexport function treeFloats(cat: Catalog, tree: DeskState[\"tree\"], area: Rect): { tree: DeskState[\"tree\"]; floats: string[] } {\n const only = (kept: readonly string[]): DeskState[\"tree\"] => ({ L: tree.L.filter((k) => kept.includes(k)), R: tree.R.filter((k) => kept.includes(k)), C: tree.C.filter((k) => kept.includes(k)) });\n const { kept, floats } = giveWay(\n [...tree.L, ...tree.R, ...tree.C],\n (k) => treeTiles(cat, only(k), area),\n (k) => tileMin(cat, k),\n cat.born,\n );\n return { tree: only(kept), floats };\n}\n\n// --- tabbed sides --------------------------------------------------------------------------------------------------\n\n/**\n * One side with tabs: the tab row on top, the active panel under it, the others hidden behind it. `float` puts\n * them over the documents (a drawer that slides over).\n */\nexport function tabbed(out: Out, side: Side, ids: readonly number[], active: number | null, x: number, y: number, w: number, h: number, float: boolean): void {\n const shown = active !== null && ids.includes(active) ? active : (ids[0] ?? null);\n out.set(`tabs:${side}`, { rect: rect(x, y, w, TABS), look: \"tabs\", layer: float ? LAYER.float : LAYER.dock, tabs: ids, active: shown, ...(float ? { shadow: true } : {}) });\n for (const id of ids) {\n const r = rect(x, y + TABS, w, h - TABS);\n out.set(panelKey(id), { rect: r, look: \"bare\", layer: float ? LAYER.float : LAYER.dock, ...(id === shown ? {} : { hidden: true }), ...(float ? { shadow: true } : {}) });\n }\n}\n\n/** A side folded to its rail: the tab row and the panels hidden into it. */\nexport function tabbedIntoRail(cat: Catalog, out: Out, side: Side, ids: readonly number[], x: number, y: number, w: number): void {\n out.set(`tabs:${side}`, { rect: rect(side === \"left\" ? x : x + RAIL - w, y, w, TABS), look: \"tabs\", layer: LAYER.dock, tabs: ids, active: null, hidden: true });\n intoRail(cat, out, x, y, w, ids, side);\n}\n\n/** Below these widths a drawer slides over the documents instead of pushing them. */\nexport const DRAWER_DOCK = { left: 760, right: 1040 } as const;\n\n// --- the scrolling strip -------------------------------------------------------------------------------------------\n\nconst STRIP_PANEL_W = 180;\nconst stripDocW =(W: number): number => Math.max(360, Math.min(520, W * 0.5));\nexport const stripMin = (cat: Catalog, k: string): number => (isDocKey(k) ? DOC_MIN.height : cat.natural(idOf(k)));\n\n/** The strip's columns as laid out: a column whose minimums don't fit the height splits in two, recursively. */\nexport function stripColumns(cat: Catalog, cols: readonly (readonly string[])[], h: number, notes: Note[] = []): string[][] {\n const split = (keys: readonly string[]): string[][] => {\n const need = keys.reduce((sum, k) => sum + stripMin(cat, k), 0) + G * (keys.length - 1);\n if (need <= h || keys.length === 1) return [[...keys]];\n const half = Math.ceil(keys.length / 2);\n notes.push({ code: \"column-split\", items: [...keys], text: `${keys.map(cat.title).join(\" + \")} split into two columns` });\n return [...split(keys.slice(0, half)), ...split(keys.slice(half))];\n };\n return cols.flatMap(split);\n}\n\nexport interface StripGeometry {\n readonly cols: string[][];\n /** Each column's left edge on the stage (scroll applied) and width. */\n readonly xs: number[];\n readonly widths: number[];\n readonly y: number;\n readonly h: number;\n /** The whole strip's width, and how far it is scrolled. */\n readonly total: number;\n readonly scroll: number;\n}\n\n/** The strip's columns and scroll: scrolled by hand, else to centre the focused document's column. */\nexport function stripGeometry(cat: Catalog, s: DeskState, size: Size, notes: Note[] = []): StripGeometry {\n const { width: W, height: H } = size;\n const y = BAR + G;\n const h = H - BAR - 2 * G;\n const cols = stripColumns(cat, s.cols, h, notes);\n const widths = cols.map((c) => (c.some(isDocKey) ? stripDocW(W) : STRIP_PANEL_W));\n const total = widths.reduce((a, b) => a + b, 0) + G * (cols.length + 1);\n const want = s.focus !== null ? docKey(s.focus) : null;\n let fi = cols.findIndex((c) => want !== null && c.includes(want));\n if (fi < 0) fi = cols.findIndex((c) => c.some(isDocKey));\n const xsAbs: number[] = [];\n let x = G;\n for (const w of widths) {\n xsAbs.push(x);\n x += w + G;\n }\n const focusX = fi >= 0 ? xsAbs[fi]! + widths[fi]! / 2 : 0;\n const scroll = Math.max(0, Math.min(total - W, s.stripScroll ?? focusX - W / 2));\n return { cols, xs: xsAbs.map((v) => v - scroll), widths, y, h, total, scroll };\n}\n\n// --- floating palettes ---------------------------------------------------------------------------------------------\n\nexport const paletteWidth = (W: number): number => Math.min(200, Math.max(140, W * 0.22));\n/** Narrower than this, both stacks share the right corner. */\nexport const PALETTE_NARROW = 640;\n/** The margin palettes keep from the area's edges when they float over the documents. */\nexport const OVER_MARGIN = 14;\n\n/**\n * Palettes at their natural size, stacked in the top corners of `area` (`m` in from its edges), and the free ones\n * where they were put; a stack too tall for the area shades its least recently used palettes to their title bars.\n */\nexport function palettes(cat: Catalog, s: DeskState, area: Rect, W: number, m: number, notes: Note[] = []): Map<number, { rect: Rect; shaded: boolean }> {\n const pw = paletteWidth(W);\n const avail = area.height - 2 * m;\n const narrow = W < PALETTE_NARROW;\n const stacks = narrow ? [[...s.stacks.left, ...s.stacks.right]] : [s.stacks.left, s.stacks.right];\n if (narrow && s.stacks.left.length && s.stacks.right.length) notes.push({ code: \"stacks-merged\", text: \"both stacks share the right corner\" });\n const out = new Map<number, { rect: Rect; shaded: boolean }>();\n let shaded = 0;\n stacks.forEach((ids, si) => {\n const folded = lruFold(s, ids, avail, cat.natural, TITLE, false);\n shaded += folded.filter((id) => !s.folded.includes(id)).length;\n const x = narrow || si === 1 ? area.x + area.width - m - pw : area.x + m;\n let y = area.y + m;\n for (const id of ids) {\n const h = folded.includes(id) ? TITLE : cat.natural(id);\n out.set(id, { rect: rect(x, y, pw, h), shaded: folded.includes(id) });\n y += h + G;\n }\n });\n for (const f of s.free) {\n const shade = s.folded.includes(f.id);\n const at = f.at ?? { x: area.x + m, y: area.y + m };\n out.set(f.id, { rect: clampInto(rect(at.x, at.y, pw, shade ? TITLE : cat.natural(f.id)), area), shaded: shade });\n }\n if (shaded) notes.push({ code: \"palettes-shaded\", text: `${plural(shaded, \"palette\", \"palettes\")} shaded to ${shaded > 1 ? \"title bars\" : \"a title bar\"}` });\n return out;\n}\n\n/** The stage area palettes and documents share (below or above the pill when it keeps its band). */\nexport function paletteArea(size: Size, opt: Options): { area: Rect } {\n const p = pill(opt, G, size.width - 2 * G, 0, size.height);\n return { area: rect(G, p.top, size.width - 2 * G, p.bottom - p.top) };\n}\n\n/**\n * A floating pill among palettes: in a stretch of its band that no palette crosses, so it never covers one. Of the\n * stretches wide enough for a full-width pill (its minimum plus margins), the one nearest the centre; with none, the\n * widest, the pill shrunk to fit it.\n */\nexport function pillBetween(opt: Options, size: Size, blocks: readonly Rect[]): Placed {\n const band = pill(opt, G, size.width - 2 * G, 0, size.height).placed.rect;\n const spans = blocks\n .filter((r) => r.y < band.y + band.height && r.y + r.height > band.y)\n .map((r) => [r.x - G, r.x + r.width + G] as const)\n .sort((a, b) => a[0] - b[0]);\n const stretches: [number, number][] = [];\n let x = G;\n for (const [b0, b1] of spans) {\n if (b0 > x) stretches.push([x, b0]);\n x = Math.max(x, b1);\n }\n if (size.width - G > x) stretches.push([x, size.width - G]);\n const roomy = stretches.filter(([a, b]) => b - a >= PILL_MIN + 24);\n const mid = size.width / 2;\n const pick =\n roomy.sort((p, q) => Math.abs((p[0] + p[1]) / 2 - mid) - Math.abs((q[0] + q[1]) / 2 - mid))[0] ??\n stretches.sort((p, q) => q[1] - q[0] - (p[1] - p[0]))[0] ??\n ([G, G] as [number, number]);\n const placed = pill(opt, pick[0], pick[1] - pick[0], 0, size.height).placed;\n const room = pick[1] - pick[0];\n // Too little room for even the shortest pill: it shrinks to the room rather than cover a palette.\n return placed.rect.width <= room ? placed : { ...placed, rect: { ...placed.rect, x: pick[0], width: Math.max(0, room) } };\n}\n\n/** The documents' band between the palettes on the left half and those on the right half. */\nexport function aroundDocs(pals: ReadonlyMap<number, { rect: Rect }>, area: Rect): Rect {\n const mid = area.x + area.width / 2;\n const rects = [...pals.values()].map((p) => p.rect);\n const left = rects.filter((r) => r.x + r.width / 2 < mid);\n const right = rects.filter((r) => r.x + r.width / 2 >= mid);\n const x0 = left.length ? Math.max(...left.map((r) => r.x + r.width)) + G : area.x;\n const x1 = right.length ? Math.min(...right.map((r) => r.x)) - G : area.x + area.width;\n return rect(x0, area.y, Math.max(0, x1 - x0), area.height);\n}\n"],"mappings":";;;;;;AAUO,IAAM,IAAI;AAEV,IAAM,MAAM;AAEZ,IAAM,OAAO;AAEb,IAAM,QAAQ;AAEd,IAAM,OAAO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AAI,EAAE,KAAK,CAAC,IAAI,IAAI,KAAK;AAChF,QAAM,KAAK,MAAM,SAAS,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,IAAI,KAAK,IAAI,KAAK;AACjF,SAAO,KAAK,IAAI,KAAK,GAAG,KAAK,IAAI,GAAG,KAAK,EAAE,GAAG,KAAK,MAAM;AAC3D;","names":["kept"]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
COLUMN_REACH,
|
|
3
|
+
RAIL_EDGE,
|
|
4
|
+
clamp,
|
|
2
5
|
rect
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WM5FJ3IS.js";
|
|
4
7
|
|
|
5
8
|
// src/panels/model.ts
|
|
6
9
|
var SIDES = ["left", "right"];
|
|
@@ -245,7 +248,6 @@ function samePlaces(a, b, defs) {
|
|
|
245
248
|
}
|
|
246
249
|
|
|
247
250
|
// src/panels/layout.ts
|
|
248
|
-
var clamp = (v, lo, hi) => Math.min(Math.max(v, lo), Math.max(lo, hi));
|
|
249
251
|
function giveWayOrder(cols, order) {
|
|
250
252
|
return [...cols].sort((a, b) => Number(a.kept) - Number(b.kept) || (order === "oldest" ? a.age - b.age : b.age - a.age) || a.index - b.index || SIDES.indexOf(a.side) - SIDES.indexOf(b.side));
|
|
251
253
|
}
|
|
@@ -563,8 +565,6 @@ function layoutPanels(defs, state, stage, options = {}) {
|
|
|
563
565
|
}
|
|
564
566
|
|
|
565
567
|
// src/panels/targets.ts
|
|
566
|
-
var COLUMN_REACH = 22;
|
|
567
|
-
var RAIL_EDGE = 10;
|
|
568
568
|
function placeRank(place) {
|
|
569
569
|
switch (place.kind) {
|
|
570
570
|
case "float":
|
|
@@ -782,12 +782,10 @@ export {
|
|
|
782
782
|
samePlaces,
|
|
783
783
|
giveWayOrder,
|
|
784
784
|
layoutPanels,
|
|
785
|
-
COLUMN_REACH,
|
|
786
|
-
RAIL_EDGE,
|
|
787
785
|
placeRank,
|
|
788
786
|
homePlace,
|
|
789
787
|
panelTargets,
|
|
790
788
|
panelDrop,
|
|
791
789
|
panelStops
|
|
792
790
|
};
|
|
793
|
-
//# sourceMappingURL=chunk-
|
|
791
|
+
//# sourceMappingURL=chunk-7ASCUAGV.js.map
|