one 1.2.79 → 1.2.81
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/dist/cjs/Root.cjs +1 -1
- package/dist/cjs/Root.js +1 -1
- package/dist/cjs/Root.js.map +1 -1
- package/dist/cjs/Root.native.js +1 -1
- package/dist/cjs/Root.native.js.map +1 -1
- package/dist/cjs/drawer.cjs +27 -0
- package/dist/cjs/drawer.js +22 -0
- package/dist/cjs/drawer.js.map +6 -0
- package/dist/cjs/drawer.native.js +30 -0
- package/dist/cjs/drawer.native.js.map +1 -0
- package/dist/cjs/hooks.cjs +25 -2
- package/dist/cjs/hooks.js +23 -2
- package/dist/cjs/hooks.js.map +1 -1
- package/dist/cjs/hooks.native.js +147 -14
- package/dist/cjs/hooks.native.js.map +1 -1
- package/dist/cjs/hooks.test.cjs +73 -0
- package/dist/cjs/hooks.test.js +98 -0
- package/dist/cjs/hooks.test.js.map +6 -0
- package/dist/cjs/hooks.test.native.js +194 -0
- package/dist/cjs/hooks.test.native.js.map +1 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +1 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/link/prefetchIntent.cjs +122 -0
- package/dist/cjs/link/prefetchIntent.js +85 -0
- package/dist/cjs/link/prefetchIntent.js.map +6 -0
- package/dist/cjs/link/prefetchIntent.native.js +155 -0
- package/dist/cjs/link/prefetchIntent.native.js.map +1 -0
- package/dist/cjs/link/prefetchIntent.test.cjs +217 -0
- package/dist/cjs/link/prefetchIntent.test.js +149 -0
- package/dist/cjs/link/prefetchIntent.test.js.map +6 -0
- package/dist/cjs/link/prefetchIntent.test.native.js +239 -0
- package/dist/cjs/link/prefetchIntent.test.native.js.map +1 -0
- package/dist/cjs/link/prefetchViewport.cjs +67 -0
- package/dist/cjs/link/prefetchViewport.js +55 -0
- package/dist/cjs/link/prefetchViewport.js.map +6 -0
- package/dist/cjs/link/prefetchViewport.native.js +83 -0
- package/dist/cjs/link/prefetchViewport.native.js.map +1 -0
- package/dist/cjs/link/prefetchViewport.test.cjs +57 -0
- package/dist/cjs/link/prefetchViewport.test.js +59 -0
- package/dist/cjs/link/prefetchViewport.test.js.map +6 -0
- package/dist/cjs/link/prefetchViewport.test.native.js +85 -0
- package/dist/cjs/link/prefetchViewport.test.native.js.map +1 -0
- package/dist/cjs/router/findRouteNode.cjs +26 -0
- package/dist/cjs/router/findRouteNode.js +28 -0
- package/dist/cjs/router/findRouteNode.js.map +1 -1
- package/dist/cjs/router/findRouteNode.native.js +31 -0
- package/dist/cjs/router/findRouteNode.native.js.map +1 -1
- package/dist/cjs/router/router.cjs +11 -13
- package/dist/cjs/router/router.js +8 -10
- package/dist/cjs/router/router.js.map +2 -2
- package/dist/cjs/router/router.native.js +38 -122
- package/dist/cjs/router/router.native.js.map +1 -1
- package/dist/cjs/views/PreloadLinks.cjs +102 -18
- package/dist/cjs/views/PreloadLinks.js +95 -19
- package/dist/cjs/views/PreloadLinks.js.map +1 -1
- package/dist/cjs/vite/one.cjs +3 -0
- package/dist/cjs/vite/one.js +3 -0
- package/dist/cjs/vite/one.js.map +1 -1
- package/dist/cjs/vite/one.native.js +4 -0
- package/dist/cjs/vite/one.native.js.map +1 -1
- package/dist/esm/Root.js +1 -1
- package/dist/esm/Root.js.map +1 -1
- package/dist/esm/Root.mjs +1 -1
- package/dist/esm/Root.mjs.map +1 -1
- package/dist/esm/Root.native.js +1 -1
- package/dist/esm/Root.native.js.map +1 -1
- package/dist/esm/drawer.js +6 -0
- package/dist/esm/drawer.js.map +6 -0
- package/dist/esm/drawer.mjs +3 -0
- package/dist/esm/drawer.mjs.map +1 -0
- package/dist/esm/drawer.native.js +3 -0
- package/dist/esm/drawer.native.js.map +1 -0
- package/dist/esm/hooks.js +23 -2
- package/dist/esm/hooks.js.map +1 -1
- package/dist/esm/hooks.mjs +25 -3
- package/dist/esm/hooks.mjs.map +1 -1
- package/dist/esm/hooks.native.js +147 -15
- package/dist/esm/hooks.native.js.map +1 -1
- package/dist/esm/hooks.test.js +98 -0
- package/dist/esm/hooks.test.js.map +6 -0
- package/dist/esm/hooks.test.mjs +74 -0
- package/dist/esm/hooks.test.mjs.map +1 -0
- package/dist/esm/hooks.test.native.js +192 -0
- package/dist/esm/hooks.test.native.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -2
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/link/prefetchIntent.js +69 -0
- package/dist/esm/link/prefetchIntent.js.map +6 -0
- package/dist/esm/link/prefetchIntent.mjs +97 -0
- package/dist/esm/link/prefetchIntent.mjs.map +1 -0
- package/dist/esm/link/prefetchIntent.native.js +127 -0
- package/dist/esm/link/prefetchIntent.native.js.map +1 -0
- package/dist/esm/link/prefetchIntent.test.js +150 -0
- package/dist/esm/link/prefetchIntent.test.js.map +6 -0
- package/dist/esm/link/prefetchIntent.test.mjs +218 -0
- package/dist/esm/link/prefetchIntent.test.mjs.map +1 -0
- package/dist/esm/link/prefetchIntent.test.native.js +237 -0
- package/dist/esm/link/prefetchIntent.test.native.js.map +1 -0
- package/dist/esm/link/prefetchViewport.js +39 -0
- package/dist/esm/link/prefetchViewport.js.map +6 -0
- package/dist/esm/link/prefetchViewport.mjs +42 -0
- package/dist/esm/link/prefetchViewport.mjs.map +1 -0
- package/dist/esm/link/prefetchViewport.native.js +55 -0
- package/dist/esm/link/prefetchViewport.native.js.map +1 -0
- package/dist/esm/link/prefetchViewport.test.js +60 -0
- package/dist/esm/link/prefetchViewport.test.js.map +6 -0
- package/dist/esm/link/prefetchViewport.test.mjs +58 -0
- package/dist/esm/link/prefetchViewport.test.mjs.map +1 -0
- package/dist/esm/link/prefetchViewport.test.native.js +83 -0
- package/dist/esm/link/prefetchViewport.test.native.js.map +1 -0
- package/dist/esm/router/findRouteNode.js +28 -0
- package/dist/esm/router/findRouteNode.js.map +1 -1
- package/dist/esm/router/findRouteNode.mjs +26 -1
- package/dist/esm/router/findRouteNode.mjs.map +1 -1
- package/dist/esm/router/findRouteNode.native.js +31 -1
- package/dist/esm/router/findRouteNode.native.js.map +1 -1
- package/dist/esm/router/router.js +10 -11
- package/dist/esm/router/router.js.map +2 -2
- package/dist/esm/router/router.mjs +12 -14
- package/dist/esm/router/router.mjs.map +1 -1
- package/dist/esm/router/router.native.js +39 -123
- package/dist/esm/router/router.native.js.map +1 -1
- package/dist/esm/views/PreloadLinks.js +86 -17
- package/dist/esm/views/PreloadLinks.js.map +1 -1
- package/dist/esm/views/PreloadLinks.mjs +87 -14
- package/dist/esm/views/PreloadLinks.mjs.map +1 -1
- package/dist/esm/vite/one.js +3 -0
- package/dist/esm/vite/one.js.map +1 -1
- package/dist/esm/vite/one.mjs +3 -0
- package/dist/esm/vite/one.mjs.map +1 -1
- package/dist/esm/vite/one.native.js +4 -0
- package/dist/esm/vite/one.native.js.map +1 -1
- package/package.json +33 -12
- package/src/Root.tsx +1 -1
- package/src/drawer.ts +1 -0
- package/src/hooks.test.ts +157 -0
- package/src/hooks.tsx +79 -23
- package/src/index.ts +1 -0
- package/src/link/prefetchIntent.test.ts +416 -0
- package/src/link/prefetchIntent.ts +174 -0
- package/src/link/prefetchViewport.test.ts +120 -0
- package/src/link/prefetchViewport.ts +62 -0
- package/src/router/findRouteNode.ts +67 -0
- package/src/router/router.ts +68 -41
- package/src/views/PreloadLinks.tsx +156 -20
- package/src/vite/one.ts +4 -0
- package/src/vite/types.ts +12 -0
- package/types/drawer.d.ts +2 -0
- package/types/drawer.d.ts.map +1 -0
- package/types/hooks.d.ts +22 -0
- package/types/hooks.d.ts.map +1 -1
- package/types/hooks.test.d.ts +2 -0
- package/types/hooks.test.d.ts.map +1 -0
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/link/prefetchIntent.d.ts +43 -0
- package/types/link/prefetchIntent.d.ts.map +1 -0
- package/types/link/prefetchIntent.test.d.ts +2 -0
- package/types/link/prefetchIntent.test.d.ts.map +1 -0
- package/types/link/prefetchViewport.d.ts +16 -0
- package/types/link/prefetchViewport.d.ts.map +1 -0
- package/types/link/prefetchViewport.test.d.ts +2 -0
- package/types/link/prefetchViewport.test.d.ts.map +1 -0
- package/types/router/findRouteNode.d.ts +11 -0
- package/types/router/findRouteNode.d.ts.map +1 -1
- package/types/router/router.d.ts.map +1 -1
- package/types/views/PreloadLinks.d.ts +9 -0
- package/types/views/PreloadLinks.d.ts.map +1 -1
- package/types/vite/one.d.ts.map +1 -1
- package/types/vite/types.d.ts +11 -0
- package/types/vite/types.d.ts.map +1 -1
|
@@ -0,0 +1,155 @@
|
|
|
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: !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, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: !0
|
|
22
|
+
}), mod);
|
|
23
|
+
var prefetchIntent_exports = {};
|
|
24
|
+
__export(prefetchIntent_exports, {
|
|
25
|
+
createPrefetchIntent: () => createPrefetchIntent,
|
|
26
|
+
observePrefetchIntent: () => observePrefetchIntent,
|
|
27
|
+
startPrefetchIntent: () => startPrefetchIntent
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(prefetchIntent_exports);
|
|
30
|
+
function createPrefetchIntent(options) {
|
|
31
|
+
var {
|
|
32
|
+
onPrefetch,
|
|
33
|
+
maxReach = 500,
|
|
34
|
+
perpWeight = 5,
|
|
35
|
+
minSpeed = 8
|
|
36
|
+
} = options,
|
|
37
|
+
done = /* @__PURE__ */new Set(),
|
|
38
|
+
rects = [],
|
|
39
|
+
px = 0,
|
|
40
|
+
py = 0,
|
|
41
|
+
vx = 0,
|
|
42
|
+
vy = 0,
|
|
43
|
+
moveCount = 0,
|
|
44
|
+
lastPrefetchMove = 0;
|
|
45
|
+
function setRects(newRects) {
|
|
46
|
+
rects = newRects.filter(function (r) {
|
|
47
|
+
return !done.has(r.h);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function move(x, y, dx, dy) {
|
|
51
|
+
moveCount++;
|
|
52
|
+
var smooth = moveCount < 3 ? 0.3 : 0.6;
|
|
53
|
+
vx = vx * smooth + dx * (1 - smooth), vy = vy * smooth + dy * (1 - smooth), px = x, py = y;
|
|
54
|
+
var speed = Math.sqrt(vx * vx + vy * vy);
|
|
55
|
+
if (!(speed < minSpeed)) {
|
|
56
|
+
var ux = vx / speed,
|
|
57
|
+
uy = vy / speed,
|
|
58
|
+
best = 1 / 0,
|
|
59
|
+
href = "",
|
|
60
|
+
_iteratorNormalCompletion = !0,
|
|
61
|
+
_didIteratorError = !1,
|
|
62
|
+
_iteratorError = void 0;
|
|
63
|
+
try {
|
|
64
|
+
for (var _iterator = rects[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
65
|
+
var {
|
|
66
|
+
r,
|
|
67
|
+
h
|
|
68
|
+
} = _step.value,
|
|
69
|
+
cx = (r.left + r.right) / 2 - px,
|
|
70
|
+
cy = (r.top + r.bottom) / 2 - py,
|
|
71
|
+
dist = Math.sqrt(cx * cx + cy * cy),
|
|
72
|
+
along = cx * ux + cy * uy;
|
|
73
|
+
if (!(along < 0)) {
|
|
74
|
+
var perpX = cx - along * ux,
|
|
75
|
+
perpY = cy - along * uy,
|
|
76
|
+
perp = Math.sqrt(perpX * perpX + perpY * perpY),
|
|
77
|
+
baseRadius = Math.max(r.width, r.height) / 2 + 30,
|
|
78
|
+
distanceFactor = Math.max(0.2, 1 - dist / 1e3),
|
|
79
|
+
radius = baseRadius * distanceFactor + 20;
|
|
80
|
+
if (!(perp > radius)) {
|
|
81
|
+
var score = along + perp * perpWeight;
|
|
82
|
+
score < best && (best = score, href = h);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
} catch (err) {
|
|
87
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
88
|
+
} finally {
|
|
89
|
+
try {
|
|
90
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
91
|
+
} finally {
|
|
92
|
+
if (_didIteratorError) throw _iteratorError;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
href && best < maxReach && moveCount - lastPrefetchMove > 1 && (done.add(href), rects = rects.filter(function (r2) {
|
|
96
|
+
return r2.h !== href;
|
|
97
|
+
}), lastPrefetchMove = moveCount, onPrefetch(href));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
var nodes = /* @__PURE__ */new Map();
|
|
101
|
+
function observe(el, href) {
|
|
102
|
+
return nodes.set(el, href), function () {
|
|
103
|
+
nodes.delete(el), done.delete(href);
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
setRects,
|
|
108
|
+
move,
|
|
109
|
+
observe,
|
|
110
|
+
nodes,
|
|
111
|
+
done
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
var instance = null,
|
|
115
|
+
started = !1;
|
|
116
|
+
function startPrefetchIntent(onPrefetch) {
|
|
117
|
+
if (started) return instance;
|
|
118
|
+
started = !0, instance = createPrefetchIntent({
|
|
119
|
+
onPrefetch
|
|
120
|
+
});
|
|
121
|
+
var frame = 0,
|
|
122
|
+
px = 0,
|
|
123
|
+
py = 0;
|
|
124
|
+
function measure() {
|
|
125
|
+
if (!instance.nodes.size) return setTimeout(measure, 300);
|
|
126
|
+
var io = new IntersectionObserver(function (entries) {
|
|
127
|
+
io.disconnect(), instance.setRects(entries.filter(function (e) {
|
|
128
|
+
return e.isIntersecting;
|
|
129
|
+
}).map(function (e) {
|
|
130
|
+
return {
|
|
131
|
+
r: e.boundingClientRect,
|
|
132
|
+
h: instance.nodes.get(e.target)
|
|
133
|
+
};
|
|
134
|
+
}).filter(function (x) {
|
|
135
|
+
return x.h;
|
|
136
|
+
})), setTimeout(measure, 300);
|
|
137
|
+
});
|
|
138
|
+
instance.nodes.forEach(function (_, el) {
|
|
139
|
+
return io.observe(el);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
return measure(), document.addEventListener("mousemove", function (e) {
|
|
143
|
+
if (!(++frame % 4)) {
|
|
144
|
+
var dx = e.clientX - px,
|
|
145
|
+
dy = e.clientY - py;
|
|
146
|
+
px = e.clientX, py = e.clientY, instance.move(px, py, dx, dy);
|
|
147
|
+
}
|
|
148
|
+
}, {
|
|
149
|
+
passive: !0
|
|
150
|
+
}), instance;
|
|
151
|
+
}
|
|
152
|
+
function observePrefetchIntent(el, href) {
|
|
153
|
+
return instance ? instance.observe(el, href) : function () {};
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=prefetchIntent.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","prefetchIntent_exports","__export","createPrefetchIntent","observePrefetchIntent","startPrefetchIntent","module","exports","options","onPrefetch","maxReach","perpWeight","minSpeed","done","Set","rects","px","py","vx","vy","moveCount","lastPrefetchMove","setRects","newRects","filter","r","has","h","move","x","y","dx","dy","smooth","speed","Math","sqrt","ux","uy","best","href","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","cx","left","right","cy","top","bottom","dist","along","perpX","perpY","perp","baseRadius","max","width","height","distanceFactor","radius","score","err","return","add","r2","nodes","Map","observe","el","set","delete","instance","started","frame","measure"],"sources":["../../../src/link/prefetchIntent.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,sBAAA;AAAAC,QAAA,CAAAD,sBAAA;EAAAE,oBAAA,EAAAA,CAAA,KAAAA,oBAAA;EAAAC,qBAAA,EAAAA,CAAA,KAAAA,qBAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAA;AAAA;AA0BOC,MAAA,CAAAC,OAAS,GAAAX,YAAA,CAAqBK,sBAAgC;AACnE,SAAME,oBAAcA,CAAAK,OAAW,EAAK;EAGpC,IAAI;MAAAC,UACA;MAAAC,QACF,GAAK,GACL;MAAAC,UACA,GAAK,CACH;MAAAC,QAAA,GAAY;IACZ,IAAAJ,OAAA;IAAAK,IAAA,GAAmB,mBAAAC,GAAA;IAAAC,KAAA;IAAAC,EAAA;IAAAC,EAAA;IAAAC,EAAA;IAAAC,EAAA;IAAAC,SAAA;IAAAC,gBAAA;EAEvB,SAASC,SAASC,QAAA,EAAuB;IACvCR,KAAA,GAAQQ,QAAA,CAASC,MAAA,CAAO,UAAQC,CAAA;MAClC,QAAAZ,IAAA,CAAAa,GAAA,CAAAD,CAAA,CAAAE,CAAA;IAEA;EACE;EAEA,SAAMC,KAAAC,CAAA,EAASC,CAAA,EAAAC,EAAA,EAAAC,EAAA;IACfZ,SAAK,EAAK;IAKV,IAAAa,MAAM,GAAAb,SAAa,GAAK,IAAK,MAAK;IAClCF,EAAA,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AAA;IAAA;EAEC;EAEzB;IACFlB,QAAA;IACAM,IAAA;IAGE6C,OAAA;IACAF,KAAC;IAEC1D;EAEA;AAEA;AAG6B,IAC/BgE,QAAA;EAAAC,OAAA;AAAA,SACEzE,mBAAcA,CAAAI,UAAA;EAClB,IAEOqE,OAAA,SAAAD,QAAA;EACTC,OAAA,OAAAD,QAAA,GAAA1E,oBAAA;IAEOM;EACL;EAA6B,IAAAsE,KAAA;IAAA/D,EAAA;IAAAC,EAAA;EAE/B,SAAA+D,QAAA","ignoreList":[]}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
var import_vitest = require("vitest"),
|
|
2
|
+
import_prefetchIntent = require("./prefetchIntent.cjs");
|
|
3
|
+
const rect = (x, y, w = 100, h = 40) => ({
|
|
4
|
+
left: x,
|
|
5
|
+
top: y,
|
|
6
|
+
right: x + w,
|
|
7
|
+
bottom: y + h,
|
|
8
|
+
width: w,
|
|
9
|
+
height: h,
|
|
10
|
+
x,
|
|
11
|
+
y,
|
|
12
|
+
toJSON: () => ({})
|
|
13
|
+
});
|
|
14
|
+
(0, import_vitest.describe)("prefetchIntent", () => {
|
|
15
|
+
let prefetched, intent;
|
|
16
|
+
(0, import_vitest.beforeEach)(() => {
|
|
17
|
+
prefetched = [], intent = (0, import_prefetchIntent.createPrefetchIntent)({
|
|
18
|
+
onPrefetch: href => prefetched.push(href)
|
|
19
|
+
});
|
|
20
|
+
}), (0, import_vitest.describe)("basic targeting", () => {
|
|
21
|
+
(0, import_vitest.it)("prefetches when moving directly toward a link", () => {
|
|
22
|
+
intent.setRects([{
|
|
23
|
+
r: rect(500, 300),
|
|
24
|
+
h: "/about"
|
|
25
|
+
}]), intent.move(100, 300, 0, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/about"]);
|
|
26
|
+
}), (0, import_vitest.it)("does not prefetch when moving away from a link", () => {
|
|
27
|
+
intent.setRects([{
|
|
28
|
+
r: rect(500, 300),
|
|
29
|
+
h: "/about"
|
|
30
|
+
}]), intent.move(400, 300, 0, 0), intent.move(380, 300, -20, 0), intent.move(350, 300, -30, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
31
|
+
}), (0, import_vitest.it)("does not prefetch when moving perpendicular to a link", () => {
|
|
32
|
+
intent.setRects([{
|
|
33
|
+
r: rect(500, 300),
|
|
34
|
+
h: "/about"
|
|
35
|
+
}]), intent.move(200, 300, 0, 0), intent.move(200, 330, 0, 30), intent.move(200, 370, 0, 40), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
36
|
+
}), (0, import_vitest.it)("prefetches link at long distance with good aim", () => {
|
|
37
|
+
intent.setRects([{
|
|
38
|
+
r: rect(500, 280),
|
|
39
|
+
h: "/far"
|
|
40
|
+
}]), intent.move(100, 300, 0, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/far"]);
|
|
41
|
+
}), (0, import_vitest.it)("does not prefetch when aim is slightly off at long distance", () => {
|
|
42
|
+
intent.setRects([{
|
|
43
|
+
r: rect(600, 300),
|
|
44
|
+
h: "/far"
|
|
45
|
+
}]), intent.move(100, 300, 0, 0), intent.move(140, 320, 40, 20), intent.move(200, 360, 60, 40), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
46
|
+
});
|
|
47
|
+
}), (0, import_vitest.describe)("prevents over-fetching", () => {
|
|
48
|
+
(0, import_vitest.it)("only prefetches each href once", () => {
|
|
49
|
+
intent.setRects([{
|
|
50
|
+
r: rect(500, 300),
|
|
51
|
+
h: "/about"
|
|
52
|
+
}]), intent.move(100, 300, 0, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/about"]), intent.move(100, 300, -100, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/about"]);
|
|
53
|
+
}), (0, import_vitest.it)("removes prefetched links from future consideration", () => {
|
|
54
|
+
intent.setRects([{
|
|
55
|
+
r: rect(400, 300),
|
|
56
|
+
h: "/first"
|
|
57
|
+
}, {
|
|
58
|
+
r: rect(600, 300),
|
|
59
|
+
h: "/second"
|
|
60
|
+
}]), intent.move(100, 300, 0, 0), intent.move(150, 300, 50, 0), (0, import_vitest.expect)(prefetched).toEqual(["/first"]), intent.move(250, 300, 100, 0), intent.move(350, 300, 100, 0), (0, import_vitest.expect)(prefetched).toEqual(["/first", "/second"]);
|
|
61
|
+
});
|
|
62
|
+
}), (0, import_vitest.describe)("winner-takes-all with clustered links", () => {
|
|
63
|
+
(0, import_vitest.it)("only prefetches the best target when multiple links are in path", () => {
|
|
64
|
+
intent.setRects([{
|
|
65
|
+
r: rect(500, 280),
|
|
66
|
+
h: "/top"
|
|
67
|
+
}, {
|
|
68
|
+
r: rect(500, 320),
|
|
69
|
+
h: "/middle"
|
|
70
|
+
}, {
|
|
71
|
+
r: rect(500, 360),
|
|
72
|
+
h: "/bottom"
|
|
73
|
+
}]), intent.move(100, 340, 0, 0), intent.move(150, 340, 50, 0), (0, import_vitest.expect)(prefetched.length).toBe(1), (0, import_vitest.expect)(prefetched[0]).toBe("/middle");
|
|
74
|
+
}), (0, import_vitest.it)("handles dense nav with 20 links", () => {
|
|
75
|
+
const links = Array.from({
|
|
76
|
+
length: 20
|
|
77
|
+
}, (_, i) => ({
|
|
78
|
+
r: rect(100 + i * 60, 50, 50, 30),
|
|
79
|
+
h: `/nav-${i}`
|
|
80
|
+
}));
|
|
81
|
+
intent.setRects(links), intent.move(700, 200, 0, 0), intent.move(700, 150, 0, -50), intent.move(700, 100, 0, -50), (0, import_vitest.expect)(prefetched.length).toBe(1), (0, import_vitest.expect)(prefetched[0]).toBe("/nav-10");
|
|
82
|
+
}), (0, import_vitest.it)("picks closer link when two are roughly aligned", () => {
|
|
83
|
+
intent.setRects([{
|
|
84
|
+
r: rect(300, 300),
|
|
85
|
+
h: "/near"
|
|
86
|
+
}, {
|
|
87
|
+
r: rect(600, 300),
|
|
88
|
+
h: "/far"
|
|
89
|
+
}]), intent.move(100, 320, 0, 0), intent.move(150, 320, 50, 0), (0, import_vitest.expect)(prefetched).toEqual(["/near"]);
|
|
90
|
+
}), (0, import_vitest.it)("picks better-aimed link over closer link", () => {
|
|
91
|
+
intent.setRects([{
|
|
92
|
+
r: rect(200, 400),
|
|
93
|
+
h: "/close-but-off"
|
|
94
|
+
},
|
|
95
|
+
// closer but significantly off-axis
|
|
96
|
+
{
|
|
97
|
+
r: rect(400, 300),
|
|
98
|
+
h: "/far-but-aimed"
|
|
99
|
+
}
|
|
100
|
+
// farther but dead-on
|
|
101
|
+
]), intent.move(100, 300, 0, 0), intent.move(150, 300, 50, 0), (0, import_vitest.expect)(prefetched).toEqual(["/far-but-aimed"]);
|
|
102
|
+
});
|
|
103
|
+
}), (0, import_vitest.describe)("velocity and smoothing", () => {
|
|
104
|
+
(0, import_vitest.it)("does not prefetch when mouse is stationary", () => {
|
|
105
|
+
intent.setRects([{
|
|
106
|
+
r: rect(500, 300),
|
|
107
|
+
h: "/about"
|
|
108
|
+
}]), intent.move(400, 300, 0, 0), intent.move(400, 300, 0, 0), intent.move(400, 300, 0, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
109
|
+
}), (0, import_vitest.it)("does not prefetch when mouse is moving slowly", () => {
|
|
110
|
+
intent.setRects([{
|
|
111
|
+
r: rect(500, 300),
|
|
112
|
+
h: "/about"
|
|
113
|
+
}]), intent.move(400, 300, 0, 0), intent.move(401, 300, 1, 0), intent.move(402, 300, 1, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
114
|
+
}), (0, import_vitest.it)("smooths velocity to avoid jitter false positives", () => {
|
|
115
|
+
intent.setRects([{
|
|
116
|
+
r: rect(500, 300),
|
|
117
|
+
h: "/about"
|
|
118
|
+
}]), intent.move(100, 300, 0, 0), intent.move(130, 305, 30, 5), intent.move(160, 298, 30, -7), intent.move(195, 303, 35, 5), (0, import_vitest.expect)(prefetched).toEqual(["/about"]);
|
|
119
|
+
});
|
|
120
|
+
}), (0, import_vitest.describe)("diagonal movement", () => {
|
|
121
|
+
(0, import_vitest.it)("prefetches with diagonal approach", () => {
|
|
122
|
+
intent.setRects([{
|
|
123
|
+
r: rect(500, 500),
|
|
124
|
+
h: "/corner"
|
|
125
|
+
}]), intent.move(200, 200, 0, 0), intent.move(240, 240, 40, 40), intent.move(290, 290, 50, 50), (0, import_vitest.expect)(prefetched).toEqual(["/corner"]);
|
|
126
|
+
}), (0, import_vitest.it)("handles angled approach to horizontal nav", () => {
|
|
127
|
+
intent.setRects([{
|
|
128
|
+
r: rect(400, 50),
|
|
129
|
+
h: "/link1"
|
|
130
|
+
}, {
|
|
131
|
+
r: rect(500, 50),
|
|
132
|
+
h: "/link2"
|
|
133
|
+
}, {
|
|
134
|
+
r: rect(600, 50),
|
|
135
|
+
h: "/link3"
|
|
136
|
+
}]), intent.move(300, 300, 0, 0), intent.move(340, 260, 40, -40), intent.move(390, 210, 50, -50), (0, import_vitest.expect)(prefetched.length).toBe(1);
|
|
137
|
+
});
|
|
138
|
+
}), (0, import_vitest.describe)("edge cases", () => {
|
|
139
|
+
(0, import_vitest.it)("handles empty rect list", () => {
|
|
140
|
+
intent.setRects([]), intent.move(100, 100, 0, 0), intent.move(150, 100, 50, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
141
|
+
}), (0, import_vitest.it)("handles link at cursor position", () => {
|
|
142
|
+
intent.setRects([{
|
|
143
|
+
r: rect(100, 100),
|
|
144
|
+
h: "/here"
|
|
145
|
+
}]), intent.move(150, 120, 0, 0), intent.move(160, 120, 10, 0), (0, import_vitest.expect)(prefetched.length).toBeLessThanOrEqual(1);
|
|
146
|
+
}), (0, import_vitest.it)("cleans up when observe returns cleanup function", () => {
|
|
147
|
+
intent.observe({
|
|
148
|
+
getBoundingClientRect: () => rect(500, 300)
|
|
149
|
+
}, "/test")(), intent.move(100, 300, 0, 0), intent.move(150, 300, 50, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
150
|
+
}), (0, import_vitest.it)("re-enables prefetch for href after cleanup", () => {
|
|
151
|
+
const el = {
|
|
152
|
+
getBoundingClientRect: () => rect(500, 300)
|
|
153
|
+
},
|
|
154
|
+
cleanup = intent.observe(el, "/test");
|
|
155
|
+
intent.setRects([{
|
|
156
|
+
r: rect(500, 300),
|
|
157
|
+
h: "/test"
|
|
158
|
+
}]), intent.move(100, 300, 0, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/test"]), cleanup(), prefetched.length = 0, intent.observe(el, "/test"), intent.setRects([{
|
|
159
|
+
r: rect(500, 300),
|
|
160
|
+
h: "/test"
|
|
161
|
+
}]), intent.move(100, 300, 0, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/test"]);
|
|
162
|
+
});
|
|
163
|
+
}), (0, import_vitest.describe)("reach configuration", () => {
|
|
164
|
+
(0, import_vitest.it)("respects maxReach option", () => {
|
|
165
|
+
const shortReach = (0, import_prefetchIntent.createPrefetchIntent)({
|
|
166
|
+
onPrefetch: href => prefetched.push(href),
|
|
167
|
+
maxReach: 200
|
|
168
|
+
});
|
|
169
|
+
shortReach.setRects([{
|
|
170
|
+
r: rect(500, 300),
|
|
171
|
+
h: "/far"
|
|
172
|
+
}]), shortReach.move(100, 300, 0, 0), shortReach.move(150, 300, 50, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
173
|
+
}), (0, import_vitest.it)("respects perpWeight option for aim strictness", () => {
|
|
174
|
+
const strictAim = (0, import_prefetchIntent.createPrefetchIntent)({
|
|
175
|
+
onPrefetch: href => prefetched.push(href),
|
|
176
|
+
perpWeight: 10
|
|
177
|
+
// very strict
|
|
178
|
+
});
|
|
179
|
+
strictAim.setRects([{
|
|
180
|
+
r: rect(400, 350),
|
|
181
|
+
h: "/off"
|
|
182
|
+
}]), strictAim.move(100, 300, 0, 0), strictAim.move(150, 300, 50, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
183
|
+
});
|
|
184
|
+
}), (0, import_vitest.describe)("memory and performance", () => {
|
|
185
|
+
(0, import_vitest.it)("does not leak elements after cleanup", () => {
|
|
186
|
+
const cleanups = [];
|
|
187
|
+
for (let i = 0; i < 100; i++) {
|
|
188
|
+
const el = {};
|
|
189
|
+
cleanups.push(intent.observe(el, `/page-${i}`));
|
|
190
|
+
}
|
|
191
|
+
(0, import_vitest.expect)(intent.nodes.size).toBe(100), cleanups.forEach(c => c()), (0, import_vitest.expect)(intent.nodes.size).toBe(0), (0, import_vitest.expect)(intent.done.size).toBe(0);
|
|
192
|
+
}), (0, import_vitest.it)("handles rapid observe/unobserve cycles", () => {
|
|
193
|
+
const el = {};
|
|
194
|
+
for (let i = 0; i < 100; i++) intent.observe(el, "/test")();
|
|
195
|
+
(0, import_vitest.expect)(intent.nodes.size).toBe(0);
|
|
196
|
+
}), (0, import_vitest.it)("processes 100 links efficiently", () => {
|
|
197
|
+
const links = [];
|
|
198
|
+
for (let row = 0; row < 10; row++) for (let col = 0; col < 10; col++) links.push({
|
|
199
|
+
r: rect(100 + col * 80, 100 + row * 50, 60, 30),
|
|
200
|
+
h: `/link-${row}-${col}`
|
|
201
|
+
});
|
|
202
|
+
intent.setRects(links);
|
|
203
|
+
const start = performance.now();
|
|
204
|
+
for (let i = 0; i < 100; i++) intent.move(50 + i * 5, 300, 5, 0);
|
|
205
|
+
const elapsed = performance.now() - start;
|
|
206
|
+
(0, import_vitest.expect)(elapsed).toBeLessThan(50);
|
|
207
|
+
}), (0, import_vitest.it)("removes prefetched links from rects to speed up future checks", () => {
|
|
208
|
+
const links = Array.from({
|
|
209
|
+
length: 10
|
|
210
|
+
}, (_, i) => ({
|
|
211
|
+
r: rect(200 + i * 100, 300),
|
|
212
|
+
h: `/link-${i}`
|
|
213
|
+
}));
|
|
214
|
+
intent.setRects(links), intent.move(100, 320, 0, 0), intent.move(150, 320, 50, 0), (0, import_vitest.expect)(prefetched.length).toBe(1), intent.move(100, 320, -50, 0), intent.move(150, 320, 50, 0), intent.move(200, 320, 50, 0), (0, import_vitest.expect)(prefetched.length).toBe(2), (0, import_vitest.expect)(prefetched[0]).not.toBe(prefetched[1]);
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
});
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
var import_vitest = require("vitest"), import_prefetchIntent = require("./prefetchIntent");
|
|
2
|
+
const rect = (x, y, w = 100, h = 40) => ({
|
|
3
|
+
left: x,
|
|
4
|
+
top: y,
|
|
5
|
+
right: x + w,
|
|
6
|
+
bottom: y + h,
|
|
7
|
+
width: w,
|
|
8
|
+
height: h,
|
|
9
|
+
x,
|
|
10
|
+
y,
|
|
11
|
+
toJSON: () => ({})
|
|
12
|
+
});
|
|
13
|
+
(0, import_vitest.describe)("prefetchIntent", () => {
|
|
14
|
+
let prefetched, intent;
|
|
15
|
+
(0, import_vitest.beforeEach)(() => {
|
|
16
|
+
prefetched = [], intent = (0, import_prefetchIntent.createPrefetchIntent)({
|
|
17
|
+
onPrefetch: (href) => prefetched.push(href)
|
|
18
|
+
});
|
|
19
|
+
}), (0, import_vitest.describe)("basic targeting", () => {
|
|
20
|
+
(0, import_vitest.it)("prefetches when moving directly toward a link", () => {
|
|
21
|
+
intent.setRects([{ r: rect(500, 300), h: "/about" }]), intent.move(100, 300, 0, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/about"]);
|
|
22
|
+
}), (0, import_vitest.it)("does not prefetch when moving away from a link", () => {
|
|
23
|
+
intent.setRects([{ r: rect(500, 300), h: "/about" }]), intent.move(400, 300, 0, 0), intent.move(380, 300, -20, 0), intent.move(350, 300, -30, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
24
|
+
}), (0, import_vitest.it)("does not prefetch when moving perpendicular to a link", () => {
|
|
25
|
+
intent.setRects([{ r: rect(500, 300), h: "/about" }]), intent.move(200, 300, 0, 0), intent.move(200, 330, 0, 30), intent.move(200, 370, 0, 40), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
26
|
+
}), (0, import_vitest.it)("prefetches link at long distance with good aim", () => {
|
|
27
|
+
intent.setRects([{ r: rect(500, 280), h: "/far" }]), intent.move(100, 300, 0, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/far"]);
|
|
28
|
+
}), (0, import_vitest.it)("does not prefetch when aim is slightly off at long distance", () => {
|
|
29
|
+
intent.setRects([{ r: rect(600, 300), h: "/far" }]), intent.move(100, 300, 0, 0), intent.move(140, 320, 40, 20), intent.move(200, 360, 60, 40), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
30
|
+
});
|
|
31
|
+
}), (0, import_vitest.describe)("prevents over-fetching", () => {
|
|
32
|
+
(0, import_vitest.it)("only prefetches each href once", () => {
|
|
33
|
+
intent.setRects([{ r: rect(500, 300), h: "/about" }]), intent.move(100, 300, 0, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/about"]), intent.move(100, 300, -100, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/about"]);
|
|
34
|
+
}), (0, import_vitest.it)("removes prefetched links from future consideration", () => {
|
|
35
|
+
intent.setRects([
|
|
36
|
+
{ r: rect(400, 300), h: "/first" },
|
|
37
|
+
{ r: rect(600, 300), h: "/second" }
|
|
38
|
+
]), intent.move(100, 300, 0, 0), intent.move(150, 300, 50, 0), (0, import_vitest.expect)(prefetched).toEqual(["/first"]), intent.move(250, 300, 100, 0), intent.move(350, 300, 100, 0), (0, import_vitest.expect)(prefetched).toEqual(["/first", "/second"]);
|
|
39
|
+
});
|
|
40
|
+
}), (0, import_vitest.describe)("winner-takes-all with clustered links", () => {
|
|
41
|
+
(0, import_vitest.it)("only prefetches the best target when multiple links are in path", () => {
|
|
42
|
+
intent.setRects([
|
|
43
|
+
{ r: rect(500, 280), h: "/top" },
|
|
44
|
+
{ r: rect(500, 320), h: "/middle" },
|
|
45
|
+
{ r: rect(500, 360), h: "/bottom" }
|
|
46
|
+
]), intent.move(100, 340, 0, 0), intent.move(150, 340, 50, 0), (0, import_vitest.expect)(prefetched.length).toBe(1), (0, import_vitest.expect)(prefetched[0]).toBe("/middle");
|
|
47
|
+
}), (0, import_vitest.it)("handles dense nav with 20 links", () => {
|
|
48
|
+
const links = Array.from({ length: 20 }, (_, i) => ({
|
|
49
|
+
r: rect(100 + i * 60, 50, 50, 30),
|
|
50
|
+
h: `/nav-${i}`
|
|
51
|
+
}));
|
|
52
|
+
intent.setRects(links), intent.move(700, 200, 0, 0), intent.move(700, 150, 0, -50), intent.move(700, 100, 0, -50), (0, import_vitest.expect)(prefetched.length).toBe(1), (0, import_vitest.expect)(prefetched[0]).toBe("/nav-10");
|
|
53
|
+
}), (0, import_vitest.it)("picks closer link when two are roughly aligned", () => {
|
|
54
|
+
intent.setRects([
|
|
55
|
+
{ r: rect(300, 300), h: "/near" },
|
|
56
|
+
{ r: rect(600, 300), h: "/far" }
|
|
57
|
+
]), intent.move(100, 320, 0, 0), intent.move(150, 320, 50, 0), (0, import_vitest.expect)(prefetched).toEqual(["/near"]);
|
|
58
|
+
}), (0, import_vitest.it)("picks better-aimed link over closer link", () => {
|
|
59
|
+
intent.setRects([
|
|
60
|
+
{ r: rect(200, 400), h: "/close-but-off" },
|
|
61
|
+
// closer but significantly off-axis
|
|
62
|
+
{ r: rect(400, 300), h: "/far-but-aimed" }
|
|
63
|
+
// farther but dead-on
|
|
64
|
+
]), intent.move(100, 300, 0, 0), intent.move(150, 300, 50, 0), (0, import_vitest.expect)(prefetched).toEqual(["/far-but-aimed"]);
|
|
65
|
+
});
|
|
66
|
+
}), (0, import_vitest.describe)("velocity and smoothing", () => {
|
|
67
|
+
(0, import_vitest.it)("does not prefetch when mouse is stationary", () => {
|
|
68
|
+
intent.setRects([{ r: rect(500, 300), h: "/about" }]), intent.move(400, 300, 0, 0), intent.move(400, 300, 0, 0), intent.move(400, 300, 0, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
69
|
+
}), (0, import_vitest.it)("does not prefetch when mouse is moving slowly", () => {
|
|
70
|
+
intent.setRects([{ r: rect(500, 300), h: "/about" }]), intent.move(400, 300, 0, 0), intent.move(401, 300, 1, 0), intent.move(402, 300, 1, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
71
|
+
}), (0, import_vitest.it)("smooths velocity to avoid jitter false positives", () => {
|
|
72
|
+
intent.setRects([{ r: rect(500, 300), h: "/about" }]), intent.move(100, 300, 0, 0), intent.move(130, 305, 30, 5), intent.move(160, 298, 30, -7), intent.move(195, 303, 35, 5), (0, import_vitest.expect)(prefetched).toEqual(["/about"]);
|
|
73
|
+
});
|
|
74
|
+
}), (0, import_vitest.describe)("diagonal movement", () => {
|
|
75
|
+
(0, import_vitest.it)("prefetches with diagonal approach", () => {
|
|
76
|
+
intent.setRects([{ r: rect(500, 500), h: "/corner" }]), intent.move(200, 200, 0, 0), intent.move(240, 240, 40, 40), intent.move(290, 290, 50, 50), (0, import_vitest.expect)(prefetched).toEqual(["/corner"]);
|
|
77
|
+
}), (0, import_vitest.it)("handles angled approach to horizontal nav", () => {
|
|
78
|
+
intent.setRects([
|
|
79
|
+
{ r: rect(400, 50), h: "/link1" },
|
|
80
|
+
{ r: rect(500, 50), h: "/link2" },
|
|
81
|
+
{ r: rect(600, 50), h: "/link3" }
|
|
82
|
+
]), intent.move(300, 300, 0, 0), intent.move(340, 260, 40, -40), intent.move(390, 210, 50, -50), (0, import_vitest.expect)(prefetched.length).toBe(1);
|
|
83
|
+
});
|
|
84
|
+
}), (0, import_vitest.describe)("edge cases", () => {
|
|
85
|
+
(0, import_vitest.it)("handles empty rect list", () => {
|
|
86
|
+
intent.setRects([]), intent.move(100, 100, 0, 0), intent.move(150, 100, 50, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
87
|
+
}), (0, import_vitest.it)("handles link at cursor position", () => {
|
|
88
|
+
intent.setRects([{ r: rect(100, 100), h: "/here" }]), intent.move(150, 120, 0, 0), intent.move(160, 120, 10, 0), (0, import_vitest.expect)(prefetched.length).toBeLessThanOrEqual(1);
|
|
89
|
+
}), (0, import_vitest.it)("cleans up when observe returns cleanup function", () => {
|
|
90
|
+
intent.observe(
|
|
91
|
+
{ getBoundingClientRect: () => rect(500, 300) },
|
|
92
|
+
"/test"
|
|
93
|
+
)(), intent.move(100, 300, 0, 0), intent.move(150, 300, 50, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
94
|
+
}), (0, import_vitest.it)("re-enables prefetch for href after cleanup", () => {
|
|
95
|
+
const el = { getBoundingClientRect: () => rect(500, 300) }, cleanup = intent.observe(el, "/test");
|
|
96
|
+
intent.setRects([{ r: rect(500, 300), h: "/test" }]), intent.move(100, 300, 0, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/test"]), cleanup(), prefetched.length = 0, intent.observe(el, "/test"), intent.setRects([{ r: rect(500, 300), h: "/test" }]), intent.move(100, 300, 0, 0), intent.move(140, 300, 40, 0), intent.move(200, 300, 60, 0), (0, import_vitest.expect)(prefetched).toEqual(["/test"]);
|
|
97
|
+
});
|
|
98
|
+
}), (0, import_vitest.describe)("reach configuration", () => {
|
|
99
|
+
(0, import_vitest.it)("respects maxReach option", () => {
|
|
100
|
+
const shortReach = (0, import_prefetchIntent.createPrefetchIntent)({
|
|
101
|
+
onPrefetch: (href) => prefetched.push(href),
|
|
102
|
+
maxReach: 200
|
|
103
|
+
});
|
|
104
|
+
shortReach.setRects([{ r: rect(500, 300), h: "/far" }]), shortReach.move(100, 300, 0, 0), shortReach.move(150, 300, 50, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
105
|
+
}), (0, import_vitest.it)("respects perpWeight option for aim strictness", () => {
|
|
106
|
+
const strictAim = (0, import_prefetchIntent.createPrefetchIntent)({
|
|
107
|
+
onPrefetch: (href) => prefetched.push(href),
|
|
108
|
+
perpWeight: 10
|
|
109
|
+
// very strict
|
|
110
|
+
});
|
|
111
|
+
strictAim.setRects([{ r: rect(400, 350), h: "/off" }]), strictAim.move(100, 300, 0, 0), strictAim.move(150, 300, 50, 0), (0, import_vitest.expect)(prefetched).toEqual([]);
|
|
112
|
+
});
|
|
113
|
+
}), (0, import_vitest.describe)("memory and performance", () => {
|
|
114
|
+
(0, import_vitest.it)("does not leak elements after cleanup", () => {
|
|
115
|
+
const cleanups = [];
|
|
116
|
+
for (let i = 0; i < 100; i++) {
|
|
117
|
+
const el = {};
|
|
118
|
+
cleanups.push(intent.observe(el, `/page-${i}`));
|
|
119
|
+
}
|
|
120
|
+
(0, import_vitest.expect)(intent.nodes.size).toBe(100), cleanups.forEach((c) => c()), (0, import_vitest.expect)(intent.nodes.size).toBe(0), (0, import_vitest.expect)(intent.done.size).toBe(0);
|
|
121
|
+
}), (0, import_vitest.it)("handles rapid observe/unobserve cycles", () => {
|
|
122
|
+
const el = {};
|
|
123
|
+
for (let i = 0; i < 100; i++)
|
|
124
|
+
intent.observe(el, "/test")();
|
|
125
|
+
(0, import_vitest.expect)(intent.nodes.size).toBe(0);
|
|
126
|
+
}), (0, import_vitest.it)("processes 100 links efficiently", () => {
|
|
127
|
+
const links = [];
|
|
128
|
+
for (let row = 0; row < 10; row++)
|
|
129
|
+
for (let col = 0; col < 10; col++)
|
|
130
|
+
links.push({
|
|
131
|
+
r: rect(100 + col * 80, 100 + row * 50, 60, 30),
|
|
132
|
+
h: `/link-${row}-${col}`
|
|
133
|
+
});
|
|
134
|
+
intent.setRects(links);
|
|
135
|
+
const start = performance.now();
|
|
136
|
+
for (let i = 0; i < 100; i++)
|
|
137
|
+
intent.move(50 + i * 5, 300, 5, 0);
|
|
138
|
+
const elapsed = performance.now() - start;
|
|
139
|
+
(0, import_vitest.expect)(elapsed).toBeLessThan(50);
|
|
140
|
+
}), (0, import_vitest.it)("removes prefetched links from rects to speed up future checks", () => {
|
|
141
|
+
const links = Array.from({ length: 10 }, (_, i) => ({
|
|
142
|
+
r: rect(200 + i * 100, 300),
|
|
143
|
+
h: `/link-${i}`
|
|
144
|
+
}));
|
|
145
|
+
intent.setRects(links), intent.move(100, 320, 0, 0), intent.move(150, 320, 50, 0), (0, import_vitest.expect)(prefetched.length).toBe(1), intent.move(100, 320, -50, 0), intent.move(150, 320, 50, 0), intent.move(200, 320, 50, 0), (0, import_vitest.expect)(prefetched.length).toBe(2), (0, import_vitest.expect)(prefetched[0]).not.toBe(prefetched[1]);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
//# sourceMappingURL=prefetchIntent.test.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/link/prefetchIntent.test.ts"],
|
|
4
|
+
"mappings": "AAAA,oBAAqD,mBACrD,wBAAiE;AAGjE,MAAM,OAAO,CAAC,GAAW,GAAW,IAAI,KAAK,IAAI,QAAyB;AAAA,EACxE,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO,IAAI;AAAA,EACX,QAAQ,IAAI;AAAA,EACZ,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ,OAAO,CAAC;AAClB;AAAA,IAEA,wBAAS,kBAAkB,MAAM;AAC/B,MAAI,YACA;AAEJ,gCAAW,MAAM;AACf,iBAAa,CAAC,GACd,aAAS,4CAAqB;AAAA,MAC5B,YAAY,CAAC,SAAS,WAAW,KAAK,IAAI;AAAA,IAC5C,CAAC;AAAA,EACH,CAAC,OAED,wBAAS,mBAAmB,MAAM;AAChC,0BAAG,iDAAiD,MAAM;AACxD,aAAO,SAAS,CAAC,EAAE,GAAG,KAAK,KAAK,GAAG,GAAG,GAAG,SAAS,CAAC,CAAC,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