@tamagui/react-native-use-responder-events 2.0.0-rc.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/cjs/ResponderSystem.cjs +293 -152
  2. package/dist/cjs/ResponderSystem.native.js +312 -170
  3. package/dist/cjs/ResponderSystem.native.js.map +1 -1
  4. package/dist/cjs/ResponderTouchHistoryStore.cjs +97 -30
  5. package/dist/cjs/ResponderTouchHistoryStore.native.js +144 -68
  6. package/dist/cjs/ResponderTouchHistoryStore.native.js.map +1 -1
  7. package/dist/cjs/createResponderEvent.cjs +66 -52
  8. package/dist/cjs/createResponderEvent.native.js +51 -39
  9. package/dist/cjs/createResponderEvent.native.js.map +1 -1
  10. package/dist/cjs/index.cjs +7 -5
  11. package/dist/cjs/index.native.js +7 -5
  12. package/dist/cjs/index.native.js.map +1 -1
  13. package/dist/cjs/types.cjs +26 -24
  14. package/dist/cjs/types.native.js +26 -24
  15. package/dist/cjs/types.native.js.map +1 -1
  16. package/dist/cjs/useResponderEvents.cjs +49 -37
  17. package/dist/cjs/useResponderEvents.native.js +53 -42
  18. package/dist/cjs/useResponderEvents.native.js.map +1 -1
  19. package/dist/cjs/utils.cjs +101 -58
  20. package/dist/cjs/utils.native.js +104 -57
  21. package/dist/cjs/utils.native.js.map +1 -1
  22. package/dist/esm/ResponderSystem.mjs +276 -137
  23. package/dist/esm/ResponderSystem.mjs.map +1 -1
  24. package/dist/esm/ResponderSystem.native.js +295 -155
  25. package/dist/esm/ResponderSystem.native.js.map +1 -1
  26. package/dist/esm/ResponderTouchHistoryStore.mjs +85 -20
  27. package/dist/esm/ResponderTouchHistoryStore.mjs.map +1 -1
  28. package/dist/esm/ResponderTouchHistoryStore.native.js +132 -58
  29. package/dist/esm/ResponderTouchHistoryStore.native.js.map +1 -1
  30. package/dist/esm/createResponderEvent.mjs +54 -42
  31. package/dist/esm/createResponderEvent.mjs.map +1 -1
  32. package/dist/esm/createResponderEvent.native.js +38 -28
  33. package/dist/esm/createResponderEvent.native.js.map +1 -1
  34. package/dist/esm/index.js +1 -1
  35. package/dist/esm/index.js.map +1 -6
  36. package/dist/esm/types.mjs +14 -14
  37. package/dist/esm/types.mjs.map +1 -1
  38. package/dist/esm/types.native.js +14 -14
  39. package/dist/esm/types.native.js.map +1 -1
  40. package/dist/esm/useResponderEvents.mjs +21 -11
  41. package/dist/esm/useResponderEvents.mjs.map +1 -1
  42. package/dist/esm/useResponderEvents.native.js +25 -16
  43. package/dist/esm/useResponderEvents.native.js.map +1 -1
  44. package/dist/esm/utils.mjs +89 -48
  45. package/dist/esm/utils.mjs.map +1 -1
  46. package/dist/esm/utils.native.js +92 -47
  47. package/dist/esm/utils.native.js.map +1 -1
  48. package/package.json +4 -3
  49. package/dist/cjs/ResponderSystem.js +0 -205
  50. package/dist/cjs/ResponderSystem.js.map +0 -6
  51. package/dist/cjs/ResponderTouchHistoryStore.js +0 -117
  52. package/dist/cjs/ResponderTouchHistoryStore.js.map +0 -6
  53. package/dist/cjs/createResponderEvent.js +0 -121
  54. package/dist/cjs/createResponderEvent.js.map +0 -6
  55. package/dist/cjs/index.js +0 -15
  56. package/dist/cjs/index.js.map +0 -6
  57. package/dist/cjs/types.js +0 -58
  58. package/dist/cjs/types.js.map +0 -6
  59. package/dist/cjs/useResponderEvents.js +0 -81
  60. package/dist/cjs/useResponderEvents.js.map +0 -6
  61. package/dist/cjs/utils.js +0 -102
  62. package/dist/cjs/utils.js.map +0 -6
  63. package/dist/esm/ResponderSystem.js +0 -207
  64. package/dist/esm/ResponderSystem.js.map +0 -6
  65. package/dist/esm/ResponderTouchHistoryStore.js +0 -101
  66. package/dist/esm/ResponderTouchHistoryStore.js.map +0 -6
  67. package/dist/esm/createResponderEvent.js +0 -105
  68. package/dist/esm/createResponderEvent.js.map +0 -6
  69. package/dist/esm/types.js +0 -42
  70. package/dist/esm/types.js.map +0 -6
  71. package/dist/esm/useResponderEvents.js +0 -59
  72. package/dist/esm/useResponderEvents.js.map +0 -6
  73. package/dist/esm/utils.js +0 -86
  74. package/dist/esm/utils.js.map +0 -6
