@hanzogui/floating 2.0.0-rc.41-hanzoai.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cjs/Floating.cjs +20 -0
- package/dist/cjs/Floating.native.js +39 -0
- package/dist/cjs/Floating.native.js.map +1 -0
- package/dist/cjs/index.cjs +73 -0
- package/dist/cjs/index.native.js +76 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/interactions/PopupTriggerMap.cjs +49 -0
- package/dist/cjs/interactions/PopupTriggerMap.native.js +97 -0
- package/dist/cjs/interactions/PopupTriggerMap.native.js.map +1 -0
- package/dist/cjs/interactions/createFloatingEvents.cjs +50 -0
- package/dist/cjs/interactions/createFloatingEvents.native.js +56 -0
- package/dist/cjs/interactions/createFloatingEvents.native.js.map +1 -0
- package/dist/cjs/interactions/safePolygon.cjs +273 -0
- package/dist/cjs/interactions/safePolygon.native.js +284 -0
- package/dist/cjs/interactions/safePolygon.native.js.map +1 -0
- package/dist/cjs/interactions/types.cjs +18 -0
- package/dist/cjs/interactions/types.native.js +21 -0
- package/dist/cjs/interactions/types.native.js.map +1 -0
- package/dist/cjs/interactions/useClick.cjs +124 -0
- package/dist/cjs/interactions/useClick.native.js +132 -0
- package/dist/cjs/interactions/useClick.native.js.map +1 -0
- package/dist/cjs/interactions/useDelayGroup.cjs +115 -0
- package/dist/cjs/interactions/useDelayGroup.native.js +125 -0
- package/dist/cjs/interactions/useDelayGroup.native.js.map +1 -0
- package/dist/cjs/interactions/useFocus.cjs +130 -0
- package/dist/cjs/interactions/useFocus.native.js +139 -0
- package/dist/cjs/interactions/useFocus.native.js.map +1 -0
- package/dist/cjs/interactions/useHover.cjs +357 -0
- package/dist/cjs/interactions/useHover.native.js +373 -0
- package/dist/cjs/interactions/useHover.native.js.map +1 -0
- package/dist/cjs/interactions/useInnerOffset.cjs +128 -0
- package/dist/cjs/interactions/useInnerOffset.native.js +141 -0
- package/dist/cjs/interactions/useInnerOffset.native.js.map +1 -0
- package/dist/cjs/interactions/useInteractions.cjs +105 -0
- package/dist/cjs/interactions/useInteractions.native.js +216 -0
- package/dist/cjs/interactions/useInteractions.native.js.map +1 -0
- package/dist/cjs/interactions/useListNavigation.cjs +418 -0
- package/dist/cjs/interactions/useListNavigation.native.js +433 -0
- package/dist/cjs/interactions/useListNavigation.native.js.map +1 -0
- package/dist/cjs/interactions/useRole.cjs +122 -0
- package/dist/cjs/interactions/useRole.native.js +136 -0
- package/dist/cjs/interactions/useRole.native.js.map +1 -0
- package/dist/cjs/interactions/useTypeahead.cjs +143 -0
- package/dist/cjs/interactions/useTypeahead.native.js +159 -0
- package/dist/cjs/interactions/useTypeahead.native.js.map +1 -0
- package/dist/cjs/interactions/utils.cjs +208 -0
- package/dist/cjs/interactions/utils.native.js +227 -0
- package/dist/cjs/interactions/utils.native.js.map +1 -0
- package/dist/cjs/middleware/inner.cjs +118 -0
- package/dist/cjs/middleware/inner.native.js +130 -0
- package/dist/cjs/middleware/inner.native.js.map +1 -0
- package/dist/cjs/useFloating.cjs +64 -0
- package/dist/cjs/useFloating.native.js +69 -0
- package/dist/cjs/useFloating.native.js.map +1 -0
- package/dist/esm/Floating.mjs +2 -0
- package/dist/esm/Floating.mjs.map +1 -0
- package/dist/esm/Floating.native.js +8 -0
- package/dist/esm/Floating.native.js.map +1 -0
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.mjs +18 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +18 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/esm/interactions/PopupTriggerMap.mjs +24 -0
- package/dist/esm/interactions/PopupTriggerMap.mjs.map +1 -0
- package/dist/esm/interactions/PopupTriggerMap.native.js +69 -0
- package/dist/esm/interactions/PopupTriggerMap.native.js.map +1 -0
- package/dist/esm/interactions/createFloatingEvents.mjs +25 -0
- package/dist/esm/interactions/createFloatingEvents.mjs.map +1 -0
- package/dist/esm/interactions/createFloatingEvents.native.js +28 -0
- package/dist/esm/interactions/createFloatingEvents.native.js.map +1 -0
- package/dist/esm/interactions/safePolygon.mjs +248 -0
- package/dist/esm/interactions/safePolygon.mjs.map +1 -0
- package/dist/esm/interactions/safePolygon.native.js +256 -0
- package/dist/esm/interactions/safePolygon.native.js.map +1 -0
- package/dist/esm/interactions/types.mjs +2 -0
- package/dist/esm/interactions/types.mjs.map +1 -0
- package/dist/esm/interactions/types.native.js +2 -0
- package/dist/esm/interactions/types.native.js.map +1 -0
- package/dist/esm/interactions/useClick.mjs +99 -0
- package/dist/esm/interactions/useClick.mjs.map +1 -0
- package/dist/esm/interactions/useClick.native.js +104 -0
- package/dist/esm/interactions/useClick.native.js.map +1 -0
- package/dist/esm/interactions/useDelayGroup.mjs +77 -0
- package/dist/esm/interactions/useDelayGroup.mjs.map +1 -0
- package/dist/esm/interactions/useDelayGroup.native.js +84 -0
- package/dist/esm/interactions/useDelayGroup.native.js.map +1 -0
- package/dist/esm/interactions/useFocus.mjs +105 -0
- package/dist/esm/interactions/useFocus.mjs.map +1 -0
- package/dist/esm/interactions/useFocus.native.js +111 -0
- package/dist/esm/interactions/useFocus.native.js.map +1 -0
- package/dist/esm/interactions/useHover.mjs +320 -0
- package/dist/esm/interactions/useHover.mjs.map +1 -0
- package/dist/esm/interactions/useHover.native.js +333 -0
- package/dist/esm/interactions/useHover.native.js.map +1 -0
- package/dist/esm/interactions/useInnerOffset.mjs +92 -0
- package/dist/esm/interactions/useInnerOffset.mjs.map +1 -0
- package/dist/esm/interactions/useInnerOffset.native.js +102 -0
- package/dist/esm/interactions/useInnerOffset.native.js.map +1 -0
- package/dist/esm/interactions/useInteractions.mjs +80 -0
- package/dist/esm/interactions/useInteractions.mjs.map +1 -0
- package/dist/esm/interactions/useInteractions.native.js +188 -0
- package/dist/esm/interactions/useInteractions.native.js.map +1 -0
- package/dist/esm/interactions/useListNavigation.mjs +393 -0
- package/dist/esm/interactions/useListNavigation.mjs.map +1 -0
- package/dist/esm/interactions/useListNavigation.native.js +405 -0
- package/dist/esm/interactions/useListNavigation.native.js.map +1 -0
- package/dist/esm/interactions/useRole.mjs +86 -0
- package/dist/esm/interactions/useRole.mjs.map +1 -0
- package/dist/esm/interactions/useRole.native.js +97 -0
- package/dist/esm/interactions/useRole.native.js.map +1 -0
- package/dist/esm/interactions/useTypeahead.mjs +118 -0
- package/dist/esm/interactions/useTypeahead.mjs.map +1 -0
- package/dist/esm/interactions/useTypeahead.native.js +131 -0
- package/dist/esm/interactions/useTypeahead.native.js.map +1 -0
- package/dist/esm/interactions/utils.mjs +162 -0
- package/dist/esm/interactions/utils.mjs.map +1 -0
- package/dist/esm/interactions/utils.native.js +178 -0
- package/dist/esm/interactions/utils.native.js.map +1 -0
- package/dist/esm/middleware/inner.mjs +82 -0
- package/dist/esm/middleware/inner.mjs.map +1 -0
- package/dist/esm/middleware/inner.native.js +91 -0
- package/dist/esm/middleware/inner.native.js.map +1 -0
- package/dist/esm/useFloating.mjs +27 -0
- package/dist/esm/useFloating.mjs.map +1 -0
- package/dist/esm/useFloating.native.js +29 -0
- package/dist/esm/useFloating.native.js.map +1 -0
- package/package.json +50 -0
- package/src/Floating.native.tsx +45 -0
- package/src/Floating.tsx +1 -0
- package/src/index.ts +116 -0
- package/src/interactions/PopupTriggerMap.ts +30 -0
- package/src/interactions/createFloatingEvents.ts +34 -0
- package/src/interactions/safePolygon.ts +500 -0
- package/src/interactions/types.ts +165 -0
- package/src/interactions/useClick.ts +148 -0
- package/src/interactions/useDelayGroup.ts +114 -0
- package/src/interactions/useFocus.ts +164 -0
- package/src/interactions/useHover.ts +453 -0
- package/src/interactions/useInnerOffset.ts +116 -0
- package/src/interactions/useInteractions.ts +101 -0
- package/src/interactions/useListNavigation.ts +578 -0
- package/src/interactions/useRole.ts +103 -0
- package/src/interactions/useTypeahead.ts +173 -0
- package/src/interactions/utils.ts +234 -0
- package/src/middleware/inner.ts +141 -0
- package/src/useFloating.tsx +53 -0
- package/types/Floating.d.ts +2 -0
- package/types/Floating.d.ts.map +1 -0
- package/types/Floating.native.d.ts +41 -0
- package/types/Floating.native.d.ts.map +1 -0
- package/types/index.d.ts +19 -0
- package/types/index.d.ts.map +1 -0
- package/types/interactions/PopupTriggerMap.d.ts +8 -0
- package/types/interactions/PopupTriggerMap.d.ts.map +1 -0
- package/types/interactions/createFloatingEvents.d.ts +7 -0
- package/types/interactions/createFloatingEvents.d.ts.map +1 -0
- package/types/interactions/safePolygon.d.ts +4 -0
- package/types/interactions/safePolygon.d.ts.map +1 -0
- package/types/interactions/types.d.ts +123 -0
- package/types/interactions/types.d.ts.map +1 -0
- package/types/interactions/useClick.d.ts +3 -0
- package/types/interactions/useClick.d.ts.map +1 -0
- package/types/interactions/useDelayGroup.d.ts +23 -0
- package/types/interactions/useDelayGroup.d.ts.map +1 -0
- package/types/interactions/useFocus.d.ts +3 -0
- package/types/interactions/useFocus.d.ts.map +1 -0
- package/types/interactions/useHover.d.ts +6 -0
- package/types/interactions/useHover.d.ts.map +1 -0
- package/types/interactions/useInnerOffset.d.ts +3 -0
- package/types/interactions/useInnerOffset.d.ts.map +1 -0
- package/types/interactions/useInteractions.d.ts +8 -0
- package/types/interactions/useInteractions.d.ts.map +1 -0
- package/types/interactions/useListNavigation.d.ts +3 -0
- package/types/interactions/useListNavigation.d.ts.map +1 -0
- package/types/interactions/useRole.d.ts +3 -0
- package/types/interactions/useRole.d.ts.map +1 -0
- package/types/interactions/useTypeahead.d.ts +3 -0
- package/types/interactions/useTypeahead.d.ts.map +1 -0
- package/types/interactions/utils.d.ts +46 -0
- package/types/interactions/utils.d.ts.map +1 -0
- package/types/middleware/inner.d.ts +14 -0
- package/types/middleware/inner.d.ts.map +1 -0
- package/types/useFloating.d.ts +28 -0
- package/types/useFloating.d.ts.map +1 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
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, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var safePolygon_exports = {};
|
|
24
|
+
__export(safePolygon_exports, {
|
|
25
|
+
safePolygon: () => safePolygon
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(safePolygon_exports);
|
|
28
|
+
var import_utils = require("./utils.cjs");
|
|
29
|
+
function isPointInPolygon(point, polygon) {
|
|
30
|
+
const [x, y] = point;
|
|
31
|
+
let isInside2 = false;
|
|
32
|
+
const length = polygon.length;
|
|
33
|
+
for (let i = 0, j = length - 1; i < length; j = i++) {
|
|
34
|
+
const [xi, yi] = polygon[i] || [0, 0];
|
|
35
|
+
const [xj, yj] = polygon[j] || [0, 0];
|
|
36
|
+
const intersect = yi >= y !== yj >= y && x <= (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
37
|
+
if (intersect) {
|
|
38
|
+
isInside2 = !isInside2;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return isInside2;
|
|
42
|
+
}
|
|
43
|
+
function isInside(point, rect) {
|
|
44
|
+
return point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height;
|
|
45
|
+
}
|
|
46
|
+
let debugSvg = null;
|
|
47
|
+
function debugDrawPolygon(polygon, trough, cursor, anchor) {
|
|
48
|
+
if (!debugSvg) {
|
|
49
|
+
debugSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
50
|
+
debugSvg.id = "__safe-polygon-debug";
|
|
51
|
+
Object.assign(debugSvg.style, {
|
|
52
|
+
position: "fixed",
|
|
53
|
+
inset: "0",
|
|
54
|
+
width: "100vw",
|
|
55
|
+
height: "100vh",
|
|
56
|
+
pointerEvents: "none",
|
|
57
|
+
zIndex: "999999"
|
|
58
|
+
});
|
|
59
|
+
document.body.appendChild(debugSvg);
|
|
60
|
+
}
|
|
61
|
+
debugSvg.innerHTML = "";
|
|
62
|
+
if (trough.length) {
|
|
63
|
+
const troughEl = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
|
|
64
|
+
troughEl.setAttribute("points", trough.map(p => p.join(",")).join(" "));
|
|
65
|
+
troughEl.setAttribute("fill", "rgba(0,100,255,0.15)");
|
|
66
|
+
troughEl.setAttribute("stroke", "rgba(0,100,255,0.6)");
|
|
67
|
+
troughEl.setAttribute("stroke-width", "1");
|
|
68
|
+
debugSvg.appendChild(troughEl);
|
|
69
|
+
}
|
|
70
|
+
if (polygon.length) {
|
|
71
|
+
const polyEl = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
|
|
72
|
+
polyEl.setAttribute("points", polygon.map(p => p.join(",")).join(" "));
|
|
73
|
+
polyEl.setAttribute("fill", "rgba(255,50,50,0.2)");
|
|
74
|
+
polyEl.setAttribute("stroke", "rgba(255,50,50,0.8)");
|
|
75
|
+
polyEl.setAttribute("stroke-width", "1.5");
|
|
76
|
+
debugSvg.appendChild(polyEl);
|
|
77
|
+
}
|
|
78
|
+
const anchorCircle = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
79
|
+
anchorCircle.setAttribute("cx", String(anchor[0]));
|
|
80
|
+
anchorCircle.setAttribute("cy", String(anchor[1]));
|
|
81
|
+
anchorCircle.setAttribute("r", "5");
|
|
82
|
+
anchorCircle.setAttribute("fill", "lime");
|
|
83
|
+
anchorCircle.setAttribute("stroke", "darkgreen");
|
|
84
|
+
anchorCircle.setAttribute("stroke-width", "1.5");
|
|
85
|
+
debugSvg.appendChild(anchorCircle);
|
|
86
|
+
const cursorCircle = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
87
|
+
cursorCircle.setAttribute("cx", String(cursor[0]));
|
|
88
|
+
cursorCircle.setAttribute("cy", String(cursor[1]));
|
|
89
|
+
cursorCircle.setAttribute("r", "4");
|
|
90
|
+
cursorCircle.setAttribute("fill", "yellow");
|
|
91
|
+
cursorCircle.setAttribute("stroke", "orange");
|
|
92
|
+
cursorCircle.setAttribute("stroke-width", "1.5");
|
|
93
|
+
debugSvg.appendChild(cursorCircle);
|
|
94
|
+
}
|
|
95
|
+
function debugClear() {
|
|
96
|
+
if (debugSvg) {
|
|
97
|
+
debugSvg.remove();
|
|
98
|
+
debugSvg = null;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function safePolygon(options = {}) {
|
|
102
|
+
const {
|
|
103
|
+
buffer = 0.5,
|
|
104
|
+
blockPointerEvents = false,
|
|
105
|
+
requireIntent = true,
|
|
106
|
+
__debug = false
|
|
107
|
+
} = options;
|
|
108
|
+
const timeoutRef = {
|
|
109
|
+
current: -1
|
|
110
|
+
};
|
|
111
|
+
let hasLanded = false;
|
|
112
|
+
let lastX = null;
|
|
113
|
+
let lastY = null;
|
|
114
|
+
let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0;
|
|
115
|
+
function getCursorSpeed(x, y) {
|
|
116
|
+
const currentTime = performance.now();
|
|
117
|
+
const elapsedTime = currentTime - lastCursorTime;
|
|
118
|
+
if (lastX === null || lastY === null || elapsedTime === 0) {
|
|
119
|
+
lastX = x;
|
|
120
|
+
lastY = y;
|
|
121
|
+
lastCursorTime = currentTime;
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
const deltaX = x - lastX;
|
|
125
|
+
const deltaY = y - lastY;
|
|
126
|
+
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
127
|
+
const speed = distance / elapsedTime;
|
|
128
|
+
lastX = x;
|
|
129
|
+
lastY = y;
|
|
130
|
+
lastCursorTime = currentTime;
|
|
131
|
+
return speed;
|
|
132
|
+
}
|
|
133
|
+
const fn = ({
|
|
134
|
+
x,
|
|
135
|
+
y,
|
|
136
|
+
placement,
|
|
137
|
+
elements,
|
|
138
|
+
onClose
|
|
139
|
+
}) => {
|
|
140
|
+
hasLanded = false;
|
|
141
|
+
lastX = null;
|
|
142
|
+
lastY = null;
|
|
143
|
+
return function onMouseMove(event) {
|
|
144
|
+
function close() {
|
|
145
|
+
(0, import_utils.clearTimeoutIfSet)(timeoutRef);
|
|
146
|
+
onClose();
|
|
147
|
+
}
|
|
148
|
+
(0, import_utils.clearTimeoutIfSet)(timeoutRef);
|
|
149
|
+
const domReference = elements.domReference ?? elements.reference;
|
|
150
|
+
if (!domReference || !elements.floating || placement == null || x == null || y == null) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const {
|
|
154
|
+
clientX,
|
|
155
|
+
clientY
|
|
156
|
+
} = event;
|
|
157
|
+
const clientPoint = [clientX, clientY];
|
|
158
|
+
const target = (0, import_utils.getTarget)(event);
|
|
159
|
+
const isLeave = event.type === "mouseleave";
|
|
160
|
+
const isOverFloatingEl = (0, import_utils.contains)(elements.floating, target);
|
|
161
|
+
const isOverReferenceEl = (0, import_utils.contains)(domReference, target);
|
|
162
|
+
const refRect = domReference.getBoundingClientRect();
|
|
163
|
+
const rect = elements.floating.getBoundingClientRect();
|
|
164
|
+
const side = placement.split("-")[0];
|
|
165
|
+
const cursorLeaveFromRight = x > rect.right - rect.width / 2;
|
|
166
|
+
const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;
|
|
167
|
+
const isOverReferenceRect = isInside(clientPoint, refRect);
|
|
168
|
+
const isFloatingWider = rect.width > refRect.width;
|
|
169
|
+
const isFloatingTaller = rect.height > refRect.height;
|
|
170
|
+
const left = (isFloatingWider ? refRect : rect).left;
|
|
171
|
+
const right = (isFloatingWider ? refRect : rect).right;
|
|
172
|
+
const top = (isFloatingTaller ? refRect : rect).top;
|
|
173
|
+
const bottom = (isFloatingTaller ? refRect : rect).bottom;
|
|
174
|
+
if (isOverFloatingEl) {
|
|
175
|
+
hasLanded = true;
|
|
176
|
+
if (!isLeave) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (isOverReferenceEl) {
|
|
181
|
+
hasLanded = false;
|
|
182
|
+
}
|
|
183
|
+
if (isOverReferenceEl && !isLeave) {
|
|
184
|
+
hasLanded = true;
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (!isOverReferenceEl && isOverReferenceRect && !isLeave) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (isLeave && event.relatedTarget && (0, import_utils.contains)(elements.floating, event.relatedTarget)) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (side === "top" && y >= refRect.bottom - 1 || side === "bottom" && y <= refRect.top + 1 || side === "left" && x >= refRect.right - 1 || side === "right" && x <= refRect.left + 1) {
|
|
194
|
+
return close();
|
|
195
|
+
}
|
|
196
|
+
let rectPoly = [];
|
|
197
|
+
switch (side) {
|
|
198
|
+
case "top":
|
|
199
|
+
rectPoly = [[left, refRect.top + 1], [left, rect.bottom - 1], [right, rect.bottom - 1], [right, refRect.top + 1]];
|
|
200
|
+
break;
|
|
201
|
+
case "bottom":
|
|
202
|
+
rectPoly = [[left, rect.top + 1], [left, refRect.bottom - 1], [right, refRect.bottom - 1], [right, rect.top + 1]];
|
|
203
|
+
break;
|
|
204
|
+
case "left":
|
|
205
|
+
rectPoly = [[rect.right - 1, bottom], [rect.right - 1, top], [refRect.left + 1, top], [refRect.left + 1, bottom]];
|
|
206
|
+
break;
|
|
207
|
+
case "right":
|
|
208
|
+
rectPoly = [[refRect.right - 1, bottom], [refRect.right - 1, top], [rect.left + 1, top], [rect.left + 1, bottom]];
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
function getPolygon([x2, y2]) {
|
|
212
|
+
switch (side) {
|
|
213
|
+
case "top":
|
|
214
|
+
{
|
|
215
|
+
const cursorPointOne = [isFloatingWider ? x2 + buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 + buffer + 1];
|
|
216
|
+
const cursorPointTwo = [isFloatingWider ? x2 - buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 + buffer + 1];
|
|
217
|
+
const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]];
|
|
218
|
+
return [cursorPointOne, cursorPointTwo, ...commonPoints];
|
|
219
|
+
}
|
|
220
|
+
case "bottom":
|
|
221
|
+
{
|
|
222
|
+
const cursorPointOne = [isFloatingWider ? x2 + buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 - buffer];
|
|
223
|
+
const cursorPointTwo = [isFloatingWider ? x2 - buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 - buffer];
|
|
224
|
+
const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]];
|
|
225
|
+
return [cursorPointOne, cursorPointTwo, ...commonPoints];
|
|
226
|
+
}
|
|
227
|
+
case "left":
|
|
228
|
+
{
|
|
229
|
+
const cursorPointOne = [x2 + buffer + 1, isFloatingTaller ? y2 + buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
230
|
+
const cursorPointTwo = [x2 + buffer + 1, isFloatingTaller ? y2 - buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
231
|
+
const commonPoints = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]];
|
|
232
|
+
return [...commonPoints, cursorPointOne, cursorPointTwo];
|
|
233
|
+
}
|
|
234
|
+
case "right":
|
|
235
|
+
{
|
|
236
|
+
const cursorPointOne = [x2 - buffer, isFloatingTaller ? y2 + buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
237
|
+
const cursorPointTwo = [x2 - buffer, isFloatingTaller ? y2 - buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
238
|
+
const commonPoints = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]];
|
|
239
|
+
return [cursorPointOne, cursorPointTwo, ...commonPoints];
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
const poly = getPolygon([x, y]);
|
|
244
|
+
if (__debug) {
|
|
245
|
+
debugDrawPolygon(poly, rectPoly, clientPoint, [x, y]);
|
|
246
|
+
}
|
|
247
|
+
if (isPointInPolygon([clientX, clientY], rectPoly)) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (hasLanded && !isOverReferenceRect) {
|
|
251
|
+
if (__debug) debugClear();
|
|
252
|
+
return close();
|
|
253
|
+
}
|
|
254
|
+
if (isPointInPolygon([clientX, clientY], poly)) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
if (!isLeave && requireIntent) {
|
|
258
|
+
const cursorSpeed = getCursorSpeed(clientX, clientY);
|
|
259
|
+
const cursorSpeedThreshold = 0.1;
|
|
260
|
+
if (cursorSpeed !== null && cursorSpeed < cursorSpeedThreshold) {
|
|
261
|
+
if (__debug) debugClear();
|
|
262
|
+
return close();
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (__debug) debugClear();
|
|
266
|
+
close();
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
fn.__options = {
|
|
270
|
+
blockPointerEvents
|
|
271
|
+
};
|
|
272
|
+
return fn;
|
|
273
|
+
}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
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, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var safePolygon_exports = {};
|
|
26
|
+
__export(safePolygon_exports, {
|
|
27
|
+
safePolygon: () => safePolygon
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(safePolygon_exports);
|
|
30
|
+
var import_utils = require("./utils.native.js");
|
|
31
|
+
function isPointInPolygon(point, polygon) {
|
|
32
|
+
var [x, y] = point;
|
|
33
|
+
var isInside2 = false;
|
|
34
|
+
var length = polygon.length;
|
|
35
|
+
for (var i = 0, j = length - 1; i < length; j = i++) {
|
|
36
|
+
var [xi, yi] = polygon[i] || [0, 0];
|
|
37
|
+
var [xj, yj] = polygon[j] || [0, 0];
|
|
38
|
+
var intersect = yi >= y !== yj >= y && x <= (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
39
|
+
if (intersect) {
|
|
40
|
+
isInside2 = !isInside2;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return isInside2;
|
|
44
|
+
}
|
|
45
|
+
function isInside(point, rect) {
|
|
46
|
+
return point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height;
|
|
47
|
+
}
|
|
48
|
+
var debugSvg = null;
|
|
49
|
+
function debugDrawPolygon(polygon, trough, cursor, anchor) {
|
|
50
|
+
if (!debugSvg) {
|
|
51
|
+
debugSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
52
|
+
debugSvg.id = "__safe-polygon-debug";
|
|
53
|
+
Object.assign(debugSvg.style, {
|
|
54
|
+
position: "fixed",
|
|
55
|
+
inset: "0",
|
|
56
|
+
width: "100vw",
|
|
57
|
+
height: "100vh",
|
|
58
|
+
pointerEvents: "none",
|
|
59
|
+
zIndex: "999999"
|
|
60
|
+
});
|
|
61
|
+
document.body.appendChild(debugSvg);
|
|
62
|
+
}
|
|
63
|
+
debugSvg.innerHTML = "";
|
|
64
|
+
if (trough.length) {
|
|
65
|
+
var troughEl = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
|
|
66
|
+
troughEl.setAttribute("points", trough.map(function (p) {
|
|
67
|
+
return p.join(",");
|
|
68
|
+
}).join(" "));
|
|
69
|
+
troughEl.setAttribute("fill", "rgba(0,100,255,0.15)");
|
|
70
|
+
troughEl.setAttribute("stroke", "rgba(0,100,255,0.6)");
|
|
71
|
+
troughEl.setAttribute("stroke-width", "1");
|
|
72
|
+
debugSvg.appendChild(troughEl);
|
|
73
|
+
}
|
|
74
|
+
if (polygon.length) {
|
|
75
|
+
var polyEl = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
|
|
76
|
+
polyEl.setAttribute("points", polygon.map(function (p) {
|
|
77
|
+
return p.join(",");
|
|
78
|
+
}).join(" "));
|
|
79
|
+
polyEl.setAttribute("fill", "rgba(255,50,50,0.2)");
|
|
80
|
+
polyEl.setAttribute("stroke", "rgba(255,50,50,0.8)");
|
|
81
|
+
polyEl.setAttribute("stroke-width", "1.5");
|
|
82
|
+
debugSvg.appendChild(polyEl);
|
|
83
|
+
}
|
|
84
|
+
var anchorCircle = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
85
|
+
anchorCircle.setAttribute("cx", String(anchor[0]));
|
|
86
|
+
anchorCircle.setAttribute("cy", String(anchor[1]));
|
|
87
|
+
anchorCircle.setAttribute("r", "5");
|
|
88
|
+
anchorCircle.setAttribute("fill", "lime");
|
|
89
|
+
anchorCircle.setAttribute("stroke", "darkgreen");
|
|
90
|
+
anchorCircle.setAttribute("stroke-width", "1.5");
|
|
91
|
+
debugSvg.appendChild(anchorCircle);
|
|
92
|
+
var cursorCircle = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
93
|
+
cursorCircle.setAttribute("cx", String(cursor[0]));
|
|
94
|
+
cursorCircle.setAttribute("cy", String(cursor[1]));
|
|
95
|
+
cursorCircle.setAttribute("r", "4");
|
|
96
|
+
cursorCircle.setAttribute("fill", "yellow");
|
|
97
|
+
cursorCircle.setAttribute("stroke", "orange");
|
|
98
|
+
cursorCircle.setAttribute("stroke-width", "1.5");
|
|
99
|
+
debugSvg.appendChild(cursorCircle);
|
|
100
|
+
}
|
|
101
|
+
function debugClear() {
|
|
102
|
+
if (debugSvg) {
|
|
103
|
+
debugSvg.remove();
|
|
104
|
+
debugSvg = null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function safePolygon() {
|
|
108
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
109
|
+
var {
|
|
110
|
+
buffer = 0.5,
|
|
111
|
+
blockPointerEvents = false,
|
|
112
|
+
requireIntent = true,
|
|
113
|
+
__debug = false
|
|
114
|
+
} = options;
|
|
115
|
+
var timeoutRef = {
|
|
116
|
+
current: -1
|
|
117
|
+
};
|
|
118
|
+
var hasLanded = false;
|
|
119
|
+
var lastX = null;
|
|
120
|
+
var lastY = null;
|
|
121
|
+
var lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0;
|
|
122
|
+
function getCursorSpeed(x, y) {
|
|
123
|
+
var currentTime = performance.now();
|
|
124
|
+
var elapsedTime = currentTime - lastCursorTime;
|
|
125
|
+
if (lastX === null || lastY === null || elapsedTime === 0) {
|
|
126
|
+
lastX = x;
|
|
127
|
+
lastY = y;
|
|
128
|
+
lastCursorTime = currentTime;
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
var deltaX = x - lastX;
|
|
132
|
+
var deltaY = y - lastY;
|
|
133
|
+
var distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
134
|
+
var speed = distance / elapsedTime;
|
|
135
|
+
lastX = x;
|
|
136
|
+
lastY = y;
|
|
137
|
+
lastCursorTime = currentTime;
|
|
138
|
+
return speed;
|
|
139
|
+
}
|
|
140
|
+
var fn = function (param) {
|
|
141
|
+
var {
|
|
142
|
+
x,
|
|
143
|
+
y,
|
|
144
|
+
placement,
|
|
145
|
+
elements,
|
|
146
|
+
onClose
|
|
147
|
+
} = param;
|
|
148
|
+
hasLanded = false;
|
|
149
|
+
lastX = null;
|
|
150
|
+
lastY = null;
|
|
151
|
+
return function onMouseMove(event) {
|
|
152
|
+
function close() {
|
|
153
|
+
(0, import_utils.clearTimeoutIfSet)(timeoutRef);
|
|
154
|
+
onClose();
|
|
155
|
+
}
|
|
156
|
+
(0, import_utils.clearTimeoutIfSet)(timeoutRef);
|
|
157
|
+
var _elements_domReference;
|
|
158
|
+
var domReference = (_elements_domReference = elements.domReference) !== null && _elements_domReference !== void 0 ? _elements_domReference : elements.reference;
|
|
159
|
+
if (!domReference || !elements.floating || placement == null || x == null || y == null) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
var {
|
|
163
|
+
clientX,
|
|
164
|
+
clientY
|
|
165
|
+
} = event;
|
|
166
|
+
var clientPoint = [clientX, clientY];
|
|
167
|
+
var target = (0, import_utils.getTarget)(event);
|
|
168
|
+
var isLeave = event.type === "mouseleave";
|
|
169
|
+
var isOverFloatingEl = (0, import_utils.contains)(elements.floating, target);
|
|
170
|
+
var isOverReferenceEl = (0, import_utils.contains)(domReference, target);
|
|
171
|
+
var refRect = domReference.getBoundingClientRect();
|
|
172
|
+
var rect = elements.floating.getBoundingClientRect();
|
|
173
|
+
var side = placement.split("-")[0];
|
|
174
|
+
var cursorLeaveFromRight = x > rect.right - rect.width / 2;
|
|
175
|
+
var cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;
|
|
176
|
+
var isOverReferenceRect = isInside(clientPoint, refRect);
|
|
177
|
+
var isFloatingWider = rect.width > refRect.width;
|
|
178
|
+
var isFloatingTaller = rect.height > refRect.height;
|
|
179
|
+
var left = (isFloatingWider ? refRect : rect).left;
|
|
180
|
+
var right = (isFloatingWider ? refRect : rect).right;
|
|
181
|
+
var top = (isFloatingTaller ? refRect : rect).top;
|
|
182
|
+
var bottom = (isFloatingTaller ? refRect : rect).bottom;
|
|
183
|
+
if (isOverFloatingEl) {
|
|
184
|
+
hasLanded = true;
|
|
185
|
+
if (!isLeave) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (isOverReferenceEl) {
|
|
190
|
+
hasLanded = false;
|
|
191
|
+
}
|
|
192
|
+
if (isOverReferenceEl && !isLeave) {
|
|
193
|
+
hasLanded = true;
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (!isOverReferenceEl && isOverReferenceRect && !isLeave) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (isLeave && event.relatedTarget && (0, import_utils.contains)(elements.floating, event.relatedTarget)) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (side === "top" && y >= refRect.bottom - 1 || side === "bottom" && y <= refRect.top + 1 || side === "left" && x >= refRect.right - 1 || side === "right" && x <= refRect.left + 1) {
|
|
203
|
+
return close();
|
|
204
|
+
}
|
|
205
|
+
var rectPoly = [];
|
|
206
|
+
switch (side) {
|
|
207
|
+
case "top":
|
|
208
|
+
rectPoly = [[left, refRect.top + 1], [left, rect.bottom - 1], [right, rect.bottom - 1], [right, refRect.top + 1]];
|
|
209
|
+
break;
|
|
210
|
+
case "bottom":
|
|
211
|
+
rectPoly = [[left, rect.top + 1], [left, refRect.bottom - 1], [right, refRect.bottom - 1], [right, rect.top + 1]];
|
|
212
|
+
break;
|
|
213
|
+
case "left":
|
|
214
|
+
rectPoly = [[rect.right - 1, bottom], [rect.right - 1, top], [refRect.left + 1, top], [refRect.left + 1, bottom]];
|
|
215
|
+
break;
|
|
216
|
+
case "right":
|
|
217
|
+
rectPoly = [[refRect.right - 1, bottom], [refRect.right - 1, top], [rect.left + 1, top], [rect.left + 1, bottom]];
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
function getPolygon(param2) {
|
|
221
|
+
var [x2, y2] = param2;
|
|
222
|
+
switch (side) {
|
|
223
|
+
case "top":
|
|
224
|
+
{
|
|
225
|
+
var cursorPointOne = [isFloatingWider ? x2 + buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 + buffer + 1];
|
|
226
|
+
var cursorPointTwo = [isFloatingWider ? x2 - buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 + buffer + 1];
|
|
227
|
+
var commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]];
|
|
228
|
+
return [cursorPointOne, cursorPointTwo, ...commonPoints];
|
|
229
|
+
}
|
|
230
|
+
case "bottom":
|
|
231
|
+
{
|
|
232
|
+
var cursorPointOne1 = [isFloatingWider ? x2 + buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 - buffer];
|
|
233
|
+
var cursorPointTwo1 = [isFloatingWider ? x2 - buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 - buffer];
|
|
234
|
+
var commonPoints1 = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]];
|
|
235
|
+
return [cursorPointOne1, cursorPointTwo1, ...commonPoints1];
|
|
236
|
+
}
|
|
237
|
+
case "left":
|
|
238
|
+
{
|
|
239
|
+
var cursorPointOne2 = [x2 + buffer + 1, isFloatingTaller ? y2 + buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
240
|
+
var cursorPointTwo2 = [x2 + buffer + 1, isFloatingTaller ? y2 - buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
241
|
+
var commonPoints2 = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]];
|
|
242
|
+
return [...commonPoints2, cursorPointOne2, cursorPointTwo2];
|
|
243
|
+
}
|
|
244
|
+
case "right":
|
|
245
|
+
{
|
|
246
|
+
var cursorPointOne3 = [x2 - buffer, isFloatingTaller ? y2 + buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
247
|
+
var cursorPointTwo3 = [x2 - buffer, isFloatingTaller ? y2 - buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
248
|
+
var commonPoints3 = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]];
|
|
249
|
+
return [cursorPointOne3, cursorPointTwo3, ...commonPoints3];
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
var poly = getPolygon([x, y]);
|
|
254
|
+
if (__debug) {
|
|
255
|
+
debugDrawPolygon(poly, rectPoly, clientPoint, [x, y]);
|
|
256
|
+
}
|
|
257
|
+
if (isPointInPolygon([clientX, clientY], rectPoly)) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (hasLanded && !isOverReferenceRect) {
|
|
261
|
+
if (__debug) debugClear();
|
|
262
|
+
return close();
|
|
263
|
+
}
|
|
264
|
+
if (isPointInPolygon([clientX, clientY], poly)) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
if (!isLeave && requireIntent) {
|
|
268
|
+
var cursorSpeed = getCursorSpeed(clientX, clientY);
|
|
269
|
+
var cursorSpeedThreshold = 0.1;
|
|
270
|
+
if (cursorSpeed !== null && cursorSpeed < cursorSpeedThreshold) {
|
|
271
|
+
if (__debug) debugClear();
|
|
272
|
+
return close();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
if (__debug) debugClear();
|
|
276
|
+
close();
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
fn.__options = {
|
|
280
|
+
blockPointerEvents
|
|
281
|
+
};
|
|
282
|
+
return fn;
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=safePolygon.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","safePolygon_exports","safePolygon","module","exports","import_utils","require","isPointInPolygon","point","polygon","x","y","isInside2","length","i","j","xi","yi","xj","yj","intersect","isInside","rect","width","height","debugSvg","debugDrawPolygon","trough","cursor","anchor","document","createElementNS","id","assign","style","position","inset","pointerEvents","zIndex","body","appendChild","innerHTML","troughEl","setAttribute","map","p","join","polyEl","anchorCircle","String","cursorCircle","debugClear","remove","options","arguments","buffer","blockPointerEvents","requireIntent","__debug","timeoutRef","current","hasLanded","lastX","lastY","lastCursorTime","performance","now","getCursorSpeed","currentTime","elapsedTime","deltaX","deltaY","distance","Math","sqrt","speed","fn","param","placement","elements","onClose","onMouseMove","event","close","clearTimeoutIfSet","_elements_domReference","domReference","reference","floating","clientX","clientY","clientPoint","getTarget","isLeave","type","isOverFloatingEl","contains","isOverReferenceEl","refRect","getBoundingClientRect","side","split","cursorLeaveFromRight","right","cursorLeaveFromBottom","bottom","isOverReferenceRect","isFloatingWider","isFloatingTaller","left","top","relatedTarget","rectPoly","getPolygon","param2","x2","y2","cursorPointOne","cursorPointTwo","commonPoints","cursorPointOne1","cursorPointTwo1","commonPoints1","cursorPointOne2","cursorPointTwo2","commonPoints2","cursorPointOne3","cursorPointTwo3","commonPoints3","poly","cursorSpeed","cursorSpeedThreshold","__options"],"sources":["safePolygon.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar safePolygon_exports = {};\n__export(safePolygon_exports, {\n safePolygon: () => safePolygon\n});\nmodule.exports = __toCommonJS(safePolygon_exports);\nvar import_utils = require(\"./utils\");\nfunction isPointInPolygon(point, polygon) {\n var [x, y] = point;\n var isInside2 = false;\n var length = polygon.length;\n for (var i = 0, j = length - 1; i < length; j = i++) {\n var [xi, yi] = polygon[i] || [\n 0,\n 0\n ];\n var [xj, yj] = polygon[j] || [\n 0,\n 0\n ];\n var intersect = yi >= y !== yj >= y && x <= (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) {\n isInside2 = !isInside2;\n }\n }\n return isInside2;\n}\nfunction isInside(point, rect) {\n return point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n}\nvar debugSvg = null;\nfunction debugDrawPolygon(polygon, trough, cursor, anchor) {\n if (!debugSvg) {\n debugSvg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n debugSvg.id = \"__safe-polygon-debug\";\n Object.assign(debugSvg.style, {\n position: \"fixed\",\n inset: \"0\",\n width: \"100vw\",\n height: \"100vh\",\n pointerEvents: \"none\",\n zIndex: \"999999\"\n });\n document.body.appendChild(debugSvg);\n }\n debugSvg.innerHTML = \"\";\n if (trough.length) {\n var troughEl = document.createElementNS(\"http://www.w3.org/2000/svg\", \"polygon\");\n troughEl.setAttribute(\"points\", trough.map(function(p) {\n return p.join(\",\");\n }).join(\" \"));\n troughEl.setAttribute(\"fill\", \"rgba(0,100,255,0.15)\");\n troughEl.setAttribute(\"stroke\", \"rgba(0,100,255,0.6)\");\n troughEl.setAttribute(\"stroke-width\", \"1\");\n debugSvg.appendChild(troughEl);\n }\n if (polygon.length) {\n var polyEl = document.createElementNS(\"http://www.w3.org/2000/svg\", \"polygon\");\n polyEl.setAttribute(\"points\", polygon.map(function(p) {\n return p.join(\",\");\n }).join(\" \"));\n polyEl.setAttribute(\"fill\", \"rgba(255,50,50,0.2)\");\n polyEl.setAttribute(\"stroke\", \"rgba(255,50,50,0.8)\");\n polyEl.setAttribute(\"stroke-width\", \"1.5\");\n debugSvg.appendChild(polyEl);\n }\n var anchorCircle = document.createElementNS(\"http://www.w3.org/2000/svg\", \"circle\");\n anchorCircle.setAttribute(\"cx\", String(anchor[0]));\n anchorCircle.setAttribute(\"cy\", String(anchor[1]));\n anchorCircle.setAttribute(\"r\", \"5\");\n anchorCircle.setAttribute(\"fill\", \"lime\");\n anchorCircle.setAttribute(\"stroke\", \"darkgreen\");\n anchorCircle.setAttribute(\"stroke-width\", \"1.5\");\n debugSvg.appendChild(anchorCircle);\n var cursorCircle = document.createElementNS(\"http://www.w3.org/2000/svg\", \"circle\");\n cursorCircle.setAttribute(\"cx\", String(cursor[0]));\n cursorCircle.setAttribute(\"cy\", String(cursor[1]));\n cursorCircle.setAttribute(\"r\", \"4\");\n cursorCircle.setAttribute(\"fill\", \"yellow\");\n cursorCircle.setAttribute(\"stroke\", \"orange\");\n cursorCircle.setAttribute(\"stroke-width\", \"1.5\");\n debugSvg.appendChild(cursorCircle);\n}\nfunction debugClear() {\n if (debugSvg) {\n debugSvg.remove();\n debugSvg = null;\n }\n}\nfunction safePolygon() {\n var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n var { buffer = 0.5, blockPointerEvents = false, requireIntent = true, __debug = false } = options;\n var timeoutRef = {\n current: -1\n };\n var hasLanded = false;\n var lastX = null;\n var lastY = null;\n var lastCursorTime = typeof performance !== \"undefined\" ? performance.now() : 0;\n function getCursorSpeed(x, y) {\n var currentTime = performance.now();\n var elapsedTime = currentTime - lastCursorTime;\n if (lastX === null || lastY === null || elapsedTime === 0) {\n lastX = x;\n lastY = y;\n lastCursorTime = currentTime;\n return null;\n }\n var deltaX = x - lastX;\n var deltaY = y - lastY;\n var distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n var speed = distance / elapsedTime;\n lastX = x;\n lastY = y;\n lastCursorTime = currentTime;\n return speed;\n }\n var fn = function(param) {\n var { x, y, placement, elements, onClose } = param;\n hasLanded = false;\n lastX = null;\n lastY = null;\n return function onMouseMove(event) {\n function close() {\n (0, import_utils.clearTimeoutIfSet)(timeoutRef);\n onClose();\n }\n (0, import_utils.clearTimeoutIfSet)(timeoutRef);\n var _elements_domReference;\n var domReference = (_elements_domReference = elements.domReference) !== null && _elements_domReference !== void 0 ? _elements_domReference : elements.reference;\n if (!domReference || !elements.floating || placement == null || x == null || y == null) {\n return;\n }\n var { clientX, clientY } = event;\n var clientPoint = [\n clientX,\n clientY\n ];\n var target = (0, import_utils.getTarget)(event);\n var isLeave = event.type === \"mouseleave\";\n var isOverFloatingEl = (0, import_utils.contains)(elements.floating, target);\n var isOverReferenceEl = (0, import_utils.contains)(domReference, target);\n var refRect = domReference.getBoundingClientRect();\n var rect = elements.floating.getBoundingClientRect();\n var side = placement.split(\"-\")[0];\n var cursorLeaveFromRight = x > rect.right - rect.width / 2;\n var cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;\n var isOverReferenceRect = isInside(clientPoint, refRect);\n var isFloatingWider = rect.width > refRect.width;\n var isFloatingTaller = rect.height > refRect.height;\n var left = (isFloatingWider ? refRect : rect).left;\n var right = (isFloatingWider ? refRect : rect).right;\n var top = (isFloatingTaller ? refRect : rect).top;\n var bottom = (isFloatingTaller ? refRect : rect).bottom;\n if (isOverFloatingEl) {\n hasLanded = true;\n if (!isLeave) {\n return;\n }\n }\n if (isOverReferenceEl) {\n hasLanded = false;\n }\n if (isOverReferenceEl && !isLeave) {\n hasLanded = true;\n return;\n }\n if (!isOverReferenceEl && isOverReferenceRect && !isLeave) {\n return;\n }\n if (isLeave && event.relatedTarget && (0, import_utils.contains)(elements.floating, event.relatedTarget)) {\n return;\n }\n if (side === \"top\" && y >= refRect.bottom - 1 || side === \"bottom\" && y <= refRect.top + 1 || side === \"left\" && x >= refRect.right - 1 || side === \"right\" && x <= refRect.left + 1) {\n return close();\n }\n var rectPoly = [];\n switch (side) {\n case \"top\":\n rectPoly = [\n [\n left,\n refRect.top + 1\n ],\n [\n left,\n rect.bottom - 1\n ],\n [\n right,\n rect.bottom - 1\n ],\n [\n right,\n refRect.top + 1\n ]\n ];\n break;\n case \"bottom\":\n rectPoly = [\n [\n left,\n rect.top + 1\n ],\n [\n left,\n refRect.bottom - 1\n ],\n [\n right,\n refRect.bottom - 1\n ],\n [\n right,\n rect.top + 1\n ]\n ];\n break;\n case \"left\":\n rectPoly = [\n [\n rect.right - 1,\n bottom\n ],\n [\n rect.right - 1,\n top\n ],\n [\n refRect.left + 1,\n top\n ],\n [\n refRect.left + 1,\n bottom\n ]\n ];\n break;\n case \"right\":\n rectPoly = [\n [\n refRect.right - 1,\n bottom\n ],\n [\n refRect.right - 1,\n top\n ],\n [\n rect.left + 1,\n top\n ],\n [\n rect.left + 1,\n bottom\n ]\n ];\n break;\n }\n function getPolygon(param2) {\n var [x2, y2] = param2;\n switch (side) {\n case \"top\": {\n var cursorPointOne = [\n isFloatingWider ? x2 + buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4,\n y2 + buffer + 1\n ];\n var cursorPointTwo = [\n isFloatingWider ? x2 - buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4,\n y2 + buffer + 1\n ];\n var commonPoints = [\n [\n rect.left,\n cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top\n ],\n [\n rect.right,\n cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer\n ]\n ];\n return [\n cursorPointOne,\n cursorPointTwo,\n ...commonPoints\n ];\n }\n case \"bottom\": {\n var cursorPointOne1 = [\n isFloatingWider ? x2 + buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4,\n y2 - buffer\n ];\n var cursorPointTwo1 = [\n isFloatingWider ? x2 - buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4,\n y2 - buffer\n ];\n var commonPoints1 = [\n [\n rect.left,\n cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom\n ],\n [\n rect.right,\n cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer\n ]\n ];\n return [\n cursorPointOne1,\n cursorPointTwo1,\n ...commonPoints1\n ];\n }\n case \"left\": {\n var cursorPointOne2 = [\n x2 + buffer + 1,\n isFloatingTaller ? y2 + buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4\n ];\n var cursorPointTwo2 = [\n x2 + buffer + 1,\n isFloatingTaller ? y2 - buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4\n ];\n var commonPoints2 = [\n [\n cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left,\n rect.top\n ],\n [\n cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer,\n rect.bottom\n ]\n ];\n return [\n ...commonPoints2,\n cursorPointOne2,\n cursorPointTwo2\n ];\n }\n case \"right\": {\n var cursorPointOne3 = [\n x2 - buffer,\n isFloatingTaller ? y2 + buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4\n ];\n var cursorPointTwo3 = [\n x2 - buffer,\n isFloatingTaller ? y2 - buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4\n ];\n var commonPoints3 = [\n [\n cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right,\n rect.top\n ],\n [\n cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer,\n rect.bottom\n ]\n ];\n return [\n cursorPointOne3,\n cursorPointTwo3,\n ...commonPoints3\n ];\n }\n }\n }\n var poly = getPolygon([\n x,\n y\n ]);\n if (__debug) {\n debugDrawPolygon(poly, rectPoly, clientPoint, [\n x,\n y\n ]);\n }\n if (isPointInPolygon([\n clientX,\n clientY\n ], rectPoly)) {\n return;\n }\n if (hasLanded && !isOverReferenceRect) {\n if (__debug) debugClear();\n return close();\n }\n if (isPointInPolygon([\n clientX,\n clientY\n ], poly)) {\n return;\n }\n if (!isLeave && requireIntent) {\n var cursorSpeed = getCursorSpeed(clientX, clientY);\n var cursorSpeedThreshold = 0.1;\n if (cursorSpeed !== null && cursorSpeed < cursorSpeedThreshold) {\n if (__debug) debugClear();\n return close();\n }\n }\n if (__debug) debugClear();\n close();\n };\n };\n fn.__options = {\n blockPointerEvents\n };\n return fn;\n}\n//# sourceMappingURL=safePolygon.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;IAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;IAAEE,UAAU,EAAE;EAAK,CAAC,CAAC;AACjE,CAAC;AACD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;EAC5C,IAAIF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,UAAU,EA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C,EAAE;QACR;MACF;MACA,IAAI,CAACpC,OAAO,IAAIpC,aAAa,EAAE;QAC7B,IAAIyE,WAAW,GAAG/D,cAAc,CAACsB,OAAO,EAAEC,OAAO,CAAC;QAClD,IAAIyC,oBAAoB,GAAG,GAAG;QAC9B,IAAID,WAAW,KAAK,IAAI,IAAIA,WAAW,GAAGC,oBAAoB,EAAE;UAC9D,IAAIzE,OAAO,EAAEP,UAAU,CAAC,CAAC;UACzB,OAAOgC,KAAK,CAAC,CAAC;QAChB;MACF;MACA,IAAIzB,OAAO,EAAEP,UAAU,CAAC,CAAC;MACzBgC,KAAK,CAAC,CAAC;IACT,CAAC;EACH,CAAC;EACDP,EAAE,CAACwD,SAAS,GAAG;IACb5E;EACF,CAAC;EACD,OAAOoB,EAAE;AACX","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
8
|
+
get: () => from[key],
|
|
9
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
}), mod);
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
+
get: () => from[key],
|
|
11
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
}), mod);
|
|
19
|
+
var types_exports = {};
|
|
20
|
+
module.exports = __toCommonJS(types_exports);
|
|
21
|
+
//# sourceMappingURL=types.native.js.map
|