@zag-js/splitter 0.79.3 → 0.81.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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -5
- package/dist/index.mjs +1 -2
- package/package.json +6 -8
package/dist/index.d.mts
CHANGED
|
@@ -141,8 +141,8 @@ declare function connect<T extends PropTypes>(state: State, send: Send, normaliz
|
|
|
141
141
|
|
|
142
142
|
declare function machine(userContext: UserDefinedContext): _zag_js_core.Machine<MachineContext, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
|
|
143
143
|
|
|
144
|
-
declare const props: ("
|
|
145
|
-
declare const splitProps: <Props extends Partial<UserDefinedContext>>(props: Props) => [Partial<UserDefinedContext>, Omit<Props, "
|
|
144
|
+
declare const props: ("size" | "dir" | "id" | "orientation" | "getRootNode" | "onSizeChange" | "onSizeChangeEnd" | "ids")[];
|
|
145
|
+
declare const splitProps: <Props extends Partial<UserDefinedContext>>(props: Props) => [Partial<UserDefinedContext>, Omit<Props, "size" | "dir" | "id" | "orientation" | "getRootNode" | "onSizeChange" | "onSizeChangeEnd" | "ids">];
|
|
146
146
|
declare const panelProps: (keyof PanelProps)[];
|
|
147
147
|
declare const splitPanelProps: <Props extends PanelProps>(props: Props) => [PanelProps, Omit<Props, keyof PanelProps>];
|
|
148
148
|
declare const resizeTriggerProps: (keyof ResizeTriggerProps)[];
|
package/dist/index.d.ts
CHANGED
|
@@ -141,8 +141,8 @@ declare function connect<T extends PropTypes>(state: State, send: Send, normaliz
|
|
|
141
141
|
|
|
142
142
|
declare function machine(userContext: UserDefinedContext): _zag_js_core.Machine<MachineContext, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
|
|
143
143
|
|
|
144
|
-
declare const props: ("
|
|
145
|
-
declare const splitProps: <Props extends Partial<UserDefinedContext>>(props: Props) => [Partial<UserDefinedContext>, Omit<Props, "
|
|
144
|
+
declare const props: ("size" | "dir" | "id" | "orientation" | "getRootNode" | "onSizeChange" | "onSizeChangeEnd" | "ids")[];
|
|
145
|
+
declare const splitProps: <Props extends Partial<UserDefinedContext>>(props: Props) => [Partial<UserDefinedContext>, Omit<Props, "size" | "dir" | "id" | "orientation" | "getRootNode" | "onSizeChange" | "onSizeChangeEnd" | "ids">];
|
|
146
146
|
declare const panelProps: (keyof PanelProps)[];
|
|
147
147
|
declare const splitPanelProps: <Props extends PanelProps>(props: Props) => [PanelProps, Omit<Props, keyof PanelProps>];
|
|
148
148
|
declare const resizeTriggerProps: (keyof ResizeTriggerProps)[];
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var anatomy$1 = require('@zag-js/anatomy');
|
|
4
|
-
var domEvent = require('@zag-js/dom-event');
|
|
5
4
|
var domQuery = require('@zag-js/dom-query');
|
|
6
5
|
var core = require('@zag-js/core');
|
|
7
6
|
var utils = require('@zag-js/utils');
|
|
@@ -305,7 +304,7 @@ function connect(state, send, normalize) {
|
|
|
305
304
|
onKeyDown(event) {
|
|
306
305
|
if (event.defaultPrevented) return;
|
|
307
306
|
if (disabled) return;
|
|
308
|
-
const moveStep =
|
|
307
|
+
const moveStep = domQuery.getEventStep(event) * step;
|
|
309
308
|
const keyMap = {
|
|
310
309
|
Enter() {
|
|
311
310
|
send("ENTER");
|
|
@@ -329,7 +328,7 @@ function connect(state, send, normalize) {
|
|
|
329
328
|
send("END");
|
|
330
329
|
}
|
|
331
330
|
};
|
|
332
|
-
const key =
|
|
331
|
+
const key = domQuery.getEventKey(event, state.context);
|
|
333
332
|
const exec = keyMap[key];
|
|
334
333
|
if (exec) {
|
|
335
334
|
exec(event);
|
|
@@ -466,7 +465,7 @@ function machine(userContext) {
|
|
|
466
465
|
activities: {
|
|
467
466
|
trackPointerMove: (ctx2, _evt, { send }) => {
|
|
468
467
|
const doc = dom.getDoc(ctx2);
|
|
469
|
-
return
|
|
468
|
+
return domQuery.trackPointerMove(doc, {
|
|
470
469
|
onPointerMove(info) {
|
|
471
470
|
send({ type: "POINTER_MOVE", point: info.point });
|
|
472
471
|
},
|
|
@@ -580,7 +579,7 @@ function machine(userContext) {
|
|
|
580
579
|
if (!panels || !bounds) return;
|
|
581
580
|
const rootEl = dom.getRootEl(ctx2);
|
|
582
581
|
if (!rootEl) return;
|
|
583
|
-
const relativePoint =
|
|
582
|
+
const relativePoint = domQuery.getRelativePoint(evt.point, rootEl);
|
|
584
583
|
const percentValue = relativePoint.getPercentValue({
|
|
585
584
|
dir: ctx2.dir,
|
|
586
585
|
orientation: ctx2.orientation
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createAnatomy } from '@zag-js/anatomy';
|
|
2
|
-
import { getEventStep, getEventKey, trackPointerMove, getRelativePoint } from '@zag-js/dom-
|
|
3
|
-
import { createScope, queryAll, dataAttr, raf } from '@zag-js/dom-query';
|
|
2
|
+
import { createScope, queryAll, dataAttr, getEventStep, getEventKey, trackPointerMove, raf, getRelativePoint } from '@zag-js/dom-query';
|
|
4
3
|
import { createMachine } from '@zag-js/core';
|
|
5
4
|
import { createSplitProps, compact } from '@zag-js/utils';
|
|
6
5
|
import { createProps } from '@zag-js/types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/splitter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.81.0",
|
|
4
4
|
"description": "Core logic for the splitter widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -27,13 +27,11 @@
|
|
|
27
27
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@zag-js/anatomy": "0.
|
|
31
|
-
"@zag-js/core": "0.
|
|
32
|
-
"@zag-js/types": "0.
|
|
33
|
-
"@zag-js/dom-query": "0.
|
|
34
|
-
"@zag-js/
|
|
35
|
-
"@zag-js/number-utils": "0.79.3",
|
|
36
|
-
"@zag-js/utils": "0.79.3"
|
|
30
|
+
"@zag-js/anatomy": "0.81.0",
|
|
31
|
+
"@zag-js/core": "0.81.0",
|
|
32
|
+
"@zag-js/types": "0.81.0",
|
|
33
|
+
"@zag-js/dom-query": "0.81.0",
|
|
34
|
+
"@zag-js/utils": "0.81.0"
|
|
37
35
|
},
|
|
38
36
|
"devDependencies": {
|
|
39
37
|
"clean-package": "2.2.0"
|