@@ -2,59 +2,71 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- },
20
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")),
21
- __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
27
- value: mod,
28
- enumerable: !0
29
- }) : target, mod)),
30
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
31
- value: !0
32
- }), mod);
19
+ }
20
+ return to;
21
+ };
22
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
+ value: mod,
30
+ enumerable: true
31
+ }) : target, mod));
32
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
33
+ value: true
34
+ }), mod);
33
35
  var useResponderEvents_exports = {};
34
36
  __export(useResponderEvents_exports, {
35
37
  getResponderConfigIfDefined: () => getResponderConfigIfDefined,
36
38
  useResponderEvents: () => useResponderEvents
37
39
  });
38
40
  module.exports = __toCommonJS(useResponderEvents_exports);
39
- var React = __toESM(require("react"), 1),
40
- ResponderSystem = __toESM(require("./ResponderSystem.cjs"), 1);
41
+ var React = __toESM(require("react"), 1);
42
+ var ResponderSystem = __toESM(require("./ResponderSystem.cjs"), 1);
41
43
  __reExport(useResponderEvents_exports, require("./utils.cjs"), module.exports);
42
- const emptyObject = {},
43
- Attached = /* @__PURE__ */new WeakMap(),
44
- Ids = /* @__PURE__ */new WeakMap();
44
+ const emptyObject = {};
45
+ const Attached = /* @__PURE__ */new WeakMap();
46
+ const Ids = /* @__PURE__ */new WeakMap();
45
47
  function useResponderEvents(hostRef, configIn = emptyObject) {
46
- const config = getResponderConfigIfDefined(configIn),
47
- node = hostRef?.current?.host || hostRef?.current;
48
+ const config = getResponderConfigIfDefined(configIn);
49
+ const node = hostRef?.current?.host || hostRef?.current;
48
50
  React.useEffect(() => {
49
51
  if (config === emptyObject) return;
50
- ResponderSystem.attachListeners(), Ids.has(hostRef) || Ids.set(hostRef, `${Math.random()}`);
52
+ ResponderSystem.attachListeners();
53
+ if (!Ids.has(hostRef)) {
54
+ Ids.set(hostRef, `${Math.random()}`);
55
+ }
51
56
  const id = Ids.get(hostRef);
52
- return ResponderSystem.addNode(id, node, config), Attached.set(hostRef, !0), () => {
53
- ResponderSystem.removeNode(node), Attached.set(hostRef, !1);
57
+ ResponderSystem.addNode(id, node, config);
58
+ Attached.set(hostRef, true);
59
+ return () => {
60
+ ResponderSystem.removeNode(node);
61
+ Attached.set(hostRef, false);
54
62
  };
55
- }, [config, hostRef]), process.env.NODE_ENV === "development" && (React.useDebugValue({
56
- isResponder: node === ResponderSystem.getResponderNode()
57
- }), React.useDebugValue(config));
63
+ }, [config, hostRef]);
64
+ if (process.env.NODE_ENV === "development") {
65
+ React.useDebugValue({
66
+ isResponder: node === ResponderSystem.getResponderNode()
67
+ });
68
+ React.useDebugValue(config);
69
+ }
58
70
  }
