@tamagui/react-native-use-responder-events 1.13.2 → 1.13.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.
Files changed (43) hide show
  1. package/dist/cjs/ResponderSystem.js +1 -388
  2. package/dist/cjs/ResponderSystem.js.map +2 -2
  3. package/dist/cjs/ResponderTouchHistoryStore.js +5 -193
  4. package/dist/cjs/ResponderTouchHistoryStore.js.map +2 -2
  5. package/dist/cjs/createResponderEvent.js +1 -150
  6. package/dist/cjs/createResponderEvent.js.map +2 -2
  7. package/dist/cjs/index.js +1 -18
  8. package/dist/cjs/index.js.map +2 -2
  9. package/dist/cjs/types.js +1 -97
  10. package/dist/cjs/types.js.map +2 -2
  11. package/dist/cjs/useResponderEvents.js +1 -79
  12. package/dist/cjs/useResponderEvents.js.map +2 -2
  13. package/dist/cjs/utils.js +2 -173
  14. package/dist/cjs/utils.js.map +2 -2
  15. package/dist/esm/ResponderSystem.js +1 -364
  16. package/dist/esm/ResponderSystem.js.map +2 -2
  17. package/dist/esm/ResponderSystem.mjs +1 -364
  18. package/dist/esm/ResponderSystem.mjs.map +2 -2
  19. package/dist/esm/ResponderTouchHistoryStore.js +5 -169
  20. package/dist/esm/ResponderTouchHistoryStore.js.map +2 -2
  21. package/dist/esm/ResponderTouchHistoryStore.mjs +5 -169
  22. package/dist/esm/ResponderTouchHistoryStore.mjs.map +2 -2
  23. package/dist/esm/createResponderEvent.js +1 -128
  24. package/dist/esm/createResponderEvent.js.map +2 -2
  25. package/dist/esm/createResponderEvent.mjs +1 -128
  26. package/dist/esm/createResponderEvent.mjs.map +2 -2
  27. package/dist/esm/index.js +1 -1
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/index.mjs +1 -1
  30. package/dist/esm/index.mjs.map +1 -1
  31. package/dist/esm/types.js +1 -54
  32. package/dist/esm/types.js.map +2 -2
  33. package/dist/esm/types.mjs +1 -54
  34. package/dist/esm/types.mjs.map +2 -2
  35. package/dist/esm/useResponderEvents.js +1 -44
  36. package/dist/esm/useResponderEvents.js.map +2 -2
  37. package/dist/esm/useResponderEvents.mjs +1 -44
  38. package/dist/esm/useResponderEvents.mjs.map +2 -2
  39. package/dist/esm/utils.js +2 -141
  40. package/dist/esm/utils.js.map +2 -2
  41. package/dist/esm/utils.mjs +2 -141
  42. package/dist/esm/utils.mjs.map +2 -2
  43. package/package.json +2 -2
