@unrulysystems/native-motion 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/android/build.gradle +24 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/unrulysystems/nativemotion/GestureExclusionModule.kt +55 -0
- package/android/src/main/java/com/unrulysystems/nativemotion/NativeMotionPackage.kt +27 -0
- package/package.json +57 -0
- package/react-native.config.js +14 -0
- package/src/native/driver/instantWindow.ts +31 -0
- package/src/native/driver/strictModeReplay.ts +20 -0
- package/src/native/driver/uiLayoutEngine.ts +845 -0
- package/src/native/driver/uiLayoutGraph.ts +338 -0
- package/src/native/driver/uiValueChannel.ts +4640 -0
- package/src/native/driver/workletDriver.ts +3860 -0
- package/src/native/motion/AnimatePresence.tsx +1605 -0
- package/src/native/motion/LayoutGroup.tsx +163 -0
- package/src/native/motion/MotionConfig.tsx +400 -0
- package/src/native/motion/MotionRoot.tsx +250 -0
- package/src/native/motion/MotionView.tsx +6761 -0
- package/src/native/motion/addScaleCorrector.ts +97 -0
- package/src/native/motion/colorEndpointUiFeed.ts +32 -0
- package/src/native/motion/colorProjection.ts +39 -0
- package/src/native/motion/composeTransform.ts +271 -0
- package/src/native/motion/constraintMeasure.ts +157 -0
- package/src/native/motion/deferredPendingSnapshots.ts +25 -0
- package/src/native/motion/discreteProjection.ts +36 -0
- package/src/native/motion/dragAncestorPanContext.ts +28 -0
- package/src/native/motion/dragControls.ts +152 -0
- package/src/native/motion/dragGestureWiring.ts +1168 -0
- package/src/native/motion/dragHandoffBinding.ts +179 -0
- package/src/native/motion/dragHubStream.ts +756 -0
- package/src/native/motion/dragPropagationLock.ts +57 -0
- package/src/native/motion/driverValueChannel.ts +3288 -0
- package/src/native/motion/externalDragDriver.ts +214 -0
- package/src/native/motion/frameData.ts +31 -0
- package/src/native/motion/gestureBinding.ts +107 -0
- package/src/native/motion/gestureStateGate.ts +563 -0
- package/src/native/motion/gestureStateResolver.ts +286 -0
- package/src/native/motion/identityValueChannelControllerAdapter.ts +2043 -0
- package/src/native/motion/identityValueChannelControllerReconciliation.ts +176 -0
- package/src/native/motion/identityValueChannelLaneMarker.ts +14 -0
- package/src/native/motion/imperativeAnimate.ts +816 -0
- package/src/native/motion/keyframeTiming.ts +7 -0
- package/src/native/motion/layoutIdBinding.ts +261 -0
- package/src/native/motion/layoutIdFlightConfig.ts +51 -0
- package/src/native/motion/layoutProjection.ts +89 -0
- package/src/native/motion/layoutScroll.ts +204 -0
- package/src/native/motion/layoutTransition.ts +1302 -0
- package/src/native/motion/lengthLayoutContext.tsx +100 -0
- package/src/native/motion/lengthLayoutHost.ts +44 -0
- package/src/native/motion/mappedKeys.ts +184 -0
- package/src/native/motion/motionViewController.ts +3180 -0
- package/src/native/motion/nativeHostMarker.ts +22 -0
- package/src/native/motion/panSessionWiring.ts +127 -0
- package/src/native/motion/pathTransition.ts +101 -0
- package/src/native/motion/popLayout.ts +176 -0
- package/src/native/motion/presenceBinding.ts +382 -0
- package/src/native/motion/scaleCorrectorRegistry.ts +123 -0
- package/src/native/motion/scrollValues.ts +260 -0
- package/src/native/motion/serializablePayload.ts +151 -0
- package/src/native/motion/severity.ts +16 -0
- package/src/native/motion/shippedSurface.ts +843 -0
- package/src/native/motion/staticLengthGate.ts +86 -0
- package/src/native/motion/styleBaseGate.ts +72 -0
- package/src/native/motion/styleValueBinding.ts +657 -0
- package/src/native/motion/systemGestureExclusion.ts +61 -0
- package/src/native/motion/tapGestureWiring.ts +215 -0
- package/src/native/motion/transformOrder.ts +38 -0
- package/src/native/motion/transformStringBinding.ts +200 -0
- package/src/native/motion/transformTemplateGate.ts +45 -0
- package/src/native/motion/transitionGate.ts +435 -0
- package/src/native/motion/useAnimate.ts +52 -0
- package/src/native/motion/useCycle.ts +44 -0
- package/src/native/motion/useInstantTransition.ts +68 -0
- package/src/native/motion/useReducedMotion.ts +58 -0
- package/src/native/motion/useScroll.ts +162 -0
- package/src/native/motion/useViewportScroll.ts +29 -0
- package/src/native/motion/valueChannel.ts +7121 -0
- package/src/native/motion/valueHooks.ts +901 -0
- package/src/native/motion/variantChildRegistry.ts +67 -0
- package/src/native/motion/variantContext.tsx +172 -0
- package/src/native/motion/variantProps.ts +598 -0
- package/src/native.ts +159 -0
- package/src/verification/harnessMetrics.ts +78 -0
- package/src/verification/probe/LayoutIdentityWorkletProbe.tsx +251 -0
- package/src/verification/probe/WorkletParityProbe.tsx +162 -0
- package/src/verification/probe/layoutIdentityProbeEngine.ts +429 -0
- package/src/verification/screens/ArcPathChecksScreen.tsx +273 -0
- package/src/verification/screens/BooleanAnimateChecksScreen.tsx +358 -0
- package/src/verification/screens/ChoreographyGalleryScreen.tsx +1010 -0
- package/src/verification/screens/ColorBindingChecksScreen.tsx +568 -0
- package/src/verification/screens/CompletionChecksScreen.tsx +294 -0
- package/src/verification/screens/ConformanceScreen.tsx +573 -0
- package/src/verification/screens/ContentionProbeScreen.tsx +224 -0
- package/src/verification/screens/DriverSmokeScreen.tsx +99 -0
- package/src/verification/screens/DurationOnlyTweenChecksScreen.tsx +294 -0
- package/src/verification/screens/DynamicDragConfigChecksScreen.tsx +237 -0
- package/src/verification/screens/FrameDataChecksScreen.tsx +252 -0
- package/src/verification/screens/GestureChecksScreen.tsx +685 -0
- package/src/verification/screens/InstantTransitionChecksScreen.tsx +839 -0
- package/src/verification/screens/LayoutAnimationStartChecksScreen.tsx +648 -0
- package/src/verification/screens/LayoutChecksScreen.tsx +822 -0
- package/src/verification/screens/LayoutCommitSpikeScreen.tsx +142 -0
- package/src/verification/screens/MotionViewChecksScreen.tsx +930 -0
- package/src/verification/screens/PresenceChecksScreen.tsx +614 -0
- package/src/verification/screens/ReducedMotionChecksScreen.tsx +614 -0
- package/src/verification/screens/RestThresholdChecksScreen.tsx +634 -0
- package/src/verification/screens/ScaleCorrectorChecksScreen.tsx +425 -0
- package/src/verification/screens/SharedLayoutContinuityChecksScreen.tsx +338 -0
- package/src/verification/screens/SharedLayoutCrossfadeChecksScreen.tsx +425 -0
- package/src/verification/screens/TransitionDefaultSelectionChecksScreen.tsx +514 -0
- package/src/verification/screens/ViewportScrollAliasChecksScreen.tsx +303 -0
- package/src/verification/screens/conformanceBanner.ts +21 -0
- package/src/verification/screens/proofConsoleTap.ts +18 -0
- package/src/verification.ts +47 -0
- package/src/web.ts +98 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// REQ-GESTURE-024 / REQ-API-041 (R15 D1) — the nested-drag PROPAGATION LOCK, Motion's global
|
|
2
|
+
// drag lock, PER AXIS (the pin's `motion-dom set-active.ts` at the §B pin): each axis holds
|
|
3
|
+
// one non-propagating session at a time — `setDragLock('x'|'y')` takes that axis's flag;
|
|
4
|
+
// `setDragLock(true)` (a both-axes drag) needs BOTH flags free and takes both, so an
|
|
5
|
+
// orthogonal nested pair (outer y, inner x) runs TOGETHER while a second session on a held
|
|
6
|
+
// axis is blocked. `dragPropagation={true}` skips the lock FOR ITSELF (never acquires, never
|
|
7
|
+
// blocked — the propagation element's own start ignores the lock, per VEDC's onStart). The
|
|
8
|
+
// lock is app-global (the pin's module-global analog, review 97bf73b720a8); the factory
|
|
9
|
+
// exists so tests never share state; `reset` is the documented TEST seam for mount-level
|
|
10
|
+
// suites sharing the process-wide lock (production never calls it).
|
|
11
|
+
|
|
12
|
+
import type { DragAxis } from '@unrulysystems/native-motion-core'
|
|
13
|
+
|
|
14
|
+
export interface DragPropagationLock {
|
|
15
|
+
// Take the lock for `owner` on ALL of `axes` ATOMICALLY (the pin's setDragLock semantics):
|
|
16
|
+
// returns false — holding NOTHING — when another owner already holds any needed axis.
|
|
17
|
+
acquire(owner: object, axes: readonly DragAxis[]): boolean
|
|
18
|
+
// Release every axis `owner` holds (its own sessions only — a release by a non-owner is a
|
|
19
|
+
// no-op, never a stolen lock).
|
|
20
|
+
release(owner: object): void
|
|
21
|
+
isHeld(axis: DragAxis): boolean
|
|
22
|
+
// TEST SEAM: force-clear all holders. Mount-level test files share the app-global singleton
|
|
23
|
+
// and a prior test's unfinished session would otherwise leak the lock into the next test.
|
|
24
|
+
reset(): void
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function createDragPropagationLock(): DragPropagationLock {
|
|
28
|
+
const holders: { x: object | null; y: object | null } = { x: null, y: null }
|
|
29
|
+
return {
|
|
30
|
+
acquire(owner, axes) {
|
|
31
|
+
for (const axis of axes) {
|
|
32
|
+
const holder = holders[axis]
|
|
33
|
+
if (holder !== null && holder !== owner) return false
|
|
34
|
+
}
|
|
35
|
+
for (const axis of axes) holders[axis] = owner
|
|
36
|
+
return true
|
|
37
|
+
},
|
|
38
|
+
release(owner) {
|
|
39
|
+
if (holders.x === owner) holders.x = null
|
|
40
|
+
if (holders.y === owner) holders.y = null
|
|
41
|
+
},
|
|
42
|
+
isHeld: (axis) => holders[axis] !== null,
|
|
43
|
+
reset() {
|
|
44
|
+
holders.x = null
|
|
45
|
+
holders.y = null
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// The app-global default (the pin's module-global analog), used by every wiring that is not
|
|
51
|
+
// given an explicit lock (unit tests inject their own via the factory above).
|
|
52
|
+
export const sharedDragPropagationLock: DragPropagationLock = createDragPropagationLock()
|
|
53
|
+
|
|
54
|
+
// TEST SEAM: clear the app-global lock between mount-level tests. Never called in production.
|
|
55
|
+
export function resetSharedDragPropagationLock(): void {
|
|
56
|
+
sharedDragPropagationLock.reset()
|
|
57
|
+
}
|