59
71
  function getResponderConfigIfDefined({
60
72
  onMoveShouldSetResponder,
@@ -4,62 +4,73 @@ var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf,
8
- __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: !0
13
- });
14
- },
15
- __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
18
  get: () => from[key],
18
19
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
20
  });
20
- return to;
21
- },
22
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")),
23
- __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
- value: mod,
30
- enumerable: !0
31
- }) : target, mod)),
32
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
33
- value: !0
34
- }), mod);
21
+ }
22
+ return to;
23
+ };
24
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ // If the importer is in node compatibility mode or this is not an ESM
27
+ // file that has been converted to a CommonJS file using a Babel-
28
+ // compatible transform (i.e. "__esModule" has not been set), then set
29
+ // "default" to the CommonJS "module.exports" for node compatibility.
30
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
31
+ value: mod,
32
+ enumerable: true
33
+ }) : target, mod));
34
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
35
+ value: true
36
+ }), mod);
35
37
  var useResponderEvents_exports = {};
36
38
  __export(useResponderEvents_exports, {
37
39
  getResponderConfigIfDefined: () => getResponderConfigIfDefined,
38
40
  useResponderEvents: () => useResponderEvents
39
41
  });
40
42
  module.exports = __toCommonJS(useResponderEvents_exports);
41
- var React = __toESM(require("react"), 1),
42
- ResponderSystem = __toESM(require("./ResponderSystem.native.js"), 1);
43
+ var React = __toESM(require("react"), 1);
44
+ var ResponderSystem = __toESM(require("./ResponderSystem.native.js"), 1);
43
45
  __reExport(useResponderEvents_exports, require("./utils.native.js"), module.exports);
44
- var emptyObject = {},
45
- Attached = /* @__PURE__ */new WeakMap(),
46
- Ids = /* @__PURE__ */new WeakMap();
46
+ var emptyObject = {};
47
+ var Attached = /* @__PURE__ */new WeakMap();
48
+ var Ids = /* @__PURE__ */new WeakMap();
47
49
  function useResponderEvents(hostRef) {
48
- var configIn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : emptyObject,
49
- _hostRef_current,
50
- config = getResponderConfigIfDefined(configIn),
51
- node = (hostRef == null || (_hostRef_current = hostRef.current) === null || _hostRef_current === void 0 ? void 0 : _hostRef_current.host) || hostRef?.current;
50
+ var configIn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : emptyObject;
51
+ var _hostRef_current;
52
+ var config = getResponderConfigIfDefined(configIn);
53
+ var node = (hostRef === null || hostRef === void 0 ? void 0 : (_hostRef_current = hostRef.current) === null || _hostRef_current === void 0 ? void 0 : _hostRef_current.host) || (hostRef === null || hostRef === void 0 ? void 0 : hostRef.current);
52
54
  React.useEffect(function () {
53
- if (config !== emptyObject) {
54
- ResponderSystem.attachListeners(), Ids.has(hostRef) || Ids.set(hostRef, `${Math.random()}`);
55
- var id = Ids.get(hostRef);
56
- return ResponderSystem.addNode(id, node, config), Attached.set(hostRef, !0), function () {
57
- ResponderSystem.removeNode(node), Attached.set(hostRef, !1);
58
- };
55
+ if (config === emptyObject) return;
56
+ ResponderSystem.attachListeners();
57
+ if (!Ids.has(hostRef)) {
58
+ Ids.set(hostRef, `${Math.random()}`);
59
59
  }
60
- }, [config, hostRef]), process.env.NODE_ENV === "development" && (React.useDebugValue({
61
- isResponder: node === ResponderSystem.getResponderNode()
62
- }), React.useDebugValue(config));
60
+ var id = Ids.get(hostRef);
61
+ ResponderSystem.addNode(id, node, config);
62
+ Attached.set(hostRef, true);
63
+ return function () {
64
+ ResponderSystem.removeNode(node);
65
+ Attached.set(hostRef, false);
66
+ };
67
+ }, [config, hostRef]);
68
+ if (process.env.NODE_ENV === "development") {
69
+ React.useDebugValue({
70
+ isResponder: node === ResponderSystem.getResponderNode()
71
+ });
72
+ React.useDebugValue(config);
73
+ }
63
74
  }