@@ -1,194 +1,6 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var ResponderTouchHistoryStore_exports = {};
20
- __export(ResponderTouchHistoryStore_exports, {
21
- ResponderTouchHistoryStore: () => ResponderTouchHistoryStore
22
- });
23
- module.exports = __toCommonJS(ResponderTouchHistoryStore_exports);
24
- var import_types = require("./types");
25
- const MAX_TOUCH_BANK = 20;
26
- function timestampForTouch(touch) {
27
- return touch["timeStamp"] || touch.timestamp;
28
- }
29
- function createTouchRecord(touch) {
30
- return {
31
- touchActive: true,
32
- startPageX: touch.pageX,
33
- startPageY: touch.pageY,
34
- startTimeStamp: timestampForTouch(touch),
35
- currentPageX: touch.pageX,
36
- currentPageY: touch.pageY,
37
- currentTimeStamp: timestampForTouch(touch),
38
- previousPageX: touch.pageX,
39
- previousPageY: touch.pageY,
40
- previousTimeStamp: timestampForTouch(touch)
41
- };
42
- }
43
- function resetTouchRecord(touchRecord, touch) {
44
- touchRecord.touchActive = true;
45
- touchRecord.startPageX = touch.pageX;
46
- touchRecord.startPageY = touch.pageY;
47
- touchRecord.startTimeStamp = timestampForTouch(touch);
48
- touchRecord.currentPageX = touch.pageX;
49
- touchRecord.currentPageY = touch.pageY;
50
- touchRecord.currentTimeStamp = timestampForTouch(touch);
51
- touchRecord.previousPageX = touch.pageX;
52
- touchRecord.previousPageY = touch.pageY;
53
- touchRecord.previousTimeStamp = timestampForTouch(touch);
54
- }
55
- function getTouchIdentifier({ identifier }) {
56
- if (identifier == null) {
57
- console.error("Touch object is missing identifier.");
58
- }
59
- if (process.env.NODE_ENV === "development") {
60
- if (identifier > MAX_TOUCH_BANK) {
61
- console.error(
62
- "Touch identifier %s is greater than maximum supported %s which causes performance issues backfilling array locations for all of the indices.",
63
- identifier,
64
- MAX_TOUCH_BANK
65
- );
66
- }
67
- }
68
- return identifier;
69
- }
70
- function recordTouchStart(touch, touchHistory) {
71
- const identifier = getTouchIdentifier(touch);
72
- const touchRecord = touchHistory.touchBank[identifier];
73
- if (touchRecord) {
74
- resetTouchRecord(touchRecord, touch);
75
- } else {
76
- touchHistory.touchBank[identifier] = createTouchRecord(touch);
77
- }
78
- touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
79
- }
80
- function recordTouchMove(touch, touchHistory) {
81
- const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
82
- if (touchRecord) {
83
- touchRecord.touchActive = true;
84
- touchRecord.previousPageX = touchRecord.currentPageX;
85
- touchRecord.previousPageY = touchRecord.currentPageY;
86
- touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;
87
- touchRecord.currentPageX = touch.pageX;
88
- touchRecord.currentPageY = touch.pageY;
89
- touchRecord.currentTimeStamp = timestampForTouch(touch);
90
- touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
91
- } else {
92
- console.warn(
93
- "Cannot record touch move without a touch start.\n",
94
- `Touch Move: ${printTouch(touch)}
95
- `,
96
- `Touch Bank: ${printTouchBank(touchHistory)}`
97
- );
98
- }
99
- }
100
- function recordTouchEnd(touch, touchHistory) {
101
- const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
102
- if (touchRecord) {
103
- touchRecord.touchActive = false;
104
- touchRecord.previousPageX = touchRecord.currentPageX;
105
- touchRecord.previousPageY = touchRecord.currentPageY;
106
- touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;
107
- touchRecord.currentPageX = touch.pageX;
108
- touchRecord.currentPageY = touch.pageY;
109
- touchRecord.currentTimeStamp = timestampForTouch(touch);
110
- touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
111
- } else {
112
- console.warn(
113
- "Cannot record touch end without a touch start.\n",
114
- `Touch End: ${printTouch(touch)}
115
- `,
116
- `Touch Bank: ${printTouchBank(touchHistory)}`
117
- );
118
- }
119
- }
120
- function printTouch(touch) {
121
- return JSON.stringify({
122
- identifier: touch.identifier,
123
- pageX: touch.pageX,
124
- pageY: touch.pageY,
125
- timestamp: timestampForTouch(touch)
126
- });
127
- }
128
- function printTouchBank(touchHistory) {
129
- const { touchBank } = touchHistory;
130
- let printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK));
131
- if (touchBank.length > MAX_TOUCH_BANK) {
132
- printed += ` (original size: ${touchBank.length})`;
133
- }
134
- return printed;
135
- }
136
- class ResponderTouchHistoryStore {
137
- constructor() {
138
- this._touchHistory = {
139
- touchBank: [],
140
- //Array<TouchRecord>
141
- numberActiveTouches: 0,
142
- // If there is only one active touch, we remember its location. This prevents
143
- // us having to loop through all of the touches all the time in the most
144
- // common case.
145
- indexOfSingleActiveTouch: -1,
146
- mostRecentTimeStamp: 0
147
- };
148
- }
149
- recordTouchTrack(topLevelType, nativeEvent) {
150
- const touchHistory = this._touchHistory;
151
- if ((0, import_types.isMoveish)(topLevelType)) {
152
- nativeEvent.changedTouches.forEach(
153
- (touch) => recordTouchMove(touch, touchHistory)
154
- );
155
- } else if ((0, import_types.isStartish)(topLevelType)) {
156
- nativeEvent.changedTouches.forEach(
157
- (touch) => recordTouchStart(touch, touchHistory)
158
- );
159
- touchHistory.numberActiveTouches = nativeEvent.touches.length;
160
- if (touchHistory.numberActiveTouches === 1) {
161
- touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier;
162
- }
163
- } else if ((0, import_types.isEndish)(topLevelType)) {
164
- nativeEvent.changedTouches.forEach(
165
- (touch) => recordTouchEnd(touch, touchHistory)
166
- );
167
- touchHistory.numberActiveTouches = nativeEvent.touches.length;
168
- if (touchHistory.numberActiveTouches === 1) {
169
- const { touchBank } = touchHistory;
170
- for (let i = 0; i < touchBank.length; i++) {
171
- const touchTrackToCheck = touchBank[i];
172
- if (touchTrackToCheck == null ? void 0 : touchTrackToCheck.touchActive) {
173
- touchHistory.indexOfSingleActiveTouch = i;
174
- break;
175
- }
176
- }
177
- if (process.env.NODE_ENV === "development") {
178
- const activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch];
179
- if (!(activeRecord == null ? void 0 : activeRecord.touchActive)) {
180
- console.error("Cannot find single active touch.");
181
- }
182
- }
183
- }
184
- }
185
- }
186
- get touchHistory() {
187
- return this._touchHistory;
188
- }
189
- }
190
- // Annotate the CommonJS export names for ESM import in node:
191
- 0 && (module.exports = {
192
- ResponderTouchHistoryStore
193
- });
1
+ "use strict";var m=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var l=(e,t)=>{for(var r in t)m(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of f(t))!v.call(e,i)&&i!==r&&m(e,i,{get:()=>t[i],enumerable:!(n=h(t,i))||n.enumerable});return e};var S=e=>d(m({},"__esModule",{value:!0}),e);var B={};l(B,{ResponderTouchHistoryStore:()=>k});module.exports=S(B);var c=require("./types");const u=20;function o(e){return e.timeStamp||e.timestamp}function P(e){return{touchActive:!0,startPageX:e.pageX,startPageY:e.pageY,startTimeStamp:o(e),currentPageX:e.pageX,currentPageY:e.pageY,currentTimeStamp:o(e),previousPageX:e.pageX,previousPageY:e.pageY,previousTimeStamp:o(e)}}function X(e,t){e.touchActive=!0,e.startPageX=t.pageX,e.startPageY=t.pageY,e.startTimeStamp=o(t),e.currentPageX=t.pageX,e.currentPageY=t.pageY,e.currentTimeStamp=o(t),e.previousPageX=t.pageX,e.previousPageY=t.pageY,e.previousTimeStamp=o(t)}function g({identifier:e}){return e==null&&console.error("Touch object is missing identifier."),process.env.NODE_ENV==="development"&&e>u&&console.error("Touch identifier %s is greater than maximum supported %s which causes performance issues backfilling array locations for all of the indices.",e,u),e}function Y(e,t){const r=g(e),n=t.touchBank[r];n?X(n,e):t.touchBank[r]=P(e),t.mostRecentTimeStamp=o(e)}function b(e,t){const r=t.touchBank[g(e)];r?(r.touchActive=!0,r.previousPageX=r.currentPageX,r.previousPageY=r.currentPageY,r.previousTimeStamp=r.currentTimeStamp,r.currentPageX=e.pageX,r.currentPageY=e.pageY,r.currentTimeStamp=o(e),t.mostRecentTimeStamp=o(e)):console.warn(`Cannot record touch move without a touch start.
2
+ `,`Touch Move: ${p(e)}
3
+ `,`Touch Bank: ${T(t)}`)}function A(e,t){const r=t.touchBank[g(e)];r?(r.touchActive=!1,r.previousPageX=r.currentPageX,r.previousPageY=r.currentPageY,r.previousTimeStamp=r.currentTimeStamp,r.currentPageX=e.pageX,r.currentPageY=e.pageY,r.currentTimeStamp=o(e),t.mostRecentTimeStamp=o(e)):console.warn(`Cannot record touch end without a touch start.
4
+ `,`Touch End: ${p(e)}
5
+ `,`Touch Bank: ${T(t)}`)}function p(e){return JSON.stringify({identifier:e.identifier,pageX:e.pageX,pageY:e.pageY,timestamp:o(e)})}function T(e){const{touchBank:t}=e;let r=JSON.stringify(t.slice(0,u));return t.length>u&&(r+=` (original size: ${t.length})`),r}class k{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(t,r){const n=this._touchHistory;if((0,c.isMoveish)(t))r.changedTouches.forEach(i=>b(i,n));else if((0,c.isStartish)(t))r.changedTouches.forEach(i=>Y(i,n)),n.numberActiveTouches=r.touches.length,n.numberActiveTouches===1&&(n.indexOfSingleActiveTouch=r.touches[0].identifier);else if((0,c.isEndish)(t)&&(r.changedTouches.forEach(i=>A(i,n)),n.numberActiveTouches=r.touches.length,n.numberActiveTouches===1)){const{touchBank:i}=n;for(let a=0;a<i.length;a++){const s=i[a];if(s!=null&&s.touchActive){n.indexOfSingleActiveTouch=a;break}}if(process.env.NODE_ENV==="development"){const a=i[n.indexOfSingleActiveTouch];a!=null&&a.touchActive||console.error("Cannot find single active touch.")}}}get touchHistory(){return this._touchHistory}}0&&(module.exports={ResponderTouchHistoryStore});
194
6
  //# sourceMappingURL=ResponderTouchHistoryStore.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/ResponderTouchHistoryStore.ts"],
