@zag-js/splitter 0.2.6 → 0.2.8

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,13 +1,14 @@
1
1
  import {
2
2
  connect
3
- } from "./chunk-7IDNY7GP.mjs";
3
+ } from "./chunk-UC2SKBKO.mjs";
4
4
  import {
5
5
  anatomy
6
- } from "./chunk-DX6NGFGC.mjs";
6
+ } from "./chunk-HPRMFGOY.mjs";
7
7
  import {
8
8
  machine
9
- } from "./chunk-F2ZDEPE3.mjs";
10
- import "./chunk-A3GF7W2N.mjs";
9
+ } from "./chunk-IOEWCDUH.mjs";
10
+ import "./chunk-T56NFB6E.mjs";
11
+ import "./chunk-SQ3UMXCZ.mjs";
11
12
  export {
12
13
  anatomy,
13
14
  connect,
@@ -1,6 +1,6 @@
1
1
  import * as _zag_js_anatomy from '@zag-js/anatomy';
2
2
 
3
- declare const anatomy: _zag_js_anatomy.AnatomyInstance<"splitter" | "root" | "secondaryPane" | "primaryPane" | "toggleButton" | "label">;
4
- declare const parts: Record<"splitter" | "root" | "secondaryPane" | "primaryPane" | "toggleButton" | "label", _zag_js_anatomy.AnatomyPart>;
3
+ declare const anatomy: _zag_js_anatomy.AnatomyInstance<"root" | "panel" | "toggleTrigger" | "resizeTrigger">;
4
+ declare const parts: Record<"root" | "panel" | "toggleTrigger" | "resizeTrigger", _zag_js_anatomy.AnatomyPart>;
5
5
 
6
6
  export { anatomy, parts };
@@ -25,14 +25,7 @@ __export(splitter_anatomy_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(splitter_anatomy_exports);
27
27
  var import_anatomy = require("@zag-js/anatomy");
28
- var anatomy = (0, import_anatomy.createAnatomy)("splitter").parts(
29
- "root",
30
- "secondaryPane",
31
- "primaryPane",
32
- "toggleButton",
33
- "label",
34
- "splitter"
35
- );
28
+ var anatomy = (0, import_anatomy.createAnatomy)("splitter").parts("root", "panel", "toggleTrigger", "resizeTrigger");
36
29
  var parts = anatomy.build();
37
30
  // Annotate the CommonJS export names for ESM import in node:
38
31
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  anatomy,
3
3
  parts
4
- } from "./chunk-DX6NGFGC.mjs";
4
+ } from "./chunk-HPRMFGOY.mjs";
5
5
  export {
6
6
  anatomy,
7
7
  parts
@@ -1,23 +1,29 @@
1
1
  import { PropTypes, NormalizeProps } from '@zag-js/types';
2
- import { State, Send } from './splitter.types.js';
2
+ import { State, Send, PanelId, PanelProps, ResizeTriggerProps } from './splitter.types.js';
3
3
  import '@zag-js/core';
4
4
 
5
5
  declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
6
- isCollapsed: boolean;
7
- isExpanded: boolean;
8
6
  isFocused: boolean;
9
7
  isDragging: boolean;
10
- value: number;
11
- collapse(): void;
12
- expand(): void;
13
- toggle(): void;
14
- setSize(size: number): void;
8
+ bounds: {
9
+ min: number;
10
+ max: number;
11
+ } | undefined;
12
+ collapse(id: PanelId): void;
13
+ expand(id: PanelId): void;
14
+ toggle(id: PanelId): void;
15
+ setSize(id: PanelId, size: number): void;
15
16
  rootProps: T["element"];
16
- secondaryPaneProps: T["element"];
17
- primaryPaneProps: T["element"];
18
- toggleButtonProps: T["element"];
19
- labelProps: T["element"];
20
- splitterProps: T["element"];
17
+ getPanelProps(props: PanelProps): T["element"];
18
+ getResizeTriggerState(props: ResizeTriggerProps): {
19
+ isDisabled: boolean;
20
+ isFocused: boolean;
21
+ panelIds: string[];
22
+ min: number | undefined;
23
+ max: number | undefined;
24
+ value: number;
25
+ };
26
+ getResizeTriggerProps(props: ResizeTriggerProps): T["element"];
21
27
  };
