@sigx/lynx-gestures 0.4.0 → 0.4.1

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.
@@ -0,0 +1,85 @@
1
+ import { jsx as _jsx } from "@sigx/lynx/jsx-runtime";
2
+ import { component, signal, useSharedValue, useMainThreadRef, defineProvide, } from '@sigx/lynx';
3
+ import { useScrollContext } from '../scroll-context.js';
4
+ /**
5
+ * MT-thread `<scroll-view>` wrapper that mirrors scroll position into a
6
+ * `SharedValue`. Pair with `useAnimatedStyle` for parallax / fade / scale
7
+ * effects driven by scroll, all running on MT with zero per-frame thread
8
+ * crossings.
9
+ *
10
+ * The component is the API; the inline `'main thread'` worklet, the
11
+ * `__FlushElementTree()` trigger, and the runtime registration are all
12
+ * internal. Users just pass a `SharedValue<number>` for the axis they care
13
+ * about — same shape as `<Draggable translateX={tx}>`.
14
+ *
15
+ * @example Parallax header
16
+ * ```tsx
17
+ * const scrollY = useSharedValue(0);
18
+ * const headerRef = useMainThreadRef<MainThread.Element | null>(null);
19
+ *
20
+ * useAnimatedStyle(headerRef, scrollY, 'translateY', {
21
+ * inputRange: [0, 300], outputRange: [0, -150], extrapolate: 'clamp',
22
+ * });
23
+ *
24
+ * <ScrollView offsetY={scrollY}>
25
+ * <view main-thread:ref={headerRef}><image src={hero} /></view>
26
+ * <text>Body…</text>
27
+ * </ScrollView>
28
+ * ```
29
+ *
30
+ * @example BG-reactive scroll readout
31
+ * ```tsx
32
+ * const scrollY = useSharedValue(0);
33
+ * <ScrollView offsetY={scrollY}>...</ScrollView>
34
+ * <text>Scrolled: {scrollY.value.toFixed(0)}px</text>
35
+ * ```
36
+ */
37
+ export const ScrollView = component(({ props, slots }) => {
38
+ // Always allocate fallback SharedValues — hooks must run unconditionally.
39
+ // The render closure picks between own/external; the worklet always sees
40
+ // a defined SharedValue in its `_c` capture.
41
+ const ownX = useSharedValue(0);
42
+ const ownY = useSharedValue(0);
43
+ // Phase 2.12 ScrollView ↔ child-gesture coordination. Descendant
44
+ // `<Draggable>` / `<Swipeable>` flip this signal during their drag so the
45
+ // UIKit `panGestureRecognizer` (which doesn't participate in the new
46
+ // gesture arena) yields the touch. See `scroll-context.ts` for the why.
47
+ const dragging = signal(false);
48
+ // Phase 2.13: publish the scroll-view's element ref through the context so
49
+ // descendants can drive scroll directly from worklets (e.g. <Draggable
50
+ // edgeScroll>). Captured at setup so the worklet `_c` map sees a stable
51
+ // ref identity.
52
+ const scrollViewRef = useMainThreadRef(null);
53
+ // Pick the axis SVs once; the same identity is shared with descendants via
54
+ // the context (so they can read live scroll position) and used at render
55
+ // time for the bindscroll worklet's `_c` capture.
56
+ const x = props.offsetX ?? ownX;
57
+ const y = props.offsetY ?? ownY;
58
+ const scrollOrientation = props['scroll-orientation'] ?? 'vertical';
59
+ defineProvide(useScrollContext, () => ({
60
+ dragging,
61
+ scrollViewRef,
62
+ offsetX: x,
63
+ offsetY: y,
64
+ scrollOrientation,
65
+ }));
66
+ return () => {
67
+ // Compose user-passed enable-scroll with the descendant-driven flag:
68
+ // both must be true. User can still force-lock by passing `false`.
69
+ const userEnableScroll = props['enable-scroll'] ?? true;
70
+ const enableScroll = userEnableScroll && !dragging.value;
71
+ return (_jsx("scroll-view", { "main-thread:ref": scrollViewRef, "scroll-orientation": scrollOrientation, "enable-scroll": enableScroll, class: props.class, style: props.style, "main-thread-bindscroll": (e) => {
72
+ 'main thread';
73
+ y.current.value = e.detail.scrollTop;
74
+ x.current.value = e.detail.scrollLeft;
75
+ // Apply useAnimatedStyle bindings on the same frame. Inlined
76
+ // (rather than calling a helper) because plain function imports
77
+ // don't survive worklet `_c` capture across the MT bundle —
78
+ // same constraint @sigx/lynx-motion's `animate()` documents.
79
+ const __flush = globalThis['__FlushElementTree'];
80
+ if (__flush)
81
+ __flush();
82
+ }, children: slots.default?.() }));
83
+ };
84
+ });
85
+ //# sourceMappingURL=ScrollView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollView.js","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,CAAC,IAAI,IAAI,CAAC;QACxD,MAAM,YAAY,GAAG,gBAAgB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QACzD,OAAO,CACL,yCACmB,aAAa,wBACV,iBAAiB,mBACtB,YAAY,EAC3B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK,4BACM,CAAC,CAAM,EAAE,EAAE;gBACjC,aAAa,CAAC;gBACd,CAAC,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;gBACrC,CAAC,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;gBACtC,6DAA6D;gBAC7D,gEAAgE;gBAChE,4DAA4D;gBAC5D,6DAA6D;gBAC7D,MAAM,OAAO,GAAI,UAAsC,CAAC,oBAAoB,CAA6B,CAAC;gBAC1G,IAAI,OAAO;oBAAE,OAAO,EAAE,CAAC;YACzB,CAAC,YAEA,KAAK,CAAC,OAAO,EAAE,EAAE,GACN,CACf,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,165 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@sigx/lynx/jsx-runtime";
2
+ import { component, useMainThreadRef, useSharedValue, useAnimatedStyle, runOnBackground, Gesture, useGestureDetector, } from '@sigx/lynx';
3
+ import { useScrollContext } from '../scroll-context.js';
4
+ /**
5
+ * Horizontal swipe-to-reveal container, built on the native gesture arena
6
+ * via `Gesture.Pan().axis('x')`. The foreground is dragged horizontally on
7
+ * the MT thread; on release it snaps to one of three resting positions
8
+ * (closed / open-left / open-right) using `MTElementWrapper.animate()`.
9
+ * Open and close events are dispatched to BG via `runOnBackground`.
10
+ *
11
+ * Migrated from a 4-`bindtouch*`-worklet implementation to a single
12
+ * `Gesture.Pan()` (Phase 2.12). Carries the same Phase 2.11 quirks:
13
+ * - `.onBegin(() => {})` no-op is load-bearing on iOS Pan to gate
14
+ * `_isInvokedBegin` open so onStart/onEnd fire.
15
+ * - `e.params.pageX` (not `e.pageX`) — Lynx pan event nests the touch
16
+ * payload under `params`.
17
+ *
18
+ * Supply `leftActions` and/or `rightActions` as render-prop functions:
19
+ *
20
+ * ```tsx
21
+ * <Swipeable
22
+ * rightActions={() => <view><text>Delete</text></view>}
23
+ * onSwipeOpen={(e) => console.log('opened', e.side)}
24
+ * >
25
+ * <view><text>Row content</text></view>
26
+ * </Swipeable>
27
+ * ```
28
+ *
29
+ * **Scroll composition** (Phase 2.12.3): nesting `<Swipeable>` inside
30
+ * `<ScrollView>` is automatic — `useScrollContext` is read at setup and
31
+ * the BG-side onStart/onEnd handlers flip `scrollCtx.dragging` so the
32
+ * parent yields its UIKit pan for the duration of the swipe. No consumer
33
+ * wiring required.
34
+ */
35
+ export const Swipeable = component(({ props, slots, emit }) => {
36
+ const fgRef = useMainThreadRef(null);
37
+ // Drive the foreground transform via a SharedValue so external animations
38
+ // could compose if we ever wanted spring snaps. For now we still call
39
+ // `.animate()` on the element directly for the snap; the SV is only the
40
+ // intermediate write target during the drag.
41
+ const tx = useSharedValue(0);
42
+ useAnimatedStyle(fgRef, tx, 'translateX');
43
+ const drag = useMainThreadRef({
44
+ startPageX: 0,
45
+ offsetX: 0,
46
+ currentX: 0,
47
+ });
48
+ // Coordinate with the parent <ScrollView> (Phase 2.12.3) — see Draggable
49
+ // for the why. Null when no ancestor ScrollView.
50
+ const scrollCtx = useScrollContext();
51
+ const leftWidth = props.leftActionsWidth ?? 100;
52
+ const rightWidth = props.rightActionsWidth ?? 100;
53
+ const snapThreshold = props.snapThreshold ?? 60;
54
+ const snapDuration = props.snapDuration ?? 200;
55
+ const hasLeft = !!props.leftActions;
56
+ const hasRight = !!props.rightActions;
57
+ const upper = hasLeft ? leftWidth : 0;
58
+ const lower = hasRight ? -rightWidth : 0;
59
+ const pan = Gesture.Pan()
60
+ .axis('x')
61
+ // Empty onBegin gates `_isInvokedBegin` open on iOS so onStart/onEnd fire.
62
+ .onBegin(() => {
63
+ 'main thread';
64
+ })
65
+ .onStart((e) => {
66
+ 'main thread';
67
+ const p = e && e.params;
68
+ drag.current.startPageX = (p && p.pageX) || 0;
69
+ drag.current.offsetX = drag.current.currentX;
70
+ // Tell the parent ScrollView (if any) we own the touch.
71
+ runOnBackground(() => {
72
+ if (scrollCtx)
73
+ scrollCtx.dragging.value = true;
74
+ })();
75
+ })
76
+ .onUpdate((e) => {
77
+ 'main thread';
78
+ const p = e && e.params;
79
+ const pageX = (p && p.pageX) || 0;
80
+ let x = drag.current.offsetX + (pageX - drag.current.startPageX);
81
+ if (x > upper)
82
+ x = upper;
83
+ if (x < lower)
84
+ x = lower;
85
+ tx.current.value = x;
86
+ // Bridge the binding on the same frame so the foreground tracks the
87
+ // finger without a vsync delay (same trick as Draggable).
88
+ const __flush = globalThis['__FlushElementTree'];
89
+ if (__flush)
90
+ __flush();
91
+ })
92
+ .onEnd(() => {
93
+ 'main thread';
94
+ const x = tx.current.value;
95
+ // Snap to closest resting position.
96
+ let target = 0;
97
+ if (hasLeft && x > snapThreshold)
98
+ target = leftWidth;
99
+ else if (hasRight && x < -snapThreshold)
100
+ target = -rightWidth;
101
+ fgRef.current?.animate([
102
+ { transform: 'translateX(' + x + 'px)' },
103
+ { transform: 'translateX(' + target + 'px)' },
104
+ ], { duration: snapDuration, fill: 'forwards', easing: 'cubic-bezier(0.2, 0.8, 0.2, 1)' })?.play();
105
+ // Keep the SV in sync with the snap target so subsequent drags don't
106
+ // jump back to the pre-animate position.
107
+ tx.current.value = target;
108
+ const wasOpen = drag.current.currentX !== 0;
109
+ const nowOpen = target !== 0;
110
+ drag.current.currentX = target;
111
+ // Always release the parent ScrollView's claim, regardless of snap.
112
+ // Bundled into the same runOnBackground call as the emit so we only
113
+ // pay one cross-thread hop.
114
+ if (nowOpen) {
115
+ const side = target > 0 ? 'left' : 'right';
116
+ runOnBackground((s) => {
117
+ if (scrollCtx)
118
+ scrollCtx.dragging.value = false;
119
+ emit('swipeOpen', { side: s });
120
+ })(side);
121
+ }
122
+ else if (wasOpen) {
123
+ runOnBackground(() => {
124
+ if (scrollCtx)
125
+ scrollCtx.dragging.value = false;
126
+ emit('swipeClose');
127
+ })();
128
+ }
129
+ else {
130
+ // Closed→closed: still need to release the ScrollView claim.
131
+ runOnBackground(() => {
132
+ if (scrollCtx)
133
+ scrollCtx.dragging.value = false;
134
+ })();
135
+ }
136
+ });
137
+ useGestureDetector(fgRef, pan);
138
+ return () => (_jsxs("view", { class: props.class, style: {
139
+ position: 'relative',
140
+ overflow: 'hidden',
141
+ ...(props.style || {}),
142
+ }, children: [hasLeft ? (_jsx("view", { style: {
143
+ position: 'absolute',
144
+ left: '0',
145
+ top: '0',
146
+ bottom: '0',
147
+ width: leftWidth + 'px',
148
+ display: 'flex',
149
+ alignItems: 'center',
150
+ justifyContent: 'center',
151
+ }, children: props.leftActions() })) : null, hasRight ? (_jsx("view", { style: {
152
+ position: 'absolute',
153
+ right: '0',
154
+ top: '0',
155
+ bottom: '0',
156
+ width: rightWidth + 'px',
157
+ display: 'flex',
158
+ alignItems: 'center',
159
+ justifyContent: 'center',
160
+ }, children: props.rightActions() })) : null, _jsx("view", { "main-thread:ref": fgRef, style: {
161
+ position: 'relative',
162
+ ...(props.foregroundStyle || {}),
163
+ }, children: slots.default?.() })] }));
164
+ });
165
+ //# sourceMappingURL=Swipeable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Swipeable.js","sourceRoot":"","sources":["../../src/components/Swipeable.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,OAAO,EACP,kBAAkB,GAGnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAyBxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS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AC,CAAC,IAAI,EAER,kCACmB,KAAK,EACtB,KAAK,EAAE;oBACL,QAAQ,EAAE,UAAU;oBACpB,GAAG,CAAC,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC;iBACjC,YAEA,KAAK,CAAC,OAAO,EAAE,EAAE,GACb,IACF,CACR,CAAC;AACJ,CAAC,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- export { usePinch } from './use-pinch';
2
- export { useRotation } from './use-rotation';
1
+ export { usePinch } from './use-pinch.js';
2
+ export { useRotation } from './use-rotation.js';
3
3
  export { useSharedValue, SharedValue, useAnimatedValue, AnimatedValue, useAnimatedStyle, resetAnimatedStyleBindingIds, } from '@sigx/lynx';