4
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) =>\n recordTouchMove(touch, touchHistory),\n )\n } else if (isStartish(topLevelType)) {\n nativeEvent.changedTouches.forEach((touch) =>\n recordTouchStart(touch, touchHistory),\n )\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) =>\n recordTouchEnd(touch, touchHistory),\n )\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?.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?.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,OAAsB;AAG/C,SAAO,MAAM,WAAW,KAAK,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,MA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,eAAe,QAASf,GAClCQ,EAAgBR,EAAOO,CAAY,CACrC,aACS,cAAWO,CAAY,EAChCC,EAAY,eAAe,QAASf,GAClCM,EAAiBN,EAAOO,CAAY,CACtC,EACAA,EAAa,oBAAsBQ,EAAY,QAAQ,OACnDR,EAAa,sBAAwB,IACvCA,EAAa,yBAA2BQ,EAAY,QAAQ,CAAC,EAAE,uBAExD,YAASD,CAAY,IAC9BC,EAAY,eAAe,QAASf,GAClCW,EAAeX,EAAOO,CAAY,CACpC,EACAA,EAAa,oBAAsBQ,EAAY,QAAQ,OACnDR,EAAa,sBAAwB,GAAG,CAC1C,KAAM,CAAE,UAAAK,CAAU,EAAIL,EACtB,QAASS,EAAI,EAAGA,EAAIJ,EAAU,OAAQI,IAAK,CACzC,MAAMC,EAAoBL,EAAUI,CAAC,EAErC,GAAIC,GAAA,MAAAA,EAAmB,YAAa,CAClCV,EAAa,yBAA2BS,EACxC,KACF,CACF,CACA,GAAI,QAAQ,IAAI,WAAa,cAAe,CAC1C,MAAME,EAAeN,EAAUL,EAAa,wBAAwB,EAE/DW,GAAA,MAAAA,EAAc,aAEjB,QAAQ,MAAM,kCAAkC,CAEpD,CACF,CAEJ,CAEA,IAAI,cAA6B,CAC/B,OAAO,KAAK,aACd,CACF",
6
+ "names": ["ResponderTouchHistoryStore_exports", "__export", "ResponderTouchHistoryStore", "__toCommonJS", "import_types", "MAX_TOUCH_BANK", "timestampForTouch", "touch", "createTouchRecord", "resetTouchRecord", "touchRecord", "getTouchIdentifier", "identifier", "recordTouchStart", "touchHistory", "recordTouchMove", "printTouch", "printTouchBank", "recordTouchEnd", "touchBank", "printed", "topLevelType", "nativeEvent", "i", "touchTrackToCheck", "activeRecord"]
7
7
  }
