@zag-js/color-picker 1.35.2 → 1.36.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.
|
@@ -425,7 +425,7 @@ var machine = (0, import_core.createMachine)({
|
|
|
425
425
|
return (0, import_dom_query.trackPointerMove)(scope.getDoc(), {
|
|
426
426
|
onPointerMove({ point }) {
|
|
427
427
|
const type = context.get("activeId") === "area" ? "AREA.POINTER_MOVE" : "CHANNEL_SLIDER.POINTER_MOVE";
|
|
428
|
-
send({ type, point, format: event.format });
|
|
428
|
+
send({ type, point, format: event.format, orientation: context.get("activeOrientation") ?? void 0 });
|
|
429
429
|
},
|
|
430
430
|
onPointerUp() {
|
|
431
431
|
const type = context.get("activeId") === "area" ? "AREA.POINTER_UP" : "CHANNEL_SLIDER.POINTER_UP";
|
|
@@ -477,7 +477,7 @@ var machine = (0, import_core.createMachine)({
|
|
|
477
477
|
const normalizedValue = event.format ? context.get("value").toFormat(event.format) : computed("areaValue");
|
|
478
478
|
const percent = dom.getChannelSliderValueFromPoint(scope, event.point, channel, prop("dir"));
|
|
479
479
|
if (!percent) return;
|
|
480
|
-
const orientation = context.get("activeOrientation") || "horizontal";
|
|
480
|
+
const orientation = event.orientation || context.get("activeOrientation") || "horizontal";
|
|
481
481
|
const channelPercent = orientation === "horizontal" ? percent.x : percent.y;
|
|
482
482
|
const value = normalizedValue.getChannelPercentValue(channel, channelPercent);
|
|
483
483
|
const color = normalizedValue.withChannelValue(channel, value);
|
|
@@ -399,7 +399,7 @@ var machine = createMachine({
|
|
|
399
399
|
return trackPointerMove(scope.getDoc(), {
|
|
400
400
|
onPointerMove({ point }) {
|
|
401
401
|
const type = context.get("activeId") === "area" ? "AREA.POINTER_MOVE" : "CHANNEL_SLIDER.POINTER_MOVE";
|
|
402
|
-
send({ type, point, format: event.format });
|
|
402
|
+
send({ type, point, format: event.format, orientation: context.get("activeOrientation") ?? void 0 });
|
|
403
403
|
},
|
|
404
404
|
onPointerUp() {
|
|
405
405
|
const type = context.get("activeId") === "area" ? "AREA.POINTER_UP" : "CHANNEL_SLIDER.POINTER_UP";
|
|
@@ -451,7 +451,7 @@ var machine = createMachine({
|
|
|
451
451
|
const normalizedValue = event.format ? context.get("value").toFormat(event.format) : computed("areaValue");
|
|
452
452
|
const percent = dom.getChannelSliderValueFromPoint(scope, event.point, channel, prop("dir"));
|
|
453
453
|
if (!percent) return;
|
|
454
|
-
const orientation = context.get("activeOrientation") || "horizontal";
|
|
454
|
+
const orientation = event.orientation || context.get("activeOrientation") || "horizontal";
|
|
455
455
|
const channelPercent = orientation === "horizontal" ? percent.x : percent.y;
|
|
456
456
|
const value = normalizedValue.getChannelPercentValue(channel, channelPercent);
|
|
457
457
|
const color = normalizedValue.withChannelValue(channel, value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/color-picker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.0",
|
|
4
4
|
"description": "Core logic for the color-picker widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@zag-js/core": "1.
|
|
31
|
-
"@zag-js/anatomy": "1.
|
|
32
|
-
"@zag-js/dom-query": "1.
|
|
33
|
-
"@zag-js/dismissable": "1.
|
|
34
|
-
"@zag-js/utils": "1.
|
|
35
|
-
"@zag-js/color-utils": "1.
|
|
36
|
-
"@zag-js/popper": "1.
|
|
37
|
-
"@zag-js/types": "1.
|
|
30
|
+
"@zag-js/core": "1.36.0",
|
|
31
|
+
"@zag-js/anatomy": "1.36.0",
|
|
32
|
+
"@zag-js/dom-query": "1.36.0",
|
|
33
|
+
"@zag-js/dismissable": "1.36.0",
|
|
34
|
+
"@zag-js/utils": "1.36.0",
|
|
35
|
+
"@zag-js/color-utils": "1.36.0",
|
|
36
|
+
"@zag-js/popper": "1.36.0",
|
|
37
|
+
"@zag-js/types": "1.36.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"clean-package": "2.2.0"
|