@adea-ai/ui 0.160.4 → 0.161.0
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/dist/components/layout/split-layout/index.d.ts +1 -0
- package/dist/components/layout/split-layout/index.d.ts.map +1 -1
- package/dist/components/layout/split-layout/index.js +2 -1
- package/dist/components/layout/split-layout/pane-focus.d.ts +29 -0
- package/dist/components/layout/split-layout/pane-focus.d.ts.map +1 -0
- package/dist/components/layout/split-layout/pane-focus.js +77 -0
- package/dist/components/layout/split-layout/pane-focus.js.map +1 -0
- package/dist/components/layout/split-layout/split-layout.d.ts +6 -0
- package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +25 -9
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/r/registry.json +5 -0
- package/dist/r/split-layout.json +5 -0
- package/dist/r/src/components/layout/split-layout/index.ts +1 -0
- package/dist/r/src/components/layout/split-layout/pane-focus.ts +111 -0
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +27 -1
- package/package.json +7 -1
- package/registry.json +5 -0
- package/src/components/layout/split-layout/index.ts +1 -0
- package/src/components/layout/split-layout/pane-focus.ts +111 -0
- package/src/components/layout/split-layout/split-layout.tsx +27 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/split-layout/index.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/split-layout/index.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA"}
|
|
@@ -2,4 +2,5 @@ import { MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO,
|
|
|
2
2
|
import { closePane, createLayoutState, focusPane, movePane, neighborLeaf, normalizeLayout, resizeSplit, splitPane, splitPaneBalanced, swapPanes, undoClosePane } from "./model.js";
|
|
3
3
|
import { computeLayoutFrames } from "./geometry.js";
|
|
4
4
|
import { SplitLayout } from "./split-layout.js";
|
|
5
|
-
|
|
5
|
+
import { PANE_FOCUS_TARGET, focusPaneOnHover, hoverTakesFocus, paneFocusMode, rememberPaneFocus, setPaneFocusMode, subscribePaneFocusMode } from "./pane-focus.js";
|
|
6
|
+
export { MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, PANE_FOCUS_TARGET, SplitLayout, clampSplitRatio, closePane, computeLayoutFrames, countLeaves, createLayoutState, focusPane, focusPaneOnHover, hoverTakesFocus, layoutDepth, listLeaves, movePane, neighborLeaf, normalizeLayout, paneFocusMode, rememberPaneFocus, resizeSplit, setPaneFocusMode, splitPane, splitPaneBalanced, subscribePaneFocusMode, swapPanes, undoClosePane };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type PaneFocusMode = 'hover' | 'click';
|
|
2
|
+
/** How panes take focus: on hover unless the person chose click. */
|
|
3
|
+
export declare function paneFocusMode(): PaneFocusMode;
|
|
4
|
+
export declare function setPaneFocusMode(value: PaneFocusMode): void;
|
|
5
|
+
/** Calls `listener` after the choice changes; returns the way to stop. */
|
|
6
|
+
export declare function subscribePaneFocusMode(listener: () => void): () => void;
|
|
7
|
+
/** A pane's own element that takes the keys when hover activates it (a terminal's input, say). */
|
|
8
|
+
export declare const PANE_FOCUS_TARGET = "[data-pane-focus-target]";
|
|
9
|
+
/** Remembers where focus is inside `pane`; call from the pane's `focusin`. */
|
|
10
|
+
export declare function rememberPaneFocus(pane: HTMLElement, target: EventTarget | null): void;
|
|
11
|
+
type PointerLike = Pick<PointerEvent, 'pointerType' | 'buttons' | 'movementX' | 'movementY'>;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the pointer moving over `pane` should activate it. Only a real mouse move with no button
|
|
14
|
+
* held counts: a touch, a pen tap, a drag, a selection or content shifting under a still pointer
|
|
15
|
+
* does not. Focus already inside the pane, inside an open overlay, or in a text field that is in
|
|
16
|
+
* no pane (no `[data-pane-id]` ancestor) and outside `scope` stays where it is.
|
|
17
|
+
*/
|
|
18
|
+
export declare function hoverTakesFocus(event: PointerLike, pane: HTMLElement, scope?: Element): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Moves focus into `pane` as a hover activation: back to the element it last had focus in, else
|
|
21
|
+
* its `data-pane-focus-target`, else the pane itself. The pane's `focusin` then marks it active.
|
|
22
|
+
* Returns whether focus moved.
|
|
23
|
+
*/
|
|
24
|
+
export declare function focusPaneOnHover(event: PointerLike, pane: HTMLElement, options?: {
|
|
25
|
+
scope?: Element;
|
|
26
|
+
mode?: PaneFocusMode;
|
|
27
|
+
}): boolean;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=pane-focus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pane-focus.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/split-layout/pane-focus.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,CAAA;AAoB7C,oEAAoE;AACpE,wBAAgB,aAAa,IAAI,aAAa,CAW7C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAS3D;AAED,0EAA0E;AAC1E,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAGvE;AAED,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,6BAA6B,CAAA;AAS3D,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAGrF;AAED,KAAK,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC,CAAA;AAE5F;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAS/F;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,WAAW,EACjB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,aAAa,CAAA;CAAO,GACtD,OAAO,CAUT"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// src/components/layout/split-layout/pane-focus.ts
|
|
2
|
+
var STORAGE_KEY = "adea:pane-focus-mode:v1";
|
|
3
|
+
var STATE_KEY = Symbol.for("adea.ui.pane-focus-mode");
|
|
4
|
+
var state = globalThis[STATE_KEY] ??= {
|
|
5
|
+
value: void 0,
|
|
6
|
+
listeners: /* @__PURE__ */ new Set()
|
|
7
|
+
};
|
|
8
|
+
function storage() {
|
|
9
|
+
try {
|
|
10
|
+
return typeof localStorage === "undefined" ? void 0 : localStorage;
|
|
11
|
+
} catch {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** How panes take focus: on hover unless the person chose click. */
|
|
16
|
+
function paneFocusMode() {
|
|
17
|
+
if (state.value === void 0) {
|
|
18
|
+
let saved = null;
|
|
19
|
+
try {
|
|
20
|
+
saved = storage()?.getItem(STORAGE_KEY) ?? null;
|
|
21
|
+
} catch {}
|
|
22
|
+
state.value = saved === "click" ? "click" : "hover";
|
|
23
|
+
}
|
|
24
|
+
return state.value;
|
|
25
|
+
}
|
|
26
|
+
function setPaneFocusMode(value) {
|
|
27
|
+
state.value = value;
|
|
28
|
+
try {
|
|
29
|
+
if (value === "hover") storage()?.removeItem(STORAGE_KEY);
|
|
30
|
+
else storage()?.setItem(STORAGE_KEY, value);
|
|
31
|
+
} catch {}
|
|
32
|
+
for (const listener of state.listeners) listener();
|
|
33
|
+
}
|
|
34
|
+
/** Calls `listener` after the choice changes; returns the way to stop. */
|
|
35
|
+
function subscribePaneFocusMode(listener) {
|
|
36
|
+
state.listeners.add(listener);
|
|
37
|
+
return () => state.listeners.delete(listener);
|
|
38
|
+
}
|
|
39
|
+
/** A pane's own element that takes the keys when hover activates it (a terminal's input, say). */
|
|
40
|
+
var PANE_FOCUS_TARGET = "[data-pane-focus-target]";
|
|
41
|
+
var OVERLAY = "[role=\"dialog\"], [role=\"alertdialog\"], [role=\"menu\"], [role=\"listbox\"]";
|
|
42
|
+
var EDITABLE = "input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]";
|
|
43
|
+
var lastFocused = /* @__PURE__ */ new WeakMap();
|
|
44
|
+
/** Remembers where focus is inside `pane`; call from the pane's `focusin`. */
|
|
45
|
+
function rememberPaneFocus(pane, target) {
|
|
46
|
+
if (target instanceof HTMLElement && target !== pane && pane.contains(target)) lastFocused.set(pane, target);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Whether the pointer moving over `pane` should activate it. Only a real mouse move with no button
|
|
50
|
+
* held counts: a touch, a pen tap, a drag, a selection or content shifting under a still pointer
|
|
51
|
+
* does not. Focus already inside the pane, inside an open overlay, or in a text field that is in
|
|
52
|
+
* no pane (no `[data-pane-id]` ancestor) and outside `scope` stays where it is.
|
|
53
|
+
*/
|
|
54
|
+
function hoverTakesFocus(event, pane, scope) {
|
|
55
|
+
if (event.pointerType !== "mouse" || event.buttons !== 0) return false;
|
|
56
|
+
if (event.movementX === 0 && event.movementY === 0) return false;
|
|
57
|
+
const active = pane.ownerDocument.activeElement;
|
|
58
|
+
if (!active || active === pane.ownerDocument.body) return true;
|
|
59
|
+
if (pane.contains(active)) return false;
|
|
60
|
+
if (active.closest(OVERLAY)) return false;
|
|
61
|
+
return active.closest("[data-pane-id]") !== null || (scope?.contains(active) ?? false) || !active.matches(EDITABLE);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Moves focus into `pane` as a hover activation: back to the element it last had focus in, else
|
|
65
|
+
* its `data-pane-focus-target`, else the pane itself. The pane's `focusin` then marks it active.
|
|
66
|
+
* Returns whether focus moved.
|
|
67
|
+
*/
|
|
68
|
+
function focusPaneOnHover(event, pane, options = {}) {
|
|
69
|
+
if ((options.mode ?? paneFocusMode()) !== "hover") return false;
|
|
70
|
+
if (!hoverTakesFocus(event, pane, options.scope)) return false;
|
|
71
|
+
const remembered = lastFocused.get(pane);
|
|
72
|
+
((remembered?.isConnected && pane.contains(remembered) ? remembered : void 0) ?? pane.querySelector("[data-pane-focus-target]") ?? pane).focus({ preventScroll: true });
|
|
73
|
+
return pane.contains(pane.ownerDocument.activeElement);
|
|
74
|
+
}
|
|
75
|
+
export { PANE_FOCUS_TARGET, focusPaneOnHover, hoverTakesFocus, paneFocusMode, rememberPaneFocus, setPaneFocusMode, subscribePaneFocusMode };
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=pane-focus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pane-focus.js","names":[],"sources":["../../../../src/components/layout/split-layout/pane-focus.ts"],"sourcesContent":["// How a pane takes focus: on hover (the pointer moving onto it activates it, so the keys typed\n// next go to it) or on click. The choice is a device preference kept in `localStorage`, shared by\n// every pane surface: SplitLayout reads it by default, and a host's own pane (a floating window,\n// for instance) calls `focusPaneOnHover` from its `pointermove` to behave the same way.\n\nexport type PaneFocusMode = 'hover' | 'click'\n\nconst STORAGE_KEY = 'adea:pane-focus-mode:v1'\n\n// One shared copy, because the preference reaches the page from more than one bundle.\ntype PaneFocusState = { value: PaneFocusMode | undefined; listeners: Set<() => void> }\nconst STATE_KEY = Symbol.for('adea.ui.pane-focus-mode')\nconst state: PaneFocusState = ((globalThis as Record<symbol, unknown>)[STATE_KEY] ??= {\n value: undefined,\n listeners: new Set<() => void>(),\n}) as PaneFocusState\n\nfunction storage(): Pick<Storage, 'getItem' | 'setItem' | 'removeItem'> | undefined {\n try {\n return typeof localStorage === 'undefined' ? undefined : localStorage\n } catch {\n return undefined\n }\n}\n\n/** How panes take focus: on hover unless the person chose click. */\nexport function paneFocusMode(): PaneFocusMode {\n if (state.value === undefined) {\n let saved: string | null = null\n try {\n saved = storage()?.getItem(STORAGE_KEY) ?? null\n } catch {\n // Unreadable storage means the default.\n }\n state.value = saved === 'click' ? 'click' : 'hover'\n }\n return state.value\n}\n\nexport function setPaneFocusMode(value: PaneFocusMode): void {\n state.value = value\n try {\n if (value === 'hover') storage()?.removeItem(STORAGE_KEY)\n else storage()?.setItem(STORAGE_KEY, value)\n } catch {\n // The choice still applies for this session.\n }\n for (const listener of state.listeners) listener()\n}\n\n/** Calls `listener` after the choice changes; returns the way to stop. */\nexport function subscribePaneFocusMode(listener: () => void): () => void {\n state.listeners.add(listener)\n return () => state.listeners.delete(listener)\n}\n\n/** A pane's own element that takes the keys when hover activates it (a terminal's input, say). */\nexport const PANE_FOCUS_TARGET = '[data-pane-focus-target]'\n\n// Focus inside an open overlay is never taken by a pane the pointer passes over.\nconst OVERLAY = '[role=\"dialog\"], [role=\"alertdialog\"], [role=\"menu\"], [role=\"listbox\"]'\nconst EDITABLE = 'input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]'\n\n// The element each pane last had focus in, so hovering back returns the keys to it.\nconst lastFocused = new WeakMap<HTMLElement, HTMLElement>()\n\n/** Remembers where focus is inside `pane`; call from the pane's `focusin`. */\nexport function rememberPaneFocus(pane: HTMLElement, target: EventTarget | null): void {\n if (target instanceof HTMLElement && target !== pane && pane.contains(target))\n lastFocused.set(pane, target)\n}\n\ntype PointerLike = Pick<PointerEvent, 'pointerType' | 'buttons' | 'movementX' | 'movementY'>\n\n/**\n * Whether the pointer moving over `pane` should activate it. Only a real mouse move with no button\n * held counts: a touch, a pen tap, a drag, a selection or content shifting under a still pointer\n * does not. Focus already inside the pane, inside an open overlay, or in a text field that is in\n * no pane (no `[data-pane-id]` ancestor) and outside `scope` stays where it is.\n */\nexport function hoverTakesFocus(event: PointerLike, pane: HTMLElement, scope?: Element): boolean {\n if (event.pointerType !== 'mouse' || event.buttons !== 0) return false\n if (event.movementX === 0 && event.movementY === 0) return false\n const active = pane.ownerDocument.activeElement\n if (!active || active === pane.ownerDocument.body) return true\n if (pane.contains(active)) return false\n if (active.closest(OVERLAY)) return false\n const inPane = active.closest('[data-pane-id]') !== null || (scope?.contains(active) ?? false)\n return inPane || !active.matches(EDITABLE)\n}\n\n/**\n * Moves focus into `pane` as a hover activation: back to the element it last had focus in, else\n * its `data-pane-focus-target`, else the pane itself. The pane's `focusin` then marks it active.\n * Returns whether focus moved.\n */\nexport function focusPaneOnHover(\n event: PointerLike,\n pane: HTMLElement,\n options: { scope?: Element; mode?: PaneFocusMode } = {}\n): boolean {\n if ((options.mode ?? paneFocusMode()) !== 'hover') return false\n if (!hoverTakesFocus(event, pane, options.scope)) return false\n const remembered = lastFocused.get(pane)\n const target =\n (remembered?.isConnected && pane.contains(remembered) ? remembered : undefined) ??\n pane.querySelector<HTMLElement>(PANE_FOCUS_TARGET) ??\n pane\n target.focus({ preventScroll: true })\n return pane.contains(pane.ownerDocument.activeElement)\n}\n"],"mappings":";AAOA,IAAM,cAAc;AAIpB,IAAM,YAAY,OAAO,IAAI,yBAAyB;AACtD,IAAM,QAAyB,WAAwC,eAAe;CACpF,OAAO,KAAA;CACP,2BAAW,IAAI,IAAgB;AACjC;AAEA,SAAS,UAA2E;CAClF,IAAI;EACF,OAAO,OAAO,iBAAiB,cAAc,KAAA,IAAY;CAC3D,QAAQ;EACN;CACF;AACF;;AAGA,SAAgB,gBAA+B;CAC7C,IAAI,MAAM,UAAU,KAAA,GAAW;EAC7B,IAAI,QAAuB;EAC3B,IAAI;GACF,QAAQ,QAAQ,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AI,CAAC,gBAAgB,OAAO,MAAM,QAAQ,KAAK,GAAG,OAAO;CACzD,MAAM,aAAa,YAAY,IAAI,IAAI;CAKvC,EAHG,YAAY,eAAe,KAAK,SAAS,UAAU,IAAI,aAAa,KAAA,MACrE,KAAK,cAAA,0BAA4C,KACjD,KAAA,CACK,MAAM,EAAE,eAAe,KAAK,CAAC;CACpC,OAAO,KAAK,SAAS,KAAK,cAAc,aAAa;AACvD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Accessor } from 'solid-js';
|
|
2
2
|
import { type JSX } from '@solidjs/web';
|
|
3
3
|
import { type PaneDropIntent } from './drop';
|
|
4
|
+
import { type PaneFocusMode } from './pane-focus';
|
|
4
5
|
export type { PaneDropIntent } from './drop';
|
|
5
6
|
import { type SplitLayoutBranch, type SplitLayoutLeaf, type SplitLayoutState } from './model';
|
|
6
7
|
export type SplitLayoutProps<L extends SplitLayoutLeaf> = {
|
|
@@ -18,6 +19,11 @@ export type SplitLayoutProps<L extends SplitLayoutLeaf> = {
|
|
|
18
19
|
labelForSeparator?: (branch: SplitLayoutBranch<L>) => string;
|
|
19
20
|
onResize: (splitId: string, ratio: number) => void;
|
|
20
21
|
onFocus?: (leafId: string) => void;
|
|
22
|
+
/**
|
|
23
|
+
* How a pane takes focus. `hover` activates the pane the mouse moves onto (keys typed next go to
|
|
24
|
+
* it); `click` waits for a click. Defaults to the device preference (`paneFocusMode`).
|
|
25
|
+
*/
|
|
26
|
+
focusMode?: PaneFocusMode;
|
|
21
27
|
/** Host performs the model transition and returns the surviving focus destination. */
|
|
22
28
|
onClose?: (leafId: string) => string | undefined;
|
|
23
29
|
/** Pointer placement only; the host supplies keyboard commands and performs the model transition. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-layout.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/split-layout/split-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,QAAQ,EACd,MAAM,UAAU,CAA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EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClD,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB,sFAAsF;IACtF,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAA;IAChD,qGAAqG;IACrG,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,KAAK,IAAI,CAAA;IAC3E,qFAAqF;IACrF,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,CAAA;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AA+HD,wHAAwH;AACxH,wBAAgB,WAAW,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,eA0fhF"}
|
|
@@ -4,6 +4,7 @@ import { resizeSeparatorClass } from "../../../lib/resize-separator.js";
|
|
|
4
4
|
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
import { computeLayoutFrames } from "./geometry.js";
|
|
6
6
|
import { paneDropIntent } from "./drop.js";
|
|
7
|
+
import { focusPaneOnHover, paneFocusMode, rememberPaneFocus, subscribePaneFocusMode } from "./pane-focus.js";
|
|
7
8
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
8
9
|
import { MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, listLeaves } from "./tree.js";
|
|
9
10
|
import { Dynamic, className, createComponent, delegateEvents, effect, insert, memo, readShallow, ref, setAttribute, style, template } from "@solidjs/web";
|
|
@@ -158,6 +159,9 @@ function SplitLayout(props) {
|
|
|
158
159
|
const [drag, setDrag] = createSignal();
|
|
159
160
|
const [drop, setDrop] = createSignal();
|
|
160
161
|
const [resizeController, setResizeController] = createSignal();
|
|
162
|
+
const [preferredFocusMode, setPreferredFocusMode] = createSignal(paneFocusMode());
|
|
163
|
+
onCleanup(subscribePaneFocusMode(() => setPreferredFocusMode(paneFocusMode())));
|
|
164
|
+
const focusMode = () => props.focusMode ?? preferredFocusMode();
|
|
161
165
|
const reloadRequired = () => resizeControllerEntry >= resizeControllerEntries.length;
|
|
162
166
|
const cancelPendingFocusRestore = () => {
|
|
163
167
|
if (pendingFocusFrame !== void 0) cancelAnimationFrame(pendingFocusFrame);
|
|
@@ -362,7 +366,17 @@ function SplitLayout(props) {
|
|
|
362
366
|
var _el$9 = _el$7.nextSibling;
|
|
363
367
|
var _el$10 = _el$9.nextSibling;
|
|
364
368
|
var _el$11 = _el$6.nextSibling;
|
|
365
|
-
_el$5._$$
|
|
369
|
+
_el$5._$$pointermove = (event) => {
|
|
370
|
+
if (drag()) return;
|
|
371
|
+
focusPaneOnHover(event, event.currentTarget, {
|
|
372
|
+
mode: focusMode(),
|
|
373
|
+
...root ? { scope: root } : {}
|
|
374
|
+
});
|
|
375
|
+
};
|
|
376
|
+
_el$5._$$focusin = (event) => {
|
|
377
|
+
rememberPaneFocus(event.currentTarget, event.target);
|
|
378
|
+
props.onFocus?.(id);
|
|
379
|
+
};
|
|
366
380
|
_el$5.addEventListener("drop", (event) => {
|
|
367
381
|
const current = allowedTarget(id, event.dataTransfer);
|
|
368
382
|
const next = paneDropIntent(event.clientX, event.clientY, event.currentTarget.getBoundingClientRect());
|
|
@@ -499,14 +513,15 @@ function SplitLayout(props) {
|
|
|
499
513
|
width: 0,
|
|
500
514
|
height: 0
|
|
501
515
|
})),
|
|
502
|
-
r:
|
|
503
|
-
d:
|
|
516
|
+
r: focusMode(),
|
|
517
|
+
d: props.onMove ? "true" : "false",
|
|
518
|
+
l: readShallow(cn("flex min-w-0 flex-1 items-center gap-2 truncate text-sm", {
|
|
504
519
|
"cursor-grab": Boolean(props.onMove),
|
|
505
520
|
"cursor-grabbing": drag()?.id === id
|
|
506
521
|
})),
|
|
507
|
-
|
|
522
|
+
u: props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : void 0
|
|
508
523
|
};
|
|
509
|
-
}, ({ e, t, a, o, i, n, s, h, r, d, l }, _p$) => {
|
|
524
|
+
}, ({ e, t, a, o, i, n, s, h, r, d, l, u }, _p$) => {
|
|
510
525
|
e !== _p$?.e && setAttribute(_el$5, "id", e);
|
|
511
526
|
t !== _p$?.t && setAttribute(_el$5, "aria-label", t);
|
|
512
527
|
a !== _p$?.a && setAttribute(_el$5, "tabindex", a);
|
|
@@ -515,9 +530,10 @@ function SplitLayout(props) {
|
|
|
515
530
|
n !== _p$?.n && setAttribute(_el$5, "data-drop-direction", n);
|
|
516
531
|
s !== _p$?.s && setAttribute(_el$5, "data-drop-placement", s);
|
|
517
532
|
style(_el$5, h, _p$?.h);
|
|
518
|
-
r !== _p$?.r && setAttribute(_el$
|
|
519
|
-
|
|
520
|
-
|
|
533
|
+
r !== _p$?.r && setAttribute(_el$5, "data-focus-mode", r);
|
|
534
|
+
d !== _p$?.d && setAttribute(_el$7, "draggable", d);
|
|
535
|
+
className(_el$7, l, _p$?.l);
|
|
536
|
+
u !== _p$?.u && setAttribute(_el$7, "title", u);
|
|
521
537
|
});
|
|
522
538
|
return _el$5;
|
|
523
539
|
}
|
|
@@ -642,7 +658,7 @@ function SplitLayout(props) {
|
|
|
642
658
|
});
|
|
643
659
|
return _el$;
|
|
644
660
|
}
|
|
645
|
-
delegateEvents(["focusin"]);
|
|
661
|
+
delegateEvents(["focusin", "pointermove"]);
|
|
646
662
|
export { SplitLayout };
|
|
647
663
|
|
|
648
664
|
//# sourceMappingURL=split-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-layout.js","names":["ref={(el) => {\n root = el\n }}","<For each={leaves().map((leaf) => leaf.id)}>\n {(id) => {\n // A memo: the map is rebuilt on every resize tick, but the leaf object\n // only changes when the leaf does, so the host's renderers stay quiet.\n // A leaf on its way out keeps its last value.\n const leaf = createMemo((previous?: L) => leafMap().get(id) ?? previous!)\n const content = props.renderLeaf(leaf)\n const paneLabel = props.renderPaneLabel?.(leaf)\n const actions = props.renderPaneActions?.(leaf)\n const intent = () => (drop()?.id === id ? drop()?.intent : undefined)\n onCleanup(() => {\n refs.delete(id)\n domIds.delete(id)\n })\n return (\n <section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabindex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n flush()\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n flush()\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) {\n setDrop(undefined)\n flush()\n }\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n flush()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n onFocusIn={() => props.onFocus?.(id)}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>\n )\n }}\n </For>","ref={(el) => refs.set(id, el)}","<GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />","class=\"size-3 shrink-0\"","<span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>","<header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>","<ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>","variant=\"ghost\"","size=\"icon-xs\"","onClick={() => close(id)}","<X />","aria-label={props.labelForLeaf(leaf())}","tabindex={props.paneTabIndex ?? -1}","data-focused={props.state.focusedLeafId === id ? '' : undefined}","data-drag-source={drag()?.id === id ? '' : undefined}","data-drop-direction={intent()?.direction}","data-drop-placement={intent()?.placement}","style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}","draggable={props.onMove ? 'true' : 'false'}","class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}","title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}","<section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabindex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n flush()\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n flush()\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) {\n setDrop(undefined)\n flush()\n }\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n flush()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n onFocusIn={() => props.onFocus?.(id)}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>","<div\n ref={(el) => {\n root = el\n }}\n role=\"group\"\n aria-label={props.label}\n data-slot=\"split-layout\"\n data-dragging={drag() ? '' : undefined}\n class={cn('relative size-full min-h-0 min-w-0 data-[dragging]:cursor-grabbing', props.class)}\n >\n <For each={leaves().map((leaf) => leaf.id)}>\n {(id) => {\n // A memo: the map is rebuilt on every resize tick, but the leaf object\n // only changes when the leaf does, so the host's renderers stay quiet.\n // A leaf on its way out keeps its last value.\n const leaf = createMemo((previous?: L) => leafMap().get(id) ?? previous!)\n const content = props.renderLeaf(leaf)\n const paneLabel = props.renderPaneLabel?.(leaf)\n const actions = props.renderPaneActions?.(leaf)\n const intent = () => (drop()?.id === id ? drop()?.intent : undefined)\n onCleanup(() => {\n refs.delete(id)\n domIds.delete(id)\n })\n return (\n <section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabindex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n flush()\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n flush()\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) {\n setDrop(undefined)\n flush()\n }\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n flush()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n onFocusIn={() => props.onFocus?.(id)}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>\n )\n }}\n </For>\n <span class=\"sr-only\" role=\"status\">\n {dropLabel() ||\n (resizeController() === 'error'\n ? reloadRequired()\n ? 'Resize controls didn’t load. Reloading may lose unsaved pane content.'\n : 'Resize controls did not load.'\n : '')}\n </span>\n <For each={branches().map((branch) => branch.id)}>\n {(id) => {\n const branch: Accessor<SplitLayoutBranch<L>> = createMemo(\n (previous?: SplitLayoutBranch<L>) => branchMap().get(id) ?? previous!\n )\n const rect = () => frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 }\n return (\n <Show\n when={typeof resizeController() === 'function'}\n fallback={\n <div\n role=\"separator\"\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}\n aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}\n aria-valuenow={Math.round(branch().ratio * 100)}\n aria-disabled=\"true\"\n tabindex={-1}\n data-direction={branch().direction}\n style={separatorPlaceholderStyle(branch(), rect())}\n class=\"pointer-events-none absolute bg-border\"\n />\n }\n >\n <Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />\n </Show>\n )\n }}\n </For>\n {resizeController() === 'error' ? (\n <div class=\"absolute top-2 right-2 z-(--z-menu) flex max-w-sm flex-col items-end gap-2\">\n {reloadRequired() ? (\n <p\n id={resizeReloadWarningId}\n role=\"alert\"\n class=\"rounded-md border bg-background p-2 text-sm shadow-md\"\n >\n Reloading may discard unsaved pane content.\n </p>\n ) : null}\n <Button\n variant=\"outline\"\n size=\"sm\"\n data-resize-retry\n aria-describedby={reloadRequired() ? resizeReloadWarningId : undefined}\n onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}\n >\n {reloadRequired() ? 'Reload page to retry resizing' : 'Retry pane resizing'}\n </Button>\n </div>\n ) : null}\n </div>","<For each={branches().map((branch) => branch.id)}>\n {(id) => {\n const branch: Accessor<SplitLayoutBranch<L>> = createMemo(\n (previous?: SplitLayoutBranch<L>) => branchMap().get(id) ?? previous!\n )\n const rect = () => frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 }\n return (\n <Show\n when={typeof resizeController() === 'function'}\n fallback={\n <div\n role=\"separator\"\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}\n aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}\n aria-valuenow={Math.round(branch().ratio * 100)}\n aria-disabled=\"true\"\n tabindex={-1}\n data-direction={branch().direction}\n style={separatorPlaceholderStyle(branch(), rect())}\n class=\"pointer-events-none absolute bg-border\"\n />\n }\n >\n <Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />\n </Show>\n )\n }}\n </For>","<Show\n when={typeof resizeController() === 'function'}\n fallback={\n <div\n role=\"separator\"\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}\n aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}\n aria-valuenow={Math.round(branch().ratio * 100)}\n aria-disabled=\"true\"\n tabindex={-1}\n data-direction={branch().direction}\n style={separatorPlaceholderStyle(branch(), rect())}\n class=\"pointer-events-none absolute bg-border\"\n />\n }\n >\n <Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />\n </Show>","<Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />","rect={() => rectStyle(rect())}","root={() => root}","aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}","aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}","aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}","aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}","aria-valuenow={Math.round(branch().ratio * 100)}","data-direction={branch().direction}","style={separatorPlaceholderStyle(branch(), rect())}","<div class=\"absolute top-2 right-2 z-(--z-menu) flex max-w-sm flex-col items-end gap-2\">\n {reloadRequired() ? (\n <p\n id={resizeReloadWarningId}\n role=\"alert\"\n class=\"rounded-md border bg-background p-2 text-sm shadow-md\"\n >\n Reloading may discard unsaved pane content.\n </p>\n ) : null}\n <Button\n variant=\"outline\"\n size=\"sm\"\n data-resize-retry\n aria-describedby={reloadRequired() ? resizeReloadWarningId : undefined}\n onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}\n >\n {reloadRequired() ? 'Reload page to retry resizing' : 'Retry pane resizing'}\n </Button>\n </div>","<Button\n variant=\"outline\"\n size=\"sm\"\n data-resize-retry\n aria-describedby={reloadRequired() ? resizeReloadWarningId : undefined}\n onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}\n >\n {reloadRequired() ? 'Reload page to retry resizing' : 'Retry pane resizing'}\n </Button>","variant=\"outline\"","size=\"sm\"","onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}","data-dragging={drag() ? '' : undefined}","class={cn('relative size-full min-h-0 min-w-0 data-[dragging]:cursor-grabbing', props.class)}","X","LucideX","GripVertical","LucideGripVertical","_$readShallow","_$setAttribute"],"sources":["../../../../src/components/layout/split-layout/split-layout.tsx"],"sourcesContent":["import {\n For,\n createEffect,\n createMemo,\n createUniqueId,\n createSignal,\n flush,\n onSettled,\n onCleanup,\n Show,\n type Accessor,\n} from 'solid-js'\nimport { type JSX } from '@solidjs/web'\nimport { Dynamic } from '@solidjs/web'\nimport { X as LucideX, GripVertical as LucideGripVertical } from '@lucide/solid'\nimport { ActionButton } from '../../composites/action-button'\nimport { Button } from '../../ui/button'\nimport { resizeSeparatorClass } from '#lib/resize-separator'\nimport { cn } from '#lib/utils'\nimport { computeLayoutFrames, type LayoutRect } from './geometry'\nimport { paneDropIntent, type PaneDropIntent } from './drop'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst X = fastIcon(LucideX)\nconst GripVertical = fastIcon(LucideGripVertical)\nexport type { PaneDropIntent } from './drop'\nconst PANE_DRAG_TYPE = 'application/x-adea-pane-move'\nconst DRAG_PREVIEW_MAX_WIDTH = 384\nconst DRAG_PREVIEW_MAX_HEIGHT = 256\nimport {\n listLeaves,\n MAX_SPLIT_RATIO,\n MIN_SPLIT_RATIO,\n type SplitLayoutBranch,\n type SplitLayoutLeaf,\n type SplitLayoutState,\n} from './model'\nimport type { SplitLayoutResizeControllerProps } from './resize-controller-core'\n\ntype ResizeController<L extends SplitLayoutLeaf> = (\n props: SplitLayoutResizeControllerProps<L>\n) => JSX.Element\ntype ResizeControllerState<L extends SplitLayoutLeaf> = ResizeController<L> | false | 'error'\n\n/*\n * Browsers cache a failed module import under its URL, failed static\n * dependencies included, so retrying the same specifier fails again without a\n * request. Each attempt therefore takes the next entry: a second facade over\n * the same implementation (a failed facade request recovers without fetching\n * the implementation twice), then a facade over a byte-identical copy of the\n * implementation (a failed implementation chunk recovers). After the last one\n * only a reload can fetch the controller.\n */\nconst resizeControllerEntries = [\n () => import('./resize-controller'),\n () => import('./resize-controller-retry'),\n () => import('./resize-controller-retry-2'),\n]\n\nexport type SplitLayoutProps<L extends SplitLayoutLeaf> = {\n state: SplitLayoutState<L>\n label: string\n /** Accessible name for a pane region and its close button. */\n labelForLeaf: (leaf: L) => string\n /** Called once per stable leaf owner; the accessor tracks opaque payload replacement. */\n renderLeaf: (leaf: Accessor<L>) => JSX.Element\n /** Inline visible header composition, separate from the region and close-button name. */\n renderPaneLabel?: (leaf: Accessor<L>) => JSX.Element\n /** Whether pane regions participate in sequential keyboard navigation; defaults to programmatic focus only. */\n paneTabIndex?: 0 | -1\n /** Accessible splitter name; defaults to the current orientation-specific label. */\n labelForSeparator?: (branch: SplitLayoutBranch<L>) => string\n onResize: (splitId: string, ratio: number) => void\n onFocus?: (leafId: string) => void\n /** Host performs the model transition and returns the surviving focus destination. */\n onClose?: (leafId: string) => string | undefined\n /** Pointer placement only; the host supplies keyboard commands and performs the model transition. */\n onMove?: (leafId: string, targetId: string, intent: PaneDropIntent) => void\n /** Stable header composition for host-owned keyboard actions/capability feedback. */\n renderPaneActions?: (leaf: Accessor<L>) => JSX.Element\n class?: string\n}\nfunction rectStyle(rect: LayoutRect): JSX.CSSProperties {\n return {\n left: `${rect.x * 100}%`,\n top: `${rect.y * 100}%`,\n width: `${rect.width * 100}%`,\n height: `${rect.height * 100}%`,\n }\n}\nfunction separatorPlaceholderStyle(branch: SplitLayoutBranch, rect: LayoutRect): JSX.CSSProperties {\n const horizontal = branch.direction === 'row'\n return {\n left: `${(rect.x + (horizontal ? rect.width * branch.ratio : 0)) * 100}%`,\n top: `${(rect.y + (horizontal ? 0 : rect.height * branch.ratio)) * 100}%`,\n width: horizontal ? '1px' : `${rect.width * 100}%`,\n height: horizontal ? `${rect.height * 100}%` : '1px',\n transform: horizontal ? 'translateX(-50%)' : 'translateY(-50%)',\n }\n}\nfunction dragPreviewPlaceholder(source: HTMLElement, message: string) {\n const placeholder = document.createElement('div')\n placeholder.className = cn(\n source.getAttribute('class'),\n 'flex min-h-8 min-w-0 items-center justify-center bg-muted px-2 text-center text-xs text-muted-foreground'\n )\n placeholder.setAttribute('data-split-drag-placeholder', source.localName)\n placeholder.textContent = message\n return placeholder\n}\nfunction boundedSnapshotSize(width: number, height: number) {\n const sourceWidth = Math.max(1, width)\n const sourceHeight = Math.max(1, height)\n const scale = Math.min(\n 1,\n DRAG_PREVIEW_MAX_WIDTH / sourceWidth,\n DRAG_PREVIEW_MAX_HEIGHT / sourceHeight\n )\n return {\n width: Math.max(1, Math.round(sourceWidth * scale)),\n height: Math.max(1, Math.round(sourceHeight * scale)),\n }\n}\nfunction cloneDragPreviewNode(source: Node): Node | undefined {\n if (source.nodeType === Node.TEXT_NODE) return source.cloneNode(false)\n if (!(source instanceof HTMLElement || source instanceof SVGElement))\n return source.cloneNode(false)\n\n if (['script', 'style', 'link', 'source', 'track', 'meta'].includes(source.localName))\n return undefined\n if (['iframe', 'video', 'audio', 'object', 'embed'].includes(source.localName))\n return dragPreviewPlaceholder(\n source as HTMLElement,\n 'Embedded content unavailable while moving'\n )\n if (source instanceof HTMLImageElement) {\n const snapshot = document.createElement('canvas')\n const size = boundedSnapshotSize(\n source.naturalWidth || source.width,\n source.naturalHeight || source.height\n )\n snapshot.width = size.width\n snapshot.height = size.height\n snapshot.className = source.getAttribute('class') ?? ''\n snapshot.setAttribute('data-split-drag-image', '')\n try {\n if (!source.complete || source.naturalWidth === 0)\n throw new Error('image has no decoded pixels')\n const context = snapshot.getContext('2d')\n if (!context) throw new Error('canvas snapshot context is unavailable')\n context.drawImage(source, 0, 0, snapshot.width, snapshot.height)\n return snapshot\n } catch {\n return dragPreviewPlaceholder(source, 'Image preview unavailable')\n }\n }\n\n // Copying a defined custom element can run its constructor; inserting it can\n // also reconnect a stream or terminal session. Flatten its display tree.\n if (source instanceof HTMLElement && source.localName.includes('-')) {\n const children = document.createDocumentFragment()\n for (const child of source.childNodes) {\n const clone = cloneDragPreviewNode(child)\n if (clone) children.append(clone)\n }\n return children.childNodes.length > 0\n ? children\n : dragPreviewPlaceholder(source, 'Live component preview unavailable while moving')\n }\n\n const clone = source.cloneNode(false) as HTMLElement | SVGElement\n for (const attribute of [\n 'id',\n 'style',\n 'draggable',\n 'data-pane-drag-handle',\n 'data-pane-id',\n 'src',\n 'srcset',\n 'href',\n 'xlink:href',\n 'data',\n 'poster',\n ])\n clone.removeAttribute(attribute)\n for (const attribute of Array.from(clone.attributes))\n if (/^on/i.test(attribute.name)) clone.removeAttribute(attribute.name)\n\n if (source instanceof HTMLCanvasElement && clone instanceof HTMLCanvasElement) {\n const size = boundedSnapshotSize(source.width, source.height)\n clone.width = size.width\n clone.height = size.height\n try {\n const context = clone.getContext('2d')\n if (!context) throw new Error('canvas snapshot context is unavailable')\n context.drawImage(source, 0, 0, clone.width, clone.height)\n } catch {\n return dragPreviewPlaceholder(source, 'Canvas preview unavailable while moving')\n }\n return clone\n }\n\n for (const child of source.childNodes) {\n const childClone = cloneDragPreviewNode(child)\n if (childClone) clone.append(childClone)\n }\n return clone\n}\n/** Muxy frame geometry keeps leaf owners stable; the lazy resize controller owns constrained separator interactions. */\nexport function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L>) {\n let root: HTMLDivElement | undefined\n let pendingFrame: number | undefined\n let disposed = false\n let resizeLoadGeneration = 0\n let resizeControllerEntry = 0\n let focusAfterResizeLoad = false\n // Counts focus moves to a real target. A deferred restore checks it so it\n // never pulls focus back after the user (or code) deliberately moved it.\n let focusMoves = 0\n let pendingFocusFrame: number | undefined\n let pendingFocusRetryTimer: number | undefined\n const refs = new Map<string, HTMLElement>()\n const domIds = new Map<string, string>()\n const prefix = createUniqueId()\n const resizeReloadWarningId = `${prefix}-resize-reload-warning`\n let nextDomId = 0\n let nextDragId = 0\n let dragPreview: HTMLElement | undefined\n const [drag, setDrag] = createSignal<{ id: string; token: string }>()\n const [drop, setDrop] = createSignal<{ id: string; intent: PaneDropIntent }>()\n const [resizeController, setResizeController] = createSignal<ResizeControllerState<L>>()\n const reloadRequired = () => resizeControllerEntry >= resizeControllerEntries.length\n const cancelPendingFocusRestore = () => {\n if (pendingFocusFrame !== undefined) cancelAnimationFrame(pendingFocusFrame)\n pendingFocusFrame = undefined\n if (pendingFocusRetryTimer !== undefined) clearTimeout(pendingFocusRetryTimer)\n pendingFocusRetryTimer = undefined\n }\n const focusAfterRender = (selector: string, preserveCurrentFocus = false) => {\n const attemptFocus = (retries: number) => {\n if (preserveCurrentFocus) {\n const currentFocus = root?.ownerDocument.activeElement\n if (currentFocus && currentFocus !== root?.ownerDocument.body && currentFocus !== root)\n return\n }\n const target = root?.querySelector<HTMLElement>(selector)\n if (target) {\n target.focus({ preventScroll: true })\n return\n }\n // A Solid state update can commit the replacement control after the\n // first frame. Retry in bounded tasks so a backgrounded page's paused\n // animation frames cannot strand keyboard focus.\n if (retries > 0)\n pendingFocusRetryTimer = window.setTimeout(() => {\n pendingFocusRetryTimer = undefined\n attemptFocus(retries - 1)\n }, 0)\n }\n cancelPendingFocusRestore()\n pendingFocusFrame = requestAnimationFrame(() => {\n pendingFocusFrame = undefined\n attemptFocus(2)\n })\n }\n const trackFocusChange = (event: FocusEvent) => {\n if (event.target === document.body) return\n focusMoves += 1\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n }\n onSettled(() => {\n document.addEventListener('focusin', trackFocusChange)\n return () => document.removeEventListener('focusin', trackFocusChange)\n })\n const clearDrag = () => {\n setDrag(undefined)\n setDrop(undefined)\n dragPreview?.remove()\n dragPreview = undefined\n }\n const createDragPreview = (source: HTMLElement) => {\n dragPreview?.remove()\n const preview = cloneDragPreviewNode(source) as HTMLElement\n preview.className =\n 'pointer-events-none fixed -left-full top-0 z-(--z-dialog) flex h-64 max-h-screen w-96 max-w-screen min-h-0 min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-card text-card-foreground shadow-xl'\n preview.removeAttribute('id')\n preview.removeAttribute('style')\n preview.removeAttribute('role')\n preview.removeAttribute('aria-label')\n preview.removeAttribute('data-pane-id')\n preview.removeAttribute('data-focused')\n preview.removeAttribute('data-drag-source')\n preview.removeAttribute('data-drop-direction')\n preview.removeAttribute('data-drop-placement')\n preview.setAttribute('data-split-drag-preview', '')\n preview.setAttribute('aria-hidden', 'true')\n preview.inert = true\n document.body.append(preview)\n dragPreview = preview\n return preview\n }\n const domId = (id: string) => {\n const existing = domIds.get(id)\n if (existing) return existing\n const created = `${prefix}-pane-${nextDomId++}`\n domIds.set(id, created)\n return created\n }\n const leaves = createMemo(() => listLeaves(props.state.center))\n const leafMap = createMemo(() => new Map(leaves().map((leaf) => [leaf.id, leaf])))\n const frames = createMemo(() => computeLayoutFrames(props.state.center))\n const branches = createMemo(() =>\n Array.from(frames().values()).flatMap((frame) =>\n frame.node.kind === 'split' ? [frame.node] : []\n )\n )\n // The branch list is rebuilt on every resize tick; only whether any split\n // exists matters to the loader, so gate it behind a memo.\n const hasBranches = createMemo(() => branches().length > 0)\n createEffect(\n () => ({ split: hasBranches(), controller: resizeController() }),\n ({ split, controller }) => {\n if (!split) {\n resizeLoadGeneration += 1\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n // Keep a loaded controller so a later split does not re-import an entry\n // that may have failed before recovery. Clear only transient UI state.\n if (controller === false || controller === 'error') setResizeController(undefined)\n return\n }\n if (controller !== undefined) return\n const generation = ++resizeLoadGeneration\n const entry = Math.min(resizeControllerEntry, resizeControllerEntries.length - 1)\n cancelPendingFocusRestore()\n setResizeController(false)\n void resizeControllerEntries[entry]!().then(\n ({ default: Controller }) => {\n if (disposed || generation !== resizeLoadGeneration || !hasBranches()) return\n const shouldFocusHandle = focusAfterResizeLoad\n focusAfterResizeLoad = false\n setResizeController(() => Controller)\n if (shouldFocusHandle) focusAfterRender('[data-split-layout-handle]', true)\n },\n () => {\n // The next split must start from the next entry as well.\n resizeControllerEntry = Math.max(resizeControllerEntry, entry + 1)\n if (!disposed && generation === resizeLoadGeneration && hasBranches()) {\n setResizeController('error')\n if (focusAfterResizeLoad) focusAfterRender('[data-resize-retry]')\n }\n }\n )\n }\n )\n // Drop drag and drop state whose pane left the layout. Clearing also removes\n // the floating drag preview node, so this is an effect rather than a memo.\n createEffect(\n () => ({ current: drag(), target: drop(), canMove: Boolean(props.onMove), map: leafMap() }),\n ({ current, target, canMove, map }) => {\n if (current && (!canMove || !map.has(current.id))) clearDrag()\n else if (target && !map.has(target.id)) setDrop(undefined)\n }\n )\n const allowedTarget = (id: string, transfer: DataTransfer | null) => {\n const current = drag()\n return props.onMove &&\n current &&\n current.id !== id &&\n leafMap().has(current.id) &&\n leafMap().has(id) &&\n transfer?.types.includes(PANE_DRAG_TYPE)\n ? current\n : undefined\n }\n const dropLabel = createMemo(() => {\n const target = drop()\n const leaf = target ? leafMap().get(target.id) : undefined\n return target && leaf\n ? `Drop to place pane ${target.intent.placement} ${props.labelForLeaf(leaf)}`\n : ''\n })\n const branchMap = createMemo(() => new Map(branches().map((branch) => [branch.id, branch])))\n const schedule = (action: () => void) => {\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n pendingFrame = requestAnimationFrame(() => {\n pendingFrame = undefined\n action()\n })\n }\n // Capture a focused editor before an ordered DOM move can blur it. The\n // compute phase runs before any render effect moves nodes, so it reads the\n // focus and selection as they were; the apply phase schedules the restore.\n // Never override a newer focus outside this root.\n createEffect(\n () => {\n void props.state.center\n const active = root?.ownerDocument.activeElement\n if (!root || !(active instanceof HTMLElement) || !root.contains(active)) return undefined\n const field =\n active instanceof HTMLTextAreaElement || active instanceof HTMLInputElement\n ? active\n : undefined\n const selection = field\n ? {\n start: field.selectionStart,\n end: field.selectionEnd,\n direction: field.selectionDirection,\n }\n : undefined\n return { active, field, selection }\n },\n (captured) => {\n if (!captured) return\n const { active, field, selection } = captured\n const moves = focusMoves\n schedule(() => {\n // Focus went somewhere else on purpose (for example the resize retry\n // action) before this frame ran: that focus, not this one, is current.\n if (focusMoves !== moves) return\n if (!active.isConnected || !root?.contains(active)) return\n const current = active.ownerDocument.activeElement\n if (current !== active && current !== active.ownerDocument.body) return\n active.focus({ preventScroll: true })\n if (field && selection?.start !== null && selection?.end !== null && selection)\n field.setSelectionRange(selection.start, selection.end, selection.direction ?? undefined)\n })\n },\n { defer: true }\n )\n onCleanup(() => {\n disposed = true\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n clearDrag()\n refs.clear()\n domIds.clear()\n })\n const close = (id: string) => {\n const next = props.onClose?.(id)\n // Apply the host's removal now: a drop dispatched right after the click\n // must see the closed pane gone and its drag payload invalidated.\n flush()\n if (next) schedule(() => refs.get(next)?.focus({ preventScroll: true }))\n }\n return (\n <div\n ref={(el) => {\n root = el\n }}\n role=\"group\"\n aria-label={props.label}\n data-slot=\"split-layout\"\n data-dragging={drag() ? '' : undefined}\n class={cn('relative size-full min-h-0 min-w-0 data-[dragging]:cursor-grabbing', props.class)}\n >\n <For each={leaves().map((leaf) => leaf.id)}>\n {(id) => {\n // A memo: the map is rebuilt on every resize tick, but the leaf object\n // only changes when the leaf does, so the host's renderers stay quiet.\n // A leaf on its way out keeps its last value.\n const leaf = createMemo((previous?: L) => leafMap().get(id) ?? previous!)\n const content = props.renderLeaf(leaf)\n const paneLabel = props.renderPaneLabel?.(leaf)\n const actions = props.renderPaneActions?.(leaf)\n const intent = () => (drop()?.id === id ? drop()?.intent : undefined)\n onCleanup(() => {\n refs.delete(id)\n domIds.delete(id)\n })\n return (\n <section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabindex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n flush()\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n flush()\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) {\n setDrop(undefined)\n flush()\n }\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n flush()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n onFocusIn={() => props.onFocus?.(id)}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>\n )\n }}\n </For>\n <span class=\"sr-only\" role=\"status\">\n {dropLabel() ||\n (resizeController() === 'error'\n ? reloadRequired()\n ? 'Resize controls didn’t load. Reloading may lose unsaved pane content.'\n : 'Resize controls did not load.'\n : '')}\n </span>\n <For each={branches().map((branch) => branch.id)}>\n {(id) => {\n const branch: Accessor<SplitLayoutBranch<L>> = createMemo(\n (previous?: SplitLayoutBranch<L>) => branchMap().get(id) ?? previous!\n )\n const rect = () => frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 }\n return (\n <Show\n when={typeof resizeController() === 'function'}\n fallback={\n <div\n role=\"separator\"\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}\n aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}\n aria-valuenow={Math.round(branch().ratio * 100)}\n aria-disabled=\"true\"\n tabindex={-1}\n data-direction={branch().direction}\n style={separatorPlaceholderStyle(branch(), rect())}\n class=\"pointer-events-none absolute bg-border\"\n />\n }\n >\n <Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />\n </Show>\n )\n }}\n </For>\n {resizeController() === 'error' ? (\n <div class=\"absolute top-2 right-2 z-(--z-menu) flex max-w-sm flex-col items-end gap-2\">\n {reloadRequired() ? (\n <p\n id={resizeReloadWarningId}\n role=\"alert\"\n class=\"rounded-md border bg-background p-2 text-sm shadow-md\"\n >\n Reloading may discard unsaved pane content.\n </p>\n ) : null}\n <Button\n variant=\"outline\"\n size=\"sm\"\n data-resize-retry\n aria-describedby={reloadRequired() ? resizeReloadWarningId : undefined}\n onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}\n >\n {reloadRequired() ? 'Reload page to retry resizing' : 'Retry pane resizing'}\n </Button>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,IAAM2C,MAAI,SAASC,CAAO;AAC1B,IAAMC,iBAAe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BQ,OAAA,IAAA,WA3BN;IA0BK,IAAA,SAAA,QAAA;IA1BL,IAAA,SAAA,OAAA;;IACE,OAAA,eAAA;;MAAC,OAAA,CAAA,CAAA,eAAe;KAQR,CAAA;KARR,aAAA;MAQQ,OAAA,KAAA,WAPN;OAMG,IAAA,SAAA,QAAA;OALD,aAAA,QAAA,MAAI,qBAAqB;OAD3B,OAAA;MAMG,EAAA,CAAA,IACD;KAAI;IAAC,EAAA,CAAD,GATVa,MA0BK;IA1BL,OAAA,QAUEC,gBAAAA,QAAAA;KACEC,SAAQ;KACRC,MAAK;KACL,qBAAA;KACA,IAAA,qBAAA;MAAkB,OAAA,eAAe,IAAI,wBAAwB,KAAA;KAAS;KACtEC,UAAU,UAAU;MAClB,IAAI,eAAe,GAAG;OACpB,OAAO,SAAS,OAAO;OACvB;MACF;MACA,uBAAuB,SAAS,kBAAkB,MAAM;MACxD,oBAAoB,KAAA,CAAS;KAC/B;KAZF,IAAA,WAAA;MAcG,OAAA,eAAe,IAAI,kCAAkC;KAChD;IAzBVJ,CAAAA,GAAAA,MA0BK;IA1BL,OAAA;GA0BK,EAAA,CAAA,IACH;EAAI;CAAC,EAAA,CAAD,GA1PVb,KA2PK;CAtPH,aAAA;;GAAY,GAAA,MAAM;GAElBkB,GAAe,KAAK,IAAI,KAAK,KAAA;GAC7BC,GAAAA,YAAO,GAAG,sEAAsE,MAAM,KAAK,CAAC;EAHrE;CAAvB,IAAA,EAAA,GAAA,GAAA,KAAA,QAAA;EAAuB,MAAA,KAAA,KAAAM,aAAA,MAAA,cAAA,CAAA;EAEvB,MAAA,KAAA,KAAAA,aAAA,MAAA,iBAAA,CAAsC;EACtC,UAAA,MAAA,GAAA,KAAA,CAA4F;CAHrE,CAAA;CAN3B,OACEzB;AA6PJ"}
|
|
1
|
+
{"version":3,"file":"split-layout.js","names":["ref={(el) => {\n root = el\n }}","<For each={leaves().map((leaf) => leaf.id)}>\n {(id) => {\n // A memo: the map is rebuilt on every resize tick, but the leaf object\n // only changes when the leaf does, so the host's renderers stay quiet.\n // A leaf on its way out keeps its last value.\n const leaf = createMemo((previous?: L) => leafMap().get(id) ?? previous!)\n const content = props.renderLeaf(leaf)\n const paneLabel = props.renderPaneLabel?.(leaf)\n const actions = props.renderPaneActions?.(leaf)\n const intent = () => (drop()?.id === id ? drop()?.intent : undefined)\n onCleanup(() => {\n refs.delete(id)\n domIds.delete(id)\n })\n return (\n <section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabindex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n flush()\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n flush()\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) {\n setDrop(undefined)\n flush()\n }\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n flush()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n data-focus-mode={focusMode()}\n onFocusIn={(event) => {\n rememberPaneFocus(event.currentTarget, event.target)\n props.onFocus?.(id)\n }}\n onPointerMove={(event) => {\n if (drag()) return\n focusPaneOnHover(event, event.currentTarget, {\n mode: focusMode(),\n ...(root ? { scope: root } : {}),\n })\n }}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>\n )\n }}\n </For>","ref={(el) => refs.set(id, el)}","<GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />","class=\"size-3 shrink-0\"","<span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>","<header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>","<ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>","variant=\"ghost\"","size=\"icon-xs\"","onClick={() => close(id)}","<X />","aria-label={props.labelForLeaf(leaf())}","tabindex={props.paneTabIndex ?? -1}","data-focused={props.state.focusedLeafId === id ? '' : undefined}","data-drag-source={drag()?.id === id ? '' : undefined}","data-drop-direction={intent()?.direction}","data-drop-placement={intent()?.placement}","style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}","data-focus-mode={focusMode()}","draggable={props.onMove ? 'true' : 'false'}","class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}","title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}","<section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabindex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n flush()\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n flush()\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) {\n setDrop(undefined)\n flush()\n }\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n flush()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n data-focus-mode={focusMode()}\n onFocusIn={(event) => {\n rememberPaneFocus(event.currentTarget, event.target)\n props.onFocus?.(id)\n }}\n onPointerMove={(event) => {\n if (drag()) return\n focusPaneOnHover(event, event.currentTarget, {\n mode: focusMode(),\n ...(root ? { scope: root } : {}),\n })\n }}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>","<div\n ref={(el) => {\n root = el\n }}\n role=\"group\"\n aria-label={props.label}\n data-slot=\"split-layout\"\n data-dragging={drag() ? '' : undefined}\n class={cn('relative size-full min-h-0 min-w-0 data-[dragging]:cursor-grabbing', props.class)}\n >\n <For each={leaves().map((leaf) => leaf.id)}>\n {(id) => {\n // A memo: the map is rebuilt on every resize tick, but the leaf object\n // only changes when the leaf does, so the host's renderers stay quiet.\n // A leaf on its way out keeps its last value.\n const leaf = createMemo((previous?: L) => leafMap().get(id) ?? previous!)\n const content = props.renderLeaf(leaf)\n const paneLabel = props.renderPaneLabel?.(leaf)\n const actions = props.renderPaneActions?.(leaf)\n const intent = () => (drop()?.id === id ? drop()?.intent : undefined)\n onCleanup(() => {\n refs.delete(id)\n domIds.delete(id)\n })\n return (\n <section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabindex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n flush()\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n flush()\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) {\n setDrop(undefined)\n flush()\n }\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n flush()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n data-focus-mode={focusMode()}\n onFocusIn={(event) => {\n rememberPaneFocus(event.currentTarget, event.target)\n props.onFocus?.(id)\n }}\n onPointerMove={(event) => {\n if (drag()) return\n focusPaneOnHover(event, event.currentTarget, {\n mode: focusMode(),\n ...(root ? { scope: root } : {}),\n })\n }}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>\n )\n }}\n </For>\n <span class=\"sr-only\" role=\"status\">\n {dropLabel() ||\n (resizeController() === 'error'\n ? reloadRequired()\n ? 'Resize controls didn’t load. Reloading may lose unsaved pane content.'\n : 'Resize controls did not load.'\n : '')}\n </span>\n <For each={branches().map((branch) => branch.id)}>\n {(id) => {\n const branch: Accessor<SplitLayoutBranch<L>> = createMemo(\n (previous?: SplitLayoutBranch<L>) => branchMap().get(id) ?? previous!\n )\n const rect = () => frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 }\n return (\n <Show\n when={typeof resizeController() === 'function'}\n fallback={\n <div\n role=\"separator\"\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}\n aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}\n aria-valuenow={Math.round(branch().ratio * 100)}\n aria-disabled=\"true\"\n tabindex={-1}\n data-direction={branch().direction}\n style={separatorPlaceholderStyle(branch(), rect())}\n class=\"pointer-events-none absolute bg-border\"\n />\n }\n >\n <Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />\n </Show>\n )\n }}\n </For>\n {resizeController() === 'error' ? (\n <div class=\"absolute top-2 right-2 z-(--z-menu) flex max-w-sm flex-col items-end gap-2\">\n {reloadRequired() ? (\n <p\n id={resizeReloadWarningId}\n role=\"alert\"\n class=\"rounded-md border bg-background p-2 text-sm shadow-md\"\n >\n Reloading may discard unsaved pane content.\n </p>\n ) : null}\n <Button\n variant=\"outline\"\n size=\"sm\"\n data-resize-retry\n aria-describedby={reloadRequired() ? resizeReloadWarningId : undefined}\n onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}\n >\n {reloadRequired() ? 'Reload page to retry resizing' : 'Retry pane resizing'}\n </Button>\n </div>\n ) : null}\n </div>","<For each={branches().map((branch) => branch.id)}>\n {(id) => {\n const branch: Accessor<SplitLayoutBranch<L>> = createMemo(\n (previous?: SplitLayoutBranch<L>) => branchMap().get(id) ?? previous!\n )\n const rect = () => frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 }\n return (\n <Show\n when={typeof resizeController() === 'function'}\n fallback={\n <div\n role=\"separator\"\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}\n aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}\n aria-valuenow={Math.round(branch().ratio * 100)}\n aria-disabled=\"true\"\n tabindex={-1}\n data-direction={branch().direction}\n style={separatorPlaceholderStyle(branch(), rect())}\n class=\"pointer-events-none absolute bg-border\"\n />\n }\n >\n <Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />\n </Show>\n )\n }}\n </For>","<Show\n when={typeof resizeController() === 'function'}\n fallback={\n <div\n role=\"separator\"\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}\n aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}\n aria-valuenow={Math.round(branch().ratio * 100)}\n aria-disabled=\"true\"\n tabindex={-1}\n data-direction={branch().direction}\n style={separatorPlaceholderStyle(branch(), rect())}\n class=\"pointer-events-none absolute bg-border\"\n />\n }\n >\n <Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />\n </Show>","<Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />","rect={() => rectStyle(rect())}","root={() => root}","aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}","aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}","aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}","aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}","aria-valuenow={Math.round(branch().ratio * 100)}","data-direction={branch().direction}","style={separatorPlaceholderStyle(branch(), rect())}","<div class=\"absolute top-2 right-2 z-(--z-menu) flex max-w-sm flex-col items-end gap-2\">\n {reloadRequired() ? (\n <p\n id={resizeReloadWarningId}\n role=\"alert\"\n class=\"rounded-md border bg-background p-2 text-sm shadow-md\"\n >\n Reloading may discard unsaved pane content.\n </p>\n ) : null}\n <Button\n variant=\"outline\"\n size=\"sm\"\n data-resize-retry\n aria-describedby={reloadRequired() ? resizeReloadWarningId : undefined}\n onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}\n >\n {reloadRequired() ? 'Reload page to retry resizing' : 'Retry pane resizing'}\n </Button>\n </div>","<Button\n variant=\"outline\"\n size=\"sm\"\n data-resize-retry\n aria-describedby={reloadRequired() ? resizeReloadWarningId : undefined}\n onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}\n >\n {reloadRequired() ? 'Reload page to retry resizing' : 'Retry pane resizing'}\n </Button>","variant=\"outline\"","size=\"sm\"","onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}","data-dragging={drag() ? '' : undefined}","class={cn('relative size-full min-h-0 min-w-0 data-[dragging]:cursor-grabbing', props.class)}","X","LucideX","GripVertical","LucideGripVertical","_$readShallow","_$setAttribute"],"sources":["../../../../src/components/layout/split-layout/split-layout.tsx"],"sourcesContent":["import {\n For,\n createEffect,\n createMemo,\n createUniqueId,\n createSignal,\n flush,\n onSettled,\n onCleanup,\n Show,\n type Accessor,\n} from 'solid-js'\nimport { type JSX } from '@solidjs/web'\nimport { Dynamic } from '@solidjs/web'\nimport { X as LucideX, GripVertical as LucideGripVertical } from '@lucide/solid'\nimport { ActionButton } from '../../composites/action-button'\nimport { Button } from '../../ui/button'\nimport { resizeSeparatorClass } from '#lib/resize-separator'\nimport { cn } from '#lib/utils'\nimport { computeLayoutFrames, type LayoutRect } from './geometry'\nimport { paneDropIntent, type PaneDropIntent } from './drop'\nimport {\n focusPaneOnHover,\n paneFocusMode,\n rememberPaneFocus,\n subscribePaneFocusMode,\n type PaneFocusMode,\n} from './pane-focus'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst X = fastIcon(LucideX)\nconst GripVertical = fastIcon(LucideGripVertical)\nexport type { PaneDropIntent } from './drop'\nconst PANE_DRAG_TYPE = 'application/x-adea-pane-move'\nconst DRAG_PREVIEW_MAX_WIDTH = 384\nconst DRAG_PREVIEW_MAX_HEIGHT = 256\nimport {\n listLeaves,\n MAX_SPLIT_RATIO,\n MIN_SPLIT_RATIO,\n type SplitLayoutBranch,\n type SplitLayoutLeaf,\n type SplitLayoutState,\n} from './model'\nimport type { SplitLayoutResizeControllerProps } from './resize-controller-core'\n\ntype ResizeController<L extends SplitLayoutLeaf> = (\n props: SplitLayoutResizeControllerProps<L>\n) => JSX.Element\ntype ResizeControllerState<L extends SplitLayoutLeaf> = ResizeController<L> | false | 'error'\n\n/*\n * Browsers cache a failed module import under its URL, failed static\n * dependencies included, so retrying the same specifier fails again without a\n * request. Each attempt therefore takes the next entry: a second facade over\n * the same implementation (a failed facade request recovers without fetching\n * the implementation twice), then a facade over a byte-identical copy of the\n * implementation (a failed implementation chunk recovers). After the last one\n * only a reload can fetch the controller.\n */\nconst resizeControllerEntries = [\n () => import('./resize-controller'),\n () => import('./resize-controller-retry'),\n () => import('./resize-controller-retry-2'),\n]\n\nexport type SplitLayoutProps<L extends SplitLayoutLeaf> = {\n state: SplitLayoutState<L>\n label: string\n /** Accessible name for a pane region and its close button. */\n labelForLeaf: (leaf: L) => string\n /** Called once per stable leaf owner; the accessor tracks opaque payload replacement. */\n renderLeaf: (leaf: Accessor<L>) => JSX.Element\n /** Inline visible header composition, separate from the region and close-button name. */\n renderPaneLabel?: (leaf: Accessor<L>) => JSX.Element\n /** Whether pane regions participate in sequential keyboard navigation; defaults to programmatic focus only. */\n paneTabIndex?: 0 | -1\n /** Accessible splitter name; defaults to the current orientation-specific label. */\n labelForSeparator?: (branch: SplitLayoutBranch<L>) => string\n onResize: (splitId: string, ratio: number) => void\n onFocus?: (leafId: string) => void\n /**\n * How a pane takes focus. `hover` activates the pane the mouse moves onto (keys typed next go to\n * it); `click` waits for a click. Defaults to the device preference (`paneFocusMode`).\n */\n focusMode?: PaneFocusMode\n /** Host performs the model transition and returns the surviving focus destination. */\n onClose?: (leafId: string) => string | undefined\n /** Pointer placement only; the host supplies keyboard commands and performs the model transition. */\n onMove?: (leafId: string, targetId: string, intent: PaneDropIntent) => void\n /** Stable header composition for host-owned keyboard actions/capability feedback. */\n renderPaneActions?: (leaf: Accessor<L>) => JSX.Element\n class?: string\n}\nfunction rectStyle(rect: LayoutRect): JSX.CSSProperties {\n return {\n left: `${rect.x * 100}%`,\n top: `${rect.y * 100}%`,\n width: `${rect.width * 100}%`,\n height: `${rect.height * 100}%`,\n }\n}\nfunction separatorPlaceholderStyle(branch: SplitLayoutBranch, rect: LayoutRect): JSX.CSSProperties {\n const horizontal = branch.direction === 'row'\n return {\n left: `${(rect.x + (horizontal ? rect.width * branch.ratio : 0)) * 100}%`,\n top: `${(rect.y + (horizontal ? 0 : rect.height * branch.ratio)) * 100}%`,\n width: horizontal ? '1px' : `${rect.width * 100}%`,\n height: horizontal ? `${rect.height * 100}%` : '1px',\n transform: horizontal ? 'translateX(-50%)' : 'translateY(-50%)',\n }\n}\nfunction dragPreviewPlaceholder(source: HTMLElement, message: string) {\n const placeholder = document.createElement('div')\n placeholder.className = cn(\n source.getAttribute('class'),\n 'flex min-h-8 min-w-0 items-center justify-center bg-muted px-2 text-center text-xs text-muted-foreground'\n )\n placeholder.setAttribute('data-split-drag-placeholder', source.localName)\n placeholder.textContent = message\n return placeholder\n}\nfunction boundedSnapshotSize(width: number, height: number) {\n const sourceWidth = Math.max(1, width)\n const sourceHeight = Math.max(1, height)\n const scale = Math.min(\n 1,\n DRAG_PREVIEW_MAX_WIDTH / sourceWidth,\n DRAG_PREVIEW_MAX_HEIGHT / sourceHeight\n )\n return {\n width: Math.max(1, Math.round(sourceWidth * scale)),\n height: Math.max(1, Math.round(sourceHeight * scale)),\n }\n}\nfunction cloneDragPreviewNode(source: Node): Node | undefined {\n if (source.nodeType === Node.TEXT_NODE) return source.cloneNode(false)\n if (!(source instanceof HTMLElement || source instanceof SVGElement))\n return source.cloneNode(false)\n\n if (['script', 'style', 'link', 'source', 'track', 'meta'].includes(source.localName))\n return undefined\n if (['iframe', 'video', 'audio', 'object', 'embed'].includes(source.localName))\n return dragPreviewPlaceholder(\n source as HTMLElement,\n 'Embedded content unavailable while moving'\n )\n if (source instanceof HTMLImageElement) {\n const snapshot = document.createElement('canvas')\n const size = boundedSnapshotSize(\n source.naturalWidth || source.width,\n source.naturalHeight || source.height\n )\n snapshot.width = size.width\n snapshot.height = size.height\n snapshot.className = source.getAttribute('class') ?? ''\n snapshot.setAttribute('data-split-drag-image', '')\n try {\n if (!source.complete || source.naturalWidth === 0)\n throw new Error('image has no decoded pixels')\n const context = snapshot.getContext('2d')\n if (!context) throw new Error('canvas snapshot context is unavailable')\n context.drawImage(source, 0, 0, snapshot.width, snapshot.height)\n return snapshot\n } catch {\n return dragPreviewPlaceholder(source, 'Image preview unavailable')\n }\n }\n\n // Copying a defined custom element can run its constructor; inserting it can\n // also reconnect a stream or terminal session. Flatten its display tree.\n if (source instanceof HTMLElement && source.localName.includes('-')) {\n const children = document.createDocumentFragment()\n for (const child of source.childNodes) {\n const clone = cloneDragPreviewNode(child)\n if (clone) children.append(clone)\n }\n return children.childNodes.length > 0\n ? children\n : dragPreviewPlaceholder(source, 'Live component preview unavailable while moving')\n }\n\n const clone = source.cloneNode(false) as HTMLElement | SVGElement\n for (const attribute of [\n 'id',\n 'style',\n 'draggable',\n 'data-pane-drag-handle',\n 'data-pane-id',\n 'src',\n 'srcset',\n 'href',\n 'xlink:href',\n 'data',\n 'poster',\n ])\n clone.removeAttribute(attribute)\n for (const attribute of Array.from(clone.attributes))\n if (/^on/i.test(attribute.name)) clone.removeAttribute(attribute.name)\n\n if (source instanceof HTMLCanvasElement && clone instanceof HTMLCanvasElement) {\n const size = boundedSnapshotSize(source.width, source.height)\n clone.width = size.width\n clone.height = size.height\n try {\n const context = clone.getContext('2d')\n if (!context) throw new Error('canvas snapshot context is unavailable')\n context.drawImage(source, 0, 0, clone.width, clone.height)\n } catch {\n return dragPreviewPlaceholder(source, 'Canvas preview unavailable while moving')\n }\n return clone\n }\n\n for (const child of source.childNodes) {\n const childClone = cloneDragPreviewNode(child)\n if (childClone) clone.append(childClone)\n }\n return clone\n}\n/** Muxy frame geometry keeps leaf owners stable; the lazy resize controller owns constrained separator interactions. */\nexport function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L>) {\n let root: HTMLDivElement | undefined\n let pendingFrame: number | undefined\n let disposed = false\n let resizeLoadGeneration = 0\n let resizeControllerEntry = 0\n let focusAfterResizeLoad = false\n // Counts focus moves to a real target. A deferred restore checks it so it\n // never pulls focus back after the user (or code) deliberately moved it.\n let focusMoves = 0\n let pendingFocusFrame: number | undefined\n let pendingFocusRetryTimer: number | undefined\n const refs = new Map<string, HTMLElement>()\n const domIds = new Map<string, string>()\n const prefix = createUniqueId()\n const resizeReloadWarningId = `${prefix}-resize-reload-warning`\n let nextDomId = 0\n let nextDragId = 0\n let dragPreview: HTMLElement | undefined\n const [drag, setDrag] = createSignal<{ id: string; token: string }>()\n const [drop, setDrop] = createSignal<{ id: string; intent: PaneDropIntent }>()\n const [resizeController, setResizeController] = createSignal<ResizeControllerState<L>>()\n const [preferredFocusMode, setPreferredFocusMode] = createSignal(paneFocusMode())\n onCleanup(subscribePaneFocusMode(() => setPreferredFocusMode(paneFocusMode())))\n const focusMode = () => props.focusMode ?? preferredFocusMode()\n const reloadRequired = () => resizeControllerEntry >= resizeControllerEntries.length\n const cancelPendingFocusRestore = () => {\n if (pendingFocusFrame !== undefined) cancelAnimationFrame(pendingFocusFrame)\n pendingFocusFrame = undefined\n if (pendingFocusRetryTimer !== undefined) clearTimeout(pendingFocusRetryTimer)\n pendingFocusRetryTimer = undefined\n }\n const focusAfterRender = (selector: string, preserveCurrentFocus = false) => {\n const attemptFocus = (retries: number) => {\n if (preserveCurrentFocus) {\n const currentFocus = root?.ownerDocument.activeElement\n if (currentFocus && currentFocus !== root?.ownerDocument.body && currentFocus !== root)\n return\n }\n const target = root?.querySelector<HTMLElement>(selector)\n if (target) {\n target.focus({ preventScroll: true })\n return\n }\n // A Solid state update can commit the replacement control after the\n // first frame. Retry in bounded tasks so a backgrounded page's paused\n // animation frames cannot strand keyboard focus.\n if (retries > 0)\n pendingFocusRetryTimer = window.setTimeout(() => {\n pendingFocusRetryTimer = undefined\n attemptFocus(retries - 1)\n }, 0)\n }\n cancelPendingFocusRestore()\n pendingFocusFrame = requestAnimationFrame(() => {\n pendingFocusFrame = undefined\n attemptFocus(2)\n })\n }\n const trackFocusChange = (event: FocusEvent) => {\n if (event.target === document.body) return\n focusMoves += 1\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n }\n onSettled(() => {\n document.addEventListener('focusin', trackFocusChange)\n return () => document.removeEventListener('focusin', trackFocusChange)\n })\n const clearDrag = () => {\n setDrag(undefined)\n setDrop(undefined)\n dragPreview?.remove()\n dragPreview = undefined\n }\n const createDragPreview = (source: HTMLElement) => {\n dragPreview?.remove()\n const preview = cloneDragPreviewNode(source) as HTMLElement\n preview.className =\n 'pointer-events-none fixed -left-full top-0 z-(--z-dialog) flex h-64 max-h-screen w-96 max-w-screen min-h-0 min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-card text-card-foreground shadow-xl'\n preview.removeAttribute('id')\n preview.removeAttribute('style')\n preview.removeAttribute('role')\n preview.removeAttribute('aria-label')\n preview.removeAttribute('data-pane-id')\n preview.removeAttribute('data-focused')\n preview.removeAttribute('data-drag-source')\n preview.removeAttribute('data-drop-direction')\n preview.removeAttribute('data-drop-placement')\n preview.setAttribute('data-split-drag-preview', '')\n preview.setAttribute('aria-hidden', 'true')\n preview.inert = true\n document.body.append(preview)\n dragPreview = preview\n return preview\n }\n const domId = (id: string) => {\n const existing = domIds.get(id)\n if (existing) return existing\n const created = `${prefix}-pane-${nextDomId++}`\n domIds.set(id, created)\n return created\n }\n const leaves = createMemo(() => listLeaves(props.state.center))\n const leafMap = createMemo(() => new Map(leaves().map((leaf) => [leaf.id, leaf])))\n const frames = createMemo(() => computeLayoutFrames(props.state.center))\n const branches = createMemo(() =>\n Array.from(frames().values()).flatMap((frame) =>\n frame.node.kind === 'split' ? [frame.node] : []\n )\n )\n // The branch list is rebuilt on every resize tick; only whether any split\n // exists matters to the loader, so gate it behind a memo.\n const hasBranches = createMemo(() => branches().length > 0)\n createEffect(\n () => ({ split: hasBranches(), controller: resizeController() }),\n ({ split, controller }) => {\n if (!split) {\n resizeLoadGeneration += 1\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n // Keep a loaded controller so a later split does not re-import an entry\n // that may have failed before recovery. Clear only transient UI state.\n if (controller === false || controller === 'error') setResizeController(undefined)\n return\n }\n if (controller !== undefined) return\n const generation = ++resizeLoadGeneration\n const entry = Math.min(resizeControllerEntry, resizeControllerEntries.length - 1)\n cancelPendingFocusRestore()\n setResizeController(false)\n void resizeControllerEntries[entry]!().then(\n ({ default: Controller }) => {\n if (disposed || generation !== resizeLoadGeneration || !hasBranches()) return\n const shouldFocusHandle = focusAfterResizeLoad\n focusAfterResizeLoad = false\n setResizeController(() => Controller)\n if (shouldFocusHandle) focusAfterRender('[data-split-layout-handle]', true)\n },\n () => {\n // The next split must start from the next entry as well.\n resizeControllerEntry = Math.max(resizeControllerEntry, entry + 1)\n if (!disposed && generation === resizeLoadGeneration && hasBranches()) {\n setResizeController('error')\n if (focusAfterResizeLoad) focusAfterRender('[data-resize-retry]')\n }\n }\n )\n }\n )\n // Drop drag and drop state whose pane left the layout. Clearing also removes\n // the floating drag preview node, so this is an effect rather than a memo.\n createEffect(\n () => ({ current: drag(), target: drop(), canMove: Boolean(props.onMove), map: leafMap() }),\n ({ current, target, canMove, map }) => {\n if (current && (!canMove || !map.has(current.id))) clearDrag()\n else if (target && !map.has(target.id)) setDrop(undefined)\n }\n )\n const allowedTarget = (id: string, transfer: DataTransfer | null) => {\n const current = drag()\n return props.onMove &&\n current &&\n current.id !== id &&\n leafMap().has(current.id) &&\n leafMap().has(id) &&\n transfer?.types.includes(PANE_DRAG_TYPE)\n ? current\n : undefined\n }\n const dropLabel = createMemo(() => {\n const target = drop()\n const leaf = target ? leafMap().get(target.id) : undefined\n return target && leaf\n ? `Drop to place pane ${target.intent.placement} ${props.labelForLeaf(leaf)}`\n : ''\n })\n const branchMap = createMemo(() => new Map(branches().map((branch) => [branch.id, branch])))\n const schedule = (action: () => void) => {\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n pendingFrame = requestAnimationFrame(() => {\n pendingFrame = undefined\n action()\n })\n }\n // Capture a focused editor before an ordered DOM move can blur it. The\n // compute phase runs before any render effect moves nodes, so it reads the\n // focus and selection as they were; the apply phase schedules the restore.\n // Never override a newer focus outside this root.\n createEffect(\n () => {\n void props.state.center\n const active = root?.ownerDocument.activeElement\n if (!root || !(active instanceof HTMLElement) || !root.contains(active)) return undefined\n const field =\n active instanceof HTMLTextAreaElement || active instanceof HTMLInputElement\n ? active\n : undefined\n const selection = field\n ? {\n start: field.selectionStart,\n end: field.selectionEnd,\n direction: field.selectionDirection,\n }\n : undefined\n return { active, field, selection }\n },\n (captured) => {\n if (!captured) return\n const { active, field, selection } = captured\n const moves = focusMoves\n schedule(() => {\n // Focus went somewhere else on purpose (for example the resize retry\n // action) before this frame ran: that focus, not this one, is current.\n if (focusMoves !== moves) return\n if (!active.isConnected || !root?.contains(active)) return\n const current = active.ownerDocument.activeElement\n if (current !== active && current !== active.ownerDocument.body) return\n active.focus({ preventScroll: true })\n if (field && selection?.start !== null && selection?.end !== null && selection)\n field.setSelectionRange(selection.start, selection.end, selection.direction ?? undefined)\n })\n },\n { defer: true }\n )\n onCleanup(() => {\n disposed = true\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n clearDrag()\n refs.clear()\n domIds.clear()\n })\n const close = (id: string) => {\n const next = props.onClose?.(id)\n // Apply the host's removal now: a drop dispatched right after the click\n // must see the closed pane gone and its drag payload invalidated.\n flush()\n if (next) schedule(() => refs.get(next)?.focus({ preventScroll: true }))\n }\n return (\n <div\n ref={(el) => {\n root = el\n }}\n role=\"group\"\n aria-label={props.label}\n data-slot=\"split-layout\"\n data-dragging={drag() ? '' : undefined}\n class={cn('relative size-full min-h-0 min-w-0 data-[dragging]:cursor-grabbing', props.class)}\n >\n <For each={leaves().map((leaf) => leaf.id)}>\n {(id) => {\n // A memo: the map is rebuilt on every resize tick, but the leaf object\n // only changes when the leaf does, so the host's renderers stay quiet.\n // A leaf on its way out keeps its last value.\n const leaf = createMemo((previous?: L) => leafMap().get(id) ?? previous!)\n const content = props.renderLeaf(leaf)\n const paneLabel = props.renderPaneLabel?.(leaf)\n const actions = props.renderPaneActions?.(leaf)\n const intent = () => (drop()?.id === id ? drop()?.intent : undefined)\n onCleanup(() => {\n refs.delete(id)\n domIds.delete(id)\n })\n return (\n <section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabindex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n flush()\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n flush()\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) {\n setDrop(undefined)\n flush()\n }\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n flush()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n data-focus-mode={focusMode()}\n onFocusIn={(event) => {\n rememberPaneFocus(event.currentTarget, event.target)\n props.onFocus?.(id)\n }}\n onPointerMove={(event) => {\n if (drag()) return\n focusPaneOnHover(event, event.currentTarget, {\n mode: focusMode(),\n ...(root ? { scope: root } : {}),\n })\n }}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={props.onMove ? 'true' : 'false'}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n // Drag events run outside any flush. Each handler flushes the\n // drag state it writes, so the next event of the gesture (a\n // dragover, drop or dragend dispatched back to back) reads it\n // and the drop feedback is in the DOM before the next paint.\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n flush()\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={() => {\n clearDrag()\n flush()\n }}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>\n )\n }}\n </For>\n <span class=\"sr-only\" role=\"status\">\n {dropLabel() ||\n (resizeController() === 'error'\n ? reloadRequired()\n ? 'Resize controls didn’t load. Reloading may lose unsaved pane content.'\n : 'Resize controls did not load.'\n : '')}\n </span>\n <For each={branches().map((branch) => branch.id)}>\n {(id) => {\n const branch: Accessor<SplitLayoutBranch<L>> = createMemo(\n (previous?: SplitLayoutBranch<L>) => branchMap().get(id) ?? previous!\n )\n const rect = () => frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 }\n return (\n <Show\n when={typeof resizeController() === 'function'}\n fallback={\n <div\n role=\"separator\"\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}\n aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}\n aria-valuenow={Math.round(branch().ratio * 100)}\n aria-disabled=\"true\"\n tabindex={-1}\n data-direction={branch().direction}\n style={separatorPlaceholderStyle(branch(), rect())}\n class=\"pointer-events-none absolute bg-border\"\n />\n }\n >\n <Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />\n </Show>\n )\n }}\n </For>\n {resizeController() === 'error' ? (\n <div class=\"absolute top-2 right-2 z-(--z-menu) flex max-w-sm flex-col items-end gap-2\">\n {reloadRequired() ? (\n <p\n id={resizeReloadWarningId}\n role=\"alert\"\n class=\"rounded-md border bg-background p-2 text-sm shadow-md\"\n >\n Reloading may discard unsaved pane content.\n </p>\n ) : null}\n <Button\n variant=\"outline\"\n size=\"sm\"\n data-resize-retry\n aria-describedby={reloadRequired() ? resizeReloadWarningId : undefined}\n onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}\n >\n {reloadRequired() ? 'Reload page to retry resizing' : 'Retry pane resizing'}\n </Button>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,IAAM4C,MAAI,SAASC,CAAO;AAC1B,IAAMC,iBAAe,SAASC,YAAkB;AAEhD,IAAM,iBAAiB;AACvB,IAAM,yBAAyB;AAC/B,IAAM,0BAA0B;AAyBhC,IAAM,0BAA0B;OACxB,OAAO;OACP,OAAO;OACP,OAAO;AACf;AA8BA,SAAS,UAAU,MAAqC;CACtD,OAAO;EACL,MAAM,GAAG,KAAK,IAAI,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AAA,KAAAA,aAAA,MAAA,iBAAA,CAAsC;EACtC,UAAA,MAAA,GAAA,KAAA,CAA4F;CAHrE,CAAA;CAN3B,OACEzB;AAwQJ"}
|
package/dist/index.js
CHANGED
|
@@ -86,6 +86,7 @@ import { Presence } from "./components/motion/presence.js";
|
|
|
86
86
|
import { MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, clampSplitRatio, countLeaves, layoutDepth, listLeaves } from "./components/layout/split-layout/tree.js";
|
|
87
87
|
import { closePane, createLayoutState, focusPane, movePane, neighborLeaf, normalizeLayout, resizeSplit, splitPane, splitPaneBalanced, swapPanes, undoClosePane } from "./components/layout/split-layout/model.js";
|
|
88
88
|
import { computeLayoutFrames } from "./components/layout/split-layout/geometry.js";
|
|
89
|
+
import { PANE_FOCUS_TARGET, focusPaneOnHover, hoverTakesFocus, paneFocusMode, rememberPaneFocus, setPaneFocusMode, subscribePaneFocusMode } from "./components/layout/split-layout/pane-focus.js";
|
|
89
90
|
import { SplitLayout } from "./components/layout/split-layout/split-layout.js";
|
|
90
91
|
import { FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, clampFloatingPreviewPosition, resizeFloatingPreview, resolveFloatingPreviewFrame } from "./components/layout/floating-preview/model.js";
|
|
91
92
|
import { FloatingPreview } from "./components/layout/floating-preview/floating-preview.js";
|
|
@@ -209,4 +210,4 @@ import { isShellIconKey, resolveShellIcon, shellIconEntries, shellIconLabel } fr
|
|
|
209
210
|
import { IconPicker, IconPickerDropdown } from "./components/composites/icon-picker/icon-picker.js";
|
|
210
211
|
import { formatBytes, formatReleaseDate, plainTextFromMarkdown } from "./lib/version-notes.js";
|
|
211
212
|
import { allTokens, colorTokens, densityTokens, designTokens, elevationTokens, motionTokens, radiusTokens, typographyTokens, undocumentedTokenAliases, zIndexTokens } from "./lib/tokens.js";
|
|
212
|
-
export { ANSI_MAX_LINE_LENGTH, ANSI_RETAIN_LINES, APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, APPEARANCE_EDITOR_TABS, AboutDialog, AccentPicker, AccentSwatchGroups, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, SettingsRow as AppearanceSettingsRow, AspectRatio, Attachment, AttachmentCard, AttachmentList, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHAIN_OF_THOUGHT_STATUS_LABELS, CODE_BLOCK_LINE_LIMIT, CalendarSurface, Callout, CalloutTitle, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChainOfThought, ChainOfThoughtResult, ChainOfThoughtResults, ChainOfThoughtStep, Chat, ChatComposer, ChatEmpty, ChatHeader, ChatNotice, Checkbox, CheckboxDescription, CheckboxLabel, Checkpoint, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, Confirmation, Context, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FILE_CHANGE_LABELS, FILE_TREE_AUTO_EXPAND_LIMIT, FILE_TREE_MAX_DEPTH, FILE_TREE_MAX_ROWS, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FileTree, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, IconPicker, IconPickerDropdown, InlineCitation, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, LazyTooltip, ListGroup, ListRow, ListRowControl, MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE_SIZE, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, MODEL_SEARCH_THRESHOLD, MarkImageError, Marker, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageAction, MessageActions, MessageBody, MessageComposer, MessageContent, MessageCopyAction, MessageDayDivider, MessageFooter, MessageGroup, MessageHeader, MessageRow, MessageScroller, MessageText, ModalDialog, ModelSelector, Motion, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelPane, PixelResizeHandle, Plan, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PromptInput, PromptInputBody, PromptInputButton, PromptInputControl, PromptInputFooter, PromptInputHeader, PromptInputSubmit, PromptInputTextarea, PromptInputTools, PropertyList, PropertyRow, PropertyTerm, PropertyValue, Questionnaire, Queue, QueueFollowUps, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, Reasoning, ResizableHandle, ResizablePanel, ResizablePanelGroup, SOURCE_SNIPPET_LIMIT, SOURCE_TITLE_LIMIT, STACK_MAX_LINES, STACK_TRACE_MAX_BLOCKS, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow$1 as SettingsRow, SettingsSection, Dialog as Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, DialogTrigger as SheetTrigger, ShellRail, ShellTopBar, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Sources, Spinner, SplitLayout, StackTrace, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Subagent, Suggestion, Suggestions, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, TASK_ITEM_STATUS_LABELS, TERMINAL_MAX_LINES, TEST_RESULTS_LIST_LIMIT, TOOL_STATUS_LABELS, TOOL_VALUE_MAX_CHARS, TRACE_STATUS_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskItemList, TaskItemRow, Terminal, TestResults, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tool, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, Trace, TraceDetail, TraceError, TraceLine, TraceMark, TranscriptComposition, Tree, TreeRow, TreeRowActions, TreeStickyHeader, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WORK_STATUS_LABELS, WORK_TRACE_STATUS, WorkspaceMark, WorkspaceReorderDialog, WorkspaceSwitcher, accentPresets, alertVariants, allTokens, ansi256ToColor, ansiLineText, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, boundText, breakdownRows, bubbleVariants, buildFileTree, builtinThemes, buttonVariants, calloutVariants, captureAnchor, cardVariants, centredSquare, chatNoticeVariants, checkMarkImageFile, checkpointLabel, checkpointStatus, citationLabel, citationName, clampFloatingPreviewPosition, clampSplitRatio, clampWindow, classifyFrame, closePane, cn, colorTokens, computeLayoutFrames, confirmationOutcome, contextLabel, contextLevel, contextLevelWord, contextPercent, contextShort, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countChanges, countLeaves, countLines, createAnsiParser, createAppMenuItems, createDeferredTooltip, createLayoutState, createPoll, createVersionedPersistence, cva, decisionReason, dedentLines, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, describeChanges, describeCount, describeFrameGroup, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findModel, findTokenRanges, firstFailureKey, flattenFileTree, focusPane, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatAttachmentSize, formatBytes, formatCost, formatDuration, formatExact, formatReleaseDate, formatDuration$1 as formatTestDuration, formatToken, formatTokens, formatToolValue, frameLocation, groupModels, groupStackEntries, hasContextFigures, headingElement, headingVariants, indexFileTree, initialExpanded, initialsFrom, safeScriptStringLiteral as inlineScriptLiteral, isAwaitingAnswer, isCustomAccent, isCustomAccentValue, isFailedExit, isFigure, isMarkImageDataUrl, isPasteBlock, isPlainStyle, isQuestionAnswered, isShellIconKey, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, listedCounts, localStoragePersistence, markImageFromFile, markImageProblemCopy, markerVariants, messageCitations, modelSearchValue, monogram, motionTokens, movePane, moveTarget, moveWorkspace, nearestAnsiColor, needsSearch, neighborLeaf, nextCitationMode, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeEfforts, normalizeLayout, normalizePath, normalizeSurface, paintAccentRoles, parseAnsi, parseDiff, parseInline, parseMessageText, parseMessageTextIncremental, parseStackTrace, partitionQueue, placeCitationMarkers, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, reasoningTitle, recollapsePastes, reconcileCounts, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, resizeFloatingPreview, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveAppearanceEditorFontSettings, resolveColors, resolveEffort, resolveFloatingPreviewFrame, resolveShellIcon, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, restoreAnchor, restoreControl, restoreDialogCopy, revealInWindow, safeHref, safePreviewSrc, safeSourceUrl, searchShortcutKeyshortcuts, searchShortcutLabel, settleDecision, sheetVariants, shellIconEntries, shellIconLabel, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, sourceHost, sourceTitle, sourcesLabel, splitLocation, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stepCountLabel, stripTrailingBlankLines, suiteKey, suiteState, surfaceAlpha, surfaceInteractive, swapPanes, taskProgress, taskProgressLabel, terminalCssVariables, terminalStatusLabel, testKey, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, treeStickyAncestors, typeaheadIndex, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, wrapIndex, writeClipboardText, writeVersionedRecord, zIndexTokens };
|
|
213
|
+
export { ANSI_MAX_LINE_LENGTH, ANSI_RETAIN_LINES, APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, APPEARANCE_EDITOR_TABS, AboutDialog, AccentPicker, AccentSwatchGroups, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, SettingsRow as AppearanceSettingsRow, AspectRatio, Attachment, AttachmentCard, AttachmentList, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHAIN_OF_THOUGHT_STATUS_LABELS, CODE_BLOCK_LINE_LIMIT, CalendarSurface, Callout, CalloutTitle, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChainOfThought, ChainOfThoughtResult, ChainOfThoughtResults, ChainOfThoughtStep, Chat, ChatComposer, ChatEmpty, ChatHeader, ChatNotice, Checkbox, CheckboxDescription, CheckboxLabel, Checkpoint, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, Confirmation, Context, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FILE_CHANGE_LABELS, FILE_TREE_AUTO_EXPAND_LIMIT, FILE_TREE_MAX_DEPTH, FILE_TREE_MAX_ROWS, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FileTree, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, IconPicker, IconPickerDropdown, InlineCitation, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, LazyTooltip, ListGroup, ListRow, ListRowControl, MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE_SIZE, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, MODEL_SEARCH_THRESHOLD, MarkImageError, Marker, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageAction, MessageActions, MessageBody, MessageComposer, MessageContent, MessageCopyAction, MessageDayDivider, MessageFooter, MessageGroup, MessageHeader, MessageRow, MessageScroller, MessageText, ModalDialog, ModelSelector, Motion, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PANE_FOCUS_TARGET, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelPane, PixelResizeHandle, Plan, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PromptInput, PromptInputBody, PromptInputButton, PromptInputControl, PromptInputFooter, PromptInputHeader, PromptInputSubmit, PromptInputTextarea, PromptInputTools, PropertyList, PropertyRow, PropertyTerm, PropertyValue, Questionnaire, Queue, QueueFollowUps, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, Reasoning, ResizableHandle, ResizablePanel, ResizablePanelGroup, SOURCE_SNIPPET_LIMIT, SOURCE_TITLE_LIMIT, STACK_MAX_LINES, STACK_TRACE_MAX_BLOCKS, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow$1 as SettingsRow, SettingsSection, Dialog as Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, DialogTrigger as SheetTrigger, ShellRail, ShellTopBar, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Sources, Spinner, SplitLayout, StackTrace, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Subagent, Suggestion, Suggestions, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, TASK_ITEM_STATUS_LABELS, TERMINAL_MAX_LINES, TEST_RESULTS_LIST_LIMIT, TOOL_STATUS_LABELS, TOOL_VALUE_MAX_CHARS, TRACE_STATUS_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskItemList, TaskItemRow, Terminal, TestResults, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tool, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, Trace, TraceDetail, TraceError, TraceLine, TraceMark, TranscriptComposition, Tree, TreeRow, TreeRowActions, TreeStickyHeader, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WORK_STATUS_LABELS, WORK_TRACE_STATUS, WorkspaceMark, WorkspaceReorderDialog, WorkspaceSwitcher, accentPresets, alertVariants, allTokens, ansi256ToColor, ansiLineText, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, boundText, breakdownRows, bubbleVariants, buildFileTree, builtinThemes, buttonVariants, calloutVariants, captureAnchor, cardVariants, centredSquare, chatNoticeVariants, checkMarkImageFile, checkpointLabel, checkpointStatus, citationLabel, citationName, clampFloatingPreviewPosition, clampSplitRatio, clampWindow, classifyFrame, closePane, cn, colorTokens, computeLayoutFrames, confirmationOutcome, contextLabel, contextLevel, contextLevelWord, contextPercent, contextShort, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countChanges, countLeaves, countLines, createAnsiParser, createAppMenuItems, createDeferredTooltip, createLayoutState, createPoll, createVersionedPersistence, cva, decisionReason, dedentLines, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, describeChanges, describeCount, describeFrameGroup, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findModel, findTokenRanges, firstFailureKey, flattenFileTree, focusPane, focusPaneOnHover, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatAttachmentSize, formatBytes, formatCost, formatDuration, formatExact, formatReleaseDate, formatDuration$1 as formatTestDuration, formatToken, formatTokens, formatToolValue, frameLocation, groupModels, groupStackEntries, hasContextFigures, headingElement, headingVariants, hoverTakesFocus, indexFileTree, initialExpanded, initialsFrom, safeScriptStringLiteral as inlineScriptLiteral, isAwaitingAnswer, isCustomAccent, isCustomAccentValue, isFailedExit, isFigure, isMarkImageDataUrl, isPasteBlock, isPlainStyle, isQuestionAnswered, isShellIconKey, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, listedCounts, localStoragePersistence, markImageFromFile, markImageProblemCopy, markerVariants, messageCitations, modelSearchValue, monogram, motionTokens, movePane, moveTarget, moveWorkspace, nearestAnsiColor, needsSearch, neighborLeaf, nextCitationMode, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeEfforts, normalizeLayout, normalizePath, normalizeSurface, paintAccentRoles, paneFocusMode, parseAnsi, parseDiff, parseInline, parseMessageText, parseMessageTextIncremental, parseStackTrace, partitionQueue, placeCitationMarkers, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, reasoningTitle, recollapsePastes, reconcileCounts, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, rememberPaneFocus, resizeFloatingPreview, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveAppearanceEditorFontSettings, resolveColors, resolveEffort, resolveFloatingPreviewFrame, resolveShellIcon, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, restoreAnchor, restoreControl, restoreDialogCopy, revealInWindow, safeHref, safePreviewSrc, safeSourceUrl, searchShortcutKeyshortcuts, searchShortcutLabel, setPaneFocusMode, settleDecision, sheetVariants, shellIconEntries, shellIconLabel, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, sourceHost, sourceTitle, sourcesLabel, splitLocation, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stepCountLabel, stripTrailingBlankLines, subscribePaneFocusMode, suiteKey, suiteState, surfaceAlpha, surfaceInteractive, swapPanes, taskProgress, taskProgressLabel, terminalCssVariables, terminalStatusLabel, testKey, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, treeStickyAncestors, typeaheadIndex, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, wrapIndex, writeClipboardText, writeVersionedRecord, zIndexTokens };
|
package/dist/r/registry.json
CHANGED
|
@@ -2227,6 +2227,11 @@
|
|
|
2227
2227
|
"type": "registry:ui",
|
|
2228
2228
|
"target": "components/layout/split-layout/model.ts"
|
|
2229
2229
|
},
|
|
2230
|
+
{
|
|
2231
|
+
"path": "src/components/layout/split-layout/pane-focus.ts",
|
|
2232
|
+
"type": "registry:ui",
|
|
2233
|
+
"target": "components/layout/split-layout/pane-focus.ts"
|
|
2234
|
+
},
|
|
2230
2235
|
{
|
|
2231
2236
|
"path": "src/components/layout/split-layout/resize-controller-core-retry.tsx",
|
|
2232
2237
|
"type": "registry:ui",
|
package/dist/r/split-layout.json
CHANGED
|
@@ -33,6 +33,11 @@
|
|
|
33
33
|
"type": "registry:ui",
|
|
34
34
|
"target": "components/layout/split-layout/model.ts"
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
"path": "src/components/layout/split-layout/pane-focus.ts",
|
|
38
|
+
"type": "registry:ui",
|
|
39
|
+
"target": "components/layout/split-layout/pane-focus.ts"
|
|
40
|
+
},
|
|
36
41
|
{
|
|
37
42
|
"path": "src/components/layout/split-layout/resize-controller-core-retry.tsx",
|
|
38
43
|
"type": "registry:ui",
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// How a pane takes focus: on hover (the pointer moving onto it activates it, so the keys typed
|
|
2
|
+
// next go to it) or on click. The choice is a device preference kept in `localStorage`, shared by
|
|
3
|
+
// every pane surface: SplitLayout reads it by default, and a host's own pane (a floating window,
|
|
4
|
+
// for instance) calls `focusPaneOnHover` from its `pointermove` to behave the same way.
|
|
5
|
+
|
|
6
|
+
export type PaneFocusMode = 'hover' | 'click'
|
|
7
|
+
|
|
8
|
+
const STORAGE_KEY = 'adea:pane-focus-mode:v1'
|
|
9
|
+
|
|
10
|
+
// One shared copy, because the preference reaches the page from more than one bundle.
|
|
11
|
+
type PaneFocusState = { value: PaneFocusMode | undefined; listeners: Set<() => void> }
|
|
12
|
+
const STATE_KEY = Symbol.for('adea.ui.pane-focus-mode')
|
|
13
|
+
const state: PaneFocusState = ((globalThis as Record<symbol, unknown>)[STATE_KEY] ??= {
|
|
14
|
+
value: undefined,
|
|
15
|
+
listeners: new Set<() => void>(),
|
|
16
|
+
}) as PaneFocusState
|
|
17
|
+
|
|
18
|
+
function storage(): Pick<Storage, 'getItem' | 'setItem' | 'removeItem'> | undefined {
|
|
19
|
+
try {
|
|
20
|
+
return typeof localStorage === 'undefined' ? undefined : localStorage
|
|
21
|
+
} catch {
|
|
22
|
+
return undefined
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** How panes take focus: on hover unless the person chose click. */
|
|
27
|
+
export function paneFocusMode(): PaneFocusMode {
|
|
28
|
+
if (state.value === undefined) {
|
|
29
|
+
let saved: string | null = null
|
|
30
|
+
try {
|
|
31
|
+
saved = storage()?.getItem(STORAGE_KEY) ?? null
|
|
32
|
+
} catch {
|
|
33
|
+
// Unreadable storage means the default.
|
|
34
|
+
}
|
|
35
|
+
state.value = saved === 'click' ? 'click' : 'hover'
|
|
36
|
+
}
|
|
37
|
+
return state.value
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function setPaneFocusMode(value: PaneFocusMode): void {
|
|
41
|
+
state.value = value
|
|
42
|
+
try {
|
|
43
|
+
if (value === 'hover') storage()?.removeItem(STORAGE_KEY)
|
|
44
|
+
else storage()?.setItem(STORAGE_KEY, value)
|
|
45
|
+
} catch {
|
|
46
|
+
// The choice still applies for this session.
|
|
47
|
+
}
|
|
48
|
+
for (const listener of state.listeners) listener()
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Calls `listener` after the choice changes; returns the way to stop. */
|
|
52
|
+
export function subscribePaneFocusMode(listener: () => void): () => void {
|
|
53
|
+
state.listeners.add(listener)
|
|
54
|
+
return () => state.listeners.delete(listener)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** A pane's own element that takes the keys when hover activates it (a terminal's input, say). */
|
|
58
|
+
export const PANE_FOCUS_TARGET = '[data-pane-focus-target]'
|
|
59
|
+
|
|
60
|
+
// Focus inside an open overlay is never taken by a pane the pointer passes over.
|
|
61
|
+
const OVERLAY = '[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'
|
|
62
|
+
const EDITABLE = 'input, textarea, select, [contenteditable=""], [contenteditable="true"]'
|
|
63
|
+
|
|
64
|
+
// The element each pane last had focus in, so hovering back returns the keys to it.
|
|
65
|
+
const lastFocused = new WeakMap<HTMLElement, HTMLElement>()
|
|
66
|
+
|
|
67
|
+
/** Remembers where focus is inside `pane`; call from the pane's `focusin`. */
|
|
68
|
+
export function rememberPaneFocus(pane: HTMLElement, target: EventTarget | null): void {
|
|
69
|
+
if (target instanceof HTMLElement && target !== pane && pane.contains(target))
|
|
70
|
+
lastFocused.set(pane, target)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type PointerLike = Pick<PointerEvent, 'pointerType' | 'buttons' | 'movementX' | 'movementY'>
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Whether the pointer moving over `pane` should activate it. Only a real mouse move with no button
|
|
77
|
+
* held counts: a touch, a pen tap, a drag, a selection or content shifting under a still pointer
|
|
78
|
+
* does not. Focus already inside the pane, inside an open overlay, or in a text field that is in
|
|
79
|
+
* no pane (no `[data-pane-id]` ancestor) and outside `scope` stays where it is.
|
|
80
|
+
*/
|
|
81
|
+
export function hoverTakesFocus(event: PointerLike, pane: HTMLElement, scope?: Element): boolean {
|
|
82
|
+
if (event.pointerType !== 'mouse' || event.buttons !== 0) return false
|
|
83
|
+
if (event.movementX === 0 && event.movementY === 0) return false
|
|
84
|
+
const active = pane.ownerDocument.activeElement
|
|
85
|
+
if (!active || active === pane.ownerDocument.body) return true
|
|
86
|
+
if (pane.contains(active)) return false
|
|
87
|
+
if (active.closest(OVERLAY)) return false
|
|
88
|
+
const inPane = active.closest('[data-pane-id]') !== null || (scope?.contains(active) ?? false)
|
|
89
|
+
return inPane || !active.matches(EDITABLE)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Moves focus into `pane` as a hover activation: back to the element it last had focus in, else
|
|
94
|
+
* its `data-pane-focus-target`, else the pane itself. The pane's `focusin` then marks it active.
|
|
95
|
+
* Returns whether focus moved.
|
|
96
|
+
*/
|
|
97
|
+
export function focusPaneOnHover(
|
|
98
|
+
event: PointerLike,
|
|
99
|
+
pane: HTMLElement,
|
|
100
|
+
options: { scope?: Element; mode?: PaneFocusMode } = {}
|
|
101
|
+
): boolean {
|
|
102
|
+
if ((options.mode ?? paneFocusMode()) !== 'hover') return false
|
|
103
|
+
if (!hoverTakesFocus(event, pane, options.scope)) return false
|
|
104
|
+
const remembered = lastFocused.get(pane)
|
|
105
|
+
const target =
|
|
106
|
+
(remembered?.isConnected && pane.contains(remembered) ? remembered : undefined) ??
|
|
107
|
+
pane.querySelector<HTMLElement>(PANE_FOCUS_TARGET) ??
|
|
108
|
+
pane
|
|
109
|
+
target.focus({ preventScroll: true })
|
|
110
|
+
return pane.contains(pane.ownerDocument.activeElement)
|
|
111
|
+
}
|
|
@@ -19,6 +19,13 @@ import { resizeSeparatorClass } from '../../../lib/resize-separator'
|
|
|
19
19
|
import { cn } from '../../../lib/utils'
|
|
20
20
|
import { computeLayoutFrames, type LayoutRect } from './geometry'
|
|
21
21
|
import { paneDropIntent, type PaneDropIntent } from './drop'
|
|
22
|
+
import {
|
|
23
|
+
focusPaneOnHover,
|
|
24
|
+
paneFocusMode,
|
|
25
|
+
rememberPaneFocus,
|
|
26
|
+
subscribePaneFocusMode,
|
|
27
|
+
type PaneFocusMode,
|
|
28
|
+
} from './pane-focus'
|
|
22
29
|
import { fastIcon } from '../../../lib/fast-icon'
|
|
23
30
|
|
|
24
31
|
// lucide icons drawn from a cloned template (see fastIcon).
|
|
@@ -73,6 +80,11 @@ export type SplitLayoutProps<L extends SplitLayoutLeaf> = {
|
|
|
73
80
|
labelForSeparator?: (branch: SplitLayoutBranch<L>) => string
|
|
74
81
|
onResize: (splitId: string, ratio: number) => void
|
|
75
82
|
onFocus?: (leafId: string) => void
|
|
83
|
+
/**
|
|
84
|
+
* How a pane takes focus. `hover` activates the pane the mouse moves onto (keys typed next go to
|
|
85
|
+
* it); `click` waits for a click. Defaults to the device preference (`paneFocusMode`).
|
|
86
|
+
*/
|
|
87
|
+
focusMode?: PaneFocusMode
|
|
76
88
|
/** Host performs the model transition and returns the surviving focus destination. */
|
|
77
89
|
onClose?: (leafId: string) => string | undefined
|
|
78
90
|
/** Pointer placement only; the host supplies keyboard commands and performs the model transition. */
|
|
@@ -230,6 +242,9 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
|
|
|
230
242
|
const [drag, setDrag] = createSignal<{ id: string; token: string }>()
|
|
231
243
|
const [drop, setDrop] = createSignal<{ id: string; intent: PaneDropIntent }>()
|
|
232
244
|
const [resizeController, setResizeController] = createSignal<ResizeControllerState<L>>()
|
|
245
|
+
const [preferredFocusMode, setPreferredFocusMode] = createSignal(paneFocusMode())
|
|
246
|
+
onCleanup(subscribePaneFocusMode(() => setPreferredFocusMode(paneFocusMode())))
|
|
247
|
+
const focusMode = () => props.focusMode ?? preferredFocusMode()
|
|
233
248
|
const reloadRequired = () => resizeControllerEntry >= resizeControllerEntries.length
|
|
234
249
|
const cancelPendingFocusRestore = () => {
|
|
235
250
|
if (pendingFocusFrame !== undefined) cancelAnimationFrame(pendingFocusFrame)
|
|
@@ -528,7 +543,18 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
|
|
|
528
543
|
}}
|
|
529
544
|
style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}
|
|
530
545
|
class="absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring"
|
|
531
|
-
|
|
546
|
+
data-focus-mode={focusMode()}
|
|
547
|
+
onFocusIn={(event) => {
|
|
548
|
+
rememberPaneFocus(event.currentTarget, event.target)
|
|
549
|
+
props.onFocus?.(id)
|
|
550
|
+
}}
|
|
551
|
+
onPointerMove={(event) => {
|
|
552
|
+
if (drag()) return
|
|
553
|
+
focusPaneOnHover(event, event.currentTarget, {
|
|
554
|
+
mode: focusMode(),
|
|
555
|
+
...(root ? { scope: root } : {}),
|
|
556
|
+
})
|
|
557
|
+
}}
|
|
532
558
|
>
|
|
533
559
|
<header class="flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2">
|
|
534
560
|
<span
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adea-ai/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.161.0",
|
|
4
4
|
"description": "The Adea design system: ui-sdk-backed Solid components, semantic OKLCH tokens, and the app-shell layout primitives shared by Adea and Cortana.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adea",
|
|
@@ -128,6 +128,12 @@
|
|
|
128
128
|
"development": "./src/components/conversation/transcript-composition.tsx",
|
|
129
129
|
"import": "./dist/components/conversation/transcript-composition.js"
|
|
130
130
|
},
|
|
131
|
+
"./components/layout/split-layout/pane-focus": {
|
|
132
|
+
"types": "./dist/components/layout/split-layout/pane-focus.d.ts",
|
|
133
|
+
"solid": "./src/components/layout/split-layout/pane-focus.ts",
|
|
134
|
+
"development": "./src/components/layout/split-layout/pane-focus.ts",
|
|
135
|
+
"import": "./dist/components/layout/split-layout/pane-focus.js"
|
|
136
|
+
},
|
|
131
137
|
"./components/layout/split-layout/tree": {
|
|
132
138
|
"types": "./dist/components/layout/split-layout/tree.d.ts",
|
|
133
139
|
"solid": "./src/components/layout/split-layout/tree.ts",
|
package/registry.json
CHANGED
|
@@ -2227,6 +2227,11 @@
|
|
|
2227
2227
|
"type": "registry:ui",
|
|
2228
2228
|
"target": "components/layout/split-layout/model.ts"
|
|
2229
2229
|
},
|
|
2230
|
+
{
|
|
2231
|
+
"path": "src/components/layout/split-layout/pane-focus.ts",
|
|
2232
|
+
"type": "registry:ui",
|
|
2233
|
+
"target": "components/layout/split-layout/pane-focus.ts"
|
|
2234
|
+
},
|
|
2230
2235
|
{
|
|
2231
2236
|
"path": "src/components/layout/split-layout/resize-controller-core-retry.tsx",
|
|
2232
2237
|
"type": "registry:ui",
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// How a pane takes focus: on hover (the pointer moving onto it activates it, so the keys typed
|
|
2
|
+
// next go to it) or on click. The choice is a device preference kept in `localStorage`, shared by
|
|
3
|
+
// every pane surface: SplitLayout reads it by default, and a host's own pane (a floating window,
|
|
4
|
+
// for instance) calls `focusPaneOnHover` from its `pointermove` to behave the same way.
|
|
5
|
+
|
|
6
|
+
export type PaneFocusMode = 'hover' | 'click'
|
|
7
|
+
|
|
8
|
+
const STORAGE_KEY = 'adea:pane-focus-mode:v1'
|
|
9
|
+
|
|
10
|
+
// One shared copy, because the preference reaches the page from more than one bundle.
|
|
11
|
+
type PaneFocusState = { value: PaneFocusMode | undefined; listeners: Set<() => void> }
|
|
12
|
+
const STATE_KEY = Symbol.for('adea.ui.pane-focus-mode')
|
|
13
|
+
const state: PaneFocusState = ((globalThis as Record<symbol, unknown>)[STATE_KEY] ??= {
|
|
14
|
+
value: undefined,
|
|
15
|
+
listeners: new Set<() => void>(),
|
|
16
|
+
}) as PaneFocusState
|
|
17
|
+
|
|
18
|
+
function storage(): Pick<Storage, 'getItem' | 'setItem' | 'removeItem'> | undefined {
|
|
19
|
+
try {
|
|
20
|
+
return typeof localStorage === 'undefined' ? undefined : localStorage
|
|
21
|
+
} catch {
|
|
22
|
+
return undefined
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** How panes take focus: on hover unless the person chose click. */
|
|
27
|
+
export function paneFocusMode(): PaneFocusMode {
|
|
28
|
+
if (state.value === undefined) {
|
|
29
|
+
let saved: string | null = null
|
|
30
|
+
try {
|
|
31
|
+
saved = storage()?.getItem(STORAGE_KEY) ?? null
|
|
32
|
+
} catch {
|
|
33
|
+
// Unreadable storage means the default.
|
|
34
|
+
}
|
|
35
|
+
state.value = saved === 'click' ? 'click' : 'hover'
|
|
36
|
+
}
|
|
37
|
+
return state.value
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function setPaneFocusMode(value: PaneFocusMode): void {
|
|
41
|
+
state.value = value
|
|
42
|
+
try {
|
|
43
|
+
if (value === 'hover') storage()?.removeItem(STORAGE_KEY)
|
|
44
|
+
else storage()?.setItem(STORAGE_KEY, value)
|
|
45
|
+
} catch {
|
|
46
|
+
// The choice still applies for this session.
|
|
47
|
+
}
|
|
48
|
+
for (const listener of state.listeners) listener()
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Calls `listener` after the choice changes; returns the way to stop. */
|
|
52
|
+
export function subscribePaneFocusMode(listener: () => void): () => void {
|
|
53
|
+
state.listeners.add(listener)
|
|
54
|
+
return () => state.listeners.delete(listener)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** A pane's own element that takes the keys when hover activates it (a terminal's input, say). */
|
|
58
|
+
export const PANE_FOCUS_TARGET = '[data-pane-focus-target]'
|
|
59
|
+
|
|
60
|
+
// Focus inside an open overlay is never taken by a pane the pointer passes over.
|
|
61
|
+
const OVERLAY = '[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'
|
|
62
|
+
const EDITABLE = 'input, textarea, select, [contenteditable=""], [contenteditable="true"]'
|
|
63
|
+
|
|
64
|
+
// The element each pane last had focus in, so hovering back returns the keys to it.
|
|
65
|
+
const lastFocused = new WeakMap<HTMLElement, HTMLElement>()
|
|
66
|
+
|
|
67
|
+
/** Remembers where focus is inside `pane`; call from the pane's `focusin`. */
|
|
68
|
+
export function rememberPaneFocus(pane: HTMLElement, target: EventTarget | null): void {
|
|
69
|
+
if (target instanceof HTMLElement && target !== pane && pane.contains(target))
|
|
70
|
+
lastFocused.set(pane, target)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type PointerLike = Pick<PointerEvent, 'pointerType' | 'buttons' | 'movementX' | 'movementY'>
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Whether the pointer moving over `pane` should activate it. Only a real mouse move with no button
|
|
77
|
+
* held counts: a touch, a pen tap, a drag, a selection or content shifting under a still pointer
|
|
78
|
+
* does not. Focus already inside the pane, inside an open overlay, or in a text field that is in
|
|
79
|
+
* no pane (no `[data-pane-id]` ancestor) and outside `scope` stays where it is.
|
|
80
|
+
*/
|
|
81
|
+
export function hoverTakesFocus(event: PointerLike, pane: HTMLElement, scope?: Element): boolean {
|
|
82
|
+
if (event.pointerType !== 'mouse' || event.buttons !== 0) return false
|
|
83
|
+
if (event.movementX === 0 && event.movementY === 0) return false
|
|
84
|
+
const active = pane.ownerDocument.activeElement
|
|
85
|
+
if (!active || active === pane.ownerDocument.body) return true
|
|
86
|
+
if (pane.contains(active)) return false
|
|
87
|
+
if (active.closest(OVERLAY)) return false
|
|
88
|
+
const inPane = active.closest('[data-pane-id]') !== null || (scope?.contains(active) ?? false)
|
|
89
|
+
return inPane || !active.matches(EDITABLE)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Moves focus into `pane` as a hover activation: back to the element it last had focus in, else
|
|
94
|
+
* its `data-pane-focus-target`, else the pane itself. The pane's `focusin` then marks it active.
|
|
95
|
+
* Returns whether focus moved.
|
|
96
|
+
*/
|
|
97
|
+
export function focusPaneOnHover(
|
|
98
|
+
event: PointerLike,
|
|
99
|
+
pane: HTMLElement,
|
|
100
|
+
options: { scope?: Element; mode?: PaneFocusMode } = {}
|
|
101
|
+
): boolean {
|
|
102
|
+
if ((options.mode ?? paneFocusMode()) !== 'hover') return false
|
|
103
|
+
if (!hoverTakesFocus(event, pane, options.scope)) return false
|
|
104
|
+
const remembered = lastFocused.get(pane)
|
|
105
|
+
const target =
|
|
106
|
+
(remembered?.isConnected && pane.contains(remembered) ? remembered : undefined) ??
|
|
107
|
+
pane.querySelector<HTMLElement>(PANE_FOCUS_TARGET) ??
|
|
108
|
+
pane
|
|
109
|
+
target.focus({ preventScroll: true })
|
|
110
|
+
return pane.contains(pane.ownerDocument.activeElement)
|
|
111
|
+
}
|
|
@@ -19,6 +19,13 @@ import { resizeSeparatorClass } from '#lib/resize-separator'
|
|
|
19
19
|
import { cn } from '#lib/utils'
|
|
20
20
|
import { computeLayoutFrames, type LayoutRect } from './geometry'
|
|
21
21
|
import { paneDropIntent, type PaneDropIntent } from './drop'
|
|
22
|
+
import {
|
|
23
|
+
focusPaneOnHover,
|
|
24
|
+
paneFocusMode,
|
|
25
|
+
rememberPaneFocus,
|
|
26
|
+
subscribePaneFocusMode,
|
|
27
|
+
type PaneFocusMode,
|
|
28
|
+
} from './pane-focus'
|
|
22
29
|
import { fastIcon } from '#lib/fast-icon'
|
|
23
30
|
|
|
24
31
|
// lucide icons drawn from a cloned template (see fastIcon).
|
|
@@ -73,6 +80,11 @@ export type SplitLayoutProps<L extends SplitLayoutLeaf> = {
|
|
|
73
80
|
labelForSeparator?: (branch: SplitLayoutBranch<L>) => string
|
|
74
81
|
onResize: (splitId: string, ratio: number) => void
|
|
75
82
|
onFocus?: (leafId: string) => void
|
|
83
|
+
/**
|
|
84
|
+
* How a pane takes focus. `hover` activates the pane the mouse moves onto (keys typed next go to
|
|
85
|
+
* it); `click` waits for a click. Defaults to the device preference (`paneFocusMode`).
|
|
86
|
+
*/
|
|
87
|
+
focusMode?: PaneFocusMode
|
|
76
88
|
/** Host performs the model transition and returns the surviving focus destination. */
|
|
77
89
|
onClose?: (leafId: string) => string | undefined
|
|
78
90
|
/** Pointer placement only; the host supplies keyboard commands and performs the model transition. */
|
|
@@ -230,6 +242,9 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
|
|
|
230
242
|
const [drag, setDrag] = createSignal<{ id: string; token: string }>()
|
|
231
243
|
const [drop, setDrop] = createSignal<{ id: string; intent: PaneDropIntent }>()
|
|
232
244
|
const [resizeController, setResizeController] = createSignal<ResizeControllerState<L>>()
|
|
245
|
+
const [preferredFocusMode, setPreferredFocusMode] = createSignal(paneFocusMode())
|
|
246
|
+
onCleanup(subscribePaneFocusMode(() => setPreferredFocusMode(paneFocusMode())))
|
|
247
|
+
const focusMode = () => props.focusMode ?? preferredFocusMode()
|
|
233
248
|
const reloadRequired = () => resizeControllerEntry >= resizeControllerEntries.length
|
|
234
249
|
const cancelPendingFocusRestore = () => {
|
|
235
250
|
if (pendingFocusFrame !== undefined) cancelAnimationFrame(pendingFocusFrame)
|
|
@@ -528,7 +543,18 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
|
|
|
528
543
|
}}
|
|
529
544
|
style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}
|
|
530
545
|
class="absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring"
|
|
531
|
-
|
|
546
|
+
data-focus-mode={focusMode()}
|
|
547
|
+
onFocusIn={(event) => {
|
|
548
|
+
rememberPaneFocus(event.currentTarget, event.target)
|
|
549
|
+
props.onFocus?.(id)
|
|
550
|
+
}}
|
|
551
|
+
onPointerMove={(event) => {
|
|
552
|
+
if (drag()) return
|
|
553
|
+
focusPaneOnHover(event, event.currentTarget, {
|
|
554
|
+
mode: focusMode(),
|
|
555
|
+
...(root ? { scope: root } : {}),
|
|
556
|
+
})
|
|
557
|
+
}}
|
|
532
558
|
>
|
|
533
559
|
<header class="flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2">
|
|
534
560
|
<span
|