@@ -1,151 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var createResponderEvent_exports = {};
20
- __export(createResponderEvent_exports, {
21
- default: () => createResponderEvent
22
- });
23
- module.exports = __toCommonJS(createResponderEvent_exports);
24
- var import_utils = require("./utils");
25
- const emptyFunction = () => {
26
- };
27
- const emptyObject = {};
28
- const emptyArray = [];
29
- function normalizeIdentifier(identifier) {
30
- return identifier > 20 ? identifier % 20 : identifier;
31
- }
32
- function createResponderEvent(domEvent, responderTouchHistoryStore) {
33
- let rect;
34
- let propagationWasStopped = false;
35
- let changedTouches;
36
- let touches;
37
- const domEventChangedTouches = domEvent.changedTouches;
38
- const domEventType = domEvent.type;
39
- const metaKey = domEvent.metaKey === true;
40
- const shiftKey = domEvent.shiftKey === true;
41
- const force = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].force) || 0;
42
- const identifier = normalizeIdentifier((domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].identifier) || 0);
43
- const clientX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientX) || domEvent.clientX;
44
- const clientY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientY) || domEvent.clientY;
45
- const pageX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageX) || domEvent.pageX;
46
- const pageY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageY) || domEvent.pageY;
47
- const preventDefault = typeof domEvent.preventDefault === "function" ? domEvent.preventDefault.bind(domEvent) : emptyFunction;
48
- const timestamp = domEvent.timeStamp;
49
- function normalizeTouches(touches2) {
50
- return Array.prototype.slice.call(touches2).map((touch) => {
51
- return {
52
- force: touch.force,
53
- identifier: normalizeIdentifier(touch.identifier),
54
- get locationX() {
55
- return locationX(touch.clientX);
56
- },
57
- get locationY() {
58
- return locationY(touch.clientY);
59
- },
60
- pageX: touch.pageX,
61
- pageY: touch.pageY,
62
- target: touch.target,
63
- timestamp
64
- };
65
- });
66
- }
67
- if (domEventChangedTouches != null) {
68
- changedTouches = normalizeTouches(domEventChangedTouches);
69
- touches = normalizeTouches(domEvent.touches);
70
- } else {
71
- const emulatedTouches = [
72
- {
73
- force,
74
- identifier,
75
- get locationX() {
76
- return locationX(clientX);
77
- },
78
- get locationY() {
79
- return locationY(clientY);
80
- },
81
- pageX,
82
- pageY,
83
- target: domEvent.target,
84
- timestamp
85
- }
86
- ];
87
- changedTouches = emulatedTouches;
88
- touches = domEventType === "mouseup" || domEventType === "dragstart" ? emptyArray : emulatedTouches;
89
- }
90
- const responderEvent = {
91
- bubbles: true,
92
- cancelable: true,
93
- // `currentTarget` is set before dispatch
94
- currentTarget: null,
95
- defaultPrevented: domEvent.defaultPrevented,
96
- dispatchConfig: emptyObject,
97
- eventPhase: domEvent.eventPhase,
98
- isDefaultPrevented() {
99
- return domEvent.defaultPrevented;
100
- },
101
- isPropagationStopped() {
102
- return propagationWasStopped;
103
- },
104
- isTrusted: domEvent.isTrusted,
105
- nativeEvent: {
106
- altKey: false,
107
- ctrlKey: false,
108
- metaKey,
109
- shiftKey,
110
- changedTouches,
111
- force,
112
- identifier,
113
- get locationX() {
114
- return locationX(clientX);
115
- },
116
- get locationY() {
117
- return locationY(clientY);
118
- },
119
- pageX,
120
- pageY,
121
- target: domEvent.target,
122
- timestamp,
123
- touches,
124
- type: domEventType
125
- },
126
- persist: emptyFunction,
127
- preventDefault,
128
- stopPropagation() {
129
- propagationWasStopped = true;
130
- },
131
- target: domEvent.target,
132
- timeStamp: timestamp,
133
- touchHistory: responderTouchHistoryStore.touchHistory
134
- };
135
- function locationX(x) {
136
- rect = rect || (0, import_utils.getBoundingClientRect)(responderEvent.currentTarget);
137
- if (rect) {
138
- return x - rect.left;
139
- }
140
- }
141
- function locationY(y) {
142
- rect = rect || (0, import_utils.getBoundingClientRect)(responderEvent.currentTarget);
143
- if (rect) {
144
- return y - rect.top;
145
- }
146
- }
147
- return responderEvent;
148
- }
149
- // Annotate the CommonJS export names for ESM import in node:
150
- 0 && (module.exports = {});
1
+ "use strict";var y=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var I=(t,n)=>{for(var r in n)y(t,r,{get:n[r],enumerable:!0})},O=(t,n,r,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of B(n))!F.call(t,a)&&a!==r&&y(t,a,{get:()=>n[a],enumerable:!(l=j(n,a))||l.enumerable});return t};var W=t=>O(y({},"__esModule",{value:!0}),t);var q={};I(q,{default:()=>x});module.exports=W(q);var b=require("./utils");const K=()=>{},d={},k=[];function T(t){return t>20?t%20:t}function x(t,n){let r,l=!1,a,c;const e=t.changedTouches,p=t.type,z=t.metaKey===!0,A=t.shiftKey===!0,P=(e==null?void 0:e[0].force)||0,X=T((e==null?void 0:e[0].identifier)||0),Y=(e==null?void 0:e[0].clientX)||t.clientX,S=(e==null?void 0:e[0].clientY)||t.clientY,H=(e==null?void 0:e[0].pageX)||t.pageX,R=(e==null?void 0:e[0].pageY)||t.pageY,N=typeof t.preventDefault=="function"?t.preventDefault.bind(t):K,s=t.timeStamp;function D(i){return Array.prototype.slice.call(i).map(o=>({force:o.force,identifier:T(o.identifier),get locationX(){return f(o.clientX)},get locationY(){return g(o.clientY)},pageX:o.pageX,pageY:o.pageY,target:o.target,timestamp:s}))}if(e!=null)a=D(e),c=D(t.touches);else{const i=[{force:P,identifier:X,get locationX(){return f(Y)},get locationY(){return g(S)},pageX:H,pageY:R,target:t.target,timestamp:s}];a=i,c=p==="mouseup"||p==="dragstart"?k:i}const u={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:t.defaultPrevented,dispatchConfig:d,eventPhase:t.eventPhase,isDefaultPrevented(){return t.defaultPrevented},isPropagationStopped(){return l},isTrusted:t.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:z,shiftKey:A,changedTouches:a,force:P,identifier:X,get locationX(){return f(Y)},get locationY(){return g(S)},pageX:H,pageY:R,target:t.target,timestamp:s,touches:c,type:p},persist:K,preventDefault:N,stopPropagation(){l=!0},target:t.target,timeStamp:s,touchHistory:n.touchHistory};function f(i){if(r=r||(0,b.getBoundingClientRect)(u.currentTarget),r)return i-r.left}function g(i){if(r=r||(0,b.getBoundingClientRect)(u.currentTarget),r)return i-r.top}return u}0&&(module.exports={});
151
2
  //# sourceMappingURL=createResponderEvent.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/createResponderEvent.ts"],
