@adea-ai/ui 0.130.1 → 0.130.2

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.
Files changed (29) hide show
  1. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts +7 -6
  2. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
  3. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +130 -144
  4. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  5. package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts +1 -1
  6. package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts.map +1 -1
  7. package/dist/components/layout/split-layout/resize-controller-core-retry.js +91 -55
  8. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  9. package/dist/components/layout/split-layout/resize-controller-core.d.ts +1 -1
  10. package/dist/components/layout/split-layout/resize-controller-core.d.ts.map +1 -1
  11. package/dist/components/layout/split-layout/resize-controller-core.js +91 -55
  12. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  13. package/dist/components/layout/split-layout/split-layout.d.ts +1 -1
  14. package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
  15. package/dist/components/layout/split-layout/split-layout.js +2 -2
  16. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  17. package/dist/r/pixel-resize-handle.json +3 -2
  18. package/dist/r/registry.json +3 -3
  19. package/dist/r/split-layout.json +0 -1
  20. package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +60 -61
  21. package/dist/r/src/components/layout/split-layout/resize-controller-core-retry.tsx +72 -31
  22. package/dist/r/src/components/layout/split-layout/resize-controller-core.tsx +72 -31
  23. package/dist/r/src/components/layout/split-layout/split-layout.tsx +2 -2
  24. package/package.json +1 -1
  25. package/registry.json +3 -3
  26. package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +60 -61
  27. package/src/components/layout/split-layout/resize-controller-core-retry.tsx +72 -31
  28. package/src/components/layout/split-layout/resize-controller-core.tsx +72 -31
  29. package/src/components/layout/split-layout/split-layout.tsx +2 -2