22
28
 
23
29
  export { connect };
@@ -56,25 +56,7 @@ function defineDomHelpers(helpers) {
56
56
  return (_a = dom2.getDoc(ctx).defaultView) != null ? _a : window;
57
57
  },
58
58
  getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
59
- getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
60
- createEmitter: (ctx, target) => {
61
- const win = dom2.getWin(ctx);
62
- return function emit(evt, detail, options) {
63
- const { bubbles = true, cancelable, composed = true } = options != null ? options : {};
64
- const eventName = `zag:${evt}`;
65
- const init = { bubbles, cancelable, composed, detail };
66
- const event = new win.CustomEvent(eventName, init);
67
- target.dispatchEvent(event);
68
- };
69
- },
70
- createListener: (target) => {
71
- return function listen(evt, handler) {
72
- const eventName = `zag:${evt}`;
73
- const listener = (e) => handler(e);
74
- target.addEventListener(eventName, listener);
75
- return () => target.removeEventListener(eventName, listener);
76
- };
77
- }
59
+ getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
78
60
  };
79
61
  return {
80
62
  ...dom2,
@@ -119,222 +101,261 @@ function getEventStep(event) {
119
101
  }
120
102
  }
121
103
 
104
+ // ../../utilities/dom/src/nodelist.ts
105
+ function queryAll(root, selector) {
106
+ var _a;
107
+ return Array.from((_a = root == null ? void 0 : root.querySelectorAll(selector)) != null ? _a : []);
108
+ }
109
+
122
110
  // src/splitter.anatomy.ts
123
111
  var import_anatomy = require("@zag-js/anatomy");
124
- var anatomy = (0, import_anatomy.createAnatomy)("splitter").parts(
125
- "root",
126
- "secondaryPane",
127
- "primaryPane",
128
- "toggleButton",
129
- "label",
130
- "splitter"
131
- );
112
+ var anatomy = (0, import_anatomy.createAnatomy)("splitter").parts("root", "panel", "toggleTrigger", "resizeTrigger");
132
113
  var parts = anatomy.build();
133
114
 
134
115
  // src/splitter.dom.ts
