@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
package/dist/core.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { C as TransitionMatch, S as TransitionMap, T as ValueOrFn, _ as Params, a as BindableParams, b as Service, c as ComputedFn, d as GuardFn, f as INIT_STATE, g as MachineStatus, h as MachineState, i as BindableFn, l as EffectsOrFn, m as MachineSchema, n as Bindable, o as BindableRefs, p as Machine, r as BindableContext, s as ChooseFn, t as ActionsOrFn, u as EventObject, v as PropFn, w as TransitionSet, x as Transition, y as Scope } from "./types-u-LWCSDE.cjs";
|
|
2
2
|
import { l as isActiveElement } from "./node--dRqVsA-.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/shared/core/merge-props.d.ts
|
|
@@ -34,6 +34,29 @@ declare function setup<T extends MachineSchema>(): {
|
|
|
34
34
|
}: Params<T>) => T["action"][] | undefined;
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
37
|
+
//#region src/shared/core/state.d.ts
|
|
38
|
+
declare function ensureStateIndex<T extends MachineSchema>(machine: Machine<T>): Map<string, MachineState<T, string>>;
|
|
39
|
+
type StateChain<T extends MachineSchema> = Array<{
|
|
40
|
+
path: string;
|
|
41
|
+
state: MachineState<T>;
|
|
42
|
+
}>;
|
|
43
|
+
declare function getStateChain<T extends MachineSchema>(machine: Machine<T>, state: T["state"] | undefined): StateChain<T>;
|
|
44
|
+
declare function resolveStateValue<T extends MachineSchema>(machine: Machine<T>, value: T["state"] | string, source?: string): T["state"];
|
|
45
|
+
declare function getStateDefinition<T extends MachineSchema>(machine: Machine<T>, state: T["state"]): MachineState<T, string>;
|
|
46
|
+
declare function findTransition<T extends MachineSchema>(machine: Machine<T>, state: T["state"], eventType: string): TransitionMatch<T>;
|
|
47
|
+
declare function getExitEnterStates<T extends MachineSchema>(machine: Machine<T>, prevState: T["state"] | undefined, nextState: T["state"], reenter?: boolean): {
|
|
48
|
+
exiting: {
|
|
49
|
+
path: string;
|
|
50
|
+
state: MachineState<T, string>;
|
|
51
|
+
}[];
|
|
52
|
+
entering: {
|
|
53
|
+
path: string;
|
|
54
|
+
state: MachineState<T, string>;
|
|
55
|
+
}[];
|
|
56
|
+
};
|
|
57
|
+
declare function matchesState(current: string | undefined, value: string): boolean;
|
|
58
|
+
declare function hasTag<T extends MachineSchema>(machine: Machine<T>, state: T["state"], tag: T["tag"]): boolean;
|
|
59
|
+
//#endregion
|
|
37
60
|
//#region src/shared/core/scope.d.ts
|
|
38
61
|
declare function createScope(props: Pick<Scope, "id" | "ids" | "getRootNode">): {
|
|
39
62
|
getRootNode: () => Document | ShadowRoot;
|
|
@@ -46,4 +69,4 @@ declare function createScope(props: Pick<Scope, "id" | "ids" | "getRootNode">):
|
|
|
46
69
|
id?: string | undefined | undefined;
|
|
47
70
|
};
|
|
48
71
|
//#endregion
|
|
49
|
-
export { ActionsOrFn, Bindable, BindableContext, BindableFn, BindableParams, BindableRefs, ChooseFn, ComputedFn, EffectsOrFn, EventObject, GuardFn, INIT_STATE, Machine, MachineSchema, MachineStatus, Params, PropFn, Scope, Service, Transition, ValueOrFn, createGuards, createMachine, createScope, memo, mergeProps, setup };
|
|
72
|
+
export { ActionsOrFn, Bindable, BindableContext, BindableFn, BindableParams, BindableRefs, ChooseFn, ComputedFn, EffectsOrFn, EventObject, GuardFn, INIT_STATE, Machine, MachineSchema, MachineState, MachineStatus, Params, PropFn, Scope, Service, Transition, TransitionMap, TransitionMatch, TransitionSet, ValueOrFn, createGuards, createMachine, createScope, ensureStateIndex, findTransition, getExitEnterStates, getStateChain, getStateDefinition, hasTag, matchesState, memo, mergeProps, resolveStateValue, setup };
|
package/dist/core.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { C as TransitionMatch, S as TransitionMap, T as ValueOrFn, _ as Params, a as BindableParams, b as Service, c as ComputedFn, d as GuardFn, f as INIT_STATE, g as MachineStatus, h as MachineState, i as BindableFn, l as EffectsOrFn, m as MachineSchema, n as Bindable, o as BindableRefs, p as Machine, r as BindableContext, s as ChooseFn, t as ActionsOrFn, u as EventObject, v as PropFn, w as TransitionSet, x as Transition, y as Scope } from "./types-DvUmCWsb.mjs";
|
|
2
2
|
import { l as isActiveElement } from "./node-DkWL2ywA.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/shared/core/merge-props.d.ts
|
|
@@ -34,6 +34,29 @@ declare function setup<T extends MachineSchema>(): {
|
|
|
34
34
|
}: Params<T>) => T["action"][] | undefined;
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
37
|
+
//#region src/shared/core/state.d.ts
|
|
38
|
+
declare function ensureStateIndex<T extends MachineSchema>(machine: Machine<T>): Map<string, MachineState<T, string>>;
|
|
39
|
+
type StateChain<T extends MachineSchema> = Array<{
|
|
40
|
+
path: string;
|
|
41
|
+
state: MachineState<T>;
|
|
42
|
+
}>;
|
|
43
|
+
declare function getStateChain<T extends MachineSchema>(machine: Machine<T>, state: T["state"] | undefined): StateChain<T>;
|
|
44
|
+
declare function resolveStateValue<T extends MachineSchema>(machine: Machine<T>, value: T["state"] | string, source?: string): T["state"];
|
|
45
|
+
declare function getStateDefinition<T extends MachineSchema>(machine: Machine<T>, state: T["state"]): MachineState<T, string>;
|
|
46
|
+
declare function findTransition<T extends MachineSchema>(machine: Machine<T>, state: T["state"], eventType: string): TransitionMatch<T>;
|
|
47
|
+
declare function getExitEnterStates<T extends MachineSchema>(machine: Machine<T>, prevState: T["state"] | undefined, nextState: T["state"], reenter?: boolean): {
|
|
48
|
+
exiting: {
|
|
49
|
+
path: string;
|
|
50
|
+
state: MachineState<T, string>;
|
|
51
|
+
}[];
|
|
52
|
+
entering: {
|
|
53
|
+
path: string;
|
|
54
|
+
state: MachineState<T, string>;
|
|
55
|
+
}[];
|
|
56
|
+
};
|
|
57
|
+
declare function matchesState(current: string | undefined, value: string): boolean;
|
|
58
|
+
declare function hasTag<T extends MachineSchema>(machine: Machine<T>, state: T["state"], tag: T["tag"]): boolean;
|
|
59
|
+
//#endregion
|
|
37
60
|
//#region src/shared/core/scope.d.ts
|
|
38
61
|
declare function createScope(props: Pick<Scope, "id" | "ids" | "getRootNode">): {
|
|
39
62
|
getRootNode: () => Document | ShadowRoot;
|
|
@@ -46,4 +69,4 @@ declare function createScope(props: Pick<Scope, "id" | "ids" | "getRootNode">):
|
|
|
46
69
|
id?: string | undefined | undefined;
|
|
47
70
|
};
|
|
48
71
|
//#endregion
|
|
49
|
-
export { ActionsOrFn, Bindable, BindableContext, BindableFn, BindableParams, BindableRefs, ChooseFn, ComputedFn, EffectsOrFn, EventObject, GuardFn, INIT_STATE, Machine, MachineSchema, MachineStatus, Params, PropFn, Scope, Service, Transition, ValueOrFn, createGuards, createMachine, createScope, memo, mergeProps, setup };
|
|
72
|
+
export { ActionsOrFn, Bindable, BindableContext, BindableFn, BindableParams, BindableRefs, ChooseFn, ComputedFn, EffectsOrFn, EventObject, GuardFn, INIT_STATE, Machine, MachineSchema, MachineState, MachineStatus, Params, PropFn, Scope, Service, Transition, TransitionMap, TransitionMatch, TransitionSet, ValueOrFn, createGuards, createMachine, createScope, ensureStateIndex, findTransition, getExitEnterStates, getStateChain, getStateDefinition, hasTag, matchesState, memo, mergeProps, resolveStateValue, setup };
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./dom-query-BFuRs3l4.mjs";
|
|
2
2
|
import "./utils-VVoZ_v29.mjs";
|
|
3
|
-
import { a as createMachine, c as mergeProps, i as createGuards, n as INIT_STATE, o as setup, r as MachineStatus, s as
|
|
4
|
-
export { INIT_STATE, MachineStatus, createGuards, createMachine, createScope, memo, mergeProps, setup };
|
|
3
|
+
import { a as createMachine, c as findTransition, d as getStateDefinition, f as hasTag, g as mergeProps, h as memo, i as createGuards, l as getExitEnterStates, m as resolveStateValue, n as INIT_STATE, o as setup, p as matchesState, r as MachineStatus, s as ensureStateIndex, t as createScope, u as getStateChain } from "./core-CTtbW9qh.mjs";
|
|
4
|
+
export { INIT_STATE, MachineStatus, createGuards, createMachine, createScope, ensureStateIndex, findTransition, getExitEnterStates, getStateChain, getStateDefinition, hasTag, matchesState, memo, mergeProps, resolveStateValue, setup };
|
|
@@ -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/accordion/accordion.anatomy.ts
|
|
8
8
|
const anatomy = require_create_anatomy.createAnatomy("accordion").parts("root", "item", "itemTrigger", "itemContent", "itemIndicator");
|
|
@@ -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/accordion/accordion.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "item" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "item" | "itemIndicator" | "itemContent" | "itemTrigger">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/accordion/accordion.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -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/accordion/accordion.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "item" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "item" | "itemIndicator" | "itemContent" | "itemTrigger">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/accordion/accordion.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
|
|
2
2
|
import { C as queryAll, Vt as isSafari, b as nextById, ft as getEventKey, x as prevById, xn as dataAttr } from "../../dom-query-BFuRs3l4.mjs";
|
|
3
3
|
import { At as remove, i as warn, pt as add, u as createSplitProps, vt as first, wt as last } 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 { t as createProps } from "../../create-props-DFW8DUsC.mjs";
|
|
6
6
|
//#region src/machines/accordion/accordion.anatomy.ts
|
|
7
7
|
const anatomy = createAnatomy("accordion").parts("root", "item", "itemTrigger", "itemContent", "itemIndicator");
|
|
@@ -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_rect_utils = require("../../rect-utils-D3RkAaHK.cjs");
|
|
7
7
|
const require_create_props = require("../../create-props-DP39rHnH.cjs");
|
|
8
8
|
//#region src/machines/angle-slider/angle-slider.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/angle-slider/angle-slider.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "track" | "valueText" | "control" | "marker" | "thumb" | "markerGroup">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/angle-slider/angle-slider.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -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/angle-slider/angle-slider.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "track" | "valueText" | "control" | "marker" | "thumb" | "markerGroup">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/angle-slider/angle-slider.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
|
|
2
2
|
import { E as trackPointerMove, St as isLeftClick, W as raf, ct as setElementValue, ft as getEventKey, gt as getNativeEvent, mt as getEventStep, pt as getEventPoint, xn as dataAttr } from "../../dom-query-BFuRs3l4.mjs";
|
|
3
3
|
import { B as snapValueToStep, 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 { R as createRect, q as getPointAngle } from "../../rect-utils-B5xqFvKC.mjs";
|
|
6
6
|
import { t as createProps } from "../../create-props-DFW8DUsC.mjs";
|
|
7
7
|
//#region src/machines/angle-slider/angle-slider.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
|
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/aspect-ratio/aspect-ratio.anatomy.ts
|
|
8
8
|
const anatomy = require_create_anatomy.createAnatomy("aspect-ratio").parts("root", "content");
|
|
@@ -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, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/aspect-ratio/aspect-ratio.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, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/aspect-ratio/aspect-ratio.anatomy.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
|
|
2
2
|
import "../../dom-query-BFuRs3l4.mjs";
|
|
3
3
|
import { 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/aspect-ratio/aspect-ratio.anatomy.ts
|
|
7
7
|
const anatomy = createAnatomy("aspect-ratio").parts("root", "content");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../dom-query-BUO7rGsg.cjs");
|
|
3
3
|
const require_utils = require("../../utils-ByNiZU8f.cjs");
|
|
4
|
-
const require_core = require("../../core-
|
|
4
|
+
const require_core = require("../../core-Bw_czdwX.cjs");
|
|
5
5
|
//#region src/machines/async-list/async-list.connect.ts
|
|
6
6
|
function connect(service) {
|
|
7
7
|
const { state, context, send } = service;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as Service, p as Machine, u as EventObject } from "../../types-u-LWCSDE.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/machines/async-list/async-list.types.d.ts
|
|
4
4
|
type SortDirection = "ascending" | "descending";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as Service, p as Machine, u as EventObject } from "../../types-DvUmCWsb.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/machines/async-list/async-list.types.d.ts
|
|
4
4
|
type SortDirection = "ascending" | "descending";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../dom-query-BFuRs3l4.mjs";
|
|
2
2
|
import { n as ensureProps, t as ensure } from "../../utils-VVoZ_v29.mjs";
|
|
3
|
-
import { a as createMachine } from "../../core-
|
|
3
|
+
import { a as createMachine } from "../../core-CTtbW9qh.mjs";
|
|
4
4
|
//#region src/machines/async-list/async-list.connect.ts
|
|
5
5
|
function connect(service) {
|
|
6
6
|
const { state, context, send } = service;
|
|
@@ -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/avatar/avatar.anatomy.ts
|
|
8
8
|
const anatomy = require_create_anatomy.createAnatomy("avatar").parts("root", "image", "fallback");
|
|
@@ -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/avatar/avatar.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/avatar/avatar.anatomy.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
|
|
2
2
|
import { B as observeChildren, z as observeAttributes } from "../../dom-query-BFuRs3l4.mjs";
|
|
3
3
|
import { 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/avatar/avatar.anatomy.ts
|
|
7
7
|
const anatomy = createAnatomy("avatar").parts("root", "image", "fallback");
|
|
@@ -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_scroll_snap = require("../../scroll-snap-vZ2q6dcN.cjs");
|
|
7
7
|
const require_create_props = require("../../create-props-DP39rHnH.cjs");
|
|
8
8
|
//#region src/machines/carousel/carousel.anatomy.ts
|
|
@@ -38,22 +38,23 @@ function connect(service, normalize) {
|
|
|
38
38
|
const autoSize = prop("autoSize");
|
|
39
39
|
const pageSnapPoints = Array.from(context.get("pageSnapPoints"));
|
|
40
40
|
const page = context.get("page");
|
|
41
|
+
const activePage = pageSnapPoints.length ? require_utils.clampValue(page, 0, pageSnapPoints.length - 1) : 0;
|
|
41
42
|
const slidesPerPage = prop("slidesPerPage");
|
|
42
43
|
const padding = prop("padding");
|
|
43
44
|
const translations = prop("translations");
|
|
44
45
|
return {
|
|
45
46
|
isPlaying,
|
|
46
47
|
isDragging,
|
|
47
|
-
page,
|
|
48
|
+
page: activePage,
|
|
48
49
|
pageSnapPoints,
|
|
49
50
|
canScrollNext,
|
|
50
51
|
canScrollPrev,
|
|
51
52
|
getProgress() {
|
|
52
|
-
return
|
|
53
|
+
return activePage / pageSnapPoints.length;
|
|
53
54
|
},
|
|
54
55
|
getProgressText() {
|
|
55
56
|
const details = {
|
|
56
|
-
page:
|
|
57
|
+
page: activePage + 1,
|
|
57
58
|
totalPages: pageSnapPoints.length
|
|
58
59
|
};
|
|
59
60
|
return translations.progressText?.(details) ?? "";
|
|
@@ -303,7 +304,7 @@ function connect(service, normalize) {
|
|
|
303
304
|
"data-orientation": prop("orientation"),
|
|
304
305
|
"data-index": props.index,
|
|
305
306
|
"data-readonly": require_dom_query.dataAttr(props.readOnly),
|
|
306
|
-
"data-current": require_dom_query.dataAttr(props.index ===
|
|
307
|
+
"data-current": require_dom_query.dataAttr(props.index === activePage),
|
|
307
308
|
"aria-label": translations.indicator(props.index),
|
|
308
309
|
onClick(event) {
|
|
309
310
|
if (event.defaultPrevented) return;
|
|
@@ -444,7 +445,7 @@ const machine = require_core.createMachine({
|
|
|
444
445
|
target: "idle",
|
|
445
446
|
actions: ["clearScrollEndTimer", "setMatchingPage"]
|
|
446
447
|
},
|
|
447
|
-
"SNAP.REFRESH": { actions: ["setSnapPoints"
|
|
448
|
+
"SNAP.REFRESH": { actions: ["setSnapPoints"] },
|
|
448
449
|
"PAGE.SCROLL": { actions: ["scrollToPage"] }
|
|
449
450
|
},
|
|
450
451
|
effects: [
|
|
@@ -484,11 +485,36 @@ const machine = require_core.createMachine({
|
|
|
484
485
|
on: {
|
|
485
486
|
DRAGGING: { actions: ["scrollSlides", "invokeDragging"] },
|
|
486
487
|
"DRAGGING.END": {
|
|
487
|
-
target: "
|
|
488
|
-
actions: ["endDragging"
|
|
488
|
+
target: "settling",
|
|
489
|
+
actions: ["endDragging"]
|
|
489
490
|
}
|
|
490
491
|
}
|
|
491
492
|
},
|
|
493
|
+
settling: {
|
|
494
|
+
effects: ["trackSettlingScroll"],
|
|
495
|
+
on: {
|
|
496
|
+
"DRAGGING.START": {
|
|
497
|
+
target: "dragging",
|
|
498
|
+
actions: ["clearScrollEndTimer", "invokeDragStart"]
|
|
499
|
+
},
|
|
500
|
+
"SCROLL.END": [{
|
|
501
|
+
guard: "isFocused",
|
|
502
|
+
target: "focus",
|
|
503
|
+
actions: [
|
|
504
|
+
"clearScrollEndTimer",
|
|
505
|
+
"setClosestPage",
|
|
506
|
+
"invokeDraggingEnd"
|
|
507
|
+
]
|
|
508
|
+
}, {
|
|
509
|
+
target: "idle",
|
|
510
|
+
actions: [
|
|
511
|
+
"clearScrollEndTimer",
|
|
512
|
+
"setClosestPage",
|
|
513
|
+
"invokeDraggingEnd"
|
|
514
|
+
]
|
|
515
|
+
}]
|
|
516
|
+
}
|
|
517
|
+
},
|
|
492
518
|
userScroll: {
|
|
493
519
|
effects: ["trackScroll"],
|
|
494
520
|
on: {
|
|
@@ -553,7 +579,8 @@ const machine = require_core.createMachine({
|
|
|
553
579
|
return () => observer.disconnect();
|
|
554
580
|
},
|
|
555
581
|
trackSlideResize({ scope, send }) {
|
|
556
|
-
|
|
582
|
+
const el = getItemGroupEl(scope);
|
|
583
|
+
if (!el) return;
|
|
557
584
|
const exec = () => {
|
|
558
585
|
send({
|
|
559
586
|
type: "SNAP.REFRESH",
|
|
@@ -571,7 +598,7 @@ const machine = require_core.createMachine({
|
|
|
571
598
|
});
|
|
572
599
|
const itemEls = getItemEls(scope);
|
|
573
600
|
itemEls.forEach(exec);
|
|
574
|
-
return require_utils.callAll(...itemEls.map((el) => require_dom_query.resizeObserverBorderBox.observe(el, exec)));
|
|
601
|
+
return require_utils.callAll(...[require_dom_query.resizeObserverBorderBox.observe(el, exec), ...itemEls.map((el) => require_dom_query.resizeObserverBorderBox.observe(el, exec))]);
|
|
575
602
|
},
|
|
576
603
|
trackSlideIntersections({ scope, prop, context }) {
|
|
577
604
|
const el = getItemGroupEl(scope);
|
|
@@ -602,6 +629,27 @@ const machine = require_core.createMachine({
|
|
|
602
629
|
};
|
|
603
630
|
return require_dom_query.addDomEvent(el, "scroll", onScroll, { passive: true });
|
|
604
631
|
},
|
|
632
|
+
trackSettlingScroll({ send, refs, scope }) {
|
|
633
|
+
const el = getItemGroupEl(scope);
|
|
634
|
+
if (!el) return;
|
|
635
|
+
const startTimer = () => {
|
|
636
|
+
clearTimeout(refs.get("timeoutRef"));
|
|
637
|
+
refs.set("timeoutRef", void 0);
|
|
638
|
+
refs.set("timeoutRef", setTimeout(() => {
|
|
639
|
+
send({ type: "SCROLL.END" });
|
|
640
|
+
}, 200));
|
|
641
|
+
};
|
|
642
|
+
startTimer();
|
|
643
|
+
const onScroll = () => {
|
|
644
|
+
startTimer();
|
|
645
|
+
};
|
|
646
|
+
const cleanup = require_dom_query.addDomEvent(el, "scroll", onScroll, { passive: true });
|
|
647
|
+
return () => {
|
|
648
|
+
cleanup();
|
|
649
|
+
clearTimeout(refs.get("timeoutRef"));
|
|
650
|
+
refs.set("timeoutRef", void 0);
|
|
651
|
+
};
|
|
652
|
+
},
|
|
605
653
|
trackDocumentVisibility({ scope, send }) {
|
|
606
654
|
const doc = scope.getDoc();
|
|
607
655
|
const onVisibilityChange = () => {
|
|
@@ -680,8 +728,11 @@ const machine = require_core.createMachine({
|
|
|
680
728
|
const el = getItemGroupEl(scope);
|
|
681
729
|
if (!el) return;
|
|
682
730
|
const scrollPosition = computed("isHorizontal") ? el.scrollLeft : el.scrollTop;
|
|
683
|
-
const
|
|
684
|
-
if (
|
|
731
|
+
const snapPoints = context.get("pageSnapPoints");
|
|
732
|
+
if (!snapPoints.length) return;
|
|
733
|
+
const page = snapPoints.reduce((closestIndex, snapPoint, index) => {
|
|
734
|
+
return Math.abs(snapPoint - scrollPosition) < Math.abs(snapPoints[closestIndex] - scrollPosition) ? index : closestIndex;
|
|
735
|
+
}, 0);
|
|
685
736
|
context.set("page", page);
|
|
686
737
|
},
|
|
687
738
|
setNextPage({ context, prop, state }) {
|
|
@@ -706,15 +757,15 @@ const machine = require_core.createMachine({
|
|
|
706
757
|
const page = event.index ?? context.get("page");
|
|
707
758
|
context.set("page", page);
|
|
708
759
|
},
|
|
709
|
-
clampPage({ context }) {
|
|
710
|
-
const index = require_utils.clampValue(context.get("page"), 0, context.get("pageSnapPoints").length - 1);
|
|
711
|
-
context.set("page", index);
|
|
712
|
-
},
|
|
713
760
|
setSnapPoints({ context, computed, scope }) {
|
|
714
761
|
const el = getItemGroupEl(scope);
|
|
715
762
|
if (!el) return;
|
|
716
763
|
const scrollSnapPoints = require_scroll_snap.getScrollSnapPositions(el);
|
|
717
|
-
|
|
764
|
+
const pageSnapPoints = computed("isHorizontal") ? scrollSnapPoints.x : scrollSnapPoints.y;
|
|
765
|
+
context.set("pageSnapPoints", pageSnapPoints);
|
|
766
|
+
if (!pageSnapPoints.length) return;
|
|
767
|
+
const index = require_utils.clampValue(context.get("page"), 0, pageSnapPoints.length - 1);
|
|
768
|
+
context.set("page", index);
|
|
718
769
|
},
|
|
719
770
|
disableScrollSnap({ scope }) {
|
|
720
771
|
const el = getItemGroupEl(scope);
|
|
@@ -736,6 +787,7 @@ const machine = require_core.createMachine({
|
|
|
736
787
|
const isHorizontal = computed("isHorizontal");
|
|
737
788
|
const scrollPos = isHorizontal ? el.scrollLeft : el.scrollTop;
|
|
738
789
|
const snapPoints = context.get("pageSnapPoints");
|
|
790
|
+
if (!snapPoints.length) return;
|
|
739
791
|
const closest = snapPoints.reduce((closest, curr) => {
|
|
740
792
|
return Math.abs(curr - scrollPos) < Math.abs(closest - scrollPos) ? curr : closest;
|
|
741
793
|
}, snapPoints[0]);
|
|
@@ -745,7 +797,6 @@ const machine = require_core.createMachine({
|
|
|
745
797
|
top: isHorizontal ? el.scrollTop : closest,
|
|
746
798
|
behavior: "smooth"
|
|
747
799
|
});
|
|
748
|
-
context.set("page", snapPoints.indexOf(closest));
|
|
749
800
|
const scrollSnapType = el.dataset.scrollSnapType;
|
|
750
801
|
if (scrollSnapType) {
|
|
751
802
|
el.style.setProperty("scroll-snap-type", scrollSnapType);
|
|
@@ -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, d as Orientation, f as OrientationProperty, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/carousel/carousel.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "item" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "item" | "indicator" | "nextTrigger" | "prevTrigger" | "control" | "itemGroup" | "indicatorGroup" | "autoplayTrigger" | "progressText">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/carousel/carousel.types.d.ts
|
|
9
9
|
interface PageChangeDetails {
|
|
@@ -86,7 +86,7 @@ interface CarouselSchema {
|
|
|
86
86
|
refs: {
|
|
87
87
|
timeoutRef: any;
|
|
88
88
|
};
|
|
89
|
-
state: "idle" | "dragging" | "autoplay" | "userScroll" | "focus";
|
|
89
|
+
state: "idle" | "dragging" | "settling" | "autoplay" | "userScroll" | "focus";
|
|
90
90
|
effect: string;
|
|
91
91
|
action: string;
|
|
92
92
|
guard: string;
|
|
@@ -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, d as Orientation, f as OrientationProperty, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/carousel/carousel.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "item" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "item" | "indicator" | "nextTrigger" | "prevTrigger" | "control" | "itemGroup" | "indicatorGroup" | "autoplayTrigger" | "progressText">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/carousel/carousel.types.d.ts
|
|
9
9
|
interface PageChangeDetails {
|
|
@@ -86,7 +86,7 @@ interface CarouselSchema {
|
|
|
86
86
|
refs: {
|
|
87
87
|
timeoutRef: any;
|
|
88
88
|
};
|
|
89
|
-
state: "idle" | "dragging" | "autoplay" | "userScroll" | "focus";
|
|
89
|
+
state: "idle" | "dragging" | "settling" | "autoplay" | "userScroll" | "focus";
|
|
90
90
|
effect: string;
|
|
91
91
|
action: string;
|
|
92
92
|
guard: string;
|