@lynx-js/lynx-ui-swipe-action 3.135.3 → 3.135.4
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 +9 -0
- package/dist/index.jsx.map +1 -1
- package/dist/types/index.docs.jsx +1 -0
- package/dist/types/index.jsx +1 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @lynx-js/lynx-ui-swipe-action
|
|
2
2
|
|
|
3
|
+
## 3.135.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Upgrade the Lynx and Rsbuild toolchain dependencies used to build lynx-ui packages. ([#233](https://github.com/lynx-family/lynx-ui/pull/233))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`753556b`](https://github.com/lynx-family/lynx-ui/commit/753556bc1acb77e05567aba3b8b5ab057b9f670b)]:
|
|
10
|
+
- @lynx-js/lynx-ui-common@3.135.4
|
|
11
|
+
|
|
3
12
|
## 3.135.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.jsx","sources":["webpack://@lynx-js/lynx-ui-swipe-action/./src/index.tsx"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nimport type { ForwardedRef } from '@lynx-js/react'\nimport {\n forwardRef,\n memo,\n runOnBackground,\n runOnMainThread,\n useImperativeHandle,\n useMainThreadRef,\n useState,\n} from '@lynx-js/react'\n\nimport { NativeGesture, useGesture } from '@lynx-js/gesture-runtime'\nimport type { NativeGestureChangeEvent } from '@lynx-js/gesture-runtime'\nimport { noop, selectorMT } from '@lynx-js/lynx-ui-common'\n\nimport type {\n SwipeActionProps,\n SwipeActionRef,\n SwipeAction as swipeActionType,\n} from './types/index'\n\nexport type { SwipeActionProps, SwipeActionRef }\n\nexport const SwipeAction = memo(forwardRef(SwipeActionImpl)) as swipeActionType\n\nfunction SwipeActionImpl(\n props: SwipeActionProps,\n ref: ForwardedRef<SwipeActionRef>,\n) {\n const {\n enableSwipe,\n swipeActionId = 'swipeActionId',\n style,\n className,\n displayArea,\n actionArea,\n estimatedActionAreaSize = 0,\n onAction = noop,\n onSwipeStart = noop,\n onSwipeEnd = noop,\n debugLog = false,\n iosEnableSimultaneousTouch = true,\n } = props\n const sampleCurveX = (tx: number, a: number, b: number, c: number) => {\n 'main thread'\n return ((a * tx + b) * tx + c) * tx\n }\n\n const sampleCurveY = (ty: number, a: number, b: number, c: number) => {\n 'main thread'\n return ((a * ty + b) * ty + c) * ty\n }\n\n const solveCurveX = (\n x: number,\n ax: number,\n bx: number,\n cx: number,\n epsilon = 1e-6,\n ) => {\n 'main thread'\n let t2 = x\n let x2: number, d2: number\n // Newton's method for solving the t-value corresponding to the x-coordinate of a curve.\n for (let i = 0; i < 8; i++) {\n x2 = sampleCurveX(t2, ax, bx, cx) - x\n if (Math.abs(x2) < epsilon) {\n return t2\n }\n d2 = (3 * ax * t2 + 2 * bx) * t2 + cx\n if (Math.abs(d2) < 1e-6) {\n break\n }\n t2 = t2 - x2 / d2\n }\n // Bisection method.\n let t0 = 0\n let t1 = 1\n t2 = x\n while (t0 < t1) {\n x2 = sampleCurveX(t2, ax, bx, cx)\n if (Math.abs(x2 - x) < epsilon) {\n return t2\n }\n if (x > x2) {\n t0 = t2\n } else {\n t1 = t2\n }\n t2 = (t1 - t0) * 0.5 + t0\n }\n return t2 // Approximate solution.\n }\n\n const cubicBezier = (\n t: number,\n p1x: number,\n p1y: number,\n p2x: number,\n p2y: number,\n ) => {\n 'main thread'\n // calculate the coefficients of a polynomial\n const cx = 3 * p1x\n const bx = 3 * (p2x - p1x) - cx\n const ax = 1 - cx - bx\n\n const cy = 3 * p1y\n const by = 3 * (p2y - p1y) - cy\n const ay = 1 - cy - by\n\n return sampleCurveY(solveCurveX(t, ax, bx, cx), ay, by, cy)\n }\n enum movingDirection {\n left = 0,\n right = 1,\n }\n const animationDuration = 350 // ms\n const transformEllison = 0.03 // px\n const swipeMinimumVelocity = useMainThreadRef<number>(0.1) // px/ms If velocity is less than this, it will not be considered as a swipe\n const prevTouchPointX = useMainThreadRef<number>(0)\n const prevTouchPointY = useMainThreadRef<number>(0)\n const [displayAreaSize, setDisplayAreaSize] = useState(0)\n\n const lastMovingDirection = useMainThreadRef<movingDirection>(0)\n\n const currentTransform = useMainThreadRef<number>(0)\n const lastTouchMoveGestureEvent = useMainThreadRef<NativeGestureChangeEvent>()\n const transformInTouchStart = useMainThreadRef<number>(0)\n\n const transformStartPosition = useMainThreadRef<number>(0)\n const currentVelocity = useMainThreadRef<number>(0)\n const isFirstJudge = useMainThreadRef<boolean>(true)\n const isStartWithHorizontal = useMainThreadRef<boolean>(false)\n const currentAnimationFrame = useMainThreadRef<number>(-1)\n\n const swipeGesture: NativeGesture = useGesture(NativeGesture)\n\n const calculateVelocityGesture = (event: NativeGestureChangeEvent) => {\n 'main thread'\n if (event == null || lastTouchMoveGestureEvent.current == null) {\n currentVelocity.current = 0\n return\n }\n const deltaTime = event.params.timestamp\n - (lastTouchMoveGestureEvent.current?.params.timestamp ?? 0)\n const deltaX = event.params.clientX\n - lastTouchMoveGestureEvent.current?.params.clientX\n const velocity = deltaX / deltaTime\n currentVelocity.current = velocity\n lastTouchMoveGestureEvent.current = event\n }\n\n const [actionAreaSize, setActionAreaSizeInner] = useState(\n estimatedActionAreaSize,\n )\n\n const actionAreaSizeMTRef = useMainThreadRef<number>(\n estimatedActionAreaSize,\n )\n\n const totalAreaSize = displayAreaSize + actionAreaSize\n\n const clearPreviousSwipeAnimation = () => {\n 'main thread'\n if (currentAnimationFrame.current !== -1) {\n cancelAnimationFrame(currentAnimationFrame.current)\n currentAnimationFrame.current = -1\n }\n }\n\n function setActionAreaSize(value: number) {\n setActionAreaSizeInner(value)\n runOnMainThread((areaSize: number) => {\n 'main thread'\n actionAreaSizeMTRef.current = areaSize\n })(value)\n }\n\n const setTransformProperty = (value: number) => {\n 'main thread'\n selectorMT(swipeActionId)?.setStyleProperty(\n 'transform',\n `translateX(${value}px)`,\n )\n }\n\n const setTransform = (value: number) => {\n 'main thread'\n if (Math.abs(value) < transformEllison) {\n setTransformProperty(0)\n currentTransform.current = 0\n return\n }\n // Clamp delta to valid range [-actionAreaSize, 0]\n let delta = Math.min(0, value)\n delta = Math.max(delta, -actionAreaSizeMTRef.current)\n\n setTransformProperty(delta)\n if (debugLog) {\n console.info(\n 'setTransform id',\n swipeActionId,\n delta,\n actionAreaSizeMTRef.current,\n )\n }\n currentTransform.current = delta\n }\n\n const isHorizontalTouchMoveGesture = (event: NativeGestureChangeEvent) => {\n 'main thread'\n\n const deltaX = event.params.clientX - prevTouchPointX.current\n\n const deltaY = event.params.clientY - prevTouchPointY.current\n return Math.abs(deltaX) >= Math.abs(deltaY)\n }\n\n swipeGesture.onTouchesDown((event, manager) => {\n 'main thread'\n if (debugLog) {\n console.info(swipeActionId, 'touch start')\n }\n manager.interceptGesture(true)\n\n isFirstJudge.current = true\n // initialize touch point for this gesture\n\n prevTouchPointY.current = event.params.clientY\n\n prevTouchPointX.current = event.params.clientX\n transformStartPosition.current = currentTransform.current\n transformInTouchStart.current = currentTransform.current\n runOnBackground(onSwipeStart)(swipeActionId)\n })\n\n swipeGesture.onTouchesMove((event, manager) => {\n 'main thread'\n if (!enableSwipe) {\n if (debugLog) {\n console.info(swipeActionId, 'swipe disabled')\n }\n return\n }\n if (!isFirstJudge.current && !isStartWithHorizontal.current) {\n if (debugLog) {\n console.info(swipeActionId, 'swipe block due to vertical gesture')\n }\n return\n }\n clearPreviousSwipeAnimation()\n\n const currentTouchPointX = event.params.clientX\n\n const currentTouchPointY = event.params.clientY\n const deltaX = currentTouchPointX - prevTouchPointX.current\n if (isFirstJudge.current) {\n isFirstJudge.current = false\n // only in the first judgement, we change the status of isStartWithHorizontal\n isStartWithHorizontal.current = isHorizontalTouchMoveGesture(event)\n if (isStartWithHorizontal.current) {\n manager.interceptGesture(true)\n } else {\n manager.interceptGesture(false)\n manager.fail()\n\n prevTouchPointX.current = currentTouchPointX\n\n prevTouchPointY.current = currentTouchPointY\n return\n }\n }\n\n prevTouchPointX.current = currentTouchPointX\n\n prevTouchPointY.current = currentTouchPointY\n\n calculateVelocityGesture(event)\n // Record last gesture to determine swipe direction is right to delete or left to undo\n lastMovingDirection.current = deltaX > 0\n ? movingDirection.left\n : movingDirection.right\n\n transformStartPosition.current = currentTransform.current ?? 0\n\n if (debugLog) {\n console.info(deltaX, transformStartPosition.current)\n }\n setTransform(deltaX + transformStartPosition.current)\n })\n\n const easingInOut = (t: number) => {\n 'main thread'\n return cubicBezier(t, 0, 0, 0.4, 1)\n }\n\n const swipeAnimation = (\n startTime: number,\n startSwipePoint: number,\n distanceToSwipe: number,\n consumedSwipedTime: number,\n isSwipeRight: boolean,\n ) => {\n 'main thread'\n const swipeAnimationInner = () => {\n const currentTime = Date.now() - startTime + consumedSwipedTime\n const timePercentage = currentTime / animationDuration\n const percentage = easingInOut(timePercentage)\n if (isSwipeRight) {\n setTransform(startSwipePoint + distanceToSwipe * percentage)\n } else {\n setTransform(distanceToSwipe * (1 - percentage))\n }\n if (debugLog) {\n console.info(\n 'currentTime',\n currentTime,\n percentage,\n distanceToSwipe,\n distanceToSwipe * (1 - percentage),\n )\n }\n if (timePercentage < 1) {\n currentAnimationFrame.current = requestAnimationFrame(\n swipeAnimationInner,\n )\n } else {\n if (isSwipeRight) {\n setTransform(-actionAreaSizeMTRef.current)\n } else {\n setTransform(0)\n }\n currentAnimationFrame.current = -1\n }\n }\n swipeAnimationInner()\n }\n\n const swipeLeftToUndo = (isCanceling: boolean) => {\n 'main thread'\n // Undo\n // |-------------actionAreaSize---------------|\n // |<<<<<<<<<<<<<<<<<<<<<<<|------------------|\n // |----distanceToSwipe----|--distanceSwiped--|\n if (debugLog) {\n console.info(swipeActionId, 'swipeLeftToUndo, isCanceling', isCanceling)\n }\n const distanceToSwipe = currentTransform.current\n const distanceSwipedPercentage = 1\n - Math.abs(currentTransform.current) / actionAreaSizeMTRef.current\n // Make sure cancel process has the same duration as swipe\n const consumedSwipedTime = isCanceling\n ? 0\n : animationDuration * distanceSwipedPercentage\n const startTime = Date.now()\n clearPreviousSwipeAnimation()\n swipeAnimation(\n startTime,\n currentTransform.current,\n distanceToSwipe,\n consumedSwipedTime,\n false,\n )\n }\n\n const swipeRightToAction = (isCanceling: boolean) => {\n 'main thread'\n // Delete\n // |-------------actionAreaSize---------------|\n // |------------------|>>>>>>>>>>>>>>>>>>>>>>>|\n // |--distanceSwiped--|----distanceToSwipe----|\n if (debugLog) {\n console.info(\n swipeActionId,\n 'swipeRightToAction, isCanceling',\n isCanceling,\n )\n }\n const distanceToSwipe = -actionAreaSizeMTRef.current\n - currentTransform.current\n const distanceSwipedPercentage = Math.abs(currentTransform.current)\n / actionAreaSizeMTRef.current\n const consumedSwipedTime = isCanceling\n ? 0\n : animationDuration * distanceSwipedPercentage\n const startTime = Date.now()\n clearPreviousSwipeAnimation()\n swipeAnimation(\n startTime,\n currentTransform.current,\n distanceToSwipe,\n consumedSwipedTime,\n true,\n )\n }\n\n const swipeWithEasingInOut = () => {\n 'main thread'\n if (debugLog) {\n console.info(\n swipeActionId,\n 'swipeWithEasingInOut, lastMovingDirection',\n lastMovingDirection.current,\n )\n }\n if (lastMovingDirection.current === movingDirection.right) {\n swipeRightToAction(false)\n } else {\n swipeLeftToUndo(false)\n }\n }\n\n const swipeCancelDueToSmallVelocity = () => {\n 'main thread'\n if (\n Math.abs(currentTransform.current)\n > actionAreaSizeMTRef.current * 0.5\n ) {\n swipeRightToAction(true)\n } else {\n swipeLeftToUndo(true)\n }\n }\n\n const sendSwipeEndJS = () => {\n if (onSwipeEnd) {\n onSwipeEnd(swipeActionId)\n }\n }\n\n const clearTouchInfo = () => {\n 'main thread'\n prevTouchPointX.current = 0\n prevTouchPointY.current = 0\n }\n\n swipeGesture.onTouchesUp((_event, _manager) => {\n 'main thread'\n if (debugLog) {\n console.info(\n 'touchEnd',\n swipeActionId,\n enableSwipe,\n prevTouchPointX.current,\n )\n }\n isFirstJudge.current = true\n // don't need to judge if enableSwipe is true or not, whenever there is a touchEnd.\n if (!prevTouchPointX.current) {\n console.error('ERROR! previous touch point is null')\n return\n }\n\n clearTouchInfo()\n\n if (debugLog) {\n console.info('scroll end velocity', currentVelocity.current)\n }\n if (isStartWithHorizontal.current) {\n if (Math.abs(currentVelocity.current) > swipeMinimumVelocity.current) {\n swipeWithEasingInOut()\n } else {\n swipeCancelDueToSmallVelocity()\n }\n runOnBackground(sendSwipeEndJS)()\n }\n isStartWithHorizontal.current = false\n })\n\n const showActionAreaMTS = (animated: boolean) => {\n 'main thread'\n if (animated) {\n swipeRightToAction(false)\n } else {\n clearPreviousSwipeAnimation()\n setTransform(-actionAreaSizeMTRef.current)\n }\n }\n\n const showActionArea = (animated: boolean) => {\n runOnMainThread(showActionAreaMTS)(animated)\n sendSwipeEndJS()\n }\n\n const closeActionAreaMTS = (animated: boolean) => {\n 'main thread'\n if (debugLog) {\n console.info('closeActionAreaMTS', swipeActionId)\n }\n clearPreviousSwipeAnimation()\n if (animated) {\n swipeLeftToUndo(false)\n } else {\n setTransform(0)\n }\n }\n\n const closeActionArea = (animated: boolean) => {\n runOnMainThread(closeActionAreaMTS)(animated)\n }\n\n useImperativeHandle(\n ref,\n () => ({\n showActionArea,\n closeActionArea,\n }),\n [showActionArea, closeActionArea],\n )\n\n return (\n <view\n style={{\n ...style,\n display: 'linear',\n linearOrientation: 'horizontal',\n width: `${totalAreaSize}px`,\n }}\n className={className}\n id={swipeActionId}\n enable-new-animator={false}\n flatten={false}\n main-thread:gesture={swipeGesture}\n main-thread:binduiappear={() => {\n 'main thread'\n setTransform(currentTransform.current)\n }}\n ios-enable-simultaneous-touch={iosEnableSimultaneousTouch}\n >\n <view\n id={`${swipeActionId}-displayArea`}\n style={{ height: '100%' }}\n main-thread:binduiappear={() => {\n 'main thread'\n setTransform(currentTransform.current)\n }}\n binduiappear={() => {\n lynx\n .createSelectorQuery()\n .select(`#${swipeActionId}-displayArea`)\n .invoke({\n method: 'boundingClientRect',\n success: (res: unknown) => {\n // @ts-expect-error expected\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n setDisplayAreaSize(res.width)\n },\n })\n .exec()\n lynx\n .createSelectorQuery()\n .select(`#${swipeActionId}-actionArea`)\n .invoke({\n method: 'boundingClientRect',\n success: (res: unknown) => {\n // @ts-expect-error expected\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n setActionAreaSize(res.width)\n },\n })\n .exec()\n }}\n main-thread:binduidisappear={() => {\n 'main thread'\n setTransformProperty(0)\n clearTouchInfo()\n clearPreviousSwipeAnimation()\n currentTransform.current = 0\n transformStartPosition.current = 0\n }}\n >\n {displayArea}\n </view>\n <view\n id={`${swipeActionId}-actionArea`}\n style={{ height: '100%' }}\n main-thread:bindtap={() => {\n 'main thread'\n setTransform(0)\n runOnBackground(onAction)(swipeActionId)\n }}\n >\n {actionArea}\n </view>\n </view>\n )\n}\n"],"names":["SwipeAction","memo","forwardRef","SwipeActionImpl","props","ref","enableSwipe","swipeActionId","style","className","displayArea","actionArea","estimatedActionAreaSize","onAction","noop","onSwipeStart","onSwipeEnd","debugLog","iosEnableSimultaneousTouch","sampleCurveX","tx","a","b","c","sampleCurveY","ty","solveCurveX","x","ax","bx","cx","epsilon","t2","x2","d2","i","Math","t0","t1","cubicBezier","t","p1x","p1y","p2x","p2y","cy","by","ay","animationDuration","transformEllison","swipeMinimumVelocity","useMainThreadRef","prevTouchPointX","prevTouchPointY","displayAreaSize","setDisplayAreaSize","useState","lastMovingDirection","currentTransform","lastTouchMoveGestureEvent","transformInTouchStart","transformStartPosition","currentVelocity","isFirstJudge","isStartWithHorizontal","currentAnimationFrame","swipeGesture","useGesture","NativeGesture","calculateVelocityGesture","event","deltaTime","deltaX","velocity","actionAreaSize","setActionAreaSizeInner","actionAreaSizeMTRef","totalAreaSize","clearPreviousSwipeAnimation","cancelAnimationFrame","setActionAreaSize","value","runOnMainThread","areaSize","setTransformProperty","selectorMT","setTransform","delta","console","isHorizontalTouchMoveGesture","deltaY","manager","runOnBackground","currentTouchPointX","currentTouchPointY","easingInOut","swipeAnimation","startTime","startSwipePoint","distanceToSwipe","consumedSwipedTime","isSwipeRight","swipeAnimationInner","currentTime","Date","timePercentage","percentage","requestAnimationFrame","swipeLeftToUndo","isCanceling","distanceSwipedPercentage","swipeRightToAction","swipeWithEasingInOut","swipeCancelDueToSmallVelocity","sendSwipeEndJS","clearTouchInfo","_event","_manager","showActionAreaMTS","animated","showActionArea","closeActionAreaMTS","closeActionArea","useImperativeHandle","view","lynx","res"],"mappings":";;;AA2BO,MAAMA,cAAcC,KAAKC,WAAWC;AAE3C,SAASA,gBACPC,KAAuB,EACvBC,GAAiC;IAEjC,MAAM,EACJC,WAAW,EACXC,gBAAgB,eAAe,EAC/BC,KAAK,EACLC,SAAS,EACTC,WAAW,EACXC,UAAU,EACVC,0BAA0B,CAAC,EAC3BC,WAAWC,IAAI,EACfC,eAAeD,IAAI,EACnBE,aAAaF,IAAI,EACjBG,WAAW,KAAK,EAChBC,6BAA6B,IAAI,EAClC,GAAGd;IACJ,MAAMe,eAAe,CAACC,IAAYC,GAAWC,GAAWC;QACtD;QACA,OAAQ,AAACF,CAAAA,CAAAA,IAAID,KAAKE,CAAAA,IAAKF,KAAKG,CAAAA,IAAKH;IACnC;IAEA,MAAMI,eAAe,CAACC,IAAYJ,GAAWC,GAAWC;QACtD;QACA,OAAQ,AAACF,CAAAA,CAAAA,IAAII,KAAKH,CAAAA,IAAKG,KAAKF,CAAAA,IAAKE;IACnC;IAEA,MAAMC,cAAc,CAClBC,GACAC,IACAC,IACAC,IACAC,UAAU,IAAI;QAEd;QACA,IAAIC,KAAKL;QACT,IAAIM,IAAYC;QAEhB,IAAK,IAAIC,IAAI,GAAG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A+BxC,4BAChC;MACC,CAAC0G,KACC,IAAI,GAAGrH,cAAc,YAAY,CAAC,EAClC,OAAO;QAAE,QAAQ;IAAO,GACxB,YAAY,cAAc;QACxB;QACA+E,aAAa5B,iBAAiB,OAAO;IACvC,GACA,cAAc;QACZmE,KACG,mBAAmB,GACnB,MAAM,CAAC,CAAC,CAAC,EAAEtH,cAAc,YAAY,CAAC,EACtC,MAAM,CAAC;YACN,QAAQ;YACR,SAAS,CAACuH;gBAGRvE,mBAAmBuE,IAAI,KAAK;YAC9B;QACF,GACC,IAAI;QACPD,KACG,mBAAmB,GACnB,MAAM,CAAC,CAAC,CAAC,EAAEtH,cAAc,WAAW,CAAC,EACrC,MAAM,CAAC;YACN,QAAQ;YACR,SAAS,CAACuH;gBAGR9C,kBAAkB8C,IAAI,KAAK;YAC7B;QACF,GACC,IAAI;IACT,GACA,YAAY,iBAAiB;QAC3B;QACA1C,qBAAqB;QACrB+B;QACArC;QACApB,iBAAiB,OAAO,GAAG;QAC3BG,uBAAuB,OAAO,GAAG;IACnC,GACD;QACC,CAACnD,YAAY;MACf,EAAEkH,KAAK;MACP,CAACA,KACC,IAAI,GAAGrH,cAAc,WAAW,CAAC,EACjC,OAAO;QAAE,QAAQ;IAAO,GACxB,YAAY,SAAS;QACnB;QACA+E,aAAa;QACbM,gBAAgB/E,UAAUN;IAC5B,GACD;QACC,CAACI,WAAW;MACd,EAAEiH,KAAK;IACT,EAAEA;AAEN"}
|
|
1
|
+
{"version":3,"file":"index.jsx","sources":["../src/index.tsx"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nimport type { ForwardedRef } from '@lynx-js/react'\nimport {\n forwardRef,\n memo,\n runOnBackground,\n runOnMainThread,\n useImperativeHandle,\n useMainThreadRef,\n useState,\n} from '@lynx-js/react'\n\nimport { NativeGesture, useGesture } from '@lynx-js/gesture-runtime'\nimport type { NativeGestureChangeEvent } from '@lynx-js/gesture-runtime'\nimport { noop, selectorMT } from '@lynx-js/lynx-ui-common'\n\nimport type {\n SwipeActionProps,\n SwipeActionRef,\n SwipeAction as swipeActionType,\n} from './types/index'\n\nexport type { SwipeActionProps, SwipeActionRef }\n\nexport const SwipeAction = memo(forwardRef(SwipeActionImpl)) as swipeActionType\n\nfunction SwipeActionImpl(\n props: SwipeActionProps,\n ref: ForwardedRef<SwipeActionRef>,\n) {\n const {\n enableSwipe,\n swipeActionId = 'swipeActionId',\n style,\n className,\n displayArea,\n actionArea,\n estimatedActionAreaSize = 0,\n onAction = noop,\n onSwipeStart = noop,\n onSwipeEnd = noop,\n debugLog = false,\n iosEnableSimultaneousTouch = true,\n } = props\n const sampleCurveX = (tx: number, a: number, b: number, c: number) => {\n 'main thread'\n return ((a * tx + b) * tx + c) * tx\n }\n\n const sampleCurveY = (ty: number, a: number, b: number, c: number) => {\n 'main thread'\n return ((a * ty + b) * ty + c) * ty\n }\n\n const solveCurveX = (\n x: number,\n ax: number,\n bx: number,\n cx: number,\n epsilon = 1e-6,\n ) => {\n 'main thread'\n let t2 = x\n let x2: number, d2: number\n // Newton's method for solving the t-value corresponding to the x-coordinate of a curve.\n for (let i = 0; i < 8; i++) {\n x2 = sampleCurveX(t2, ax, bx, cx) - x\n if (Math.abs(x2) < epsilon) {\n return t2\n }\n d2 = (3 * ax * t2 + 2 * bx) * t2 + cx\n if (Math.abs(d2) < 1e-6) {\n break\n }\n t2 = t2 - x2 / d2\n }\n // Bisection method.\n let t0 = 0\n let t1 = 1\n t2 = x\n while (t0 < t1) {\n x2 = sampleCurveX(t2, ax, bx, cx)\n if (Math.abs(x2 - x) < epsilon) {\n return t2\n }\n if (x > x2) {\n t0 = t2\n } else {\n t1 = t2\n }\n t2 = (t1 - t0) * 0.5 + t0\n }\n return t2 // Approximate solution.\n }\n\n const cubicBezier = (\n t: number,\n p1x: number,\n p1y: number,\n p2x: number,\n p2y: number,\n ) => {\n 'main thread'\n // calculate the coefficients of a polynomial\n const cx = 3 * p1x\n const bx = 3 * (p2x - p1x) - cx\n const ax = 1 - cx - bx\n\n const cy = 3 * p1y\n const by = 3 * (p2y - p1y) - cy\n const ay = 1 - cy - by\n\n return sampleCurveY(solveCurveX(t, ax, bx, cx), ay, by, cy)\n }\n enum movingDirection {\n left = 0,\n right = 1,\n }\n const animationDuration = 350 // ms\n const transformEllison = 0.03 // px\n const swipeMinimumVelocity = useMainThreadRef<number>(0.1) // px/ms If velocity is less than this, it will not be considered as a swipe\n const prevTouchPointX = useMainThreadRef<number>(0)\n const prevTouchPointY = useMainThreadRef<number>(0)\n const [displayAreaSize, setDisplayAreaSize] = useState(0)\n\n const lastMovingDirection = useMainThreadRef<movingDirection>(0)\n\n const currentTransform = useMainThreadRef<number>(0)\n const lastTouchMoveGestureEvent = useMainThreadRef<NativeGestureChangeEvent>()\n const transformInTouchStart = useMainThreadRef<number>(0)\n\n const transformStartPosition = useMainThreadRef<number>(0)\n const currentVelocity = useMainThreadRef<number>(0)\n const isFirstJudge = useMainThreadRef<boolean>(true)\n const isStartWithHorizontal = useMainThreadRef<boolean>(false)\n const currentAnimationFrame = useMainThreadRef<number>(-1)\n\n const swipeGesture: NativeGesture = useGesture(NativeGesture)\n\n const calculateVelocityGesture = (event: NativeGestureChangeEvent) => {\n 'main thread'\n if (event == null || lastTouchMoveGestureEvent.current == null) {\n currentVelocity.current = 0\n return\n }\n const deltaTime = event.params.timestamp\n - (lastTouchMoveGestureEvent.current?.params.timestamp ?? 0)\n const deltaX = event.params.clientX\n - lastTouchMoveGestureEvent.current?.params.clientX\n const velocity = deltaX / deltaTime\n currentVelocity.current = velocity\n lastTouchMoveGestureEvent.current = event\n }\n\n const [actionAreaSize, setActionAreaSizeInner] = useState(\n estimatedActionAreaSize,\n )\n\n const actionAreaSizeMTRef = useMainThreadRef<number>(\n estimatedActionAreaSize,\n )\n\n const totalAreaSize = displayAreaSize + actionAreaSize\n\n const clearPreviousSwipeAnimation = () => {\n 'main thread'\n if (currentAnimationFrame.current !== -1) {\n cancelAnimationFrame(currentAnimationFrame.current)\n currentAnimationFrame.current = -1\n }\n }\n\n function setActionAreaSize(value: number) {\n setActionAreaSizeInner(value)\n runOnMainThread((areaSize: number) => {\n 'main thread'\n actionAreaSizeMTRef.current = areaSize\n })(value)\n }\n\n const setTransformProperty = (value: number) => {\n 'main thread'\n selectorMT(swipeActionId)?.setStyleProperty(\n 'transform',\n `translateX(${value}px)`,\n )\n }\n\n const setTransform = (value: number) => {\n 'main thread'\n if (Math.abs(value) < transformEllison) {\n setTransformProperty(0)\n currentTransform.current = 0\n return\n }\n // Clamp delta to valid range [-actionAreaSize, 0]\n let delta = Math.min(0, value)\n delta = Math.max(delta, -actionAreaSizeMTRef.current)\n\n setTransformProperty(delta)\n if (debugLog) {\n console.info(\n 'setTransform id',\n swipeActionId,\n delta,\n actionAreaSizeMTRef.current,\n )\n }\n currentTransform.current = delta\n }\n\n const isHorizontalTouchMoveGesture = (event: NativeGestureChangeEvent) => {\n 'main thread'\n\n const deltaX = event.params.clientX - prevTouchPointX.current\n\n const deltaY = event.params.clientY - prevTouchPointY.current\n return Math.abs(deltaX) >= Math.abs(deltaY)\n }\n\n swipeGesture.onTouchesDown((event, manager) => {\n 'main thread'\n if (debugLog) {\n console.info(swipeActionId, 'touch start')\n }\n manager.interceptGesture(true)\n\n isFirstJudge.current = true\n // initialize touch point for this gesture\n\n prevTouchPointY.current = event.params.clientY\n\n prevTouchPointX.current = event.params.clientX\n transformStartPosition.current = currentTransform.current\n transformInTouchStart.current = currentTransform.current\n runOnBackground(onSwipeStart)(swipeActionId)\n })\n\n swipeGesture.onTouchesMove((event, manager) => {\n 'main thread'\n if (!enableSwipe) {\n if (debugLog) {\n console.info(swipeActionId, 'swipe disabled')\n }\n return\n }\n if (!isFirstJudge.current && !isStartWithHorizontal.current) {\n if (debugLog) {\n console.info(swipeActionId, 'swipe block due to vertical gesture')\n }\n return\n }\n clearPreviousSwipeAnimation()\n\n const currentTouchPointX = event.params.clientX\n\n const currentTouchPointY = event.params.clientY\n const deltaX = currentTouchPointX - prevTouchPointX.current\n if (isFirstJudge.current) {\n isFirstJudge.current = false\n // only in the first judgement, we change the status of isStartWithHorizontal\n isStartWithHorizontal.current = isHorizontalTouchMoveGesture(event)\n if (isStartWithHorizontal.current) {\n manager.interceptGesture(true)\n } else {\n manager.interceptGesture(false)\n manager.fail()\n\n prevTouchPointX.current = currentTouchPointX\n\n prevTouchPointY.current = currentTouchPointY\n return\n }\n }\n\n prevTouchPointX.current = currentTouchPointX\n\n prevTouchPointY.current = currentTouchPointY\n\n calculateVelocityGesture(event)\n // Record last gesture to determine swipe direction is right to delete or left to undo\n lastMovingDirection.current = deltaX > 0\n ? movingDirection.left\n : movingDirection.right\n\n transformStartPosition.current = currentTransform.current ?? 0\n\n if (debugLog) {\n console.info(deltaX, transformStartPosition.current)\n }\n setTransform(deltaX + transformStartPosition.current)\n })\n\n const easingInOut = (t: number) => {\n 'main thread'\n return cubicBezier(t, 0, 0, 0.4, 1)\n }\n\n const swipeAnimation = (\n startTime: number,\n startSwipePoint: number,\n distanceToSwipe: number,\n consumedSwipedTime: number,\n isSwipeRight: boolean,\n ) => {\n 'main thread'\n const swipeAnimationInner = () => {\n const currentTime = Date.now() - startTime + consumedSwipedTime\n const timePercentage = currentTime / animationDuration\n const percentage = easingInOut(timePercentage)\n if (isSwipeRight) {\n setTransform(startSwipePoint + distanceToSwipe * percentage)\n } else {\n setTransform(distanceToSwipe * (1 - percentage))\n }\n if (debugLog) {\n console.info(\n 'currentTime',\n currentTime,\n percentage,\n distanceToSwipe,\n distanceToSwipe * (1 - percentage),\n )\n }\n if (timePercentage < 1) {\n currentAnimationFrame.current = requestAnimationFrame(\n swipeAnimationInner,\n )\n } else {\n if (isSwipeRight) {\n setTransform(-actionAreaSizeMTRef.current)\n } else {\n setTransform(0)\n }\n currentAnimationFrame.current = -1\n }\n }\n swipeAnimationInner()\n }\n\n const swipeLeftToUndo = (isCanceling: boolean) => {\n 'main thread'\n // Undo\n // |-------------actionAreaSize---------------|\n // |<<<<<<<<<<<<<<<<<<<<<<<|------------------|\n // |----distanceToSwipe----|--distanceSwiped--|\n if (debugLog) {\n console.info(swipeActionId, 'swipeLeftToUndo, isCanceling', isCanceling)\n }\n const distanceToSwipe = currentTransform.current\n const distanceSwipedPercentage = 1\n - Math.abs(currentTransform.current) / actionAreaSizeMTRef.current\n // Make sure cancel process has the same duration as swipe\n const consumedSwipedTime = isCanceling\n ? 0\n : animationDuration * distanceSwipedPercentage\n const startTime = Date.now()\n clearPreviousSwipeAnimation()\n swipeAnimation(\n startTime,\n currentTransform.current,\n distanceToSwipe,\n consumedSwipedTime,\n false,\n )\n }\n\n const swipeRightToAction = (isCanceling: boolean) => {\n 'main thread'\n // Delete\n // |-------------actionAreaSize---------------|\n // |------------------|>>>>>>>>>>>>>>>>>>>>>>>|\n // |--distanceSwiped--|----distanceToSwipe----|\n if (debugLog) {\n console.info(\n swipeActionId,\n 'swipeRightToAction, isCanceling',\n isCanceling,\n )\n }\n const distanceToSwipe = -actionAreaSizeMTRef.current\n - currentTransform.current\n const distanceSwipedPercentage = Math.abs(currentTransform.current)\n / actionAreaSizeMTRef.current\n const consumedSwipedTime = isCanceling\n ? 0\n : animationDuration * distanceSwipedPercentage\n const startTime = Date.now()\n clearPreviousSwipeAnimation()\n swipeAnimation(\n startTime,\n currentTransform.current,\n distanceToSwipe,\n consumedSwipedTime,\n true,\n )\n }\n\n const swipeWithEasingInOut = () => {\n 'main thread'\n if (debugLog) {\n console.info(\n swipeActionId,\n 'swipeWithEasingInOut, lastMovingDirection',\n lastMovingDirection.current,\n )\n }\n if (lastMovingDirection.current === movingDirection.right) {\n swipeRightToAction(false)\n } else {\n swipeLeftToUndo(false)\n }\n }\n\n const swipeCancelDueToSmallVelocity = () => {\n 'main thread'\n if (\n Math.abs(currentTransform.current)\n > actionAreaSizeMTRef.current * 0.5\n ) {\n swipeRightToAction(true)\n } else {\n swipeLeftToUndo(true)\n }\n }\n\n const sendSwipeEndJS = () => {\n if (onSwipeEnd) {\n onSwipeEnd(swipeActionId)\n }\n }\n\n const clearTouchInfo = () => {\n 'main thread'\n prevTouchPointX.current = 0\n prevTouchPointY.current = 0\n }\n\n swipeGesture.onTouchesUp((_event, _manager) => {\n 'main thread'\n if (debugLog) {\n console.info(\n 'touchEnd',\n swipeActionId,\n enableSwipe,\n prevTouchPointX.current,\n )\n }\n isFirstJudge.current = true\n // don't need to judge if enableSwipe is true or not, whenever there is a touchEnd.\n if (!prevTouchPointX.current) {\n console.error('ERROR! previous touch point is null')\n return\n }\n\n clearTouchInfo()\n\n if (debugLog) {\n console.info('scroll end velocity', currentVelocity.current)\n }\n if (isStartWithHorizontal.current) {\n if (Math.abs(currentVelocity.current) > swipeMinimumVelocity.current) {\n swipeWithEasingInOut()\n } else {\n swipeCancelDueToSmallVelocity()\n }\n runOnBackground(sendSwipeEndJS)()\n }\n isStartWithHorizontal.current = false\n })\n\n const showActionAreaMTS = (animated: boolean) => {\n 'main thread'\n if (animated) {\n swipeRightToAction(false)\n } else {\n clearPreviousSwipeAnimation()\n setTransform(-actionAreaSizeMTRef.current)\n }\n }\n\n const showActionArea = (animated: boolean) => {\n runOnMainThread(showActionAreaMTS)(animated)\n sendSwipeEndJS()\n }\n\n const closeActionAreaMTS = (animated: boolean) => {\n 'main thread'\n if (debugLog) {\n console.info('closeActionAreaMTS', swipeActionId)\n }\n clearPreviousSwipeAnimation()\n if (animated) {\n swipeLeftToUndo(false)\n } else {\n setTransform(0)\n }\n }\n\n const closeActionArea = (animated: boolean) => {\n runOnMainThread(closeActionAreaMTS)(animated)\n }\n\n useImperativeHandle(\n ref,\n () => ({\n showActionArea,\n closeActionArea,\n }),\n [showActionArea, closeActionArea],\n )\n\n return (\n <view\n style={{\n ...style,\n display: 'linear',\n linearOrientation: 'horizontal',\n width: `${totalAreaSize}px`,\n }}\n className={className}\n id={swipeActionId}\n enable-new-animator={false}\n flatten={false}\n main-thread:gesture={swipeGesture}\n main-thread:binduiappear={() => {\n 'main thread'\n setTransform(currentTransform.current)\n }}\n ios-enable-simultaneous-touch={iosEnableSimultaneousTouch}\n >\n <view\n id={`${swipeActionId}-displayArea`}\n style={{ height: '100%' }}\n main-thread:binduiappear={() => {\n 'main thread'\n setTransform(currentTransform.current)\n }}\n binduiappear={() => {\n lynx\n .createSelectorQuery()\n .select(`#${swipeActionId}-displayArea`)\n .invoke({\n method: 'boundingClientRect',\n success: (res: unknown) => {\n // @ts-expect-error expected\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n setDisplayAreaSize(res.width)\n },\n })\n .exec()\n lynx\n .createSelectorQuery()\n .select(`#${swipeActionId}-actionArea`)\n .invoke({\n method: 'boundingClientRect',\n success: (res: unknown) => {\n // @ts-expect-error expected\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n setActionAreaSize(res.width)\n },\n })\n .exec()\n }}\n main-thread:binduidisappear={() => {\n 'main thread'\n setTransformProperty(0)\n clearTouchInfo()\n clearPreviousSwipeAnimation()\n currentTransform.current = 0\n transformStartPosition.current = 0\n }}\n >\n {displayArea}\n </view>\n <view\n id={`${swipeActionId}-actionArea`}\n style={{ height: '100%' }}\n main-thread:bindtap={() => {\n 'main thread'\n setTransform(0)\n runOnBackground(onAction)(swipeActionId)\n }}\n >\n {actionArea}\n </view>\n </view>\n )\n}\n"],"names":["SwipeAction","memo","forwardRef","SwipeActionImpl","props","ref","enableSwipe","swipeActionId","style","className","displayArea","actionArea","estimatedActionAreaSize","onAction","noop","onSwipeStart","onSwipeEnd","debugLog","iosEnableSimultaneousTouch","sampleCurveX","tx","a","b","c","sampleCurveY","ty","solveCurveX","x","ax","bx","cx","epsilon","t2","x2","d2","i","Math","t0","t1","cubicBezier","t","p1x","p1y","p2x","p2y","cy","by","ay","animationDuration","transformEllison","swipeMinimumVelocity","useMainThreadRef","prevTouchPointX","prevTouchPointY","displayAreaSize","setDisplayAreaSize","useState","lastMovingDirection","currentTransform","lastTouchMoveGestureEvent","transformInTouchStart","transformStartPosition","currentVelocity","isFirstJudge","isStartWithHorizontal","currentAnimationFrame","swipeGesture","useGesture","NativeGesture","calculateVelocityGesture","event","deltaTime","deltaX","velocity","actionAreaSize","setActionAreaSizeInner","actionAreaSizeMTRef","totalAreaSize","clearPreviousSwipeAnimation","cancelAnimationFrame","setActionAreaSize","value","runOnMainThread","areaSize","setTransformProperty","selectorMT","setTransform","delta","console","isHorizontalTouchMoveGesture","deltaY","manager","runOnBackground","currentTouchPointX","currentTouchPointY","easingInOut","swipeAnimation","startTime","startSwipePoint","distanceToSwipe","consumedSwipedTime","isSwipeRight","swipeAnimationInner","currentTime","Date","timePercentage","percentage","requestAnimationFrame","swipeLeftToUndo","isCanceling","distanceSwipedPercentage","swipeRightToAction","swipeWithEasingInOut","swipeCancelDueToSmallVelocity","sendSwipeEndJS","clearTouchInfo","_event","_manager","showActionAreaMTS","animated","showActionArea","closeActionAreaMTS","closeActionArea","useImperativeHandle","view","lynx","res"],"mappings":";;;AA2BO,MAAMA,cAAcC,KAAKC,WAAWC;AAE3C,SAASA,gBACPC,KAAuB,EACvBC,GAAiC;IAEjC,MAAM,EACJC,WAAW,EACXC,gBAAgB,eAAe,EAC/BC,KAAK,EACLC,SAAS,EACTC,WAAW,EACXC,UAAU,EACVC,0BAA0B,CAAC,EAC3BC,WAAWC,IAAI,EACfC,eAAeD,IAAI,EACnBE,aAAaF,IAAI,EACjBG,WAAW,KAAK,EAChBC,6BAA6B,IAAI,EAClC,GAAGd;IACJ,MAAMe,eAAe,CAACC,IAAYC,GAAWC,GAAWC;QACtD;QACA,OAAQ,AAACF,CAAAA,CAAAA,IAAID,KAAKE,CAAAA,IAAKF,KAAKG,CAAAA,IAAKH;IACnC;IAEA,MAAMI,eAAe,CAACC,IAAYJ,GAAWC,GAAWC;QACtD;QACA,OAAQ,AAACF,CAAAA,CAAAA,IAAII,KAAKH,CAAAA,IAAKG,KAAKF,CAAAA,IAAKE;IACnC;IAEA,MAAMC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WACX,IAAIF,eACJ,qBAAqB,OACrB,SAAS,OACT,YAAY,SAAS2D,cACrB,YAAY,cAAc;QACxB;QACAoB,aAAa5B,iBAAiB,OAAO;IACvC,GACA,+BAA+BxC,4BAChC;MACC,CAAC0G,KACC,IAAI,GAAGrH,cAAc,YAAY,CAAC,EAClC,OAAO;QAAE,QAAQ;IAAO,GACxB,YAAY,cAAc;QACxB;QACA+E,aAAa5B,iBAAiB,OAAO;IACvC,GACA,cAAc;QACZmE,KACG,mBAAmB,GACnB,MAAM,CAAC,CAAC,CAAC,EAAEtH,cAAc,YAAY,CAAC,EACtC,MAAM,CAAC;YACN,QAAQ;YACR,SAAS,CAACuH;gBAGRvE,mBAAmBuE,IAAI,KAAK;YAC9B;QACF,GACC,IAAI;QACPD,KACG,mBAAmB,GACnB,MAAM,CAAC,CAAC,CAAC,EAAEtH,cAAc,WAAW,CAAC,EACrC,MAAM,CAAC;YACN,QAAQ;YACR,SAAS,CAACuH;gBAGR9C,kBAAkB8C,IAAI,KAAK;YAC7B;QACF,GACC,IAAI;IACT,GACA,YAAY,iBAAiB;QAC3B;QACA1C,qBAAqB;QACrB+B;QACArC;QACApB,iBAAiB,OAAO,GAAG;QAC3BG,uBAAuB,OAAO,GAAG;IACnC,GACD;QACC,CAACnD,YAAY;MACf,EAAEkH,KAAK;MACP,CAACA,KACC,IAAI,GAAGrH,cAAc,WAAW,CAAC,EACjC,OAAO;QAAE,QAAQ;IAAO,GACxB,YAAY,SAAS;QACnB;QACA+E,aAAa;QACbM,gBAAgB/E,UAAUN;IAC5B,GACD;QACC,CAACI,WAAW;MACd,EAAEiH,KAAK;IACT,EAAEA;AAEN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/types/index.jsx
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/lynx-ui-swipe-action",
|
|
3
|
-
"version": "3.135.
|
|
3
|
+
"version": "3.135.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/lynx-family/lynx-ui.git",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@lynx-js/gesture-runtime": "2.1.1",
|
|
29
|
-
"@lynx-js/lynx-ui-common": "3.135.
|
|
29
|
+
"@lynx-js/lynx-ui-common": "3.135.4"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@lynx-js/react": "0.
|
|
33
|
-
"@lynx-js/types": "
|
|
34
|
-
"@rslib/core": "
|
|
32
|
+
"@lynx-js/react": "0.123.1",
|
|
33
|
+
"@lynx-js/types": "4.1.0",
|
|
34
|
+
"@rslib/core": "0.23.2",
|
|
35
35
|
"@types/react": "^18.3.8",
|
|
36
|
-
"typescript": "^5.
|
|
36
|
+
"typescript": "^5.8.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@lynx-js/react": ">=0.100.0",
|