135
116
  var dom = defineDomHelpers({
136
- getRootId: (ctx) => {
137
- var _a, _b;
138
- return (_b = (_a = ctx.ids) == null ? void 0 : _a.root) != null ? _b : `splitter:${ctx.id}`;
139
- },
140
- getSplitterId: (ctx) => {
141
- var _a, _b;
142
- return (_b = (_a = ctx.ids) == null ? void 0 : _a.splitter) != null ? _b : `splitter:${ctx.id}:splitter`;
143
- },
144
- getToggleButtonId: (ctx) => {
145
- var _a, _b;
146
- return (_b = (_a = ctx.ids) == null ? void 0 : _a.toggleBtn) != null ? _b : `splitter:${ctx.id}:toggle-btn`;
147
- },
148
- getLabelId: (ctx) => {
149
- var _a, _b;
150
- return (_b = (_a = ctx.ids) == null ? void 0 : _a.label) != null ? _b : `splitter:${ctx.id}:label`;
151
- },
152
- getPrimaryPaneId: (ctx) => {
153
- var _a, _b;
154
- return (_b = (_a = ctx.ids) == null ? void 0 : _a.primaryPane) != null ? _b : `splitter:${ctx.id}:primary`;
155
- },
156
- getSecondaryPaneId: (ctx) => {
157
- var _a, _b;
158
- return (_b = (_a = ctx.ids) == null ? void 0 : _a.secondaryPane) != null ? _b : `splitter:${ctx.id}:secondary`;
159
- },
160
- getSplitterEl: (ctx) => dom.getById(ctx, dom.getSplitterId(ctx)),
161
- getPrimaryPaneEl: (ctx) => dom.getById(ctx, dom.getPrimaryPaneId(ctx)),
117
+ getRootId: (ctx) => `splitter:${ctx.id}`,
118
+ getResizeTriggerId: (ctx, id) => `splitter:${ctx.id}:splitter:${id}`,
119
+ getToggleTriggerId: (ctx) => `splitter:${ctx.id}:toggle-btn`,
120
+ getLabelId: (ctx) => `splitter:${ctx.id}:label`,
121
+ getPanelId: (ctx, id) => `splitter:${ctx.id}:panel:${id}`,
122
+ globalCursorId: (ctx) => `splitter:${ctx.id}:global-cursor`,
123
+ getRootEl: (ctx) => dom.getById(ctx, dom.getRootId(ctx)),
124
+ getResizeTriggerEl: (ctx, id) => dom.getById(ctx, dom.getResizeTriggerId(ctx, id)),
125
+ getPanelEl: (ctx, id) => dom.getById(ctx, dom.getPanelId(ctx, id)),
162
126
  getCursor(ctx) {
163
- if (ctx.disabled || ctx.fixed)
164
- return "default";
165
127
  const x = ctx.isHorizontal;
166
128
  let cursor = x ? "col-resize" : "row-resize";
167
- if (ctx.isAtMin)
129
+ if (ctx.activeResizeState.isAtMin)
168
130
  cursor = x ? "e-resize" : "s-resize";
169
- if (ctx.isAtMax)
131
+ if (ctx.activeResizeState.isAtMax)
170
132
  cursor = x ? "w-resize" : "n-resize";
171
133
  return cursor;
134
+ },
135
+ getPanelStyle(ctx, id) {
136
+ var _a, _b;
137
+ const flexGrow = (_b = (_a = ctx.panels.find((panel) => panel.id === id)) == null ? void 0 : _a.size) != null ? _b : "0";
138
+ return {
139
+ flexBasis: 0,
140
+ flexGrow,
141
+ flexShrink: 1,
142
+ overflow: "hidden"
143
+ };
144
+ },
145
+ getActiveHandleEl(ctx) {
146
+ const activeId = ctx.activeResizeId;
147
+ if (activeId == null)
148
+ return;
149
+ return dom.getById(ctx, dom.getResizeTriggerId(ctx, activeId));
150
+ },
151
+ getResizeTriggerEls(ctx) {
152
+ const ownerId = CSS.escape(dom.getRootId(ctx));
153
+ return queryAll(dom.getRootEl(ctx), `[role=separator][data-ownedby='${ownerId}']`);
154
+ },
155
+ setupGlobalCursor(ctx) {
156
+ const styleEl = dom.getById(ctx, dom.globalCursorId(ctx));
157
+ const textContent = `* { cursor: ${dom.getCursor(ctx)} !important; }`;
158
+ if (styleEl) {
159
+ styleEl.textContent = textContent;
160
+ } else {
161
+ const style = dom.getDoc(ctx).createElement("style");
162
+ style.id = dom.globalCursorId(ctx);
163
+ style.textContent = textContent;
164
+ dom.getDoc(ctx).head.appendChild(style);
165
+ }
166
+ },
167
+ removeGlobalCursor(ctx) {
168
+ var _a;
169
+ (_a = dom.getById(ctx, dom.globalCursorId(ctx))) == null ? void 0 : _a.remove();
172
170
  }
173
171
  });
174
172
 
