@justai/core 0.37.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scroll.d.ts +12 -0
- package/dist/scroll.js +6 -2
- package/package.json +2 -2
package/dist/scroll.d.ts
CHANGED
|
@@ -18,6 +18,18 @@ export interface PersonaScrollOptions {
|
|
|
18
18
|
titleFor?: (id: string) => string;
|
|
19
19
|
/** Whether this owns `body.ready`. Pass `false` on a page that renders asynchronously. */
|
|
20
20
|
reveal?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Which section a visit with no hash opens on. Defaults to `"kernel"`, which is right for every
|
|
23
|
+
* persona in the fleet: their kernel is the thing they do, and the profile above it is a header
|
|
24
|
+
* you scroll back to.
|
|
25
|
+
*
|
|
26
|
+
* app.zone is the exception this exists for. Its kernel is a catalogue of the OTHER personas, so
|
|
27
|
+
* landing there opens the house on a list of its rooms — the mark, the wordmark and the sentence
|
|
28
|
+
* that say what app.zone is scroll past before anyone reads them. Named rather than boolean so a
|
|
29
|
+
* persona can point at any of its own cuts; an id that is not on the page falls back to the
|
|
30
|
+
* kernel rather than landing nowhere.
|
|
31
|
+
*/
|
|
32
|
+
landOn?: string;
|
|
21
33
|
}
|
|
22
34
|
export declare function personaScroll(options?: PersonaScrollOptions): void;
|
|
23
35
|
export declare function personaScrollJs(options?: PersonaScrollOptions): string;
|
package/dist/scroll.js
CHANGED
|
@@ -222,8 +222,12 @@ export function personaScroll(options) {
|
|
|
222
222
|
const sentTo = (() => {
|
|
223
223
|
const t = cuts.find((c) => "#" + c[0].id === location.hash);
|
|
224
224
|
// A section hash is honoured on load and refresh; anything else — including #kernel and no hash
|
|
225
|
-
// at all — lands on the kernel.
|
|
226
|
-
|
|
225
|
+
// at all — lands on `landOn`, which is the kernel unless a persona says otherwise.
|
|
226
|
+
//
|
|
227
|
+
// The fallback chain is deliberate: an unknown id must not land the page nowhere. `el()` returns
|
|
228
|
+
// null for an id the page does not carry, and every caller downstream of this reads `sentTo` as
|
|
229
|
+
// a section that exists.
|
|
230
|
+
return t ? t[0] : (o.landOn ? el(o.landOn) : null) ?? kernel;
|
|
227
231
|
})();
|
|
228
232
|
const land = () => {
|
|
229
233
|
// presentation mode owns the viewport — a page presenting itself does not scroll out from under
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justai/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "The framework-free heart of the persona shell
|
|
3
|
+
"version": "0.38.0",
|
|
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": {
|
|
7
7
|
"type": "git",
|