@n-uf/placement 26.11.34 → 26.11.37
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 +163 -0
- package/README.md +147 -20
- package/dist/{chunk-VKB3UWKX.js → chunk-2PWDUBPG.js} +520 -97
- package/dist/chunk-2PWDUBPG.js.map +1 -0
- package/dist/{chunk-AVMZIXGO.js → chunk-NF7RYK3U.js} +9 -49
- package/dist/chunk-NF7RYK3U.js.map +1 -0
- package/dist/chunk-R3AAANRY.js +220 -0
- package/dist/chunk-R3AAANRY.js.map +1 -0
- package/dist/desk.d.ts +2 -2
- package/dist/dock.js +2 -1
- package/dist/dock.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{model-BSIKmANw.d.ts → model-CuE-ML-f.d.ts} +111 -19
- package/dist/panels.d.ts +3 -3
- package/dist/regions-Db_RyT4P.d.ts +48 -0
- package/dist/scene-cases.d.ts +42 -10
- package/dist/scene-cases.js +109 -10
- package/dist/scene-cases.js.map +1 -1
- package/dist/scene.d.ts +100 -6
- package/dist/scene.js +11 -1
- package/dist/stack.d.ts +1 -1
- package/dist/{target-2RYYKkd1.d.ts → target-fhD5UVlt.d.ts} +2 -0
- package/dist/{targets-Du5_4T1u.d.ts → targets-DnVNZVQW.d.ts} +1 -1
- package/dist/targets.d.ts +17 -32
- package/dist/targets.js +20 -54
- package/dist/targets.js.map +1 -1
- package/dist/tiling.d.ts +114 -0
- package/dist/tiling.js +40 -0
- package/dist/tiling.js.map +1 -0
- package/package.json +6 -2
- package/dist/chunk-AVMZIXGO.js.map +0 -1
- package/dist/chunk-VKB3UWKX.js.map +0 -1
package/dist/scene-cases.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { P as Point, R as Rect } from './geometry-Bf37LbCT.js';
|
|
2
2
|
import { S as StackFormKind } from './model-X7eUaKlA.js';
|
|
3
|
-
import { S as Scene, a as ScenePlace, b as SceneLayout, c as StoredScene,
|
|
4
|
-
import './target-
|
|
3
|
+
import { S as Scene, a as ScenePlace, b as SceneLayout, c as StoredScene, Z as Zone, d as Side, e as SceneNoteCode, f as SceneTarget, g as SceneRefusal } from './model-CuE-ML-f.js';
|
|
4
|
+
import './target-fhD5UVlt.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The conformance rows' shapes. A row is plain data: a scene, the settings it runs at, the gestures a user makes, and
|
|
@@ -164,7 +164,7 @@ interface Checkpoint {
|
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* What a row's scene needs of the host's window: a host that can't meet it skips the row or marks it. The runner reads
|
|
167
|
-
*
|
|
167
|
+
* only `docks` (against `CaseHost.dockMinWidth`); the rest is data for the host's suite.
|
|
168
168
|
*/
|
|
169
169
|
interface CaseRequires {
|
|
170
170
|
/** The scene's columns use the default `hitBand` (an open panel's body is no drop place); a host whose columns use `"middle"` gets card halves there. */
|
|
@@ -183,6 +183,13 @@ interface CaseRequires {
|
|
|
183
183
|
* `railDrop`) skips the row; rows that only mean a place aim by place and need no such precondition.
|
|
184
184
|
*/
|
|
185
185
|
readonly railDrop?: "scene";
|
|
186
|
+
/**
|
|
187
|
+
* The row's expected outcome depends on panels being docked (columns or rails, an order along an edge, a docked
|
|
188
|
+
* panel's place, rect or form, the content beside docked panels, floats that leave a panel out). `CASES` sets it by
|
|
189
|
+
* one rule (`needsDocks`); a row may state it, true or false, to override. The runner skips a row with it on a host
|
|
190
|
+
* whose `dockMinWidth` is above the row's stage width.
|
|
191
|
+
*/
|
|
192
|
+
readonly docks?: boolean;
|
|
186
193
|
}
|
|
187
194
|
interface CaseRow {
|
|
188
195
|
/** Generic and stable: an integrating app's suite names rows by it. */
|
|
@@ -250,6 +257,12 @@ interface CaseHost {
|
|
|
250
257
|
stops?(item: string): readonly ScenePlace[];
|
|
251
258
|
/** The pick rule the host aims with (see {@link PickRule}); the runner never calls it. */
|
|
252
259
|
readonly pick?: PickRule;
|
|
260
|
+
/**
|
|
261
|
+
* The narrowest stage width, px, at which the host docks panels (below it, say, every panel floats or opens as a
|
|
262
|
+
* sheet). The runner skips a row that needs docked panels (`requires.docks`) when the row's stage is narrower at any
|
|
263
|
+
* point (its start, or a window `resize`), and lists the row in `skipped`. Absent: the host docks at every width.
|
|
264
|
+
*/
|
|
265
|
+
readonly dockMinWidth?: number;
|
|
253
266
|
/**
|
|
254
267
|
* The host's names for a row's items and edges: row id to host id (`{ views: "panels", tools: "commands" }`). The
|
|
255
268
|
* runner passes every id to the host in the host's words (the scene, the gestures, `stops`, `itemSelector`) and reads
|
|
@@ -263,8 +276,18 @@ interface CaseHost {
|
|
|
263
276
|
* `targetAt` (the lowest priority number, then the smallest zone; a rect holds its edges exactly; `hits` all count), and
|
|
264
277
|
* every host passes it: placement doesn't import motion, so the host takes the rule as an input. A `move` lands the
|
|
265
278
|
* pointer over the target this rule picks, and `resolvePlace` aims with it.
|
|
279
|
+
*
|
|
280
|
+
* It reads only a candidate's `id`, `priority`, `hit` and `hits`, and gives back one of the candidates it was given, so
|
|
281
|
+
* one rule picks among targets, refusal targets (`refusalTargets`) or both.
|
|
266
282
|
*/
|
|
267
|
-
type PickRule = (list: readonly
|
|
283
|
+
type PickRule = <T extends PickCandidate>(list: readonly T[], point: Point) => T | null;
|
|
284
|
+
/** What the pick rule reads of a candidate. */
|
|
285
|
+
interface PickCandidate {
|
|
286
|
+
readonly id: string;
|
|
287
|
+
readonly priority: 1 | 2 | 3;
|
|
288
|
+
readonly hit: Rect;
|
|
289
|
+
readonly hits?: readonly Rect[];
|
|
290
|
+
}
|
|
268
291
|
/**
|
|
269
292
|
* A `CaseHost` whose calls may be async (a page a browser runner drives with real pointer events and timers): each of
|
|
270
293
|
* `load`, `perform`, `layout`, `root`, `stored` and `stops` may return a promise. `itemSelector` stays a plain value.
|
|
@@ -280,13 +303,18 @@ interface AsyncCaseHost {
|
|
|
280
303
|
stops?(item: string): readonly ScenePlace[] | Promise<readonly ScenePlace[]>;
|
|
281
304
|
/** The pick rule the host aims with, a plain value (see {@link PickRule}); the runner never calls it. */
|
|
282
305
|
readonly pick?: PickRule;
|
|
306
|
+
/** The narrowest stage width at which the host docks panels, as {@link CaseHost.dockMinWidth}. */
|
|
307
|
+
readonly dockMinWidth?: number;
|
|
283
308
|
/** The host's names for a row's items and edges, as {@link CaseHost.ids}. */
|
|
284
309
|
readonly ids?: Readonly<Record<string, string>>;
|
|
285
310
|
}
|
|
286
311
|
interface CaseResult {
|
|
287
312
|
readonly ok: boolean;
|
|
288
313
|
readonly failures: string[];
|
|
289
|
-
/**
|
|
314
|
+
/**
|
|
315
|
+
* The checks not run because the host can't (no root, no stored form, no stops): each one's note, or its selector. A
|
|
316
|
+
* row skipped whole (it needs docked panels below the host's `dockMinWidth`) is `ok` with one entry that says so.
|
|
317
|
+
*/
|
|
290
318
|
readonly skipped: string[];
|
|
291
319
|
}
|
|
292
320
|
|
|
@@ -322,9 +350,10 @@ declare function pickTarget<T extends {
|
|
|
322
350
|
readonly hits?: readonly Rect[];
|
|
323
351
|
}>(list: readonly T[], point: Point): T | null;
|
|
324
352
|
/**
|
|
325
|
-
* The pick rule with the scene's refusals (`refusals(scene, dragged)`)
|
|
326
|
-
*
|
|
327
|
-
* home ("No room here"). Every host aims and drops with it: the reference host,
|
|
353
|
+
* The pick rule with the scene's refusals (`refusals(scene, dragged)`), the drag intent's way: the refusals take part in
|
|
354
|
+
* the pick as refusal targets (`refusalTargets`), and where one is what the rule picks nothing is picked, so a release
|
|
355
|
+
* there commits nothing and the item goes home ("No room here"). Every host aims and drops with it: the reference host,
|
|
356
|
+
* and a page's host for `resolvePlace`.
|
|
328
357
|
*/
|
|
329
358
|
declare function withRefusals(pick: PickRule, refused: readonly SceneRefusal[]): PickRule;
|
|
330
359
|
/** What `resolvePlace` may aim at when a target covers the whole plane (a float): the stage and the content. */
|
|
@@ -537,7 +566,10 @@ interface WinOptions {
|
|
|
537
566
|
/** A window: dynamic columns on both sides, a rail on each, `contentMin`, padding and gap. */
|
|
538
567
|
declare function winScene(spec: WinSpec, o?: WinOptions): Scene;
|
|
539
568
|
|
|
540
|
-
/**
|
|
569
|
+
/**
|
|
570
|
+
* Every row, in order: the docking cases, the bar cases, the built-in rules, the panel gestures, the two windows. The
|
|
571
|
+
* rows that need docked panels carry `requires: { docks: true }` (see `./docks`).
|
|
572
|
+
*/
|
|
541
573
|
declare const CASES: readonly CaseRow[];
|
|
542
574
|
/** The groups rows are listed under, in order, with their titles. */
|
|
543
575
|
declare const CASE_GROUPS: readonly {
|
|
@@ -547,4 +579,4 @@ declare const CASE_GROUPS: readonly {
|
|
|
547
579
|
/** The row with this id, or undefined. */
|
|
548
580
|
declare const caseById: (id: string) => CaseRow | undefined;
|
|
549
581
|
|
|
550
|
-
export { type AimArea, type AsyncCaseHost, CASES, CASE_GROUPS, type CaseGroup, type CaseHost, type CaseRequires, type CaseResult, type CaseRow, type CaseSettings, type Checkpoint, type DomCheck, type DomRoot, END_REACH, type EdgeExpect, type Gesture, type GestureType, type IdMap, type ItemExpect, LIFT_THRESHOLD, type LayoutExpect, type PickRule, type Rename, type SceneHost, type SceneHostOptions, type StoredExpect, WINDOW_A, WINDOW_B, WINDOW_BARE, type WinOptions, type WinSpec, caseById, createSceneHost, defaultItemSelector, g, idRenames, layoutIssues, mapGesture, mapLayout, mapPlace, mapScene, mapStored, pickTarget, resizeStep, resolvePlace, runCase, runCaseAsync, runCases, runCasesAsync, winScene, withRefusals };
|
|
582
|
+
export { type AimArea, type AsyncCaseHost, CASES, CASE_GROUPS, type CaseGroup, type CaseHost, type CaseRequires, type CaseResult, type CaseRow, type CaseSettings, type Checkpoint, type DomCheck, type DomRoot, END_REACH, type EdgeExpect, type Gesture, type GestureType, type IdMap, type ItemExpect, LIFT_THRESHOLD, type LayoutExpect, type PickCandidate, type PickRule, type Rename, type SceneHost, type SceneHostOptions, type StoredExpect, WINDOW_A, WINDOW_B, WINDOW_BARE, type WinOptions, type WinSpec, caseById, createSceneHost, defaultItemSelector, g, idRenames, layoutIssues, mapGesture, mapLayout, mapPlace, mapScene, mapStored, pickTarget, resizeStep, resolvePlace, runCase, runCaseAsync, runCases, runCasesAsync, winScene, withRefusals };
|
package/dist/scene-cases.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
placeTargetId,
|
|
9
9
|
raise,
|
|
10
10
|
readScene,
|
|
11
|
+
refusalTargets,
|
|
11
12
|
refusals,
|
|
12
13
|
resize,
|
|
13
14
|
solve,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
storeScene,
|
|
16
17
|
targets,
|
|
17
18
|
use
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2PWDUBPG.js";
|
|
19
20
|
import "./chunk-AE3BWTAE.js";
|
|
20
21
|
import {
|
|
21
22
|
centre,
|
|
@@ -534,7 +535,8 @@ var DOCKING_ROWS = [
|
|
|
534
535
|
settings: { frozen: true },
|
|
535
536
|
gestures: [g.click("pages", "float"), g.moveTo("pages", g.float), g.click("pages", "dock"), g.key("Alt"), g.click("pages", "float"), g.key("Alt:up")],
|
|
536
537
|
checkpoints: [{ at: 2, layout: { items: { pages: { edge: "column", floating: false, rect: rect(0, 40, 240, 246.43) }, annotations: { rect: rect(0, 286.43, 240, 213.57) } } }, note: "frozen: nothing moved" }],
|
|
537
|
-
|
|
538
|
+
// The menu's Float anchors it to the content's top-right corner; the float already there wins, so it lies beside it.
|
|
539
|
+
expectLayout: { items: { pages: { floating: true, rect: rect(240, 40, 200, 190) }, annotations: { rect: rect(0, 40, 240, 460) } } }
|
|
538
540
|
},
|
|
539
541
|
{
|
|
540
542
|
id: "C15",
|
|
@@ -714,6 +716,11 @@ var BAR_ROWS = [
|
|
|
714
716
|
// src/scene/cases/rows-rules.ts
|
|
715
717
|
var panelsOnly = () => tweakEdge({ ...doc(), floatKinds: ["panel"] }, "left", { accepts: ["panel"] });
|
|
716
718
|
var trayColumn = () => tweakEdge({ ...doc(), floatKinds: ["panel"] }, "left", { zoneAccepts: { start: ["panel"], end: ["group"] } });
|
|
719
|
+
function titleEnd(end) {
|
|
720
|
+
const s = tweakEdge(tweakEdge(doc(), "titlebar", { items: ["title", ...end] }), "toolbar", { items: ["views", "tools"] });
|
|
721
|
+
const readout2 = (id, w) => ({ id, kind: "readout", used: 0, fixed: true, align: "end", forms: { row: [form("row", w, w, 28)] } });
|
|
722
|
+
return { ...s, items: { ...s.items, state: readout2("state", 96), page: readout2("page", 42) } };
|
|
723
|
+
}
|
|
717
724
|
function barZones() {
|
|
718
725
|
const s = tweakEdge(doc(), "toolbar", { items: ["views", "zoom"] });
|
|
719
726
|
return { ...s, floats: [...s.floats, { id: "tools", rect: rect(500, 300, 200, 28) }] };
|
|
@@ -746,7 +753,7 @@ var RULE_ROWS = [
|
|
|
746
753
|
checkpoints: [{ at: 2, layout: { items: { pages: null, views: { rect: rect(8, 32, 200, 36) }, tools: { rect: rect(212, 32, 200, 36) }, zoom: { rect: rect(992, 32, 200, 36) } }, order: { toolbar: ["views", "tools", "zoom"] } }, note: "refused: no target, the held item out of the layout" }],
|
|
747
754
|
expectLayout: { items: { pages: { edge: "left", floating: false }, views: { rect: rect(8, 32, 200, 36) }, tools: { rect: rect(212, 32, 200, 36) }, zoom: { rect: rect(992, 32, 200, 36) } }, order: { toolbar: ["views", "tools", "zoom"], left: ["pages"] } },
|
|
748
755
|
expectDom: [
|
|
749
|
-
{ at: 2, select: "[data-drag-refusal]", count: 1, attr: { "data-drag-refusal": "refuse:toolbar:
|
|
756
|
+
{ at: 2, select: "[data-drag-refusal]", count: 1, attr: { "data-drag-refusal": "refuse:toolbar:start" }, note: "the toolbar's one refusal shows where the pointer is" },
|
|
750
757
|
{ at: 2, select: "[data-drag-slot]", count: 0, note: "no slot anywhere" }
|
|
751
758
|
]
|
|
752
759
|
},
|
|
@@ -1030,8 +1037,67 @@ var RULE_ROWS = [
|
|
|
1030
1037
|
order: { toolbar: ["views", "tools", "zoom"] }
|
|
1031
1038
|
}
|
|
1032
1039
|
})
|
|
1033
|
-
)
|
|
1040
|
+
),
|
|
1041
|
+
...["leading", "trailing"].map(
|
|
1042
|
+
(half) => ({
|
|
1043
|
+
id: `R7-end-zone-pushes-fixed-behind-a-movable-${half}`,
|
|
1044
|
+
title: `Fixed items behind a movable one are pushed: Zoom's ${half} half`,
|
|
1045
|
+
expect: {
|
|
1046
|
+
leading: "In a title bar whose end zone is State and Page (fixed) then Zoom, Tools let go over Zoom's leading half lands before Zoom (gap end:2): State and Page, placed only by Zoom's size, move left to make room.",
|
|
1047
|
+
trailing: "The same title bar: Tools let go over Zoom's trailing half lands after Zoom (gap end:3), State, Page and Zoom moving left to make room."
|
|
1048
|
+
}[half],
|
|
1049
|
+
group: "groups",
|
|
1050
|
+
scene: titleEnd(["state", "page", "zoom"]),
|
|
1051
|
+
gestures: [g.press("tools"), g.at(half === "leading" ? 1050 : 1150, 16), g.hold(), g.release()],
|
|
1052
|
+
expectLayout: {
|
|
1053
|
+
items: half === "leading" ? { tools: { edge: "titlebar", zone: "end", rect: rect(800, 0, 200, 32) }, state: { rect: rect(662, 0, 96, 32) }, page: { rect: rect(758, 0, 42, 32) }, zoom: { rect: rect(1e3, 0, 200, 32) } } : { tools: { edge: "titlebar", zone: "end", rect: rect(1e3, 0, 200, 32) }, state: { rect: rect(662, 0, 96, 32) }, page: { rect: rect(758, 0, 42, 32) }, zoom: { rect: rect(800, 0, 200, 32) } },
|
|
1054
|
+
order: { titlebar: half === "leading" ? ["title", "state", "page", "tools", "zoom"] : ["title", "state", "page", "zoom", "tools"] }
|
|
1055
|
+
}
|
|
1056
|
+
})
|
|
1057
|
+
),
|
|
1058
|
+
{
|
|
1059
|
+
id: "R7-end-zone-anchored-fixed-stay",
|
|
1060
|
+
title: "The anchored fixed run stays put",
|
|
1061
|
+
expect: "With Zoom first in the end zone and State and Page (fixed) after it, at the bar's end, the readouts are the zone's anchored fixed run: no place after them is offered, so Tools let go over Zoom's trailing half lands right after Zoom (gap end:1) and State and Page keep their places.",
|
|
1062
|
+
group: "groups",
|
|
1063
|
+
scene: titleEnd(["zoom", "state", "page"]),
|
|
1064
|
+
gestures: [g.press("tools"), g.at(1012, 16), g.hold(), g.release()],
|
|
1065
|
+
expectLayout: {
|
|
1066
|
+
items: { tools: { edge: "titlebar", zone: "end", rect: rect(862, 0, 200, 32) }, zoom: { rect: rect(662, 0, 200, 32) }, state: { rect: rect(1062, 0, 96, 32) }, page: { rect: rect(1158, 0, 42, 32) } },
|
|
1067
|
+
order: { titlebar: ["title", "zoom", "tools", "state", "page"] }
|
|
1068
|
+
}
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
id: "R8-hand-fold-is-the-fold-form",
|
|
1072
|
+
title: "A hand fold folds a toolbar group, it never steps to a variant",
|
|
1073
|
+
expect: "Zoom's forms along the toolbar are row, stacked, icons, its fold (its grip and \xBB) and the menu. Folded by hand (a grip's double-click), it takes its fold form, not stacked, the next variant; unfolded, it takes the form the toolbar's room allows again, its row.",
|
|
1074
|
+
group: "groups",
|
|
1075
|
+
scene: zoomFive(),
|
|
1076
|
+
gestures: [g.click("zoom", "fold"), g.click("zoom", "unfold")],
|
|
1077
|
+
checkpoints: [{ at: 0, layout: { items: { zoom: { edge: "toolbar", formKind: "fold", form: 3 } } }, note: "folded by hand: its fold form" }],
|
|
1078
|
+
expectLayout: { items: { zoom: { edge: "toolbar", formKind: "row", form: 0 } } }
|
|
1079
|
+
},
|
|
1080
|
+
{
|
|
1081
|
+
id: "R9-zones-taking-nothing-refuse-nothing",
|
|
1082
|
+
title: "A side rail whose zones take nothing is no drop place and no refusal",
|
|
1083
|
+
expect: "An empty side rail at the window's left edge that lists toolbars but whose zones take none (`zoneAccepts: {}`, a rail the host doesn't draw) is no edge for a toolbar at all: Tools held 6 px from the window's left edge, over the column's panel, shows no refusal there and floats where it is let go (it used to be refused there and went back to its toolbar).",
|
|
1084
|
+
group: "kinds",
|
|
1085
|
+
scene: sideRailTakingNothing(),
|
|
1086
|
+
gestures: [g.press("tools"), g.at(6, 400), g.hold(), g.release()],
|
|
1087
|
+
expectLayout: { items: { tools: { edge: null, floating: true } } },
|
|
1088
|
+
expectDom: [{ at: 2, select: "[data-drag-refusal]", count: 0, note: "no refusal along the undrawn rail" }]
|
|
1089
|
+
}
|
|
1034
1090
|
];
|
|
1091
|
+
function sideRailTakingNothing() {
|
|
1092
|
+
const s = doc();
|
|
1093
|
+
const rail = { id: "side-rail", side: "left", ring: 0, accepts: ["group"], zoneAccepts: {}, items: [], cross: { min: 32, max: 32, rail: 32 } };
|
|
1094
|
+
return { ...s, edges: [rail, ...s.edges.map((e) => e.side === "left" ? { ...e, ring: e.ring + 1 } : e)] };
|
|
1095
|
+
}
|
|
1096
|
+
function zoomFive() {
|
|
1097
|
+
const s = doc();
|
|
1098
|
+
const row2 = [form("row", 200, 200, 28), form("stacked", 120, 120, 30), form("icons", 84, 84, 28), form("fold", 24, 24, 28), form("menu", 0, 0, 0)];
|
|
1099
|
+
return { ...s, items: { ...s.items, zoom: { ...s.items.zoom, forms: { ...s.items.zoom.forms, row: row2 } } } };
|
|
1100
|
+
}
|
|
1035
1101
|
|
|
1036
1102
|
// src/scene/cases/windows.ts
|
|
1037
1103
|
var WINDOW_A = { card: { min: 220, max: 640 }, gap: 12, pad: 12, rail: 32, contentMin: { width: 320, height: 240 }, barMain: 30 };
|
|
@@ -1337,7 +1403,7 @@ var GESTURE_ROWS = [
|
|
|
1337
1403
|
checkpoints: [{ at: 2, layout: { items: { pages: null, tools: { edge: "tools-bar", rect: rect(12, 770, 120, 30) } }, order: { "tools-bar": ["tools"] } }, note: "refused: no target, the held item out of the layout" }],
|
|
1338
1404
|
expectLayout: { items: { pages: { edge: "left-0", floating: false }, tools: { edge: "tools-bar", rect: rect(12, 770, 120, 30) } }, order: { "tools-bar": ["tools"] }, columns: { left: [["pages", "annotations"]] } },
|
|
1339
1405
|
expectDom: [
|
|
1340
|
-
{ at: 2, select: "[data-drag-refusal]", count: 1, attr: { "data-drag-refusal": "refuse:tools-bar:
|
|
1406
|
+
{ at: 2, select: "[data-drag-refusal]", count: 1, attr: { "data-drag-refusal": "refuse:tools-bar:start" }, note: "the bar's one refusal shows where the pointer is" },
|
|
1341
1407
|
{ at: 2, select: "[data-drag-slot]", count: 0, note: "no slot anywhere" }
|
|
1342
1408
|
]
|
|
1343
1409
|
},
|
|
@@ -1433,6 +1499,7 @@ var GESTURE_ROWS = [
|
|
|
1433
1499
|
expect: "In a flush window with a column open on each side, Annotations held over the float mid-window, then moved to the window's first px on the left and rested there, lands in a new outer left column: the float never holds the window's edge.",
|
|
1434
1500
|
group: "gestures",
|
|
1435
1501
|
scene: flush(),
|
|
1502
|
+
requires: { railDrop: "scene" },
|
|
1436
1503
|
gestures: [g.press("annotations", { x: 20, y: 10 }), g.at(FLUSH_W / 2, 400), g.hold(), g.at(0, 400), g.hold(), g.release()],
|
|
1437
1504
|
expectLayout: { items: { annotations: { edge: "left-1", rect: rect(0, 0, 200, 900) }, pages: { rect: rect(200, 0, 200, 900) } }, columns: { left: [["annotations"], ["pages"]], right: [["findings"]] }, floats: [] }
|
|
1438
1505
|
},
|
|
@@ -1442,6 +1509,7 @@ var GESTURE_ROWS = [
|
|
|
1442
1509
|
expect: "The same on the right: Annotations rested over the float, then at the window's last px, lands in a new outer right column.",
|
|
1443
1510
|
group: "gestures",
|
|
1444
1511
|
scene: flush(),
|
|
1512
|
+
requires: { railDrop: "scene" },
|
|
1445
1513
|
gestures: [g.press("annotations", { x: 20, y: 10 }), g.at(FLUSH_W / 2, 400), g.hold(), g.at(FLUSH_W - 1, 400), g.hold(), g.release()],
|
|
1446
1514
|
expectLayout: { items: { annotations: { edge: "right-1", rect: rect(FLUSH_W - 200, 0, 200, 900) }, findings: { rect: rect(FLUSH_W - 400, 0, 200, 900) } }, columns: { left: [["pages"]], right: [["annotations"], ["findings"]] }, floats: [] }
|
|
1447
1515
|
},
|
|
@@ -1451,6 +1519,7 @@ var GESTURE_ROWS = [
|
|
|
1451
1519
|
expect: "With hand folds riding, the left rail can't take the drop while the left column stays open, so it owns none of the window's edge: Annotations let go 9 px in from the left lands in a new outer column, neither floating nor refused.",
|
|
1452
1520
|
group: "gestures",
|
|
1453
1521
|
scene: flush(),
|
|
1522
|
+
requires: { railDrop: "scene" },
|
|
1454
1523
|
gestures: [g.press("annotations", { x: 20, y: 10 }), g.at(9, 400), g.hold(), g.release()],
|
|
1455
1524
|
expectLayout: { items: { annotations: { edge: "left-1", rect: rect(0, 0, 200, 900) } }, columns: { left: [["annotations"], ["pages"]], right: [["findings"]] }, floats: [] }
|
|
1456
1525
|
},
|
|
@@ -1575,6 +1644,26 @@ var HAND = [
|
|
|
1575
1644
|
];
|
|
1576
1645
|
var WINDOW_ROWS = [...windowRows(), ...HAND];
|
|
1577
1646
|
|
|
1647
|
+
// src/scene/cases/docks.ts
|
|
1648
|
+
function needsDocks(row2) {
|
|
1649
|
+
if (row2.requires?.docks !== void 0) return row2.requires.docks;
|
|
1650
|
+
const items = row2.scene.items;
|
|
1651
|
+
const isPanel = (id) => items[id]?.kind === "panel";
|
|
1652
|
+
const panels = Object.keys(items).filter((id) => isPanel(id) && !items[id].closed);
|
|
1653
|
+
const start = solve(row2.scene);
|
|
1654
|
+
const dockedAtStart = new Set(panels.filter((id) => !!start.items[id]?.edge && !start.items[id].floating));
|
|
1655
|
+
const takesPanels = (edge) => !!row2.scene.edges.find((e) => e.id === edge)?.accepts.includes("panel");
|
|
1656
|
+
const expects = [row2.expectLayout, ...(row2.checkpoints ?? []).flatMap((c) => c.layout ? [c.layout] : [])];
|
|
1657
|
+
return expects.some(
|
|
1658
|
+
(e) => e.columns !== void 0 || e.rails !== void 0 || Object.values(e.order ?? {}).some((ids) => ids.some(isPanel)) || Object.entries(e.items ?? {}).some(([id, x]) => {
|
|
1659
|
+
if (!x || !isPanel(id)) return false;
|
|
1660
|
+
if (x.edge !== void 0 && x.edge !== null || x.zone !== void 0 || x.rail !== void 0 && x.rail !== null || x.rides || x.inMenu) return true;
|
|
1661
|
+
return dockedAtStart.has(id) && !x.floating && x.edge !== null && (x.rect !== void 0 || x.formKind !== void 0);
|
|
1662
|
+
}) || (e.content !== void 0 || e.contentAtLeast !== void 0) && dockedAtStart.size > 0 || Object.keys(e.edges ?? {}).some(takesPanels) || e.floats !== void 0 && panels.some((id) => !e.floats.includes(id))
|
|
1663
|
+
);
|
|
1664
|
+
}
|
|
1665
|
+
var withDocks = (rows) => rows.map((row2) => row2.requires?.docks === void 0 && needsDocks(row2) ? { ...row2, requires: { ...row2.requires, docks: true } } : row2);
|
|
1666
|
+
|
|
1578
1667
|
// src/scene/cases/host.ts
|
|
1579
1668
|
var LIFT_THRESHOLD = 4;
|
|
1580
1669
|
var END_REACH = 24;
|
|
@@ -1591,12 +1680,13 @@ function pickTarget(list, point) {
|
|
|
1591
1680
|
}
|
|
1592
1681
|
function withRefusals(pick, refused) {
|
|
1593
1682
|
if (refused.length === 0) return pick;
|
|
1683
|
+
const inert = refusalTargets(refused);
|
|
1594
1684
|
return (list, point) => {
|
|
1595
|
-
const t = pick(list, point);
|
|
1596
|
-
|
|
1597
|
-
return refused.some((r) => contains(r.hit, point, 0)) ? null : t;
|
|
1685
|
+
const t = pick([...list, ...inert], point);
|
|
1686
|
+
return t !== null && isOneOf(list, t) ? t : null;
|
|
1598
1687
|
};
|
|
1599
1688
|
}
|
|
1689
|
+
var isOneOf = (list, x) => list.includes(x);
|
|
1600
1690
|
function targetAt(list, place, item) {
|
|
1601
1691
|
const id = placeTargetId(place, item);
|
|
1602
1692
|
return (id ? list.find((t) => t.id === id) : void 0) ?? list.find((t) => t.place.kind === place.kind && (place.kind === "none" || id === null)) ?? null;
|
|
@@ -2067,11 +2157,20 @@ var gestureWords = (g2, i) => {
|
|
|
2067
2157
|
return `gesture ${i + 1} (${g2.type}${bits.length ? ` ${bits.join(" ")}` : ""})`;
|
|
2068
2158
|
};
|
|
2069
2159
|
var words = (e) => e instanceof Error ? e.message : String(e);
|
|
2160
|
+
var isWindowResize = (g2) => g2.type === "resize" && g2.edge === void 0 && g2.item === void 0 && g2.point !== void 0;
|
|
2161
|
+
function narrowestStage(row2) {
|
|
2162
|
+
const start = row2.settings?.stage ? row2.settings.stage.w : row2.scene.stage.width;
|
|
2163
|
+
return Math.min(start, ...row2.gestures.filter(isWindowResize).map((g2) => g2.point.x));
|
|
2164
|
+
}
|
|
2070
2165
|
function* steps(row2, host) {
|
|
2071
2166
|
const failures = [];
|
|
2072
2167
|
const skipped = [];
|
|
2073
2168
|
const n = row2.gestures.length;
|
|
2074
2169
|
const last = n - 1;
|
|
2170
|
+
const narrowest = narrowestStage(row2);
|
|
2171
|
+
if (row2.requires?.docks && host.dockMinWidth !== void 0 && narrowest < host.dockMinWidth) {
|
|
2172
|
+
return { ok: true, failures, skipped: [`the row: it needs docked panels at ${px(narrowest)} px, and the host docks from ${px(host.dockMinWidth)} px`] };
|
|
2173
|
+
}
|
|
2075
2174
|
const fail = (lines, when) => {
|
|
2076
2175
|
for (const l2 of lines) failures.push(`${row2.id}${when}: ${l2}`);
|
|
2077
2176
|
};
|
|
@@ -2139,7 +2238,7 @@ function* steps(row2, host) {
|
|
|
2139
2238
|
for (let i = 0; i < n; i++) {
|
|
2140
2239
|
const g2 = row2.gestures[i];
|
|
2141
2240
|
const sent = inStage(g2);
|
|
2142
|
-
if (g2
|
|
2241
|
+
if (isWindowResize(g2)) stage = { x: 0, y: 0, width: g2.point.x, height: g2.point.y };
|
|
2143
2242
|
const done = yield () => host.perform(ids.active ? mapGesture(sent, ids.to) : sent);
|
|
2144
2243
|
if (!done.ok) {
|
|
2145
2244
|
fail([`${gestureWords(g2, i)} failed: ${words(done.error)}`], "");
|
|
@@ -2211,7 +2310,7 @@ async function runCasesAsync(rows, makeHost, options = {}) {
|
|
|
2211
2310
|
}
|
|
2212
2311
|
|
|
2213
2312
|
// src/scene/cases/index.ts
|
|
2214
|
-
var CASES = [...DOCKING_ROWS, ...BAR_ROWS, ...RULE_ROWS, ...GESTURE_ROWS, ...WINDOW_ROWS];
|
|
2313
|
+
var CASES = withDocks([...DOCKING_ROWS, ...BAR_ROWS, ...RULE_ROWS, ...GESTURE_ROWS, ...WINDOW_ROWS]);
|
|
2215
2314
|
var CASE_GROUPS = [
|
|
2216
2315
|
{ id: "panels", title: "Panels in a column" },
|
|
2217
2316
|
{ id: "groups", title: "Groups and toolbars" },
|