4
4
  export type { SharedValueState, AnimatedValueState, BuiltinMapperName, MapperParams, } from '@sigx/lynx';
5
- export { Pressable } from './components/Pressable';
6
- export type { PressableProps } from './components/Pressable';
7
- export { Draggable } from './components/Draggable';
8
- export type { DraggableProps, DragEndDetail } from './components/Draggable';
9
- export { Swipeable } from './components/Swipeable';
10
- export type { SwipeableProps, SwipeSide } from './components/Swipeable';
11
- export { ScrollView } from './components/ScrollView';
12
- export type { ScrollViewProps } from './components/ScrollView';
13
- export { useScrollContext } from './scroll-context';
14
- export type { ScrollContext } from './scroll-context';
15
- export type { TouchPoint, TouchEvent, GesturePhase, GestureHandlers, PinchState, UsePinchOptions, UsePinchReturn, RotationState, UseRotationOptions, UseRotationReturn, } from './types';
5
+ export { Pressable } from './components/Pressable.js';
6
+ export type { PressableProps } from './components/Pressable.js';
7
+ export { Draggable } from './components/Draggable.js';
8
+ export type { DraggableProps, DragEndDetail } from './components/Draggable.js';
9
+ export { Swipeable } from './components/Swipeable.js';
10
+ export type { SwipeableProps, SwipeSide } from './components/Swipeable.js';
11
+ export { ScrollView } from './components/ScrollView.js';
12
+ export type { ScrollViewProps } from './components/ScrollView.js';
13
+ export { useScrollContext } from './scroll-context.js';
14
+ export type { ScrollContext } from './scroll-context.js';
15
+ export type { TouchPoint, TouchEvent, GesturePhase, GestureHandlers, PinchState, UsePinchOptions, UsePinchReturn, RotationState, UseRotationOptions, UseRotationReturn, } from './types.js';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAO7C,OAAO,EACL,cAAc,EACd,WAAW,EAEX,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,gBAAgB,EAEhB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,YAAY,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,eAAe,EACf,UAAU,EACV,eAAe,EACf,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.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