@singapore-editor/panes 0.1.1 → 0.2.10

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shaul Lavo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # @singapore-editor/panes
2
2
 
3
- Small DOM utility for resizable pane groups.
3
+ Resizable split panes for browser DOM elements.
4
+
5
+ Part of [Singapore](https://singapore.shaulavo.dev/). A code editor for the browser that keeps every version.
4
6
 
5
7
  ## Install
6
8
 
@@ -12,19 +14,34 @@ npm install @singapore-editor/panes
12
14
 
13
15
  ```ts
14
16
  import { ResizablePaneGroup } from '@singapore-editor/panes'
15
- import '@singapore-editor/panes/style.css'
16
17
 
17
- const group = new ResizablePaneGroup(document.querySelector('#panes')!, {
18
+ const host = document.createElement('div')
19
+ host.style.cssText = 'height: 400px; width: 100%'
20
+ document.body.append(host)
21
+ const group = new ResizablePaneGroup(host, {
18
22
  orientation: 'horizontal',
19
23
  panes: [
20
- { id: 'left', element: document.querySelector('#left')!, defaultSize: 40 },
21
- { id: 'right', element: document.querySelector('#right')!, defaultSize: 60 },
24
+ { id: 'files', element: document.createElement('div'), defaultSize: 30 },
25
+ { id: 'editor', element: document.createElement('div') },
22
26
  ],
23
27
  })
28
+ // Call group.dispose() when removing the panes.
24
29
  ```
25
30
 
26
- ## Exports
31
+ ## API highlights
32
+
33
+ - `ResizablePaneGroup` owns panes and drag handles.
34
+ - `getLayout()` reads sizes by pane ID.
35
+ - `setLayout()` changes the split.
36
+
37
+ [Generated API reference](https://singapore.shaulavo.dev/docs/reference/api/panes/overview/)
38
+
39
+ ## In the Singapore family
40
+
41
+ You can use this package on its own. `@singapore-editor/core` owns editor views; optional packages add syntax, search, gutters, and language features.
42
+
43
+ [Singapore README](https://github.com/ShaulLavo/singapore/blob/main/README.md) · [Documentation](https://singapore.shaulavo.dev/docs/start-here/introduction/)
44
+
45
+ ## License
27
46
 
28
- - `ResizablePaneGroup` mounts accessible split handles and manages percentage layouts.
29
- - `ResizablePaneGroupOptions`, `ResizablePaneLayout`, and related types describe pane and handle
30
- configuration.
47
+ MIT. [License](https://github.com/ShaulLavo/singapore/blob/main/LICENSE)
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type BrowserDispatcher, type FocusNode } from '@shaulavo/hotkeys';
1
2
  import './style.css';
2
3
  export type ResizablePaneOrientation = 'horizontal' | 'vertical';
3
4
  export type ResizablePaneLayout = Readonly<Record<string, number>>;
@@ -20,6 +21,8 @@ export type ResizablePaneHandleContext = {
20
21
  };
21
22
  export type ResizablePaneHandleFactory = (context: ResizablePaneHandleContext) => HTMLElement;
22
23
  export type ResizablePaneGroupOptions = {
24
+ readonly hotkeys?: BrowserDispatcher;
25
+ readonly hotkeysParent?: FocusNode<KeyboardEvent>;
23
26
  readonly id?: string;
24
27
  readonly orientation?: ResizablePaneOrientation;
25
28
  readonly panes: readonly ResizablePane[];
@@ -30,6 +33,39 @@ export type ResizablePaneGroupOptions = {
30
33
  readonly keyboardStep?: number;
31
34
  readonly disabled?: boolean;
32
35
  };
36
+ export declare const paneHandlePack: readonly [{
37
+ readonly keys: 'F6';
38
+ readonly command: 'panes.focusNextHandle';
39
+ readonly context: 'PaneHandle && !DisabledPane';
40
+ }, {
41
+ readonly keys: 'Shift+F6';
42
+ readonly command: 'panes.focusPreviousHandle';
43
+ readonly context: 'PaneHandle && !DisabledPane';
44
+ }, {
45
+ readonly keys: 'ArrowLeft';
46
+ readonly command: 'panes.resizeSmaller';
47
+ readonly context: 'PaneHandle && HorizontalPane && !DisabledPane';
48
+ }, {
49
+ readonly keys: 'ArrowRight';
50
+ readonly command: 'panes.resizeLarger';
51
+ readonly context: 'PaneHandle && HorizontalPane && !DisabledPane';
52
+ }, {
53
+ readonly keys: 'ArrowUp';
54
+ readonly command: 'panes.resizeSmaller';
55
+ readonly context: 'PaneHandle && VerticalPane && !DisabledPane';
56
+ }, {
57
+ readonly keys: 'ArrowDown';
58
+ readonly command: 'panes.resizeLarger';
59
+ readonly context: 'PaneHandle && VerticalPane && !DisabledPane';
60
+ }, {
61
+ readonly keys: 'Home';
62
+ readonly command: 'panes.resizeMinimum';
63
+ readonly context: 'PaneHandle && !DisabledPane';
64
+ }, {
65
+ readonly keys: 'End';
66
+ readonly command: 'panes.resizeMaximum';
67
+ readonly context: 'PaneHandle && !DisabledPane';
68
+ }];
33
69
  export declare class ResizablePaneGroup {
34
70
  private readonly container;
35
71
  private readonly document;
@@ -39,6 +75,9 @@ export declare class ResizablePaneGroup {
39
75
  private readonly disabled;
40
76
  private readonly panes;
41
77
  private readonly handles;
78
+ private readonly hotkeys;
79
+ private readonly hotkeysParent?;
80
+ private readonly ownHotkeys;
42
81
  private readonly onDocumentPointerMove;
43
82
  private readonly onDocumentPointerUp;
44
83
  private readonly onLayoutChange?;
@@ -56,7 +95,7 @@ export declare class ResizablePaneGroup {
56
95
  private handlePointerDown;
57
96
  private handleDocumentPointerMove;
58
97
  private handleDocumentPointerUp;
59
- private handleKeyDown;
98
+ private resizeHandle;
60
99
  private focusSiblingHandle;
61
100
  private applyHandleDelta;
62
101
  private applyLayout;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,UAAU,CAAA;AAEhE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAElE,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,wBAAwB,CAAA;CAC/C,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,EAAE,0BAA0B,KAAK,WAAW,CAAA;A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W,EAAE,OAAO,EAAE,yBAAyB,EAmB5E;IAEM,SAAS,IAAI,mBAAmB,CAEtC;IAEM,SAAS,CAAC,MAAM,EAAE,mBAAmB,GAAG,mBAAmB,CAMjE;IAEM,OAAO,IAAI,IAAI,CAUrB;IAED,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,WAAW;IAsBnB,OAAO,CAAC,mBAAmB;IAoC3B,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,yBAAyB;IAWjC,OAAO,CAAC,uBAAuB;IAY/B,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,4BAA4B;IAKpC,OAAO,CAAC,8BAA8B;CAIvC"}
package/dist/index.js CHANGED
@@ -1,5 +1,48 @@
1
+ import { createBrowserDispatcher } from "@shaulavo/hotkeys";
1
2
  import "./style.css";
2
- //#region src/index.ts
3
+ // src/index.ts
4
+ var paneHandlePack = [
5
+ {
6
+ keys: "F6",
7
+ command: "panes.focusNextHandle",
8
+ context: "PaneHandle && !DisabledPane"
9
+ },
10
+ {
11
+ keys: "Shift+F6",
12
+ command: "panes.focusPreviousHandle",
13
+ context: "PaneHandle && !DisabledPane"
14
+ },
15
+ {
16
+ keys: "ArrowLeft",
17
+ command: "panes.resizeSmaller",
18
+ context: "PaneHandle && HorizontalPane && !DisabledPane"
19
+ },
20
+ {
21
+ keys: "ArrowRight",
22
+ command: "panes.resizeLarger",
23
+ context: "PaneHandle && HorizontalPane && !DisabledPane"
24
+ },
25
+ {
26
+ keys: "ArrowUp",
27
+ command: "panes.resizeSmaller",
28
+ context: "PaneHandle && VerticalPane && !DisabledPane"
29
+ },
30
+ {
31
+ keys: "ArrowDown",
32
+ command: "panes.resizeLarger",
33
+ context: "PaneHandle && VerticalPane && !DisabledPane"
34
+ },
35
+ {
36
+ keys: "Home",
37
+ command: "panes.resizeMinimum",
38
+ context: "PaneHandle && !DisabledPane"
39
+ },
40
+ {
41
+ keys: "End",
42
+ command: "panes.resizeMaximum",
43
+ context: "PaneHandle && !DisabledPane"
44
+ }
45
+ ];
3
46
  var DEFAULT_KEYBOARD_STEP = 5;
4
47
  var FLOAT_TOLERANCE = .001;
5
48
  var nextPaneGroupId = 0;
@@ -12,6 +55,9 @@ var ResizablePaneGroup = class {
12
55
  disabled;
13
56
  panes;
14
57
  handles = [];
58
+ hotkeys;
59
+ hotkeysParent;
60
+ ownHotkeys;
15
61
  onDocumentPointerMove = (event) => {
16
62
  this.handleDocumentPointerMove(event);
17
63
  };
@@ -25,6 +71,10 @@ var ResizablePaneGroup = class {
25
71
  layout;
26
72
  constructor(container, options) {
27
73
  this.container = container;
74
+ this.hotkeys = options.hotkeys ?? createBrowserDispatcher({ root: container });
75
+ this.hotkeysParent = options.hotkeysParent;
76
+ this.ownHotkeys = !options.hotkeys;
77
+ if (this.ownHotkeys) this.hotkeys.setKeymap(paneHandlePack);
28
78
  this.document = container.ownerDocument;
29
79
  this.groupId = options.id ?? `editor-pane-group-${nextPaneGroupId++}`;
30
80
  this.orientation = options.orientation ?? "horizontal";
@@ -53,6 +103,7 @@ var ResizablePaneGroup = class {
53
103
  this.uninstallDocumentDragListeners();
54
104
  for (const handle of this.handles) disposeHandle(handle);
55
105
  this.handles.length = 0;
106
+ if (this.ownHotkeys) this.hotkeys.dispose();
56
107
  for (const pane of this.panes) unmountPane(pane);
57
108
  unmountContainer(this.container);
58
109
  }
@@ -87,14 +138,29 @@ var ResizablePaneGroup = class {
87
138
  id,
88
139
  element,
89
140
  index,
90
- onKeyDown: (event) => this.handleKeyDown(handle, event),
141
+ disposeHotkeys: () => {
142
+ detach();
143
+ node.remove();
144
+ },
91
145
  onPointerDown: (event) => this.handlePointerDown(handle, event),
92
146
  onPointerEnter: () => setHandleState(handle, "hover"),
93
147
  onPointerLeave: () => setHandleState(handle, "inactive"),
94
148
  onBlur: () => setHandleState(handle, "inactive"),
95
149
  onFocus: () => setHandleState(handle, "focus")
96
150
  };
97
- element.addEventListener("keydown", handle.onKeyDown);
151
+ const node = this.hotkeys.createNode({
152
+ parent: this.hotkeysParent,
153
+ context: `PaneHandle ${this.orientation === "horizontal" ? "HorizontalPane" : "VerticalPane"} ${this.disabled ? "DisabledPane" : ""}`,
154
+ commands: {
155
+ "panes.focusNextHandle": () => this.focusSiblingHandle(handle, false),
156
+ "panes.focusPreviousHandle": () => this.focusSiblingHandle(handle, true),
157
+ "panes.resizeSmaller": () => this.resizeHandle(handle, -this.keyboardStep),
158
+ "panes.resizeLarger": () => this.resizeHandle(handle, this.keyboardStep),
159
+ "panes.resizeMinimum": () => this.resizeHandle(handle, -100),
160
+ "panes.resizeMaximum": () => this.resizeHandle(handle, 100)
161
+ }
162
+ });
163
+ const detach = this.hotkeys.attachElement(node, element);
98
164
  element.addEventListener("pointerdown", handle.onPointerDown);
99
165
  element.addEventListener("pointerenter", handle.onPointerEnter);
100
166
  element.addEventListener("pointerleave", handle.onPointerLeave);
@@ -140,17 +206,10 @@ var ResizablePaneGroup = class {
140
206
  setHandleState(drag.handle, "focus");
141
207
  if (drag.changed) this.onLayoutChanged?.(this.getLayout());
142
208
  }
143
- handleKeyDown(handle, event) {
144
- if (this.disabled) return;
145
- if (event.key === "F6") {
146
- event.preventDefault();
147
- this.focusSiblingHandle(handle, event.shiftKey);
148
- return;
149
- }
150
- const delta = keyboardDelta(event, this.orientation, this.keyboardStep);
151
- if (delta === null) return;
152
- event.preventDefault();
209
+ resizeHandle(handle, delta) {
210
+ if (this.disabled) return false;
153
211
  if (this.applyHandleDelta(handle.index, delta, this.layout, "both")) setHandleState(handle, "focus");
212
+ return true;
154
213
  }
155
214
  focusSiblingHandle(handle, reverse) {
156
215
  nextFocusableHandle(this.handles, handle, reverse)?.element.focus({ preventScroll: true });
@@ -285,7 +344,7 @@ function applyHandleOrientationStyle(element, orientation, disabled) {
285
344
  element.style.cursor = disabled ? "default" : "ns-resize";
286
345
  }
287
346
  function disposeHandle(handle) {
288
- handle.element.removeEventListener("keydown", handle.onKeyDown);
347
+ handle.disposeHotkeys();
289
348
  handle.element.removeEventListener("pointerdown", handle.onPointerDown);
290
349
  handle.element.removeEventListener("pointerenter", handle.onPointerEnter);
291
350
  handle.element.removeEventListener("pointerleave", handle.onPointerLeave);
@@ -472,22 +531,6 @@ function calculateHandleAria(options) {
472
531
  now
473
532
  };
474
533
  }
475
- function keyboardDelta(event, orientation, keyboardStep) {
476
- if (event.key === "Home") return -100;
477
- if (event.key === "End") return 100;
478
- if (orientation === "horizontal") return horizontalKeyboardDelta(event.key, keyboardStep);
479
- return verticalKeyboardDelta(event.key, keyboardStep);
480
- }
481
- function horizontalKeyboardDelta(key, keyboardStep) {
482
- if (key === "ArrowLeft") return -keyboardStep;
483
- if (key === "ArrowRight") return keyboardStep;
484
- return null;
485
- }
486
- function verticalKeyboardDelta(key, keyboardStep) {
487
- if (key === "ArrowUp") return -keyboardStep;
488
- if (key === "ArrowDown") return keyboardStep;
489
- return null;
490
- }
491
534
  function nextFocusableHandle(handles, current, reverse) {
492
535
  if (handles.length === 0) return null;
493
536
  const index = handles.indexOf(current);
@@ -558,7 +601,6 @@ function releasePointer(element, event) {
558
601
  if (typeof event.pointerId !== "number") return;
559
602
  element.releasePointerCapture?.(event.pointerId);
560
603
  }
561
- //#endregion
562
- export { ResizablePaneGroup };
604
+ export { ResizablePaneGroup, paneHandlePack };
563
605
 
564
606
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import './style.css'\n\nexport type ResizablePaneOrientation = 'horizontal' | 'vertical'\n\nexport type ResizablePaneLayout = Readonly<Record<string, number>>\n\nexport type ResizablePane = {\n readonly id: string\n readonly element: HTMLElement\n readonly defaultSize?: number\n readonly minSize?: number\n readonly maxSize?: number\n readonly disabled?: boolean\n}\n\nexport type ResizablePaneHandleContext = {\n readonly document: Document\n readonly groupId: string\n readonly handleId: string\n readonly index: number\n readonly beforePaneId: string\n readonly afterPaneId: string\n readonly orientation: ResizablePaneOrientation\n}\n\nexport type ResizablePaneHandleFactory = (context: ResizablePaneHandleContext) => HTMLElement\n\nexport type ResizablePaneGroupOptions = {\n readonly id?: string\n readonly orientation?: ResizablePaneOrientation\n readonly panes: readonly ResizablePane[]\n readonly defaultLayout?: ResizablePaneLayout\n readonly createHandle?: ResizablePaneHandleFactory\n readonly onLayoutChange?: (layout: ResizablePaneLayout) => void\n readonly onLayoutChanged?: (layout: ResizablePaneLayout) => void\n readonly keyboardStep?: number\n readonly disabled?: boolean\n}\n\ntype NormalizedPane = {\n readonly id: string\n readonly element: HTMLElement\n readonly defaultSize?: number\n readonly minSize: number\n readonly maxSize: number\n readonly disabled: boolean\n}\n\ntype MountedHandle = {\n readonly id: string\n readonly element: HTMLElement\n readonly index: number\n readonly onKeyDown: (event: KeyboardEvent) => void\n readonly onPointerDown: (event: PointerEvent) => void\n readonly onPointerEnter: () => void\n readonly onPointerLeave: () => void\n readonly onBlur: () => void\n readonly onFocus: () => void\n}\n\ntype DragState = {\n readonly handle: MountedHandle\n readonly initialLayout: ResizablePaneLayout\n readonly pointerId: number | null\n readonly startX: number\n readonly startY: number\n readonly groupSize: number\n changed: boolean\n}\n\ntype LayoutApplyMode = 'silent' | 'change' | 'changed' | 'both'\n\nconst DEFAULT_KEYBOARD_STEP = 5\nconst FLOAT_TOLERANCE = 0.001\nlet nextPaneGroupId = 0\n\nexport class ResizablePaneGroup {\n private readonly container: HTMLElement\n private readonly document: Document\n private readonly groupId: string\n private readonly orientation: ResizablePaneOrientation\n private readonly keyboardStep: number\n private readonly disabled: boolean\n private readonly panes: readonly NormalizedPane[]\n private readonly handles: MountedHandle[] = []\n private readonly onDocumentPointerMove = (event: PointerEvent): void => {\n this.handleDocumentPointerMove(event)\n }\n private readonly onDocumentPointerUp = (event: PointerEvent): void => {\n this.handleDocumentPointerUp(event)\n }\n private readonly onLayoutChange?: (layout: ResizablePaneLayout) => void\n private readonly onLayoutChanged?: (layout: ResizablePaneLayout) => void\n private dragState: DragState | null = null\n private disposed = false\n private layout: ResizablePaneLayout\n\n public constructor(container: HTMLElement, options: ResizablePaneGroupOptions) {\n this.container = container\n this.document = container.ownerDocument\n this.groupId = options.id ?? `editor-pane-group-${nextPaneGroupId++}`\n this.orientation = options.orientation ?? 'horizontal'\n this.keyboardStep = normalizeKeyboardStep(options.keyboardStep)\n this.disabled = options.disabled === true\n this.onLayoutChange = options.onLayoutChange\n this.onLayoutChanged = options.onLayoutChanged\n this.panes = normalizePanes(options.panes)\n this.layout = createInitialLayout(this.panes, options.defaultLayout)\n\n mountContainer(this.container, this.groupId, this.orientation)\n this.mountPanesAndHandles(options.createHandle)\n this.applyLayout(this.layout, 'silent')\n }\n\n public getLayout(): ResizablePaneLayout {\n return { ...this.layout }\n }\n\n public setLayout(layout: ResizablePaneLayout): ResizablePaneLayout {\n if (this.disposed) return this.getLayout()\n\n const nextLayout = normalizeLayout(layout, this.panes)\n this.applyLayout(nextLayout, 'both')\n return this.getLayout()\n }\n\n public dispose(): void {\n if (this.disposed) return\n\n this.disposed = true\n this.uninstallDocumentDragListeners()\n for (const handle of this.handles) disposeHandle(handle)\n this.handles.length = 0\n for (const pane of this.panes) unmountPane(pane)\n unmountContainer(this.container)\n }\n\n private mountPanesAndHandles(createHandle: ResizablePaneHandleFactory | undefined): void {\n for (const [index, pane] of this.panes.entries()) {\n mountPane(this.container, pane, this.groupId, index)\n if (index === 0) continue\n this.mountHandle(index - 1, createHandle)\n }\n }\n\n private mountHandle(index: number, createHandle: ResizablePaneHandleFactory | undefined): void {\n const beforePane = this.panes[index]\n const afterPane = this.panes[index + 1]\n if (!beforePane || !afterPane) return\n\n const handleId = `${this.groupId}-handle-${index}`\n const element =\n createHandle?.({\n document: this.document,\n groupId: this.groupId,\n handleId,\n index,\n beforePaneId: beforePane.id,\n afterPaneId: afterPane.id,\n orientation: this.orientation,\n }) ?? createDefaultHandle(this.document)\n const handle = this.createMountedHandle(element, handleId, index)\n this.handles.push(handle)\n configureHandle(handle, this.separatorOrientation(), this.disabled)\n this.container.insertBefore(element, afterPane.element)\n }\n\n private createMountedHandle(element: HTMLElement, id: string, index: number): MountedHandle {\n const handle: MountedHandle = {\n id,\n element,\n index,\n onKeyDown: (event) => this.handleKeyDown(handle, event),\n onPointerDown: (event) => this.handlePointerDown(handle, event),\n onPointerEnter: () => setHandleState(handle, 'hover'),\n onPointerLeave: () => setHandleState(handle, 'inactive'),\n onBlur: () => setHandleState(handle, 'inactive'),\n onFocus: () => setHandleState(handle, 'focus'),\n }\n element.addEventListener('keydown', handle.onKeyDown)\n element.addEventListener('pointerdown', handle.onPointerDown)\n element.addEventListener('pointerenter', handle.onPointerEnter)\n element.addEventListener('pointerleave', handle.onPointerLeave)\n element.addEventListener('blur', handle.onBlur)\n element.addEventListener('focus', handle.onFocus)\n return handle\n }\n\n private handlePointerDown(handle: MountedHandle, event: PointerEvent): void {\n if (!this.canStartInteraction(event)) return\n\n const groupSize = this.groupSize()\n if (groupSize <= 0) return\n\n event.preventDefault()\n handle.element.focus({ preventScroll: true })\n setHandleState(handle, 'dragging')\n this.dragState = {\n handle,\n initialLayout: this.getLayout(),\n pointerId: pointerIdFromEvent(event),\n startX: event.clientX,\n startY: event.clientY,\n groupSize,\n changed: false,\n }\n capturePointer(handle.element, event)\n this.installDocumentDragListeners()\n }\n\n private handleDocumentPointerMove(event: PointerEvent): void {\n const drag = this.dragState\n if (!drag) return\n if (!matchesPointer(drag, event)) return\n\n event.preventDefault()\n const delta = this.pointerDeltaPercent(drag, event)\n const changed = this.applyHandleDelta(drag.handle.index, delta, drag.initialLayout, 'change')\n drag.changed ||= changed\n }\n\n private handleDocumentPointerUp(event: PointerEvent): void {\n const drag = this.dragState\n if (!drag) return\n if (!matchesPointer(drag, event)) return\n\n this.dragState = null\n this.uninstallDocumentDragListeners()\n releasePointer(drag.handle.element, event)\n setHandleState(drag.handle, 'focus')\n if (drag.changed) this.onLayoutChanged?.(this.getLayout())\n }\n\n private handleKeyDown(handle: MountedHandle, event: KeyboardEvent): void {\n if (this.disabled) return\n if (event.key === 'F6') {\n event.preventDefault()\n this.focusSiblingHandle(handle, event.shiftKey)\n return\n }\n\n const delta = keyboardDelta(event, this.orientation, this.keyboardStep)\n if (delta === null) return\n\n event.preventDefault()\n const changed = this.applyHandleDelta(handle.index, delta, this.layout, 'both')\n if (changed) setHandleState(handle, 'focus')\n }\n\n private focusSiblingHandle(handle: MountedHandle, reverse: boolean): void {\n const nextHandle = nextFocusableHandle(this.handles, handle, reverse)\n nextHandle?.element.focus({ preventScroll: true })\n }\n\n private applyHandleDelta(\n handleIndex: number,\n delta: number,\n initialLayout: ResizablePaneLayout,\n mode: LayoutApplyMode,\n ): boolean {\n const nextLayout = adjustLayoutByDelta({\n delta,\n initialLayout,\n panes: this.panes,\n pivotIndex: handleIndex,\n prevLayout: this.layout,\n })\n return this.applyLayout(nextLayout, mode)\n }\n\n private applyLayout(layout: ResizablePaneLayout, mode: LayoutApplyMode): boolean {\n const nextLayout = normalizeLayout(layout, this.panes)\n if (layoutsEqual(this.layout, nextLayout)) {\n this.updateHandles()\n return false\n }\n\n this.layout = nextLayout\n for (const pane of this.panes) applyPaneLayout(pane, nextLayout[pane.id] ?? 0)\n this.updateHandles()\n notifyLayoutChange(mode, nextLayout, this.onLayoutChange, this.onLayoutChanged)\n return true\n }\n\n private updateHandles(): void {\n for (const handle of this.handles) this.updateHandle(handle)\n }\n\n private updateHandle(handle: MountedHandle): void {\n const beforePane = this.panes[handle.index]\n if (!beforePane) return\n\n const aria = calculateHandleAria({\n handleIndex: handle.index,\n layout: this.layout,\n panes: this.panes,\n })\n handle.element.id = handle.id\n handle.element.setAttribute('aria-controls', beforePane.element.id)\n handle.element.setAttribute('aria-valuemin', formatAriaNumber(aria.min))\n handle.element.setAttribute('aria-valuemax', formatAriaNumber(aria.max))\n handle.element.setAttribute('aria-valuenow', formatAriaNumber(aria.now))\n }\n\n private canStartInteraction(event: PointerEvent): boolean {\n if (this.disabled || this.disposed || event.defaultPrevented) return false\n if (event.pointerType === 'mouse' && event.button > 0) return false\n return true\n }\n\n private pointerDeltaPercent(drag: DragState, event: PointerEvent): number {\n if (this.orientation === 'horizontal')\n return ((event.clientX - drag.startX) / drag.groupSize) * 100\n return ((event.clientY - drag.startY) / drag.groupSize) * 100\n }\n\n private groupSize(): number {\n const rect = this.container.getBoundingClientRect()\n if (this.orientation === 'horizontal') return rect.width\n return rect.height\n }\n\n private separatorOrientation(): 'horizontal' | 'vertical' {\n if (this.orientation === 'horizontal') return 'vertical'\n return 'horizontal'\n }\n\n private installDocumentDragListeners(): void {\n this.document.addEventListener('pointermove', this.onDocumentPointerMove)\n this.document.addEventListener('pointerup', this.onDocumentPointerUp, true)\n }\n\n private uninstallDocumentDragListeners(): void {\n this.document.removeEventListener('pointermove', this.onDocumentPointerMove)\n this.document.removeEventListener('pointerup', this.onDocumentPointerUp, true)\n }\n}\n\nfunction mountContainer(\n container: HTMLElement,\n groupId: string,\n orientation: ResizablePaneOrientation,\n): void {\n container.classList.add('editor-resizable-pane-group')\n container.dataset.editorPaneGroup = groupId\n container.dataset.editorPaneOrientation = orientation\n container.style.display = 'flex'\n container.style.flexDirection = orientation === 'horizontal' ? 'row' : 'column'\n container.style.flexWrap = 'nowrap'\n container.style.overflow = 'hidden'\n container.style.touchAction = orientation === 'horizontal' ? 'pan-y' : 'pan-x'\n}\n\nfunction unmountContainer(container: HTMLElement): void {\n container.classList.remove('editor-resizable-pane-group')\n delete container.dataset.editorPaneGroup\n delete container.dataset.editorPaneOrientation\n}\n\nfunction mountPane(\n container: HTMLElement,\n pane: NormalizedPane,\n groupId: string,\n index: number,\n): void {\n ensureElementId(pane.element, `${groupId}-pane-${pane.id}`)\n pane.element.classList.add('editor-resizable-pane')\n pane.element.dataset.editorPane = pane.id\n pane.element.dataset.editorPaneIndex = String(index)\n pane.element.style.minHeight = '0'\n pane.element.style.minWidth = '0'\n if (pane.disabled) pane.element.dataset.disabled = 'true'\n container.appendChild(pane.element)\n}\n\nfunction unmountPane(pane: NormalizedPane): void {\n pane.element.classList.remove('editor-resizable-pane')\n delete pane.element.dataset.editorPane\n delete pane.element.dataset.editorPaneIndex\n delete pane.element.dataset.disabled\n}\n\nfunction applyPaneLayout(pane: NormalizedPane, size: number): void {\n pane.element.style.flexGrow = formatFlexNumber(size)\n pane.element.style.flexShrink = '1'\n pane.element.style.flexBasis = '0'\n}\n\nfunction createDefaultHandle(document: Document): HTMLElement {\n const handle = document.createElement('div')\n handle.className = 'editor-resizable-pane-handle'\n return handle\n}\n\nfunction configureHandle(\n handle: MountedHandle,\n orientation: 'horizontal' | 'vertical',\n disabled: boolean,\n): void {\n handle.element.classList.add('editor-resizable-pane-handle')\n handle.element.dataset.editorPaneHandle = handle.id\n handle.element.dataset.editorPaneHandleState = 'inactive'\n handle.element.setAttribute('aria-disabled', disabled ? 'true' : 'false')\n handle.element.setAttribute('aria-orientation', orientation)\n handle.element.setAttribute('role', 'separator')\n handle.element.style.flexGrow = '0'\n handle.element.style.flexShrink = '0'\n handle.element.style.touchAction = 'none'\n applyHandleOrientationStyle(handle.element, orientation, disabled)\n handle.element.tabIndex = disabled ? -1 : 0\n}\n\nfunction applyHandleOrientationStyle(\n element: HTMLElement,\n orientation: 'horizontal' | 'vertical',\n disabled: boolean,\n): void {\n if (orientation === 'vertical') {\n element.style.width = element.style.width || '8px'\n element.style.cursor = disabled ? 'default' : 'ew-resize'\n return\n }\n\n element.style.height = element.style.height || '8px'\n element.style.cursor = disabled ? 'default' : 'ns-resize'\n}\n\nfunction disposeHandle(handle: MountedHandle): void {\n handle.element.removeEventListener('keydown', handle.onKeyDown)\n handle.element.removeEventListener('pointerdown', handle.onPointerDown)\n handle.element.removeEventListener('pointerenter', handle.onPointerEnter)\n handle.element.removeEventListener('pointerleave', handle.onPointerLeave)\n handle.element.removeEventListener('blur', handle.onBlur)\n handle.element.removeEventListener('focus', handle.onFocus)\n handle.element.remove()\n}\n\nfunction setHandleState(handle: MountedHandle, state: string): void {\n if (handle.element.dataset.editorPaneHandleState === 'dragging' && state === 'inactive') return\n handle.element.dataset.editorPaneHandleState = state\n}\n\nfunction normalizePanes(panes: readonly ResizablePane[]): readonly NormalizedPane[] {\n const seenIds = new Set<string>()\n return panes.map((pane) => normalizePane(pane, seenIds))\n}\n\nfunction normalizePane(pane: ResizablePane, seenIds: Set<string>): NormalizedPane {\n const id = String(pane.id)\n if (!id) throw new Error('Resizable panes must have an id')\n if (seenIds.has(id)) throw new Error(`Duplicate resizable pane id \"${id}\"`)\n seenIds.add(id)\n\n const minSize = clampPercent(pane.minSize ?? 0)\n const maxSize = Math.max(minSize, clampPercent(pane.maxSize ?? 100))\n return {\n id,\n element: pane.element,\n defaultSize: optionalPercent(pane.defaultSize),\n minSize,\n maxSize,\n disabled: pane.disabled === true,\n }\n}\n\nfunction createInitialLayout(\n panes: readonly NormalizedPane[],\n defaultLayout: ResizablePaneLayout | undefined,\n): ResizablePaneLayout {\n const configured = layoutFromDefaultLayout(panes, defaultLayout)\n if (configured) return configured\n\n const paneDefaults = layoutFromPaneDefaults(panes)\n if (paneDefaults) return paneDefaults\n\n return equalLayout(panes)\n}\n\nfunction layoutFromDefaultLayout(\n panes: readonly NormalizedPane[],\n defaultLayout: ResizablePaneLayout | undefined,\n): ResizablePaneLayout | null {\n if (!defaultLayout) return null\n if (!panes.every((pane) => finiteNumber(defaultLayout[pane.id]))) return null\n return normalizeLayout(defaultLayout, panes)\n}\n\nfunction layoutFromPaneDefaults(panes: readonly NormalizedPane[]): ResizablePaneLayout | null {\n if (!panes.some((pane) => pane.defaultSize !== undefined)) return null\n\n const fixedTotal = sumValues(panes.map((pane) => pane.defaultSize ?? 0))\n const flexiblePanes = panes.filter((pane) => pane.defaultSize === undefined)\n const flexibleSize =\n flexiblePanes.length > 0 ? Math.max(0, 100 - fixedTotal) / flexiblePanes.length : 0\n const layout: Record<string, number> = {}\n for (const pane of panes) layout[pane.id] = pane.defaultSize ?? flexibleSize\n return normalizeLayout(layout, panes)\n}\n\nfunction equalLayout(panes: readonly NormalizedPane[]): ResizablePaneLayout {\n const size = panes.length > 0 ? 100 / panes.length : 0\n const layout: Record<string, number> = {}\n for (const pane of panes) layout[pane.id] = size\n return normalizeLayout(layout, panes)\n}\n\nfunction normalizeLayout(\n layout: ResizablePaneLayout,\n panes: readonly NormalizedPane[],\n): ResizablePaneLayout {\n const nextLayout = mutableLayout(layout, panes)\n return freezeLayout(rebalanceLayout(nextLayout, panes))\n}\n\nfunction mutableLayout(\n layout: ResizablePaneLayout,\n panes: readonly NormalizedPane[],\n): Record<string, number> {\n const nextLayout: Record<string, number> = {}\n for (const pane of panes) nextLayout[pane.id] = clampToPane(layout[pane.id], pane)\n return nextLayout\n}\n\nfunction rebalanceLayout(\n layout: Record<string, number>,\n panes: readonly NormalizedPane[],\n): Record<string, number> {\n let remaining = 100 - sumValues(Object.values(layout))\n let iterations = 0\n while (Math.abs(remaining) > FLOAT_TOLERANCE && iterations < panes.length * 3) {\n const applied = distributeRebalanceDelta(layout, panes, remaining)\n if (Math.abs(applied) <= FLOAT_TOLERANCE) break\n remaining -= applied\n iterations += 1\n }\n return layout\n}\n\nfunction distributeRebalanceDelta(\n layout: Record<string, number>,\n panes: readonly NormalizedPane[],\n remaining: number,\n): number {\n const candidates = rebalanceCandidates(layout, panes, remaining)\n if (candidates.length === 0) return 0\n\n const share = remaining / candidates.length\n let applied = 0\n for (const pane of candidates) applied += applyRebalanceShare(layout, pane, share)\n return applied\n}\n\nfunction rebalanceCandidates(\n layout: Record<string, number>,\n panes: readonly NormalizedPane[],\n remaining: number,\n): readonly NormalizedPane[] {\n if (remaining > 0) return panes.filter((pane) => layout[pane.id] < pane.maxSize)\n return panes.filter((pane) => layout[pane.id] > pane.minSize)\n}\n\nfunction applyRebalanceShare(\n layout: Record<string, number>,\n pane: NormalizedPane,\n share: number,\n): number {\n const current = layout[pane.id] ?? 0\n const next = clampToPane(current + share, pane)\n layout[pane.id] = next\n return next - current\n}\n\nfunction adjustLayoutByDelta(options: {\n readonly delta: number\n readonly initialLayout: ResizablePaneLayout\n readonly panes: readonly NormalizedPane[]\n readonly pivotIndex: number\n readonly prevLayout: ResizablePaneLayout\n}): ResizablePaneLayout {\n const { delta, initialLayout, panes, pivotIndex, prevLayout } = options\n if (Math.abs(delta) <= FLOAT_TOLERANCE) return prevLayout\n\n const nextLayout = mutableLayout(initialLayout, panes)\n const amount = Math.abs(delta)\n const shrinkIndices = shrinkCandidateIndices(delta, panes, pivotIndex)\n const growIndices = growCandidateIndices(delta, panes, pivotIndex)\n const applicableDelta = Math.min(\n amount,\n totalShrinkCapacity(nextLayout, panes, shrinkIndices),\n totalGrowCapacity(nextLayout, panes, growIndices),\n )\n if (applicableDelta <= FLOAT_TOLERANCE) return prevLayout\n\n distributeResizeDelta(nextLayout, panes, shrinkIndices, -applicableDelta)\n distributeResizeDelta(nextLayout, panes, growIndices, applicableDelta)\n const next = freezeLayout(nextLayout)\n if (layoutsEqual(prevLayout, next)) return prevLayout\n return next\n}\n\nfunction shrinkCandidateIndices(\n delta: number,\n panes: readonly NormalizedPane[],\n pivotIndex: number,\n): readonly number[] {\n if (delta > 0) return forwardIndices(pivotIndex + 1, panes.length)\n return reverseIndices(pivotIndex)\n}\n\nfunction growCandidateIndices(\n delta: number,\n panes: readonly NormalizedPane[],\n pivotIndex: number,\n): readonly number[] {\n if (delta > 0) return reverseIndices(pivotIndex)\n return forwardIndices(pivotIndex + 1, panes.length)\n}\n\nfunction forwardIndices(start: number, length: number): readonly number[] {\n const indices: number[] = []\n for (let index = start; index < length; index += 1) indices.push(index)\n return indices\n}\n\nfunction reverseIndices(start: number): readonly number[] {\n const indices: number[] = []\n for (let index = start; index >= 0; index -= 1) indices.push(index)\n return indices\n}\n\nfunction totalShrinkCapacity(\n layout: ResizablePaneLayout,\n panes: readonly NormalizedPane[],\n indices: readonly number[],\n): number {\n return indices.reduce((total, index) => {\n const pane = panes[index]\n if (!pane || pane.disabled) return total\n return total + Math.max(0, (layout[pane.id] ?? 0) - pane.minSize)\n }, 0)\n}\n\nfunction totalGrowCapacity(\n layout: ResizablePaneLayout,\n panes: readonly NormalizedPane[],\n indices: readonly number[],\n): number {\n return indices.reduce((total, index) => {\n const pane = panes[index]\n if (!pane || pane.disabled) return total\n return total + Math.max(0, pane.maxSize - (layout[pane.id] ?? 0))\n }, 0)\n}\n\nfunction distributeResizeDelta(\n layout: Record<string, number>,\n panes: readonly NormalizedPane[],\n indices: readonly number[],\n delta: number,\n): void {\n let remaining = Math.abs(delta)\n const direction = delta < 0 ? -1 : 1\n for (const index of indices) {\n const pane = panes[index]\n if (!pane || pane.disabled) continue\n remaining = applyResizeDelta(layout, pane, remaining, direction)\n if (remaining <= FLOAT_TOLERANCE) return\n }\n}\n\nfunction applyResizeDelta(\n layout: Record<string, number>,\n pane: NormalizedPane,\n remaining: number,\n direction: number,\n): number {\n const current = layout[pane.id] ?? 0\n const target = current + remaining * direction\n const next = clampToPane(target, pane)\n layout[pane.id] = next\n return remaining - Math.abs(next - current)\n}\n\nfunction calculateHandleAria(options: {\n readonly handleIndex: number\n readonly layout: ResizablePaneLayout\n readonly panes: readonly NormalizedPane[]\n}): { readonly min: number; readonly max: number; readonly now: number } {\n const pane = options.panes[options.handleIndex]\n if (!pane) return { min: 0, max: 100, now: 0 }\n\n const now = options.layout[pane.id] ?? 0\n const minLayout = adjustLayoutByDelta({\n delta: pane.minSize - now,\n initialLayout: options.layout,\n panes: options.panes,\n pivotIndex: options.handleIndex,\n prevLayout: options.layout,\n })\n const maxLayout = adjustLayoutByDelta({\n delta: pane.maxSize - now,\n initialLayout: options.layout,\n panes: options.panes,\n pivotIndex: options.handleIndex,\n prevLayout: options.layout,\n })\n return {\n min: minLayout[pane.id] ?? pane.minSize,\n max: maxLayout[pane.id] ?? pane.maxSize,\n now,\n }\n}\n\nfunction keyboardDelta(\n event: KeyboardEvent,\n orientation: ResizablePaneOrientation,\n keyboardStep: number,\n): number | null {\n if (event.key === 'Home') return -100\n if (event.key === 'End') return 100\n if (orientation === 'horizontal') return horizontalKeyboardDelta(event.key, keyboardStep)\n return verticalKeyboardDelta(event.key, keyboardStep)\n}\n\nfunction horizontalKeyboardDelta(key: string, keyboardStep: number): number | null {\n if (key === 'ArrowLeft') return -keyboardStep\n if (key === 'ArrowRight') return keyboardStep\n return null\n}\n\nfunction verticalKeyboardDelta(key: string, keyboardStep: number): number | null {\n if (key === 'ArrowUp') return -keyboardStep\n if (key === 'ArrowDown') return keyboardStep\n return null\n}\n\nfunction nextFocusableHandle(\n handles: readonly MountedHandle[],\n current: MountedHandle,\n reverse: boolean,\n): MountedHandle | null {\n if (handles.length === 0) return null\n\n const index = handles.indexOf(current)\n if (index === -1) return handles[0] ?? null\n const offset = reverse ? -1 : 1\n const nextIndex = (index + offset + handles.length) % handles.length\n return handles[nextIndex] ?? null\n}\n\nfunction notifyLayoutChange(\n mode: LayoutApplyMode,\n layout: ResizablePaneLayout,\n onLayoutChange: ((layout: ResizablePaneLayout) => void) | undefined,\n onLayoutChanged: ((layout: ResizablePaneLayout) => void) | undefined,\n): void {\n if (mode === 'silent') return\n if (mode === 'change' || mode === 'both') onLayoutChange?.({ ...layout })\n if (mode === 'changed' || mode === 'both') onLayoutChanged?.({ ...layout })\n}\n\nfunction layoutsEqual(a: ResizablePaneLayout, b: ResizablePaneLayout): boolean {\n const keys = new Set(Object.keys(a).concat(Object.keys(b)))\n for (const key of keys) {\n if (Math.abs((a[key] ?? 0) - (b[key] ?? 0)) > FLOAT_TOLERANCE) return false\n }\n return true\n}\n\nfunction freezeLayout(layout: Record<string, number>): ResizablePaneLayout {\n return Object.freeze({ ...layout })\n}\n\nfunction clampToPane(value: number | undefined, pane: NormalizedPane): number {\n if (!finiteNumber(value)) return pane.minSize\n return clamp(value, pane.minSize, pane.maxSize)\n}\n\nfunction clampPercent(value: number): number {\n if (!finiteNumber(value)) return 0\n return clamp(value, 0, 100)\n}\n\nfunction optionalPercent(value: number | undefined): number | undefined {\n if (value === undefined) return undefined\n return clampPercent(value)\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value))\n}\n\nfunction finiteNumber(value: unknown): value is number {\n return typeof value === 'number' && Number.isFinite(value)\n}\n\nfunction sumValues(values: readonly number[]): number {\n return values.reduce((total, value) => total + value, 0)\n}\n\nfunction normalizeKeyboardStep(value: number | undefined): number {\n if (!finiteNumber(value) || value <= 0) return DEFAULT_KEYBOARD_STEP\n return value\n}\n\nfunction ensureElementId(element: HTMLElement, fallback: string): void {\n if (element.id) return\n element.id = fallback.replace(/[^a-zA-Z0-9_-]/g, '-')\n}\n\nfunction formatFlexNumber(value: number): string {\n return Number(value.toFixed(4)).toString()\n}\n\nfunction formatAriaNumber(value: number): string {\n return Number(value.toFixed(2)).toString()\n}\n\nfunction pointerIdFromEvent(event: PointerEvent): number | null {\n if (typeof event.pointerId !== 'number') return null\n return event.pointerId\n}\n\nfunction matchesPointer(drag: DragState, event: PointerEvent): boolean {\n if (drag.pointerId === null) return true\n return event.pointerId === drag.pointerId\n}\n\nfunction capturePointer(element: HTMLElement, event: PointerEvent): void {\n if (typeof event.pointerId !== 'number') return\n element.setPointerCapture?.(event.pointerId)\n}\n\nfunction releasePointer(element: HTMLElement, event: PointerEvent): void {\n if (typeof event.pointerId !== 'number') return\n element.releasePointerCapture?.(event.pointerId)\n}\n"],"mappings":";;AAwEA,IAAM,wBAAwB;AAC9B,IAAM,kBAAkB;AACxB,IAAI,kBAAkB;AAEtB,IAAa,qBAAb,MAAgC;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA,UAA4C,CAAC;CAC7C,yBAA0C,UAA8B;EACtE,KAAK,0BA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3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n createBrowserDispatcher,\n type BrowserDispatcher,\n type FocusNode,\n type Binding,\n} from '@shaulavo/hotkeys'\nimport './style.css'\n\nexport type ResizablePaneOrientation = 'horizontal' | 'vertical'\n\nexport type ResizablePaneLayout = Readonly<Record<string, number>>\n\nexport type ResizablePane = {\n readonly id: string\n readonly element: HTMLElement\n readonly defaultSize?: number\n readonly minSize?: number\n readonly maxSize?: number\n readonly disabled?: boolean\n}\n\nexport type ResizablePaneHandleContext = {\n readonly document: Document\n readonly groupId: string\n readonly handleId: string\n readonly index: number\n readonly beforePaneId: string\n readonly afterPaneId: string\n readonly orientation: ResizablePaneOrientation\n}\n\nexport type ResizablePaneHandleFactory = (context: ResizablePaneHandleContext) => HTMLElement\n\nexport type ResizablePaneGroupOptions = {\n readonly hotkeys?: BrowserDispatcher\n readonly hotkeysParent?: FocusNode<KeyboardEvent>\n readonly id?: string\n readonly orientation?: ResizablePaneOrientation\n readonly panes: readonly ResizablePane[]\n readonly defaultLayout?: ResizablePaneLayout\n readonly createHandle?: ResizablePaneHandleFactory\n readonly onLayoutChange?: (layout: ResizablePaneLayout) => void\n readonly onLayoutChanged?: (layout: ResizablePaneLayout) => void\n readonly keyboardStep?: number\n readonly disabled?: boolean\n}\n\ntype NormalizedPane = {\n readonly id: string\n readonly element: HTMLElement\n readonly defaultSize?: number\n readonly minSize: number\n readonly maxSize: number\n readonly disabled: boolean\n}\n\ntype MountedHandle = {\n readonly id: string\n readonly element: HTMLElement\n readonly index: number\n readonly disposeHotkeys: () => void\n readonly onPointerDown: (event: PointerEvent) => void\n readonly onPointerEnter: () => void\n readonly onPointerLeave: () => void\n readonly onBlur: () => void\n readonly onFocus: () => void\n}\n\ntype DragState = {\n readonly handle: MountedHandle\n readonly initialLayout: ResizablePaneLayout\n readonly pointerId: number | null\n readonly startX: number\n readonly startY: number\n readonly groupSize: number\n changed: boolean\n}\n\ntype LayoutApplyMode = 'silent' | 'change' | 'changed' | 'both'\n\nexport const paneHandlePack = [\n { keys: 'F6', command: 'panes.focusNextHandle', context: 'PaneHandle && !DisabledPane' },\n {\n keys: 'Shift+F6',\n command: 'panes.focusPreviousHandle',\n context: 'PaneHandle && !DisabledPane',\n },\n {\n keys: 'ArrowLeft',\n command: 'panes.resizeSmaller',\n context: 'PaneHandle && HorizontalPane && !DisabledPane',\n },\n {\n keys: 'ArrowRight',\n command: 'panes.resizeLarger',\n context: 'PaneHandle && HorizontalPane && !DisabledPane',\n },\n {\n keys: 'ArrowUp',\n command: 'panes.resizeSmaller',\n context: 'PaneHandle && VerticalPane && !DisabledPane',\n },\n {\n keys: 'ArrowDown',\n command: 'panes.resizeLarger',\n context: 'PaneHandle && VerticalPane && !DisabledPane',\n },\n { keys: 'Home', command: 'panes.resizeMinimum', context: 'PaneHandle && !DisabledPane' },\n { keys: 'End', command: 'panes.resizeMaximum', context: 'PaneHandle && !DisabledPane' },\n] as const satisfies readonly Binding[]\n\nconst DEFAULT_KEYBOARD_STEP = 5\nconst FLOAT_TOLERANCE = 0.001\nlet nextPaneGroupId = 0\n\nexport class ResizablePaneGroup {\n private readonly container: HTMLElement\n private readonly document: Document\n private readonly groupId: string\n private readonly orientation: ResizablePaneOrientation\n private readonly keyboardStep: number\n private readonly disabled: boolean\n private readonly panes: readonly NormalizedPane[]\n private readonly handles: MountedHandle[] = []\n private readonly hotkeys: BrowserDispatcher\n private readonly hotkeysParent?: FocusNode<KeyboardEvent>\n private readonly ownHotkeys: boolean\n private readonly onDocumentPointerMove = (event: PointerEvent): void => {\n this.handleDocumentPointerMove(event)\n }\n private readonly onDocumentPointerUp = (event: PointerEvent): void => {\n this.handleDocumentPointerUp(event)\n }\n private readonly onLayoutChange?: (layout: ResizablePaneLayout) => void\n private readonly onLayoutChanged?: (layout: ResizablePaneLayout) => void\n private dragState: DragState | null = null\n private disposed = false\n private layout: ResizablePaneLayout\n\n public constructor(container: HTMLElement, options: ResizablePaneGroupOptions) {\n this.container = container\n this.hotkeys = options.hotkeys ?? createBrowserDispatcher({ root: container })\n this.hotkeysParent = options.hotkeysParent\n this.ownHotkeys = !options.hotkeys\n if (this.ownHotkeys) this.hotkeys.setKeymap(paneHandlePack)\n this.document = container.ownerDocument\n this.groupId = options.id ?? `editor-pane-group-${nextPaneGroupId++}`\n this.orientation = options.orientation ?? 'horizontal'\n this.keyboardStep = normalizeKeyboardStep(options.keyboardStep)\n this.disabled = options.disabled === true\n this.onLayoutChange = options.onLayoutChange\n this.onLayoutChanged = options.onLayoutChanged\n this.panes = normalizePanes(options.panes)\n this.layout = createInitialLayout(this.panes, options.defaultLayout)\n\n mountContainer(this.container, this.groupId, this.orientation)\n this.mountPanesAndHandles(options.createHandle)\n this.applyLayout(this.layout, 'silent')\n }\n\n public getLayout(): ResizablePaneLayout {\n return { ...this.layout }\n }\n\n public setLayout(layout: ResizablePaneLayout): ResizablePaneLayout {\n if (this.disposed) return this.getLayout()\n\n const nextLayout = normalizeLayout(layout, this.panes)\n this.applyLayout(nextLayout, 'both')\n return this.getLayout()\n }\n\n public dispose(): void {\n if (this.disposed) return\n\n this.disposed = true\n this.uninstallDocumentDragListeners()\n for (const handle of this.handles) disposeHandle(handle)\n this.handles.length = 0\n if (this.ownHotkeys) this.hotkeys.dispose()\n for (const pane of this.panes) unmountPane(pane)\n unmountContainer(this.container)\n }\n\n private mountPanesAndHandles(createHandle: ResizablePaneHandleFactory | undefined): void {\n for (const [index, pane] of this.panes.entries()) {\n mountPane(this.container, pane, this.groupId, index)\n if (index === 0) continue\n this.mountHandle(index - 1, createHandle)\n }\n }\n\n private mountHandle(index: number, createHandle: ResizablePaneHandleFactory | undefined): void {\n const beforePane = this.panes[index]\n const afterPane = this.panes[index + 1]\n if (!beforePane || !afterPane) return\n\n const handleId = `${this.groupId}-handle-${index}`\n const element =\n createHandle?.({\n document: this.document,\n groupId: this.groupId,\n handleId,\n index,\n beforePaneId: beforePane.id,\n afterPaneId: afterPane.id,\n orientation: this.orientation,\n }) ?? createDefaultHandle(this.document)\n const handle = this.createMountedHandle(element, handleId, index)\n this.handles.push(handle)\n configureHandle(handle, this.separatorOrientation(), this.disabled)\n this.container.insertBefore(element, afterPane.element)\n }\n\n private createMountedHandle(element: HTMLElement, id: string, index: number): MountedHandle {\n const handle: MountedHandle = {\n id,\n element,\n index,\n disposeHotkeys: () => {\n detach()\n node.remove()\n },\n onPointerDown: (event) => this.handlePointerDown(handle, event),\n onPointerEnter: () => setHandleState(handle, 'hover'),\n onPointerLeave: () => setHandleState(handle, 'inactive'),\n onBlur: () => setHandleState(handle, 'inactive'),\n onFocus: () => setHandleState(handle, 'focus'),\n }\n const node = this.hotkeys.createNode({\n parent: this.hotkeysParent,\n context: `PaneHandle ${this.orientation === 'horizontal' ? 'HorizontalPane' : 'VerticalPane'} ${this.disabled ? 'DisabledPane' : ''}`,\n commands: {\n 'panes.focusNextHandle': () => this.focusSiblingHandle(handle, false),\n 'panes.focusPreviousHandle': () => this.focusSiblingHandle(handle, true),\n 'panes.resizeSmaller': () => this.resizeHandle(handle, -this.keyboardStep),\n 'panes.resizeLarger': () => this.resizeHandle(handle, this.keyboardStep),\n 'panes.resizeMinimum': () => this.resizeHandle(handle, -100),\n 'panes.resizeMaximum': () => this.resizeHandle(handle, 100),\n },\n })\n const detach = this.hotkeys.attachElement(node, element)\n element.addEventListener('pointerdown', handle.onPointerDown)\n element.addEventListener('pointerenter', handle.onPointerEnter)\n element.addEventListener('pointerleave', handle.onPointerLeave)\n element.addEventListener('blur', handle.onBlur)\n element.addEventListener('focus', handle.onFocus)\n return handle\n }\n\n private handlePointerDown(handle: MountedHandle, event: PointerEvent): void {\n if (!this.canStartInteraction(event)) return\n\n const groupSize = this.groupSize()\n if (groupSize <= 0) return\n\n event.preventDefault()\n handle.element.focus({ preventScroll: true })\n setHandleState(handle, 'dragging')\n this.dragState = {\n handle,\n initialLayout: this.getLayout(),\n pointerId: pointerIdFromEvent(event),\n startX: event.clientX,\n startY: event.clientY,\n groupSize,\n changed: false,\n }\n capturePointer(handle.element, event)\n this.installDocumentDragListeners()\n }\n\n private handleDocumentPointerMove(event: PointerEvent): void {\n const drag = this.dragState\n if (!drag) return\n if (!matchesPointer(drag, event)) return\n\n event.preventDefault()\n const delta = this.pointerDeltaPercent(drag, event)\n const changed = this.applyHandleDelta(drag.handle.index, delta, drag.initialLayout, 'change')\n drag.changed ||= changed\n }\n\n private handleDocumentPointerUp(event: PointerEvent): void {\n const drag = this.dragState\n if (!drag) return\n if (!matchesPointer(drag, event)) return\n\n this.dragState = null\n this.uninstallDocumentDragListeners()\n releasePointer(drag.handle.element, event)\n setHandleState(drag.handle, 'focus')\n if (drag.changed) this.onLayoutChanged?.(this.getLayout())\n }\n\n private resizeHandle(handle: MountedHandle, delta: number): boolean {\n if (this.disabled) return false\n const changed = this.applyHandleDelta(handle.index, delta, this.layout, 'both')\n if (changed) setHandleState(handle, 'focus')\n return true\n }\n\n private focusSiblingHandle(handle: MountedHandle, reverse: boolean): void {\n const nextHandle = nextFocusableHandle(this.handles, handle, reverse)\n nextHandle?.element.focus({ preventScroll: true })\n }\n\n private applyHandleDelta(\n handleIndex: number,\n delta: number,\n initialLayout: ResizablePaneLayout,\n mode: LayoutApplyMode,\n ): boolean {\n const nextLayout = adjustLayoutByDelta({\n delta,\n initialLayout,\n panes: this.panes,\n pivotIndex: handleIndex,\n prevLayout: this.layout,\n })\n return this.applyLayout(nextLayout, mode)\n }\n\n private applyLayout(layout: ResizablePaneLayout, mode: LayoutApplyMode): boolean {\n const nextLayout = normalizeLayout(layout, this.panes)\n if (layoutsEqual(this.layout, nextLayout)) {\n this.updateHandles()\n return false\n }\n\n this.layout = nextLayout\n for (const pane of this.panes) applyPaneLayout(pane, nextLayout[pane.id] ?? 0)\n this.updateHandles()\n notifyLayoutChange(mode, nextLayout, this.onLayoutChange, this.onLayoutChanged)\n return true\n }\n\n private updateHandles(): void {\n for (const handle of this.handles) this.updateHandle(handle)\n }\n\n private updateHandle(handle: MountedHandle): void {\n const beforePane = this.panes[handle.index]\n if (!beforePane) return\n\n const aria = calculateHandleAria({\n handleIndex: handle.index,\n layout: this.layout,\n panes: this.panes,\n })\n handle.element.id = handle.id\n handle.element.setAttribute('aria-controls', beforePane.element.id)\n handle.element.setAttribute('aria-valuemin', formatAriaNumber(aria.min))\n handle.element.setAttribute('aria-valuemax', formatAriaNumber(aria.max))\n handle.element.setAttribute('aria-valuenow', formatAriaNumber(aria.now))\n }\n\n private canStartInteraction(event: PointerEvent): boolean {\n if (this.disabled || this.disposed || event.defaultPrevented) return false\n if (event.pointerType === 'mouse' && event.button > 0) return false\n return true\n }\n\n private pointerDeltaPercent(drag: DragState, event: PointerEvent): number {\n if (this.orientation === 'horizontal')\n return ((event.clientX - drag.startX) / drag.groupSize) * 100\n return ((event.clientY - drag.startY) / drag.groupSize) * 100\n }\n\n private groupSize(): number {\n const rect = this.container.getBoundingClientRect()\n if (this.orientation === 'horizontal') return rect.width\n return rect.height\n }\n\n private separatorOrientation(): 'horizontal' | 'vertical' {\n if (this.orientation === 'horizontal') return 'vertical'\n return 'horizontal'\n }\n\n private installDocumentDragListeners(): void {\n this.document.addEventListener('pointermove', this.onDocumentPointerMove)\n this.document.addEventListener('pointerup', this.onDocumentPointerUp, true)\n }\n\n private uninstallDocumentDragListeners(): void {\n this.document.removeEventListener('pointermove', this.onDocumentPointerMove)\n this.document.removeEventListener('pointerup', this.onDocumentPointerUp, true)\n }\n}\n\nfunction mountContainer(\n container: HTMLElement,\n groupId: string,\n orientation: ResizablePaneOrientation,\n): void {\n container.classList.add('editor-resizable-pane-group')\n container.dataset.editorPaneGroup = groupId\n container.dataset.editorPaneOrientation = orientation\n container.style.display = 'flex'\n container.style.flexDirection = orientation === 'horizontal' ? 'row' : 'column'\n container.style.flexWrap = 'nowrap'\n container.style.overflow = 'hidden'\n container.style.touchAction = orientation === 'horizontal' ? 'pan-y' : 'pan-x'\n}\n\nfunction unmountContainer(container: HTMLElement): void {\n container.classList.remove('editor-resizable-pane-group')\n delete container.dataset.editorPaneGroup\n delete container.dataset.editorPaneOrientation\n}\n\nfunction mountPane(\n container: HTMLElement,\n pane: NormalizedPane,\n groupId: string,\n index: number,\n): void {\n ensureElementId(pane.element, `${groupId}-pane-${pane.id}`)\n pane.element.classList.add('editor-resizable-pane')\n pane.element.dataset.editorPane = pane.id\n pane.element.dataset.editorPaneIndex = String(index)\n pane.element.style.minHeight = '0'\n pane.element.style.minWidth = '0'\n if (pane.disabled) pane.element.dataset.disabled = 'true'\n container.appendChild(pane.element)\n}\n\nfunction unmountPane(pane: NormalizedPane): void {\n pane.element.classList.remove('editor-resizable-pane')\n delete pane.element.dataset.editorPane\n delete pane.element.dataset.editorPaneIndex\n delete pane.element.dataset.disabled\n}\n\nfunction applyPaneLayout(pane: NormalizedPane, size: number): void {\n pane.element.style.flexGrow = formatFlexNumber(size)\n pane.element.style.flexShrink = '1'\n pane.element.style.flexBasis = '0'\n}\n\nfunction createDefaultHandle(document: Document): HTMLElement {\n const handle = document.createElement('div')\n handle.className = 'editor-resizable-pane-handle'\n return handle\n}\n\nfunction configureHandle(\n handle: MountedHandle,\n orientation: 'horizontal' | 'vertical',\n disabled: boolean,\n): void {\n handle.element.classList.add('editor-resizable-pane-handle')\n handle.element.dataset.editorPaneHandle = handle.id\n handle.element.dataset.editorPaneHandleState = 'inactive'\n handle.element.setAttribute('aria-disabled', disabled ? 'true' : 'false')\n handle.element.setAttribute('aria-orientation', orientation)\n handle.element.setAttribute('role', 'separator')\n handle.element.style.flexGrow = '0'\n handle.element.style.flexShrink = '0'\n handle.element.style.touchAction = 'none'\n applyHandleOrientationStyle(handle.element, orientation, disabled)\n handle.element.tabIndex = disabled ? -1 : 0\n}\n\nfunction applyHandleOrientationStyle(\n element: HTMLElement,\n orientation: 'horizontal' | 'vertical',\n disabled: boolean,\n): void {\n if (orientation === 'vertical') {\n element.style.width = element.style.width || '8px'\n element.style.cursor = disabled ? 'default' : 'ew-resize'\n return\n }\n\n element.style.height = element.style.height || '8px'\n element.style.cursor = disabled ? 'default' : 'ns-resize'\n}\n\nfunction disposeHandle(handle: MountedHandle): void {\n handle.disposeHotkeys()\n handle.element.removeEventListener('pointerdown', handle.onPointerDown)\n handle.element.removeEventListener('pointerenter', handle.onPointerEnter)\n handle.element.removeEventListener('pointerleave', handle.onPointerLeave)\n handle.element.removeEventListener('blur', handle.onBlur)\n handle.element.removeEventListener('focus', handle.onFocus)\n handle.element.remove()\n}\n\nfunction setHandleState(handle: MountedHandle, state: string): void {\n if (handle.element.dataset.editorPaneHandleState === 'dragging' && state === 'inactive') return\n handle.element.dataset.editorPaneHandleState = state\n}\n\nfunction normalizePanes(panes: readonly ResizablePane[]): readonly NormalizedPane[] {\n const seenIds = new Set<string>()\n return panes.map((pane) => normalizePane(pane, seenIds))\n}\n\nfunction normalizePane(pane: ResizablePane, seenIds: Set<string>): NormalizedPane {\n const id = String(pane.id)\n if (!id) throw new Error('Resizable panes must have an id')\n if (seenIds.has(id)) throw new Error(`Duplicate resizable pane id \"${id}\"`)\n seenIds.add(id)\n\n const minSize = clampPercent(pane.minSize ?? 0)\n const maxSize = Math.max(minSize, clampPercent(pane.maxSize ?? 100))\n return {\n id,\n element: pane.element,\n defaultSize: optionalPercent(pane.defaultSize),\n minSize,\n maxSize,\n disabled: pane.disabled === true,\n }\n}\n\nfunction createInitialLayout(\n panes: readonly NormalizedPane[],\n defaultLayout: ResizablePaneLayout | undefined,\n): ResizablePaneLayout {\n const configured = layoutFromDefaultLayout(panes, defaultLayout)\n if (configured) return configured\n\n const paneDefaults = layoutFromPaneDefaults(panes)\n if (paneDefaults) return paneDefaults\n\n return equalLayout(panes)\n}\n\nfunction layoutFromDefaultLayout(\n panes: readonly NormalizedPane[],\n defaultLayout: ResizablePaneLayout | undefined,\n): ResizablePaneLayout | null {\n if (!defaultLayout) return null\n if (!panes.every((pane) => finiteNumber(defaultLayout[pane.id]))) return null\n return normalizeLayout(defaultLayout, panes)\n}\n\nfunction layoutFromPaneDefaults(panes: readonly NormalizedPane[]): ResizablePaneLayout | null {\n if (!panes.some((pane) => pane.defaultSize !== undefined)) return null\n\n const fixedTotal = sumValues(panes.map((pane) => pane.defaultSize ?? 0))\n const flexiblePanes = panes.filter((pane) => pane.defaultSize === undefined)\n const flexibleSize =\n flexiblePanes.length > 0 ? Math.max(0, 100 - fixedTotal) / flexiblePanes.length : 0\n const layout: Record<string, number> = {}\n for (const pane of panes) layout[pane.id] = pane.defaultSize ?? flexibleSize\n return normalizeLayout(layout, panes)\n}\n\nfunction equalLayout(panes: readonly NormalizedPane[]): ResizablePaneLayout {\n const size = panes.length > 0 ? 100 / panes.length : 0\n const layout: Record<string, number> = {}\n for (const pane of panes) layout[pane.id] = size\n return normalizeLayout(layout, panes)\n}\n\nfunction normalizeLayout(\n layout: ResizablePaneLayout,\n panes: readonly NormalizedPane[],\n): ResizablePaneLayout {\n const nextLayout = mutableLayout(layout, panes)\n return freezeLayout(rebalanceLayout(nextLayout, panes))\n}\n\nfunction mutableLayout(\n layout: ResizablePaneLayout,\n panes: readonly NormalizedPane[],\n): Record<string, number> {\n const nextLayout: Record<string, number> = {}\n for (const pane of panes) nextLayout[pane.id] = clampToPane(layout[pane.id], pane)\n return nextLayout\n}\n\nfunction rebalanceLayout(\n layout: Record<string, number>,\n panes: readonly NormalizedPane[],\n): Record<string, number> {\n let remaining = 100 - sumValues(Object.values(layout))\n let iterations = 0\n while (Math.abs(remaining) > FLOAT_TOLERANCE && iterations < panes.length * 3) {\n const applied = distributeRebalanceDelta(layout, panes, remaining)\n if (Math.abs(applied) <= FLOAT_TOLERANCE) break\n remaining -= applied\n iterations += 1\n }\n return layout\n}\n\nfunction distributeRebalanceDelta(\n layout: Record<string, number>,\n panes: readonly NormalizedPane[],\n remaining: number,\n): number {\n const candidates = rebalanceCandidates(layout, panes, remaining)\n if (candidates.length === 0) return 0\n\n const share = remaining / candidates.length\n let applied = 0\n for (const pane of candidates) applied += applyRebalanceShare(layout, pane, share)\n return applied\n}\n\nfunction rebalanceCandidates(\n layout: Record<string, number>,\n panes: readonly NormalizedPane[],\n remaining: number,\n): readonly NormalizedPane[] {\n if (remaining > 0) return panes.filter((pane) => layout[pane.id] < pane.maxSize)\n return panes.filter((pane) => layout[pane.id] > pane.minSize)\n}\n\nfunction applyRebalanceShare(\n layout: Record<string, number>,\n pane: NormalizedPane,\n share: number,\n): number {\n const current = layout[pane.id] ?? 0\n const next = clampToPane(current + share, pane)\n layout[pane.id] = next\n return next - current\n}\n\nfunction adjustLayoutByDelta(options: {\n readonly delta: number\n readonly initialLayout: ResizablePaneLayout\n readonly panes: readonly NormalizedPane[]\n readonly pivotIndex: number\n readonly prevLayout: ResizablePaneLayout\n}): ResizablePaneLayout {\n const { delta, initialLayout, panes, pivotIndex, prevLayout } = options\n if (Math.abs(delta) <= FLOAT_TOLERANCE) return prevLayout\n\n const nextLayout = mutableLayout(initialLayout, panes)\n const amount = Math.abs(delta)\n const shrinkIndices = shrinkCandidateIndices(delta, panes, pivotIndex)\n const growIndices = growCandidateIndices(delta, panes, pivotIndex)\n const applicableDelta = Math.min(\n amount,\n totalShrinkCapacity(nextLayout, panes, shrinkIndices),\n totalGrowCapacity(nextLayout, panes, growIndices),\n )\n if (applicableDelta <= FLOAT_TOLERANCE) return prevLayout\n\n distributeResizeDelta(nextLayout, panes, shrinkIndices, -applicableDelta)\n distributeResizeDelta(nextLayout, panes, growIndices, applicableDelta)\n const next = freezeLayout(nextLayout)\n if (layoutsEqual(prevLayout, next)) return prevLayout\n return next\n}\n\nfunction shrinkCandidateIndices(\n delta: number,\n panes: readonly NormalizedPane[],\n pivotIndex: number,\n): readonly number[] {\n if (delta > 0) return forwardIndices(pivotIndex + 1, panes.length)\n return reverseIndices(pivotIndex)\n}\n\nfunction growCandidateIndices(\n delta: number,\n panes: readonly NormalizedPane[],\n pivotIndex: number,\n): readonly number[] {\n if (delta > 0) return reverseIndices(pivotIndex)\n return forwardIndices(pivotIndex + 1, panes.length)\n}\n\nfunction forwardIndices(start: number, length: number): readonly number[] {\n const indices: number[] = []\n for (let index = start; index < length; index += 1) indices.push(index)\n return indices\n}\n\nfunction reverseIndices(start: number): readonly number[] {\n const indices: number[] = []\n for (let index = start; index >= 0; index -= 1) indices.push(index)\n return indices\n}\n\nfunction totalShrinkCapacity(\n layout: ResizablePaneLayout,\n panes: readonly NormalizedPane[],\n indices: readonly number[],\n): number {\n return indices.reduce((total, index) => {\n const pane = panes[index]\n if (!pane || pane.disabled) return total\n return total + Math.max(0, (layout[pane.id] ?? 0) - pane.minSize)\n }, 0)\n}\n\nfunction totalGrowCapacity(\n layout: ResizablePaneLayout,\n panes: readonly NormalizedPane[],\n indices: readonly number[],\n): number {\n return indices.reduce((total, index) => {\n const pane = panes[index]\n if (!pane || pane.disabled) return total\n return total + Math.max(0, pane.maxSize - (layout[pane.id] ?? 0))\n }, 0)\n}\n\nfunction distributeResizeDelta(\n layout: Record<string, number>,\n panes: readonly NormalizedPane[],\n indices: readonly number[],\n delta: number,\n): void {\n let remaining = Math.abs(delta)\n const direction = delta < 0 ? -1 : 1\n for (const index of indices) {\n const pane = panes[index]\n if (!pane || pane.disabled) continue\n remaining = applyResizeDelta(layout, pane, remaining, direction)\n if (remaining <= FLOAT_TOLERANCE) return\n }\n}\n\nfunction applyResizeDelta(\n layout: Record<string, number>,\n pane: NormalizedPane,\n remaining: number,\n direction: number,\n): number {\n const current = layout[pane.id] ?? 0\n const target = current + remaining * direction\n const next = clampToPane(target, pane)\n layout[pane.id] = next\n return remaining - Math.abs(next - current)\n}\n\nfunction calculateHandleAria(options: {\n readonly handleIndex: number\n readonly layout: ResizablePaneLayout\n readonly panes: readonly NormalizedPane[]\n}): { readonly min: number; readonly max: number; readonly now: number } {\n const pane = options.panes[options.handleIndex]\n if (!pane) return { min: 0, max: 100, now: 0 }\n\n const now = options.layout[pane.id] ?? 0\n const minLayout = adjustLayoutByDelta({\n delta: pane.minSize - now,\n initialLayout: options.layout,\n panes: options.panes,\n pivotIndex: options.handleIndex,\n prevLayout: options.layout,\n })\n const maxLayout = adjustLayoutByDelta({\n delta: pane.maxSize - now,\n initialLayout: options.layout,\n panes: options.panes,\n pivotIndex: options.handleIndex,\n prevLayout: options.layout,\n })\n return {\n min: minLayout[pane.id] ?? pane.minSize,\n max: maxLayout[pane.id] ?? pane.maxSize,\n now,\n }\n}\n\nfunction nextFocusableHandle(\n handles: readonly MountedHandle[],\n current: MountedHandle,\n reverse: boolean,\n): MountedHandle | null {\n if (handles.length === 0) return null\n\n const index = handles.indexOf(current)\n if (index === -1) return handles[0] ?? null\n const offset = reverse ? -1 : 1\n const nextIndex = (index + offset + handles.length) % handles.length\n return handles[nextIndex] ?? null\n}\n\nfunction notifyLayoutChange(\n mode: LayoutApplyMode,\n layout: ResizablePaneLayout,\n onLayoutChange: ((layout: ResizablePaneLayout) => void) | undefined,\n onLayoutChanged: ((layout: ResizablePaneLayout) => void) | undefined,\n): void {\n if (mode === 'silent') return\n if (mode === 'change' || mode === 'both') onLayoutChange?.({ ...layout })\n if (mode === 'changed' || mode === 'both') onLayoutChanged?.({ ...layout })\n}\n\nfunction layoutsEqual(a: ResizablePaneLayout, b: ResizablePaneLayout): boolean {\n const keys = new Set(Object.keys(a).concat(Object.keys(b)))\n for (const key of keys) {\n if (Math.abs((a[key] ?? 0) - (b[key] ?? 0)) > FLOAT_TOLERANCE) return false\n }\n return true\n}\n\nfunction freezeLayout(layout: Record<string, number>): ResizablePaneLayout {\n return Object.freeze({ ...layout })\n}\n\nfunction clampToPane(value: number | undefined, pane: NormalizedPane): number {\n if (!finiteNumber(value)) return pane.minSize\n return clamp(value, pane.minSize, pane.maxSize)\n}\n\nfunction clampPercent(value: number): number {\n if (!finiteNumber(value)) return 0\n return clamp(value, 0, 100)\n}\n\nfunction optionalPercent(value: number | undefined): number | undefined {\n if (value === undefined) return undefined\n return clampPercent(value)\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value))\n}\n\nfunction finiteNumber(value: unknown): value is number {\n return typeof value === 'number' && Number.isFinite(value)\n}\n\nfunction sumValues(values: readonly number[]): number {\n return values.reduce((total, value) => total + value, 0)\n}\n\nfunction normalizeKeyboardStep(value: number | undefined): number {\n if (!finiteNumber(value) || value <= 0) return DEFAULT_KEYBOARD_STEP\n return value\n}\n\nfunction ensureElementId(element: HTMLElement, fallback: string): void {\n if (element.id) return\n element.id = fallback.replace(/[^a-zA-Z0-9_-]/g, '-')\n}\n\nfunction formatFlexNumber(value: number): string {\n return Number(value.toFixed(4)).toString()\n}\n\nfunction formatAriaNumber(value: number): string {\n return Number(value.toFixed(2)).toString()\n}\n\nfunction pointerIdFromEvent(event: PointerEvent): number | null {\n if (typeof event.pointerId !== 'number') return null\n return event.pointerId\n}\n\nfunction matchesPointer(drag: DragState, event: PointerEvent): boolean {\n if (drag.pointerId === null) return true\n return event.pointerId === drag.pointerId\n}\n\nfunction capturePointer(element: HTMLElement, event: PointerEvent): void {\n if (typeof event.pointerId !== 'number') return\n element.setPointerCapture?.(event.pointerId)\n}\n\nfunction releasePointer(element: HTMLElement, event: PointerEvent): void {\n if (typeof event.pointerId !== 'number') return\n element.releasePointerCapture?.(event.pointerId)\n}\n"],"mappings":";;;AAgFA,IAAa,iBAAiB;CAC5B;EAAE,MAAM;EAAM,SAAS;EAAyB,SAAS;CAA8B;CACvF;EACE,MAAM;EACN,SAAS;EACT,SAAS;CACX;CACA;EACE,MAAM;EACN,SAAS;EACT,SAAS;CACX;CACA;EACE,MAAM;EACN,SAAS;EACT,SAAS;CACX;CACA;EACE,MAAM;EACN,SAAS;EACT,SAAS;CACX;CACA;EACE,MAAM;EACN,SAAS;EACT,SAAS;CACX;CACA;EAAE,MAAM;EAAQ,SAAS;EAAuB,SAAS;CAA8B;CACvF;EAAE,MAAM;EAAO,SAAS;EAAuB,SAAS;CAA8B;AACxF;AAEA,IAAM,wBAAwB;AAC9B,IAAM,kBAAkB;AACxB,IAAI,kBAAkB;AAEtB,IAAa,qBAAb,MAAgC;CAC9B;CACA;CACA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B;CACvE,IAAI,OAAO,MAAM,cAAc,UAAU;CACzC,QAAQ,wBAAwB,MAAM,SAAS;AACjD"}
package/package.json CHANGED
@@ -1,6 +1,24 @@
1
1
  {
2
2
  "name": "@singapore-editor/panes",
3
- "version": "0.1.1",
3
+ "version": "0.2.10",
4
+ "description": "Resizable split panes for browser DOM elements.",
5
+ "keywords": [
6
+ "browser",
7
+ "editor",
8
+ "resize",
9
+ "singapore",
10
+ "split-panes",
11
+ "typescript"
12
+ ],
13
+ "homepage": "https://singapore.shaulavo.dev/docs/reference/api/panes/overview/",
14
+ "bugs": {
15
+ "url": "https://github.com/ShaulLavo/singapore/issues"
16
+ },
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/ShaulLavo/singapore.git"
21
+ },
4
22
  "files": [
5
23
  "README.md",
6
24
  "dist"
@@ -19,22 +37,25 @@
19
37
  },
20
38
  "publishConfig": {
21
39
  "access": "public",
40
+ "provenance": true,
22
41
  "registry": "https://registry.npmjs.org/"
23
42
  },
24
43
  "scripts": {
25
44
  "build": "bun ../../scripts/build-package.ts",
26
45
  "test": "vitest run",
27
- "typecheck": "tsgo --noEmit",
46
+ "typecheck": "tsc --noEmit",
28
47
  "lint": "oxlint .",
29
48
  "format": "oxfmt --write .",
30
49
  "format:check": "oxfmt --check ."
31
50
  },
51
+ "dependencies": {
52
+ "@shaulavo/hotkeys": "^0.0.4"
53
+ },
32
54
  "devDependencies": {
33
- "@typescript/native-preview": "7.0.0-dev.20260707.2",
34
55
  "happy-dom": "^20.14.5",
35
56
  "oxfmt": "0.70.0",
36
57
  "oxlint": "1.85.0",
37
- "typescript": "~6.0.3",
38
- "vitest": "^5.0.2"
58
+ "typescript": "7.0.2",
59
+ "vitest": "5.0.2"
39
60
  }
40
61
  }