173
+ // src/splitter.utils.ts
174
+ function getHandlePanels(ctx, id = ctx.activeResizeId) {
175
+ var _a;
176
+ const [beforeId, afterId] = (_a = id == null ? void 0 : id.split(":")) != null ? _a : [];
177
+ if (!beforeId || !afterId)
178
+ return;
179
+ const beforeIndex = ctx.previousPanels.findIndex((panel) => panel.id === beforeId);
180
+ const afterIndex = ctx.previousPanels.findIndex((panel) => panel.id === afterId);
181
+ if (beforeIndex === -1 || afterIndex === -1)
182
+ return;
183
+ const before = ctx.previousPanels[beforeIndex];
184
+ const after = ctx.previousPanels[afterIndex];
185
+ return {
186
+ before: {
187
+ ...before,
188
+ index: beforeIndex
189
+ },
190
+ after: {
191
+ ...after,
192
+ index: afterIndex
193
+ }
194
+ };
195
+ }
196
+ function getHandleBounds(ctx, id = ctx.activeResizeId) {
197
+ const panels = getHandlePanels(ctx, id);
198
+ if (!panels)
199
+ return;
200
+ const { before, after } = panels;
201
+ return {
202
+ min: Math.max(before.start + before.minSize, after.end - after.maxSize),
203
+ max: Math.min(after.end - after.minSize, before.maxSize + before.start)
204
+ };
205
+ }
206
+
175
207
  // src/splitter.connect.ts