64
75
  function getResponderConfigIfDefined(param) {
65
76
  var {
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useResponderEvents_exports","__export","getResponderConfigIfDefined","useResponderEvents","module","exports","React","__toESM","require","ResponderSystem","__reExport","emptyObject","Attached","WeakMap","Ids","hostRef","configIn","arguments","length","_hostRef_current","config","node","current","host","useEffect","attachListeners","has","set","Math","random","id","get","addNode","removeNode","process","env","NODE_ENV","useDebugValue","isResponder","getResponderNode","param","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture"],"sources":["../../src/useResponderEvents.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,0BAAA;AAAAC,QAAA,CAAAD,0BAAA;EAAAE,2BAAA,EAAAA,CAAA,KAAAA,2BAAA;EAAAC,kBAAA,EAAAA,CAAA,KAAAA;AAAA;AAMAC,MAAA,CAAAC,OAAuB,GAAAV,YAAA,CAAAK,0BAEvB;AAEA,IAAAM,KAAA,GAAAC,OAAA,CAAAC,OAAA,YAAc;EAAAC,eAAA,GAVdF,OAAA,CAAAC,OAAA;AAYAE,UAAM,CAAAV,0BAEW,EA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IAAAC,gBAAA;IAAAC,eAAA;IAAAC,iBAAA;IAAAC,kBAAA;IAAAC,gBAAA;IAAAC,oBAAA;IAAAC,6BAAA;IAAAC,0BAAA;IAAAC,iCAAA;IAAAC,mCAAA;IAAAC,0CAAA;IAAAC,yBAAA;IAAAC;EAAA,IAAAhB,KAAA;EACA,OAAAC,wBAAA,IAAAC,+BAAA,IAAAC,cAAA,IAAAC,gBAAA,IAAAC,eAAA,IAAAC,iBAAA,IAAAC,kBAAA,IAAAC,gBAAA,IAAAC,oBAAA,IAAAC,6BAAA,IAAAC,0BAAA,IAAAC,iCAAA,IAAAC,mCAAA,IAAAC,0CAAA,IAAAC,yBAAA,IAAAC,gCAAA;IACAf,wBAAA;IACAC,+BAAA;IACAC,cAAA;IACAC,gBAAA;IACAC,eAAA;IACAC,iBAAA;IACAC,kBAAA;IACAC,gBAAA;IACAC,oBAAA;IACmEC,6BAAA;IACnEC,0BAAO;IAiBDC,iCAAA;IACAC,mCAAA;IACAC,0CAAA;IACAC,yBAAA;IACAC;EAAA,IACA7C,WAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useResponderEvents_exports","__export","getResponderConfigIfDefined","useResponderEvents","module","exports","React","__toESM","require","ResponderSystem","__reExport","emptyObject","Attached","WeakMap","Ids","hostRef","configIn","arguments","length","_hostRef_current","config","node","current","host","useEffect","attachListeners","has","set","Math","random","id","get","addNode","removeNode","process","env","NODE_ENV","useDebugValue","isResponder","getResponderNode","param","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture"],"sources":["../../src/useResponderEvents.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;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@@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var utils_exports = {};
22
24
  __export(utils_exports, {
@@ -31,37 +33,53 @@ __export(utils_exports, {
31
33
  setResponderId: () => setResponderId
32
34
  });
33
35
  module.exports = __toCommonJS(utils_exports);
34
- const keyName = "__reactResponderId",
35
- canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement),
36
- getBoundingClientRect = node => {
37
- if (node && node.nodeType === 1 && node.getBoundingClientRect) return node.getBoundingClientRect();
38
- };
36
+ const keyName = "__reactResponderId";
37
+ const canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
38
+ const getBoundingClientRect = node => {
39
+ if (!node) return;
40
+ if (node.nodeType !== 1) return;
41
+ if (node.getBoundingClientRect) {
42
+ return node.getBoundingClientRect();
43
+ }
44
+ };
39
45
  function getEventPath(domEvent) {
40
46
  if (domEvent.type === "selectionchange") {
41
47
  const target = window.getSelection()?.anchorNode;
42
48
  return composedPathFallback(target);
43
49
  }
44
- return domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
50
+ const path = domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
51
+ return path;
45
52
  }
46
53
  function composedPathFallback(target) {
47
54
  const path = [];
48
- for (; target != null && target !== document.body;) path.push(target), target = target.parentNode;
55
+ while (target != null && target !== document.body) {
56
+ path.push(target);
57
+ target = target.parentNode;
58
+ }
49
59
  return path;
50
60
  }
51
61
  function getResponderId(node) {
52
- return node != null ? node[keyName] : null;
62
+ if (node != null) {
63
+ return node[keyName];
64
+ }
65
+ return null;
53
66
  }
54
67
  function setResponderId(node, id) {
55
- node != null && (node[keyName] = id);
68
+ if (node != null) {
69
+ node[keyName] = id;
70
+ }
56
71
  }
57
72
  function getResponderPaths(domEvent) {
58
- const idPath = [],
59
- nodePath = [],
60
- eventPath = getEventPath(domEvent);
73
+ const idPath = [];
74
+ const nodePath = [];
75
+ const eventPath = getEventPath(domEvent);
61
76
  for (let i = 0; i < eventPath.length; i++) {
62
- const node = eventPath[i],
63
- id = getResponderId(node);
64
- id != null && (idPath.push(id), nodePath.push(node));
77
+ const node = eventPath[i];
78
+ const id = getResponderId(node);
79
+ if (id != null) {
80
+ idPath.push(id);
81
+ nodePath.push(node);
82
+ }
65
83
  }
66
84
  return {
67
85
  idPath,
@@ -69,58 +87,83 @@ function getResponderPaths(domEvent) {
69
87
  };
70
88
  }
71
89
  function getLowestCommonAncestor(pathA, pathB) {
72
- let pathALength = pathA.length,
73
- pathBLength = pathB.length;
90
+ let pathALength = pathA.length;
91
+ let pathBLength = pathB.length;
74
92
  if (
75
93
  // If either path is empty
76
94
  pathALength === 0 || pathBLength === 0 ||
77
95
  // If the last elements aren't the same there can't be a common ancestor
78
96
  // that is connected to the responder system
79
- pathA[pathALength - 1] !== pathB[pathBLength - 1]) return null;
80
- let itemA = pathA[0],
81
- indexA = 0,
82
- itemB = pathB[0],
83
- indexB = 0;
84
- pathALength - pathBLength > 0 && (indexA = pathALength - pathBLength, itemA = pathA[indexA], pathALength = pathBLength), pathBLength - pathALength > 0 && (indexB = pathBLength - pathALength, itemB = pathB[indexB], pathBLength = pathALength);
97
+ pathA[pathALength - 1] !== pathB[pathBLength - 1]) {
98
+ return null;
99
+ }
100
+ let itemA = pathA[0];
101
+ let indexA = 0;
102
+ let itemB = pathB[0];
103
+ let indexB = 0;
104
+ if (pathALength - pathBLength > 0) {
105
+ indexA = pathALength - pathBLength;
106
+ itemA = pathA[indexA];
107
+ pathALength = pathBLength;
108
+ }
109
+ if (pathBLength - pathALength > 0) {
110
+ indexB = pathBLength - pathALength;
111
+ itemB = pathB[indexB];
112
+ pathBLength = pathALength;
113
+ }
85
114
  let depth = pathALength;
86
- for (; depth--;) {
87
- if (itemA === itemB) return itemA;
88
- itemA = pathA[indexA++], itemB = pathB[indexB++];
115
+ while (depth--) {
116
+ if (itemA === itemB) {
117
+ return itemA;
118
+ }
119
+ itemA = pathA[indexA++];
120
+ itemB = pathB[indexB++];
89
121
  }
90
122
  return null;
91
123
  }
92
124
  function hasTargetTouches(target, touches) {
93
- if (!touches || touches.length === 0) return !1;
125
+ if (!touches || touches.length === 0) {
126
+ return false;
127
+ }
94
128
  for (let i = 0; i < touches.length; i++) {
95
129
  const node = touches[i].target;
96
- if (node != null && target.contains(node)) return !0;
130
+ if (node != null) {
131
+ if (target.contains(node)) {
132
+ return true;
133
+ }
134
+ }
97
135
  }
98
- return !1;
136
+ return false;
99
137
  }
100
138
  function hasValidSelection(domEvent) {
101
- return domEvent.type === "selectionchange" ? isSelectionValid() : domEvent.type === "select";
139
+ if (domEvent.type === "selectionchange") {
140
+ return isSelectionValid();
141
+ }
142
+ return domEvent.type === "select";
102
143
  }
103
144
  function isPrimaryPointerDown(domEvent) {
104
145
  const {
105
- altKey,
106
- button,
107
- buttons,
108
- ctrlKey,
109
- type
110
- } = domEvent,
111
- isTouch = type === "touchstart" || type === "touchmove",
112
- isPrimaryMouseDown = type === "mousedown" && (button === 0 || buttons === 1),
113
- isPrimaryMouseMove = type === "mousemove" && buttons === 1,
114
- noModifiers = altKey === !1 && ctrlKey === !1;
115
- return !!(isTouch || isPrimaryMouseDown && noModifiers || isPrimaryMouseMove && noModifiers);
146
+ altKey,
147
+ button,
148
+ buttons,
149
+ ctrlKey,
150
+ type
151
+ } = domEvent;
152
+ const isTouch = type === "touchstart" || type === "touchmove";
153
+ const isPrimaryMouseDown = type === "mousedown" && (button === 0 || buttons === 1);
154
+ const isPrimaryMouseMove = type === "mousemove" && buttons === 1;
155
+ const noModifiers = altKey === false && ctrlKey === false;
156
+ if (isTouch || isPrimaryMouseDown && noModifiers || isPrimaryMouseMove && noModifiers) {
157
+ return true;
158
+ }
159
+ return false;
116
160
  }
117
161
  function isSelectionValid() {
118
162
  const selection = window.getSelection();
119
- if (!selection) return !1;
120
- const string = selection.toString(),
121
- anchorNode = selection.anchorNode,
122
- focusNode = selection.focusNode,
123
- isTextNode = anchorNode && anchorNode.nodeType === window.Node.TEXT_NODE || focusNode && focusNode.nodeType === window.Node.TEXT_NODE;
124
- return string.length >= 1 && string !== `
125
- ` && !!isTextNode;
163
+ if (!selection) return false;
164
+ const string = selection.toString();
165
+ const anchorNode = selection.anchorNode;
166
+ const focusNode = selection.focusNode;
167
+ const isTextNode = anchorNode && anchorNode.nodeType === window.Node.TEXT_NODE || focusNode && focusNode.nodeType === window.Node.TEXT_NODE;
168
+ return string.length >= 1 && string !== "\n" && !!isTextNode;
126
169
  }