@zag-js/splitter 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -331,7 +331,7 @@ var machine = core.createMachine({
331
331
  return {
332
332
  orientation: "horizontal",
333
333
  defaultSize: [],
334
- ...utils.compact(props2)
334
+ ...props2
335
335
  };
336
336
  },
337
337
  initialState() {
@@ -392,6 +392,10 @@ var machine = core.createMachine({
392
392
  target: "focused",
393
393
  actions: ["setActiveHandleId"]
394
394
  },
395
+ POINTER_DOWN: {
396
+ target: "dragging",
397
+ actions: ["setActiveHandleId"]
398
+ },
395
399
  DOUBLE_CLICK: {
396
400
  actions: ["resetStartPanel", "setPreviousPanels"]
397
401
  }
@@ -482,10 +486,9 @@ var machine = core.createMachine({
482
486
  implementations: {
483
487
  effects: {
484
488
  waitForHoverDelay: ({ send }) => {
485
- const id = setTimeout(() => {
489
+ return utils.setRafTimeout(() => {
486
490
  send({ type: "HOVER_DELAY" });
487
491
  }, 250);
488
- return () => clearTimeout(id);
489
492
  },
490
493
  trackPointerMove: ({ scope, send }) => {
491
494
  const doc = scope.getDoc();
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createAnatomy } from '@zag-js/anatomy';
2
2
  import { trackPointerMove, raf, getRelativePoint, dataAttr, getEventStep, getEventKey } from '@zag-js/dom-query';
3
3
  import { createMachine } from '@zag-js/core';
4
- import { compact, createSplitProps } from '@zag-js/utils';
4
+ import { setRafTimeout, createSplitProps } from '@zag-js/utils';
5
5
  import { createProps } from '@zag-js/types';
6
6
 
7
7
  // src/splitter.anatomy.ts
@@ -329,7 +329,7 @@ var machine = createMachine({
329
329
  return {
330
330
  orientation: "horizontal",
331
331
  defaultSize: [],
332
- ...compact(props2)
332
+ ...props2
333
333
  };
334
334
  },
335
335
  initialState() {
@@ -390,6 +390,10 @@ var machine = createMachine({
390
390
  target: "focused",
391
391
  actions: ["setActiveHandleId"]
392
392
  },
393
+ POINTER_DOWN: {
394
+ target: "dragging",
395
+ actions: ["setActiveHandleId"]
396
+ },
393
397
  DOUBLE_CLICK: {
394
398
  actions: ["resetStartPanel", "setPreviousPanels"]
395
399
  }
@@ -480,10 +484,9 @@ var machine = createMachine({
480
484
  implementations: {
481
485
  effects: {
482
486
  waitForHoverDelay: ({ send }) => {
483
- const id = setTimeout(() => {
487
+ return setRafTimeout(() => {
484
488
  send({ type: "HOVER_DELAY" });
485
489
  }, 250);
486
- return () => clearTimeout(id);
487
490
  },
488
491
  trackPointerMove: ({ scope, send }) => {
489
492
  const doc = scope.getDoc();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/splitter",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Core logic for the splitter widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -27,11 +27,11 @@
27
27
  "url": "https://github.com/chakra-ui/zag/issues"
28
28
  },
29
29
  "dependencies": {
30
- "@zag-js/anatomy": "1.0.1",
31
- "@zag-js/core": "1.0.1",
32
- "@zag-js/types": "1.0.1",
33
- "@zag-js/dom-query": "1.0.1",
34
- "@zag-js/utils": "1.0.1"
30
+ "@zag-js/anatomy": "1.0.2",
31
+ "@zag-js/core": "1.0.2",
32
+ "@zag-js/types": "1.0.2",
33
+ "@zag-js/dom-query": "1.0.2",
34
+ "@zag-js/utils": "1.0.2"
35
35
  },
36
36
  "devDependencies": {
37
37
  "clean-package": "2.2.0"