4
4
  "sourcesContent": ["/**\n * Copyright (c) Nicolas Gallagher\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 {\n ResponderTouchHistoryStore,\n TouchHistory,\n} from './ResponderTouchHistoryStore'\nimport { getBoundingClientRect } from './utils'\n\nexport type ResponderEvent = {\n bubbles: boolean\n cancelable: boolean\n currentTarget: any\n defaultPrevented: boolean | null\n dispatchConfig: {\n registrationName?: string\n phasedRegistrationNames?: {\n bubbled: string\n captured: string\n }\n }\n eventPhase: number | null\n isDefaultPrevented: () => boolean\n isPropagationStopped: () => boolean\n isTrusted: boolean | null\n preventDefault: () => void\n stopPropagation: () => void\n nativeEvent: TouchEvent\n persist: () => void\n target: any | null\n timeStamp: number\n touchHistory: TouchHistory\n}\n\nconst emptyFunction = () => {}\nconst emptyObject = {}\nconst emptyArray = []\n\n/**\n * Safari produces very large identifiers that would cause the `touchBank` array\n * length to be so large as to crash the browser, if not normalized like this.\n * In the future the `touchBank` should use an object/map instead.\n */\nfunction normalizeIdentifier(identifier) {\n return identifier > 20 ? identifier % 20 : identifier\n}\n\n/**\n * Converts a native DOM event to a ResponderEvent.\n * Mouse events are transformed into fake touch events.\n */\nexport default function createResponderEvent(\n domEvent: any,\n responderTouchHistoryStore: ResponderTouchHistoryStore,\n): ResponderEvent {\n let rect\n let propagationWasStopped = false\n let changedTouches\n let touches\n\n const domEventChangedTouches = domEvent.changedTouches\n const domEventType = domEvent.type\n\n const metaKey = domEvent.metaKey === true\n const shiftKey = domEvent.shiftKey === true\n const force = domEventChangedTouches?.[0].force || 0\n const identifier = normalizeIdentifier(domEventChangedTouches?.[0].identifier || 0)\n const clientX = domEventChangedTouches?.[0].clientX || domEvent.clientX\n const clientY = domEventChangedTouches?.[0].clientY || domEvent.clientY\n const pageX = domEventChangedTouches?.[0].pageX || domEvent.pageX\n const pageY = domEventChangedTouches?.[0].pageY || domEvent.pageY\n const preventDefault =\n typeof domEvent.preventDefault === 'function'\n ? domEvent.preventDefault.bind(domEvent)\n : emptyFunction\n const timestamp = domEvent.timeStamp\n\n function normalizeTouches(touches) {\n return Array.prototype.slice.call(touches).map((touch) => {\n return {\n force: touch.force,\n identifier: normalizeIdentifier(touch.identifier),\n get locationX() {\n return locationX(touch.clientX)\n },\n get locationY() {\n return locationY(touch.clientY)\n },\n pageX: touch.pageX,\n pageY: touch.pageY,\n target: touch.target,\n timestamp,\n }\n })\n }\n\n if (domEventChangedTouches != null) {\n changedTouches = normalizeTouches(domEventChangedTouches)\n touches = normalizeTouches(domEvent.touches)\n } else {\n const emulatedTouches = [\n {\n force,\n identifier,\n get locationX() {\n return locationX(clientX)\n },\n get locationY() {\n return locationY(clientY)\n },\n pageX,\n pageY,\n target: domEvent.target,\n timestamp,\n },\n ]\n changedTouches = emulatedTouches\n touches =\n domEventType === 'mouseup' || domEventType === 'dragstart'\n ? emptyArray\n : emulatedTouches\n }\n\n const responderEvent = {\n bubbles: true,\n cancelable: true,\n // `currentTarget` is set before dispatch\n currentTarget: null,\n defaultPrevented: domEvent.defaultPrevented,\n dispatchConfig: emptyObject,\n eventPhase: domEvent.eventPhase,\n isDefaultPrevented() {\n return domEvent.defaultPrevented\n },\n isPropagationStopped() {\n return propagationWasStopped\n },\n isTrusted: domEvent.isTrusted,\n nativeEvent: {\n altKey: false,\n ctrlKey: false,\n metaKey,\n shiftKey,\n changedTouches,\n force,\n identifier,\n get locationX() {\n return locationX(clientX)\n },\n get locationY() {\n return locationY(clientY)\n },\n pageX,\n pageY,\n target: domEvent.target,\n timestamp,\n touches,\n type: domEventType,\n },\n persist: emptyFunction,\n preventDefault,\n stopPropagation() {\n propagationWasStopped = true\n },\n target: domEvent.target,\n timeStamp: timestamp,\n touchHistory: responderTouchHistoryStore.touchHistory,\n }\n\n // Using getters and functions serves two purposes:\n // 1) The value of `currentTarget` is not initially available.\n // 2) Measuring the clientRect may cause layout jank and should only be done on-demand.\n function locationX(x) {\n rect = rect || getBoundingClientRect(responderEvent.currentTarget)\n if (rect) {\n return x - rect.left\n }\n }\n function locationY(y) {\n rect = rect || getBoundingClientRect(responderEvent.currentTarget)\n if (rect) {\n return y - rect.top\n }\n }\n\n return responderEvent as any\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,mBAAsC;AA2BtC,MAAM,gBAAgB,MAAM;AAAC;AAC7B,MAAM,cAAc,CAAC;AACrB,MAAM,aAAa,CAAC;AAOpB,SAAS,oBAAoB,YAAY;AACvC,SAAO,aAAa,KAAK,aAAa,KAAK;AAC7C;AAMe,SAAR,qBACL,UACA,4BACgB;AAChB,MAAI;AACJ,MAAI,wBAAwB;AAC5B,MAAI;AACJ,MAAI;AAEJ,QAAM,yBAAyB,SAAS;AACxC,QAAM,eAAe,SAAS;AAE9B,QAAM,UAAU,SAAS,YAAY;AACrC,QAAM,WAAW,SAAS,aAAa;AACvC,QAAM,SAAQ,iEAAyB,GAAG,UAAS;AACnD,QAAM,aAAa,qBAAoB,iEAAyB,GAAG,eAAc,CAAC;AAClF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AiB,WAAaA,IAAiB,YAC3CV,EACAwB,CACR,CAEA,MAAMC,EAAiB,CACrB,QAAS,GACT,WAAY,GAEZ,cAAe,KACf,iBAAkBtB,EAAS,iBAC3B,eAAgBJ,EAChB,WAAYI,EAAS,WACrB,oBAAqB,CACnB,OAAOA,EAAS,gBAClB,EACA,sBAAuB,CACrB,OAAOG,CACT,EACA,UAAWH,EAAS,UACpB,YAAa,CACX,OAAQ,GACR,QAAS,GACT,QAAAQ,EACA,SAAAC,EACA,eAAAL,EACA,MAAAM,EACA,WAAAX,EACA,IAAI,WAAY,CACd,OAAOoB,EAAUR,CAAO,CAC1B,EACA,IAAI,WAAY,CACd,OAAOS,EAAUR,CAAO,CAC1B,EACA,MAAAC,EACA,MAAAC,EACA,OAAQd,EAAS,OACjB,UAAAgB,EACA,QAAAX,EACA,KAAME,CACR,EACA,QAASZ,EACT,eAAAoB,EACA,iBAAkB,CAChBZ,EAAwB,EAC1B,EACA,OAAQH,EAAS,OACjB,UAAWgB,EACX,aAAcf,EAA2B,YAC3C,EAKA,SAASkB,EAAUI,EAAG,CAEpB,GADArB,EAAOA,MAAQ,yBAAsBoB,EAAe,aAAa,EAC7DpB,EACF,OAAOqB,EAAIrB,EAAK,IAEpB,CACA,SAASkB,EAAUI,EAAG,CAEpB,GADAtB,EAAOA,MAAQ,yBAAsBoB,EAAe,aAAa,EAC7DpB,EACF,OAAOsB,EAAItB,EAAK,GAEpB,CAEA,OAAOoB,CACT",
6
+ "names": ["createResponderEvent_exports", "__export", "createResponderEvent", "__toCommonJS", "import_utils", "emptyFunction", "emptyObject", "emptyArray", "normalizeIdentifier", "identifier", "domEvent", "responderTouchHistoryStore", "rect", "propagationWasStopped", "changedTouches", "touches", "domEventChangedTouches", "domEventType", "metaKey", "shiftKey", "force", "clientX", "clientY", "pageX", "pageY", "preventDefault", "timestamp", "normalizeTouches", "touch", "locationX", "locationY", "emulatedTouches", "responderEvent", "x", "y"]
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -1,19 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var src_exports = {};
17
- module.exports = __toCommonJS(src_exports);
18
- __reExport(src_exports, require("./useResponderEvents"), module.exports);
1
+ "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(r,o,f,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!d.call(r,e)&&e!==f&&a(r,e,{get:()=>o[e],enumerable:!(x=b(o,e))||x.enumerable});return r},t=(r,o,f)=>(p(r,o,"default"),f&&p(f,o,"default"));var g=r=>p(a({},"__esModule",{value:!0}),r);var m={};module.exports=g(m);t(m,require("./useResponderEvents"),module.exports);
19
2
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './useResponderEvents'\n"],
5
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,iCAAd;",
6
- "names": []
5
+ "mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,gCAAd",
6
+ "names": ["src_exports", "__toCommonJS", "__reExport"]
7
7
  }