@@ -22,13 +22,14 @@ export type PixelResizeHandleProps = {
22
22
  *
23
23
  * A keyboard- and pointer-operable edge ruler for a host-owned pane. Keep the
24
24
  * pane's actual width and any persistence in its layout owner; this component
25
- * reports a bounded pixel value and places the shared resizable grip at the
26
- * matching left or right edge.
25
+ * reports a bounded pixel value and draws the grip at the matching left or
26
+ * right edge.
27
27
  *
28
- * Corvu 0.2.5 supplies geometry, keyboard resizing, ARIA and the shared grip,
29
- * but its global drag handler does not end on pointer cancellation. Prevent
30
- * that handler through its public start hook and use local pointer capture
31
- * for bounded pixel gestures, including cancellation and lost capture.
28
+ * The ruler is a single separator positioned inside a box as wide as the
29
+ * maximum, so it needs no panel-group geometry (and none of the split-layout
30
+ * code that comes with one): arrow keys move it by `step` along its visual
31
+ * edge, Home and End jump to the bounds, and a pointer drag is captured on the
32
+ * handle so cancellation and lost capture end the gesture.
32
33
  */
33
34
  export declare function PixelResizeHandle(props: PixelResizeHandleProps): import("solid-js").JSX.Element;
34
35
  //# sourceMappingURL=pixel-resize-handle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pixel-resize-handle.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,sBAAsB,GAAG;IACnC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,kCAgJ9D"}
1
+ {"version":3,"file":"pixel-resize-handle.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,sBAAsB,GAAG;IACnC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,kCA8I9D"}
@@ -1,28 +1,31 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
- import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "../../ui/resizable/resizable.js";
3
- import { createComponent, memo } from "solid-js/web";
2
+ import { className, createComponent, delegateEvents, effect, insert, memo, setAttribute, setStyleProperty, template } from "solid-js/web";
3
+ import { GripVertical } from "lucide-solid";
4
4
  import { createSignal, onCleanup } from "solid-js";
5
5
  //#region src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx
6
+ var _tmpl$ = /*#__PURE__*/ template(`<div><div role=separator tabindex=0 aria-orientation=vertical>`);
7
+ var _tmpl$2 = /*#__PURE__*/ template(`<div class="bg-border z-(--z-docked) flex h-4 w-2.5 items-center justify-center rounded-sm border border-border">`);
8
+ var _tmpl$3 = /*#__PURE__*/ template(`<div data-slot=resizable-grip class="z-(--z-docked) h-11 w-1.5 flex-none rounded-full bg-border/55">`);
6
9
  /**
7
10
  * PixelResizeHandle.
8
11
  *
9
12
  * A keyboard- and pointer-operable edge ruler for a host-owned pane. Keep the
10
13
  * pane's actual width and any persistence in its layout owner; this component
11
- * reports a bounded pixel value and places the shared resizable grip at the
12
- * matching left or right edge.
14
+ * reports a bounded pixel value and draws the grip at the matching left or
15
+ * right edge.
13
16
  *
14
- * Corvu 0.2.5 supplies geometry, keyboard resizing, ARIA and the shared grip,
15
- * but its global drag handler does not end on pointer cancellation. Prevent
16
- * that handler through its public start hook and use local pointer capture
17
- * for bounded pixel gestures, including cancellation and lost capture.
17
+ * The ruler is a single separator positioned inside a box as wide as the
18
+ * maximum, so it needs no panel-group geometry (and none of the split-layout
19
+ * code that comes with one): arrow keys move it by `step` along its visual
20
+ * edge, Home and End jump to the bounds, and a pointer drag is captured on the
21
+ * handle so cancellation and lost capture end the gesture.
18
22
  */
19
23
  function PixelResizeHandle(props) {
20
24
  const maximum = () => Math.max(1, props.maximum);
21
25
  const minimum = () => Math.min(maximum(), Math.max(0, props.minimum));
22
26
  const value = () => Math.min(maximum(), Math.max(minimum(), Math.round(props.value)));
23
- const ratio = () => value() / maximum();
24
27
  const isRight = () => props.side === "right";
25
- const rulerSizes = () => isRight() ? [1 - ratio(), ratio()] : [ratio(), 1 - ratio()];
28
+ const bounded = (next) => Math.min(maximum(), Math.max(minimum(), Math.round(next)));
26
29
  const commit = () => props.onCommit?.(value());
27
30
  let interacting = false;
28
31
  const [drag, setDrag] = createSignal();
@@ -42,143 +45,126 @@ function PixelResizeHandle(props) {
42
45
  endKeyboard();
43
46
  endPointer(false);
44
47
  });
45
- return createComponent(ResizablePanelGroup, {
46
- orientation: "horizontal",
47
- dir: "ltr",
48
- get sizes() {
49
- return rulerSizes();
50
- },
51
- get keyboardDelta() {
52
- return `${props.step ?? 16}px`;
53
- },
54
- get style() {
55
- return { width: `${maximum()}px` };
56
- },
57
- get ["class"]() {
58
- return cn("pointer-events-none absolute inset-y-0 flex", {
48
+ const move = (next) => {
49
+ if (next !== value()) props.onChange(next);
50
+ };
51
+ const KEY_DIRECTION = {
52
+ ArrowLeft: -1,
53
+ ArrowRight: 1
54
+ };
55
+ return (() => {
56
+ var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
57
+ _el$2.$$keyup = (event) => {
58
+ if ([
59
+ "ArrowLeft",
60
+ "ArrowRight",
61
+ "Home",
62
+ "End"
63
+ ].includes(event.key)) endKeyboard();
64
+ };
65
+ _el$2.$$keydown = (event) => {
66
+ const current = drag();
67
+ if (current && !current.handle.hasPointerCapture(current.pointerId)) endPointer(false);
68
+ if (drag()) {
69
+ event.preventDefault();
70
+ return;
71
+ }
72
+ const direction = KEY_DIRECTION[event.key];
73
+ if (direction !== void 0) {
74
+ event.preventDefault();
75
+ interacting = true;
76
+ move(bounded(value() + direction * (isRight() ? -1 : 1) * (props.step ?? 16)));
77
+ } else if (event.key === "Home" || event.key === "End") {
78
+ event.preventDefault();
79
+ interacting = true;
80
+ move(event.key === "Home" ? minimum() : maximum());
81
+ }
82
+ };
83
+ _el$2.addEventListener("blur", () => {
84
+ endKeyboard();
85
+ endPointer(false);
86
+ });
87
+ _el$2.addEventListener("lostpointercapture", (event) => {
88
+ if (event.pointerId === drag()?.pointerId) endPointer(false);
89
+ });
90
+ _el$2.addEventListener("pointercancel", (event) => {
91
+ if (event.pointerId === drag()?.pointerId) endPointer(false);
92
+ });
93
+ _el$2.$$pointerup = (event) => {
94
+ if (event.pointerId === drag()?.pointerId) endPointer(true);
95
+ };
96
+ _el$2.$$pointermove = (event) => {
97
+ const current = drag();
98
+ if (!current || event.pointerId !== current.pointerId) return;
99
+ if (!current.handle.hasPointerCapture(current.pointerId)) {
100
+ endPointer(false);
101
+ return;
102
+ }
103
+ const delta = (event.clientX - current.startX) * (isRight() ? -1 : 1);
104
+ move(bounded(current.startValue + delta));
105
+ };
106
+ _el$2.$$pointerdown = (event) => {
107
+ if (event.button !== 0 || !event.isPrimary) return;
108
+ const handle = event.currentTarget;
109
+ endPointer(false);
110
+ interacting = false;
111
+ handle.focus();
112
+ handle.setPointerCapture(event.pointerId);
113
+ setDrag({
114
+ pointerId: event.pointerId,
115
+ startX: event.clientX,
116
+ startValue: value(),
117
+ handle
118
+ });
119
+ };
120
+ insert(_el$2, (() => {
121
+ var _c$ = memo(() => props.grip === "chip");
122
+ return () => _c$() ? (() => {
123
+ var _el$3 = _tmpl$2();
124
+ insert(_el$3, createComponent(GripVertical, { "class": "size-2.5 text-muted-foreground" }));
125
+ return _el$3;
126
+ })() : _tmpl$3();
127
+ })());
128
+ effect((_p$) => {
129
+ var _v$ = cn("pointer-events-none absolute inset-y-0", {
59
130
  "left-0": props.side === "left",
60
131
  "right-0": props.side === "right"
61
- }, props.class);
62
- },
63
- onSizesChange: (sizes) => {
64
- if (!interacting || sizes.length !== 2) return;
65
- const next = Math.round((sizes[isRight() ? 1 : 0] ?? ratio()) * maximum());
66
- const bounded = Math.min(maximum(), Math.max(minimum(), next));
67
- if (bounded !== value()) props.onChange(bounded);
68
- },
69
- get children() {
70
- return [
71
- createComponent(ResizablePanel, {
72
- get minSize() {
73
- return memo(() => !!isRight())() ? 0 : minimum() / maximum();
74
- },
75
- maxSize: 1,
76
- "aria-hidden": "true"
77
- }),
78
- createComponent(ResizableHandle, {
79
- get withHandle() {
80
- return props.grip === "chip" ? true : "rung";
81
- },
82
- get label() {
83
- return props.label ?? `Resize ${props.side} pane`;
84
- },
85
- get ["aria-controls"]() {
86
- return props.controls;
87
- },
88
- get ["aria-valuemin"]() {
89
- return minimum();
90
- },
91
- get ["aria-valuemax"]() {
92
- return maximum();
93
- },
94
- get ["aria-valuenow"]() {
95
- return value();
96
- },
97
- get ["aria-valuetext"]() {
98
- return `${value()} pixels`;
99
- },
100
- get ["data-dragging"]() {
101
- return drag() ? "" : void 0;
102
- },
103
- onHandleDragStart: (event) => {
104
- event.preventDefault();
105
- if (event.button !== 0 || !event.isPrimary) return;
106
- const handle = event.currentTarget;
107
- if (!(handle instanceof HTMLElement)) return;
108
- endPointer(false);
109
- interacting = false;
110
- handle.focus();
111
- handle.setPointerCapture(event.pointerId);
112
- setDrag({
113
- pointerId: event.pointerId,
114
- startX: event.clientX,
115
- startValue: value(),
116
- handle
117
- });
118
- },
119
- onPointerMove: (event) => {
120
- const current = drag();
121
- if (!current || event.pointerId !== current.pointerId) return;
122
- if (!current.handle.hasPointerCapture(current.pointerId)) {
123
- endPointer(false);
124
- return;
125
- }
126
- const delta = (event.clientX - current.startX) * (isRight() ? -1 : 1);
127
- const next = Math.min(maximum(), Math.max(minimum(), Math.round(current.startValue + delta)));
128
- if (next !== value()) props.onChange(next);
129
- },
130
- onPointerUp: (event) => {
131
- if (event.pointerId === drag()?.pointerId) endPointer(true);
132
- },
133
- onPointerCancel: (event) => {
134
- if (event.pointerId === drag()?.pointerId) endPointer(false);
135
- },
136
- onLostPointerCapture: (event) => {
137
- if (event.pointerId === drag()?.pointerId) endPointer(false);
138
- },
139
- onBlur: () => {
140
- endKeyboard();
141
- endPointer(false);
142
- },
143
- onKeyDown: (event) => {
144
- const current = drag();
145
- if (current && !current.handle.hasPointerCapture(current.pointerId)) endPointer(false);
146
- if (drag()) {
147
- event.preventDefault();
148
- return;
149
- }
150
- if ([
151
- "ArrowLeft",
152
- "ArrowRight",
153
- "Home",
154
- "End"
155
- ].includes(event.key)) interacting = true;
156
- if (event.key === "Home" || event.key === "End") {
157
- event.preventDefault();
158
- props.onChange(event.key === "Home" ? minimum() : maximum());
159
- }
160
- },
161
- onKeyUp: (event) => {
162
- if ([
163
- "ArrowLeft",
164
- "ArrowRight",
165
- "Home",
166
- "End"
167
- ].includes(event.key)) endKeyboard();
168
- },
169
- "class": "pointer-events-auto"
170
- }),
171
- createComponent(ResizablePanel, {
172
- get minSize() {
173
- return memo(() => !!isRight())() ? minimum() / maximum() : 0;
174
- },
175
- maxSize: 1,
176
- "aria-hidden": "true"
177
- })
178
- ];
179
- }
180
- });
132
+ }, props.class), _v$2 = `${maximum()}px`, _v$3 = props.label ?? `Resize ${props.side} pane`, _v$4 = props.controls, _v$5 = minimum(), _v$6 = maximum(), _v$7 = value(), _v$8 = `${value()} pixels`, _v$9 = drag() ? "" : void 0, _v$0 = `${isRight() ? maximum() - value() : value()}px`, _v$1 = cn("group/resize bg-border pointer-events-auto absolute inset-y-0 flex w-px items-center justify-center", "after:absolute after:inset-y-0 after:-inset-x-3 after:w-6", "transition-colors ease-out focus-visible:bg-primary focus-visible:outline-none", props.grip === "chip" ? "hover:bg-primary" : "hover:bg-primary/45");
133
+ _v$ !== _p$.e && className(_el$, _p$.e = _v$);
134
+ _v$2 !== _p$.t && setStyleProperty(_el$, "width", _p$.t = _v$2);
135
+ _v$3 !== _p$.a && setAttribute(_el$2, "aria-label", _p$.a = _v$3);
136
+ _v$4 !== _p$.o && setAttribute(_el$2, "aria-controls", _p$.o = _v$4);
137
+ _v$5 !== _p$.i && setAttribute(_el$2, "aria-valuemin", _p$.i = _v$5);
138
+ _v$6 !== _p$.n && setAttribute(_el$2, "aria-valuemax", _p$.n = _v$6);
139
+ _v$7 !== _p$.s && setAttribute(_el$2, "aria-valuenow", _p$.s = _v$7);
140
+ _v$8 !== _p$.h && setAttribute(_el$2, "aria-valuetext", _p$.h = _v$8);
141
+ _v$9 !== _p$.r && setAttribute(_el$2, "data-dragging", _p$.r = _v$9);
142
+ _v$0 !== _p$.d && setStyleProperty(_el$2, "left", _p$.d = _v$0);
143
+ _v$1 !== _p$.l && className(_el$2, _p$.l = _v$1);
144
+ return _p$;
145
+ }, {
146
+ e: void 0,
147
+ t: void 0,
148
+ a: void 0,
149
+ o: void 0,
150
+ i: void 0,
151
+ n: void 0,
152
+ s: void 0,
153
+ h: void 0,
154
+ r: void 0,
155
+ d: void 0,
156
+ l: void 0
157
+ });
158
+ return _el$;
159
+ })();
181
160
  }
