@n-uf/placement 26.11.53 → 26.11.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -1
- package/README.md +27 -58
- package/dist/{chunk-VLTYJHUA.js → chunk-2UVUFEBP.js} +4 -8
- package/dist/{chunk-VLTYJHUA.js.map → chunk-2UVUFEBP.js.map} +1 -1
- package/dist/{geometry-Bf37LbCT.d.ts → geometry-L5gCoiZV.d.ts} +2 -8
- package/dist/index.d.ts +64 -42
- package/dist/index.js +6 -66
- package/dist/index.js.map +1 -1
- package/dist/popup.d.ts +49 -0
- package/dist/popup.js +58 -0
- package/dist/popup.js.map +1 -0
- package/dist/stack.d.ts +529 -228
- package/dist/stack.js +701 -28
- package/dist/stack.js.map +1 -1
- package/dist/tiling.d.ts +48 -5
- package/dist/tiling.js +198 -19
- package/dist/tiling.js.map +1 -1
- package/package.json +9 -36
- package/dist/chunk-2GGJ4GVR.js +0 -9
- package/dist/chunk-2GGJ4GVR.js.map +0 -1
- package/dist/chunk-3ZICYLWL.js +0 -791
- package/dist/chunk-3ZICYLWL.js.map +0 -1
- package/dist/chunk-AE3BWTAE.js +0 -838
- package/dist/chunk-AE3BWTAE.js.map +0 -1
- package/dist/chunk-JVAR67OL.js +0 -172
- package/dist/chunk-JVAR67OL.js.map +0 -1
- package/dist/chunk-NF7RYK3U.js +0 -429
- package/dist/chunk-NF7RYK3U.js.map +0 -1
- package/dist/chunk-R3AAANRY.js +0 -220
- package/dist/chunk-R3AAANRY.js.map +0 -1
- package/dist/chunk-TWI644JK.js +0 -221
- package/dist/chunk-TWI644JK.js.map +0 -1
- package/dist/chunk-ZTH5FCUO.js +0 -4190
- package/dist/chunk-ZTH5FCUO.js.map +0 -1
- package/dist/constructions-Cbz7uEAZ.d.ts +0 -251
- package/dist/desk.d.ts +0 -51
- package/dist/desk.js +0 -111
- package/dist/desk.js.map +0 -1
- package/dist/dock.d.ts +0 -25
- package/dist/dock.js +0 -397
- package/dist/dock.js.map +0 -1
- package/dist/float-fit-DCYxRMru.d.ts +0 -37
- package/dist/lanes-DIwUqchd.d.ts +0 -1321
- package/dist/model-X7eUaKlA.d.ts +0 -337
- package/dist/panels.d.ts +0 -60
- package/dist/panels.js +0 -99
- package/dist/panels.js.map +0 -1
- package/dist/regions-Db_RyT4P.d.ts +0 -48
- package/dist/scene-cases.d.ts +0 -888
- package/dist/scene-cases.js +0 -3149
- package/dist/scene-cases.js.map +0 -1
- package/dist/scene.d.ts +0 -290
- package/dist/scene.js +0 -128
- package/dist/scene.js.map +0 -1
- package/dist/target-BBOCeez2.d.ts +0 -69
- package/dist/targets-C9ZVhmCl.d.ts +0 -621
- package/dist/targets.d.ts +0 -212
- package/dist/targets.js +0 -447
- package/dist/targets.js.map +0 -1
- package/dist/toolbar.d.ts +0 -167
- package/dist/toolbar.js +0 -55
- package/dist/toolbar.js.map +0 -1
package/dist/chunk-R3AAANRY.js
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
clamp
|
|
3
|
-
} from "./chunk-VLTYJHUA.js";
|
|
4
|
-
|
|
5
|
-
// src/tiling/order.ts
|
|
6
|
-
function masterStack(panes, area, options = {}) {
|
|
7
|
-
const gap = options.gap ?? 0;
|
|
8
|
-
const out = /* @__PURE__ */ new Map();
|
|
9
|
-
if (panes.length === 0) return out;
|
|
10
|
-
if (panes.length === 1) {
|
|
11
|
-
out.set(panes[0], { ...area });
|
|
12
|
-
return out;
|
|
13
|
-
}
|
|
14
|
-
const mw = (area.width - gap) * (options.ratio ?? 0.5);
|
|
15
|
-
out.set(panes[0], { x: area.x, y: area.y, width: mw, height: area.height });
|
|
16
|
-
const k = panes.length - 1;
|
|
17
|
-
const sh = (area.height - gap * (k - 1)) / k;
|
|
18
|
-
panes.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 }));
|
|
19
|
-
return out;
|
|
20
|
-
}
|
|
21
|
-
function columns(panes, area, options = {}) {
|
|
22
|
-
const gap = options.gap ?? 0;
|
|
23
|
-
const out = /* @__PURE__ */ new Map();
|
|
24
|
-
const n = panes.length;
|
|
25
|
-
const w = (area.width - gap * (n - 1)) / Math.max(1, n);
|
|
26
|
-
panes.forEach((id, i) => out.set(id, { x: area.x + i * (w + gap), y: area.y, width: w, height: area.height }));
|
|
27
|
-
return out;
|
|
28
|
-
}
|
|
29
|
-
function grid(panes, area, options = {}) {
|
|
30
|
-
const gap = options.gap ?? 0;
|
|
31
|
-
const out = /* @__PURE__ */ new Map();
|
|
32
|
-
const n = panes.length;
|
|
33
|
-
if (n === 0) return out;
|
|
34
|
-
const cols = Math.ceil(Math.sqrt(n));
|
|
35
|
-
const rows = Math.ceil(n / cols);
|
|
36
|
-
const h = (area.height - gap * (rows - 1)) / rows;
|
|
37
|
-
panes.forEach((id, i) => {
|
|
38
|
-
const row = Math.floor(i / cols);
|
|
39
|
-
const inRow = row === rows - 1 ? n - cols * (rows - 1) : cols;
|
|
40
|
-
const col = i - row * cols;
|
|
41
|
-
const w = (area.width - gap * (inRow - 1)) / inRow;
|
|
42
|
-
out.set(id, { x: area.x + col * (w + gap), y: area.y + row * (h + gap), width: w, height: h });
|
|
43
|
-
});
|
|
44
|
-
return out;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// src/tiling/split.ts
|
|
48
|
-
function layoutSplit(tree, area, options = {}) {
|
|
49
|
-
const out = /* @__PURE__ */ new Map();
|
|
50
|
-
lay(tree, area, Math.max(0, options.gap ?? 0), out);
|
|
51
|
-
return out;
|
|
52
|
-
}
|
|
53
|
-
function lay(tree, area, gap, out) {
|
|
54
|
-
if (!tree) return;
|
|
55
|
-
if ("pane" in tree) {
|
|
56
|
-
out.set(tree.pane, { ...area });
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const ratio = Math.min(1, Math.max(0, tree.ratio ?? 0.5));
|
|
60
|
-
if ((tree.axis ?? (area.width >= area.height ? "x" : "y")) === "x") {
|
|
61
|
-
const room = Math.max(0, area.width - gap);
|
|
62
|
-
const w = room * ratio;
|
|
63
|
-
lay(tree.a, { x: area.x, y: area.y, width: w, height: area.height }, gap, out);
|
|
64
|
-
const bx = room > 0 ? area.x + w + gap : area.x + Math.max(0, area.width);
|
|
65
|
-
lay(tree.b, { x: bx, y: area.y, width: room * (1 - ratio), height: area.height }, gap, out);
|
|
66
|
-
} else {
|
|
67
|
-
const room = Math.max(0, area.height - gap);
|
|
68
|
-
const h = room * ratio;
|
|
69
|
-
lay(tree.a, { x: area.x, y: area.y, width: area.width, height: h }, gap, out);
|
|
70
|
-
const by = room > 0 ? area.y + h + gap : area.y + Math.max(0, area.height);
|
|
71
|
-
lay(tree.b, { x: area.x, y: by, width: area.width, height: room * (1 - ratio) }, gap, out);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
var panesOf = (tree) => !tree ? [] : "pane" in tree ? [tree.pane] : [...panesOf(tree.a), ...panesOf(tree.b)];
|
|
75
|
-
var has = (tree, pane) => panesOf(tree).includes(pane);
|
|
76
|
-
function mapPanes(tree, fn) {
|
|
77
|
-
if ("pane" in tree) return fn(tree.pane);
|
|
78
|
-
return { ...tree, a: mapPanes(tree.a, fn), b: mapPanes(tree.b, fn) };
|
|
79
|
-
}
|
|
80
|
-
function splitPane(tree, at, pane, side) {
|
|
81
|
-
const fresh = { pane };
|
|
82
|
-
const split = (node) => {
|
|
83
|
-
if (!side) return { a: node, b: fresh };
|
|
84
|
-
const axis = side === "left" || side === "right" ? "x" : "y";
|
|
85
|
-
const first = side === "left" || side === "top";
|
|
86
|
-
return first ? { a: fresh, b: node, axis, ratio: 0.5 } : { a: node, b: fresh, axis, ratio: 0.5 };
|
|
87
|
-
};
|
|
88
|
-
if (!tree) return fresh;
|
|
89
|
-
if (at === null || !has(tree, at)) return split(tree);
|
|
90
|
-
return mapPanes(tree, (p) => p === at ? split({ pane: p }) : { pane: p });
|
|
91
|
-
}
|
|
92
|
-
function removePane(tree, pane) {
|
|
93
|
-
if (!tree) return null;
|
|
94
|
-
if ("pane" in tree) return tree.pane === pane ? null : tree;
|
|
95
|
-
const a = removePane(tree.a, pane);
|
|
96
|
-
const b = removePane(tree.b, pane);
|
|
97
|
-
return a && b ? { ...tree, a, b } : a ?? b;
|
|
98
|
-
}
|
|
99
|
-
function swapPanes(tree, x, y) {
|
|
100
|
-
if (!tree || !has(tree, x) || !has(tree, y)) return tree;
|
|
101
|
-
return mapPanes(tree, (p) => ({ pane: p === x ? y : p === y ? x : p }));
|
|
102
|
-
}
|
|
103
|
-
function splitFromOrder(panes) {
|
|
104
|
-
let t = null;
|
|
105
|
-
panes.forEach((id, i) => {
|
|
106
|
-
t = splitPane(t, i > 0 ? panes[i - 1] : null, id);
|
|
107
|
-
});
|
|
108
|
-
return t;
|
|
109
|
-
}
|
|
110
|
-
function dropOnPane(tree, dragged, at, region) {
|
|
111
|
-
if (!tree) return { pane: dragged };
|
|
112
|
-
if (dragged === at || !has(tree, at)) return has(tree, dragged) ? tree : splitPane(tree, null, dragged);
|
|
113
|
-
if (region !== "center") return splitPane(removePane(tree, dragged), at, dragged, region);
|
|
114
|
-
if (has(tree, dragged)) return swapPanes(tree, dragged, at);
|
|
115
|
-
return mapPanes(tree, (p) => p === at ? { a: { pane: dragged }, b: { pane: p } } : { pane: p });
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// src/tiling/regions.ts
|
|
119
|
-
var PANE_SIDES = ["top", "right", "bottom", "left"];
|
|
120
|
-
var PANE_REGION_DEFAULTS = { center: 0.34, centerMin: 24, hysteresis: 6, pixelRatio: 1 };
|
|
121
|
-
var snap = (v, ratio) => Math.round(v * ratio) / ratio;
|
|
122
|
-
function paneCenter(size, options = {}) {
|
|
123
|
-
const o = { ...PANE_REGION_DEFAULTS, ...options };
|
|
124
|
-
const width = Math.max(0, size.width);
|
|
125
|
-
const height = Math.max(0, size.height);
|
|
126
|
-
const ratio = o.pixelRatio > 0 ? o.pixelRatio : 1;
|
|
127
|
-
const rx = clamp(o.centerX ?? o.center, 0.05, 0.95);
|
|
128
|
-
const ry = clamp(o.centerY ?? o.center, 0.05, 0.95);
|
|
129
|
-
const cw = Math.min(width, Math.max(width * rx, Math.min(o.centerMin, width)));
|
|
130
|
-
const ch = Math.min(height, Math.max(height * ry, Math.min(o.centerMin, height)));
|
|
131
|
-
return { width, height, left: snap((width - cw) / 2, ratio), top: snap((height - ch) / 2, ratio), right: snap((width + cw) / 2, ratio), bottom: snap((height + ch) / 2, ratio) };
|
|
132
|
-
}
|
|
133
|
-
function depths(p, c) {
|
|
134
|
-
return [
|
|
135
|
-
{ side: "top", depth: (c.top - p.y) / Math.max(c.top, 1) },
|
|
136
|
-
{ side: "right", depth: (p.x - c.right) / Math.max(c.width - c.right, 1) },
|
|
137
|
-
{ side: "bottom", depth: (p.y - c.bottom) / Math.max(c.height - c.bottom, 1) },
|
|
138
|
-
{ side: "left", depth: (c.left - p.x) / Math.max(c.left, 1) }
|
|
139
|
-
];
|
|
140
|
-
}
|
|
141
|
-
function rawRegion(p, c) {
|
|
142
|
-
if (p.x >= c.left && p.x <= c.right && p.y >= c.top && p.y <= c.bottom) return "center";
|
|
143
|
-
let best = "center";
|
|
144
|
-
let deepest = 0;
|
|
145
|
-
for (const d of depths(p, c)) {
|
|
146
|
-
if (d.depth > deepest) {
|
|
147
|
-
deepest = d.depth;
|
|
148
|
-
best = d.side;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return best;
|
|
152
|
-
}
|
|
153
|
-
function toward(p, region, by, c) {
|
|
154
|
-
if (region === "left") return { x: p.x - by, y: p.y };
|
|
155
|
-
if (region === "right") return { x: p.x + by, y: p.y };
|
|
156
|
-
if (region === "top") return { x: p.x, y: p.y - by };
|
|
157
|
-
if (region === "bottom") return { x: p.x, y: p.y + by };
|
|
158
|
-
const dx = c.width / 2 - p.x;
|
|
159
|
-
const dy = c.height / 2 - p.y;
|
|
160
|
-
const len = Math.hypot(dx, dy);
|
|
161
|
-
if (len <= by || len === 0) return { x: c.width / 2, y: c.height / 2 };
|
|
162
|
-
return { x: p.x + dx / len * by, y: p.y + dy / len * by };
|
|
163
|
-
}
|
|
164
|
-
function paneRegion(pane, point, previous = null, options = {}) {
|
|
165
|
-
const c = paneCenter(pane, options);
|
|
166
|
-
const p = { x: point.x - pane.x, y: point.y - pane.y };
|
|
167
|
-
const raw = rawRegion(p, c);
|
|
168
|
-
const by = Math.max(0, options.hysteresis ?? PANE_REGION_DEFAULTS.hysteresis);
|
|
169
|
-
if (previous === null || by === 0 || previous === raw) return raw;
|
|
170
|
-
return rawRegion(toward(p, previous, by, c), c) === previous ? previous : raw;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// src/tiling/targets.ts
|
|
174
|
-
var tilingTarget = (id, hit, slot) => ({ id, priority: 2, hit, ...slot ? { slot } : {} });
|
|
175
|
-
function paneTargets(layout, options = {}) {
|
|
176
|
-
const key = options.key ?? String;
|
|
177
|
-
return [...layout].filter(([k]) => k !== options.except).map(([pane, r]) => ({ ...tilingTarget(`pane:${key(pane)}`, r), pane }));
|
|
178
|
-
}
|
|
179
|
-
function orderTargets(arrange, panes, dragged, area, options) {
|
|
180
|
-
return Array.from({ length: panes.length + 1 }, (_, index) => {
|
|
181
|
-
const layout = arrange([...panes.slice(0, index), dragged, ...panes.slice(index)], area, options);
|
|
182
|
-
const slot = layout.get(dragged);
|
|
183
|
-
return { ...tilingTarget(`at:${index}`, slot, slot), index, layout };
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// src/tiling/give-way.ts
|
|
188
|
-
function giveWay(panes, layout, min, age) {
|
|
189
|
-
let kept = [...panes];
|
|
190
|
-
const floats = [];
|
|
191
|
-
for (; ; ) {
|
|
192
|
-
const res = layout(kept);
|
|
193
|
-
const broken = [...res].some(([k, r]) => r.width < min(k).width - 0.5 || r.height < min(k).height - 0.5);
|
|
194
|
-
if (!broken || kept.length <= 1) return { kept, floats };
|
|
195
|
-
const newest = kept.reduce((a, b) => age(b) > age(a) ? b : a);
|
|
196
|
-
kept = kept.filter((k) => k !== newest);
|
|
197
|
-
floats.push(newest);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
export {
|
|
202
|
-
masterStack,
|
|
203
|
-
columns,
|
|
204
|
-
grid,
|
|
205
|
-
layoutSplit,
|
|
206
|
-
panesOf,
|
|
207
|
-
splitPane,
|
|
208
|
-
removePane,
|
|
209
|
-
swapPanes,
|
|
210
|
-
splitFromOrder,
|
|
211
|
-
dropOnPane,
|
|
212
|
-
PANE_SIDES,
|
|
213
|
-
PANE_REGION_DEFAULTS,
|
|
214
|
-
paneCenter,
|
|
215
|
-
paneRegion,
|
|
216
|
-
paneTargets,
|
|
217
|
-
orderTargets,
|
|
218
|
-
giveWay
|
|
219
|
-
};
|
|
220
|
-
//# sourceMappingURL=chunk-R3AAANRY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tiling/order.ts","../src/tiling/split.ts","../src/tiling/regions.ts","../src/tiling/targets.ts","../src/tiling/give-way.ts"],"sourcesContent":["/**\n * The order layouts: panes in order and an area in, a rect per pane out. Pure rect functions; a drop on one reorders\n * (the dragged pane inserted at an index, see `orderTargets`).\n */\nimport type { Rect } from \"../geometry\";\n\n/** How a layout spaces its panes: `gap` px between neighbors (default 0), `ratio` the master's share (default 0.5). */\nexport interface TileOptions {\n readonly gap?: number;\n readonly ratio?: number;\n}\n\n/** An order layout: `masterStack`, `columns`, `grid`, or the app's own of the same shape. */\nexport type OrderLayout = <K>(panes: readonly K[], area: Rect, options?: TileOptions) => Map<K, Rect>;\n\n/**\n * Master and stack: the first pane takes the left part (`ratio` of the width less the gap), the rest stack on the\n * right in equal rows. One pane takes the whole area.\n */\nexport function masterStack<K>(panes: readonly K[], area: Rect, options: TileOptions = {}): Map<K, Rect> {\n const gap = options.gap ?? 0;\n const out = new Map<K, Rect>();\n if (panes.length === 0) return out;\n if (panes.length === 1) {\n out.set(panes[0]!, { ...area });\n return out;\n }\n const mw = (area.width - gap) * (options.ratio ?? 0.5);\n out.set(panes[0]!, { x: area.x, y: area.y, width: mw, height: area.height });\n const k = panes.length - 1;\n const sh = (area.height - gap * (k - 1)) / k;\n panes.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/** Equal columns, full height. */\nexport function columns<K>(panes: readonly K[], area: Rect, options: TileOptions = {}): Map<K, Rect> {\n const gap = options.gap ?? 0;\n const out = new Map<K, Rect>();\n const n = panes.length;\n const w = (area.width - gap * (n - 1)) / Math.max(1, n);\n panes.forEach((id, i) => out.set(id, { x: area.x + i * (w + gap), y: area.y, width: w, height: area.height }));\n return out;\n}\n\n/** A grid as square as the count allows; the last row's cells widen to fill it. */\nexport function grid<K>(panes: readonly K[], area: Rect, options: TileOptions = {}): Map<K, Rect> {\n const gap = options.gap ?? 0;\n const out = new Map<K, Rect>();\n const n = panes.length;\n if (n === 0) return out;\n const cols = Math.ceil(Math.sqrt(n));\n const rows = Math.ceil(n / cols);\n const h = (area.height - gap * (rows - 1)) / rows;\n panes.forEach((id, i) => {\n const row = Math.floor(i / cols);\n const inRow = row === rows - 1 ? n - cols * (rows - 1) : cols;\n const col = i - row * cols;\n const w = (area.width - gap * (inRow - 1)) / inRow;\n out.set(id, { x: area.x + col * (w + gap), y: area.y + row * (h + gap), width: w, height: h });\n });\n return out;\n}\n","/**\n * The split tree: how panes divide an area. A node is a pane, or a split of its rect in two (`a` then `b`). A split\n * with an `axis` divides along it (`\"x\"`: `a` left of `b`; `\"y\"`: `a` above `b`) at `ratio`; one without divides\n * along the rect's longer side in halves, which is dwindle (split along the longer side). Pure: trees in, trees out.\n */\nimport type { Rect } from \"../geometry\";\nimport type { TileOptions } from \"./order\";\nimport type { PaneRegion, PaneSide } from \"./regions\";\n\nexport type Split<K> =\n | { readonly pane: K }\n | { readonly a: Split<K>; readonly b: Split<K>; readonly axis?: \"x\" | \"y\"; readonly ratio?: number };\n\n/**\n * The rect of every pane of `tree` in `area`, `gap` px between the two sides of each split. A split's `ratio` is\n * clamped to 0..1; each side gets its share of the room the gap leaves (none when the gap is wider than the rect), so\n * no size is ever negative, and at ratio 0.5 both sides are exactly equal. A split with no room lays both sides at no\n * size inside its rect: the first at its start, the second at its end, never past it.\n */\nexport function layoutSplit<K>(tree: Split<K> | null, area: Rect, options: TileOptions = {}): Map<K, Rect> {\n const out = new Map<K, Rect>();\n lay(tree, area, Math.max(0, options.gap ?? 0), out);\n return out;\n}\n\nfunction lay<K>(tree: Split<K> | null, area: Rect, gap: number, out: Map<K, Rect>): void {\n if (!tree) return;\n if (\"pane\" in tree) {\n out.set(tree.pane, { ...area });\n return;\n }\n const ratio = Math.min(1, Math.max(0, tree.ratio ?? 0.5));\n if ((tree.axis ?? (area.width >= area.height ? \"x\" : \"y\")) === \"x\") {\n const room = Math.max(0, area.width - gap);\n const w = room * ratio;\n lay(tree.a, { x: area.x, y: area.y, width: w, height: area.height }, gap, out);\n // With no room, the second side sits at the rect's end, not a gap past its start.\n const bx = room > 0 ? area.x + w + gap : area.x + Math.max(0, area.width);\n lay(tree.b, { x: bx, y: area.y, width: room * (1 - ratio), height: area.height }, gap, out);\n } else {\n const room = Math.max(0, area.height - gap);\n const h = room * ratio;\n lay(tree.a, { x: area.x, y: area.y, width: area.width, height: h }, gap, out);\n const by = room > 0 ? area.y + h + gap : area.y + Math.max(0, area.height);\n lay(tree.b, { x: area.x, y: by, width: area.width, height: room * (1 - ratio) }, gap, out);\n }\n}\n\n/** The panes of `tree` in order (`a` before `b`). */\nexport const panesOf = <K>(tree: Split<K> | null): K[] => (!tree ? [] : \"pane\" in tree ? [tree.pane] : [...panesOf(tree.a), ...panesOf(tree.b)]);\n\nconst has = <K>(tree: Split<K> | null, pane: K): boolean => panesOf(tree).includes(pane);\n\n/** `tree` with each pane node `fn` gives a replacement for replaced. */\nfunction mapPanes<K>(tree: Split<K>, fn: (pane: K) => Split<K>): Split<K> {\n if (\"pane\" in tree) return fn(tree.pane);\n return { ...tree, a: mapPanes(tree.a, fn), b: mapPanes(tree.b, fn) };\n}\n\n/**\n * `tree` with pane `at` split in two, `pane` on its `side`. A side writes an explicit axis and ratio 0.5, so the side\n * means the same whatever the pane's shape; no side splits along the longer side, `pane` second (dwindle). An empty\n * tree becomes `pane` alone; an `at` that isn't in the tree (or null) splits the whole tree, so no pane is lost.\n */\nexport function splitPane<K>(tree: Split<K> | null, at: K | null, pane: K, side?: PaneSide): Split<K> {\n const fresh: Split<K> = { pane };\n const split = (node: Split<K>): Split<K> => {\n if (!side) return { a: node, b: fresh };\n const axis = side === \"left\" || side === \"right\" ? \"x\" : \"y\";\n const first = side === \"left\" || side === \"top\";\n return first ? { a: fresh, b: node, axis, ratio: 0.5 } : { a: node, b: fresh, axis, ratio: 0.5 };\n };\n if (!tree) return fresh;\n if (at === null || !has(tree, at)) return split(tree);\n return mapPanes(tree, (p) => (p === at ? split({ pane: p }) : { pane: p }));\n}\n\n/** `tree` without `pane`: its sibling takes their parent's place. */\nexport function removePane<K>(tree: Split<K> | null, pane: K): Split<K> | null {\n if (!tree) return null;\n if (\"pane\" in tree) return tree.pane === pane ? null : tree;\n const a = removePane(tree.a, pane);\n const b = removePane(tree.b, pane);\n return a && b ? { ...tree, a, b } : (a ?? b);\n}\n\n/** `tree` with panes `x` and `y` in each other's place; unchanged unless both are in it. */\nexport function swapPanes<K>(tree: Split<K> | null, x: K, y: K): Split<K> | null {\n if (!tree || !has(tree, x) || !has(tree, y)) return tree;\n return mapPanes(tree, (p) => ({ pane: p === x ? y : p === y ? x : p }));\n}\n\n/** A dwindle tree for `panes`: each one splits the one before it along the longer side. */\nexport function splitFromOrder<K>(panes: readonly K[]): Split<K> | null {\n let t: Split<K> | null = null;\n panes.forEach((id, i) => {\n t = splitPane(t, i > 0 ? panes[i - 1]! : null, id);\n });\n return t;\n}\n\n/**\n * A drop of `dragged` on pane `at`'s `region`. A side splits `at` on that side (`dragged` taken out of its old place\n * first). The center swaps the two when `dragged` is in the tree; a pane from outside takes `at`'s place, with `at`\n * split off after it along the longer side. An `at` that isn't in the tree (or is `dragged` itself) changes nothing\n * but adding `dragged` when it is missing, as `splitPane` does. The set of panes is kept: the tree's, plus `dragged`.\n */\nexport function dropOnPane<K>(tree: Split<K> | null, dragged: K, at: K, region: PaneRegion): Split<K> {\n if (!tree) return { pane: dragged };\n if (dragged === at || !has(tree, at)) return has(tree, dragged) ? tree : splitPane(tree, null, dragged);\n if (region !== \"center\") return splitPane(removePane(tree, dragged), at, dragged, region);\n if (has(tree, dragged)) return swapPanes(tree, dragged, at)!;\n return mapPanes(tree, (p) => (p === at ? { a: { pane: dragged }, b: { pane: p } } : { pane: p }));\n}\n","/**\n * A pane's drop regions: a center rectangle (a drop there swaps with the pane) and four side trapezoids (a drop there\n * splits the pane on that side), formed by the diagonals from each pane corner to the nearest corner of the center.\n * The five regions cover the pane with no gaps and no overlaps.\n *\n * Meant for `@n-uf/motion/drag`'s `placeOf(target, point, previous)`: one target per pane (`paneTargets`), its place\n * the region under the pointer, the previous region held for `hysteresis` px past its boundary so a pointer resting on\n * a boundary doesn't flicker. A region that takes no drop is the consumer's to answer with a null place.\n */\nimport { clamp, type Point, type Rect, type Size } from \"../geometry\";\n\nexport type PaneSide = \"top\" | \"right\" | \"bottom\" | \"left\";\nexport type PaneRegion = \"center\" | PaneSide;\n\n/** The sides in their tie-break order: at an exact diagonal the first wins (a corner resolves to `top`). */\nexport const PANE_SIDES: readonly PaneSide[] = [\"top\", \"right\", \"bottom\", \"left\"];\n\nexport interface PaneRegionOptions {\n /** The center rectangle's share of each pane axis (0.05 to 0.95); `centerX` / `centerY` override one axis. */\n readonly center?: number;\n readonly centerX?: number;\n readonly centerY?: number;\n /** The least the center spans on either axis, px (a small pane keeps a usable center). */\n readonly centerMin?: number;\n /** How far past its boundary the previous region holds, px. */\n readonly hysteresis?: number;\n /** Device pixels per px: the center's edges snap to that grid, as the browser draws them. */\n readonly pixelRatio?: number;\n}\n\nexport const PANE_REGION_DEFAULTS: Required<Omit<PaneRegionOptions, \"centerX\" | \"centerY\">> = { center: 0.34, centerMin: 24, hysteresis: 6, pixelRatio: 1 };\n\n/** The center rectangle of a pane of `size`, in pane-local px (origin at the pane's top-left corner). */\nexport interface PaneCenter {\n readonly width: number;\n readonly height: number;\n readonly left: number;\n readonly top: number;\n readonly right: number;\n readonly bottom: number;\n}\n\nconst snap = (v: number, ratio: number): number => Math.round(v * ratio) / ratio;\n\n/** Where the center rectangle of a pane of `size` lies, by these options. */\nexport function paneCenter(size: Size, options: PaneRegionOptions = {}): PaneCenter {\n const o = { ...PANE_REGION_DEFAULTS, ...options };\n const width = Math.max(0, size.width);\n const height = Math.max(0, size.height);\n const ratio = o.pixelRatio > 0 ? o.pixelRatio : 1;\n const rx = clamp(o.centerX ?? o.center, 0.05, 0.95);\n const ry = clamp(o.centerY ?? o.center, 0.05, 0.95);\n const cw = Math.min(width, Math.max(width * rx, Math.min(o.centerMin, width)));\n const ch = Math.min(height, Math.max(height * ry, Math.min(o.centerMin, height)));\n return { width, height, left: snap((width - cw) / 2, ratio), top: snap((height - ch) / 2, ratio), right: snap((width + cw) / 2, ratio), bottom: snap((height + ch) / 2, ratio) };\n}\n\n/** How deep past the center a point is toward each side, as a share of that side's band (positive: in that band). */\nfunction depths(p: Point, c: PaneCenter): { side: PaneSide; depth: number }[] {\n return [\n { side: \"top\", depth: (c.top - p.y) / Math.max(c.top, 1) },\n { side: \"right\", depth: (p.x - c.right) / Math.max(c.width - c.right, 1) },\n { side: \"bottom\", depth: (p.y - c.bottom) / Math.max(c.height - c.bottom, 1) },\n { side: \"left\", depth: (c.left - p.x) / Math.max(c.left, 1) },\n ];\n}\n\n/** The region a pane-local point is in, by position alone. */\nfunction rawRegion(p: Point, c: PaneCenter): PaneRegion {\n if (p.x >= c.left && p.x <= c.right && p.y >= c.top && p.y <= c.bottom) return \"center\";\n let best: PaneRegion = \"center\";\n let deepest = 0;\n for (const d of depths(p, c)) {\n if (d.depth > deepest) {\n deepest = d.depth;\n best = d.side;\n }\n }\n return best;\n}\n\n/** `p` moved `by` px into `region` (toward the pane's middle for the center). */\nfunction toward(p: Point, region: PaneRegion, by: number, c: PaneCenter): Point {\n if (region === \"left\") return { x: p.x - by, y: p.y };\n if (region === \"right\") return { x: p.x + by, y: p.y };\n if (region === \"top\") return { x: p.x, y: p.y - by };\n if (region === \"bottom\") return { x: p.x, y: p.y + by };\n const dx = c.width / 2 - p.x;\n const dy = c.height / 2 - p.y;\n const len = Math.hypot(dx, dy);\n if (len <= by || len === 0) return { x: c.width / 2, y: c.height / 2 };\n return { x: p.x + (dx / len) * by, y: p.y + (dy / len) * by };\n}\n\n/**\n * The drop region of `pane` (in the same coordinates as `point`) the point is in. With a `previous` region, the point\n * has to be `hysteresis` px past that region's boundary before the region changes: no time-based debounce, only\n * geometry.\n */\nexport function paneRegion(pane: Rect, point: Point, previous: PaneRegion | null = null, options: PaneRegionOptions = {}): PaneRegion {\n const c = paneCenter(pane, options);\n const p = { x: point.x - pane.x, y: point.y - pane.y };\n const raw = rawRegion(p, c);\n const by = Math.max(0, options.hysteresis ?? PANE_REGION_DEFAULTS.hysteresis);\n if (previous === null || by === 0 || previous === raw) return raw;\n return rawRegion(toward(p, previous, by, c), c) === previous ? previous : raw;\n}\n","/**\n * Drop targets for tiling, in the root `Target` shape (what `@n-uf/motion/drag` takes). Both kinds come from one\n * helper: a pane target (`pane:<id>`, its hit the pane, the place in it its drop region) for the split tree, and an\n * insertion target (`at:<index>`, its hit and slot the dragged pane's rect with it inserted there) for an order layout.\n */\nimport type { Rect } from \"../geometry\";\nimport type { Target } from \"../target\";\nimport type { OrderLayout, TileOptions } from \"./order\";\n\n/** A split tree's target: drop on pane `pane` (the region under the pointer says how). */\nexport interface PaneTarget<K> extends Target {\n readonly pane: K;\n}\n\n/** An order layout's target: insert the dragged pane at `index`; `layout` is every pane's rect with it there. */\nexport interface OrderTarget<K> extends Target {\n readonly index: number;\n readonly layout: ReadonlyMap<K, Rect>;\n}\n\n/** The one shape both kinds share: a slot-sized drop with no precedence over any other. */\nconst tilingTarget = (id: string, hit: Rect, slot?: Rect): Target => ({ id, priority: 2, hit, ...(slot ? { slot } : {}) });\n\nexport interface PaneTargetsOptions<K> {\n /** A pane left out: the dragged one, when it is still laid out. */\n readonly except?: K;\n /**\n * A pane's key in its target's id (`pane:<key>`); default `String`. Keys must be unique across the panes: a drag\n * intent follows its targets by id, so two panes with one key would be one target.\n */\n readonly key?: (pane: K) => string;\n}\n\n/** One target per pane of `layout`, its id `pane:<key>`. */\nexport function paneTargets<K>(layout: ReadonlyMap<K, Rect>, options: PaneTargetsOptions<K> = {}): PaneTarget<K>[] {\n const key = options.key ?? String;\n return [...layout].filter(([k]) => k !== options.except).map(([pane, r]) => ({ ...tilingTarget(`pane:${key(pane)}`, r), pane }));\n}\n\n/**\n * One target per index `dragged` could be inserted at among `panes` (which don't hold it), laid out by `arrange` in\n * `area`. Each target's hit and slot is `dragged`'s rect with it there, so the targets cover the area as the layout\n * does. Ids are `at:<index>`, unique whatever the panes are.\n */\nexport function orderTargets<K>(arrange: OrderLayout, panes: readonly K[], dragged: K, area: Rect, options?: TileOptions): OrderTarget<K>[] {\n return Array.from({ length: panes.length + 1 }, (_, index) => {\n const layout = arrange([...panes.slice(0, index), dragged, ...panes.slice(index)], area, options);\n const slot = layout.get(dragged)!;\n return { ...tilingTarget(`at:${index}`, slot, slot), index, layout };\n });\n}\n","import type { Rect, Size } from \"../geometry\";\n\n/**\n * The minimum-size give-way: while a pane is laid out below its minimum, the newest pane (highest `age`) floats and\n * the rest are laid out again. Stops when every pane keeps its minimum or one pane is left. `layout` lays out the\n * kept panes; the result says which are kept (in their order) and which float (newest first).\n */\nexport function giveWay<K>(panes: readonly K[], layout: (kept: readonly K[]) => ReadonlyMap<K, Rect>, min: (pane: K) => Size, age: (pane: K) => number): { kept: K[]; floats: K[] } {\n let kept = [...panes];\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"],"mappings":";;;;;AAmBO,SAAS,YAAe,OAAqB,MAAY,UAAuB,CAAC,GAAiB;AACvG,QAAM,MAAM,QAAQ,OAAO;AAC3B,QAAM,MAAM,oBAAI,IAAa;AAC7B,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,MAAI,MAAM,WAAW,GAAG;AACtB,QAAI,IAAI,MAAM,CAAC,GAAI,EAAE,GAAG,KAAK,CAAC;AAC9B,WAAO;AAAA,EACT;AACA,QAAM,MAAM,KAAK,QAAQ,QAAQ,QAAQ,SAAS;AAClD,MAAI,IAAI,MAAM,CAAC,GAAI,EAAE,GAAG,KAAK,GAAG,GAAG,KAAK,GAAG,OAAO,IAAI,QAAQ,KAAK,OAAO,CAAC;AAC3E,QAAM,IAAI,MAAM,SAAS;AACzB,QAAM,MAAM,KAAK,SAAS,OAAO,IAAI,MAAM;AAC3C,QAAM,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,MAAM,IAAI,IAAI,IAAI,EAAE,GAAG,KAAK,IAAI,KAAK,KAAK,GAAG,KAAK,IAAI,KAAK,KAAK,MAAM,OAAO,KAAK,QAAQ,KAAK,KAAK,QAAQ,GAAG,CAAC,CAAC;AAC7I,SAAO;AACT;AAGO,SAAS,QAAW,OAAqB,MAAY,UAAuB,CAAC,GAAiB;AACnG,QAAM,MAAM,QAAQ,OAAO;AAC3B,QAAM,MAAM,oBAAI,IAAa;AAC7B,QAAM,IAAI,MAAM;AAChB,QAAM,KAAK,KAAK,QAAQ,OAAO,IAAI,MAAM,KAAK,IAAI,GAAG,CAAC;AACtD,QAAM,QAAQ,CA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AAI,IAAI,CAAE;AAC9D,WAAO,KAAK,OAAO,CAAC,MAAM,MAAM,MAAM;AACtC,WAAO,KAAK,MAAM;AAAA,EACpB;AACF;","names":[]}
|
package/dist/chunk-TWI644JK.js
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
// src/toolbar/index.ts
|
|
2
|
-
var HOSTS = ["title", "top", "bottom", "left", "right"];
|
|
3
|
-
var ZONES = ["start", "center", "end"];
|
|
4
|
-
var HOST_LABEL = { title: "Title bar", top: "Top bar", bottom: "Bottom bar", left: "Left edge", right: "Right edge" };
|
|
5
|
-
var zoneLabel = (h, z) => (vertical(h) ? { start: "top", center: "middle", end: "bottom" } : { start: "left", center: "centre", end: "right" })[z];
|
|
6
|
-
var vertical = (h) => h === "left" || h === "right";
|
|
7
|
-
var GAP = 12;
|
|
8
|
-
var ZONE_GAP = 16;
|
|
9
|
-
function arrangement(p) {
|
|
10
|
-
const z = (q = {}) => ({ start: [], center: [], end: [], ...q });
|
|
11
|
-
return { title: z(p.title), top: z(p.top), bottom: z(p.bottom), left: z(p.left), right: z(p.right), collapsed: [], floating: [] };
|
|
12
|
-
}
|
|
13
|
-
var mapHosts = (a, f) => ({
|
|
14
|
-
...a,
|
|
15
|
-
...Object.fromEntries(HOSTS.map((h) => [h, Object.fromEntries(ZONES.map((zn) => [zn, f(h, zn, a[h][zn])]))]))
|
|
16
|
-
});
|
|
17
|
-
function hostOf(a, g) {
|
|
18
|
-
for (const h of HOSTS) for (const zn of ZONES) if (a[h][zn].includes(g)) return { host: h, zone: zn, index: a[h][zn].indexOf(g) };
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
var withoutGroup = (a, g) => ({ ...mapHosts(a, (_h, _z, l) => l.filter((x) => x !== g)), floating: a.floating.filter((f) => f.id !== g) });
|
|
22
|
-
function insertGroup(a, g, h, zone, i) {
|
|
23
|
-
return mapHosts(withoutGroup(a, g), (hh, zz, l) => hh === h && zz === zone ? [...l.slice(0, i), g, ...l.slice(i)] : l);
|
|
24
|
-
}
|
|
25
|
-
function floatGroup(a, g, x, y) {
|
|
26
|
-
const from = hostOf(a, g) ?? a.floating.find((f) => f.id === g)?.from ?? null;
|
|
27
|
-
const out = withoutGroup(a, g);
|
|
28
|
-
return { ...out, floating: [...out.floating, { id: g, x, y, from }] };
|
|
29
|
-
}
|
|
30
|
-
var dockAt = (a, g, place) => insertGroup(a, g, place.host, place.zone, Math.min(place.index, a[place.host][place.zone].filter((x) => x !== g).length));
|
|
31
|
-
function dockGroup(a, g, home) {
|
|
32
|
-
const from = a.floating.find((f) => f.id === g)?.from ?? hostOf(home, g);
|
|
33
|
-
return from ? dockAt(a, g, from) : a;
|
|
34
|
-
}
|
|
35
|
-
function resetGroup(a, g, home) {
|
|
36
|
-
const place = hostOf(home, g);
|
|
37
|
-
const out = place ? dockAt(a, g, place) : a;
|
|
38
|
-
return { ...out, collapsed: out.collapsed.filter((x) => x !== g) };
|
|
39
|
-
}
|
|
40
|
-
function moveToHost(a, g, h) {
|
|
41
|
-
const rest = withoutGroup(a, g);
|
|
42
|
-
const zone = [...ZONES].reverse().find((zn) => rest[h][zn].length > 0) ?? "start";
|
|
43
|
-
return insertGroup(a, g, h, zone, rest[h][zone].length);
|
|
44
|
-
}
|
|
45
|
-
function moveBar(a, from, to) {
|
|
46
|
-
if (from === to) return a;
|
|
47
|
-
return mapHosts(a, (h, zn, l) => h === from ? [] : h === to ? [...l, ...a[from][zn]] : l);
|
|
48
|
-
}
|
|
49
|
-
var toggleCollapsed = (a, g) => ({ ...a, collapsed: a.collapsed.includes(g) ? a.collapsed.filter((x) => x !== g) : [...a.collapsed, g] });
|
|
50
|
-
var isEmptyHost = (a, h) => ZONES.every((zn) => a[h][zn].length === 0);
|
|
51
|
-
var samePlace = (a, b) => a === null || b === null ? a === b : a.host === b.host && a.zone === b.zone && a.index === b.index;
|
|
52
|
-
function sameArrangement(a, b) {
|
|
53
|
-
const sameList = (x, y) => x.length === y.length && x.every((g, i) => g === y[i]);
|
|
54
|
-
const sameSet = (x, y) => x.length === y.length && x.every((g) => y.includes(g)) && y.every((g) => x.includes(g));
|
|
55
|
-
if (!HOSTS.every((h) => ZONES.every((zn) => sameList(a[h][zn], b[h][zn])))) return false;
|
|
56
|
-
if (!sameSet(a.collapsed, b.collapsed)) return false;
|
|
57
|
-
if (!sameSet(a.floating.map((f) => f.id), b.floating.map((f) => f.id))) return false;
|
|
58
|
-
return a.floating.every((f) => {
|
|
59
|
-
const o = b.floating.find((x) => x.id === f.id);
|
|
60
|
-
return !!o && o.x === f.x && o.y === f.y && samePlace(o.from, f.from);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
var isOwnPlace = (a, g, place) => sameArrangement(insertGroup(a, g, place.host, place.zone, place.index), a);
|
|
64
|
-
function storeArrangement(a) {
|
|
65
|
-
const hosts = Object.fromEntries(HOSTS.map((h) => [h, Object.fromEntries(ZONES.map((zn) => [zn, [...a[h][zn]]]))]));
|
|
66
|
-
return { v: 1, hosts, collapsed: [...a.collapsed], floating: a.floating.map((f) => ({ id: f.id, x: f.x, y: f.y, from: f.from ? { ...f.from } : null })) };
|
|
67
|
-
}
|
|
68
|
-
function readArrangement(data, groups) {
|
|
69
|
-
const fail = (error) => ({ ok: false, error });
|
|
70
|
-
const isObject = (x) => typeof x === "object" && x !== null && !Array.isArray(x);
|
|
71
|
-
if (!isObject(data)) return fail("not an object");
|
|
72
|
-
if (data.v !== 1) return fail(`unknown version ${typeof data.v === "number" || typeof data.v === "string" ? String(data.v) : typeof data.v} (this reads version 1)`);
|
|
73
|
-
const seen = /* @__PURE__ */ new Set();
|
|
74
|
-
const ids = (x, where, placed) => {
|
|
75
|
-
if (!Array.isArray(x) || !x.every((g) => typeof g === "string")) return `${where} is not a list of group ids`;
|
|
76
|
-
for (const g of x) {
|
|
77
|
-
if (groups && !groups.includes(g)) return `${where} has an unknown group "${g}"`;
|
|
78
|
-
if (placed && seen.has(g)) return `group "${g}" is in two places`;
|
|
79
|
-
if (placed) seen.add(g);
|
|
80
|
-
}
|
|
81
|
-
return x;
|
|
82
|
-
};
|
|
83
|
-
if (!isObject(data.hosts)) return fail("hosts is missing");
|
|
84
|
-
const hosts = {};
|
|
85
|
-
for (const h of HOSTS) {
|
|
86
|
-
const zones = data.hosts[h];
|
|
87
|
-
if (!isObject(zones)) return fail(`host ${h} is missing`);
|
|
88
|
-
const out = {};
|
|
89
|
-
for (const zn of ZONES) {
|
|
90
|
-
const list = ids(zones[zn], `${h}.${zn}`, true);
|
|
91
|
-
if (typeof list === "string") return fail(list);
|
|
92
|
-
out[zn] = list;
|
|
93
|
-
}
|
|
94
|
-
hosts[h] = out;
|
|
95
|
-
}
|
|
96
|
-
const collapsed = ids(data.collapsed, "collapsed", false);
|
|
97
|
-
if (typeof collapsed === "string") return fail(collapsed);
|
|
98
|
-
if (!Array.isArray(data.floating)) return fail("floating is not a list");
|
|
99
|
-
const floating = [];
|
|
100
|
-
for (const f of data.floating) {
|
|
101
|
-
if (!isObject(f) || typeof f.id !== "string" || typeof f.x !== "number" || typeof f.y !== "number" || !Number.isFinite(f.x) || !Number.isFinite(f.y)) return fail("a floating group is not { id, x, y, from }");
|
|
102
|
-
const id = ids([f.id], "floating", true);
|
|
103
|
-
if (typeof id === "string") return fail(id);
|
|
104
|
-
const from = f.from;
|
|
105
|
-
const place = from === null || from === void 0 ? null : isObject(from) && HOSTS.includes(from.host) && ZONES.includes(from.zone) && Number.isInteger(from.index) && from.index >= 0 ? { host: from.host, zone: from.zone, index: from.index } : void 0;
|
|
106
|
-
if (place === void 0) return fail(`floating group "${f.id}" has a bad home`);
|
|
107
|
-
floating.push({ id: id[0], x: f.x, y: f.y, from: place });
|
|
108
|
-
}
|
|
109
|
-
return { ok: true, arrangement: { ...hosts, collapsed, floating } };
|
|
110
|
-
}
|
|
111
|
-
function hostNeed(zones, collapsed, spec, size, v) {
|
|
112
|
-
const lens = ZONES.map((zn) => zones[zn].reduce((s, g) => s + size(g, v, collapsed.includes(g)).along, 0) + GAP * Math.max(0, zones[zn].length - 1));
|
|
113
|
-
const used = ZONES.filter((zn) => zones[zn].length > 0).length;
|
|
114
|
-
const c = spec.center;
|
|
115
|
-
if (!c) return spec.lead + spec.tail + lens.reduce((s, x) => s + x, 0) + ZONE_GAP * Math.max(0, used - 1);
|
|
116
|
-
return spec.lead + spec.tail + lens[0] + lens[2] + Math.max(lens[1], c.min) + 2 * c.margin;
|
|
117
|
-
}
|
|
118
|
-
function layoutHost(zones, h, spec, size, byHand = []) {
|
|
119
|
-
const v = vertical(h);
|
|
120
|
-
const collapsed = new Set(ZONES.flatMap((zn) => zones[zn]).filter((g) => byHand.includes(g)));
|
|
121
|
-
const overflow = [];
|
|
122
|
-
const len = (g) => size(g, v, collapsed.has(g)).along;
|
|
123
|
-
const zoneLen = (l) => l.reduce((s, g) => s + len(g), 0) + GAP * Math.max(0, l.length - 1);
|
|
124
|
-
const needNow = () => hostNeed(zones, [...collapsed], spec, size, v);
|
|
125
|
-
const keep = (g) => {
|
|
126
|
-
const k = spec.keep && Object.hasOwn(spec.keep, g) ? spec.keep[g] : 0;
|
|
127
|
-
return typeof k === "number" && Number.isFinite(k) ? k : 0;
|
|
128
|
-
};
|
|
129
|
-
const order = [...ZONES].reverse().flatMap((zn) => [...zones[zn]].reverse());
|
|
130
|
-
for (const g of order.sort((x, y) => keep(x) - keep(y))) {
|
|
131
|
-
if (needNow() <= spec.length) break;
|
|
132
|
-
if (collapsed.has(g)) continue;
|
|
133
|
-
collapsed.add(g);
|
|
134
|
-
overflow.push(g);
|
|
135
|
-
}
|
|
136
|
-
const a0 = spec.lead;
|
|
137
|
-
const b0 = spec.length - spec.tail;
|
|
138
|
-
const S = zoneLen(zones.start);
|
|
139
|
-
const C = zoneLen(zones.center);
|
|
140
|
-
const E = zoneLen(zones.end);
|
|
141
|
-
const lo = a0 + S + (S > 0 ? ZONE_GAP : 0);
|
|
142
|
-
const hi = b0 - E - (E > 0 ? ZONE_GAP : 0);
|
|
143
|
-
let c0 = spec.length / 2 - C / 2;
|
|
144
|
-
if (c0 < lo || c0 + C > hi) c0 = (lo + hi) / 2 - C / 2;
|
|
145
|
-
const slots = /* @__PURE__ */ new Map();
|
|
146
|
-
const place = (l, from) => {
|
|
147
|
-
let at = from;
|
|
148
|
-
for (const g of l) {
|
|
149
|
-
const s = size(g, v, collapsed.has(g));
|
|
150
|
-
const across = (spec.thickness - s.across) / 2;
|
|
151
|
-
slots.set(g, v ? { x: across, y: at, width: s.across, height: s.along } : { x: at, y: across, width: s.along, height: s.across });
|
|
152
|
-
at += s.along + GAP;
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
place(zones.start, a0);
|
|
156
|
-
place(zones.center, c0);
|
|
157
|
-
place(zones.end, b0 - E);
|
|
158
|
-
return { slots, collapsed: [...collapsed], overflow, need: needNow() };
|
|
159
|
-
}
|
|
160
|
-
function insertions(zones, h, spec, l, label = (g) => g) {
|
|
161
|
-
const v = vertical(h);
|
|
162
|
-
const lo = (r) => v ? r.y : r.x;
|
|
163
|
-
const hi = (r) => v ? r.y + r.height : r.x + r.width;
|
|
164
|
-
const L = spec.length;
|
|
165
|
-
const all = ZONES.flatMap((zn) => zones[zn].map((g) => l.slots.get(g)).filter((r) => !!r));
|
|
166
|
-
const first = all.length ? Math.min(...all.map(lo)) : L;
|
|
167
|
-
const last = all.length ? Math.max(...all.map(hi)) : 0;
|
|
168
|
-
const zoneEdge = (zn, end) => {
|
|
169
|
-
const rs = zones[zn].map((g) => l.slots.get(g)).filter((r) => !!r);
|
|
170
|
-
if (!rs.length) return null;
|
|
171
|
-
return end === "lo" ? Math.min(...rs.map(lo)) : Math.max(...rs.map(hi));
|
|
172
|
-
};
|
|
173
|
-
const near = [];
|
|
174
|
-
const empties = [];
|
|
175
|
-
for (const zn of ZONES) {
|
|
176
|
-
const name = `${HOST_LABEL[h]} \xB7 ${zoneLabel(h, zn)}`;
|
|
177
|
-
const vis = zones[zn].map((g, i) => ({ g, i, r: l.slots.get(g) }));
|
|
178
|
-
if (!vis.length) {
|
|
179
|
-
const sEnd = zoneEdge("start", "hi");
|
|
180
|
-
const eStart = zoneEdge("end", "lo");
|
|
181
|
-
const span = zn === "start" ? [0, Math.min(L / 3, first - GAP / 2)] : zn === "end" ? [Math.max(2 * L / 3, last + GAP / 2), L] : [Math.max(L / 3, (sEnd ?? 0) + GAP / 2), Math.min(2 * L / 3, (eStart ?? L) - GAP / 2)];
|
|
182
|
-
if (span[1] - span[0] >= 8) empties.push({ host: h, zone: zn, index: 0, at: (span[0] + span[1]) / 2, span, empty: true, label: name });
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
near.push({ host: h, zone: zn, index: vis[0].i, at: lo(vis[0].r) - GAP / 2, empty: false, label: `${name} \xB7 before all` });
|
|
186
|
-
for (let k = 1; k < vis.length; k++) near.push({ host: h, zone: zn, index: vis[k].i, at: (hi(vis[k - 1].r) + lo(vis[k].r)) / 2, empty: false, label: `${name} \xB7 between ${label(vis[k - 1].g)} and ${label(vis[k].g)}` });
|
|
187
|
-
near.push({ host: h, zone: zn, index: zones[zn].length, at: hi(vis.at(-1).r) + GAP / 2, empty: false, label: `${name} \xB7 after all` });
|
|
188
|
-
}
|
|
189
|
-
near.sort((a, b) => a.at - b.at);
|
|
190
|
-
const lines = near.map((p, k) => ({ ...p, span: [k === 0 ? 0 : (near[k - 1].at + p.at) / 2, k === near.length - 1 ? L : (p.at + near[k + 1].at) / 2] }));
|
|
191
|
-
return [...lines, ...empties];
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export {
|
|
195
|
-
HOSTS,
|
|
196
|
-
ZONES,
|
|
197
|
-
HOST_LABEL,
|
|
198
|
-
zoneLabel,
|
|
199
|
-
vertical,
|
|
200
|
-
GAP,
|
|
201
|
-
ZONE_GAP,
|
|
202
|
-
arrangement,
|
|
203
|
-
hostOf,
|
|
204
|
-
withoutGroup,
|
|
205
|
-
insertGroup,
|
|
206
|
-
floatGroup,
|
|
207
|
-
dockGroup,
|
|
208
|
-
resetGroup,
|
|
209
|
-
moveToHost,
|
|
210
|
-
moveBar,
|
|
211
|
-
toggleCollapsed,
|
|
212
|
-
isEmptyHost,
|
|
213
|
-
sameArrangement,
|
|
214
|
-
isOwnPlace,
|
|
215
|
-
storeArrangement,
|
|
216
|
-
readArrangement,
|
|
217
|
-
hostNeed,
|
|
218
|
-
layoutHost,
|
|
219
|
-
insertions
|
|
220
|
-
};
|
|
221
|
-
//# sourceMappingURL=chunk-TWI644JK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/toolbar/index.ts"],"sourcesContent":["/**\n * @n-uf/placement/toolbar: toolbar groups as a pure model. Commands come in groups, each sitting in one of five\n * toolbar areas (the title bar, the top toolbar, a bottom toolbar, a left and a right side toolbar), in one of three\n * zones (start, center, end; top, middle, bottom on a side), in order; or floating. A toolbar is a slot: it never moves\n * itself, its groups do. Group sizes come in as numbers; group ids are the consumer's strings.\n *\n * - A toolbar area lays its zones out along its length: start from the lead, end up to the tail, the center centered on\n * the whole area; when the center would hit the start or end zone it centers in the space between them.\n * - Toolbars never wrap: when room runs out, groups collapse to their grip and » from the trailing end. A group\n * collapsed by hand stays collapsed.\n * - A group drop lands in a zone before all, after all, or between two groups. An empty zone is a target of its\n * own. A group's home is its own place: a drop there changes nothing.\n *\n * A legacy entry. See docs/placement.md, Entry: toolbar.\n */\nimport type { Rect } from \"../geometry\";\n\nexport type HostId = \"title\" | \"top\" | \"bottom\" | \"left\" | \"right\";\nexport type ZoneId = \"start\" | \"center\" | \"end\";\nexport type Zones<G extends string = string> = Readonly<Record<ZoneId, readonly G[]>>;\n\n/** Where a group is docked: a host, a zone, and its index there. */\nexport interface Place {\n readonly host: HostId;\n readonly zone: ZoneId;\n readonly index: number;\n}\n\n/** A group floating over the content: its top-left corner, and where it was docked. */\nexport interface Floating<G extends string = string> {\n readonly id: G;\n readonly x: number;\n readonly y: number;\n readonly from: Place | null;\n}\n\nexport type Arrangement<G extends string = string> = Readonly<Record<HostId, Zones<G>>> & {\n /** Groups collapsed to their handle and » by hand. */\n readonly collapsed: readonly G[];\n readonly floating: readonly Floating<G>[];\n};\n\nexport const HOSTS: readonly HostId[] = [\"title\", \"top\", \"bottom\", \"left\", \"right\"];\nexport const ZONES: readonly ZoneId[] = [\"start\", \"center\", \"end\"];\n\nexport const HOST_LABEL: Readonly<Record<HostId, string>> = { title: \"Title bar\", top: \"Top bar\", bottom: \"Bottom bar\", left: \"Left edge\", right: \"Right edge\" };\nexport const zoneLabel = (h: HostId, z: ZoneId): string => (vertical(h) ? { start: \"top\", center: \"middle\", end: \"bottom\" } : { start: \"left\", center: \"centre\", end: \"right\" })[z];\n\n/** The side edges hold their groups in a column. */\nexport const vertical = (h: HostId): boolean => h === \"left\" || h === \"right\";\n\n/** Between two groups (the handle of the second is the separator). */\nexport const GAP = 12;\n/** Between zones. */\nexport const ZONE_GAP = 16;\n\n/** An arrangement from the zones each host has (the rest empty), nothing collapsed or floating. */\nexport function arrangement<G extends string>(p: Partial<Record<HostId, Partial<Record<ZoneId, readonly G[]>>>>): Arrangement<G> {\n const z = (q: Partial<Record<ZoneId, readonly G[]>> = {}): Zones<G> => ({ start: [], center: [], end: [], ...q });\n return { title: z(p.title), top: z(p.top), bottom: z(p.bottom), left: z(p.left), right: z(p.right), collapsed: [], floating: [] };\n}\n\n// --- changes -------------------------------------------------------------------------------------------------------\n\nconst mapHosts = <G extends string>(a: Arrangement<G>, f: (h: HostId, zone: ZoneId, list: readonly G[]) => readonly G[]): Arrangement<G> => ({\n ...a,\n ...(Object.fromEntries(HOSTS.map((h) => [h, Object.fromEntries(ZONES.map((zn) => [zn, f(h, zn, a[h][zn])]))])) as Record<HostId, Zones<G>>),\n});\n\n/** Where `g` is docked (null: floating or absent). */\nexport function hostOf<G extends string>(a: Arrangement<G>, g: G): Place | null {\n for (const h of HOSTS) for (const zn of ZONES) if (a[h][zn].includes(g)) return { host: h, zone: zn, index: a[h][zn].indexOf(g) };\n return null;\n}\n\n/** The arrangement with group `g` lifted out (of its host, or from floating). */\nexport const withoutGroup = <G extends string>(a: Arrangement<G>, g: G): Arrangement<G> => ({ ...mapHosts(a, (_h, _z, l) => l.filter((x) => x !== g)), floating: a.floating.filter((f) => f.id !== g) });\n\n/** The arrangement with `g` docked at place `i` of zone `zone` of host `h` (`i` counts the others). */\nexport function insertGroup<G extends string>(a: Arrangement<G>, g: G, h: HostId, zone: ZoneId, i: number): Arrangement<G> {\n return mapHosts(withoutGroup(a, g), (hh, zz, l) => (hh === h && zz === zone ? [...l.slice(0, i), g, ...l.slice(i)] : l));\n}\n\n/** `g` floating with its top-left corner at (x, y); it remembers where it was docked. */\nexport function floatGroup<G extends string>(a: Arrangement<G>, g: G, x: number, y: number): Arrangement<G> {\n const from = hostOf(a, g) ?? a.floating.find((f) => f.id === g)?.from ?? null;\n const out = withoutGroup(a, g);\n return { ...out, floating: [...out.floating, { id: g, x, y, from }] };\n}\n\n/** `g` at `place`, its index kept within the zone. */\nconst dockAt = <G extends string>(a: Arrangement<G>, g: G, place: Place): Arrangement<G> =>\n insertGroup(a, g, place.host, place.zone, Math.min(place.index, a[place.host][place.zone].filter((x) => x !== g).length));\n\n/** `g` docked again where it floated from, else where `home` (the default arrangement) has it. */\nexport function dockGroup<G extends string>(a: Arrangement<G>, g: G, home: Arrangement<G>): Arrangement<G> {\n const from = a.floating.find((f) => f.id === g)?.from ?? hostOf(home, g);\n return from ? dockAt(a, g, from) : a;\n}\n\n/** `g` back where `home` (the default arrangement) has it, expanded. */\nexport function resetGroup<G extends string>(a: Arrangement<G>, g: G, home: Arrangement<G>): Arrangement<G> {\n const place = hostOf(home, g);\n const out = place ? dockAt(a, g, place) : a;\n return { ...out, collapsed: out.collapsed.filter((x) => x !== g) };\n}\n\n/** `g` moved to host `h`: after its last group (in its last zone that has any), or into its start zone. */\nexport function moveToHost<G extends string>(a: Arrangement<G>, g: G, h: HostId): Arrangement<G> {\n const rest = withoutGroup(a, g);\n const zone = [...ZONES].reverse().find((zn) => rest[h][zn].length > 0) ?? \"start\";\n return insertGroup(a, g, h, zone, rest[h][zone].length);\n}\n\n/** Every group of host `from` moved to host `to`, zone by zone, after the groups there. */\nexport function moveBar<G extends string>(a: Arrangement<G>, from: HostId, to: HostId): Arrangement<G> {\n if (from === to) return a;\n return mapHosts(a, (h, zn, l) => (h === from ? [] : h === to ? [...l, ...a[from][zn]] : l));\n}\n\nexport const toggleCollapsed = <G extends string>(a: Arrangement<G>, g: G): Arrangement<G> => ({ ...a, collapsed: a.collapsed.includes(g) ? a.collapsed.filter((x) => x !== g) : [...a.collapsed, g] });\n\nexport const isEmptyHost = <G extends string>(a: Arrangement<G>, h: HostId): boolean => ZONES.every((zn) => a[h][zn].length === 0);\n\nconst samePlace = (a: Place | null, b: Place | null): boolean => (a === null || b === null ? a === b : a.host === b.host && a.zone === b.zone && a.index === b.index);\n\n/**\n * The same arrangement: the same groups in the same order in every zone of every host, the same groups collapsed,\n * and the same groups floating at the same corner with the same home (in any order: neither list's order means\n * anything). Compared field by field, so how the arrangement was written down (its keys' order) doesn't matter.\n */\nexport function sameArrangement<G extends string>(a: Arrangement<G>, b: Arrangement<G>): boolean {\n const sameList = (x: readonly G[], y: readonly G[]): boolean => x.length === y.length && x.every((g, i) => g === y[i]);\n // Both ways, so a repeated id on one side can't stand in for a missing one ([\"a\", \"a\"] is not [\"a\", \"b\"]).\n const sameSet = (x: readonly G[], y: readonly G[]): boolean => x.length === y.length && x.every((g) => y.includes(g)) && y.every((g) => x.includes(g));\n if (!HOSTS.every((h) => ZONES.every((zn) => sameList(a[h][zn], b[h][zn])))) return false;\n if (!sameSet(a.collapsed, b.collapsed)) return false;\n if (!sameSet(a.floating.map((f) => f.id), b.floating.map((f) => f.id))) return false;\n return a.floating.every((f) => {\n const o = b.floating.find((x) => x.id === f.id);\n return !!o && o.x === f.x && o.y === f.y && samePlace(o.from, f.from);\n });\n}\n\n/** Dropping `g` at `place` changes nothing: it is the group's home, never a target. */\nexport const isOwnPlace = <G extends string>(a: Arrangement<G>, g: G, place: Place): boolean => sameArrangement(insertGroup(a, g, place.host, place.zone, place.index), a);\n\n// --- stored arrangements -------------------------------------------------------------------------------------------\n\n/** An arrangement as stored: version 1. */\nexport interface StoredArrangement<G extends string = string> {\n readonly v: 1;\n readonly hosts: Readonly<Record<HostId, Readonly<Record<ZoneId, readonly G[]>>>>;\n readonly collapsed: readonly G[];\n readonly floating: readonly { readonly id: G; readonly x: number; readonly y: number; readonly from: Place | null }[];\n}\n\n/** What reading a stored arrangement gives: the arrangement, or why it couldn't be read. Never a throw. */\nexport type ArrangementRead<G extends string = string> = { readonly ok: true; readonly arrangement: Arrangement<G> } | { readonly ok: false; readonly error: string };\n\n/** The arrangement as plain data with its version, ready for `JSON.stringify`. */\nexport function storeArrangement<G extends string>(a: Arrangement<G>): StoredArrangement<G> {\n const hosts = Object.fromEntries(HOSTS.map((h) => [h, Object.fromEntries(ZONES.map((zn) => [zn, [...a[h][zn]]]))])) as unknown as Record<HostId, Record<ZoneId, G[]>>;\n return { v: 1, hosts, collapsed: [...a.collapsed], floating: a.floating.map((f) => ({ id: f.id, x: f.x, y: f.y, from: f.from ? { ...f.from } : null })) };\n}\n\n/**\n * A stored arrangement read back from parsed data (`JSON.parse`'s result, not the string). Anything else gives\n * `{ ok: false, error }`, never a throw: an unknown version, a missing host or zone, a value of the wrong kind, a\n * group in two places, or (with `groups`) a group the consumer doesn't have. A group the consumer has but the stored\n * arrangement lacks is no error: the consumer places it (`resetGroup` with its default arrangement, say).\n */\nexport function readArrangement<G extends string = string>(data: unknown, groups?: readonly G[]): ArrangementRead<G> {\n const fail = (error: string): ArrangementRead<G> => ({ ok: false, error });\n const isObject = (x: unknown): x is Record<string, unknown> => typeof x === \"object\" && x !== null && !Array.isArray(x);\n if (!isObject(data)) return fail(\"not an object\");\n // Named without serialising it: a BigInt or a circular value must not throw.\n if (data.v !== 1) return fail(`unknown version ${typeof data.v === \"number\" || typeof data.v === \"string\" ? String(data.v) : typeof data.v} (this reads version 1)`);\n const seen = new Set<string>();\n const ids = (x: unknown, where: string, placed: boolean): G[] | string => {\n if (!Array.isArray(x) || !x.every((g) => typeof g === \"string\")) return `${where} is not a list of group ids`;\n for (const g of x as string[]) {\n if (groups && !(groups as readonly string[]).includes(g)) return `${where} has an unknown group \"${g}\"`;\n if (placed && seen.has(g)) return `group \"${g}\" is in two places`;\n if (placed) seen.add(g);\n }\n return x as G[];\n };\n if (!isObject(data.hosts)) return fail(\"hosts is missing\");\n const hosts = {} as Record<HostId, Zones<G>>;\n for (const h of HOSTS) {\n const zones = data.hosts[h];\n if (!isObject(zones)) return fail(`host ${h} is missing`);\n const out = {} as Record<ZoneId, readonly G[]>;\n for (const zn of ZONES) {\n const list = ids(zones[zn], `${h}.${zn}`, true);\n if (typeof list === \"string\") return fail(list);\n out[zn] = list;\n }\n hosts[h] = out;\n }\n const collapsed = ids(data.collapsed, \"collapsed\", false);\n if (typeof collapsed === \"string\") return fail(collapsed);\n if (!Array.isArray(data.floating)) return fail(\"floating is not a list\");\n const floating: Floating<G>[] = [];\n for (const f of data.floating as unknown[]) {\n if (!isObject(f) || typeof f.id !== \"string\" || typeof f.x !== \"number\" || typeof f.y !== \"number\" || !Number.isFinite(f.x) || !Number.isFinite(f.y)) return fail(\"a floating group is not { id, x, y, from }\");\n const id = ids([f.id], \"floating\", true);\n if (typeof id === \"string\") return fail(id);\n const from = f.from;\n const place = from === null || from === undefined ? null : isObject(from) && HOSTS.includes(from.host as HostId) && ZONES.includes(from.zone as ZoneId) && Number.isInteger(from.index) && (from.index as number) >= 0 ? { host: from.host as HostId, zone: from.zone as ZoneId, index: from.index as number } : undefined;\n if (place === undefined) return fail(`floating group \"${f.id}\" has a bad home`);\n floating.push({ id: id[0]!, x: f.x, y: f.y, from: place });\n }\n return { ok: true, arrangement: { ...hosts, collapsed, floating } };\n}\n\n// --- a host's layout -----------------------------------------------------------------------------------------------\n\n/** A host's room: its length and thickness, and what its ends keep for themselves (window controls, a margin). */\nexport interface HostSpec<G extends string = string> {\n readonly length: number;\n readonly thickness: number;\n readonly lead: number;\n readonly tail: number;\n /**\n * The center zone's minimum length and its margin on each side, counted in the need whether it holds groups or\n * not (an empty center keeps its drop size). Unset: the center counts only its groups.\n */\n readonly center?: { readonly min: number; readonly margin: number };\n /**\n * How long each group keeps its full form when room runs out (default 0): groups with a lower keep collapse\n * first, and among equal keeps the trailing end goes first. A primary group at the end keeps open with a keep of 1.\n */\n readonly keep?: Readonly<Partial<Record<G, number>>>;\n}\n\n/** A group's size in a host, expanded or collapsed: along it (`along`) and across it (`across`). */\nexport type GroupSize<G extends string = string> = (id: G, vertical: boolean, collapsed: boolean) => { along: number; across: number };\n\nexport interface HostLayout<G extends string = string> {\n /** Each group's rect in the host (x along, y across for a horizontal host; transposed on a side). */\n readonly slots: ReadonlyMap<G, Rect>;\n /** Groups shown collapsed (by hand, or because the room ran out). */\n readonly collapsed: readonly G[];\n /** Of those, the ones the room collapsed (from the trailing end). */\n readonly overflow: readonly G[];\n /** The length the groups and the ends take. */\n readonly need: number;\n}\n\n/** How long the host's groups need it to be, collapsing only those in `collapsed`. */\nexport function hostNeed<G extends string>(zones: Zones<G>, collapsed: readonly G[], spec: Pick<HostSpec, \"lead\" | \"tail\" | \"center\">, size: GroupSize<G>, v: boolean): number {\n const lens = ZONES.map((zn) => zones[zn].reduce((s, g) => s + size(g, v, collapsed.includes(g)).along, 0) + GAP * Math.max(0, zones[zn].length - 1));\n const used = ZONES.filter((zn) => zones[zn].length > 0).length;\n const c = spec.center;\n if (!c) return spec.lead + spec.tail + lens.reduce((s, x) => s + x, 0) + ZONE_GAP * Math.max(0, used - 1);\n // The center always counts, at its minimum at least, and its margins keep it apart from the start and end zones.\n return spec.lead + spec.tail + lens[0]! + lens[2]! + Math.max(lens[1]!, c.min) + 2 * c.margin;\n}\n\n/**\n * Lay a host out: zones along its length; when they don't fit, groups collapse, the lowest keep first and, among\n * equal keeps, from the trailing end.\n */\nexport function layoutHost<G extends string>(zones: Zones<G>, h: HostId, spec: HostSpec<G>, size: GroupSize<G>, byHand: readonly G[] = []): HostLayout<G> {\n const v = vertical(h);\n const collapsed = new Set<G>(ZONES.flatMap((zn) => zones[zn]).filter((g) => byHand.includes(g)));\n const overflow: G[] = [];\n const len = (g: G): number => size(g, v, collapsed.has(g)).along;\n const zoneLen = (l: readonly G[]): number => l.reduce((s, g) => s + len(g), 0) + GAP * Math.max(0, l.length - 1);\n const needNow = (): number => hostNeed(zones, [...collapsed], spec, size, v);\n // The lowest keep first; among equal keeps the trailing end first: the end zone's last group, back to the start\n // zone's first (the sort is stable).\n // Own keys only (a group named \"toString\" mustn't read the prototype), and finite numbers only (NaN breaks the sort).\n const keep = (g: G): number => {\n const k = spec.keep && Object.hasOwn(spec.keep, g) ? spec.keep[g] : 0;\n return typeof k === \"number\" && Number.isFinite(k) ? k : 0;\n };\n const order = [...ZONES].reverse().flatMap((zn) => [...zones[zn]].reverse());\n for (const g of order.sort((x, y) => keep(x) - keep(y))) {\n if (needNow() <= spec.length) break;\n if (collapsed.has(g)) continue;\n collapsed.add(g);\n overflow.push(g);\n }\n const a0 = spec.lead;\n const b0 = spec.length - spec.tail;\n const S = zoneLen(zones.start);\n const C = zoneLen(zones.center);\n const E = zoneLen(zones.end);\n const lo = a0 + S + (S > 0 ? ZONE_GAP : 0);\n const hi = b0 - E - (E > 0 ? ZONE_GAP : 0);\n let c0 = spec.length / 2 - C / 2;\n if (c0 < lo || c0 + C > hi) c0 = (lo + hi) / 2 - C / 2;\n const slots = new Map<G, Rect>();\n const place = (l: readonly G[], from: number): void => {\n let at = from;\n for (const g of l) {\n const s = size(g, v, collapsed.has(g));\n const across = (spec.thickness - s.across) / 2;\n slots.set(g, v ? { x: across, y: at, width: s.across, height: s.along } : { x: at, y: across, width: s.along, height: s.across });\n at += s.along + GAP;\n }\n };\n place(zones.start, a0);\n place(zones.center, c0);\n place(zones.end, b0 - E);\n return { slots, collapsed: [...collapsed], overflow, need: needNow() };\n}\n\n// --- insertion points ----------------------------------------------------------------------------------------------\n\n/** A place a dragged group can go: a zone of a host and the index among the others there, and where it is. */\nexport interface Insertion extends Place {\n /** Along the host: the insertion line (between groups); for an empty zone, the zone's middle. */\n readonly at: number;\n /** The stretch of the host it owns (host coordinates). */\n readonly span: readonly [number, number];\n /** An empty zone: it owns all of its stretch, whatever is nearer (it wins while the pointer is inside it). */\n readonly empty: boolean;\n readonly label: string;\n}\n\n/**\n * The insertion points of a host laid out without the dragged group: in each zone before all, between two, after\n * all; each owns the stretch of the host nearest to it. An empty zone owns its own stretch: the host's first third\n * (start), middle third (center) or last third (end), less what its neighbors' groups take. `label` names a group\n * in the \"between\" labels (default: its id).\n */\nexport function insertions<G extends string>(zones: Zones<G>, h: HostId, spec: HostSpec<G>, l: HostLayout<G>, label: (g: G) => string = (g) => g): Insertion[] {\n const v = vertical(h);\n const lo = (r: Rect): number => (v ? r.y : r.x);\n const hi = (r: Rect): number => (v ? r.y + r.height : r.x + r.width);\n const L = spec.length;\n const all = ZONES.flatMap((zn) => zones[zn].map((g) => l.slots.get(g)).filter((r): r is Rect => !!r));\n const first = all.length ? Math.min(...all.map(lo)) : L;\n const last = all.length ? Math.max(...all.map(hi)) : 0;\n const zoneEdge = (zn: ZoneId, end: \"lo\" | \"hi\"): number | null => {\n const rs = zones[zn].map((g) => l.slots.get(g)).filter((r): r is Rect => !!r);\n if (!rs.length) return null;\n return end === \"lo\" ? Math.min(...rs.map(lo)) : Math.max(...rs.map(hi));\n };\n const near: Omit<Insertion, \"span\">[] = [];\n const empties: Insertion[] = [];\n for (const zn of ZONES) {\n const name = `${HOST_LABEL[h]} · ${zoneLabel(h, zn)}`;\n const vis = zones[zn].map((g, i) => ({ g, i, r: l.slots.get(g)! }));\n if (!vis.length) {\n const sEnd = zoneEdge(\"start\", \"hi\");\n const eStart = zoneEdge(\"end\", \"lo\");\n const span: [number, number] =\n zn === \"start\" ? [0, Math.min(L / 3, first - GAP / 2)] : zn === \"end\" ? [Math.max((2 * L) / 3, last + GAP / 2), L] : [Math.max(L / 3, (sEnd ?? 0) + GAP / 2), Math.min((2 * L) / 3, (eStart ?? L) - GAP / 2)];\n if (span[1] - span[0] >= 8) empties.push({ host: h, zone: zn, index: 0, at: (span[0] + span[1]) / 2, span, empty: true, label: name });\n continue;\n }\n near.push({ host: h, zone: zn, index: vis[0]!.i, at: lo(vis[0]!.r) - GAP / 2, empty: false, label: `${name} · before all` });\n for (let k = 1; k < vis.length; k++) near.push({ host: h, zone: zn, index: vis[k]!.i, at: (hi(vis[k - 1]!.r) + lo(vis[k]!.r)) / 2, empty: false, label: `${name} · between ${label(vis[k - 1]!.g)} and ${label(vis[k]!.g)}` });\n near.push({ host: h, zone: zn, index: zones[zn].length, at: hi(vis.at(-1)!.r) + GAP / 2, empty: false, label: `${name} · after all` });\n }\n near.sort((a, b) => a.at - b.at);\n const lines = near.map((p, k) => ({ ...p, span: [k === 0 ? 0 : (near[k - 1]!.at + p.at) / 2, k === near.length - 1 ? L : (p.at + near[k + 1]!.at) / 2] as const }));\n return [...lines, ...empties];\n}\n"],"mappings":";AA0CO,IAAM,QAA2B,CAAC,SAAS,OAAO,UAAU,QAAQ,OAAO;AAC3E,IAAM,QAA2B,CAAC,SAAS,UAAU,KAAK;AAE1D,IAAM,aAA+C,EAAE,OAAO,aAAa,KAAK,WAAW,QAAQ,cAAc,MAAM,aAAa,OAAO,aAAa;AACxJ,IAAM,YAAY,CAAC,GAAW,OAAuB,SAAS,CAAC,IAAI,EAAE,OAAO,OAAO,QAAQ,UAAU,KAAK,SAAS,IAAI,EAAE,OAAO,QAAQ,QAAQ,UAAU,KAAK,QAAQ,GAAG,CAAC;AAG3K,IAAM,WAAW,CAAC,MAAuB,MAAM,UAAU,MAAM;AAG/D,IAAM,MAAM;AAEZ,IAAM,WAAW;AAGjB,SAAS,YAA8B,GAAmF;AAC/H,QAAM,IAAI,CAAC,IAA2C,CAAC,OAAiB,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,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