176
208
  function connect(state, send, normalize) {
177
209
  const isHorizontal = state.context.isHorizontal;
178
- const isDisabled = state.context.disabled;
179
210
  const isFocused = state.hasTag("focus");
180
211
  const isDragging = state.matches("dragging");
181
- const isAtMin = state.context.isAtMin;
182
- const isAtMax = state.context.isAtMax;
183
- const min = state.context.min;
184
- const max = state.context.max;
185
- const value = state.context.value;
186
- return {
187
- isCollapsed: isAtMin,
188
- isExpanded: isAtMax,
212
+ const api = {
189
213
  isFocused,
190
214
  isDragging,
191
- value,
192
- collapse() {
193
- send("COLLAPSE");
215
+ bounds: getHandleBounds(state.context),
216
+ collapse(id) {
217
+ send({ type: "COLLAPSE", id });
194
218
  },
195
- expand() {
196
- send("EXPAND");
219
+ expand(id) {
220
+ send({ type: "EXPAND", id });
197
221
  },
198
- toggle() {
199
- send("TOGGLE");
222
+ toggle(id) {
223
+ send({ type: "TOGGLE", id });
200
224
  },
201
- setSize(size) {
202
- send({ type: "SET_SIZE", size });
225
+ setSize(id, size) {
226
+ send({ type: "SET_SIZE", id, size });
203
227
  },
204
228
  rootProps: normalize.element({
205
229
  ...parts.root.attrs,
206
230
  "data-orientation": state.context.orientation,
207
- "data-disabled": dataAttr(isDisabled),
208
231
  id: dom.getRootId(state.context),
232
+ dir: state.context.dir,
209
233
  style: {
210
234
  display: "flex",
211
- flex: "1 1 0%",
212
- flexDirection: isHorizontal ? "row" : "column"
213
- }
214
- }),
215
- secondaryPaneProps: normalize.element({
216
- ...parts.secondaryPane.attrs,
217
- "data-disabled": dataAttr(isDisabled),
218
- id: dom.getSecondaryPaneId(state.context),
219
- style: {
220
- height: isHorizontal ? "100%" : "auto",
221
- width: isHorizontal ? "auto" : "100%",
222
- flex: "1 1 auto",
223
- position: "relative"
224
- }
225
- }),
226
- primaryPaneProps: normalize.element({
227
- ...parts.primaryPane.attrs,
228
- id: dom.getPrimaryPaneId(state.context),
229
- "data-disabled": dataAttr(isDisabled),
230
- "data-state": isAtMax ? "at-max" : isAtMin ? "at-min" : "between",
231
- style: {
232
- visibility: "visible",
233
- flex: `0 0 ${value}px`,
234
- position: "relative",
235
- userSelect: isDragging ? "none" : "auto",
236
- ...isHorizontal ? { minWidth: `${min}px`, maxWidth: `${max}px` } : { minHeight: `${min}px`, maxHeight: `${max}px` }
237
- }
238
- }),
239
- toggleButtonProps: normalize.element({
240
- ...parts.toggleButton.attrs,
241
- id: dom.getToggleButtonId(state.context),
242
- "aria-label": state.context.isAtMin ? "Expand Primary Pane" : "Collapse Primary Pane",
243
- onClick() {
244
- send("TOGGLE");
235
+ flexDirection: isHorizontal ? "row" : "column",
236
+ height: "100%",
237
+ width: "100%",
238
+ overflow: "hidden"
245
239
  }
246
240
  }),
247
- labelProps: normalize.element({
248
- ...parts.label.attrs,
249
- id: dom.getLabelId(state.context)
250
- }),
251
- splitterProps: normalize.element({
252
- ...parts.splitter.attrs,
253
- id: dom.getSplitterId(state.context),
254
- role: "separator",
255
- tabIndex: isDisabled ? void 0 : 0,
256
- "aria-valuenow": value,
257
- "aria-valuemin": min,
258
- "aria-valuemax": max,
259
- "aria-orientation": state.context.orientation,
260
- "aria-labelledby": dom.getLabelId(state.context),
261
- "aria-controls": dom.getPrimaryPaneId(state.context),
262
- "data-orientation": state.context.orientation,
263
- "data-focus": dataAttr(isFocused),
264
- "data-disabled": dataAttr(isDisabled),
265
- style: {
266
- touchAction: "none",
267
- userSelect: "none",
268
- WebkitUserSelect: "none",
269
- msUserSelect: "none",
270
- flex: "0 0 auto",
271
- cursor: dom.getCursor(state.context),
272
- minHeight: isHorizontal ? "0px" : void 0,
273
- minWidth: isHorizontal ? void 0 : "0px"
274
- },
275
- onPointerDown(event) {
276
- if (isDisabled) {
277
- event.preventDefault();
278
- return;
279
- }
280
- send("POINTER_DOWN");
281
- event.preventDefault();
282
- event.stopPropagation();
283
- },
284
- onPointerOver() {
285
- if (isDisabled)
286
- return;
287
- send("POINTER_OVER");
288
- },
289
- onPointerLeave() {
290
- if (isDisabled)
291
- return;
292
- send("POINTER_LEAVE");
293
- },
294
- onBlur() {
295
- send("BLUR");
296
- },
297
- onFocus() {
298
- send("FOCUS");
299
- },
300
- onDoubleClick() {
301
- if (isDisabled)
302
- return;
303
- send("DOUBLE_CLICK");
304
- },
305
- onKeyDown(event) {
306
- if (isDisabled)
307
- return;
308
- const step = getEventStep(event) * state.context.step;
309
- const keyMap = {
310
- ArrowUp() {
311
- send({ type: "ARROW_UP", step });
312
- },
313
- ArrowDown() {
314
- send({ type: "ARROW_DOWN", step });
315
- },
316
- ArrowLeft() {
317
- send({ type: "ARROW_LEFT", step });
318
- },
319
- ArrowRight() {
320
- send({ type: "ARROW_RIGHT", step });
321
- },
322
- Home() {
323
- send("HOME");
324
- },
325
- End() {
326
- send("END");
241
+ getPanelProps(props) {
242
+ const { id } = props;
243
+ return normalize.element({
244
+ ...parts.panel.attrs,
245
+ dir: state.context.dir,
246
+ id: dom.getPanelId(state.context, id),
247
+ "data-ownedby": dom.getRootId(state.context),
248
+ style: dom.getPanelStyle(state.context, id)
249
+ });
250
+ },
251
+ getResizeTriggerState(props) {
252
+ const { id, disabled } = props;
253
+ const ids = id.split(":");
254
+ const panelIds = ids.map((id2) => dom.getPanelId(state.context, id2));
255
+ const panels = getHandleBounds(state.context, id);
256
+ return {
257
+ isDisabled: !!disabled,
258
+ isFocused: state.context.activeResizeId === id && isFocused,
259
+ panelIds,
260
+ min: panels == null ? void 0 : panels.min,
261
+ max: panels == null ? void 0 : panels.max,
262
+ value: 0
263
+ };
264
+ },
265
+ getResizeTriggerProps(props) {
266
+ const { id, disabled, step = 1 } = props;
267
+ const triggerState = api.getResizeTriggerState(props);
268
+ return normalize.element({
269
+ ...parts.resizeTrigger.attrs,
270
+ dir: state.context.dir,
271
+ id: dom.getResizeTriggerId(state.context, id),
272
+ role: "separator",
273
+ "data-ownedby": dom.getRootId(state.context),
274
+ tabIndex: disabled ? void 0 : 0,
275
+ "aria-valuenow": triggerState.value,
276
+ "aria-valuemin": triggerState.min,
277
+ "aria-valuemax": triggerState.max,
278
+ "data-orientation": state.context.orientation,
279
+ "aria-orientation": state.context.orientation,
280
+ "aria-controls": triggerState.panelIds.join(" "),
281
+ "data-focus": dataAttr(triggerState.isFocused),
282
+ "data-disabled": dataAttr(disabled),
283
+ style: {
284
+ touchAction: "none",
285
+ userSelect: "none",
286
+ flex: "0 0 auto",
287
+ pointerEvents: isDragging && !triggerState.isFocused ? "none" : void 0,
288
+ cursor: isHorizontal ? "col-resize" : "row-resize",
289
+ [isHorizontal ? "minHeight" : "minWidth"]: "0"
290
+ },
291
+ onPointerDown(event) {
292
+ if (disabled) {
293
+ event.preventDefault();
294
+ return;
327
295
  }
328
- };
329
- const key = getEventKey(event, state.context);
330
- const exec = keyMap[key];
331
- if (exec) {
332
- exec(event);
296
+ send({ type: "POINTER_DOWN", id });
333
297
  event.preventDefault();
298
+ event.stopPropagation();
299
+ },
300
+ onPointerOver() {
301
+ if (disabled)
302
+ return;
303
+ send({ type: "POINTER_OVER", id });
304
+ },
305
+ onPointerLeave() {
306
+ if (disabled)
307
+ return;
308
+ send({ type: "POINTER_LEAVE", id });
309
+ },
310
+ onBlur() {
311
+ send("BLUR");
312
+ },
313
+ onFocus() {
314
+ send({ type: "FOCUS", id });
315
+ },
316
+ onDoubleClick() {
317
+ if (disabled)
318
+ return;
319
+ send({ type: "DOUBLE_CLICK", id });
320
+ },
321
+ onKeyDown(event) {
322
+ if (disabled)
323
+ return;
324
+ const moveStep = getEventStep(event) * step;
325
+ const keyMap = {
326
+ Enter() {
327
+ send("ENTER");
328
+ },
329
+ ArrowUp() {
330
+ send({ type: "ARROW_UP", step: moveStep });
331
+ },
332
+ ArrowDown() {
333
+ send({ type: "ARROW_DOWN", step: moveStep });
334
+ },
335
+ ArrowLeft() {
336
+ send({ type: "ARROW_LEFT", step: moveStep });
337
+ },
338
+ ArrowRight() {
339
+ send({ type: "ARROW_RIGHT", step: moveStep });
340
+ },
341
+ Home() {
342
+ send("HOME");
343
+ },
344
+ End() {
345
+ send("END");
346
+ }
347
+ };
348
+ const key = getEventKey(event, state.context);
349
+ const exec = keyMap[key];
350
+ if (exec) {
351
+ exec(event);
352
+ event.preventDefault();
353
+ }
334
354
  }
335
- }
336
- })
355
+ });
356
+ }
337
357
  };
358
+ return api;
338
359
  }
339
360
  // Annotate the CommonJS export names for ESM import in node:
340
361
  0 && (module.exports = {
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  connect
3
- } from "./chunk-7IDNY7GP.mjs";
4
- import "./chunk-DX6NGFGC.mjs";
5
- import "./chunk-A3GF7W2N.mjs";
3
+ } from "./chunk-UC2SKBKO.mjs";
4
+ import "./chunk-HPRMFGOY.mjs";
5
+ import "./chunk-T56NFB6E.mjs";
6
+ import "./chunk-SQ3UMXCZ.mjs";
6
7
  export {
7
8
  connect
8
9
  };
@@ -1,6 +1,6 @@
1
- import { MachineContext } from './splitter.types.js';
1
+ import { JSX } from '@zag-js/types';
2
+ import { MachineContext, PanelId } from './splitter.types.js';
2
3
  import '@zag-js/core';
3
- import '@zag-js/types';
4
4
 
5
5
  declare const dom: {
6
6
  getRootNode: (ctx: {
@@ -18,20 +18,22 @@ declare const dom: {
18
18
  getById: <T = HTMLElement>(ctx: {
19
19
  getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
20
20
  }, id: string) => T | null;
21
- createEmitter: (ctx: {
22
- getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
23
- }, target: HTMLElement) => (evt: string, detail: Record<string, any>, options?: EventInit | undefined) => void;
24
- createListener: (target: HTMLElement) => <T_1 = any>(evt: string, handler: (e: CustomEvent<T_1>) => void) => () => void;
25
21
  } & {
26
22
  getRootId: (ctx: MachineContext) => string;
27
- getSplitterId: (ctx: MachineContext) => string;
28
- getToggleButtonId: (ctx: MachineContext) => string;
23
+ getResizeTriggerId: (ctx: MachineContext, id: string) => string;
24
+ getToggleTriggerId: (ctx: MachineContext) => string;
29
25
  getLabelId: (ctx: MachineContext) => string;
30
- getPrimaryPaneId: (ctx: MachineContext) => string;
31
- getSecondaryPaneId: (ctx: MachineContext) => string;
32
- getSplitterEl: (ctx: MachineContext) => HTMLElement | null;
33
- getPrimaryPaneEl: (ctx: MachineContext) => HTMLElement | null;
34
- getCursor(ctx: MachineContext): (string & {}) | "col-resize" | "default" | "e-resize" | "n-resize" | "row-resize" | "s-resize" | "w-resize";
26
+ getPanelId: (ctx: MachineContext, id: string | number) => string;
27
+ globalCursorId: (ctx: MachineContext) => string;
28
+ getRootEl: (ctx: MachineContext) => HTMLElement | null;
29
+ getResizeTriggerEl: (ctx: MachineContext, id: string) => HTMLElement | null;
30
+ getPanelEl: (ctx: MachineContext, id: string | number) => HTMLElement | null;
31
+ getCursor(ctx: MachineContext): (string & {}) | "col-resize" | "e-resize" | "n-resize" | "row-resize" | "s-resize" | "w-resize";
32
+ getPanelStyle(ctx: MachineContext, id: PanelId): JSX.CSSProperties;
33
+ getActiveHandleEl(ctx: MachineContext): HTMLElement | null | undefined;
34
+ getResizeTriggerEls(ctx: MachineContext): HTMLElement[];
35
+ setupGlobalCursor(ctx: MachineContext): void;
36
+ removeGlobalCursor(ctx: MachineContext): void;
35
37
  };
36
38
 
37
39
  export { dom };