package/dist/cjs/types.js CHANGED
@@ -1,98 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var types_exports = {};
20
- __export(types_exports, {
21
- BLUR: () => BLUR,
22
- CONTEXT_MENU: () => CONTEXT_MENU,
23
- FOCUS_OUT: () => FOCUS_OUT,
24
- MOUSE_CANCEL: () => MOUSE_CANCEL,
25
- MOUSE_DOWN: () => MOUSE_DOWN,
26
- MOUSE_MOVE: () => MOUSE_MOVE,
27
- MOUSE_UP: () => MOUSE_UP,
28
- SCROLL: () => SCROLL,
29
- SELECT: () => SELECT,
30
- SELECTION_CHANGE: () => SELECTION_CHANGE,
31
- TOUCH_CANCEL: () => TOUCH_CANCEL,
32
- TOUCH_END: () => TOUCH_END,
33
- TOUCH_MOVE: () => TOUCH_MOVE,
34
- TOUCH_START: () => TOUCH_START,
35
- isCancelish: () => isCancelish,
36
- isEndish: () => isEndish,
37
- isMoveish: () => isMoveish,
38
- isScroll: () => isScroll,
39
- isSelectionChange: () => isSelectionChange,
40
- isStartish: () => isStartish
41
- });
42
- module.exports = __toCommonJS(types_exports);
43
- const BLUR = "blur";
44
- const CONTEXT_MENU = "contextmenu";
45
- const FOCUS_OUT = "focusout";
46
- const MOUSE_DOWN = "mousedown";
47
- const MOUSE_MOVE = "mousemove";
48
- const MOUSE_UP = "mouseup";
49
- const MOUSE_CANCEL = "dragstart";
50
- const TOUCH_START = "touchstart";
51
- const TOUCH_MOVE = "touchmove";
52
- const TOUCH_END = "touchend";
53
- const TOUCH_CANCEL = "touchcancel";
54
- const SCROLL = "scroll";
55
- const SELECT = "select";
56
- const SELECTION_CHANGE = "selectionchange";
57
- function isStartish(eventType) {
58
- return eventType === TOUCH_START || eventType === MOUSE_DOWN;
59
- }
60
- function isMoveish(eventType) {
61
- return eventType === TOUCH_MOVE || eventType === MOUSE_MOVE;
62
- }
63
- function isEndish(eventType) {
64
- return eventType === TOUCH_END || eventType === MOUSE_UP || isCancelish(eventType);
65
- }
66
- function isCancelish(eventType) {
67
- return eventType === TOUCH_CANCEL || eventType === MOUSE_CANCEL;
68
- }
69
- function isScroll(eventType) {
70
- return eventType === SCROLL;
71
- }
72
- function isSelectionChange(eventType) {
73
- return eventType === SELECT || eventType === SELECTION_CHANGE;
74
- }
75
- // Annotate the CommonJS export names for ESM import in node:
76
- 0 && (module.exports = {
77
- BLUR,
78
- CONTEXT_MENU,
79
- FOCUS_OUT,
80
- MOUSE_CANCEL,
81
- MOUSE_DOWN,
82
- MOUSE_MOVE,
83
- MOUSE_UP,
84
- SCROLL,
85
- SELECT,
86
- SELECTION_CHANGE,
87
- TOUCH_CANCEL,
88
- TOUCH_END,
89
- TOUCH_MOVE,
90
- TOUCH_START,
91
- isCancelish,
92
- isEndish,
93
- isMoveish,
94
- isScroll,
95
- isSelectionChange,
96
- isStartish
97
- });
1
+ "use strict";var r=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var S=(o,n)=>{for(var e in n)r(o,e,{get:n[e],enumerable:!0})},_=(o,n,e,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of U(n))!f.call(o,t)&&t!==e&&r(o,t,{get:()=>n[t],enumerable:!(c=O(n,t))||c.enumerable});return o};var g=o=>_(r({},"__esModule",{value:!0}),o);var A={};S(A,{BLUR:()=>T,CONTEXT_MENU:()=>y,FOCUS_OUT:()=>M,MOUSE_CANCEL:()=>i,MOUSE_DOWN:()=>u,MOUSE_MOVE:()=>a,MOUSE_UP:()=>s,SCROLL:()=>m,SELECT:()=>h,SELECTION_CHANGE:()=>E,TOUCH_CANCEL:()=>b,TOUCH_END:()=>x,TOUCH_MOVE:()=>p,TOUCH_START:()=>l,isCancelish:()=>C,isEndish:()=>w,isMoveish:()=>d,isScroll:()=>L,isSelectionChange:()=>k,isStartish:()=>N});module.exports=g(A);const T="blur",y="contextmenu",M="focusout",u="mousedown",a="mousemove",s="mouseup",i="dragstart",l="touchstart",p="touchmove",x="touchend",b="touchcancel",m="scroll",h="select",E="selectionchange";function N(o){return o===l||o===u}function d(o){return o===p||o===a}function w(o){return o===x||o===s||C(o)}function C(o){return o===b||o===i}function L(o){return o===m}function k(o){return o===h||o===E}0&&(module.exports={BLUR,CONTEXT_MENU,FOCUS_OUT,MOUSE_CANCEL,MOUSE_DOWN,MOUSE_MOVE,MOUSE_UP,SCROLL,SELECT,SELECTION_CHANGE,TOUCH_CANCEL,TOUCH_END,TOUCH_MOVE,TOUCH_START,isCancelish,isEndish,isMoveish,isScroll,isSelectionChange,isStartish});
98
2
  //# sourceMappingURL=types.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/types.ts"],
