@tamagui/react-native-use-responder-events 1.0.1-beta.218 → 1.0.1-beta.220
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ResponderTouchHistoryStore.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { Touch, TouchEvent } from './types'\nimport { isEndish, isMoveish, isStartish } from './types'\n\ntype TouchRecord = {\n currentPageX: number\n currentPageY: number\n currentTimeStamp: number\n previousPageX: number\n previousPageY: number\n previousTimeStamp: number\n startPageX: number\n startPageY: number\n startTimeStamp: number\n touchActive: boolean\n}\n\nexport type TouchHistory = {\n indexOfSingleActiveTouch: number\n mostRecentTimeStamp: number\n numberActiveTouches: number\n touchBank: Array<TouchRecord>\n}\n\n/**\n * Tracks the position and time of each active touch by `touch.identifier`. We\n * should typically only see IDs in the range of 1-20 because IDs get recycled\n * when touches end and start again.\n */\n\nconst MAX_TOUCH_BANK = 20\n\nfunction timestampForTouch(touch: Touch): number {\n // The legacy internal implementation provides \"timeStamp\", which has been\n // renamed to \"timestamp\".\n return touch['timeStamp'] || touch.timestamp\n}\n\n/**\n * TODO: Instead of making gestures recompute filtered velocity, we could\n * include a built in velocity computation that can be reused globally.\n */\nfunction createTouchRecord(touch: Touch): TouchRecord {\n return {\n touchActive: true,\n startPageX: touch.pageX,\n startPageY: touch.pageY,\n startTimeStamp: timestampForTouch(touch),\n currentPageX: touch.pageX,\n currentPageY: touch.pageY,\n currentTimeStamp: timestampForTouch(touch),\n previousPageX: touch.pageX,\n previousPageY: touch.pageY,\n previousTimeStamp: timestampForTouch(touch),\n }\n}\n\nfunction resetTouchRecord(touchRecord: TouchRecord, touch: Touch): void {\n touchRecord.touchActive = true\n touchRecord.startPageX = touch.pageX\n touchRecord.startPageY = touch.pageY\n touchRecord.startTimeStamp = timestampForTouch(touch)\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchRecord.previousPageX = touch.pageX\n touchRecord.previousPageY = touch.pageY\n touchRecord.previousTimeStamp = timestampForTouch(touch)\n}\n\nfunction getTouchIdentifier({ identifier }: Touch): number {\n if (identifier == null) {\n // eslint-disable-next-line no-console\n console.error('Touch object is missing identifier.')\n }\n if (process.env.NODE_ENV === 'development') {\n if (identifier > MAX_TOUCH_BANK) {\n // eslint-disable-next-line no-console\n console.error(\n 'Touch identifier %s is greater than maximum supported %s which causes ' +\n 'performance issues backfilling array locations for all of the indices.',\n identifier,\n MAX_TOUCH_BANK\n )\n }\n }\n return identifier\n}\n\nfunction recordTouchStart(touch: Touch, touchHistory): void {\n const identifier = getTouchIdentifier(touch)\n const touchRecord = touchHistory.touchBank[identifier]\n if (touchRecord) {\n resetTouchRecord(touchRecord, touch)\n } else {\n touchHistory.touchBank[identifier] = createTouchRecord(touch)\n }\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n}\n\nfunction recordTouchMove(touch: Touch, touchHistory): void {\n const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)]\n if (touchRecord) {\n touchRecord.touchActive = true\n touchRecord.previousPageX = touchRecord.currentPageX\n touchRecord.previousPageY = touchRecord.currentPageY\n touchRecord.previousTimeStamp = touchRecord.currentTimeStamp\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n } else {\n console.warn(\n 'Cannot record touch move without a touch start.\\n',\n `Touch Move: ${printTouch(touch)}\\n`,\n `Touch Bank: ${printTouchBank(touchHistory)}`\n )\n }\n}\n\nfunction recordTouchEnd(touch: Touch, touchHistory): void {\n const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)]\n if (touchRecord) {\n touchRecord.touchActive = false\n touchRecord.previousPageX = touchRecord.currentPageX\n touchRecord.previousPageY = touchRecord.currentPageY\n touchRecord.previousTimeStamp = touchRecord.currentTimeStamp\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n } else {\n console.warn(\n 'Cannot record touch end without a touch start.\\n',\n `Touch End: ${printTouch(touch)}\\n`,\n `Touch Bank: ${printTouchBank(touchHistory)}`\n )\n }\n}\n\nfunction printTouch(touch: Touch): string {\n return JSON.stringify({\n identifier: touch.identifier,\n pageX: touch.pageX,\n pageY: touch.pageY,\n timestamp: timestampForTouch(touch),\n })\n}\n\nfunction printTouchBank(touchHistory): string {\n const { touchBank } = touchHistory\n let printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK))\n if (touchBank.length > MAX_TOUCH_BANK) {\n printed += ' (original size: ' + touchBank.length + ')'\n }\n return printed\n}\n\nexport class ResponderTouchHistoryStore {\n _touchHistory = {\n touchBank: [], //Array<TouchRecord>\n numberActiveTouches: 0,\n // If there is only one active touch, we remember its location. This prevents\n // us having to loop through all of the touches all the time in the most\n // common case.\n indexOfSingleActiveTouch: -1,\n mostRecentTimeStamp: 0,\n }\n\n recordTouchTrack(topLevelType: string, nativeEvent: TouchEvent): void {\n const touchHistory = this._touchHistory\n if (isMoveish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchMove(touch, touchHistory))\n } else if (isStartish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchStart(touch, touchHistory))\n touchHistory.numberActiveTouches = nativeEvent.touches.length\n if (touchHistory.numberActiveTouches === 1) {\n touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier\n }\n } else if (isEndish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchEnd(touch, touchHistory))\n touchHistory.numberActiveTouches = nativeEvent.touches.length\n if (touchHistory.numberActiveTouches === 1) {\n const { touchBank } = touchHistory\n for (let i = 0; i < touchBank.length; i++) {\n const touchTrackToCheck = touchBank[i]\n // @ts-ignore\n if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {\n touchHistory.indexOfSingleActiveTouch = i\n break\n }\n }\n if (process.env.NODE_ENV === 'development') {\n const activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]\n // @ts-ignore\n if (!(activeRecord != null && activeRecord.touchActive)) {\n console.error('Cannot find single active touch.')\n }\n }\n }\n }\n }\n\n get touchHistory(): TouchHistory {\n return this._touchHistory\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,mBAAgD;AA4BhD,MAAM,iBAAiB;AAEvB,SAAS,kBAAkB,OAAsB;AAG/C,SAAO,MAAM,gBAAgB,MAAM;AACrC;AAMA,SAAS,kBAAkB,OAA2B;AACpD,SAAO;AAAA,IACL,aAAa;AAAA,IACb,YAAY,MAAM;AAAA,IAClB,YAAY,MAAM;AAAA,IAClB,gBAAgB,kBAAkB,KAAK;AAAA,IACvC,cAAc,MAAM;AAAA,IACpB,cAAc,MAAM;AAAA,IACpB,kBAAkB,kBAAkB,KAAK;AAAA,IACzC,eAAe,MAAM;AAAA,IACrB,eAAe,MAAM;AAAA,IACrB,mBAAmB,kBAAkB,KAAK;AAAA,EAC5C;AACF;AAEA,SAAS,iBAAiB,aAA0B,OAAoB;AACtE,cAAY,cAAc;AAC1B,cAAY,aAAa,MAAM;AAC/B,cAAY,aAAa,MAAM;AAC/B,cAAY,iBAAiB,kBAAkB,KAAK;AACpD,cAAY,eAAe,MAAM;AACjC,cAAY,eAAe,MAAM;AACjC,cAAY,mBAAmB,kBAAkB,KAAK;AACtD,cAAY,gBAAgB,MAAM;AAClC,cAAY,gBAAgB,MAAM;AAClC,cAAY,oBAAoB,kBAAkB,KAAK;AACzD;AAEA,SAAS,mBAAmB,EAAE,WAAW,GAAkB;AACzD,MAAI,cAAc,MAAM;AAEtB,YAAQ,MAAM,qCAAqC;AAAA,EACrD;AACA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,aAAa,gBAAgB;AAE/B,cAAQ;AAAA,QACN;AAAA,QAEA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,iBAAiB,OAAc,cAAoB;AAC1D,QAAM,aAAa,mBAAmB,KAAK;AAC3C,QAAM,cAAc,aAAa,UAAU;AAC3C,MAAI,aAAa;AACf,qBAAiB,aAAa,KAAK;AAAA,EACrC,OAAO;AACL,iBAAa,UAAU,cAAc,kBAAkB,KAAK;AAAA,EAC9D;AACA,eAAa,sBAAsB,kBAAkB,KAAK;AAC5D;AAEA,SAAS,gBAAgB,OAAc,cAAoB;AACzD,QAAM,cAAc,aAAa,UAAU,mBAAmB,KAAK;AACnE,MAAI,aAAa;AACf,gBAAY,cAAc;AAC1B,gBAAY,gBAAgB,YAAY;AACxC,gBAAY,gBAAgB,YAAY;AACxC,gBAAY,oBAAoB,YAAY;AAC5C,gBAAY,eAAe,MAAM;AACjC,gBAAY,eAAe,MAAM;AACjC,gBAAY,mBAAmB,kBAAkB,KAAK;AACtD,iBAAa,sBAAsB,kBAAkB,KAAK;AAAA,EAC5D,OAAO;
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { Touch, TouchEvent } from './types'\nimport { isEndish, isMoveish, isStartish } from './types'\n\ntype TouchRecord = {\n currentPageX: number\n currentPageY: number\n currentTimeStamp: number\n previousPageX: number\n previousPageY: number\n previousTimeStamp: number\n startPageX: number\n startPageY: number\n startTimeStamp: number\n touchActive: boolean\n}\n\nexport type TouchHistory = {\n indexOfSingleActiveTouch: number\n mostRecentTimeStamp: number\n numberActiveTouches: number\n touchBank: Array<TouchRecord>\n}\n\n/**\n * Tracks the position and time of each active touch by `touch.identifier`. We\n * should typically only see IDs in the range of 1-20 because IDs get recycled\n * when touches end and start again.\n */\n\nconst MAX_TOUCH_BANK = 20\n\nfunction timestampForTouch(touch: Touch): number {\n // The legacy internal implementation provides \"timeStamp\", which has been\n // renamed to \"timestamp\".\n return touch['timeStamp'] || touch.timestamp\n}\n\n/**\n * TODO: Instead of making gestures recompute filtered velocity, we could\n * include a built in velocity computation that can be reused globally.\n */\nfunction createTouchRecord(touch: Touch): TouchRecord {\n return {\n touchActive: true,\n startPageX: touch.pageX,\n startPageY: touch.pageY,\n startTimeStamp: timestampForTouch(touch),\n currentPageX: touch.pageX,\n currentPageY: touch.pageY,\n currentTimeStamp: timestampForTouch(touch),\n previousPageX: touch.pageX,\n previousPageY: touch.pageY,\n previousTimeStamp: timestampForTouch(touch),\n }\n}\n\nfunction resetTouchRecord(touchRecord: TouchRecord, touch: Touch): void {\n touchRecord.touchActive = true\n touchRecord.startPageX = touch.pageX\n touchRecord.startPageY = touch.pageY\n touchRecord.startTimeStamp = timestampForTouch(touch)\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchRecord.previousPageX = touch.pageX\n touchRecord.previousPageY = touch.pageY\n touchRecord.previousTimeStamp = timestampForTouch(touch)\n}\n\nfunction getTouchIdentifier({ identifier }: Touch): number {\n if (identifier == null) {\n // eslint-disable-next-line no-console\n console.error('Touch object is missing identifier.')\n }\n if (process.env.NODE_ENV === 'development') {\n if (identifier > MAX_TOUCH_BANK) {\n // eslint-disable-next-line no-console\n console.error(\n 'Touch identifier %s is greater than maximum supported %s which causes ' +\n 'performance issues backfilling array locations for all of the indices.',\n identifier,\n MAX_TOUCH_BANK\n )\n }\n }\n return identifier\n}\n\nfunction recordTouchStart(touch: Touch, touchHistory): void {\n const identifier = getTouchIdentifier(touch)\n const touchRecord = touchHistory.touchBank[identifier]\n if (touchRecord) {\n resetTouchRecord(touchRecord, touch)\n } else {\n touchHistory.touchBank[identifier] = createTouchRecord(touch)\n }\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n}\n\nfunction recordTouchMove(touch: Touch, touchHistory): void {\n const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)]\n if (touchRecord) {\n touchRecord.touchActive = true\n touchRecord.previousPageX = touchRecord.currentPageX\n touchRecord.previousPageY = touchRecord.currentPageY\n touchRecord.previousTimeStamp = touchRecord.currentTimeStamp\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n 'Cannot record touch move without a touch start.\\n',\n `Touch Move: ${printTouch(touch)}\\n`,\n `Touch Bank: ${printTouchBank(touchHistory)}`\n )\n }\n}\n\nfunction recordTouchEnd(touch: Touch, touchHistory): void {\n const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)]\n if (touchRecord) {\n touchRecord.touchActive = false\n touchRecord.previousPageX = touchRecord.currentPageX\n touchRecord.previousPageY = touchRecord.currentPageY\n touchRecord.previousTimeStamp = touchRecord.currentTimeStamp\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n 'Cannot record touch end without a touch start.\\n',\n `Touch End: ${printTouch(touch)}\\n`,\n `Touch Bank: ${printTouchBank(touchHistory)}`\n )\n }\n}\n\nfunction printTouch(touch: Touch): string {\n return JSON.stringify({\n identifier: touch.identifier,\n pageX: touch.pageX,\n pageY: touch.pageY,\n timestamp: timestampForTouch(touch),\n })\n}\n\nfunction printTouchBank(touchHistory): string {\n const { touchBank } = touchHistory\n let printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK))\n if (touchBank.length > MAX_TOUCH_BANK) {\n printed += ' (original size: ' + touchBank.length + ')'\n }\n return printed\n}\n\nexport class ResponderTouchHistoryStore {\n _touchHistory = {\n touchBank: [], //Array<TouchRecord>\n numberActiveTouches: 0,\n // If there is only one active touch, we remember its location. This prevents\n // us having to loop through all of the touches all the time in the most\n // common case.\n indexOfSingleActiveTouch: -1,\n mostRecentTimeStamp: 0,\n }\n\n recordTouchTrack(topLevelType: string, nativeEvent: TouchEvent): void {\n const touchHistory = this._touchHistory\n if (isMoveish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchMove(touch, touchHistory))\n } else if (isStartish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchStart(touch, touchHistory))\n touchHistory.numberActiveTouches = nativeEvent.touches.length\n if (touchHistory.numberActiveTouches === 1) {\n touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier\n }\n } else if (isEndish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchEnd(touch, touchHistory))\n touchHistory.numberActiveTouches = nativeEvent.touches.length\n if (touchHistory.numberActiveTouches === 1) {\n const { touchBank } = touchHistory\n for (let i = 0; i < touchBank.length; i++) {\n const touchTrackToCheck = touchBank[i]\n // @ts-ignore\n if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {\n touchHistory.indexOfSingleActiveTouch = i\n break\n }\n }\n if (process.env.NODE_ENV === 'development') {\n const activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]\n // @ts-ignore\n if (!(activeRecord != null && activeRecord.touchActive)) {\n // eslint-disable-next-line no-console\n console.error('Cannot find single active touch.')\n }\n }\n }\n }\n }\n\n get touchHistory(): TouchHistory {\n return this._touchHistory\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,mBAAgD;AA4BhD,MAAM,iBAAiB;AAEvB,SAAS,kBAAkB,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
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ResponderTouchHistoryStore.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { Touch, TouchEvent } from './types'\nimport { isEndish, isMoveish, isStartish } from './types'\n\ntype TouchRecord = {\n currentPageX: number\n currentPageY: number\n currentTimeStamp: number\n previousPageX: number\n previousPageY: number\n previousTimeStamp: number\n startPageX: number\n startPageY: number\n startTimeStamp: number\n touchActive: boolean\n}\n\nexport type TouchHistory = {\n indexOfSingleActiveTouch: number\n mostRecentTimeStamp: number\n numberActiveTouches: number\n touchBank: Array<TouchRecord>\n}\n\n/**\n * Tracks the position and time of each active touch by `touch.identifier`. We\n * should typically only see IDs in the range of 1-20 because IDs get recycled\n * when touches end and start again.\n */\n\nconst MAX_TOUCH_BANK = 20\n\nfunction timestampForTouch(touch: Touch): number {\n // The legacy internal implementation provides \"timeStamp\", which has been\n // renamed to \"timestamp\".\n return touch['timeStamp'] || touch.timestamp\n}\n\n/**\n * TODO: Instead of making gestures recompute filtered velocity, we could\n * include a built in velocity computation that can be reused globally.\n */\nfunction createTouchRecord(touch: Touch): TouchRecord {\n return {\n touchActive: true,\n startPageX: touch.pageX,\n startPageY: touch.pageY,\n startTimeStamp: timestampForTouch(touch),\n currentPageX: touch.pageX,\n currentPageY: touch.pageY,\n currentTimeStamp: timestampForTouch(touch),\n previousPageX: touch.pageX,\n previousPageY: touch.pageY,\n previousTimeStamp: timestampForTouch(touch),\n }\n}\n\nfunction resetTouchRecord(touchRecord: TouchRecord, touch: Touch): void {\n touchRecord.touchActive = true\n touchRecord.startPageX = touch.pageX\n touchRecord.startPageY = touch.pageY\n touchRecord.startTimeStamp = timestampForTouch(touch)\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchRecord.previousPageX = touch.pageX\n touchRecord.previousPageY = touch.pageY\n touchRecord.previousTimeStamp = timestampForTouch(touch)\n}\n\nfunction getTouchIdentifier({ identifier }: Touch): number {\n if (identifier == null) {\n // eslint-disable-next-line no-console\n console.error('Touch object is missing identifier.')\n }\n if (process.env.NODE_ENV === 'development') {\n if (identifier > MAX_TOUCH_BANK) {\n // eslint-disable-next-line no-console\n console.error(\n 'Touch identifier %s is greater than maximum supported %s which causes ' +\n 'performance issues backfilling array locations for all of the indices.',\n identifier,\n MAX_TOUCH_BANK\n )\n }\n }\n return identifier\n}\n\nfunction recordTouchStart(touch: Touch, touchHistory): void {\n const identifier = getTouchIdentifier(touch)\n const touchRecord = touchHistory.touchBank[identifier]\n if (touchRecord) {\n resetTouchRecord(touchRecord, touch)\n } else {\n touchHistory.touchBank[identifier] = createTouchRecord(touch)\n }\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n}\n\nfunction recordTouchMove(touch: Touch, touchHistory): void {\n const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)]\n if (touchRecord) {\n touchRecord.touchActive = true\n touchRecord.previousPageX = touchRecord.currentPageX\n touchRecord.previousPageY = touchRecord.currentPageY\n touchRecord.previousTimeStamp = touchRecord.currentTimeStamp\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n } else {\n console.warn(\n 'Cannot record touch move without a touch start.\\n',\n `Touch Move: ${printTouch(touch)}\\n`,\n `Touch Bank: ${printTouchBank(touchHistory)}`\n )\n }\n}\n\nfunction recordTouchEnd(touch: Touch, touchHistory): void {\n const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)]\n if (touchRecord) {\n touchRecord.touchActive = false\n touchRecord.previousPageX = touchRecord.currentPageX\n touchRecord.previousPageY = touchRecord.currentPageY\n touchRecord.previousTimeStamp = touchRecord.currentTimeStamp\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n } else {\n console.warn(\n 'Cannot record touch end without a touch start.\\n',\n `Touch End: ${printTouch(touch)}\\n`,\n `Touch Bank: ${printTouchBank(touchHistory)}`\n )\n }\n}\n\nfunction printTouch(touch: Touch): string {\n return JSON.stringify({\n identifier: touch.identifier,\n pageX: touch.pageX,\n pageY: touch.pageY,\n timestamp: timestampForTouch(touch),\n })\n}\n\nfunction printTouchBank(touchHistory): string {\n const { touchBank } = touchHistory\n let printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK))\n if (touchBank.length > MAX_TOUCH_BANK) {\n printed += ' (original size: ' + touchBank.length + ')'\n }\n return printed\n}\n\nexport class ResponderTouchHistoryStore {\n _touchHistory = {\n touchBank: [], //Array<TouchRecord>\n numberActiveTouches: 0,\n // If there is only one active touch, we remember its location. This prevents\n // us having to loop through all of the touches all the time in the most\n // common case.\n indexOfSingleActiveTouch: -1,\n mostRecentTimeStamp: 0,\n }\n\n recordTouchTrack(topLevelType: string, nativeEvent: TouchEvent): void {\n const touchHistory = this._touchHistory\n if (isMoveish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchMove(touch, touchHistory))\n } else if (isStartish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchStart(touch, touchHistory))\n touchHistory.numberActiveTouches = nativeEvent.touches.length\n if (touchHistory.numberActiveTouches === 1) {\n touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier\n }\n } else if (isEndish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchEnd(touch, touchHistory))\n touchHistory.numberActiveTouches = nativeEvent.touches.length\n if (touchHistory.numberActiveTouches === 1) {\n const { touchBank } = touchHistory\n for (let i = 0; i < touchBank.length; i++) {\n const touchTrackToCheck = touchBank[i]\n // @ts-ignore\n if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {\n touchHistory.indexOfSingleActiveTouch = i\n break\n }\n }\n if (process.env.NODE_ENV === 'development') {\n const activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]\n // @ts-ignore\n if (!(activeRecord != null && activeRecord.touchActive)) {\n console.error('Cannot find single active touch.')\n }\n }\n }\n }\n }\n\n get touchHistory(): TouchHistory {\n return this._touchHistory\n }\n}\n"],
|
|
5
|
-
"mappings": "AAQA,SAAS,UAAU,WAAW,kBAAkB;AA4BhD,MAAM,iBAAiB;AAEvB,SAAS,kBAAkB,OAAsB;AAG/C,SAAO,MAAM,gBAAgB,MAAM;AACrC;AAMA,SAAS,kBAAkB,OAA2B;AACpD,SAAO;AAAA,IACL,aAAa;AAAA,IACb,YAAY,MAAM;AAAA,IAClB,YAAY,MAAM;AAAA,IAClB,gBAAgB,kBAAkB,KAAK;AAAA,IACvC,cAAc,MAAM;AAAA,IACpB,cAAc,MAAM;AAAA,IACpB,kBAAkB,kBAAkB,KAAK;AAAA,IACzC,eAAe,MAAM;AAAA,IACrB,eAAe,MAAM;AAAA,IACrB,mBAAmB,kBAAkB,KAAK;AAAA,EAC5C;AACF;AAEA,SAAS,iBAAiB,aAA0B,OAAoB;AACtE,cAAY,cAAc;AAC1B,cAAY,aAAa,MAAM;AAC/B,cAAY,aAAa,MAAM;AAC/B,cAAY,iBAAiB,kBAAkB,KAAK;AACpD,cAAY,eAAe,MAAM;AACjC,cAAY,eAAe,MAAM;AACjC,cAAY,mBAAmB,kBAAkB,KAAK;AACtD,cAAY,gBAAgB,MAAM;AAClC,cAAY,gBAAgB,MAAM;AAClC,cAAY,oBAAoB,kBAAkB,KAAK;AACzD;AAEA,SAAS,mBAAmB,EAAE,WAAW,GAAkB;AACzD,MAAI,cAAc,MAAM;AAEtB,YAAQ,MAAM,qCAAqC;AAAA,EACrD;AACA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,aAAa,gBAAgB;AAE/B,cAAQ;AAAA,QACN;AAAA,QAEA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,iBAAiB,OAAc,cAAoB;AAC1D,QAAM,aAAa,mBAAmB,KAAK;AAC3C,QAAM,cAAc,aAAa,UAAU;AAC3C,MAAI,aAAa;AACf,qBAAiB,aAAa,KAAK;AAAA,EACrC,OAAO;AACL,iBAAa,UAAU,cAAc,kBAAkB,KAAK;AAAA,EAC9D;AACA,eAAa,sBAAsB,kBAAkB,KAAK;AAC5D;AAEA,SAAS,gBAAgB,OAAc,cAAoB;AACzD,QAAM,cAAc,aAAa,UAAU,mBAAmB,KAAK;AACnE,MAAI,aAAa;AACf,gBAAY,cAAc;AAC1B,gBAAY,gBAAgB,YAAY;AACxC,gBAAY,gBAAgB,YAAY;AACxC,gBAAY,oBAAoB,YAAY;AAC5C,gBAAY,eAAe,MAAM;AACjC,gBAAY,eAAe,MAAM;AACjC,gBAAY,mBAAmB,kBAAkB,KAAK;AACtD,iBAAa,sBAAsB,kBAAkB,KAAK;AAAA,EAC5D,OAAO;
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { Touch, TouchEvent } from './types'\nimport { isEndish, isMoveish, isStartish } from './types'\n\ntype TouchRecord = {\n currentPageX: number\n currentPageY: number\n currentTimeStamp: number\n previousPageX: number\n previousPageY: number\n previousTimeStamp: number\n startPageX: number\n startPageY: number\n startTimeStamp: number\n touchActive: boolean\n}\n\nexport type TouchHistory = {\n indexOfSingleActiveTouch: number\n mostRecentTimeStamp: number\n numberActiveTouches: number\n touchBank: Array<TouchRecord>\n}\n\n/**\n * Tracks the position and time of each active touch by `touch.identifier`. We\n * should typically only see IDs in the range of 1-20 because IDs get recycled\n * when touches end and start again.\n */\n\nconst MAX_TOUCH_BANK = 20\n\nfunction timestampForTouch(touch: Touch): number {\n // The legacy internal implementation provides \"timeStamp\", which has been\n // renamed to \"timestamp\".\n return touch['timeStamp'] || touch.timestamp\n}\n\n/**\n * TODO: Instead of making gestures recompute filtered velocity, we could\n * include a built in velocity computation that can be reused globally.\n */\nfunction createTouchRecord(touch: Touch): TouchRecord {\n return {\n touchActive: true,\n startPageX: touch.pageX,\n startPageY: touch.pageY,\n startTimeStamp: timestampForTouch(touch),\n currentPageX: touch.pageX,\n currentPageY: touch.pageY,\n currentTimeStamp: timestampForTouch(touch),\n previousPageX: touch.pageX,\n previousPageY: touch.pageY,\n previousTimeStamp: timestampForTouch(touch),\n }\n}\n\nfunction resetTouchRecord(touchRecord: TouchRecord, touch: Touch): void {\n touchRecord.touchActive = true\n touchRecord.startPageX = touch.pageX\n touchRecord.startPageY = touch.pageY\n touchRecord.startTimeStamp = timestampForTouch(touch)\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchRecord.previousPageX = touch.pageX\n touchRecord.previousPageY = touch.pageY\n touchRecord.previousTimeStamp = timestampForTouch(touch)\n}\n\nfunction getTouchIdentifier({ identifier }: Touch): number {\n if (identifier == null) {\n // eslint-disable-next-line no-console\n console.error('Touch object is missing identifier.')\n }\n if (process.env.NODE_ENV === 'development') {\n if (identifier > MAX_TOUCH_BANK) {\n // eslint-disable-next-line no-console\n console.error(\n 'Touch identifier %s is greater than maximum supported %s which causes ' +\n 'performance issues backfilling array locations for all of the indices.',\n identifier,\n MAX_TOUCH_BANK\n )\n }\n }\n return identifier\n}\n\nfunction recordTouchStart(touch: Touch, touchHistory): void {\n const identifier = getTouchIdentifier(touch)\n const touchRecord = touchHistory.touchBank[identifier]\n if (touchRecord) {\n resetTouchRecord(touchRecord, touch)\n } else {\n touchHistory.touchBank[identifier] = createTouchRecord(touch)\n }\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n}\n\nfunction recordTouchMove(touch: Touch, touchHistory): void {\n const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)]\n if (touchRecord) {\n touchRecord.touchActive = true\n touchRecord.previousPageX = touchRecord.currentPageX\n touchRecord.previousPageY = touchRecord.currentPageY\n touchRecord.previousTimeStamp = touchRecord.currentTimeStamp\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n 'Cannot record touch move without a touch start.\\n',\n `Touch Move: ${printTouch(touch)}\\n`,\n `Touch Bank: ${printTouchBank(touchHistory)}`\n )\n }\n}\n\nfunction recordTouchEnd(touch: Touch, touchHistory): void {\n const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)]\n if (touchRecord) {\n touchRecord.touchActive = false\n touchRecord.previousPageX = touchRecord.currentPageX\n touchRecord.previousPageY = touchRecord.currentPageY\n touchRecord.previousTimeStamp = touchRecord.currentTimeStamp\n touchRecord.currentPageX = touch.pageX\n touchRecord.currentPageY = touch.pageY\n touchRecord.currentTimeStamp = timestampForTouch(touch)\n touchHistory.mostRecentTimeStamp = timestampForTouch(touch)\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n 'Cannot record touch end without a touch start.\\n',\n `Touch End: ${printTouch(touch)}\\n`,\n `Touch Bank: ${printTouchBank(touchHistory)}`\n )\n }\n}\n\nfunction printTouch(touch: Touch): string {\n return JSON.stringify({\n identifier: touch.identifier,\n pageX: touch.pageX,\n pageY: touch.pageY,\n timestamp: timestampForTouch(touch),\n })\n}\n\nfunction printTouchBank(touchHistory): string {\n const { touchBank } = touchHistory\n let printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK))\n if (touchBank.length > MAX_TOUCH_BANK) {\n printed += ' (original size: ' + touchBank.length + ')'\n }\n return printed\n}\n\nexport class ResponderTouchHistoryStore {\n _touchHistory = {\n touchBank: [], //Array<TouchRecord>\n numberActiveTouches: 0,\n // If there is only one active touch, we remember its location. This prevents\n // us having to loop through all of the touches all the time in the most\n // common case.\n indexOfSingleActiveTouch: -1,\n mostRecentTimeStamp: 0,\n }\n\n recordTouchTrack(topLevelType: string, nativeEvent: TouchEvent): void {\n const touchHistory = this._touchHistory\n if (isMoveish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchMove(touch, touchHistory))\n } else if (isStartish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchStart(touch, touchHistory))\n touchHistory.numberActiveTouches = nativeEvent.touches.length\n if (touchHistory.numberActiveTouches === 1) {\n touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier\n }\n } else if (isEndish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) => recordTouchEnd(touch, touchHistory))\n touchHistory.numberActiveTouches = nativeEvent.touches.length\n if (touchHistory.numberActiveTouches === 1) {\n const { touchBank } = touchHistory\n for (let i = 0; i < touchBank.length; i++) {\n const touchTrackToCheck = touchBank[i]\n // @ts-ignore\n if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {\n touchHistory.indexOfSingleActiveTouch = i\n break\n }\n }\n if (process.env.NODE_ENV === 'development') {\n const activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]\n // @ts-ignore\n if (!(activeRecord != null && activeRecord.touchActive)) {\n // eslint-disable-next-line no-console\n console.error('Cannot find single active touch.')\n }\n }\n }\n }\n }\n\n get touchHistory(): TouchHistory {\n return this._touchHistory\n }\n}\n"],
|
|
5
|
+
"mappings": "AAQA,SAAS,UAAU,WAAW,kBAAkB;AA4BhD,MAAM,iBAAiB;AAEvB,SAAS,kBAAkB,OAAsB;AAG/C,SAAO,MAAM,gBAAgB,MAAM;AACrC;AAMA,SAAS,kBAAkB,OAA2B;AACpD,SAAO;AAAA,IACL,aAAa;AAAA,IACb,YAAY,MAAM;AAAA,IAClB,YAAY,MAAM;AAAA,IAClB,gBAAgB,kBAAkB,KAAK;A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vB;AAAA;AAAA,EAEA,iBAAiB,cAAsB,aAA+B;AACpE,UAAM,eAAe,KAAK;AAC1B,QAAI,UAAU,YAAY,GAAG;AAC3B,kBAAY,eAAe,QAAQ,CAAC,UAAU,gBAAgB,OAAO,YAAY,CAAC;AAAA,IACpF,WAAW,WAAW,YAAY,GAAG;AACnC,kBAAY,eAAe,QAAQ,CAAC,UAAU,iBAAiB,OAAO,YAAY,CAAC;AACnF,mBAAa,sBAAsB,YAAY,QAAQ;AACvD,UAAI,aAAa,wBAAwB,GAAG;AAC1C,qBAAa,2BAA2B,YAAY,QAAQ,GAAG;AAAA,MACjE;AAAA,IACF,WAAW,SAAS,YAAY,GAAG;AACjC,kBAAY,eAAe,QAAQ,CAAC,UAAU,eAAe,OAAO,YAAY,CAAC;AACjF,mBAAa,sBAAsB,YAAY,QAAQ;AACvD,UAAI,aAAa,wBAAwB,GAAG;AAC1C,cAAM,EAAE,UAAU,IAAI;AACtB,iBAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AACzC,gBAAM,oBAAoB,UAAU;AAEpC,cAAI,qBAAqB,QAAQ,kBAAkB,aAAa;AAC9D,yBAAa,2BAA2B;AACxC;AAAA,UACF;AAAA,QACF;AACA,YAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,gBAAM,eAAe,UAAU,aAAa;AAE5C,cAAI,EAAE,gBAAgB,QAAQ,aAAa,cAAc;AAEvD,oBAAQ,MAAM,kCAAkC;AAAA,UAClD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,IAAI,eAA6B;AAC/B,WAAO,KAAK;AAAA,EACd;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/react-native-use-responder-events",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.220",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "tamagui-build",
|
|
14
14
|
"watch": "tamagui-build --watch",
|
|
15
|
-
"lint": "eslint",
|
|
15
|
+
"lint": "eslint src",
|
|
16
16
|
"lint:fix": "yarn lint --fix",
|
|
17
17
|
"clean": "tamagui-build clean",
|
|
18
18
|
"clean:build": "tamagui-build clean:build"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"react": ">=18"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
24
|
+
"@tamagui/build": "^1.0.1-beta.220",
|
|
25
25
|
"@types/react": "^18.0.15"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
@@ -116,6 +116,7 @@ function recordTouchMove(touch: Touch, touchHistory): void {
|
|
|
116
116
|
touchRecord.currentTimeStamp = timestampForTouch(touch)
|
|
117
117
|
touchHistory.mostRecentTimeStamp = timestampForTouch(touch)
|
|
118
118
|
} else {
|
|
119
|
+
// eslint-disable-next-line no-console
|
|
119
120
|
console.warn(
|
|
120
121
|
'Cannot record touch move without a touch start.\n',
|
|
121
122
|
`Touch Move: ${printTouch(touch)}\n`,
|
|
@@ -136,6 +137,7 @@ function recordTouchEnd(touch: Touch, touchHistory): void {
|
|
|
136
137
|
touchRecord.currentTimeStamp = timestampForTouch(touch)
|
|
137
138
|
touchHistory.mostRecentTimeStamp = timestampForTouch(touch)
|
|
138
139
|
} else {
|
|
140
|
+
// eslint-disable-next-line no-console
|
|
139
141
|
console.warn(
|
|
140
142
|
'Cannot record touch end without a touch start.\n',
|
|
141
143
|
`Touch End: ${printTouch(touch)}\n`,
|
|
@@ -200,6 +202,7 @@ export class ResponderTouchHistoryStore {
|
|
|
200
202
|
const activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]
|
|
201
203
|
// @ts-ignore
|
|
202
204
|
if (!(activeRecord != null && activeRecord.touchActive)) {
|
|
205
|
+
// eslint-disable-next-line no-console
|
|
203
206
|
console.error('Cannot find single active touch.')
|
|
204
207
|
}
|
|
205
208
|
}
|