@zag-js/splitter 0.10.5 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,3 +1,646 @@
1
- export { anatomy } from './splitter.anatomy.mjs';
2
- export { connect } from './splitter.connect.mjs';
3
- export { machine } from './splitter.machine.mjs';
1
+ // src/splitter.anatomy.ts
2
+ import { createAnatomy } from "@zag-js/anatomy";
3
+ var anatomy = createAnatomy("splitter").parts("root", "panel", "toggleTrigger", "resizeTrigger");
4
+ var parts = anatomy.build();
5
+
6
+ // src/splitter.connect.ts
7
+ import { getEventKey, getEventStep } from "@zag-js/dom-event";
8
+ import { dataAttr } from "@zag-js/dom-query";
9
+
10
+ // src/splitter.dom.ts
11
+ import { createScope, queryAll } from "@zag-js/dom-query";
12
+ var dom = createScope({
13
+ getRootId: (ctx) => ctx.ids?.root ?? `splitter:${ctx.id}`,
14
+ getResizeTriggerId: (ctx, id) => ctx.ids?.resizeTrigger?.(id) ?? `splitter:${ctx.id}:splitter:${id}`,
15
+ getToggleTriggerId: (ctx) => ctx.ids?.toggleTrigger?.(ctx.id) ?? `splitter:${ctx.id}:toggle-btn`,
16
+ getLabelId: (ctx) => ctx.ids?.label ?? `splitter:${ctx.id}:label`,
17
+ getPanelId: (ctx, id) => ctx.ids?.panel?.(id) ?? `splitter:${ctx.id}:panel:${id}`,
18
+ globalCursorId: (ctx) => `splitter:${ctx.id}:global-cursor`,
19
+ getRootEl: (ctx) => dom.queryById(ctx, dom.getRootId(ctx)),
20
+ getResizeTriggerEl: (ctx, id) => dom.getById(ctx, dom.getResizeTriggerId(ctx, id)),
21
+ getPanelEl: (ctx, id) => dom.getById(ctx, dom.getPanelId(ctx, id)),
22
+ getCursor(ctx) {
23
+ const x = ctx.isHorizontal;
24
+ let cursor = x ? "col-resize" : "row-resize";
25
+ if (ctx.activeResizeState.isAtMin)
26
+ cursor = x ? "e-resize" : "s-resize";
27
+ if (ctx.activeResizeState.isAtMax)
28
+ cursor = x ? "w-resize" : "n-resize";
29
+ return cursor;
30
+ },
31
+ getPanelStyle(ctx, id) {
32
+ const flexGrow = ctx.panels.find((panel) => panel.id === id)?.size ?? "0";
33
+ return {
34
+ flexBasis: 0,
35
+ flexGrow,
36
+ flexShrink: 1,
37
+ overflow: "hidden"
38
+ };
39
+ },
40
+ getActiveHandleEl(ctx) {
41
+ const activeId = ctx.activeResizeId;
42
+ if (activeId == null)
43
+ return;
44
+ return dom.getById(ctx, dom.getResizeTriggerId(ctx, activeId));
45
+ },
46
+ getResizeTriggerEls(ctx) {
47
+ const ownerId = CSS.escape(dom.getRootId(ctx));
48
+ return queryAll(dom.getRootEl(ctx), `[role=separator][data-ownedby='${ownerId}']`);
49
+ },
50
+ setupGlobalCursor(ctx) {
51
+ const styleEl = dom.getById(ctx, dom.globalCursorId(ctx));
52
+ const textContent = `* { cursor: ${dom.getCursor(ctx)} !important; }`;
53
+ if (styleEl) {
54
+ styleEl.textContent = textContent;
55
+ } else {
56
+ const style = dom.getDoc(ctx).createElement("style");
57
+ style.id = dom.globalCursorId(ctx);
58
+ style.textContent = textContent;
59
+ dom.getDoc(ctx).head.appendChild(style);
60
+ }
61
+ },
62
+ removeGlobalCursor(ctx) {
63
+ dom.getById(ctx, dom.globalCursorId(ctx))?.remove();
64
+ }
65
+ });
66
+
67
+ // src/splitter.utils.ts
68
+ function validateSize(key, size) {
69
+ if (Math.floor(size) > 100) {
70
+ throw new Error(`Total ${key} of panels cannot be greater than 100`);
71
+ }
72
+ }
73
+ function getNormalizedPanels(ctx) {
74
+ let numOfPanelsWithoutSize = 0;
75
+ let totalSize = 0;
76
+ let totalMinSize = 0;
77
+ const panels = ctx.size.map((panel) => {
78
+ const minSize = panel.minSize ?? 0;
79
+ const maxSize = panel.maxSize ?? 100;
80
+ totalMinSize += minSize;
81
+ if (panel.size == null) {
82
+ numOfPanelsWithoutSize++;
83
+ } else {
84
+ totalSize += panel.size;
85
+ }
86
+ return {
87
+ ...panel,
88
+ minSize,
89
+ maxSize
90
+ };
91
+ });
92
+ validateSize("minSize", totalMinSize);
93
+ validateSize("size", totalSize);
94
+ let end = 0;
95
+ let remainingSize = 0;
96
+ const result = panels.map((panel) => {
97
+ let start = end;
98
+ if (panel.size != null) {
99
+ end += panel.size;
100
+ remainingSize = panel.size - panel.minSize;
101
+ return {
102
+ ...panel,
103
+ start,
104
+ end,
105
+ remainingSize
106
+ };
107
+ }
108
+ const size = (100 - totalSize) / numOfPanelsWithoutSize;
109
+ end += size;
110
+ remainingSize = size - panel.minSize;
111
+ return { ...panel, size, start, end, remainingSize };
112
+ });
113
+ return result;
114
+ }
115
+ function getHandlePanels(ctx, id = ctx.activeResizeId) {
116
+ const [beforeId, afterId] = id?.split(":") ?? [];
117
+ if (!beforeId || !afterId)
118
+ return;
119
+ const beforeIndex = ctx.previousPanels.findIndex((panel) => panel.id === beforeId);
120
+ const afterIndex = ctx.previousPanels.findIndex((panel) => panel.id === afterId);
121
+ if (beforeIndex === -1 || afterIndex === -1)
122
+ return;
123
+ const before = ctx.previousPanels[beforeIndex];
124
+ const after = ctx.previousPanels[afterIndex];
125
+ return {
126
+ before: {
127
+ ...before,
128
+ index: beforeIndex
129
+ },
130
+ after: {
131
+ ...after,
132
+ index: afterIndex
133
+ }
134
+ };
135
+ }
136
+ function getHandleBounds(ctx, id = ctx.activeResizeId) {
137
+ const panels = getHandlePanels(ctx, id);
138
+ if (!panels)
139
+ return;
140
+ const { before, after } = panels;
141
+ return {
142
+ min: Math.max(before.start + before.minSize, after.end - after.maxSize),
143
+ max: Math.min(after.end - after.minSize, before.maxSize + before.start)
144
+ };
145
+ }
146
+ function getPanelBounds(ctx, id) {
147
+ const bounds = getHandleBounds(ctx, id);
148
+ const panels = getHandlePanels(ctx, id);
149
+ if (!bounds || !panels)
150
+ return;
151
+ const { before, after } = panels;
152
+ const beforeMin = Math.abs(before.start - bounds.min);
153
+ const afterMin = after.size + (before.size - beforeMin);
154
+ const beforeMax = Math.abs(before.start - bounds.max);
155
+ const afterMax = after.size - (beforeMax - before.size);
156
+ return {
157
+ before: {
158
+ index: before.index,
159
+ min: beforeMin,
160
+ max: beforeMax,
161
+ isAtMin: beforeMin === before.size,
162
+ isAtMax: beforeMax === before.size,
163
+ up(step) {
164
+ return Math.min(before.size + step, beforeMax);
165
+ },
166
+ down(step) {
167
+ return Math.max(before.size - step, beforeMin);
168
+ }
169
+ },
170
+ after: {
171
+ index: after.index,
172
+ min: afterMin,
173
+ max: afterMax,
174
+ isAtMin: afterMin === after.size,
175
+ isAtMax: afterMax === after.size,
176
+ up(step) {
177
+ return Math.min(after.size + step, afterMin);
178
+ },
179
+ down(step) {
180
+ return Math.max(after.size - step, afterMax);
181
+ }
182
+ }
183
+ };
184
+ }
185
+ function clamp(value, min, max) {
186
+ return Math.min(Math.max(value, min), max);
187
+ }
188
+
189
+ // src/splitter.connect.ts
190
+ function connect(state, send, normalize) {
191
+ const isHorizontal = state.context.isHorizontal;
192
+ const isFocused = state.hasTag("focus");
193
+ const isDragging = state.matches("dragging");
194
+ const panels = state.context.panels;
195
+ const api = {
196
+ /**
197
+ * Whether the splitter is focused.
198
+ */
199
+ isFocused,
200
+ /**
201
+ * Whether the splitter is being dragged.
202
+ */
203
+ isDragging,
204
+ /**
205
+ * The bounds of the currently dragged splitter handle.
206
+ */
207
+ bounds: getHandleBounds(state.context),
208
+ /**
209
+ * Function to set a panel to its minimum size.
210
+ */
211
+ setToMinSize(id) {
212
+ const panel = panels.find((panel2) => panel2.id === id);
213
+ send({ type: "SET_PANEL_SIZE", id, size: panel?.minSize, src: "setToMinSize" });
214
+ },
215
+ /**
216
+ * Function to set a panel to its maximum size.
217
+ */
218
+ setToMaxSize(id) {
219
+ const panel = panels.find((panel2) => panel2.id === id);
220
+ send({ type: "SET_PANEL_SIZE", id, size: panel?.maxSize, src: "setToMaxSize" });
221
+ },
222
+ /**
223
+ * Function to set the size of a panel.
224
+ */
225
+ setSize(id, size) {
226
+ send({ type: "SET_PANEL_SIZE", id, size });
227
+ },
228
+ /**
229
+ * Returns the state details for a resize trigger.
230
+ */
231
+ getResizeTriggerState(props) {
232
+ const { id, disabled } = props;
233
+ const ids = id.split(":");
234
+ const panelIds = ids.map((id2) => dom.getPanelId(state.context, id2));
235
+ const panels2 = getHandleBounds(state.context, id);
236
+ return {
237
+ isDisabled: !!disabled,
238
+ isFocused: state.context.activeResizeId === id && isFocused,
239
+ panelIds,
240
+ min: panels2?.min,
241
+ max: panels2?.max,
242
+ value: 0
243
+ };
244
+ },
245
+ rootProps: normalize.element({
246
+ ...parts.root.attrs,
247
+ "data-orientation": state.context.orientation,
248
+ id: dom.getRootId(state.context),
249
+ dir: state.context.dir,
250
+ style: {
251
+ display: "flex",
252
+ flexDirection: isHorizontal ? "row" : "column",
253
+ height: "100%",
254
+ width: "100%",
255
+ overflow: "hidden"
256
+ }
257
+ }),
258
+ getPanelProps(props) {
259
+ const { id } = props;
260
+ return normalize.element({
261
+ ...parts.panel.attrs,
262
+ dir: state.context.dir,
263
+ id: dom.getPanelId(state.context, id),
264
+ "data-ownedby": dom.getRootId(state.context),
265
+ style: dom.getPanelStyle(state.context, id)
266
+ });
267
+ },
268
+ getResizeTriggerProps(props) {
269
+ const { id, disabled, step = 1 } = props;
270
+ const triggerState = api.getResizeTriggerState(props);
271
+ return normalize.element({
272
+ ...parts.resizeTrigger.attrs,
273
+ dir: state.context.dir,
274
+ id: dom.getResizeTriggerId(state.context, id),
275
+ role: "separator",
276
+ "data-ownedby": dom.getRootId(state.context),
277
+ tabIndex: disabled ? void 0 : 0,
278
+ "aria-valuenow": triggerState.value,
279
+ "aria-valuemin": triggerState.min,
280
+ "aria-valuemax": triggerState.max,
281
+ "data-orientation": state.context.orientation,
282
+ "aria-orientation": state.context.orientation,
283
+ "aria-controls": triggerState.panelIds.join(" "),
284
+ "data-focus": dataAttr(triggerState.isFocused),
285
+ "data-disabled": dataAttr(disabled),
286
+ style: {
287
+ touchAction: "none",
288
+ userSelect: "none",
289
+ flex: "0 0 auto",
290
+ pointerEvents: isDragging && !triggerState.isFocused ? "none" : void 0,
291
+ cursor: isHorizontal ? "col-resize" : "row-resize",
292
+ [isHorizontal ? "minHeight" : "minWidth"]: "0"
293
+ },
294
+ onPointerDown(event) {
295
+ if (disabled) {
296
+ event.preventDefault();
297
+ return;
298
+ }
299
+ send({ type: "POINTER_DOWN", id });
300
+ event.preventDefault();
301
+ event.stopPropagation();
302
+ },
303
+ onPointerOver() {
304
+ if (disabled)
305
+ return;
306
+ send({ type: "POINTER_OVER", id });
307
+ },
308
+ onPointerLeave() {
309
+ if (disabled)
310
+ return;
311
+ send({ type: "POINTER_LEAVE", id });
312
+ },
313
+ onBlur() {
314
+ send("BLUR");
315
+ },
316
+ onFocus() {
317
+ send({ type: "FOCUS", id });
318
+ },
319
+ onDoubleClick() {
320
+ if (disabled)
321
+ return;
322
+ send({ type: "DOUBLE_CLICK", id });
323
+ },
324
+ onKeyDown(event) {
325
+ if (disabled)
326
+ return;
327
+ const moveStep = getEventStep(event) * step;
328
+ const keyMap = {
329
+ Enter() {
330
+ send("ENTER");
331
+ },
332
+ ArrowUp() {
333
+ send({ type: "ARROW_UP", step: moveStep });
334
+ },
335
+ ArrowDown() {
336
+ send({ type: "ARROW_DOWN", step: moveStep });
337
+ },
338
+ ArrowLeft() {
339
+ send({ type: "ARROW_LEFT", step: moveStep });
340
+ },
341
+ ArrowRight() {
342
+ send({ type: "ARROW_RIGHT", step: moveStep });
343
+ },
344
+ Home() {
345
+ send("HOME");
346
+ },
347
+ End() {
348
+ send("END");
349
+ }
350
+ };
351
+ const key = getEventKey(event, state.context);
352
+ const exec = keyMap[key];
353
+ if (exec) {
354
+ exec(event);
355
+ event.preventDefault();
356
+ }
357
+ }
358
+ });
359
+ }
360
+ };
361
+ return api;
362
+ }
363
+
364
+ // src/splitter.machine.ts
365
+ import { createMachine } from "@zag-js/core";
366
+ import { getRelativePoint, trackPointerMove } from "@zag-js/dom-event";
367
+ import { raf } from "@zag-js/dom-query";
368
+ import { compact } from "@zag-js/utils";
369
+ function machine(userContext) {
370
+ const ctx = compact(userContext);
371
+ return createMachine(
372
+ {
373
+ id: "splitter",
374
+ initial: "idle",
375
+ context: {
376
+ orientation: "horizontal",
377
+ activeResizeId: null,
378
+ previousPanels: [],
379
+ size: [],
380
+ initialSize: [],
381
+ activeResizeState: {
382
+ isAtMin: false,
383
+ isAtMax: false
384
+ },
385
+ ...ctx
386
+ },
387
+ created: ["setPreviousPanels", "setInitialSize"],
388
+ watch: {
389
+ size: ["setActiveResizeState"]
390
+ },
391
+ computed: {
392
+ isHorizontal: (ctx2) => ctx2.orientation === "horizontal",
393
+ panels: (ctx2) => getNormalizedPanels(ctx2)
394
+ },
395
+ on: {
396
+ SET_PANEL_SIZE: {
397
+ actions: "setPanelSize"
398
+ }
399
+ },
400
+ states: {
401
+ idle: {
402
+ entry: ["clearActiveHandleId"],
403
+ on: {
404
+ POINTER_OVER: {
405
+ target: "hover:temp",
406
+ actions: ["setActiveHandleId"]
407
+ },
408
+ FOCUS: {
409
+ target: "focused",
410
+ actions: ["setActiveHandleId"]
411
+ },
412
+ DOUBLE_CLICK: {
413
+ actions: ["resetStartPanel", "setPreviousPanels"]
414
+ }
415
+ }
416
+ },
417
+ "hover:temp": {
418
+ after: {
419
+ HOVER_DELAY: "hover"
420
+ },
421
+ on: {
422
+ POINTER_DOWN: {
423
+ target: "dragging",
424
+ actions: ["setActiveHandleId", "invokeOnResizeStart"]
425
+ },
426
+ POINTER_LEAVE: "idle"
427
+ }
428
+ },
429
+ hover: {
430
+ tags: ["focus"],
431
+ on: {
432
+ POINTER_DOWN: {
433
+ target: "dragging",
434
+ actions: ["invokeOnResizeStart"]
435
+ },
436
+ POINTER_LEAVE: "idle"
437
+ }
438
+ },
439
+ focused: {
440
+ tags: ["focus"],
441
+ on: {
442
+ BLUR: "idle",
443
+ POINTER_DOWN: {
444
+ target: "dragging",
445
+ actions: ["setActiveHandleId", "invokeOnResizeStart"]
446
+ },
447
+ ARROW_LEFT: {
448
+ guard: "isHorizontal",
449
+ actions: ["shrinkStartPanel", "setPreviousPanels"]
450
+ },
451
+ ARROW_RIGHT: {
452
+ guard: "isHorizontal",
453
+ actions: ["expandStartPanel", "setPreviousPanels"]
454
+ },
455
+ ARROW_UP: {
456
+ guard: "isVertical",
457
+ actions: ["shrinkStartPanel", "setPreviousPanels"]
458
+ },
459
+ ARROW_DOWN: {
460
+ guard: "isVertical",
461
+ actions: ["expandStartPanel", "setPreviousPanels"]
462
+ },
463
+ ENTER: [
464
+ {
465
+ guard: "isStartPanelAtMax",
466
+ actions: ["setStartPanelToMin", "setPreviousPanels"]
467
+ },
468
+ { actions: ["setStartPanelToMax", "setPreviousPanels"] }
469
+ ],
470
+ HOME: {
471
+ actions: ["setStartPanelToMin", "setPreviousPanels"]
472
+ },
473
+ END: {
474
+ actions: ["setStartPanelToMax", "setPreviousPanels"]
475
+ }
476
+ }
477
+ },
478
+ dragging: {
479
+ tags: ["focus"],
480
+ entry: "focusResizeHandle",
481
+ activities: ["trackPointerMove"],
482
+ on: {
483
+ POINTER_MOVE: {
484
+ actions: ["setPointerValue", "setGlobalCursor"]
485
+ },
486
+ POINTER_UP: {
487
+ target: "focused",
488
+ actions: ["invokeOnResizeEnd", "setPreviousPanels", "clearGlobalCursor", "blurResizeHandle"]
489
+ }
490
+ }
491
+ }
492
+ }
493
+ },
494
+ {
495
+ activities: {
496
+ trackPointerMove: (ctx2, _evt, { send }) => {
497
+ const doc = dom.getDoc(ctx2);
498
+ return trackPointerMove(doc, {
499
+ onPointerMove(info) {
500
+ send({ type: "POINTER_MOVE", point: info.point });
501
+ },
502
+ onPointerUp() {
503
+ send("POINTER_UP");
504
+ }
505
+ });
506
+ }
507
+ },
508
+ guards: {
509
+ isStartPanelAtMin: (ctx2) => ctx2.activeResizeState.isAtMin,
510
+ isStartPanelAtMax: (ctx2) => ctx2.activeResizeState.isAtMax,
511
+ isHorizontal: (ctx2) => ctx2.isHorizontal,
512
+ isVertical: (ctx2) => !ctx2.isHorizontal
513
+ },
514
+ delays: {
515
+ HOVER_DELAY: 250
516
+ },
517
+ actions: {
518
+ setGlobalCursor(ctx2) {
519
+ dom.setupGlobalCursor(ctx2);
520
+ },
521
+ clearGlobalCursor(ctx2) {
522
+ dom.removeGlobalCursor(ctx2);
523
+ },
524
+ invokeOnResize(ctx2) {
525
+ ctx2.onResize?.({ size: ctx2.size, activeHandleId: ctx2.activeResizeId });
526
+ },
527
+ invokeOnResizeStart(ctx2) {
528
+ ctx2.onResizeStart?.({ size: ctx2.size, activeHandleId: ctx2.activeResizeId });
529
+ },
530
+ invokeOnResizeEnd(ctx2) {
531
+ ctx2.onResizeEnd?.({ size: ctx2.size, activeHandleId: ctx2.activeResizeId });
532
+ },
533
+ setActiveHandleId(ctx2, evt) {
534
+ ctx2.activeResizeId = evt.id;
535
+ },
536
+ clearActiveHandleId(ctx2) {
537
+ ctx2.activeResizeId = null;
538
+ },
539
+ setInitialSize(ctx2) {
540
+ ctx2.initialSize = ctx2.panels.slice().map((panel) => ({
541
+ id: panel.id,
542
+ size: panel.size
543
+ }));
544
+ },
545
+ setPanelSize(ctx2, evt) {
546
+ const { id, size } = evt;
547
+ ctx2.size = ctx2.size.map((panel) => {
548
+ const panelSize = clamp(size, panel.minSize ?? 0, panel.maxSize ?? 100);
549
+ return panel.id === id ? { ...panel, size: panelSize } : panel;
550
+ });
551
+ },
552
+ setStartPanelToMin(ctx2) {
553
+ const bounds = getPanelBounds(ctx2);
554
+ if (!bounds)
555
+ return;
556
+ const { before, after } = bounds;
557
+ ctx2.size[before.index].size = before.min;
558
+ ctx2.size[after.index].size = after.min;
559
+ },
560
+ setStartPanelToMax(ctx2) {
561
+ const bounds = getPanelBounds(ctx2);
562
+ if (!bounds)
563
+ return;
564
+ const { before, after } = bounds;
565
+ ctx2.size[before.index].size = before.max;
566
+ ctx2.size[after.index].size = after.max;
567
+ },
568
+ expandStartPanel(ctx2, evt) {
569
+ const bounds = getPanelBounds(ctx2);
570
+ if (!bounds)
571
+ return;
572
+ const { before, after } = bounds;
573
+ ctx2.size[before.index].size = before.up(evt.step);
574
+ ctx2.size[after.index].size = after.down(evt.step);
575
+ },
576
+ shrinkStartPanel(ctx2, evt) {
577
+ const bounds = getPanelBounds(ctx2);
578
+ if (!bounds)
579
+ return;
580
+ const { before, after } = bounds;
581
+ ctx2.size[before.index].size = before.down(evt.step);
582
+ ctx2.size[after.index].size = after.up(evt.step);
583
+ },
584
+ resetStartPanel(ctx2, evt) {
585
+ const bounds = getPanelBounds(ctx2, evt.id);
586
+ if (!bounds)
587
+ return;
588
+ const { before, after } = bounds;
589
+ ctx2.size[before.index].size = ctx2.initialSize[before.index].size;
590
+ ctx2.size[after.index].size = ctx2.initialSize[after.index].size;
591
+ },
592
+ focusResizeHandle(ctx2) {
593
+ raf(() => {
594
+ dom.getActiveHandleEl(ctx2)?.focus({ preventScroll: true });
595
+ });
596
+ },
597
+ blurResizeHandle(ctx2) {
598
+ raf(() => {
599
+ dom.getActiveHandleEl(ctx2)?.blur();
600
+ });
601
+ },
602
+ setPreviousPanels(ctx2) {
603
+ ctx2.previousPanels = ctx2.panels.slice();
604
+ },
605
+ setActiveResizeState(ctx2) {
606
+ const panels = getPanelBounds(ctx2);
607
+ if (!panels)
608
+ return;
609
+ const { before } = panels;
610
+ ctx2.activeResizeState = {
611
+ isAtMin: before.isAtMin,
612
+ isAtMax: before.isAtMax
613
+ };
614
+ },
615
+ setPointerValue(ctx2, evt) {
616
+ const panels = getHandlePanels(ctx2);
617
+ const bounds = getHandleBounds(ctx2);
618
+ if (!panels || !bounds)
619
+ return;
620
+ const rootEl = dom.getRootEl(ctx2);
621
+ const relativePoint = getRelativePoint(evt.point, rootEl);
622
+ const percentValue = relativePoint.getPercentValue({
623
+ dir: ctx2.dir,
624
+ orientation: ctx2.orientation
625
+ });
626
+ let pointValue = percentValue * 100;
627
+ ctx2.activeResizeState = {
628
+ isAtMin: pointValue < bounds.min,
629
+ isAtMax: pointValue > bounds.max
630
+ };
631
+ pointValue = clamp(pointValue, bounds.min, bounds.max);
632
+ const { before, after } = panels;
633
+ const offset = pointValue - before.end;
634
+ ctx2.size[before.index].size = before.size + offset;
635
+ ctx2.size[after.index].size = after.size - offset;
636
+ }
637
+ }
638
+ }
639
+ );
640
+ }
641
+ export {
642
+ anatomy,
643
+ connect,
644
+ machine
645
+ };
646
+ //# sourceMappingURL=index.mjs.map