4
4
  "sourcesContent": ["/**\n * Copyright (c) Nicolas Gallagher\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\nexport type Touch = {\n force: number\n identifier: number\n // The locationX and locationY properties are non-standard additions\n locationX: any\n locationY: any\n pageX: number\n pageY: number\n target: any\n // Touches in a list have a timestamp property\n timestamp: number\n}\n\nexport type TouchEvent = {\n altKey: boolean\n ctrlKey: boolean\n metaKey: boolean\n shiftKey: boolean\n // TouchList is an array in the Responder system\n changedTouches: Array<Touch>\n force: number\n // React Native adds properties to the \"nativeEvent that are usually only found on W3C Touches \u203E\\_(\u30C4)_/\u203E\n identifier: number\n locationX: any\n locationY: any\n pageX: number\n pageY: number\n target: any\n // The timestamp has a lowercase \"s\" in the Responder system\n timestamp: number\n // TouchList is an array in the Responder system\n touches: Array<Touch>\n}\n\nexport const BLUR = 'blur'\nexport const CONTEXT_MENU = 'contextmenu'\nexport const FOCUS_OUT = 'focusout'\nexport const MOUSE_DOWN = 'mousedown'\nexport const MOUSE_MOVE = 'mousemove'\nexport const MOUSE_UP = 'mouseup'\nexport const MOUSE_CANCEL = 'dragstart'\nexport const TOUCH_START = 'touchstart'\nexport const TOUCH_MOVE = 'touchmove'\nexport const TOUCH_END = 'touchend'\nexport const TOUCH_CANCEL = 'touchcancel'\nexport const SCROLL = 'scroll'\nexport const SELECT = 'select'\nexport const SELECTION_CHANGE = 'selectionchange'\n\nexport function isStartish(eventType: unknown): boolean {\n return eventType === TOUCH_START || eventType === MOUSE_DOWN\n}\n\nexport function isMoveish(eventType: unknown): boolean {\n return eventType === TOUCH_MOVE || eventType === MOUSE_MOVE\n}\n\nexport function isEndish(eventType: unknown): boolean {\n return eventType === TOUCH_END || eventType === MOUSE_UP || isCancelish(eventType)\n}\n\nexport function isCancelish(eventType: unknown): boolean {\n return eventType === TOUCH_CANCEL || eventType === MOUSE_CANCEL\n}\n\nexport function isScroll(eventType: unknown): boolean {\n return eventType === SCROLL\n}\n\nexport function isSelectionChange(eventType: unknown): boolean {\n return eventType === SELECT || eventType === SELECTION_CHANGE\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCO,MAAM,OAAO;AACb,MAAM,eAAe;AACrB,MAAM,YAAY;AAClB,MAAM,aAAa;AACnB,MAAM,aAAa;AACnB,MAAM,WAAW;AACjB,MAA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,GAAaU,IAAcf,GAAYQ,EAAYO,CAAS,CACnF,CAEO,SAASP,EAAYO,EAA6B,CACvD,OAAOA,IAAcX,GAAgBW,IAAclB,CACrD,CAEO,SAASc,EAASI,EAA6B,CACpD,OAAOA,IAAcd,CACvB,CAEO,SAASW,EAAkBG,EAA6B,CAC7D,OAAOA,IAAcb,GAAUa,IAAcZ,CAC/C",
6
+ "names": ["types_exports", "__export", "BLUR", "CONTEXT_MENU", "FOCUS_OUT", "MOUSE_CANCEL", "MOUSE_DOWN", "MOUSE_MOVE", "MOUSE_UP", "SCROLL", "SELECT", "SELECTION_CHANGE", "TOUCH_CANCEL", "TOUCH_END", "TOUCH_MOVE", "TOUCH_START", "isCancelish", "isEndish", "isMoveish", "isScroll", "isSelectionChange", "isStartish", "__toCommonJS", "eventType"]
7
7
  }