@n-uf/placement 26.11.29 → 26.11.31
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 +62 -0
- package/README.md +105 -65
- package/dist/{chunk-7ASCUAGV.js → chunk-3ZICYLWL.js} +2 -2
- package/dist/{chunk-7ASCUAGV.js.map → chunk-3ZICYLWL.js.map} +1 -1
- package/dist/{chunk-3RRCKN74.js → chunk-AE3BWTAE.js} +2 -2
- package/dist/chunk-AE3BWTAE.js.map +1 -0
- package/dist/{chunk-3P6VOXA6.js → chunk-AVMZIXGO.js} +2 -2
- package/dist/{chunk-3P6VOXA6.js.map → chunk-AVMZIXGO.js.map} +1 -1
- package/dist/{chunk-PC5UHBW4.js → chunk-COK4YNMF.js} +87 -35
- package/dist/chunk-COK4YNMF.js.map +1 -0
- package/dist/{chunk-WLMJ6JGO.js → chunk-GIBUM6TB.js} +1 -1
- package/dist/chunk-GIBUM6TB.js.map +1 -0
- package/dist/{chunk-OYGOJWAX.js → chunk-JVAR67OL.js} +2 -2
- package/dist/{chunk-WM5FJ3IS.js → chunk-VLTYJHUA.js} +1 -1
- package/dist/{chunk-WM5FJ3IS.js.map → chunk-VLTYJHUA.js.map} +1 -1
- package/dist/{constructions-DSEjvWMP.d.ts → constructions-Cbz7uEAZ.d.ts} +3 -3
- package/dist/desk.d.ts +3 -3
- package/dist/desk.js +3 -3
- package/dist/dock.d.ts +4 -4
- package/dist/dock.js +2 -2
- package/dist/dock.js.map +1 -1
- package/dist/{float-fit-DRSOU_2y.d.ts → float-fit-DCYxRMru.d.ts} +1 -1
- package/dist/{geometry-CkZ6Fcfb.d.ts → geometry-Bf37LbCT.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{model-lYlnfQnl.d.ts → model-DMB2ZFJ2.d.ts} +25 -6
- package/dist/{model-CPM1Lv65.d.ts → model-X7eUaKlA.d.ts} +2 -2
- package/dist/panels.d.ts +5 -5
- package/dist/panels.js +3 -3
- package/dist/scene-cases.d.ts +59 -15
- package/dist/scene-cases.js +115 -21
- package/dist/scene-cases.js.map +1 -1
- package/dist/scene.d.ts +12 -7
- package/dist/scene.js +3 -3
- package/dist/stack.d.ts +6 -6
- package/dist/stack.js +2 -2
- package/dist/{target-D9PMr9pF.d.ts → target-2RYYKkd1.d.ts} +1 -1
- package/dist/{targets-BYRTTwCP.d.ts → targets-Du5_4T1u.d.ts} +4 -4
- package/dist/targets.d.ts +14 -14
- package/dist/targets.js +4 -4
- package/dist/targets.js.map +1 -1
- package/dist/toolbar.d.ts +11 -11
- package/dist/toolbar.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-3RRCKN74.js.map +0 -1
- package/dist/chunk-PC5UHBW4.js.map +0 -1
- package/dist/chunk-WLMJ6JGO.js.map +0 -1
- /package/dist/{chunk-OYGOJWAX.js.map → chunk-JVAR67OL.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
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 */\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":";AAwCO,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,EAA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E,EAAE,QAAQ,IAAI,GAAG,IAAI,GAAG,EAAE,EAAG,CAAC,IAAI,MAAM,GAAG,OAAO,OAAO,OAAO,GAAG,IAAI,kBAAe,CAAC;AAAA,EACvI;AACA,OAAK,KAAK,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE;AAC/B,QAAM,QAAQ,KAAK,IAAI,CAAC,GAAG,OAAO,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,IAAI,KAAK,KAAK,IAAI,CAAC,EAAG,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,SAAS,IAAI,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,EAAG,MAAM,CAAC,EAAW,EAAE;AAClK,SAAO,CAAC,GAAG,OAAO,GAAG,OAAO;AAC9B;","names":[]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
bandSize,
|
|
5
5
|
defOf,
|
|
6
6
|
floatSize
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3ZICYLWL.js";
|
|
8
8
|
|
|
9
9
|
// src/panels/store.ts
|
|
10
10
|
function storePanels(state) {
|
|
@@ -169,4 +169,4 @@ export {
|
|
|
169
169
|
storePanels,
|
|
170
170
|
readPanels
|
|
171
171
|
};
|
|
172
|
-
//# sourceMappingURL=chunk-
|
|
172
|
+
//# sourceMappingURL=chunk-JVAR67OL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/geometry.ts"],"sourcesContent":["/**\n * The shapes every entry shares. Plain data: a rect is a top-left corner and a size, in whatever px the consumer\n * lays out in (stage, window or host coordinates). The same shape as @n-uf/motion's, so the two compose without\n * either importing the other.\n */\n\nexport interface Rect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface Size {\n readonly width: number;\n readonly height: number;\n}\n\nexport interface Point {\n readonly x: number;\n readonly y: number;\n}\n\nexport const rect = (x: number, y: number, width: number, height: number): Rect => ({ x, y, width, height });\n\n/** The area two rects share (0 when apart). */\nexport const overlap = (a: Rect, b: Rect): number =>\n Math.max(0, Math.min(a.x + a.width, b.x + b.width) - Math.max(a.x, b.x)) * Math.max(0, Math.min(a.y + a.height, b.y + b.height) - Math.max(a.y, b.y));\n\n/** `r` moved (not resized) to lie inside `area`; one larger than the area keeps its top-left corner on the area's. */\nexport const clampInto = (r: Rect, area: Rect): Rect => ({\n ...r,\n x: Math.min(Math.max(r.x, area.x), Math.max(area.x, area.x + area.width - r.width)),\n y: Math.min(Math.max(r.y, area.y), Math.max(area.y, area.y + area.height - r.height)),\n});\n\n/** The
|
|
1
|
+
{"version":3,"sources":["../src/geometry.ts"],"sourcesContent":["/**\n * The shapes every entry shares. Plain data: a rect is a top-left corner and a size, in whatever px the consumer\n * lays out in (stage, window or host coordinates). The same shape as @n-uf/motion's, so the two compose without\n * either importing the other.\n */\n\nexport interface Rect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface Size {\n readonly width: number;\n readonly height: number;\n}\n\nexport interface Point {\n readonly x: number;\n readonly y: number;\n}\n\nexport const rect = (x: number, y: number, width: number, height: number): Rect => ({ x, y, width, height });\n\n/** The area two rects share (0 when apart). */\nexport const overlap = (a: Rect, b: Rect): number =>\n Math.max(0, Math.min(a.x + a.width, b.x + b.width) - Math.max(a.x, b.x)) * Math.max(0, Math.min(a.y + a.height, b.y + b.height) - Math.max(a.y, b.y));\n\n/** `r` moved (not resized) to lie inside `area`; one larger than the area keeps its top-left corner on the area's. */\nexport const clampInto = (r: Rect, area: Rect): Rect => ({\n ...r,\n x: Math.min(Math.max(r.x, area.x), Math.max(area.x, area.x + area.width - r.width)),\n y: Math.min(Math.max(r.y, area.y), Math.max(area.y, area.y + area.height - r.height)),\n});\n\n/** The center of a rect. */\nexport const centre = (r: Rect): Point => ({ x: r.x + r.width / 2, y: r.y + r.height / 2 });\n\n/** The tolerance the geometry compares with, px. */\nexport const EPS = 1e-6;\n\n/** A rect that covers any point a page can see (a float target's hit). */\nexport const PLANE: Rect = rect(-1e9, -1e9, 2e9, 2e9);\n\n/** A rect's area (a negative side counts as 0). */\nexport const area = (r: Rect): number => Math.max(0, r.width) * Math.max(0, r.height);\n\n/** Whether two rects share more than `eps` each way (touching edges don't overlap). */\nexport const overlaps = (a: Rect, b: Rect, eps = EPS): boolean =>\n Math.min(a.x + a.width, b.x + b.width) - Math.max(a.x, b.x) > eps && Math.min(a.y + a.height, b.y + b.height) - Math.max(a.y, b.y) > eps;\n\n/** Whether `p` lies in `r`, its edges included (within `eps`). */\nexport const contains = (r: Rect, p: Point, eps = EPS): boolean => p.x >= r.x - eps && p.x <= r.x + r.width + eps && p.y >= r.y - eps && p.y <= r.y + r.height + eps;\n\n/** `v` within `lo..hi` (`lo` wins when `hi` is under it). */\nexport const clamp = (v: number, lo: number, hi: number): number => Math.min(Math.max(v, lo), Math.max(lo, hi));\n\n/** `r` less `cut`, as disjoint rects: the parts beside the cut whole, then above and below it within its width. */\nexport function subtract(r: Rect, cut: Rect): Rect[] {\n if (!overlaps(r, cut)) return [r];\n const right = r.x + r.width;\n const bottom = r.y + r.height;\n const x0 = Math.max(r.x, cut.x);\n const x1 = Math.min(right, cut.x + cut.width);\n return [\n rect(r.x, r.y, x0 - r.x, r.height),\n rect(x1, r.y, right - x1, r.height),\n rect(x0, r.y, x1 - x0, Math.min(bottom, cut.y) - r.y),\n rect(x0, Math.max(r.y, cut.y + cut.height), x1 - x0, bottom - Math.max(r.y, cut.y + cut.height)),\n ].filter((p) => area(p) > EPS);\n}\n\n/**\n * Hit sizes the targets share: how far a column line's hit reaches on each side of the line, and how deep a side takes\n * a rail drop while it shows no rail, px.\n */\nexport const COLUMN_REACH = 22;\nexport const RAIL_EDGE = 10;\n"],"mappings":";AAuBO,IAAM,OAAO,CAAC,GAAW,GAAW,OAAe,YAA0B,EAAE,GAAG,GAAG,OAAO,OAAO;AAGnG,IAAM,UAAU,CAAC,GAAS,MAC/B,KAAK,IAAI,GAAG,KAAK,IAAI,EAAE,IAAI,EAAE,OAAO,EA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E,KAAK,EAAE,IAAI,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS;AAG1J,IAAM,QAAQ,CAAC,GAAW,IAAY,OAAuB,KAAK,IAAI,KAAK,IAAI,GAAG,EAAE,GAAG,KAAK,IAAI,IAAI,EAAE,CAAC;AAGvG,SAAS,SAAS,GAAS,KAAmB;AACnD,MAAI,CAAC,SAAS,GAAG,GAAG,EAAG,QAAO,CAAC,CAAC;AAChC,QAAM,QAAQ,EAAE,IAAI,EAAE;AACtB,QAAM,SAAS,EAAE,IAAI,EAAE;AACvB,QAAM,KAAK,KAAK,IAAI,EAAE,GAAG,IAAI,CAAC;AAC9B,QAAM,KAAK,KAAK,IAAI,OAAO,IAAI,IAAI,IAAI,KAAK;AAC5C,SAAO;AAAA,IACL,KAAK,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,MAAM;AAAA,IACjC,KAAK,IAAI,EAAE,GAAG,QAAQ,IAAI,EAAE,MAAM;AAAA,IAClC,KAAK,IAAI,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;AAAA,IACpD,KAAK,IAAI,KAAK,IAAI,EAAE,GAAG,IAAI,IAAI,IAAI,MAAM,GAAG,KAAK,IAAI,SAAS,KAAK,IAAI,EAAE,GAAG,IAAI,IAAI,IAAI,MAAM,CAAC;AAAA,EACjG,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG;AAC/B;AAMO,IAAM,eAAe;AACrB,IAAM,YAAY;","names":["area"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as Rect, S as Size } from './geometry-
|
|
1
|
+
import { R as Rect, S as Size } from './geometry-Bf37LbCT.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The desk's model: panels and documents, the options, the state every construction keeps, and what a layout
|
|
@@ -100,7 +100,7 @@ interface DeskState {
|
|
|
100
100
|
};
|
|
101
101
|
/** Panels torn off a dock, floating (edge docks + tear-off). */
|
|
102
102
|
readonly torn: readonly Free[];
|
|
103
|
-
/** The tiling tree: item keys in the left column, the right column and the
|
|
103
|
+
/** The tiling tree: item keys in the left column, the right column and the center (dwindle order). */
|
|
104
104
|
readonly tree: {
|
|
105
105
|
readonly L: readonly string[];
|
|
106
106
|
readonly R: readonly string[];
|
|
@@ -180,7 +180,7 @@ interface Layout {
|
|
|
180
180
|
readonly notes: readonly Note[];
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
183
|
-
* The same state with these documents open: new ones join the tiling tree's
|
|
183
|
+
* The same state with these documents open: new ones join the tiling tree's center (the first one at its front)
|
|
184
184
|
* and get a strip column of their own after the last document column; closed ones leave both.
|
|
185
185
|
*/
|
|
186
186
|
declare function withDocs(s: DeskState, docs: readonly number[], focus: number | null): DeskState;
|
package/dist/desk.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as PanelsOptions, a as PanelDef, b as PanelsState, c as PanelTargetInput, d as PanelTarget, p as panelDrop, e as PanelDrop, l as layoutPanels, f as PanelsLayout } from './targets-
|
|
2
|
-
import './geometry-
|
|
3
|
-
import './target-
|
|
1
|
+
import { P as PanelsOptions, a as PanelDef, b as PanelsState, c as PanelTargetInput, d as PanelTarget, p as panelDrop, e as PanelDrop, l as layoutPanels, f as PanelsLayout } from './targets-Du5_4T1u.js';
|
|
2
|
+
import './geometry-Bf37LbCT.js';
|
|
3
|
+
import './target-2RYYKkd1.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @n-uf/placement/desk: desk presets as data on `@n-uf/placement/panels`. A preset is options for the panels engine
|
package/dist/desk.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-JVAR67OL.js";
|
|
2
2
|
import {
|
|
3
3
|
createPanels,
|
|
4
4
|
floatSize,
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
panelDrop,
|
|
7
7
|
panelTargets,
|
|
8
8
|
showTabs
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-3ZICYLWL.js";
|
|
10
|
+
import "./chunk-VLTYJHUA.js";
|
|
11
11
|
|
|
12
12
|
// src/desk/index.ts
|
|
13
13
|
function split(defs, hint = {}) {
|
package/dist/dock.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as Catalog, D as DeskState, N as Note } from './constructions-
|
|
2
|
-
export { a as Construction, b as ConstructionId, c as DEFAULT_OPTIONS, d as Desk, e as DeskSpec, f as DeskStart, F as Free, G, L as LAYER, g as Layout, h as Look, i as NoteCode, O as Options, P as PanelSpec, j as Placed, S as Side, k as createDesk, l as docKey, m as draggable, n as idOf, o as isDocKey, p as isPanelKey, q as liftOut, r as panelKey, t as toggleClosed, s as toggleFold, u as touch, w as withActive, v as withDocs } from './constructions-
|
|
3
|
-
import { S as Size } from './geometry-
|
|
1
|
+
import { C as Catalog, D as DeskState, N as Note } from './constructions-Cbz7uEAZ.js';
|
|
2
|
+
export { a as Construction, b as ConstructionId, c as DEFAULT_OPTIONS, d as Desk, e as DeskSpec, f as DeskStart, F as Free, G, L as LAYER, g as Layout, h as Look, i as NoteCode, O as Options, P as PanelSpec, j as Placed, S as Side, k as createDesk, l as docKey, m as draggable, n as idOf, o as isDocKey, p as isPanelKey, q as liftOut, r as panelKey, t as toggleClosed, s as toggleFold, u as touch, w as withActive, v as withDocs } from './constructions-Cbz7uEAZ.js';
|
|
3
|
+
import { S as Size } from './geometry-Bf37LbCT.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The parts the desk constructions are built from, each pure: the toolbar pill, the documents' tiles, natural-height
|
|
@@ -19,7 +19,7 @@ interface StripGeometry {
|
|
|
19
19
|
readonly total: number;
|
|
20
20
|
readonly scroll: number;
|
|
21
21
|
}
|
|
22
|
-
/** The strip's columns and scroll: scrolled by hand, else to
|
|
22
|
+
/** The strip's columns and scroll: scrolled by hand, else to center the focused document's column. */
|
|
23
23
|
declare function stripGeometry(cat: Catalog, s: DeskState, size: Size, notes?: Note[]): StripGeometry;
|
|
24
24
|
|
|
25
25
|
export { Catalog, DeskState, Note, type StripGeometry, stripGeometry };
|
package/dist/dock.js
CHANGED
|
@@ -47,11 +47,11 @@ import {
|
|
|
47
47
|
treeTiles,
|
|
48
48
|
withActive,
|
|
49
49
|
withDocs
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-AVMZIXGO.js";
|
|
51
51
|
import {
|
|
52
52
|
clampInto,
|
|
53
53
|
rect
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-VLTYJHUA.js";
|
|
55
55
|
|
|
56
56
|
// src/dock/constructions.ts
|
|
57
57
|
function docks(cat, s, size, opt, mode, notes) {
|
package/dist/dock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dock/constructions.ts"],"sourcesContent":["/**\n * The nine desk constructions, presets built from the parts: a state, the stage size and the options in, a placed\n * rect per item out, plus notes saying how it gave way. How each one gives way when width or height runs out:\n *\n * - Edge docks (`docks`): sections fold to headers (least recently used first), the bottom dock folds to its\n * header, the docks fold to their rails (right first). `docksFull` runs the bottom dock across the full width.\n * - One tiling tree (`tree`): the newest tile that breaks a minimum floats.\n * - Navigator + inspector (`navigator`): the sides fold to icon tabs; height never matters.\n * - Scrolling strip (`strip`): a column whose minimums don't fit splits in two; the strip scrolls to the focus.\n * - Drawers (`drawers`): below a width a drawer slides over the documents instead of pushing them.\n * - Palettes over the documents (`floatOver`), and palettes with the documents tiled around them (`floatAround`):\n * the least recently used shade to their title bars; narrow, the stacks merge in one corner.\n * - Edge docks + tear-off (`dockTear`): as the edge docks, and torn-off panels float (and shade when they don't fit).\n */\nimport { clampInto, rect, type Size } from \"../geometry\";\nimport { columnHeights, share } from \"./arrange\";\nimport {\n DRAWER_DOCK,\n OVER_MARGIN,\n TORN_W,\n TREE_COLUMN,\n accordion,\n aroundDocs,\n bar,\n dockGeometry,\n intoRail,\n paletteArea,\n palettes,\n pill,\n pillBetween,\n plural,\n rail,\n stripGeometry,\n stripMin,\n tabbed,\n tabbedIntoRail,\n tileMin,\n tiles,\n treeArea,\n treeFloats,\n treeRails,\n treeShown,\n treeTiles,\n DOCK,\n type Out,\n} from \"./parts\";\nimport { BAR, G, LAYER, RAIL, TITLE, catalogOf, idOf, isDocKey, panelKey, startState, type Catalog, type DeskSpec, type DeskState, type Layout, type Note, type Options, type Side } from \"./model\";\n\n// --- edge docks (docks, docksFull, dockTear) ------------------------------------------------------------------------\n\nfunction docks(cat: Catalog, s: DeskState, size: { width: number; height: number }, opt: Options, mode: \"between\" | \"full\", notes: Note[]): Out {\n const out: Out = new Map();\n const { width: W, height: H } = size;\n const d = dockGeometry(cat, s, size, opt, mode, notes);\n rail(out, \"left\", 0, 0, d.h, s.left);\n rail(out, \"right\", W - RAIL, 0, d.h, d.right);\n let folded = 0;\n if (d.lOpen) folded += accordion(cat, out, s, RAIL + G, G, DOCK - G, d.h - 2 * G, s.left);\n else intoRail(cat, out, 0, 0, DOCK - G, s.left, \"left\");\n if (d.rOpen) folded += accordion(cat, out, s, W - RAIL - DOCK, G, DOCK - G, d.h - 2 * G, d.right);\n else intoRail(cat, out, W - RAIL, 0, DOCK - G, d.right, \"right\");\n if (folded) notes.push({ code: \"sections-folded\", text: `${plural(folded, \"section\", \"sections\")} folded to ${folded > 1 ? \"headers\" : \"a header\"}` });\n // Reserved: the documents end above the bottom dock. Overlay: it floats over the documents' lower part.\n const overlay = opt.bottom === \"overlay\";\n if (d.bottomRect) {\n const b = d.bottomRect;\n const n = s.bottom.length;\n const w = (b.width - G * (n - 1)) / n;\n s.bottom.forEach((id, i) => {\n const open = d.bh > TITLE;\n out.set(panelKey(id), {\n rect: rect(b.x + i * (w + G), b.y, w, b.height),\n look: overlay ? (open ? \"float\" : \"header\") : open ? \"section\" : \"header\",\n layer: overlay ? LAYER.overlay : LAYER.dock,\n accent: true,\n ...(overlay ? { shadow: true } : {}),\n ...(open ? { min: { height: cat.natural(id) } } : {}),\n });\n });\n }\n const docsBottom = d.bottomOn && !overlay ? H - G - d.bh : H;\n const p = pill(opt, d.x0, d.x1 - d.x0, 0, overlay && d.bottomOn ? H - G - d.bh : docsBottom);\n // With the bottom dock floating, the documents run down under it (but never under a reserved bottom pill).\n const bottomOfDocs = overlay && d.bottomOn && !(opt.toolbar === \"bottom\" && opt.toolbarSpace === \"reserved\") ? H - G : p.bottom;\n tiles(out, rect(d.x0, p.top, d.x1 - d.x0, bottomOfDocs - p.top), s.docs);\n out.set(\"toolbar\", p.placed);\n return out;\n}\n\n/** Tear-off: torn-off panels float over the documents; one that doesn't fit the stage's height shades to its title bar. */\nfunction tornOff(cat: Catalog, out: Out, s: DeskState, size: Size, notes: Note[]): void {\n const docRects = [...out.entries()].filter(([k]) => isDocKey(k)).map(([, p]) => p.rect);\n const right = docRects.length ? Math.max(...docRects.map((r) => r.x + r.width)) : size.width / 2;\n const top = docRects.length ? Math.min(...docRects.map((r) => r.y)) : 0;\n let shaded = 0;\n s.torn.forEach((f, i) => {\n const full = cat.natural(f.id);\n const at = f.at ?? { x: right - 12 - TORN_W - 22 * i, y: top + 40 + 22 * i };\n const fits = at.y + full <= size.height - G;\n const shade = s.folded.includes(f.id) || !fits;\n if (!fits && !s.folded.includes(f.id)) shaded++;\n const r = clampInto(rect(at.x, at.y, TORN_W, shade ? TITLE : full), rect(0, 0, size.width, size.height));\n out.set(panelKey(f.id), { rect: r, look: shade ? \"header\" : \"float\", layer: LAYER.float, shadow: true, ...(shade ? {} : { min: { height: full } }) });\n });\n if (s.torn.length) {\n const items = s.torn.map((f) => panelKey(f.id));\n notes.push({ code: \"torn-floating\", items, text: `${items.map(cat.title).join(\", \")} ${items.length > 1 ? \"float\" : \"floats\"}; drop on a dock or its rail icon to dock again` });\n }\n if (shaded) notes.push({ code: \"torn-shaded\", text: `${plural(shaded, \"floating panel\", \"floating panels\")} shaded` });\n}\n\n// --- one tiling tree (tree) --------------------------------------------------------------------------------------------\n\nfunction tree(cat: Catalog, s: DeskState, size: Size, notes: Note[]): Out {\n const out: Out = new Map();\n const area = treeArea(size, s);\n // A column folded to its rail: icons at the stage's edge, its panels hidden into them.\n const rails = treeRails(s);\n for (const side of [\"left\", \"right\"] as const) {\n if (!rails[side]) continue;\n const ids = (side === \"left\" ? s.tree.L : s.tree.R).map(idOf);\n const x = side === \"left\" ? 0 : size.width - RAIL;\n rail(out, side, x, BAR, size.height - BAR, ids);\n intoRail(cat, out, x, BAR, TREE_COLUMN, ids, side);\n }\n if (rails.left || rails.right) {\n const both = rails.left && rails.right;\n const text = `${both ? \"both side columns\" : `the ${rails.left ? \"left\" : \"right\"} column`} folded to ${both ? \"their rails\" : \"its rail\"}`;\n notes.push({ code: \"columns-railed\", text, ...(both ? {} : { side: rails.left ? \"left\" : \"right\" }) });\n }\n const { tree: t, floats } = treeFloats(cat, treeShown(s), area);\n for (const [k, r] of treeTiles(cat, t, area)) out.set(k, { rect: r, look: isDocKey(k) ? \"doc\" : \"tile\", layer: LAYER.doc, min: tileMin(cat, k) });\n floats.forEach((k, i) => {\n const m = isDocKey(k) ? { w: 300, h: 190 } : { w: 200, h: cat.natural(idOf(k)) };\n const r = clampInto(rect(size.width / 2 - m.w / 2 + 22 * i, BAR + 40 + 22 * i, m.w, m.h), rect(0, 0, size.width, size.height));\n out.set(k, { rect: r, look: isDocKey(k) ? \"doc\" : \"float\", layer: LAYER.float, shadow: true });\n });\n if (floats.length) notes.push({ code: \"tiles-float\", items: floats, text: `${plural(floats.length, \"tile floats\", \"tiles float\")} (newest first): ${floats.map(cat.title).join(\", \")}` });\n out.set(\"toolbar\", bar(size.width));\n return out;\n}\n\n/**\n * The tree's start: on a stage too narrow for the documents to tile between the side columns, the columns start folded to\n * their rails (the right one first), then the centre's panels join the folded right column, so nothing floats\n * until a rail icon opens a column.\n */\nfunction treeStart(cat: Catalog, docs: readonly number[], size?: Size): DeskState {\n const s = startState(cat, docs);\n if (!size) return s;\n const both = { ...s, closed: [\"right\", \"left\"] as Side[] };\n const panels = s.tree.C.filter((k) => !isDocKey(k));\n const tries: DeskState[] = [s, { ...s, closed: [\"right\"] }, both, { ...both, tree: { ...s.tree, R: [...s.tree.R, ...panels], C: s.tree.C.filter(isDocKey) } }];\n return tries.find((st) => treeFloats(cat, treeShown(st), treeArea(size, st)).floats.length === 0) ?? tries.at(-1)!;\n}\n\n// --- navigator + inspector (navigator), and drawers (drawers) ----------------------------------------------------------------------\n\nconst NAV_L = 240;\nconst NAV_R = 240;\nconst NAV_MIN = 380;\n\nfunction navigator(cat: Catalog, s: DeskState, size: Size, opt: Options, notes: Note[]): Out {\n const out: Out = new Map();\n const { width: W, height: H } = size;\n let lw = s.left.length ? NAV_L : 0;\n let rw = s.right.length ? NAV_R : 0;\n if (rw && W - lw - rw < NAV_MIN) {\n rw = RAIL;\n notes.push({ code: \"tabs-folded\", side: \"right\", text: \"inspector folded to icon tabs\" });\n }\n if (lw && W - lw - rw < NAV_MIN) {\n lw = RAIL;\n notes.push({ code: \"tabs-folded\", side: \"left\", text: \"navigator folded to icon tabs\" });\n }\n const side = (sd: Side, x: number, w: number, full: number, ids: readonly number[]): void => {\n if (w === RAIL) {\n rail(out, sd, x, 0, H, ids);\n tabbedIntoRail(cat, out, sd, ids, x, 0, full);\n } else if (w > 0) {\n rail(out, sd, sd === \"left\" ? x : x + w - RAIL, 0, H, ids, true);\n tabbed(out, sd, ids, s.active[sd], x, 0, w, H, false);\n }\n };\n side(\"left\", 0, lw, NAV_L, s.left);\n side(\"right\", W - rw, rw, NAV_R, s.right);\n const cx = lw + G;\n const cw = W - lw - rw - 2 * G;\n const p = pill(opt, cx, cw, 0, H);\n tiles(out, rect(cx, p.top, cw, p.bottom - p.top), s.docs);\n out.set(\"toolbar\", p.placed);\n return out;\n}\n\nconst DRAWER_L = 240;\nconst DRAWER_R = 240;\n\nfunction drawers(cat: Catalog, s: DeskState, size: Size, notes: Note[]): Out {\n const out: Out = new Map();\n const { width: W, height: H } = size;\n const y = BAR;\n const h = H - BAR;\n const rDocked = W >= DRAWER_DOCK.right;\n const lDocked = W >= DRAWER_DOCK.left;\n const lOpen = s.left.length > 0 && !s.closed.includes(\"left\");\n const rOpen = s.right.length > 0 && !s.closed.includes(\"right\");\n if (!rDocked && rOpen) notes.push({ code: \"drawer-over\", side: \"right\", text: \"right drawer slides over the documents\" });\n if (!lDocked && lOpen) notes.push({ code: \"drawer-over\", side: \"left\", text: rDocked || !rOpen ? \"left drawer slides over the documents\" : \"left drawer slides over too\" });\n rail(out, \"left\", 0, y, h, s.left);\n rail(out, \"right\", W - RAIL, y, h, s.right);\n const x0 = RAIL + (lDocked && lOpen ? DRAWER_L : 0) + G;\n const x1 = W - RAIL - (rDocked && rOpen ? DRAWER_R : 0) - G;\n tiles(out, rect(x0, y + G, x1 - x0, h - 2 * G), s.docs);\n // Both sliding over a stage too narrow for the two side by side: each takes half the room between the rails.\n const both = !lDocked && !rDocked && lOpen && rOpen;\n const half = (W - 2 * RAIL - G) / 2;\n const lw = both ? Math.min(DRAWER_L, half) : DRAWER_L;\n const rw = both ? Math.min(DRAWER_R, half) : DRAWER_R;\n if (lOpen) tabbed(out, \"left\", s.left, s.active.left, RAIL, y, lw, h, !lDocked);\n else tabbedIntoRail(cat, out, \"left\", s.left, 0, y, DRAWER_L);\n if (rOpen) tabbed(out, \"right\", s.right, s.active.right, W - RAIL - rw, y, rw, h, !rDocked);\n else tabbedIntoRail(cat, out, \"right\", s.right, W - RAIL, y, DRAWER_R);\n out.set(\"toolbar\", bar(W));\n return out;\n}\n\n// --- scrolling strip (strip) --------------------------------------------------------------------------------------------\n\nfunction strip(cat: Catalog, s: DeskState, size: Size, notes: Note[]): Out {\n const out: Out = new Map();\n const { width: W, height: H } = size;\n const g = stripGeometry(cat, s, size, notes);\n g.cols.forEach((c, ci) => {\n // A column of panels: each at its natural height, the last taking the rest; documents share as before.\n const mins = c.map((k) => stripMin(cat, k));\n const heights = c.some(isDocKey) ? share(g.h - G * (c.length - 1), mins) : columnHeights(g.h, mins, G);\n let cy = g.y;\n c.forEach((k, i) => {\n out.set(k, { rect: rect(g.xs[ci]!, cy, g.widths[ci]!, heights[i]!), look: isDocKey(k) ? \"doc\" : \"tile\", layer: LAYER.doc, offStage: true, min: { width: g.widths[ci]!, height: mins[i]! } });\n cy += heights[i]! + G;\n });\n });\n const scrolls = g.total > W;\n if (scrolls) notes.push({ code: \"strip-scrolls\", text: `the strip is ${Math.round(g.total)} wide: ${Math.round(g.total - W)} px off screen, reached by scrolling` });\n out.set(\"track\", { rect: rect(0, H - 5, W, 5), look: \"track\", layer: LAYER.toolbar, ...(scrolls ? {} : { hidden: true }) });\n const tw = scrolls ? (W / g.total) * W : W;\n out.set(\"thumb\", { rect: rect(scrolls ? (g.scroll / g.total) * W : 0, H - 5, tw, 5), look: \"thumb\", layer: LAYER.toolbar, ...(scrolls ? {} : { hidden: true }) });\n out.set(\"toolbar\", bar(W));\n return out;\n}\n\n// --- floating palettes (floatOver, floatAround) --------------------------------------------------------------------\n\nfunction floatOver(cat: Catalog, s: DeskState, size: Size, opt: Options, notes: Note[]): Out {\n const out: Out = new Map();\n const { area } = paletteArea(size, opt);\n const pals = palettes(cat, s, area, size.width, OVER_MARGIN, notes);\n const tb = pillBetween(opt, size, [...pals.values()].map((p) => p.rect));\n tiles(out, area, s.docs);\n let covered = 0;\n for (const [id, p] of pals) {\n out.set(panelKey(id), { rect: p.rect, look: p.shaded ? \"header\" : \"float\", layer: LAYER.float, shadow: true, ...(p.shaded ? {} : { min: { height: cat.natural(id) } }) });\n covered += p.rect.width * p.rect.height;\n }\n notes.push({ code: \"palettes-cover\", text: `palettes cover ${Math.round((covered / (area.width * area.height)) * 100)}% of the documents` });\n out.set(\"toolbar\", tb);\n return out;\n}\n\nfunction floatAround(cat: Catalog, s: DeskState, size: Size, opt: Options, notes: Note[]): Out {\n const out: Out = new Map();\n const { area } = paletteArea(size, opt);\n const pals = palettes(cat, s, area, size.width, 0, notes);\n const tb = pillBetween(opt, size, [...pals.values()].map((p) => p.rect));\n const docsRect = aroundDocs(pals, area);\n tiles(out, docsRect, s.docs);\n let used = docsRect.width * docsRect.height;\n for (const [id, p] of pals) {\n out.set(panelKey(id), { rect: p.rect, look: p.shaded ? \"header\" : \"palette\", layer: LAYER.palette, shadow: true, ...(p.shaded ? {} : { min: { height: cat.natural(id) } }) });\n used += p.rect.width * p.rect.height;\n }\n notes.push({ code: \"docs-room\", text: `documents get ${Math.round(docsRect.width)} px of width; ${Math.max(0, Math.round((1 - used / (area.width * area.height)) * 100))}% of the desk stays empty under short stacks` });\n out.set(\"toolbar\", tb);\n return out;\n}\n\n// --- the presets ---------------------------------------------------------------------------------------------------\n\nexport type ConstructionId = \"docks\" | \"docksFull\" | \"tree\" | \"navigator\" | \"strip\" | \"drawers\" | \"floatOver\" | \"floatAround\" | \"dockTear\";\n\nexport interface Construction {\n readonly id: ConstructionId;\n readonly title: string;\n readonly idea: string;\n /** It has a floating toolbar pill (top or bottom, reserved or overlay). */\n readonly pill: boolean;\n /** It has a bottom dock (reserved, floating or off). */\n readonly bottom: boolean;\n /** The arrangement it starts from (at this stage size, when it depends on one). */\n readonly initial: (docs: readonly number[], size?: Size) => DeskState;\n readonly layout: (s: DeskState, size: Size, opt: Options) => Layout;\n /** The desk it belongs to (its catalog). */\n readonly desk: Desk;\n}\n\n/** A desk: the catalog, its nine constructions, and the catalog-bound helpers. */\nexport interface Desk {\n readonly catalog: Catalog;\n readonly constructions: readonly Construction[];\n readonly constructionOf: (id: ConstructionId) => Construction;\n /** The arrangement every construction starts from, with these documents open (none by default). */\n readonly initialState: (docs?: readonly number[]) => DeskState;\n readonly natural: (id: number) => number;\n readonly titleOf: (key: string) => string;\n}\n\ntype LayoutFn = (s: DeskState, size: Size, opt: Options, notes: Note[]) => Out;\n\nconst withNotes = (f: LayoutFn) => (s: DeskState, size: Size, opt: Options): Layout => {\n const notes: Note[] = [];\n const items = f(s, size, opt, notes);\n return { items, notes };\n};\n\n/**\n * A desk for these panels: the nine constructions as presets, each a pure layout over the shared state.\n *\n * ```ts\n * const desk = createDesk({ panels: [{ id: 1, title: \"Files\", natural: 160 }], start: { left: [1], right: [], bottom: [] } });\n * const c = desk.constructionOf(\"docks\");\n * const { items, notes } = c.layout(c.initial([1, 2]), { width: 960, height: 560 }, DEFAULT_OPTIONS);\n * ```\n */\nexport function createDesk(spec: DeskSpec): Desk {\n const cat = catalogOf(spec);\n const initial = (docs?: readonly number[]): DeskState => startState(cat, docs);\n const sides = (patch: (s: DeskState) => Partial<DeskState>) => (docs: readonly number[]): DeskState => {\n const s = startState(cat, docs);\n return { ...s, ...patch(s) };\n };\n // Navigator and drawers have no bottom dock: its panels join the right side.\n const noBottom = sides((s) => ({ right: [...s.right, ...s.bottom], bottom: [] }));\n const plain = sides(() => ({}));\n const list: Omit<Construction, \"desk\">[] = [\n {\n id: \"docks\",\n title: \"Edge docks\",\n idea: \"Each side is a dock with a rail of icons; its panels are accordion sections. Short on height, the least recently used fold to headers; short on width, a whole dock folds to its rail (right first). The bottom dock sits between the side docks.\",\n pill: true,\n bottom: true,\n initial: plain,\n layout: withNotes((s, size, opt, notes) => docks(cat, s, size, opt, \"between\", notes)),\n },\n {\n id: \"docksFull\",\n title: \"Edge docks, full-width bottom dock\",\n idea: \"As the edge docks, except the bottom dock runs under everything across the full width; the side docks and their rails stop above it, so they fold sooner.\",\n pill: true,\n bottom: true,\n initial: plain,\n layout: withNotes((s, size, opt, notes) => docks(cat, s, size, opt, \"full\", notes)),\n },\n {\n id: \"tree\",\n title: \"One tiling tree\",\n idea: \"Panels and documents are tiles of one tree, so a panel can sit beside a document. One rule for all: the newest tile that breaks a minimum floats. Opened on a narrow stage, the side columns start folded to rails at its edges.\",\n pill: false,\n bottom: false,\n initial: (docs, size) => treeStart(cat, docs, size),\n layout: withNotes((s, size, _opt, notes) => tree(cat, s, size, notes)),\n },\n {\n id: \"navigator\",\n title: \"Navigator + inspector\",\n idea: \"A fixed left and right side, one panel showing per side (tabs); the toolbar floats over the canvas. Narrow, the sides fold to icon tabs. Height never matters.\",\n pill: true,\n bottom: false,\n initial: noBottom,\n layout: withNotes((s, size, opt, notes) => navigator(cat, s, size, opt, notes)),\n },\n {\n id: \"strip\",\n title: \"Scrolling strip\",\n idea: \"Panels and documents are columns of a strip wider than the screen; nothing shrinks below its minimum, the view scrolls to the focus instead. Short on height, a column splits in two.\",\n pill: false,\n bottom: false,\n initial: plain,\n layout: withNotes((s, size, _opt, notes) => strip(cat, s, size, notes)),\n },\n {\n id: \"drawers\",\n title: \"Drawers\",\n idea: \"Documents take the screen; each side is a drawer with tabs. Wide, the drawers dock and push; narrow, they slide over the documents.\",\n pill: false,\n bottom: false,\n initial: noBottom,\n layout: withNotes((s, size, _opt, notes) => drawers(cat, s, size, notes)),\n },\n {\n id: \"floatOver\",\n title: \"Floating palettes over the documents\",\n idea: \"Documents take the whole desk; panels are palettes floating over them at their natural size, stacked in the top corners and draggable anywhere. Short on height, the least recently used shade to their title bars; the documents never move.\",\n pill: true,\n bottom: false,\n initial: plain,\n layout: withNotes((s, size, opt, notes) => floatOver(cat, s, size, opt, notes)),\n },\n {\n id: \"floatAround\",\n title: \"Floating palettes, documents tile around\",\n idea: \"Palettes float at their natural size but reserve their footprint: the documents tile in the space between them. Nothing is covered; the space under a short stack stays empty.\",\n pill: true,\n bottom: false,\n initial: plain,\n layout: withNotes((s, size, opt, notes) => floatAround(cat, s, size, opt, notes)),\n },\n {\n id: \"dockTear\",\n title: \"Edge docks + tear-off\",\n idea: \"The edge docks, and any panel can be torn off to float over the documents and dropped back on a dock or its rail icon. Docked is the default; floating is the exception you choose.\",\n pill: true,\n bottom: true,\n initial: plain,\n layout: withNotes((s, size, opt, notes) => {\n const out = docks(cat, s, size, opt, \"between\", notes);\n tornOff(cat, out, s, size, notes);\n return out;\n }),\n },\n ];\n const constructions: Construction[] = [];\n const desk: Desk = {\n catalog: cat,\n constructions,\n constructionOf: (id) => constructions.find((c) => c.id === id)!,\n initialState: initial,\n natural: cat.natural,\n titleOf: cat.title,\n };\n constructions.push(...list.map((c) => ({ ...c, desk })));\n return desk;\n}\n\n/** Which items a construction lets the pointer drag: panels everywhere, documents in the tree and the strip. */\nexport const draggable = (c: Construction, key: string): boolean => key.startsWith(\"panel:\") || (key.startsWith(\"doc:\") && (c.id === \"tree\" || c.id === \"strip\"));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAS,MAAM,KAAc,GAAc,MAAyC,KAAc,MAA0B,OAAoB;AAC9I,QAAM,MAAW,oBAAI,IAAI;AACzB,QAAM,EAAE,OAAO,GAAG,QAAQ,EAAE,IAAI;AAChC,QAAM,IAAI,aAAa,KAAK,GAAG,MAAM,KAAK,MAAM,KAAK;AACrD,OAAK,KAAK,QAAQ,GAAG,GAAG,EAAE,GAAG,EAAE,IAAI;AACnC,OAAK,KAAK,SAAS,IAAI,MAAM,GAAG,EAAE,GAAG,EAAE,KAAK;AAC5C,MAAI,SAAS;AACb,MAAI,EAAE,MAAO,WAAU,UAAU,KAAK,KAAK,GAAG,OAAO,GAAG,GAAG,OAAO,GAAG,EAAE,IAAI,IAAI,GAAG,EAAE,IAAI;AAAA,MACnF,UAAS,KAAK,KAAK,GAAG,GAAG,OAAO,GAAG,EAAE,MAAM,MAAM;AACtD,MAAI,EAAE,MAAO,WAAU,UAAU,KAAK,KAAK,GAAG,IAAI,OAAO,MAAM,GAAG,OAAO,GAAG,EAAE,IAAI,IAAI,GAAG,EAAE,KAAK;AAAA,MAC3F,UAAS,KAAK,KAAK,IAAI,MAAM,GAAG,OAAO,GAAG,EAAE,OAAO,OAAO;AAC/D,MAAI,OAAQ,OAAM,KAAK,EAAE,MAAM,mBAAmB,MAAM,GAAG,OAAO,QAAQ,WAAW,UAAU,CAAC,cAAc,SAAS,IAAI,YAAY,UAAU,GAAG,CAAC;AAErJ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AAA,MACN,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,QAAQ,UAAU,CAAC,GAAG,MAAM,KAAK,UAAU,YAAY,KAAK,GAAG,MAAM,KAAK,KAAK,CAAC;AAAA,IAClF;AAAA,IACA;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,QAAQ,UAAU,CAAC,GAAG,MAAM,KAAK,UAAU;AACzC,cAAM,MAAM,MAAM,KAAK,GAAG,MAAM,KAAK,WAAW,KAAK;AACrD,gBAAQ,KAAK,KAAK,GAAG,MAAM,KAAK;AAChC,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,gBAAgC,CAAC;AACvC,QAAM,OAAa;AAAA,IACjB,SAAS;AAAA,IACT;AAAA,IACA,gBAAgB,CAAC,OAAO,cAAc,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE;AAAA,IAC7D,cAAc;AAAA,IACd,SAAS,IAAI;AAAA,IACb,SAAS,IAAI;AAAA,EACf;AACA,gBAAc,KAAK,GAAG,KAAK,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,KAAK,EAAE,CAAC;AACvD,SAAO;AACT;AAGO,IAAM,YAAY,CAAC,GAAiB,QAAyB,IAAI,WAAW,QAAQ,KAAM,IAAI,WAAW,MAAM,MAAM,EAAE,OAAO,UAAU,EAAE,OAAO;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/dock/constructions.ts"],"sourcesContent":["/**\n * The nine desk constructions, presets built from the parts: a state, the stage size and the options in, a placed\n * rect per item out, plus notes saying how it gave way. How each one gives way when width or height runs out:\n *\n * - Edge docks (`docks`): sections fold to headers (least recently used first), the bottom dock folds to its\n * header, the docks fold to their rails (right first). `docksFull` runs the bottom dock across the full width.\n * - One tiling tree (`tree`): the newest tile that breaks a minimum floats.\n * - Navigator + inspector (`navigator`): the sides fold to icon tabs; height never matters.\n * - Scrolling strip (`strip`): a column whose minimums don't fit splits in two; the strip scrolls to the focus.\n * - Drawers (`drawers`): below a width a drawer slides over the documents instead of pushing them.\n * - Palettes over the documents (`floatOver`), and palettes with the documents tiled around them (`floatAround`):\n * the least recently used shade to their title bars; narrow, the stacks merge in one corner.\n * - Edge docks + tear-off (`dockTear`): as the edge docks, and torn-off panels float (and shade when they don't fit).\n */\nimport { clampInto, rect, type Size } from \"../geometry\";\nimport { columnHeights, share } from \"./arrange\";\nimport {\n DRAWER_DOCK,\n OVER_MARGIN,\n TORN_W,\n TREE_COLUMN,\n accordion,\n aroundDocs,\n bar,\n dockGeometry,\n intoRail,\n paletteArea,\n palettes,\n pill,\n pillBetween,\n plural,\n rail,\n stripGeometry,\n stripMin,\n tabbed,\n tabbedIntoRail,\n tileMin,\n tiles,\n treeArea,\n treeFloats,\n treeRails,\n treeShown,\n treeTiles,\n DOCK,\n type Out,\n} from \"./parts\";\nimport { BAR, G, LAYER, RAIL, TITLE, catalogOf, idOf, isDocKey, panelKey, startState, type Catalog, type DeskSpec, type DeskState, type Layout, type Note, type Options, type Side } from \"./model\";\n\n// --- edge docks (docks, docksFull, dockTear) ------------------------------------------------------------------------\n\nfunction docks(cat: Catalog, s: DeskState, size: { width: number; height: number }, opt: Options, mode: \"between\" | \"full\", notes: Note[]): Out {\n const out: Out = new Map();\n const { width: W, height: H } = size;\n const d = dockGeometry(cat, s, size, opt, mode, notes);\n rail(out, \"left\", 0, 0, d.h, s.left);\n rail(out, \"right\", W - RAIL, 0, d.h, d.right);\n let folded = 0;\n if (d.lOpen) folded += accordion(cat, out, s, RAIL + G, G, DOCK - G, d.h - 2 * G, s.left);\n else intoRail(cat, out, 0, 0, DOCK - G, s.left, \"left\");\n if (d.rOpen) folded += accordion(cat, out, s, W - RAIL - DOCK, G, DOCK - G, d.h - 2 * G, d.right);\n else intoRail(cat, out, W - RAIL, 0, DOCK - G, d.right, \"right\");\n if (folded) notes.push({ code: \"sections-folded\", text: `${plural(folded, \"section\", \"sections\")} folded to ${folded > 1 ? \"headers\" : \"a header\"}` });\n // Reserved: the documents end above the bottom dock. Overlay: it floats over the documents' lower part.\n const overlay = opt.bottom === \"overlay\";\n if (d.bottomRect) {\n const b = d.bottomRect;\n const n = s.bottom.length;\n const w = (b.width - G * (n - 1)) / n;\n s.bottom.forEach((id, i) => {\n const open = d.bh > TITLE;\n out.set(panelKey(id), {\n rect: rect(b.x + i * (w + G), b.y, w, b.height),\n look: overlay ? (open ? \"float\" : \"header\") : open ? \"section\" : \"header\",\n layer: overlay ? LAYER.overlay : LAYER.dock,\n accent: true,\n ...(overlay ? { shadow: true } : {}),\n ...(open ? { min: { height: cat.natural(id) } } : {}),\n });\n });\n }\n const docsBottom = d.bottomOn && !overlay ? H - G - d.bh : H;\n const p = pill(opt, d.x0, d.x1 - d.x0, 0, overlay && d.bottomOn ? H - G - d.bh : docsBottom);\n // With the bottom dock floating, the documents run down under it (but never under a reserved bottom pill).\n const bottomOfDocs = overlay && d.bottomOn && !(opt.toolbar === \"bottom\" && opt.toolbarSpace === \"reserved\") ? H - G : p.bottom;\n tiles(out, rect(d.x0, p.top, d.x1 - d.x0, bottomOfDocs - p.top), s.docs);\n out.set(\"toolbar\", p.placed);\n return out;\n}\n\n/** Tear-off: torn-off panels float over the documents; one that doesn't fit the stage's height shades to its title bar. */\nfunction tornOff(cat: Catalog, out: Out, s: DeskState, size: Size, notes: Note[]): void {\n const docRects = [...out.entries()].filter(([k]) => isDocKey(k)).map(([, p]) => p.rect);\n const right = docRects.length ? Math.max(...docRects.map((r) => r.x + r.width)) : size.width / 2;\n const top = docRects.length ? Math.min(...docRects.map((r) => r.y)) : 0;\n let shaded = 0;\n s.torn.forEach((f, i) => {\n const full = cat.natural(f.id);\n const at = f.at ?? { x: right - 12 - TORN_W - 22 * i, y: top + 40 + 22 * i };\n const fits = at.y + full <= size.height - G;\n const shade = s.folded.includes(f.id) || !fits;\n if (!fits && !s.folded.includes(f.id)) shaded++;\n const r = clampInto(rect(at.x, at.y, TORN_W, shade ? TITLE : full), rect(0, 0, size.width, size.height));\n out.set(panelKey(f.id), { rect: r, look: shade ? \"header\" : \"float\", layer: LAYER.float, shadow: true, ...(shade ? {} : { min: { height: full } }) });\n });\n if (s.torn.length) {\n const items = s.torn.map((f) => panelKey(f.id));\n notes.push({ code: \"torn-floating\", items, text: `${items.map(cat.title).join(\", \")} ${items.length > 1 ? \"float\" : \"floats\"}; drop on a dock or its rail icon to dock again` });\n }\n if (shaded) notes.push({ code: \"torn-shaded\", text: `${plural(shaded, \"floating panel\", \"floating panels\")} shaded` });\n}\n\n// --- one tiling tree (tree) --------------------------------------------------------------------------------------------\n\nfunction tree(cat: Catalog, s: DeskState, size: Size, notes: Note[]): Out {\n const out: Out = new Map();\n const area = treeArea(size, s);\n // A column folded to its rail: icons at the stage's edge, its panels hidden into them.\n const rails = treeRails(s);\n for (const side of [\"left\", \"right\"] as const) {\n if (!rails[side]) continue;\n const ids = (side === \"left\" ? s.tree.L : s.tree.R).map(idOf);\n const x = side === \"left\" ? 0 : size.width - RAIL;\n rail(out, side, x, BAR, size.height - BAR, ids);\n intoRail(cat, out, x, BAR, TREE_COLUMN, ids, side);\n }\n if (rails.left || rails.right) {\n const both = rails.left && rails.right;\n const text = `${both ? \"both side columns\" : `the ${rails.left ? \"left\" : \"right\"} column`} folded to ${both ? \"their rails\" : \"its rail\"}`;\n notes.push({ code: \"columns-railed\", text, ...(both ? {} : { side: rails.left ? \"left\" : \"right\" }) });\n }\n const { tree: t, floats } = treeFloats(cat, treeShown(s), area);\n for (const [k, r] of treeTiles(cat, t, area)) out.set(k, { rect: r, look: isDocKey(k) ? \"doc\" : \"tile\", layer: LAYER.doc, min: tileMin(cat, k) });\n floats.forEach((k, i) => {\n const m = isDocKey(k) ? { w: 300, h: 190 } : { w: 200, h: cat.natural(idOf(k)) };\n const r = clampInto(rect(size.width / 2 - m.w / 2 + 22 * i, BAR + 40 + 22 * i, m.w, m.h), rect(0, 0, size.width, size.height));\n out.set(k, { rect: r, look: isDocKey(k) ? \"doc\" : \"float\", layer: LAYER.float, shadow: true });\n });\n if (floats.length) notes.push({ code: \"tiles-float\", items: floats, text: `${plural(floats.length, \"tile floats\", \"tiles float\")} (newest first): ${floats.map(cat.title).join(\", \")}` });\n out.set(\"toolbar\", bar(size.width));\n return out;\n}\n\n/**\n * The tree's start: on a stage too narrow for the documents to tile between the side columns, the columns start folded to\n * their rails (the right one first), then the center's panels join the folded right column, so nothing floats\n * until a rail icon opens a column.\n */\nfunction treeStart(cat: Catalog, docs: readonly number[], size?: Size): DeskState {\n const s = startState(cat, docs);\n if (!size) return s;\n const both = { ...s, closed: [\"right\", \"left\"] as Side[] };\n const panels = s.tree.C.filter((k) => !isDocKey(k));\n const tries: DeskState[] = [s, { ...s, closed: [\"right\"] }, both, { ...both, tree: { ...s.tree, R: [...s.tree.R, ...panels], C: s.tree.C.filter(isDocKey) } }];\n return tries.find((st) => treeFloats(cat, treeShown(st), treeArea(size, st)).floats.length === 0) ?? tries.at(-1)!;\n}\n\n// --- navigator + inspector (navigator), and drawers (drawers) ----------------------------------------------------------------------\n\nconst NAV_L = 240;\nconst NAV_R = 240;\nconst NAV_MIN = 380;\n\nfunction navigator(cat: Catalog, s: DeskState, size: Size, opt: Options, notes: Note[]): Out {\n const out: Out = new Map();\n const { width: W, height: H } = size;\n let lw = s.left.length ? NAV_L : 0;\n let rw = s.right.length ? NAV_R : 0;\n if (rw && W - lw - rw < NAV_MIN) {\n rw = RAIL;\n notes.push({ code: \"tabs-folded\", side: \"right\", text: \"inspector folded to icon tabs\" });\n }\n if (lw && W - lw - rw < NAV_MIN) {\n lw = RAIL;\n notes.push({ code: \"tabs-folded\", side: \"left\", text: \"navigator folded to icon tabs\" });\n }\n const side = (sd: Side, x: number, w: number, full: number, ids: readonly number[]): void => {\n if (w === RAIL) {\n rail(out, sd, x, 0, H, ids);\n tabbedIntoRail(cat, out, sd, ids, x, 0, full);\n } else if (w > 0) {\n rail(out, sd, sd === \"left\" ? x : x + w - RAIL, 0, H, ids, true);\n tabbed(out, sd, ids, s.active[sd], x, 0, w, H, false);\n }\n };\n side(\"left\", 0, lw, NAV_L, s.left);\n side(\"right\", W - rw, rw, NAV_R, s.right);\n const cx = lw + G;\n const cw = W - lw - rw - 2 * G;\n const p = pill(opt, cx, cw, 0, H);\n tiles(out, rect(cx, p.top, cw, p.bottom - p.top), s.docs);\n out.set(\"toolbar\", p.placed);\n return out;\n}\n\nconst DRAWER_L = 240;\nconst DRAWER_R = 240;\n\nfunction drawers(cat: Catalog, s: DeskState, size: Size, notes: Note[]): Out {\n const out: Out = new Map();\n const { width: W, height: H } = size;\n const y = BAR;\n const h = H - BAR;\n const rDocked = W >= DRAWER_DOCK.right;\n const lDocked = W >= DRAWER_DOCK.left;\n const lOpen = s.left.length > 0 && !s.closed.includes(\"left\");\n const rOpen = s.right.length > 0 && !s.closed.includes(\"right\");\n if (!rDocked && rOpen) notes.push({ code: \"drawer-over\", side: \"right\", text: \"right drawer slides over the documents\" });\n if (!lDocked && lOpen) notes.push({ code: \"drawer-over\", side: \"left\", text: rDocked || !rOpen ? \"left drawer slides over the documents\" : \"left drawer slides over too\" });\n rail(out, \"left\", 0, y, h, s.left);\n rail(out, \"right\", W - RAIL, y, h, s.right);\n const x0 = RAIL + (lDocked && lOpen ? DRAWER_L : 0) + G;\n const x1 = W - RAIL - (rDocked && rOpen ? DRAWER_R : 0) - G;\n tiles(out, rect(x0, y + G, x1 - x0, h - 2 * G), s.docs);\n // Both sliding over a stage too narrow for the two side by side: each takes half the room between the rails.\n const both = !lDocked && !rDocked && lOpen && rOpen;\n const half = (W - 2 * RAIL - G) / 2;\n const lw = both ? Math.min(DRAWER_L, half) : DRAWER_L;\n const rw = both ? Math.min(DRAWER_R, half) : DRAWER_R;\n if (lOpen) tabbed(out, \"left\", s.left, s.active.left, RAIL, y, lw, h, !lDocked);\n else tabbedIntoRail(cat, out, \"left\", s.left, 0, y, DRAWER_L);\n if (rOpen) tabbed(out, \"right\", s.right, s.active.right, W - RAIL - rw, y, rw, h, !rDocked);\n else tabbedIntoRail(cat, out, \"right\", s.right, W - RAIL, y, DRAWER_R);\n out.set(\"toolbar\", bar(W));\n return out;\n}\n\n// --- scrolling strip (strip) --------------------------------------------------------------------------------------------\n\nfunction strip(cat: Catalog, s: DeskState, size: Size, notes: Note[]): Out {\n const out: Out = new Map();\n const { width: W, height: H } = size;\n const g = stripGeometry(cat, s, size, notes);\n g.cols.forEach((c, ci) => {\n // A column of panels: each at its natural height, the last taking the rest; documents share as before.\n const mins = c.map((k) => stripMin(cat, k));\n const heights = c.some(isDocKey) ? share(g.h - G * (c.length - 1), mins) : columnHeights(g.h, mins, G);\n let cy = g.y;\n c.forEach((k, i) => {\n out.set(k, { rect: rect(g.xs[ci]!, cy, g.widths[ci]!, heights[i]!), look: isDocKey(k) ? \"doc\" : \"tile\", layer: LAYER.doc, offStage: true, min: { width: g.widths[ci]!, height: mins[i]! } });\n cy += heights[i]! + G;\n });\n });\n const scrolls = g.total > W;\n if (scrolls) notes.push({ code: \"strip-scrolls\", text: `the strip is ${Math.round(g.total)} wide: ${Math.round(g.total - W)} px off screen, reached by scrolling` });\n out.set(\"track\", { rect: rect(0, H - 5, W, 5), look: \"track\", layer: LAYER.toolbar, ...(scrolls ? {} : { hidden: true }) });\n const tw = scrolls ? (W / g.total) * W : W;\n out.set(\"thumb\", { rect: rect(scrolls ? (g.scroll / g.total) * W : 0, H - 5, tw, 5), look: \"thumb\", layer: LAYER.toolbar, ...(scrolls ? {} : { hidden: true }) });\n out.set(\"toolbar\", bar(W));\n return out;\n}\n\n// --- floating palettes (floatOver, floatAround) --------------------------------------------------------------------\n\nfunction floatOver(cat: Catalog, s: DeskState, size: Size, opt: Options, notes: Note[]): Out {\n const out: Out = new Map();\n const { area } = paletteArea(size, opt);\n const pals = palettes(cat, s, area, size.width, OVER_MARGIN, notes);\n const tb = pillBetween(opt, size, [...pals.values()].map((p) => p.rect));\n tiles(out, area, s.docs);\n let covered = 0;\n for (const [id, p] of pals) {\n out.set(panelKey(id), { rect: p.rect, look: p.shaded ? \"header\" : \"float\", layer: LAYER.float, shadow: true, ...(p.shaded ? {} : { min: { height: cat.natural(id) } }) });\n covered += p.rect.width * p.rect.height;\n }\n notes.push({ code: \"palettes-cover\", text: `palettes cover ${Math.round((covered / (area.width * area.height)) * 100)}% of the documents` });\n out.set(\"toolbar\", tb);\n return out;\n}\n\nfunction floatAround(cat: Catalog, s: DeskState, size: Size, opt: Options, notes: Note[]): Out {\n const out: Out = new Map();\n const { area } = paletteArea(size, opt);\n const pals = palettes(cat, s, area, size.width, 0, notes);\n const tb = pillBetween(opt, size, [...pals.values()].map((p) => p.rect));\n const docsRect = aroundDocs(pals, area);\n tiles(out, docsRect, s.docs);\n let used = docsRect.width * docsRect.height;\n for (const [id, p] of pals) {\n out.set(panelKey(id), { rect: p.rect, look: p.shaded ? \"header\" : \"palette\", layer: LAYER.palette, shadow: true, ...(p.shaded ? {} : { min: { height: cat.natural(id) } }) });\n used += p.rect.width * p.rect.height;\n }\n notes.push({ code: \"docs-room\", text: `documents get ${Math.round(docsRect.width)} px of width; ${Math.max(0, Math.round((1 - used / (area.width * area.height)) * 100))}% of the desk stays empty under short stacks` });\n out.set(\"toolbar\", tb);\n return out;\n}\n\n// --- the presets ---------------------------------------------------------------------------------------------------\n\nexport type ConstructionId = \"docks\" | \"docksFull\" | \"tree\" | \"navigator\" | \"strip\" | \"drawers\" | \"floatOver\" | \"floatAround\" | \"dockTear\";\n\nexport interface Construction {\n readonly id: ConstructionId;\n readonly title: string;\n readonly idea: string;\n /** It has a floating toolbar pill (top or bottom, reserved or overlay). */\n readonly pill: boolean;\n /** It has a bottom dock (reserved, floating or off). */\n readonly bottom: boolean;\n /** The arrangement it starts from (at this stage size, when it depends on one). */\n readonly initial: (docs: readonly number[], size?: Size) => DeskState;\n readonly layout: (s: DeskState, size: Size, opt: Options) => Layout;\n /** The desk it belongs to (its catalog). */\n readonly desk: Desk;\n}\n\n/** A desk: the catalog, its nine constructions, and the catalog-bound helpers. */\nexport interface Desk {\n readonly catalog: Catalog;\n readonly constructions: readonly Construction[];\n readonly constructionOf: (id: ConstructionId) => Construction;\n /** The arrangement every construction starts from, with these documents open (none by default). */\n readonly initialState: (docs?: readonly number[]) => DeskState;\n readonly natural: (id: number) => number;\n readonly titleOf: (key: string) => string;\n}\n\ntype LayoutFn = (s: DeskState, size: Size, opt: Options, notes: Note[]) => Out;\n\nconst withNotes = (f: LayoutFn) => (s: DeskState, size: Size, opt: Options): Layout => {\n const notes: Note[] = [];\n const items = f(s, size, opt, notes);\n return { items, notes };\n};\n\n/**\n * A desk for these panels: the nine constructions as presets, each a pure layout over the shared state.\n *\n * ```ts\n * const desk = createDesk({ panels: [{ id: 1, title: \"Files\", natural: 160 }], start: { left: [1], right: [], bottom: [] } });\n * const c = desk.constructionOf(\"docks\");\n * const { items, notes } = c.layout(c.initial([1, 2]), { width: 960, height: 560 }, DEFAULT_OPTIONS);\n * ```\n */\nexport function createDesk(spec: DeskSpec): Desk {\n const cat = catalogOf(spec);\n const initial = (docs?: readonly number[]): DeskState => startState(cat, docs);\n const sides = (patch: (s: DeskState) => Partial<DeskState>) => (docs: readonly number[]): DeskState => {\n const s = startState(cat, docs);\n return { ...s, ...patch(s) };\n };\n // Navigator and drawers have no bottom dock: its panels join the right side.\n const noBottom = sides((s) => ({ right: [...s.right, ...s.bottom], bottom: [] }));\n const plain = sides(() => ({}));\n const list: Omit<Construction, \"desk\">[] = [\n {\n id: \"docks\",\n title: \"Edge docks\",\n idea: \"Each side is a dock with a rail of icons; its panels are accordion sections. Short on height, the least recently used fold to headers; short on width, a whole dock folds to its rail (right first). The bottom dock sits between the side docks.\",\n pill: true,\n bottom: true,\n initial: plain,\n layout: withNotes((s, size, opt, notes) => docks(cat, s, size, opt, \"between\", notes)),\n },\n {\n id: \"docksFull\",\n title: \"Edge docks, full-width bottom dock\",\n idea: \"As the edge docks, except the bottom dock runs under everything across the full width; the side docks and their rails stop above it, so they fold sooner.\",\n pill: true,\n bottom: true,\n initial: plain,\n layout: withNotes((s, size, opt, notes) => docks(cat, s, size, opt, \"full\", notes)),\n },\n {\n id: \"tree\",\n title: \"One tiling tree\",\n idea: \"Panels and documents are tiles of one tree, so a panel can sit beside a document. One rule for all: the newest tile that breaks a minimum floats. Opened on a narrow stage, the side columns start folded to rails at its edges.\",\n pill: false,\n bottom: false,\n initial: (docs, size) => treeStart(cat, docs, size),\n layout: withNotes((s, size, _opt, notes) => tree(cat, s, size, notes)),\n },\n {\n id: \"navigator\",\n title: \"Navigator + inspector\",\n idea: \"A fixed left and right side, one panel showing per side (tabs); the toolbar floats over the canvas. Narrow, the sides fold to icon tabs. Height never matters.\",\n pill: true,\n bottom: false,\n initial: noBottom,\n layout: withNotes((s, size, opt, notes) => navigator(cat, s, size, opt, notes)),\n },\n {\n id: \"strip\",\n title: \"Scrolling strip\",\n idea: \"Panels and documents are columns of a strip wider than the screen; nothing shrinks below its minimum, the view scrolls to the focus instead. Short on height, a column splits in two.\",\n pill: false,\n bottom: false,\n initial: plain,\n layout: withNotes((s, size, _opt, notes) => strip(cat, s, size, notes)),\n },\n {\n id: \"drawers\",\n title: \"Drawers\",\n idea: \"Documents take the screen; each side is a drawer with tabs. Wide, the drawers dock and push; narrow, they slide over the documents.\",\n pill: false,\n bottom: false,\n initial: noBottom,\n layout: withNotes((s, size, _opt, notes) => drawers(cat, s, size, notes)),\n },\n {\n id: \"floatOver\",\n title: \"Floating palettes over the documents\",\n idea: \"Documents take the whole desk; panels are palettes floating over them at their natural size, stacked in the top corners and draggable anywhere. Short on height, the least recently used shade to their title bars; the documents never move.\",\n pill: true,\n bottom: false,\n initial: plain,\n layout: withNotes((s, size, opt, notes) => floatOver(cat, s, size, opt, notes)),\n },\n {\n id: \"floatAround\",\n title: \"Floating palettes, documents tile around\",\n idea: \"Palettes float at their natural size but reserve their footprint: the documents tile in the space between them. Nothing is covered; the space under a short stack stays empty.\",\n pill: true,\n bottom: false,\n initial: plain,\n layout: withNotes((s, size, opt, notes) => floatAround(cat, s, size, opt, notes)),\n },\n {\n id: \"dockTear\",\n title: \"Edge docks + tear-off\",\n idea: \"The edge docks, and any panel can be torn off to float over the documents and dropped back on a dock or its rail icon. Docked is the default; floating is the exception you choose.\",\n pill: true,\n bottom: true,\n initial: plain,\n layout: withNotes((s, size, opt, notes) => {\n const out = docks(cat, s, size, opt, \"between\", notes);\n tornOff(cat, out, s, size, notes);\n return out;\n }),\n },\n ];\n const constructions: Construction[] = [];\n const desk: Desk = {\n catalog: cat,\n constructions,\n constructionOf: (id) => constructions.find((c) => c.id === id)!,\n initialState: initial,\n natural: cat.natural,\n titleOf: cat.title,\n };\n constructions.push(...list.map((c) => ({ ...c, desk })));\n return desk;\n}\n\n/** Which items a construction lets the pointer drag: panels everywhere, documents in the tree and the strip. */\nexport const draggable = (c: Construction, key: string): boolean => key.startsWith(\"panel:\") || (key.startsWith(\"doc:\") && (c.id === \"tree\" || c.id === \"strip\"));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAS,MAAM,KAAc,GAAc,MAAyC,KAAc,MAA0B,OAAoB;AAC9I,QAAM,MAAW,oBAAI,IAAI;AACzB,QAAM,EAAE,OAAO,GAAG,QAAQ,EAAE,IAAI;AAChC,QAAM,IAAI,aAAa,KAAK,GAAG,MAAM,KAAK,MAAM,KAAK;AACrD,OAAK,KAAK,QAAQ,GAAG,GAAG,EAAE,GAAG,EAAE,IAAI;AACnC,OAAK,KAAK,SAAS,IAAI,MAAM,GAAG,EAAE,GAAG,EAAE,KAAK;AAC5C,MAAI,SAAS;AACb,MAAI,EAAE,MAAO,WAAU,UAAU,KAAK,KAAK,GAAG,OAAO,GAAG,GAAG,OAAO,GAAG,EAAE,IAAI,IAAI,GAAG,EAAE,IAAI;AAAA,MACnF,UAAS,KAAK,KAAK,GAAG,GAAG,OAAO,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AQ,KAAM,IAAI,WAAW,MAAM,MAAM,EAAE,OAAO,UAAU,EAAE,OAAO;","names":[]}
|
|
@@ -22,7 +22,7 @@ declare const rect: (x: number, y: number, width: number, height: number) => Rec
|
|
|
22
22
|
declare const overlap: (a: Rect, b: Rect) => number;
|
|
23
23
|
/** `r` moved (not resized) to lie inside `area`; one larger than the area keeps its top-left corner on the area's. */
|
|
24
24
|
declare const clampInto: (r: Rect, area: Rect) => Rect;
|
|
25
|
-
/** The
|
|
25
|
+
/** The center of a rect. */
|
|
26
26
|
declare const centre: (r: Rect) => Point;
|
|
27
27
|
/** The tolerance the geometry compares with, px. */
|
|
28
28
|
declare const EPS = 0.000001;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { P as Point, R as Rect, S as Size } from './geometry-
|
|
2
|
-
export { C as COLUMN_REACH, E as EPS, a as PLANE, b as RAIL_EDGE, c as area, d as centre, e as clamp, f as clampInto, g as contains, o as overlap, h as overlaps, r as rect, s as subtract } from './geometry-
|
|
3
|
-
export { T as Target } from './target-
|
|
1
|
+
import { P as Point, R as Rect, S as Size } from './geometry-Bf37LbCT.js';
|
|
2
|
+
export { C as COLUMN_REACH, E as EPS, a as PLANE, b as RAIL_EDGE, c as area, d as centre, e as clamp, f as clampInto, g as contains, o as overlap, h as overlaps, r as rect, s as subtract } from './geometry-Bf37LbCT.js';
|
|
3
|
+
export { T as Target } from './target-2RYYKkd1.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Placing a popup (a drop label, a menu, a tooltip) the way Wayland's xdg-positioner does: an anchor point on the
|
|
7
7
|
* anchor rect, a gravity, an offset, then the constraint adjustments in order per axis: flip, slide, resize.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
/** -1: the start edge (left or top), 0: the
|
|
10
|
+
/** -1: the start edge (left or top), 0: the center, 1: the end edge. */
|
|
11
11
|
type Align = -1 | 0 | 1;
|
|
12
12
|
/**
|
|
13
13
|
* A rule: the popup's anchor point on the anchor rect, the direction it extends from there (gravity), an offset,
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/positioner.ts"],"sourcesContent":["/**\n * Placing a popup (a drop label, a menu, a tooltip) the way Wayland's xdg-positioner does: an anchor point on the\n * anchor rect, a gravity, an offset, then the constraint adjustments in order per axis: flip, slide, resize.\n */\nimport type { Point, Rect, Size } from \"./geometry\";\n\n/** -1: the start edge (left or top), 0: the
|
|
1
|
+
{"version":3,"sources":["../src/positioner.ts"],"sourcesContent":["/**\n * Placing a popup (a drop label, a menu, a tooltip) the way Wayland's xdg-positioner does: an anchor point on the\n * anchor rect, a gravity, an offset, then the constraint adjustments in order per axis: flip, slide, resize.\n */\nimport type { Point, Rect, Size } from \"./geometry\";\n\n/** -1: the start edge (left or top), 0: the center, 1: the end edge. */\nexport type Align = -1 | 0 | 1;\n\n/**\n * A rule: the popup's anchor point on the anchor rect, the direction it extends from there (gravity), an offset,\n * and which adjustments are allowed: flip (mirror anchor, gravity and offset; kept only if that fits), then slide\n * (move inside, the start edge winning), then resize (cut to the bounds).\n */\nexport interface PositionerRule {\n readonly anchor: { readonly x: Align; readonly y: Align };\n readonly gravity: { readonly x: Align; readonly y: Align };\n readonly offset: Point;\n readonly flip: boolean;\n readonly slide: boolean;\n readonly resize: boolean;\n}\n\nexport interface Positioned {\n readonly rect: Rect;\n readonly flipped: { readonly x: boolean; readonly y: boolean };\n readonly slid: { readonly x: boolean; readonly y: boolean };\n readonly resized: boolean;\n}\n\nfunction placeAxis(a0: number, alen: number, anchor: Align, gravity: Align, offset: number, size: number): number {\n const point = a0 + ((anchor + 1) / 2) * alen + offset;\n return gravity === 1 ? point : gravity === -1 ? point - size : point - size / 2;\n}\n\n/** Where a popup of `size` goes for `anchorRect` by `rule`, kept inside `bounds` as far as the rule allows. */\nexport function positionPopup(anchorRect: Rect, size: Size, bounds: Rect, rule: PositionerRule): Positioned {\n const axes = [\n { a0: anchorRect.x, alen: anchorRect.width, anchor: rule.anchor.x, gravity: rule.gravity.x, offset: rule.offset.x, size: size.width, b0: bounds.x, blen: bounds.width },\n { a0: anchorRect.y, alen: anchorRect.height, anchor: rule.anchor.y, gravity: rule.gravity.y, offset: rule.offset.y, size: size.height, b0: bounds.y, blen: bounds.height },\n ];\n const out = axes.map((ax) => {\n const fits = (start: number, len: number): boolean => start >= ax.b0 - 0.01 && start + len <= ax.b0 + ax.blen + 0.01;\n let start = placeAxis(ax.a0, ax.alen, ax.anchor, ax.gravity, ax.offset, ax.size);\n let len = ax.size;\n let flipped = false;\n let slid = false;\n let resized = false;\n if (!fits(start, len) && rule.flip && (ax.anchor !== 0 || ax.gravity !== 0)) {\n const mirrored = placeAxis(ax.a0, ax.alen, -ax.anchor as Align, -ax.gravity as Align, -ax.offset, ax.size);\n if (fits(mirrored, len)) {\n start = mirrored;\n flipped = true;\n }\n }\n if (!fits(start, len) && rule.slide) {\n if (start + len > ax.b0 + ax.blen) start = ax.b0 + ax.blen - len;\n if (start < ax.b0) start = ax.b0;\n slid = true;\n }\n if (!fits(start, len) && rule.resize) {\n const end = Math.min(start + len, ax.b0 + ax.blen);\n start = Math.max(start, ax.b0);\n len = Math.max(0, end - start);\n resized = true;\n }\n return { start, len, flipped, slid, resized };\n });\n const [x, y] = out as [(typeof out)[0], (typeof out)[0]];\n return {\n rect: { x: x.start, y: y.start, width: x.len, height: y.len },\n flipped: { x: x.flipped, y: y.flipped },\n slid: { x: x.slid, y: y.slid },\n resized: x.resized || y.resized,\n };\n}\n\n/** Below the anchor's bottom-left corner, extending right and down, 6 px apart; flips, slides and resizes. */\nexport const BELOW_LEFT: PositionerRule = {\n anchor: { x: -1, y: 1 },\n gravity: { x: 1, y: 1 },\n offset: { x: 0, y: 6 },\n flip: true,\n slide: true,\n resize: true,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA8BA,SAAS,UAAU,IAAY,MAAc,QAAe,SAAgB,QAA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KAAK,KAAK,OAAO;AACnC,UAAI,QAAQ,MAAM,GAAG,KAAK,GAAG,KAAM,SAAQ,GAAG,KAAK,GAAG,OAAO;AAC7D,UAAI,QAAQ,GAAG,GAAI,SAAQ,GAAG;AAC9B,aAAO;AAAA,IACT;AACA,QAAI,CAAC,KAAK,OAAO,GAAG,KAAK,KAAK,QAAQ;AACpC,YAAM,MAAM,KAAK,IAAI,QAAQ,KAAK,GAAG,KAAK,GAAG,IAAI;AACjD,cAAQ,KAAK,IAAI,OAAO,GAAG,EAAE;AAC7B,YAAM,KAAK,IAAI,GAAG,MAAM,KAAK;AAC7B,gBAAU;AAAA,IACZ;AACA,WAAO,EAAE,OAAO,KAAK,SAAS,MAAM,QAAQ;AAAA,EAC9C,CAAC;AACD,QAAM,CAAC,GAAG,CAAC,IAAI;AACf,SAAO;AAAA,IACL,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,EAAE,OAAO,OAAO,EAAE,KAAK,QAAQ,EAAE,IAAI;AAAA,IAC5D,SAAS,EAAE,GAAG,EAAE,SAAS,GAAG,EAAE,QAAQ;AAAA,IACtC,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,EAAE,KAAK;AAAA,IAC7B,SAAS,EAAE,WAAW,EAAE;AAAA,EAC1B;AACF;AAGO,IAAM,aAA6B;AAAA,EACxC,QAAQ,EAAE,GAAG,IAAI,GAAG,EAAE;AAAA,EACtB,SAAS,EAAE,GAAG,GAAG,GAAG,EAAE;AAAA,EACtB,QAAQ,EAAE,GAAG,GAAG,GAAG,EAAE;AAAA,EACrB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;","names":["start","len"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as Rect, S as Size, P as Point } from './geometry-
|
|
2
|
-
import { T as Target } from './target-
|
|
3
|
-
import { C as CrossLimits, a as StackForm, S as StackFormKind, b as StackFit, c as StackNote } from './model-
|
|
1
|
+
import { R as Rect, S as Size, P as Point } from './geometry-Bf37LbCT.js';
|
|
2
|
+
import { T as Target } from './target-2RYYKkd1.js';
|
|
3
|
+
import { C as CrossLimits, a as StackForm, S as StackFormKind, b as StackFit, c as StackNote } from './model-X7eUaKlA.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The scene's shapes: one model of a whole window. A scene is a stage (the window's inner rect), the edges along its
|
|
@@ -16,7 +16,7 @@ type Kind = string;
|
|
|
16
16
|
/** A side of the stage. Left and right edges are columns (they run down); top and bottom edges are bars (they run across). */
|
|
17
17
|
type Side = "top" | "right" | "bottom" | "left";
|
|
18
18
|
declare const SIDES: readonly Side[];
|
|
19
|
-
/** Where an item sits along its edge: packed from the start,
|
|
19
|
+
/** Where an item sits along its edge: packed from the start, centered in the spare length, or packed from the end. */
|
|
20
20
|
type Zone = "start" | "center" | "end";
|
|
21
21
|
declare const ZONES: readonly Zone[];
|
|
22
22
|
/** A float that follows the content: flush with that side or corner of `layout.content` until a drop gives it a real rect. */
|
|
@@ -137,7 +137,7 @@ interface Edge {
|
|
|
137
137
|
/** The drop strip's depth while the edge is empty, px (default {@link DEFAULT_STRIP}). */
|
|
138
138
|
readonly strip?: number;
|
|
139
139
|
/**
|
|
140
|
-
* How a gap's hit runs along the edge. The gaps always split the edge halfway between
|
|
140
|
+
* How a gap's hit runs along the edge. The gaps always split the edge halfway between neighboring insertion lines, so
|
|
141
141
|
* free space and short items (a toolbar, a closed or folded panel) are covered end to end. A number: over an open
|
|
142
142
|
* item's body only (a panel), the hit narrows to a band that many px around the line, so the middle of a panel is no
|
|
143
143
|
* gap and the pointer falls through to the float target, or to none. `"middle"`: no band, so panels are split too.
|
|
@@ -355,6 +355,16 @@ interface SceneItemLayout {
|
|
|
355
355
|
readonly rides?: string;
|
|
356
356
|
/** Its column folded: by hand (every member folded) or by give-way. */
|
|
357
357
|
readonly folded?: "hand" | "auto";
|
|
358
|
+
/**
|
|
359
|
+
* Why this item is drawn smaller than its first form, read from the scene's own state, never inferred from the rects:
|
|
360
|
+
* `"hand"` when it is folded by hand (`SceneItem.from` over 0, which `fold` sets), `"auto"` when it gave way (a form
|
|
361
|
+
* below the one it started in, by length or width, a » menu entry included: the same word `folded` uses for a column
|
|
362
|
+
* folded by give-way). Absent when the item shows its first form, is closed, or lies in an icons-only edge in the form
|
|
363
|
+
* that edge gives it. By hand wins: a hand-folded item that gave way further is `"hand"`, since expanding it
|
|
364
|
+
* (`fold(scene, id, false)`) is the user's to do, so a host shows "Expand" for `"hand"` only. A float is only ever
|
|
365
|
+
* folded by hand. `folded` is about the item's column; this one is about the item.
|
|
366
|
+
*/
|
|
367
|
+
readonly foldedBy?: "hand" | "auto";
|
|
358
368
|
/** A `wrap` form: the word indexes per row (the words wrap beside the grip, a hanging indent). */
|
|
359
369
|
readonly rows?: readonly (readonly number[])[];
|
|
360
370
|
/** Its grip: a `wrap` form's lead cell at the start of row one, or a form's `grip` strip (an icons strip's, on top). */
|
|
@@ -378,6 +388,14 @@ interface SceneEdgeLayout {
|
|
|
378
388
|
readonly rect: Rect;
|
|
379
389
|
readonly items: readonly string[];
|
|
380
390
|
} | null;
|
|
391
|
+
/**
|
|
392
|
+
* Its items in the edge's order: the zones in order (start, center, end), then the order within each zone, the order
|
|
393
|
+
* `solve` lays them in. Exactly the ids `SceneLayout.items` draws for this edge (`SceneItemLayout.edge`): an item in the
|
|
394
|
+
* » menu keeps its place (`menu.items` names those, so a host wanting the docked ones filters them out), a rail tab is
|
|
395
|
+
* listed, and a closed item is left out (unless it shows as a rail tab). A column folded into its rail or riding lists
|
|
396
|
+
* its members in zone order. Never sort rects to learn it.
|
|
397
|
+
*/
|
|
398
|
+
readonly items: readonly string[];
|
|
381
399
|
/** The ids drawn as rail tabs, in order (empty unless the column is a rail). */
|
|
382
400
|
readonly tabs: readonly string[];
|
|
383
401
|
/**
|
|
@@ -549,7 +567,8 @@ interface FloatResize {
|
|
|
549
567
|
* then along, over its new width), and such a stop beats the minimum. The rect is then laid by the one clamp `solve`
|
|
550
568
|
* lays floats with, so `solve(resize(...))` draws exactly this rect. A float that already covers something (no clear
|
|
551
569
|
* place at its size) may move to a clear place once a resize opens one; the preview is still the commit, and
|
|
552
|
-
* `"docked"` says so.
|
|
570
|
+
* `"docked"` says so. Such a float never grows over what it covers: a dragged edge that lies inside an obstacle stays
|
|
571
|
+
* where it is drawn (`"docked"`), so a resize never covers more than the float did. `limits` says which of these bound it.
|
|
553
572
|
*
|
|
554
573
|
* Null for anything but a float drawn at its first form when that form grows (a panel's card): a toolbar group's size
|
|
555
574
|
* comes from its forms, and so does a folded float's bar. Pure: it solves the scene once, for what is drawn now.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as Rect } from './geometry-
|
|
1
|
+
import { R as Rect } from './geometry-Bf37LbCT.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The edge stack's shapes. A stack is the items along one edge of a stage: a column (vertical, a side region) or a
|
|
@@ -181,7 +181,7 @@ interface StackInput {
|
|
|
181
181
|
readonly main: number;
|
|
182
182
|
};
|
|
183
183
|
/**
|
|
184
|
-
* The space between
|
|
184
|
+
* The space between neighboring drawn items, px (default 0). The » entry is a neighbor of the last drawn item. It
|
|
185
185
|
* counts toward the length and the rects include it, so an app draws at the solver's rects.
|
|
186
186
|
*/
|
|
187
187
|
readonly gap?: number;
|
package/dist/panels.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { b as PanelsState, S as Side, E as Edge, C as Clock, a as PanelDef } from './targets-
|
|
2
|
-
export { B as BAND_SIZE, g as Band, h as BandOption, i as Column, D as DEFAULT_PANELS_OPTIONS, j as DockOptions, k as EDGES, F as FLOAT_HEIGHT, m as FLOAT_MIN, n as FloatAt, G as GiveWay, I as IDENTITY_VIEW, e as PanelDrop, o as PanelKind, q as PanelPlace, r as PanelStop, s as PanelStopsOptions, d as PanelTarget, c as PanelTargetInput, f as PanelsLayout, t as PanelsNote, u as PanelsNoteCode, P as PanelsOptions, v as PanelsStart, w as Place, x as PlacedBand, y as PlacedColumn, z as PlacedPanel, A as PlacedRail, R as Reserve, H as ReserveEdge, J as SIDES, V as View, W as Where, K as activate, L as bandHeight, M as bandSize, N as close, O as columnWidth, Q as createPanels, T as defOf, U as dock, X as dockBand, Y as float, Z as floatSize, _ as focus, $ as giveWayOrder, a0 as homePlace, a1 as keep, l as layoutPanels, a2 as liftPanel, a3 as open, a4 as ownWidth, p as panelDrop, a5 as panelStops, a6 as panelTargets, a7 as pin, a8 as placeRank, a9 as resizeBand, aa as resizeColumn, ab as resizeFloat, ac as samePlaces, ad as showTabs, ae as tick, af as toPage, ag as toView, ah as toggleFold, ai as whereIs } from './targets-
|
|
3
|
-
import { R as Rect } from './geometry-
|
|
4
|
-
export { C as COLUMN_REACH, b as RAIL_EDGE } from './geometry-
|
|
5
|
-
import './target-
|
|
1
|
+
import { b as PanelsState, S as Side, E as Edge, C as Clock, a as PanelDef } from './targets-Du5_4T1u.js';
|
|
2
|
+
export { B as BAND_SIZE, g as Band, h as BandOption, i as Column, D as DEFAULT_PANELS_OPTIONS, j as DockOptions, k as EDGES, F as FLOAT_HEIGHT, m as FLOAT_MIN, n as FloatAt, G as GiveWay, I as IDENTITY_VIEW, e as PanelDrop, o as PanelKind, q as PanelPlace, r as PanelStop, s as PanelStopsOptions, d as PanelTarget, c as PanelTargetInput, f as PanelsLayout, t as PanelsNote, u as PanelsNoteCode, P as PanelsOptions, v as PanelsStart, w as Place, x as PlacedBand, y as PlacedColumn, z as PlacedPanel, A as PlacedRail, R as Reserve, H as ReserveEdge, J as SIDES, V as View, W as Where, K as activate, L as bandHeight, M as bandSize, N as close, O as columnWidth, Q as createPanels, T as defOf, U as dock, X as dockBand, Y as float, Z as floatSize, _ as focus, $ as giveWayOrder, a0 as homePlace, a1 as keep, l as layoutPanels, a2 as liftPanel, a3 as open, a4 as ownWidth, p as panelDrop, a5 as panelStops, a6 as panelTargets, a7 as pin, a8 as placeRank, a9 as resizeBand, aa as resizeColumn, ab as resizeFloat, ac as samePlaces, ad as showTabs, ae as tick, af as toPage, ag as toView, ah as toggleFold, ai as whereIs } from './targets-Du5_4T1u.js';
|
|
3
|
+
import { R as Rect } from './geometry-Bf37LbCT.js';
|
|
4
|
+
export { C as COLUMN_REACH, b as RAIL_EDGE } from './geometry-Bf37LbCT.js';
|
|
5
|
+
import './target-2RYYKkd1.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The panels' stored form: `storePanels(state)` gives plain JSON-safe data (`{ v: 1, … }`); `readPanels(data, defs?)`
|