@sprawlify/primitives 0.1.6 → 0.1.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/core-Bw_czdwX.cjs +383 -0
- package/dist/core-CTtbW9qh.mjs +288 -0
- package/dist/core.cjs +9 -1
- package/dist/core.d.cts +25 -2
- package/dist/core.d.mts +25 -2
- package/dist/core.mjs +2 -2
- package/dist/machines/accordion/index.cjs +1 -1
- package/dist/machines/accordion/index.d.cts +2 -2
- package/dist/machines/accordion/index.d.mts +2 -2
- package/dist/machines/accordion/index.mjs +1 -1
- package/dist/machines/angle-slider/index.cjs +1 -1
- package/dist/machines/angle-slider/index.d.cts +2 -2
- package/dist/machines/angle-slider/index.d.mts +2 -2
- package/dist/machines/angle-slider/index.mjs +1 -1
- package/dist/machines/aspect-ratio/index.cjs +1 -1
- package/dist/machines/aspect-ratio/index.d.cts +1 -1
- package/dist/machines/aspect-ratio/index.d.mts +1 -1
- package/dist/machines/aspect-ratio/index.mjs +1 -1
- package/dist/machines/async-list/index.cjs +1 -1
- package/dist/machines/async-list/index.d.cts +1 -1
- package/dist/machines/async-list/index.d.mts +1 -1
- package/dist/machines/async-list/index.mjs +1 -1
- package/dist/machines/avatar/index.cjs +1 -1
- package/dist/machines/avatar/index.d.cts +1 -1
- package/dist/machines/avatar/index.d.mts +1 -1
- package/dist/machines/avatar/index.mjs +1 -1
- package/dist/machines/carousel/index.cjs +69 -18
- package/dist/machines/carousel/index.d.cts +3 -3
- package/dist/machines/carousel/index.d.mts +3 -3
- package/dist/machines/carousel/index.mjs +69 -18
- package/dist/machines/cascade-select/index.cjs +1 -1
- package/dist/machines/cascade-select/index.d.cts +3 -3
- package/dist/machines/cascade-select/index.d.mts +3 -3
- package/dist/machines/cascade-select/index.mjs +1 -1
- package/dist/machines/checkbox/index.cjs +1 -1
- package/dist/machines/checkbox/index.d.cts +2 -2
- package/dist/machines/checkbox/index.d.mts +2 -2
- package/dist/machines/checkbox/index.mjs +1 -1
- package/dist/machines/clipboard/index.cjs +1 -1
- package/dist/machines/clipboard/index.d.cts +2 -2
- package/dist/machines/clipboard/index.d.mts +2 -2
- package/dist/machines/clipboard/index.mjs +1 -1
- package/dist/machines/collapsible/index.cjs +1 -1
- package/dist/machines/collapsible/index.d.cts +1 -1
- package/dist/machines/collapsible/index.d.mts +1 -1
- package/dist/machines/collapsible/index.mjs +1 -1
- package/dist/machines/color-picker/index.cjs +76 -102
- package/dist/machines/color-picker/index.d.cts +3 -3
- package/dist/machines/color-picker/index.d.mts +3 -3
- package/dist/machines/color-picker/index.mjs +76 -102
- package/dist/machines/combobox/index.cjs +1 -1
- package/dist/machines/combobox/index.d.cts +2 -2
- package/dist/machines/combobox/index.d.mts +2 -2
- package/dist/machines/combobox/index.mjs +1 -1
- package/dist/machines/date-picker/index.cjs +1 -1
- package/dist/machines/date-picker/index.d.cts +2 -2
- package/dist/machines/date-picker/index.d.mts +2 -2
- package/dist/machines/date-picker/index.mjs +1 -1
- package/dist/machines/dialog/index.cjs +1 -1
- package/dist/machines/dialog/index.d.cts +2 -2
- package/dist/machines/dialog/index.d.mts +2 -2
- package/dist/machines/dialog/index.mjs +1 -1
- package/dist/machines/drawer/index.cjs +1 -1
- package/dist/machines/drawer/index.d.cts +2 -2
- package/dist/machines/drawer/index.d.mts +2 -2
- package/dist/machines/drawer/index.mjs +1 -1
- package/dist/machines/dropdown-menu/index.cjs +1 -1
- package/dist/machines/dropdown-menu/index.d.cts +2 -2
- package/dist/machines/dropdown-menu/index.d.mts +2 -2
- package/dist/machines/dropdown-menu/index.mjs +1 -1
- package/dist/machines/editable/index.cjs +1 -1
- package/dist/machines/editable/index.d.cts +2 -2
- package/dist/machines/editable/index.d.mts +2 -2
- package/dist/machines/editable/index.mjs +1 -1
- package/dist/machines/file-upload/index.cjs +1 -1
- package/dist/machines/file-upload/index.d.cts +2 -2
- package/dist/machines/file-upload/index.d.mts +2 -2
- package/dist/machines/file-upload/index.mjs +1 -1
- package/dist/machines/floating-panel/index.cjs +96 -93
- package/dist/machines/floating-panel/index.d.cts +3 -3
- package/dist/machines/floating-panel/index.d.mts +3 -3
- package/dist/machines/floating-panel/index.mjs +96 -93
- package/dist/machines/hover-card/index.cjs +1 -1
- package/dist/machines/hover-card/index.d.cts +2 -2
- package/dist/machines/hover-card/index.d.mts +2 -2
- package/dist/machines/hover-card/index.mjs +1 -1
- package/dist/machines/image-cropper/index.cjs +1 -1
- package/dist/machines/image-cropper/index.d.cts +1 -1
- package/dist/machines/image-cropper/index.d.mts +1 -1
- package/dist/machines/image-cropper/index.mjs +1 -1
- package/dist/machines/listbox/index.cjs +1 -1
- package/dist/machines/listbox/index.d.cts +2 -2
- package/dist/machines/listbox/index.d.mts +2 -2
- package/dist/machines/listbox/index.mjs +1 -1
- package/dist/machines/marquee/index.cjs +1 -1
- package/dist/machines/marquee/index.d.cts +3 -3
- package/dist/machines/marquee/index.d.mts +3 -3
- package/dist/machines/marquee/index.mjs +1 -1
- package/dist/machines/navigation-menu/index.cjs +1 -1
- package/dist/machines/navigation-menu/index.d.cts +2 -2
- package/dist/machines/navigation-menu/index.d.mts +2 -2
- package/dist/machines/navigation-menu/index.mjs +1 -1
- package/dist/machines/number-input/index.cjs +1 -1
- package/dist/machines/number-input/index.d.cts +2 -2
- package/dist/machines/number-input/index.d.mts +2 -2
- package/dist/machines/number-input/index.mjs +1 -1
- package/dist/machines/pagination/index.cjs +1 -1
- package/dist/machines/pagination/index.d.cts +1 -1
- package/dist/machines/pagination/index.d.mts +1 -1
- package/dist/machines/pagination/index.mjs +1 -1
- package/dist/machines/password-input/index.cjs +1 -1
- package/dist/machines/password-input/index.d.cts +2 -2
- package/dist/machines/password-input/index.d.mts +2 -2
- package/dist/machines/password-input/index.mjs +1 -1
- package/dist/machines/pin-input/index.cjs +1 -1
- package/dist/machines/pin-input/index.d.cts +2 -2
- package/dist/machines/pin-input/index.d.mts +2 -2
- package/dist/machines/pin-input/index.mjs +1 -1
- package/dist/machines/popover/index.cjs +1 -1
- package/dist/machines/popover/index.d.cts +2 -2
- package/dist/machines/popover/index.d.mts +2 -2
- package/dist/machines/popover/index.mjs +1 -1
- package/dist/machines/presence/index.cjs +1 -1
- package/dist/machines/presence/index.d.cts +1 -1
- package/dist/machines/presence/index.d.mts +1 -1
- package/dist/machines/presence/index.mjs +1 -1
- package/dist/machines/progress/index.cjs +1 -1
- package/dist/machines/progress/index.d.cts +2 -2
- package/dist/machines/progress/index.d.mts +2 -2
- package/dist/machines/progress/index.mjs +1 -1
- package/dist/machines/qr-code/index.cjs +1 -1
- package/dist/machines/qr-code/index.d.cts +1 -1
- package/dist/machines/qr-code/index.d.mts +1 -1
- package/dist/machines/qr-code/index.mjs +1 -1
- package/dist/machines/radio-group/index.cjs +1 -1
- package/dist/machines/radio-group/index.d.cts +1 -1
- package/dist/machines/radio-group/index.d.mts +1 -1
- package/dist/machines/radio-group/index.mjs +1 -1
- package/dist/machines/rating-group/index.cjs +1 -1
- package/dist/machines/rating-group/index.d.cts +2 -2
- package/dist/machines/rating-group/index.d.mts +2 -2
- package/dist/machines/rating-group/index.mjs +1 -1
- package/dist/machines/scroll-area/index.cjs +1 -1
- package/dist/machines/scroll-area/index.d.cts +1 -1
- package/dist/machines/scroll-area/index.d.mts +1 -1
- package/dist/machines/scroll-area/index.mjs +1 -1
- package/dist/machines/select/index.cjs +1 -1
- package/dist/machines/select/index.d.cts +2 -2
- package/dist/machines/select/index.d.mts +2 -2
- package/dist/machines/select/index.mjs +1 -1
- package/dist/machines/separator/index.cjs +1 -1
- package/dist/machines/separator/index.d.cts +1 -1
- package/dist/machines/separator/index.d.mts +1 -1
- package/dist/machines/separator/index.mjs +1 -1
- package/dist/machines/signature-pad/index.cjs +1 -1
- package/dist/machines/signature-pad/index.d.cts +2 -2
- package/dist/machines/signature-pad/index.d.mts +2 -2
- package/dist/machines/signature-pad/index.mjs +1 -1
- package/dist/machines/slider/index.cjs +1 -1
- package/dist/machines/slider/index.d.cts +2 -2
- package/dist/machines/slider/index.d.mts +2 -2
- package/dist/machines/slider/index.mjs +1 -1
- package/dist/machines/splitter/index.cjs +1 -1
- package/dist/machines/splitter/index.d.cts +1 -1
- package/dist/machines/splitter/index.d.mts +1 -1
- package/dist/machines/splitter/index.mjs +1 -1
- package/dist/machines/steps/index.cjs +1 -1
- package/dist/machines/steps/index.d.cts +2 -2
- package/dist/machines/steps/index.d.mts +2 -2
- package/dist/machines/steps/index.mjs +1 -1
- package/dist/machines/switch/index.cjs +1 -1
- package/dist/machines/switch/index.d.cts +2 -2
- package/dist/machines/switch/index.d.mts +2 -2
- package/dist/machines/switch/index.mjs +1 -1
- package/dist/machines/tabs/index.cjs +1 -1
- package/dist/machines/tabs/index.d.cts +2 -2
- package/dist/machines/tabs/index.d.mts +2 -2
- package/dist/machines/tabs/index.mjs +1 -1
- package/dist/machines/tags-input/index.cjs +1 -1
- package/dist/machines/tags-input/index.d.cts +2 -2
- package/dist/machines/tags-input/index.d.mts +2 -2
- package/dist/machines/tags-input/index.mjs +1 -1
- package/dist/machines/timer/index.cjs +1 -1
- package/dist/machines/timer/index.d.cts +2 -2
- package/dist/machines/timer/index.d.mts +2 -2
- package/dist/machines/timer/index.mjs +1 -1
- package/dist/machines/toast/index.cjs +1 -1
- package/dist/machines/toast/index.d.cts +2 -2
- package/dist/machines/toast/index.d.mts +2 -2
- package/dist/machines/toast/index.mjs +1 -1
- package/dist/machines/toggle/index.cjs +1 -1
- package/dist/machines/toggle/index.d.cts +1 -1
- package/dist/machines/toggle/index.d.mts +1 -1
- package/dist/machines/toggle/index.mjs +1 -1
- package/dist/machines/toggle-group/index.cjs +1 -1
- package/dist/machines/toggle-group/index.d.cts +1 -1
- package/dist/machines/toggle-group/index.d.mts +1 -1
- package/dist/machines/toggle-group/index.mjs +1 -1
- package/dist/machines/tooltip/index.cjs +1 -1
- package/dist/machines/tooltip/index.d.cts +2 -2
- package/dist/machines/tooltip/index.d.mts +2 -2
- package/dist/machines/tooltip/index.mjs +1 -1
- package/dist/machines/tour/index.cjs +48 -46
- package/dist/machines/tour/index.d.cts +3 -3
- package/dist/machines/tour/index.d.mts +3 -3
- package/dist/machines/tour/index.mjs +48 -46
- package/dist/machines/tree-view/index.cjs +1 -1
- package/dist/machines/tree-view/index.d.cts +2 -2
- package/dist/machines/tree-view/index.d.mts +2 -2
- package/dist/machines/tree-view/index.mjs +1 -1
- package/dist/{types-B24gMTKq.d.cts → types-DvUmCWsb.d.mts} +28 -12
- package/dist/{types-DUM9rzfD.d.mts → types-u-LWCSDE.d.cts} +28 -12
- package/package.json +1 -1
- package/dist/core-Ci9Yu6QI.mjs +0 -123
- package/dist/core-DwdPztGA.cjs +0 -170
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
|
|
2
2
|
import { $t as contains, C as queryAll, E as trackPointerMove, St as isLeftClick, W as raf, bn as ariaAttr, et as getTabbables, ft as getEventKey, ht as getEventTarget, m as resizeObserverBorderBox, tt as isFocusable, ut as addDomEvent, xn as dataAttr } from "../../dom-query-BFuRs3l4.mjs";
|
|
3
3
|
import { At as remove, Et as nextIndex, Nt as uniq, Q as throttle, W as callAll, ct as isObject, g as clampValue, kt as prevIndex, n as ensureProps, pt as add, u as createSplitProps } from "../../utils-VVoZ_v29.mjs";
|
|
4
|
-
import { a as createMachine } from "../../core-
|
|
4
|
+
import { a as createMachine } from "../../core-CTtbW9qh.mjs";
|
|
5
5
|
import { n as getScrollSnapPositions, t as findSnapPoint } from "../../scroll-snap-CdneVP31.mjs";
|
|
6
6
|
import { t as createProps } from "../../create-props-DFW8DUsC.mjs";
|
|
7
7
|
//#region src/machines/carousel/carousel.anatomy.ts
|
|
@@ -37,22 +37,23 @@ function connect(service, normalize) {
|
|
|
37
37
|
const autoSize = prop("autoSize");
|
|
38
38
|
const pageSnapPoints = Array.from(context.get("pageSnapPoints"));
|
|
39
39
|
const page = context.get("page");
|
|
40
|
+
const activePage = pageSnapPoints.length ? clampValue(page, 0, pageSnapPoints.length - 1) : 0;
|
|
40
41
|
const slidesPerPage = prop("slidesPerPage");
|
|
41
42
|
const padding = prop("padding");
|
|
42
43
|
const translations = prop("translations");
|
|
43
44
|
return {
|
|
44
45
|
isPlaying,
|
|
45
46
|
isDragging,
|
|
46
|
-
page,
|
|
47
|
+
page: activePage,
|
|
47
48
|
pageSnapPoints,
|
|
48
49
|
canScrollNext,
|
|
49
50
|
canScrollPrev,
|
|
50
51
|
getProgress() {
|
|
51
|
-
return
|
|
52
|
+
return activePage / pageSnapPoints.length;
|
|
52
53
|
},
|
|
53
54
|
getProgressText() {
|
|
54
55
|
const details = {
|
|
55
|
-
page:
|
|
56
|
+
page: activePage + 1,
|
|
56
57
|
totalPages: pageSnapPoints.length
|
|
57
58
|
};
|
|
58
59
|
return translations.progressText?.(details) ?? "";
|
|
@@ -302,7 +303,7 @@ function connect(service, normalize) {
|
|
|
302
303
|
"data-orientation": prop("orientation"),
|
|
303
304
|
"data-index": props.index,
|
|
304
305
|
"data-readonly": dataAttr(props.readOnly),
|
|
305
|
-
"data-current": dataAttr(props.index ===
|
|
306
|
+
"data-current": dataAttr(props.index === activePage),
|
|
306
307
|
"aria-label": translations.indicator(props.index),
|
|
307
308
|
onClick(event) {
|
|
308
309
|
if (event.defaultPrevented) return;
|
|
@@ -443,7 +444,7 @@ const machine = createMachine({
|
|
|
443
444
|
target: "idle",
|
|
444
445
|
actions: ["clearScrollEndTimer", "setMatchingPage"]
|
|
445
446
|
},
|
|
446
|
-
"SNAP.REFRESH": { actions: ["setSnapPoints"
|
|
447
|
+
"SNAP.REFRESH": { actions: ["setSnapPoints"] },
|
|
447
448
|
"PAGE.SCROLL": { actions: ["scrollToPage"] }
|
|
448
449
|
},
|
|
449
450
|
effects: [
|
|
@@ -483,11 +484,36 @@ const machine = createMachine({
|
|
|
483
484
|
on: {
|
|
484
485
|
DRAGGING: { actions: ["scrollSlides", "invokeDragging"] },
|
|
485
486
|
"DRAGGING.END": {
|
|
486
|
-
target: "
|
|
487
|
-
actions: ["endDragging"
|
|
487
|
+
target: "settling",
|
|
488
|
+
actions: ["endDragging"]
|
|
488
489
|
}
|
|
489
490
|
}
|
|
490
491
|
},
|
|
492
|
+
settling: {
|
|
493
|
+
effects: ["trackSettlingScroll"],
|
|
494
|
+
on: {
|
|
495
|
+
"DRAGGING.START": {
|
|
496
|
+
target: "dragging",
|
|
497
|
+
actions: ["clearScrollEndTimer", "invokeDragStart"]
|
|
498
|
+
},
|
|
499
|
+
"SCROLL.END": [{
|
|
500
|
+
guard: "isFocused",
|
|
501
|
+
target: "focus",
|
|
502
|
+
actions: [
|
|
503
|
+
"clearScrollEndTimer",
|
|
504
|
+
"setClosestPage",
|
|
505
|
+
"invokeDraggingEnd"
|
|
506
|
+
]
|
|
507
|
+
}, {
|
|
508
|
+
target: "idle",
|
|
509
|
+
actions: [
|
|
510
|
+
"clearScrollEndTimer",
|
|
511
|
+
"setClosestPage",
|
|
512
|
+
"invokeDraggingEnd"
|
|
513
|
+
]
|
|
514
|
+
}]
|
|
515
|
+
}
|
|
516
|
+
},
|
|
491
517
|
userScroll: {
|
|
492
518
|
effects: ["trackScroll"],
|
|
493
519
|
on: {
|
|
@@ -552,7 +578,8 @@ const machine = createMachine({
|
|
|
552
578
|
return () => observer.disconnect();
|
|
553
579
|
},
|
|
554
580
|
trackSlideResize({ scope, send }) {
|
|
555
|
-
|
|
581
|
+
const el = getItemGroupEl(scope);
|
|
582
|
+
if (!el) return;
|
|
556
583
|
const exec = () => {
|
|
557
584
|
send({
|
|
558
585
|
type: "SNAP.REFRESH",
|
|
@@ -570,7 +597,7 @@ const machine = createMachine({
|
|
|
570
597
|
});
|
|
571
598
|
const itemEls = getItemEls(scope);
|
|
572
599
|
itemEls.forEach(exec);
|
|
573
|
-
return callAll(...itemEls.map((el) => resizeObserverBorderBox.observe(el, exec)));
|
|
600
|
+
return callAll(...[resizeObserverBorderBox.observe(el, exec), ...itemEls.map((el) => resizeObserverBorderBox.observe(el, exec))]);
|
|
574
601
|
},
|
|
575
602
|
trackSlideIntersections({ scope, prop, context }) {
|
|
576
603
|
const el = getItemGroupEl(scope);
|
|
@@ -601,6 +628,27 @@ const machine = createMachine({
|
|
|
601
628
|
};
|
|
602
629
|
return addDomEvent(el, "scroll", onScroll, { passive: true });
|
|
603
630
|
},
|
|
631
|
+
trackSettlingScroll({ send, refs, scope }) {
|
|
632
|
+
const el = getItemGroupEl(scope);
|
|
633
|
+
if (!el) return;
|
|
634
|
+
const startTimer = () => {
|
|
635
|
+
clearTimeout(refs.get("timeoutRef"));
|
|
636
|
+
refs.set("timeoutRef", void 0);
|
|
637
|
+
refs.set("timeoutRef", setTimeout(() => {
|
|
638
|
+
send({ type: "SCROLL.END" });
|
|
639
|
+
}, 200));
|
|
640
|
+
};
|
|
641
|
+
startTimer();
|
|
642
|
+
const onScroll = () => {
|
|
643
|
+
startTimer();
|
|
644
|
+
};
|
|
645
|
+
const cleanup = addDomEvent(el, "scroll", onScroll, { passive: true });
|
|
646
|
+
return () => {
|
|
647
|
+
cleanup();
|
|
648
|
+
clearTimeout(refs.get("timeoutRef"));
|
|
649
|
+
refs.set("timeoutRef", void 0);
|
|
650
|
+
};
|
|
651
|
+
},
|
|
604
652
|
trackDocumentVisibility({ scope, send }) {
|
|
605
653
|
const doc = scope.getDoc();
|
|
606
654
|
const onVisibilityChange = () => {
|
|
@@ -679,8 +727,11 @@ const machine = createMachine({
|
|
|
679
727
|
const el = getItemGroupEl(scope);
|
|
680
728
|
if (!el) return;
|
|
681
729
|
const scrollPosition = computed("isHorizontal") ? el.scrollLeft : el.scrollTop;
|
|
682
|
-
const
|
|
683
|
-
if (
|
|
730
|
+
const snapPoints = context.get("pageSnapPoints");
|
|
731
|
+
if (!snapPoints.length) return;
|
|
732
|
+
const page = snapPoints.reduce((closestIndex, snapPoint, index) => {
|
|
733
|
+
return Math.abs(snapPoint - scrollPosition) < Math.abs(snapPoints[closestIndex] - scrollPosition) ? index : closestIndex;
|
|
734
|
+
}, 0);
|
|
684
735
|
context.set("page", page);
|
|
685
736
|
},
|
|
686
737
|
setNextPage({ context, prop, state }) {
|
|
@@ -705,15 +756,15 @@ const machine = createMachine({
|
|
|
705
756
|
const page = event.index ?? context.get("page");
|
|
706
757
|
context.set("page", page);
|
|
707
758
|
},
|
|
708
|
-
clampPage({ context }) {
|
|
709
|
-
const index = clampValue(context.get("page"), 0, context.get("pageSnapPoints").length - 1);
|
|
710
|
-
context.set("page", index);
|
|
711
|
-
},
|
|
712
759
|
setSnapPoints({ context, computed, scope }) {
|
|
713
760
|
const el = getItemGroupEl(scope);
|
|
714
761
|
if (!el) return;
|
|
715
762
|
const scrollSnapPoints = getScrollSnapPositions(el);
|
|
716
|
-
|
|
763
|
+
const pageSnapPoints = computed("isHorizontal") ? scrollSnapPoints.x : scrollSnapPoints.y;
|
|
764
|
+
context.set("pageSnapPoints", pageSnapPoints);
|
|
765
|
+
if (!pageSnapPoints.length) return;
|
|
766
|
+
const index = clampValue(context.get("page"), 0, pageSnapPoints.length - 1);
|
|
767
|
+
context.set("page", index);
|
|
717
768
|
},
|
|
718
769
|
disableScrollSnap({ scope }) {
|
|
719
770
|
const el = getItemGroupEl(scope);
|
|
@@ -735,6 +786,7 @@ const machine = createMachine({
|
|
|
735
786
|
const isHorizontal = computed("isHorizontal");
|
|
736
787
|
const scrollPos = isHorizontal ? el.scrollLeft : el.scrollTop;
|
|
737
788
|
const snapPoints = context.get("pageSnapPoints");
|
|
789
|
+
if (!snapPoints.length) return;
|
|
738
790
|
const closest = snapPoints.reduce((closest, curr) => {
|
|
739
791
|
return Math.abs(curr - scrollPos) < Math.abs(closest - scrollPos) ? curr : closest;
|
|
740
792
|
}, snapPoints[0]);
|
|
@@ -744,7 +796,6 @@ const machine = createMachine({
|
|
|
744
796
|
top: isHorizontal ? el.scrollTop : closest,
|
|
745
797
|
behavior: "smooth"
|
|
746
798
|
});
|
|
747
|
-
context.set("page", snapPoints.indexOf(closest));
|
|
748
799
|
const scrollSnapType = el.dataset.scrollSnapType;
|
|
749
800
|
if (scrollSnapType) {
|
|
750
801
|
el.style.setProperty("scroll-snap-type", scrollSnapType);
|
|
@@ -3,7 +3,7 @@ const require_create_anatomy = require("../../create-anatomy-BnwEmNnc.cjs");
|
|
|
3
3
|
const require_dom_query = require("../../dom-query-BUO7rGsg.cjs");
|
|
4
4
|
const require_utils = require("../../utils-ByNiZU8f.cjs");
|
|
5
5
|
const require_collection = require("../../collection-BBgC8xCb.cjs");
|
|
6
|
-
const require_core = require("../../core-
|
|
6
|
+
const require_core = require("../../core-Bw_czdwX.cjs");
|
|
7
7
|
require("../../interact-outside-Bg-QSXqp.cjs");
|
|
8
8
|
const require_dismissable = require("../../dismissable-DxjbwsOf.cjs");
|
|
9
9
|
const require_focus_visible = require("../../focus-visible-Co_9bW09.cjs");
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { n as AnatomyInstance, r as AnatomyPart } from "../../create-anatomy-9eFQs7lO.cjs";
|
|
2
2
|
import { f as TreeCollectionOptions, p as TreeNode, u as IndexPath } from "../../types-D-7AMgSE.cjs";
|
|
3
3
|
import { t as TreeCollection } from "../../tree-collection-DlqV5kYO.cjs";
|
|
4
|
-
import {
|
|
4
|
+
import { b as Service, p as Machine, u as EventObject } from "../../types-u-LWCSDE.cjs";
|
|
5
5
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
6
6
|
import { i as InteractOutsideHandlers } from "../../index-DzWGFhcS.cjs";
|
|
7
7
|
import { c as Placement, d as PositioningOptions } from "../../types-CZAtqGqH.cjs";
|
|
8
8
|
import { a as Point } from "../../types-CLXYEgfm.cjs";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/cascade-select/cascade-select.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
12
|
-
declare const parts: Record<"root" | "
|
|
11
|
+
declare const anatomy: AnatomyInstance<"root" | "list" | "item" | "trigger" | "indicator" | "content" | "label" | "valueText" | "control" | "clearTrigger" | "itemIndicator" | "itemText" | "positioner">;
|
|
12
|
+
declare const parts: Record<"root" | "list" | "item" | "trigger" | "indicator" | "content" | "label" | "valueText" | "control" | "clearTrigger" | "itemIndicator" | "itemText" | "positioner", AnatomyPart>;
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/machines/cascade-select/cascade-select.collection.d.ts
|
|
15
15
|
declare const collection: {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { n as AnatomyInstance, r as AnatomyPart } from "../../create-anatomy-BedZVdg0.mjs";
|
|
2
2
|
import { f as TreeCollectionOptions, p as TreeNode, u as IndexPath } from "../../types-9uw8LHpE.mjs";
|
|
3
3
|
import { t as TreeCollection } from "../../tree-collection-Dlf9EUrT.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { b as Service, p as Machine, u as EventObject } from "../../types-DvUmCWsb.mjs";
|
|
5
5
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
6
6
|
import { i as InteractOutsideHandlers } from "../../index-CGNNiDyE.mjs";
|
|
7
7
|
import { p as PositioningOptions, u as Placement } from "../../index-fMh0VDkR.mjs";
|
|
8
8
|
import { a as Point } from "../../types-DU764tY_.mjs";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/cascade-select/cascade-select.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
12
|
-
declare const parts: Record<"root" | "
|
|
11
|
+
declare const anatomy: AnatomyInstance<"root" | "list" | "item" | "trigger" | "indicator" | "content" | "label" | "valueText" | "control" | "clearTrigger" | "itemIndicator" | "itemText" | "positioner">;
|
|
12
|
+
declare const parts: Record<"root" | "list" | "item" | "trigger" | "indicator" | "content" | "label" | "valueText" | "control" | "clearTrigger" | "itemIndicator" | "itemText" | "positioner", AnatomyPart>;
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/machines/cascade-select/cascade-select.collection.d.ts
|
|
15
15
|
declare const collection: {
|
|
@@ -2,7 +2,7 @@ import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
|
|
|
2
2
|
import { C as queryAll, Et as isSelfTarget, I as scrollIntoView, K as isValidTabEvent, W as raf, bn as ariaAttr, ct as setElementValue, ft as getEventKey, it as dispatchInputValueEvent, lt as trackFormControl, p as createScope, un as isEditableElement, xn as dataAttr, z as observeAttributes } from "../../dom-query-BFuRs3l4.mjs";
|
|
3
3
|
import { Ct as isEmpty, ft as isEqual, u as createSplitProps, wt as last } from "../../utils-VVoZ_v29.mjs";
|
|
4
4
|
import { t as TreeCollection } from "../../collection-DgzidRvr.mjs";
|
|
5
|
-
import { a as createMachine, i as createGuards } from "../../core-
|
|
5
|
+
import { a as createMachine, i as createGuards } from "../../core-CTtbW9qh.mjs";
|
|
6
6
|
import "../../interact-outside-Ba50N1a5.mjs";
|
|
7
7
|
import { n as trackDismissableElement } from "../../dismissable-B9k5K6f9.mjs";
|
|
8
8
|
import { a as setInteractionModality, o as trackFocusVisible, t as getInteractionModality } from "../../focus-visible-BuLf8M9F.mjs";
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_create_anatomy = require("../../create-anatomy-BnwEmNnc.cjs");
|
|
3
3
|
const require_dom_query = require("../../dom-query-BUO7rGsg.cjs");
|
|
4
4
|
const require_utils = require("../../utils-ByNiZU8f.cjs");
|
|
5
|
-
const require_core = require("../../core-
|
|
5
|
+
const require_core = require("../../core-Bw_czdwX.cjs");
|
|
6
6
|
const require_focus_visible = require("../../focus-visible-Co_9bW09.cjs");
|
|
7
7
|
const require_create_props = require("../../create-props-DP39rHnH.cjs");
|
|
8
8
|
//#region src/machines/checkbox/checkbox.anatomy.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-9eFQs7lO.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { b as Service, p as Machine, u as EventObject } from "../../types-u-LWCSDE.cjs";
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/checkbox/checkbox.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "indicator" | "label" | "control">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/checkbox/checkbox.types.d.ts
|
|
9
9
|
type CheckedState = boolean | "indeterminate";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-BedZVdg0.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { b as Service, p as Machine, u as EventObject } from "../../types-DvUmCWsb.mjs";
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/checkbox/checkbox.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "indicator" | "label" | "control">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/checkbox/checkbox.types.d.ts
|
|
9
9
|
type CheckedState = boolean | "indeterminate";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
|
|
2
2
|
import { T as trackPress, a as visuallyHiddenStyle, ht as getEventTarget, lt as trackFormControl, rt as dispatchInputCheckedEvent, st as setElementChecked, xn as dataAttr } from "../../dom-query-BFuRs3l4.mjs";
|
|
3
3
|
import { u as createSplitProps } from "../../utils-VVoZ_v29.mjs";
|
|
4
|
-
import { a as createMachine, i as createGuards } from "../../core-
|
|
4
|
+
import { a as createMachine, i as createGuards } from "../../core-CTtbW9qh.mjs";
|
|
5
5
|
import { o as trackFocusVisible, r as isFocusVisible } from "../../focus-visible-BuLf8M9F.mjs";
|
|
6
6
|
import { t as createProps } from "../../create-props-DFW8DUsC.mjs";
|
|
7
7
|
//#region src/machines/checkbox/checkbox.anatomy.ts
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_create_anatomy = require("../../create-anatomy-BnwEmNnc.cjs");
|
|
3
3
|
const require_dom_query = require("../../dom-query-BUO7rGsg.cjs");
|
|
4
4
|
const require_utils = require("../../utils-ByNiZU8f.cjs");
|
|
5
|
-
const require_core = require("../../core-
|
|
5
|
+
const require_core = require("../../core-Bw_czdwX.cjs");
|
|
6
6
|
const require_create_props = require("../../create-props-DP39rHnH.cjs");
|
|
7
7
|
//#region src/machines/clipboard/clipboard.anatomy.ts
|
|
8
8
|
const anatomy = require_create_anatomy.createAnatomy("clipboard").parts("root", "control", "trigger", "indicator", "input", "label");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-9eFQs7lO.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { b as Service, p as Machine } from "../../types-u-LWCSDE.cjs";
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/clipboard/clipboard.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "trigger" | "indicator" | "label" | "control" | "input">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/clipboard/clipboard.types.d.ts
|
|
9
9
|
interface CopyStatusDetails {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-BedZVdg0.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { b as Service, p as Machine } from "../../types-DvUmCWsb.mjs";
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/clipboard/clipboard.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "trigger" | "indicator" | "label" | "control" | "input">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/clipboard/clipboard.types.d.ts
|
|
9
9
|
interface CopyStatusDetails {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
|
|
2
2
|
import { ct as setElementValue, on as getWindow, xn as dataAttr } from "../../dom-query-BFuRs3l4.mjs";
|
|
3
3
|
import { s as setRafTimeout, u as createSplitProps } from "../../utils-VVoZ_v29.mjs";
|
|
4
|
-
import { a as createMachine } from "../../core-
|
|
4
|
+
import { a as createMachine } from "../../core-CTtbW9qh.mjs";
|
|
5
5
|
import { t as createProps } from "../../create-props-DFW8DUsC.mjs";
|
|
6
6
|
//#region src/machines/clipboard/clipboard.anatomy.ts
|
|
7
7
|
const anatomy = createAnatomy("clipboard").parts("root", "control", "trigger", "indicator", "input", "label");
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_create_anatomy = require("../../create-anatomy-BnwEmNnc.cjs");
|
|
3
3
|
const require_dom_query = require("../../dom-query-BUO7rGsg.cjs");
|
|
4
4
|
const require_utils = require("../../utils-ByNiZU8f.cjs");
|
|
5
|
-
const require_core = require("../../core-
|
|
5
|
+
const require_core = require("../../core-Bw_czdwX.cjs");
|
|
6
6
|
const require_create_props = require("../../create-props-DP39rHnH.cjs");
|
|
7
7
|
//#region src/machines/collapsible/collapsible.anatomy.ts
|
|
8
8
|
const anatomy = require_create_anatomy.createAnatomy("collapsible").parts("root", "trigger", "content", "indicator");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-9eFQs7lO.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { b as Service, p as Machine } from "../../types-u-LWCSDE.cjs";
|
|
3
3
|
import { b as NormalizeProps, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/collapsible/collapsible.anatomy.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-BedZVdg0.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { b as Service, p as Machine } from "../../types-DvUmCWsb.mjs";
|
|
3
3
|
import { b as NormalizeProps, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/collapsible/collapsible.anatomy.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
|
|
2
2
|
import { B as observeChildren, H as nextTick, Qt as getComputedStyle, W as raf, c as setAttribute, et as getTabbables, ht as getEventTarget, u as setStyle, xn as dataAttr } from "../../dom-query-BFuRs3l4.mjs";
|
|
3
3
|
import { H as toPx, u as createSplitProps } from "../../utils-VVoZ_v29.mjs";
|
|
4
|
-
import { a as createMachine } from "../../core-
|
|
4
|
+
import { a as createMachine } from "../../core-CTtbW9qh.mjs";
|
|
5
5
|
import { t as createProps } from "../../create-props-DFW8DUsC.mjs";
|
|
6
6
|
//#region src/machines/collapsible/collapsible.anatomy.ts
|
|
7
7
|
const anatomy = createAnatomy("collapsible").parts("root", "trigger", "content", "indicator");
|
|
@@ -3,7 +3,7 @@ const require_create_anatomy = require("../../create-anatomy-BnwEmNnc.cjs");
|
|
|
3
3
|
const require_dom_query = require("../../dom-query-BUO7rGsg.cjs");
|
|
4
4
|
const require_utils = require("../../utils-ByNiZU8f.cjs");
|
|
5
5
|
const require_color_utils = require("../../color-utils-XoYeFX3g.cjs");
|
|
6
|
-
const require_core = require("../../core-
|
|
6
|
+
const require_core = require("../../core-Bw_czdwX.cjs");
|
|
7
7
|
require("../../interact-outside-Bg-QSXqp.cjs");
|
|
8
8
|
const require_dismissable = require("../../dismissable-DxjbwsOf.cjs");
|
|
9
9
|
const require_popper = require("../../popper-viCrafLC.cjs");
|
|
@@ -1036,6 +1036,7 @@ const machine = require_core.createMachine({
|
|
|
1036
1036
|
}
|
|
1037
1037
|
},
|
|
1038
1038
|
focused: {
|
|
1039
|
+
id: "color-picker-focused",
|
|
1039
1040
|
tags: ["closed", "focused"],
|
|
1040
1041
|
on: {
|
|
1041
1042
|
"CONTROLLED.OPEN": {
|
|
@@ -1067,52 +1068,13 @@ const machine = require_core.createMachine({
|
|
|
1067
1068
|
open: {
|
|
1068
1069
|
tags: ["open"],
|
|
1069
1070
|
effects: ["trackPositioning", "trackDismissableElement"],
|
|
1071
|
+
initial: "idle",
|
|
1070
1072
|
on: {
|
|
1071
1073
|
"CONTROLLED.CLOSE": [{
|
|
1072
1074
|
guard: "shouldRestoreFocus",
|
|
1073
1075
|
target: "focused",
|
|
1074
1076
|
actions: ["setReturnFocus"]
|
|
1075
1077
|
}, { target: "idle" }],
|
|
1076
|
-
"TRIGGER.CLICK": [{
|
|
1077
|
-
guard: "isOpenControlled",
|
|
1078
|
-
actions: ["invokeOnClose"]
|
|
1079
|
-
}, {
|
|
1080
|
-
target: "idle",
|
|
1081
|
-
actions: ["invokeOnClose"]
|
|
1082
|
-
}],
|
|
1083
|
-
"AREA.POINTER_DOWN": {
|
|
1084
|
-
target: "open:dragging",
|
|
1085
|
-
actions: [
|
|
1086
|
-
"setActiveChannel",
|
|
1087
|
-
"setAreaColorFromPoint",
|
|
1088
|
-
"focusAreaThumb"
|
|
1089
|
-
]
|
|
1090
|
-
},
|
|
1091
|
-
"AREA.FOCUS": { actions: ["setActiveChannel"] },
|
|
1092
|
-
"CHANNEL_SLIDER.POINTER_DOWN": {
|
|
1093
|
-
target: "open:dragging",
|
|
1094
|
-
actions: [
|
|
1095
|
-
"setActiveChannel",
|
|
1096
|
-
"setChannelColorFromPoint",
|
|
1097
|
-
"focusChannelThumb"
|
|
1098
|
-
]
|
|
1099
|
-
},
|
|
1100
|
-
"CHANNEL_SLIDER.FOCUS": { actions: ["setActiveChannel"] },
|
|
1101
|
-
"AREA.ARROW_LEFT": { actions: ["decrementAreaXChannel"] },
|
|
1102
|
-
"AREA.ARROW_RIGHT": { actions: ["incrementAreaXChannel"] },
|
|
1103
|
-
"AREA.ARROW_UP": { actions: ["incrementAreaYChannel"] },
|
|
1104
|
-
"AREA.ARROW_DOWN": { actions: ["decrementAreaYChannel"] },
|
|
1105
|
-
"AREA.PAGE_UP": { actions: ["incrementAreaXChannel"] },
|
|
1106
|
-
"AREA.PAGE_DOWN": { actions: ["decrementAreaXChannel"] },
|
|
1107
|
-
"CHANNEL_SLIDER.ARROW_LEFT": { actions: ["decrementChannel"] },
|
|
1108
|
-
"CHANNEL_SLIDER.ARROW_RIGHT": { actions: ["incrementChannel"] },
|
|
1109
|
-
"CHANNEL_SLIDER.ARROW_UP": { actions: ["incrementChannel"] },
|
|
1110
|
-
"CHANNEL_SLIDER.ARROW_DOWN": { actions: ["decrementChannel"] },
|
|
1111
|
-
"CHANNEL_SLIDER.PAGE_UP": { actions: ["incrementChannel"] },
|
|
1112
|
-
"CHANNEL_SLIDER.PAGE_DOWN": { actions: ["decrementChannel"] },
|
|
1113
|
-
"CHANNEL_SLIDER.HOME": { actions: ["setChannelToMin"] },
|
|
1114
|
-
"CHANNEL_SLIDER.END": { actions: ["setChannelToMax"] },
|
|
1115
|
-
"CHANNEL_INPUT.BLUR": { actions: ["setChannelColorFromInput"] },
|
|
1116
1078
|
INTERACT_OUTSIDE: [
|
|
1117
1079
|
{
|
|
1118
1080
|
guard: "isOpenControlled",
|
|
@@ -1134,72 +1096,84 @@ const machine = require_core.createMachine({
|
|
|
1134
1096
|
}, {
|
|
1135
1097
|
target: "idle",
|
|
1136
1098
|
actions: ["invokeOnClose"]
|
|
1137
|
-
}]
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
},
|
|
1143
|
-
{
|
|
1144
|
-
guard: "closeOnSelect",
|
|
1145
|
-
target: "focused",
|
|
1146
|
-
actions: [
|
|
1147
|
-
"setValue",
|
|
1148
|
-
"invokeOnClose",
|
|
1149
|
-
"setReturnFocus"
|
|
1150
|
-
]
|
|
1151
|
-
},
|
|
1152
|
-
{ actions: ["setValue"] }
|
|
1153
|
-
]
|
|
1154
|
-
}
|
|
1155
|
-
},
|
|
1156
|
-
"open:dragging": {
|
|
1157
|
-
tags: ["open"],
|
|
1158
|
-
exit: ["clearActiveChannel"],
|
|
1159
|
-
effects: [
|
|
1160
|
-
"trackPointerMove",
|
|
1161
|
-
"disableTextSelection",
|
|
1162
|
-
"trackPositioning",
|
|
1163
|
-
"trackDismissableElement"
|
|
1164
|
-
],
|
|
1165
|
-
on: {
|
|
1166
|
-
"CONTROLLED.CLOSE": [{
|
|
1167
|
-
guard: "shouldRestoreFocus",
|
|
1168
|
-
target: "focused",
|
|
1169
|
-
actions: ["setReturnFocus"]
|
|
1170
|
-
}, { target: "idle" }],
|
|
1171
|
-
"AREA.POINTER_MOVE": { actions: ["setAreaColorFromPoint", "focusAreaThumb"] },
|
|
1172
|
-
"AREA.POINTER_UP": {
|
|
1173
|
-
target: "open",
|
|
1174
|
-
actions: ["invokeOnChangeEnd"]
|
|
1175
|
-
},
|
|
1176
|
-
"CHANNEL_SLIDER.POINTER_MOVE": { actions: ["setChannelColorFromPoint", "focusChannelThumb"] },
|
|
1177
|
-
"CHANNEL_SLIDER.POINTER_UP": {
|
|
1178
|
-
target: "open",
|
|
1179
|
-
actions: ["invokeOnChangeEnd"]
|
|
1180
|
-
},
|
|
1181
|
-
INTERACT_OUTSIDE: [
|
|
1182
|
-
{
|
|
1099
|
+
}]
|
|
1100
|
+
},
|
|
1101
|
+
states: {
|
|
1102
|
+
idle: { on: {
|
|
1103
|
+
"TRIGGER.CLICK": [{
|
|
1183
1104
|
guard: "isOpenControlled",
|
|
1184
1105
|
actions: ["invokeOnClose"]
|
|
1106
|
+
}, {
|
|
1107
|
+
target: "#color-picker-focused",
|
|
1108
|
+
actions: ["invokeOnClose"]
|
|
1109
|
+
}],
|
|
1110
|
+
"AREA.POINTER_DOWN": {
|
|
1111
|
+
target: "dragging",
|
|
1112
|
+
actions: [
|
|
1113
|
+
"setActiveChannel",
|
|
1114
|
+
"setAreaColorFromPoint",
|
|
1115
|
+
"focusAreaThumb"
|
|
1116
|
+
]
|
|
1185
1117
|
},
|
|
1186
|
-
{
|
|
1187
|
-
|
|
1188
|
-
target: "
|
|
1189
|
-
actions: [
|
|
1118
|
+
"AREA.FOCUS": { actions: ["setActiveChannel"] },
|
|
1119
|
+
"CHANNEL_SLIDER.POINTER_DOWN": {
|
|
1120
|
+
target: "dragging",
|
|
1121
|
+
actions: [
|
|
1122
|
+
"setActiveChannel",
|
|
1123
|
+
"setChannelColorFromPoint",
|
|
1124
|
+
"focusChannelThumb"
|
|
1125
|
+
]
|
|
1190
1126
|
},
|
|
1191
|
-
{
|
|
1192
|
-
|
|
1193
|
-
|
|
1127
|
+
"CHANNEL_SLIDER.FOCUS": { actions: ["setActiveChannel"] },
|
|
1128
|
+
"AREA.ARROW_LEFT": { actions: ["decrementAreaXChannel"] },
|
|
1129
|
+
"AREA.ARROW_RIGHT": { actions: ["incrementAreaXChannel"] },
|
|
1130
|
+
"AREA.ARROW_UP": { actions: ["incrementAreaYChannel"] },
|
|
1131
|
+
"AREA.ARROW_DOWN": { actions: ["decrementAreaYChannel"] },
|
|
1132
|
+
"AREA.PAGE_UP": { actions: ["incrementAreaXChannel"] },
|
|
1133
|
+
"AREA.PAGE_DOWN": { actions: ["decrementAreaXChannel"] },
|
|
1134
|
+
"CHANNEL_SLIDER.ARROW_LEFT": { actions: ["decrementChannel"] },
|
|
1135
|
+
"CHANNEL_SLIDER.ARROW_RIGHT": { actions: ["incrementChannel"] },
|
|
1136
|
+
"CHANNEL_SLIDER.ARROW_UP": { actions: ["incrementChannel"] },
|
|
1137
|
+
"CHANNEL_SLIDER.ARROW_DOWN": { actions: ["decrementChannel"] },
|
|
1138
|
+
"CHANNEL_SLIDER.PAGE_UP": { actions: ["incrementChannel"] },
|
|
1139
|
+
"CHANNEL_SLIDER.PAGE_DOWN": { actions: ["decrementChannel"] },
|
|
1140
|
+
"CHANNEL_SLIDER.HOME": { actions: ["setChannelToMin"] },
|
|
1141
|
+
"CHANNEL_SLIDER.END": { actions: ["setChannelToMax"] },
|
|
1142
|
+
"CHANNEL_INPUT.BLUR": { actions: ["setChannelColorFromInput"] },
|
|
1143
|
+
"SWATCH_TRIGGER.CLICK": [
|
|
1144
|
+
{
|
|
1145
|
+
guard: and("isOpenControlled", "closeOnSelect"),
|
|
1146
|
+
actions: ["setValue", "invokeOnClose"]
|
|
1147
|
+
},
|
|
1148
|
+
{
|
|
1149
|
+
guard: "closeOnSelect",
|
|
1150
|
+
target: "focused",
|
|
1151
|
+
actions: [
|
|
1152
|
+
"setValue",
|
|
1153
|
+
"invokeOnClose",
|
|
1154
|
+
"setReturnFocus"
|
|
1155
|
+
]
|
|
1156
|
+
},
|
|
1157
|
+
{ actions: ["setValue"] }
|
|
1158
|
+
]
|
|
1159
|
+
} },
|
|
1160
|
+
dragging: {
|
|
1161
|
+
tags: ["dragging"],
|
|
1162
|
+
exit: ["clearActiveChannel"],
|
|
1163
|
+
effects: ["trackPointerMove", "disableTextSelection"],
|
|
1164
|
+
on: {
|
|
1165
|
+
"AREA.POINTER_MOVE": { actions: ["setAreaColorFromPoint", "focusAreaThumb"] },
|
|
1166
|
+
"AREA.POINTER_UP": {
|
|
1167
|
+
target: "idle",
|
|
1168
|
+
actions: ["invokeOnChangeEnd"]
|
|
1169
|
+
},
|
|
1170
|
+
"CHANNEL_SLIDER.POINTER_MOVE": { actions: ["setChannelColorFromPoint", "focusChannelThumb"] },
|
|
1171
|
+
"CHANNEL_SLIDER.POINTER_UP": {
|
|
1172
|
+
target: "idle",
|
|
1173
|
+
actions: ["invokeOnChangeEnd"]
|
|
1174
|
+
}
|
|
1194
1175
|
}
|
|
1195
|
-
|
|
1196
|
-
CLOSE: [{
|
|
1197
|
-
guard: "isOpenControlled",
|
|
1198
|
-
actions: ["invokeOnClose"]
|
|
1199
|
-
}, {
|
|
1200
|
-
target: "idle",
|
|
1201
|
-
actions: ["invokeOnClose"]
|
|
1202
|
-
}]
|
|
1176
|
+
}
|
|
1203
1177
|
}
|
|
1204
1178
|
}
|
|
1205
1179
|
},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as Anatomy } from "../../create-anatomy-9eFQs7lO.cjs";
|
|
2
2
|
import { a as ColorFormat, n as ColorAxes, r as ColorChannel, s as ColorType, t as Color } from "../../color-vvN_Cdao.cjs";
|
|
3
|
-
import {
|
|
3
|
+
import { b as Service, p as Machine, u as EventObject } from "../../types-u-LWCSDE.cjs";
|
|
4
4
|
import { b as NormalizeProps, d as Orientation, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
5
5
|
import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-DzWGFhcS.cjs";
|
|
6
6
|
import { d as PositioningOptions } from "../../types-CZAtqGqH.cjs";
|
|
7
7
|
|
|
8
8
|
//#region src/machines/color-picker/color-picker.anatomy.d.ts
|
|
9
|
-
declare const anatomy: Anatomy<"root" | "
|
|
9
|
+
declare const anatomy: Anatomy<"root" | "trigger" | "content" | "label" | "valueText" | "control" | "area" | "positioner" | "areaThumb" | "areaBackground" | "channelSlider" | "channelSliderLabel" | "channelSliderTrack" | "channelSliderThumb" | "channelSliderValueText" | "channelInput" | "transparencyGrid" | "swatchGroup" | "swatchTrigger" | "swatchIndicator" | "swatch" | "eyeDropperTrigger" | "formatTrigger" | "formatSelect">;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/machines/color-picker/color-picker.types.d.ts
|
|
12
12
|
type ExtendedColorChannel = ColorChannel | "hex" | "css";
|
|
@@ -78,7 +78,7 @@ interface ColorPickerProps extends CommonProperties, DirectionProperty, Interact
|
|
|
78
78
|
type PropsWithDefault = "defaultFormat" | "defaultValue" | "openAutoFocus" | "dir" | "positioning";
|
|
79
79
|
type ColorPickerSchema = {
|
|
80
80
|
tag: "open" | "closed" | "dragging" | "focused";
|
|
81
|
-
state: "idle" | "focused" | "open" | "open
|
|
81
|
+
state: "idle" | "focused" | "open" | "open.idle" | "open.dragging";
|
|
82
82
|
props: RequiredBy<ColorPickerProps, PropsWithDefault>;
|
|
83
83
|
computed: {
|
|
84
84
|
disabled: boolean;
|