@zag-js/color-picker 0.9.1 → 0.9.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.
@@ -23,7 +23,14 @@ import {
23
23
 
24
24
  // src/color-picker.connect.ts
25
25
  import { normalizeColor } from "@zag-js/color-utils";
26
- import { getEventKey, getEventStep, getNativeEvent, isLeftClick, isModifiedEvent } from "@zag-js/dom-event";
26
+ import {
27
+ getEventKey,
28
+ getEventPoint,
29
+ getEventStep,
30
+ getNativeEvent,
31
+ isLeftClick,
32
+ isModifiedEvent
33
+ } from "@zag-js/dom-event";
27
34
  import { dataAttr } from "@zag-js/dom-query";
28
35
  function connect(state, send, normalize) {
29
36
  const valueAsColor = state.context.valueAsColor;
@@ -85,7 +92,7 @@ function connect(state, send, normalize) {
85
92
  const evt = getNativeEvent(event);
86
93
  if (!isLeftClick(evt) || isModifiedEvent(evt))
87
94
  return;
88
- const point = { x: evt.clientX, y: evt.clientY };
95
+ const point = getEventPoint(evt);
89
96
  const channel = { xChannel, yChannel };
90
97
  send({ type: "AREA.POINTER_DOWN", point, channel, id: "area" });
91
98
  },
@@ -180,7 +187,7 @@ function connect(state, send, normalize) {
180
187
  const evt = getNativeEvent(event);
181
188
  if (!isLeftClick(evt) || isModifiedEvent(evt))
182
189
  return;
183
- const point = { x: evt.clientX, y: evt.clientY };
190
+ const point = getEventPoint(evt);
184
191
  send({ type: "CHANNEL_SLIDER.POINTER_DOWN", channel, point, id: channel, orientation });
185
192
  },
186
193
  style: {
@@ -451,7 +451,7 @@ function connect(state, send, normalize) {
451
451
  const evt = (0, import_dom_event2.getNativeEvent)(event);
452
452
  if (!(0, import_dom_event2.isLeftClick)(evt) || (0, import_dom_event2.isModifiedEvent)(evt))
453
453
  return;
454
- const point = { x: evt.clientX, y: evt.clientY };
454
+ const point = (0, import_dom_event2.getEventPoint)(evt);
455
455
  const channel = { xChannel, yChannel };
456
456
  send({ type: "AREA.POINTER_DOWN", point, channel, id: "area" });
457
457
  },
@@ -546,7 +546,7 @@ function connect(state, send, normalize) {
546
546
  const evt = (0, import_dom_event2.getNativeEvent)(event);
547
547
  if (!(0, import_dom_event2.isLeftClick)(evt) || (0, import_dom_event2.isModifiedEvent)(evt))
548
548
  return;
549
- const point = { x: evt.clientX, y: evt.clientY };
549
+ const point = (0, import_dom_event2.getEventPoint)(evt);
550
550
  send({ type: "CHANNEL_SLIDER.POINTER_DOWN", channel, point, id: channel, orientation });
551
551
  },
552
552
  style: {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  connect
3
- } from "./chunk-HSUD4DN3.mjs";
3
+ } from "./chunk-KYNJURCY.mjs";
4
4
  import "./chunk-JNBNPPMF.mjs";
5
5
  import "./chunk-KO4TBUXB.mjs";
6
6
  import "./chunk-3XH465XT.mjs";
package/dist/index.js CHANGED
@@ -455,7 +455,7 @@ function connect(state, send, normalize) {
455
455
  const evt = (0, import_dom_event2.getNativeEvent)(event);
456
456
  if (!(0, import_dom_event2.isLeftClick)(evt) || (0, import_dom_event2.isModifiedEvent)(evt))
457
457
  return;
458
- const point = { x: evt.clientX, y: evt.clientY };
458
+ const point = (0, import_dom_event2.getEventPoint)(evt);
459
459
  const channel = { xChannel, yChannel };
460
460
  send({ type: "AREA.POINTER_DOWN", point, channel, id: "area" });
461
461
  },
@@ -550,7 +550,7 @@ function connect(state, send, normalize) {
550
550
  const evt = (0, import_dom_event2.getNativeEvent)(event);
551
551
  if (!(0, import_dom_event2.isLeftClick)(evt) || (0, import_dom_event2.isModifiedEvent)(evt))
552
552
  return;
553
- const point = { x: evt.clientX, y: evt.clientY };
553
+ const point = (0, import_dom_event2.getEventPoint)(evt);
554
554
  send({ type: "CHANNEL_SLIDER.POINTER_DOWN", channel, point, id: channel, orientation });
555
555
  },
556
556
  style: {
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  connect
3
- } from "./chunk-HSUD4DN3.mjs";
3
+ } from "./chunk-KYNJURCY.mjs";
4
4
  import "./chunk-JNBNPPMF.mjs";
5
5
  import "./chunk-KO4TBUXB.mjs";
6
6
  import "./chunk-3XH465XT.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/color-picker",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Core logic for the color-picker widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -27,15 +27,15 @@
27
27
  "url": "https://github.com/chakra-ui/zag/issues"
28
28
  },
29
29
  "dependencies": {
30
- "@zag-js/core": "0.9.1",
31
- "@zag-js/anatomy": "0.9.1",
32
- "@zag-js/dom-query": "0.9.1",
33
- "@zag-js/dom-event": "0.9.1",
34
- "@zag-js/utils": "0.9.1",
35
- "@zag-js/color-utils": "0.9.1",
36
- "@zag-js/numeric-range": "0.9.1",
37
- "@zag-js/text-selection": "0.9.1",
38
- "@zag-js/types": "0.9.1"
30
+ "@zag-js/core": "0.9.2",
31
+ "@zag-js/anatomy": "0.9.2",
32
+ "@zag-js/dom-query": "0.9.2",
33
+ "@zag-js/dom-event": "0.9.2",
34
+ "@zag-js/utils": "0.9.2",
35
+ "@zag-js/color-utils": "0.9.2",
36
+ "@zag-js/numeric-range": "0.9.2",
37
+ "@zag-js/text-selection": "0.9.2",
38
+ "@zag-js/types": "0.9.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "clean-package": "2.2.0"