161
+ delegateEvents([
162
+ "pointerdown",
163
+ "pointermove",
164
+ "pointerup",
165
+ "keydown",
166
+ "keyup"
167
+ ]);
182
168
  //#endregion
183
169
  export { PixelResizeHandle };
184
170
 
@@ -1 +1 @@
1
- {"version":3,"file":"pixel-resize-handle.js","names":["ResizableHandle","ResizablePanel","ResizablePanelGroup","createSignal","onCleanup","cn","PixelResizeHandleProps","side","value","minimum","maximum","step","label","controls","class","grip","onChange","onCommit","PixelResizeHandle","props","Math","max","min","round","ratio","isRight","rulerSizes","commit","interacting","drag","setDrag","pointerId","startX","startValue","handle","HTMLElement","endPointer","shouldCommit","current","undefined","hasPointerCapture","releasePointerCapture","endKeyboard","wasInteracting","_$createComponent","orientation","dir","sizes","keyboardDelta","style","width","onSizesChange","length","next","bounded","children","minSize","_$memo","maxSize","withHandle","aria-controls","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","data-dragging","onHandleDragStart","event","preventDefault","button","isPrimary","currentTarget","focus","setPointerCapture","clientX","onPointerMove","PointerEvent","delta","onPointerUp","onPointerCancel","onLostPointerCapture","onBlur","onKeyDown","includes","key","onKeyUp","_$createComponent","_$memo"],"sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"sourcesContent":["import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '../../ui/resizable'\nimport { createSignal, onCleanup } from 'solid-js'\nimport { cn } from '#lib/utils'\n\nexport type PixelResizeHandleProps = {\n /** Which physical edge of the ruler the resizable surface is attached to. */\n side: 'left' | 'right'\n /** Current width in CSS pixels. */\n value: number\n minimum: number\n maximum: number\n step?: number\n label?: string\n controls?: string\n class?: string\n /**\n * The grip drawn on the edge: the quieter rung by default, or the bordered\n * chip for hosts that want the heavier affordance.\n */\n grip?: 'chip' | 'rung'\n onChange(value: number): void\n onCommit?(value: number): void\n}\n\n/**\n * PixelResizeHandle.\n *\n * A keyboard- and pointer-operable edge ruler for a host-owned pane. Keep the\n * pane's actual width and any persistence in its layout owner; this component\n * reports a bounded pixel value and places the shared resizable grip at the\n * matching left or right edge.\n *\n * Corvu 0.2.5 supplies geometry, keyboard resizing, ARIA and the shared grip,\n * but its global drag handler does not end on pointer cancellation. Prevent\n * that handler through its public start hook and use local pointer capture\n * for bounded pixel gestures, including cancellation and lost capture.\n */\nexport function PixelResizeHandle(props: PixelResizeHandleProps) {\n const maximum = () => Math.max(1, props.maximum)\n const minimum = () => Math.min(maximum(), Math.max(0, props.minimum))\n const value = () => Math.min(maximum(), Math.max(minimum(), Math.round(props.value)))\n const ratio = () => value() / maximum()\n const isRight = () => props.side === 'right'\n const rulerSizes = () => (isRight() ? [1 - ratio(), ratio()] : [ratio(), 1 - ratio()])\n const commit = () => props.onCommit?.(value())\n let interacting = false\n const [drag, setDrag] = createSignal<{\n pointerId: number\n startX: number\n startValue: number\n handle: HTMLElement\n }>()\n const endPointer = (shouldCommit: boolean) => {\n const current = drag()\n if (!current) return\n setDrag(undefined)\n if (current.handle.hasPointerCapture(current.pointerId))\n current.handle.releasePointerCapture(current.pointerId)\n if (shouldCommit) commit()\n }\n const endKeyboard = () => {\n const wasInteracting = interacting\n interacting = false\n if (wasInteracting) commit()\n }\n onCleanup(() => {\n endKeyboard()\n endPointer(false)\n })\n\n return (\n <ResizablePanelGroup\n orientation=\"horizontal\"\n dir=\"ltr\"\n sizes={rulerSizes()}\n keyboardDelta={`${props.step ?? 16}px`}\n style={{ width: `${maximum()}px` }}\n class={cn(\n 'pointer-events-none absolute inset-y-0 flex',\n {\n 'left-0': props.side === 'left',\n 'right-0': props.side === 'right',\n },\n props.class\n )}\n onSizesChange={(sizes) => {\n // Panel registration and teardown also emit sizes. Only user resizing\n // may update the host preference; collapsing must preserve its width.\n if (!interacting || sizes.length !== 2) return\n const next = Math.round((sizes[isRight() ? 1 : 0] ?? ratio()) * maximum())\n const bounded = Math.min(maximum(), Math.max(minimum(), next))\n if (bounded !== value()) props.onChange(bounded)\n }}\n >\n <ResizablePanel\n minSize={isRight() ? 0 : minimum() / maximum()}\n maxSize={1}\n aria-hidden=\"true\"\n />\n <ResizableHandle\n withHandle={props.grip === 'chip' ? true : 'rung'}\n label={props.label ?? `Resize ${props.side} pane`}\n aria-controls={props.controls}\n aria-valuemin={minimum()}\n aria-valuemax={maximum()}\n aria-valuenow={value()}\n aria-valuetext={`${value()} pixels`}\n data-dragging={drag() ? '' : undefined}\n onHandleDragStart={(event) => {\n // Corvu checks defaultPrevented before starting its global handler.\n event.preventDefault()\n if (event.button !== 0 || !event.isPrimary) return\n const handle = event.currentTarget\n if (!(handle instanceof HTMLElement)) return\n endPointer(false)\n interacting = false\n handle.focus()\n handle.setPointerCapture(event.pointerId)\n setDrag({\n pointerId: event.pointerId,\n startX: event.clientX,\n startValue: value(),\n handle,\n })\n }}\n onPointerMove={(event: PointerEvent) => {\n const current = drag()\n if (!current || event.pointerId !== current.pointerId) return\n if (!current.handle.hasPointerCapture(current.pointerId)) {\n endPointer(false)\n return\n }\n const delta = (event.clientX - current.startX) * (isRight() ? -1 : 1)\n const next = Math.min(\n maximum(),\n Math.max(minimum(), Math.round(current.startValue + delta))\n )\n if (next !== value()) props.onChange(next)\n }}\n onPointerUp={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(true)\n }}\n onPointerCancel={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onLostPointerCapture={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onBlur={() => {\n endKeyboard()\n endPointer(false)\n }}\n onKeyDown={(event) => {\n const current = drag()\n if (current && !current.handle.hasPointerCapture(current.pointerId)) endPointer(false)\n if (drag()) {\n event.preventDefault()\n return\n }\n if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) interacting = true\n // Corvu operates on physical panel order. Home/End here describe\n // the controlled pane width, including a pane after the separator.\n if (event.key === 'Home' || event.key === 'End') {\n event.preventDefault()\n props.onChange(event.key === 'Home' ? minimum() : maximum())\n }\n }}\n onKeyUp={(event) => {\n if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) {\n endKeyboard()\n }\n }}\n class=\"pointer-events-auto\"\n />\n <ResizablePanel\n minSize={isRight() ? minimum() / maximum() : 0}\n maxSize={1}\n aria-hidden=\"true\"\n />\n </ResizablePanelGroup>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqCA,SAAgBkB,kBAAkBC,OAA+B;CAC/D,MAAMT,gBAAgBU,KAAKC,IAAI,GAAGF,MAAMT,OAAO;CAC/C,MAAMD,gBAAgBW,KAAKE,IAAIZ,QAAQ,GAAGU,KAAKC,IAAI,GAAGF,MAAMV,OAAO,CAAC;CACpE,MAAMD,cAAcY,KAAKE,IAAIZ,QAAQ,GAAGU,KAAKC,IAAIZ,QAAQ,GAAGW,KAAKG,MAAMJ,MAAMX,KAAK,CAAC,CAAC;CACpF,MAAMgB,cAAchB,MAAM,IAAIE,QAAQ;CACtC,MAAMe,gBAAgBN,MAAMZ,SAAS;CACrC,MAAMmB,mBAAoBD,QAAQ,IAAI,CAAC,IAAID,MAAM,GAAGA,MAAM,CAAC,IAAI,CAACA,MAAM,GAAG,IAAIA,MAAM,CAAC;CACpF,MAAMG,eAAeR,MAAMF,WAAWT,MAAM,CAAC;CAC7C,IAAIoB,cAAc;CAClB,MAAM,CAACC,MAAMC,WAAW3B,aAKrB;CACH,MAAMiC,cAAcC,iBAA0B;EAC5C,MAAMC,UAAUT,KAAK;EACrB,IAAI,CAACS,SAAS;EACdR,QAAQS,KAAAA,CAAS;EACjB,IAAID,QAAQJ,OAAOM,kBAAkBF,QAAQP,SAAS,GACpDO,QAAQJ,OAAOO,sBAAsBH,QAAQP,SAAS;EACxD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AW,IAAI;KAC5D;KACA2C,kBAAkBZ,UAAwB;MACxC,IAAIA,MAAMpC,cAAcF,KAAK,CAAC,EAAEE,WAAWK,WAAW,KAAK;KAC7D;KACA4C,uBAAuBb,UAAwB;MAC7C,IAAIA,MAAMpC,cAAcF,KAAK,CAAC,EAAEE,WAAWK,WAAW,KAAK;KAC7D;KACA6C,cAAc;MACZvC,YAAY;MACZN,WAAW,KAAK;KAClB;KACA8C,YAAYf,UAAU;MACpB,MAAM7B,UAAUT,KAAK;MACrB,IAAIS,WAAW,CAACA,QAAQJ,OAAOM,kBAAkBF,QAAQP,SAAS,GAAGK,WAAW,KAAK;MACrF,IAAIP,KAAK,GAAG;OACVsC,MAAMC,eAAe;OACrB;MACF;MACA,IAAI;OAAC;OAAa;OAAc;OAAQ;MAAK,CAAC,CAACe,SAAShB,MAAMiB,GAAG,GAAGxD,cAAc;MAGlF,IAAIuC,MAAMiB,QAAQ,UAAUjB,MAAMiB,QAAQ,OAAO;OAC/CjB,MAAMC,eAAe;OACrBjD,MAAMH,SAASmD,MAAMiB,QAAQ,SAAS3E,QAAQ,IAAIC,QAAQ,CAAC;MAC7D;KACF;KACA2E,UAAUlB,UAAU;MAClB,IAAI;OAAC;OAAa;OAAc;OAAQ;MAAK,CAAC,CAACgB,SAAShB,MAAMiB,GAAG,GAC/D1C,YAAY;KAEhB;KAAC,SAAA;IAAA,CAAA;IAAAE,gBAGF3C,gBAAc;KAAA,IACbuD,UAAO;MAAA,OAAEC,WAAA,CAAA,CAAAhC,QAAQ,CAAC,CAAA,CAAA,IAAGhB,QAAQ,IAAIC,QAAQ,IAAI;KAAC;KAC9CgD,SAAS;KAAC,eAAA;IAAA,CAAA;GAAA;EAAA;CAAA,CAAA;AAKlB"}
1
+ {"version":3,"file":"pixel-resize-handle.js","names":["GripVertical","createSignal","onCleanup","cn","PixelResizeHandleProps","side","value","minimum","maximum","step","label","controls","class","grip","onChange","onCommit","PixelResizeHandle","props","Math","max","min","round","isRight","bounded","next","commit","interacting","drag","setDrag","pointerId","startX","startValue","handle","HTMLElement","endPointer","shouldCommit","current","undefined","hasPointerCapture","releasePointerCapture","endKeyboard","wasInteracting","move","KEY_DIRECTION","Record","ArrowLeft","ArrowRight","_el$","_tmpl$","_el$2","firstChild","$$keyup","event","includes","key","$$keydown","preventDefault","direction","addEventListener","$$pointerup","$$pointermove","delta","clientX","$$pointerdown","button","isPrimary","currentTarget","focus","setPointerCapture","_$insert","_c$","_$memo","_el$3","_tmpl$2","_$createComponent","_tmpl$3","_$effect","_p$","_v$","_v$2","_v$3","_v$4","_v$5","_v$6","_v$7","_v$8","_v$9","_v$0","_v$1","e","_$className","t","_$setStyleProperty","a","_$setAttribute","o","i","n","s","h","r","d","l","_$delegateEvents","_$memo","_$createComponent","_$className","_$setStyleProperty","_$setAttribute","_$delegateEvents"],"sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"sourcesContent":["import { GripVertical } from 'lucide-solid'\nimport { createSignal, onCleanup } from 'solid-js'\nimport { cn } from '#lib/utils'\n\nexport type PixelResizeHandleProps = {\n /** Which physical edge of the ruler the resizable surface is attached to. */\n side: 'left' | 'right'\n /** Current width in CSS pixels. */\n value: number\n minimum: number\n maximum: number\n step?: number\n label?: string\n controls?: string\n class?: string\n /**\n * The grip drawn on the edge: the quieter rung by default, or the bordered\n * chip for hosts that want the heavier affordance.\n */\n grip?: 'chip' | 'rung'\n onChange(value: number): void\n onCommit?(value: number): void\n}\n\n/**\n * PixelResizeHandle.\n *\n * A keyboard- and pointer-operable edge ruler for a host-owned pane. Keep the\n * pane's actual width and any persistence in its layout owner; this component\n * reports a bounded pixel value and draws the grip at the matching left or\n * right edge.\n *\n * The ruler is a single separator positioned inside a box as wide as the\n * maximum, so it needs no panel-group geometry (and none of the split-layout\n * code that comes with one): arrow keys move it by `step` along its visual\n * edge, Home and End jump to the bounds, and a pointer drag is captured on the\n * handle so cancellation and lost capture end the gesture.\n */\nexport function PixelResizeHandle(props: PixelResizeHandleProps) {\n const maximum = () => Math.max(1, props.maximum)\n const minimum = () => Math.min(maximum(), Math.max(0, props.minimum))\n const value = () => Math.min(maximum(), Math.max(minimum(), Math.round(props.value)))\n const isRight = () => props.side === 'right'\n const bounded = (next: number) => Math.min(maximum(), Math.max(minimum(), Math.round(next)))\n const commit = () => props.onCommit?.(value())\n let interacting = false\n const [drag, setDrag] = createSignal<{\n pointerId: number\n startX: number\n startValue: number\n handle: HTMLElement\n }>()\n const endPointer = (shouldCommit: boolean) => {\n const current = drag()\n if (!current) return\n setDrag(undefined)\n if (current.handle.hasPointerCapture(current.pointerId))\n current.handle.releasePointerCapture(current.pointerId)\n if (shouldCommit) commit()\n }\n const endKeyboard = () => {\n const wasInteracting = interacting\n interacting = false\n if (wasInteracting) commit()\n }\n onCleanup(() => {\n endKeyboard()\n endPointer(false)\n })\n const move = (next: number) => {\n if (next !== value()) props.onChange(next)\n }\n // Arrow keys describe physical movement of the handle: on a right-edge pane\n // moving the handle left widens the pane.\n const KEY_DIRECTION: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1 }\n\n return (\n <div\n class={cn(\n 'pointer-events-none absolute inset-y-0',\n {\n 'left-0': props.side === 'left',\n 'right-0': props.side === 'right',\n },\n props.class\n )}\n style={{ width: `${maximum()}px` }}\n >\n <div\n role=\"separator\"\n tabIndex={0}\n aria-orientation=\"vertical\"\n aria-label={props.label ?? `Resize ${props.side} pane`}\n aria-controls={props.controls}\n aria-valuemin={minimum()}\n aria-valuemax={maximum()}\n aria-valuenow={value()}\n aria-valuetext={`${value()} pixels`}\n data-dragging={drag() ? '' : undefined}\n style={{ left: `${isRight() ? maximum() - value() : value()}px` }}\n class={cn(\n 'group/resize bg-border pointer-events-auto absolute inset-y-0 flex w-px items-center justify-center',\n /* Widen the hit target without moving the visual line: 24px on the\n drag axis meets WCAG 2.5.8's minimum target. */\n 'after:absolute after:inset-y-0 after:-inset-x-3 after:w-6',\n 'transition-colors ease-out focus-visible:bg-primary focus-visible:outline-none',\n props.grip === 'chip' ? 'hover:bg-primary' : 'hover:bg-primary/45'\n )}\n onPointerDown={(event) => {\n if (event.button !== 0 || !event.isPrimary) return\n const handle = event.currentTarget\n endPointer(false)\n interacting = false\n handle.focus()\n handle.setPointerCapture(event.pointerId)\n setDrag({\n pointerId: event.pointerId,\n startX: event.clientX,\n startValue: value(),\n handle,\n })\n }}\n onPointerMove={(event) => {\n const current = drag()\n if (!current || event.pointerId !== current.pointerId) return\n if (!current.handle.hasPointerCapture(current.pointerId)) {\n endPointer(false)\n return\n }\n const delta = (event.clientX - current.startX) * (isRight() ? -1 : 1)\n move(bounded(current.startValue + delta))\n }}\n onPointerUp={(event) => {\n if (event.pointerId === drag()?.pointerId) endPointer(true)\n }}\n onPointerCancel={(event) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onLostPointerCapture={(event) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onBlur={() => {\n endKeyboard()\n endPointer(false)\n }}\n onKeyDown={(event) => {\n const current = drag()\n if (current && !current.handle.hasPointerCapture(current.pointerId)) endPointer(false)\n if (drag()) {\n event.preventDefault()\n return\n }\n const direction = KEY_DIRECTION[event.key]\n if (direction !== undefined) {\n event.preventDefault()\n interacting = true\n move(bounded(value() + direction * (isRight() ? -1 : 1) * (props.step ?? 16)))\n } else if (event.key === 'Home' || event.key === 'End') {\n event.preventDefault()\n interacting = true\n move(event.key === 'Home' ? minimum() : maximum())\n }\n }}\n onKeyUp={(event) => {\n if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) endKeyboard()\n }}\n >\n {props.grip === 'chip' ? (\n <div class=\"bg-border z-(--z-docked) flex h-4 w-2.5 items-center justify-center rounded-sm border border-border\">\n <GripVertical class=\"size-2.5 text-muted-foreground\" />\n </div>\n ) : (\n <div\n data-slot=\"resizable-grip\"\n class=\"z-(--z-docked) h-11 w-1.5 flex-none rounded-full bg-border/55\"\n />\n )}\n </div>\n </div>\n )\n}\n"],"mappings":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A;CAAA;CAAA;AAAA,CAAA"}
@@ -8,6 +8,6 @@ export type SplitLayoutResizeControllerProps<L extends SplitLayoutLeaf> = {
8
8
  labelForSeparator?: (branch: SplitLayoutBranch<L>) => string;
9
9
  onResize: (splitId: string, ratio: number) => void;
10
10
  };
11
- /** Corvu stays behind the first real split while the pane owners remain mounted. */
11
+ /** The divider stays behind the first real split while the pane owners remain mounted. */
12
12
  export default function SplitLayoutResizeController<L extends SplitLayoutLeaf>(props: SplitLayoutResizeControllerProps<L>): JSX.Element;
13
13
  //# sourceMappingURL=resize-controller-core-retry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resize-controller-core-retry.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/split-layout/resize-controller-core-retry.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,gCAAgC,CAAC,CAAC,SAAS,eAAe,IAAI;IACxE,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IACtC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IACjC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAA;IAC7B,IAAI,EAAE,MAAM,cAAc,GAAG,SAAS,CAAA;IACtC,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,MAAM,CAAA;IAC5D,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACnD,CAAA;AAED,oFAAoF;AACpF,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,CAAC,SAAS,eAAe,EAC3E,KAAK,EAAE,gCAAgC,CAAC,CAAC,CAAC,eA4C3C"}
1
+ {"version":3,"file":"resize-controller-core-retry.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/split-layout/resize-controller-core-retry.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAChE,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,gCAAgC,CAAC,CAAC,SAAS,eAAe,IAAI;IACxE,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IACtC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IACjC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAA;IAC7B,IAAI,EAAE,MAAM,cAAc,GAAG,SAAS,CAAA;IACtC,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,MAAM,CAAA;IAC5D,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACnD,CAAA;AAID,0FAA0F;AAC1F,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,CAAC,SAAS,eAAe,EAC3E,KAAK,EAAE,gCAAgC,CAAC,CAAC,CAAC,eAoF3C"}
@@ -1,62 +1,98 @@
1
1
  import { MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, listLeaves } from "./tree.js";
2
- import { createComponent } from "solid-js/web";
3
- import "solid-js";
4
- import Resizable from "@corvu/resizable";
2
+ import { delegateEvents, effect, setAttribute, style, template, use } from "solid-js/web";
3
+ import { createSignal } from "solid-js";
5
4
  //#region src/components/layout/split-layout/resize-controller-core-retry.tsx
6
- /** Corvu stays behind the first real split while the pane owners remain mounted. */
5
+ var _tmpl$ = /*#__PURE__*/ template(`<div class="pointer-events-none absolute min-h-0 min-w-0"><div role=separator tabindex=0 data-split-layout-handle aria-valuemin=10 aria-valuemax=90 class="pointer-events-auto absolute shrink-0 bg-border after:absolute after:inset-y-0 after:-inset-x-1 after:w-3 focus-visible:bg-primary focus-visible:outline-none hover:bg-primary data-[orientation=vertical]:after:inset-x-0 data-[orientation=vertical]:after:-inset-y-1 data-[orientation=vertical]:after:h-3 data-[orientation=vertical]:after:w-full">`);
6
+ var KEYBOARD_DELTA = .05;
7
+ /** The divider stays behind the first real split while the pane owners remain mounted. */
7
8
  function SplitLayoutResizeController(props) {
8
- const id = () => props.branch().id;
9
- return createComponent(Resizable, {
10
- get orientation() {
11
- return props.branch().direction === "row" ? "horizontal" : "vertical";
12
- },
13
- get sizes() {
14
- return [props.branch().ratio, 1 - props.branch().ratio];
15
- },
16
- keyboardDelta: .05,
17
- onSizesChange: (sizes) => {
18
- const root = props.root();
19
- if (!root?.isConnected || root.getClientRects().length === 0) return;
20
- if (sizes.length !== 2 || sizes.some((size) => !Number.isFinite(size)) || Math.abs(sizes[0] + sizes[1] - 1) > 1e-6) return;
21
- if (sizes[0] !== void 0 && Math.abs(sizes[0] - props.branch().ratio) > 1e-6) props.onResize(id(), sizes[0]);
22
- },
23
- get style() {
24
- return props.rect();
25
- },
26
- "class": "pointer-events-none absolute flex min-h-0 min-w-0 data-[orientation=vertical]:flex-col",
27
- get children() {
28
- return [
29
- createComponent(Resizable.Panel, {
30
- minSize: MIN_SPLIT_RATIO,
31
- maxSize: MAX_SPLIT_RATIO,
32
- "aria-hidden": "true"
33
- }),
34
- createComponent(Resizable.Handle, {
35
- get ["aria-label"]() {
36
- return props.labelForSeparator?.(props.branch()) ?? (props.branch().direction === "row" ? "Resize pane columns" : "Resize pane rows");
37
- },
38
- get ["aria-orientation"]() {
39
- return props.branch().direction === "row" ? "vertical" : "horizontal";
40
- },
41
- get ["aria-controls"]() {
42
- return listLeaves(props.branch()).map((leaf) => props.domId(leaf.id)).join(" ");
43
- },
44
- "aria-valuemin": 10,
45
- "aria-valuemax": 90,
46
- get ["aria-valuenow"]() {
47
- return Math.round(props.branch().ratio * 100);
48
- },
49
- "class": "pointer-events-auto relative w-px shrink-0 bg-border after:absolute after:inset-y-0 after:-inset-x-1 after:w-3 focus-visible:bg-primary focus-visible:outline-none hover:bg-primary data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:inset-x-0 data-[orientation=vertical]:after:-inset-y-1 data-[orientation=vertical]:after:h-3 data-[orientation=vertical]:after:w-full"
50
- }),
51
- createComponent(Resizable.Panel, {
52
- minSize: MIN_SPLIT_RATIO,
53
- maxSize: MAX_SPLIT_RATIO,
54
- "aria-hidden": "true"
55
- })
56
- ];
57
- }
58
- });
9
+ const [container, setContainer] = createSignal();
10
+ let activePointer;
11
+ const horizontal = () => props.branch().direction === "row";
12
+ const resizeTo = (ratio) => {
13
+ const root = props.root();
14
+ if (!root?.isConnected || root.getClientRects().length === 0) return;
15
+ const next = Math.min(MAX_SPLIT_RATIO, Math.max(MIN_SPLIT_RATIO, ratio));
16
+ if (Number.isFinite(next) && Math.abs(next - props.branch().ratio) > 1e-6) props.onResize(props.branch().id, next);
17
+ };
18
+ const stopDrag = (handle, event) => {
19
+ if (activePointer !== event.pointerId) return;
20
+ activePointer = void 0;
21
+ handle.removeAttribute("data-dragging");
22
+ if (handle.hasPointerCapture(event.pointerId)) handle.releasePointerCapture(event.pointerId);
23
+ };
24
+ return (() => {
25
+ var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
26
+ use(setContainer, _el$);
27
+ _el$2.addEventListener("lostpointercapture", (event) => stopDrag(event.currentTarget, event));
28
+ _el$2.addEventListener("pointercancel", (event) => stopDrag(event.currentTarget, event));
29
+ _el$2.$$pointerup = (event) => stopDrag(event.currentTarget, event);
30
+ _el$2.$$pointermove = (event) => {
31
+ const element = container();
32
+ if (activePointer !== event.pointerId || !element) return;
33
+ const box = element.getBoundingClientRect();
34
+ const size = horizontal() ? box.width : box.height;
35
+ if (size <= 0) return;
36
+ resizeTo((horizontal() ? event.clientX - box.left : event.clientY - box.top) / size);
37
+ };
38
+ _el$2.$$pointerdown = (event) => {
39
+ if (event.button !== 0 || activePointer !== void 0) return;
40
+ activePointer = event.pointerId;
41
+ event.currentTarget.setPointerCapture(event.pointerId);
42
+ event.currentTarget.setAttribute("data-dragging", "");
43
+ event.preventDefault();
44
+ };
45
+ _el$2.$$keydown = (event) => {
46
+ const forward = horizontal() ? "ArrowRight" : "ArrowDown";
47
+ const backward = horizontal() ? "ArrowLeft" : "ArrowUp";
48
+ const current = props.branch().ratio;
49
+ let next;
50
+ if (event.key === forward) next = current + KEYBOARD_DELTA;
51
+ else if (event.key === backward) next = current - KEYBOARD_DELTA;
52
+ else if (event.key === "Home") next = MIN_SPLIT_RATIO;
53
+ else if (event.key === "End") next = MAX_SPLIT_RATIO;
54
+ else return;
55
+ event.preventDefault();
56
+ resizeTo(next);
57
+ };
58
+ effect((_p$) => {
59
+ var _v$ = props.rect(), _v$2 = horizontal() ? "horizontal" : "vertical", _v$3 = props.labelForSeparator?.(props.branch()) ?? (horizontal() ? "Resize pane columns" : "Resize pane rows"), _v$4 = horizontal() ? "vertical" : "horizontal", _v$5 = listLeaves(props.branch()).map((leaf) => props.domId(leaf.id)).join(" "), _v$6 = Math.round(props.branch().ratio * 100), _v$7 = horizontal() ? {
60
+ left: `${props.branch().ratio * 100}%`,
61
+ top: 0,
62
+ bottom: 0,
63
+ width: "1px"
64
+ } : {
65
+ top: `${props.branch().ratio * 100}%`,
66
+ left: 0,
67
+ right: 0,
68
+ height: "1px"
69
+ };
70
+ _p$.e = style(_el$, _v$, _p$.e);
71
+ _v$2 !== _p$.t && setAttribute(_el$2, "data-orientation", _p$.t = _v$2);
72
+ _v$3 !== _p$.a && setAttribute(_el$2, "aria-label", _p$.a = _v$3);
73
+ _v$4 !== _p$.o && setAttribute(_el$2, "aria-orientation", _p$.o = _v$4);
74
+ _v$5 !== _p$.i && setAttribute(_el$2, "aria-controls", _p$.i = _v$5);
75
+ _v$6 !== _p$.n && setAttribute(_el$2, "aria-valuenow", _p$.n = _v$6);
76
+ _p$.s = style(_el$2, _v$7, _p$.s);
77
+ return _p$;
78
+ }, {
79
+ e: void 0,
80
+ t: void 0,
81
+ a: void 0,
82
+ o: void 0,
83
+ i: void 0,
84
+ n: void 0,
85
+ s: void 0
86
+ });
87
+ return _el$;
88
+ })();
59
89
  }
90
+ delegateEvents([
91
+ "keydown",
92
+ "pointerdown",
93
+ "pointermove",
94
+ "pointerup"
95
+ ]);
60
96
  //#endregion
61
97
  export { SplitLayoutResizeController as default };
62
98
 
@@ -1 +1 @@
1
- {"version":3,"file":"resize-controller-core-retry.js","names":["Resizable","Accessor","JSX","listLeaves","MIN_SPLIT_RATIO","MAX_SPLIT_RATIO","SplitLayoutBranch","SplitLayoutLeaf","SplitLayoutResizeControllerProps","branch","L","rect","CSSProperties","domId","id","root","HTMLDivElement","labelForSeparator","onResize","splitId","ratio","SplitLayoutResizeController","props","_$createComponent","orientation","direction","sizes","keyboardDelta","onSizesChange","isConnected","getClientRects","length","some","size","Number","isFinite","Math","abs","undefined","style","children","Panel","minSize","maxSize","Handle","aria-label","aria-orientation","aria-controls","map","leaf","join","aria-valuenow","round","_$createComponent"],"sources":["../../../../src/components/layout/split-layout/resize-controller-core-retry.tsx"],"sourcesContent":["import Resizable from '@corvu/resizable'\nimport { type Accessor, type JSX } from 'solid-js'\nimport {\n listLeaves,\n MIN_SPLIT_RATIO,\n MAX_SPLIT_RATIO,\n type SplitLayoutBranch,\n type SplitLayoutLeaf,\n} from './model'\n\nexport type SplitLayoutResizeControllerProps<L extends SplitLayoutLeaf> = {\n branch: Accessor<SplitLayoutBranch<L>>\n rect: Accessor<JSX.CSSProperties>\n domId: (id: string) => string\n root: () => HTMLDivElement | undefined\n labelForSeparator?: (branch: SplitLayoutBranch<L>) => string\n onResize: (splitId: string, ratio: number) => void\n}\n\n/** Corvu stays behind the first real split while the pane owners remain mounted. */\nexport default function SplitLayoutResizeController<L extends SplitLayoutLeaf>(\n props: SplitLayoutResizeControllerProps<L>\n) {\n const id = () => props.branch().id\n return (\n <Resizable\n orientation={props.branch().direction === 'row' ? 'horizontal' : 'vertical'}\n sizes={[props.branch().ratio, 1 - props.branch().ratio]}\n keyboardDelta={0.05}\n onSizesChange={(sizes) => {\n // Corvu also reports panel registration/unregistration while\n // mounting or disposing a controller. Those incomplete or\n // hidden-host sizes are not user resize intent.\n const root = props.root()\n if (!root?.isConnected || root.getClientRects().length === 0) return\n if (\n sizes.length !== 2 ||\n sizes.some((size) => !Number.isFinite(size)) ||\n Math.abs(sizes[0]! + sizes[1]! - 1) > 0.000001\n )\n return\n if (sizes[0] !== undefined && Math.abs(sizes[0] - props.branch().ratio) > 0.000001)\n props.onResize(id(), sizes[0])\n }}\n style={props.rect()}\n class=\"pointer-events-none absolute flex min-h-0 min-w-0 data-[orientation=vertical]:flex-col\"\n >\n <Resizable.Panel minSize={MIN_SPLIT_RATIO} maxSize={MAX_SPLIT_RATIO} aria-hidden=\"true\" />\n <Resizable.Handle\n aria-label={\n props.labelForSeparator?.(props.branch()) ??\n (props.branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={props.branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(props.branch())\n .map((leaf) => props.domId(leaf.id))\n .join(' ')}\n aria-valuemin={10}\n aria-valuemax={90}\n aria-valuenow={Math.round(props.branch().ratio * 100)}\n class=\"pointer-events-auto relative w-px shrink-0 bg-border after:absolute after:inset-y-0 after:-inset-x-1 after:w-3 focus-visible:bg-primary focus-visible:outline-none hover:bg-primary data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:inset-x-0 data-[orientation=vertical]:after:-inset-y-1 data-[orientation=vertical]:after:h-3 data-[orientation=vertical]:after:w-full\"\n />\n <Resizable.Panel minSize={MIN_SPLIT_RATIO} maxSize={MAX_SPLIT_RATIO} aria-hidden=\"true\" />\n </Resiz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A;MAAA,OACjEtB,WAAWmB,MAAMb,OAAO,CAAC,CAAC,CACtCuC,KAAKC,SAAS3B,MAAMT,MAAMoC,KAAKnC,EAAE,CAAC,CAAC,CACnCoC,KAAK,GAAG;KAAC;KAAA,iBACG;KAAE,iBACF;KAAE,KAAA,mBAAA;MAAA,OACFd,KAAKgB,MAAM9B,MAAMb,OAAO,CAAC,CAACW,QAAQ,GAAG;KAAC;KAAA,SAAA;IAAA,CAAA;IAAAG,gBAGtDvB,UAAUyC,OAAK;KAACC,SAAStC;KAAiBuC,SAAStC;KAAe,eAAA;IAAA,CAAA;GAAA;EAAA;CAAA,CAAA;AAGzE"}
1
+ {"version":3,"file":"resize-controller-core-retry.js","names":["createSignal","Accessor","JSX","listLeaves","MIN_SPLIT_RATIO","MAX_SPLIT_RATIO","SplitLayoutBranch","SplitLayoutLeaf","SplitLayoutResizeControllerProps","branch","L","rect","CSSProperties","domId","id","root","HTMLDivElement","labelForSeparator","onResize","splitId","ratio","KEYBOARD_DELTA","SplitLayoutResizeController","props","container","setContainer","activePointer","horizontal","direction","resizeTo","isConnected","getClientRects","length","next","Math","min","max","Number","isFinite","abs","stopDrag","handle","HTMLElement","event","PointerEvent","pointerId","undefined","removeAttribute","hasPointerCapture","releasePointerCapture","_el$","_tmpl$","_el$2","firstChild","_$use","addEventListener","currentTarget","$$pointerup","$$pointermove","element","box","getBoundingClientRect","size","width","height","clientX","left","clientY","top","$$pointerdown","button","setPointerCapture","setAttribute","preventDefault","$$keydown","forward","backward","current","key","_$effect","_p$","_v$","_v$2","_v$3","_v$4","_v$5","map","leaf","join","_v$6","round","_v$7","bottom","right","e","_$style","t","_$setAttribute","a","o","i","n","s","_$delegateEvents","_$style","_$setAttribute","_$delegateEvents"],"sources":["../../../../src/components/layout/split-layout/resize-controller-core-retry.tsx"],"sourcesContent":["import { createSignal, type Accessor, type JSX } from 'solid-js'\nimport {\n listLeaves,\n MIN_SPLIT_RATIO,\n MAX_SPLIT_RATIO,\n type SplitLayoutBranch,\n type SplitLayoutLeaf,\n} from './model'\n\nexport type SplitLayoutResizeControllerProps<L extends SplitLayoutLeaf> = {\n branch: Accessor<SplitLayoutBranch<L>>\n rect: Accessor<JSX.CSSProperties>\n domId: (id: string) => string\n root: () => HTMLDivElement | undefined\n labelForSeparator?: (branch: SplitLayoutBranch<L>) => string\n onResize: (splitId: string, ratio: number) => void\n}\n\nconst KEYBOARD_DELTA = 0.05\n\n/** The divider stays behind the first real split while the pane owners remain mounted. */\nexport default function SplitLayoutResizeController<L extends SplitLayoutLeaf>(\n props: SplitLayoutResizeControllerProps<L>\n) {\n const [container, setContainer] = createSignal<HTMLDivElement>()\n let activePointer: number | undefined\n const horizontal = () => props.branch().direction === 'row'\n\n const resizeTo = (ratio: number) => {\n // A hidden or detached host reports no usable geometry; that is not\n // user resize intent.\n const root = props.root()\n if (!root?.isConnected || root.getClientRects().length === 0) return\n const next = Math.min(MAX_SPLIT_RATIO, Math.max(MIN_SPLIT_RATIO, ratio))\n if (Number.isFinite(next) && Math.abs(next - props.branch().ratio) > 0.000001)\n props.onResize(props.branch().id, next)\n }\n const stopDrag = (handle: HTMLElement, event: PointerEvent) => {\n if (activePointer !== event.pointerId) return\n activePointer = undefined\n handle.removeAttribute('data-dragging')\n if (handle.hasPointerCapture(event.pointerId)) handle.releasePointerCapture(event.pointerId)\n }\n\n return (\n <div\n ref={setContainer}\n style={props.rect()}\n class=\"pointer-events-none absolute min-h-0 min-w-0\"\n >\n <div\n role=\"separator\"\n tabIndex={0}\n data-split-layout-handle=\"\"\n data-orientation={horizontal() ? 'horizontal' : 'vertical'}\n aria-label={\n props.labelForSeparator?.(props.branch()) ??\n (horizontal() ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={horizontal() ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(props.branch())\n .map((leaf) => props.domId(leaf.id))\n .join(' ')}\n aria-valuemin={10}\n aria-valuemax={90}\n aria-valuenow={Math.round(props.branch().ratio * 100)}\n style={\n horizontal()\n ? { left: `${props.branch().ratio * 100}%`, top: 0, bottom: 0, width: '1px' }\n : { top: `${props.branch().ratio * 100}%`, left: 0, right: 0, height: '1px' }\n }\n onKeyDown={(event) => {\n const forward = horizontal() ? 'ArrowRight' : 'ArrowDown'\n const backward = horizontal() ? 'ArrowLeft' : 'ArrowUp'\n const current = props.branch().ratio\n let next: number\n if (event.key === forward) next = current + KEYBOARD_DELTA\n else if (event.key === backward) next = current - KEYBOARD_DELTA\n else if (event.key === 'Home') next = MIN_SPLIT_RATIO\n else if (event.key === 'End') next = MAX_SPLIT_RATIO\n else return\n event.preventDefault()\n resizeTo(next)\n }}\n onPointerDown={(event) => {\n if (event.button !== 0 || activePointer !== undefined) return\n activePointer = event.pointerId\n event.currentTarget.setPointerCapture(event.pointerId)\n event.currentTarget.setAttribute('data-dragging', '')\n event.preventDefault()\n }}\n onPointerMove={(event) => {\n const element = container()\n if (activePointer !== event.pointerId || !element) return\n const box = element.getBoundingClientRect()\n const size = horizontal() ? box.width : box.height\n if (size <= 0) return\n resizeTo((horizontal() ? event.clientX - box.left : event.clientY - box.top) / size)\n }}\n onPointerUp={(event) => stopDrag(event.currentTarget, event)}\n onPointerCancel={(event) => stopDrag(event.currentTarget, event)}\n onLostPointerCapture={(event) => stopDrag(event.currentTarget, event)}\n class=\"pointer-events-auto absolute shrink-0 bg-border after:absolute after:inset-y-0 after:-inset-x-1 after:w-3 focus-visible:bg-primary focus-visible:outline-none hover:bg-primary data-[orientation=vertical]:after:inset-x-0 data-[orientation=vertical]:after:-inset-y-1 data-[orientation=vertical]:after:h-3 data-[orientation=vertical]:after:w-full\"\n />\n </div>\n )\n}\n"],"mappings":";;;;;AAkBA,IAAMqB,iBAAiB;;AAGvB,SAAwBC,4BACtBC,OACA;CACA,MAAM,CAACC,WAAWC,gBAAgBzB,aAA6B;CAC/D,IAAI0B;CACJ,MAAMC,mBAAmBJ,MAAMd,OAAO,CAAC,CAACmB,cAAc;CAEtD,MAAMC,YAAYT,UA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