@justai/core 0.34.0 → 0.34.1
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/package.json +2 -2
- package/src/index.js +17 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justai/core",
|
|
3
|
-
"version": "0.34.
|
|
4
|
-
"description": "The framework-free heart of the persona shell
|
|
3
|
+
"version": "0.34.1",
|
|
4
|
+
"description": "The framework-free heart of the persona shell \u2014 the load-bearing behaviour (auth capture, reveal, ready) as plain strings, so Astro and Next inject the SAME logic instead of each re-writing it.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
package/src/index.js
CHANGED
|
@@ -961,9 +961,26 @@ export function personaScroll(options) {
|
|
|
961
961
|
window.addEventListener(ev, takeBack, { passive: true, once: true, capture: true });
|
|
962
962
|
}
|
|
963
963
|
if (typeof ResizeObserver === "function") {
|
|
964
|
+
// queries: the keeper fought a programmatic scroll · scrollTo(0) snapped back to the kernel ·
|
|
965
|
+
// the query-survives spec times out in CI · near band 64
|
|
966
|
+
//
|
|
967
|
+
// AND THE KEEPER ONLY ACTS WHILE THE PAGE IS STILL AT THE LANDING. CI caught the first version
|
|
968
|
+
// within the hour: a consumer's programmatic scrollTo(0) — which no gesture listener sees — was
|
|
969
|
+
// followed by the fonts settling, the resize fired, and the keeper yanked the page back to the
|
|
970
|
+
// kernel from somewhere it had been deliberately sent. Gestures cannot be the only release,
|
|
971
|
+
// because a page is allowed to scroll ITSELF (lendcam's stage does; a spec does).
|
|
972
|
+
//
|
|
973
|
+
// So the promise is spatial as well: on every resize the keeper first asks whether the page is
|
|
974
|
+
// still within a hand's width (64px) of where it last held it. Layout shifts displace a landed
|
|
975
|
+
// page by small strokes — the vault's was 18px — while anybody scrolling AWAY, by hand or by
|
|
976
|
+
// code, leaves that band immediately and permanently: the keeper reads leaving as being
|
|
977
|
+
// relieved of duty, not as something to correct.
|
|
978
|
+
let kept = landingY(sentTo);
|
|
964
979
|
const keeper = new ResizeObserver(() => {
|
|
965
980
|
if (touched || document.body.dataset.present) { keeper.disconnect(); return; }
|
|
981
|
+
if (Math.abs(window.scrollY - kept) > 64) { keeper.disconnect(); return; }
|
|
966
982
|
const want = landingY(sentTo);
|
|
983
|
+
kept = want;
|
|
967
984
|
// A pixel of slack: browsers land sub-pixel scrolls a hair off the number they were handed,
|
|
968
985
|
// and re-asserting over a rounding error would run on every breath the page takes.
|
|
969
986
|
if (Math.abs(window.scrollY - want) > 1) goTo(sentTo, "instant");
|