@justai/core 0.9.0 → 0.9.2
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 +1 -1
- package/src/index.js +14 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justai/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "The framework-free heart of the persona shell — 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": {
|
package/src/index.js
CHANGED
|
@@ -538,9 +538,13 @@ export function personaScroll(options) {
|
|
|
538
538
|
// a persona's own code — and is left alone. Derived from the toolbar rather than chosen, so it
|
|
539
539
|
// stays true if the bar ever changes shape.
|
|
540
540
|
const drift = toolbar ? toolbar.getBoundingClientRect().height : 0;
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
541
|
+
// Arriving does NOT end the promise. The page can be nudged again long after it settled — a
|
|
542
|
+
// consent sheet closing moved qr by 3px, and released early that is enough to hand the section
|
|
543
|
+
// back to the profile while the kernel fills the screen. The promise ends when somebody takes
|
|
544
|
+
// over, or when the page is moved somewhere it was plainly never sent.
|
|
545
|
+
if (off <= 1) return;
|
|
546
|
+
if (off <= drift) land();
|
|
547
|
+
else landed = true;
|
|
544
548
|
};
|
|
545
549
|
requestAnimationFrame(landIfUntouched);
|
|
546
550
|
window.addEventListener("load", landIfUntouched);
|
|
@@ -650,6 +654,12 @@ export function personaScroll(options) {
|
|
|
650
654
|
const t = cuts.find((c) => "#" + c[0].id === a.getAttribute("href"));
|
|
651
655
|
if (!t) return;
|
|
652
656
|
e.preventDefault();
|
|
657
|
+
// A NEW LANDING RE-ARMS THE PROMISE. Somebody asking for a cut is asking to arrive at it, and the
|
|
658
|
+
// arrival needs the same protection the page's first one had: the title strip opens as the kernel
|
|
659
|
+
// becomes current, which drags the scroll ~18px past the mark and tucks the kernel's first line
|
|
660
|
+
// under the sticky bar. Without this the toolbar's own icon landed flush and the avatar did not,
|
|
661
|
+
// for no reason a person could see.
|
|
662
|
+
landed = false;
|
|
653
663
|
goTo(t[0], "smooth");
|
|
654
664
|
setHash(t[0].id);
|
|
655
665
|
});
|
|
@@ -658,7 +668,7 @@ export function personaScroll(options) {
|
|
|
658
668
|
// `setHash` uses replaceState and fires nothing, so this can only be somebody else's navigation.
|
|
659
669
|
window.addEventListener("hashchange", () => {
|
|
660
670
|
const t = cuts.find((c) => "#" + c[0].id === location.hash);
|
|
661
|
-
if (t) goTo(t[0], "smooth");
|
|
671
|
+
if (t) { landed = false; goTo(t[0], "smooth"); }
|
|
662
672
|
});
|
|
663
673
|
}
|
|
664
674
|
|