@graview/pages 0.1.18 → 0.1.19
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/README.md +3 -1
- package/dist/ask-place.d.ts +14 -20
- package/dist/ask-place.d.ts.map +1 -1
- package/dist/ask-place.js +12 -17
- package/dist/ask-place.js.map +1 -1
- package/dist/ask.d.ts +7 -8
- package/dist/ask.d.ts.map +1 -1
- package/dist/ask.js +84 -84
- package/dist/ask.js.map +1 -1
- package/dist/face-placed.d.ts +4 -2
- package/dist/face-placed.d.ts.map +1 -1
- package/dist/face-placed.js.map +1 -1
- package/dist/facts.d.ts.map +1 -1
- package/dist/facts.js +2 -2
- package/dist/facts.js.map +1 -1
- package/dist/page-context.d.ts +28 -2
- package/dist/page-context.d.ts.map +1 -1
- package/dist/page-context.js +3 -3
- package/dist/page-context.js.map +1 -1
- package/dist/page-draft.d.ts +12 -0
- package/dist/page-draft.d.ts.map +1 -0
- package/dist/page-draft.js +33 -0
- package/dist/page-draft.js.map +1 -0
- package/dist/page-places.d.ts.map +1 -1
- package/dist/page-places.js +2 -7
- package/dist/page-places.js.map +1 -1
- package/dist/page-record.js +1 -1
- package/dist/page-record.js.map +1 -1
- package/dist/page-search.d.ts +3 -0
- package/dist/page-search.d.ts.map +1 -1
- package/dist/page-search.js +19 -5
- package/dist/page-search.js.map +1 -1
- package/dist/page-shell.d.ts +11 -0
- package/dist/page-shell.d.ts.map +1 -1
- package/dist/page-shell.js +15 -7
- package/dist/page-shell.js.map +1 -1
- package/dist/page-typography.d.ts +1 -0
- package/dist/page-typography.d.ts.map +1 -1
- package/dist/page-typography.js +3 -1
- package/dist/page-typography.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +4 -8
- package/dist/registry.js.map +1 -1
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +34 -10
- package/dist/router.js.map +1 -1
- package/package.json +6 -6
- package/dist/ask-companion.d.ts +0 -2
- package/dist/ask-companion.d.ts.map +0 -1
- package/dist/ask-companion.js +0 -8
- package/dist/ask-companion.js.map +0 -1
package/README.md
CHANGED
|
@@ -27,7 +27,9 @@ this package serves lists, records, forms, problems and history as ordinary link
|
|
|
27
27
|
"More" (FR-145); then Find, the standing and the person. A page keeps only its own links — a picture
|
|
28
28
|
its kind as a list, a record "In the scene ↗" to its stop there.
|
|
29
29
|
Under an embed's bar the shell draws none of it, and the face's Find goes in
|
|
30
|
-
that bar.
|
|
30
|
+
that bar. A design's own shell stands under the bar too (`context.barAbove`),
|
|
31
|
+
drawing only what is its own; `surface("shell", Shell, { without: ["bar"] })`
|
|
32
|
+
makes it the whole window. Each page's own title is said a level under the app's name. See
|
|
31
33
|
`apps/todo` for both mounted from one declaration (`/` scene, `/pages` routed).
|
|
32
34
|
- **The host may own the history.** `basename` mounts the face under a path;
|
|
33
35
|
`onNavigate(path, how)` tells a host each page the face opens (`"push"`,
|
package/dist/ask-place.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* THE
|
|
2
|
+
* THE SEAT STAYS IN ITS OWN BOX.
|
|
3
3
|
*
|
|
4
4
|
* On graview.dev the routed face of a chapter stood its "Ask" at the foot
|
|
5
5
|
* of the WINDOW, fixed there like a page's own control: over the hero's
|
|
6
6
|
* caption, over the copy beside it and over every section scrolled past,
|
|
7
7
|
* while the embed it belonged to was somewhere else. On somebody else's page
|
|
8
|
-
* the face's box is the whole of its world, so the
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* the face's box is the whole of its world, so the seat stands in the part
|
|
9
|
+
* of that box that shows on the screen, and is put away when too little of
|
|
10
|
+
* the box shows to hold it.
|
|
11
11
|
*/
|
|
12
12
|
/** A box on the screen, as `getBoundingClientRect` says it. */
|
|
13
13
|
export interface ScreenBox {
|
|
@@ -16,29 +16,23 @@ export interface ScreenBox {
|
|
|
16
16
|
readonly right: number;
|
|
17
17
|
readonly bottom: number;
|
|
18
18
|
}
|
|
19
|
-
/** Where the
|
|
19
|
+
/** Where the seat's box goes, in the fixed coordinates of the window. */
|
|
20
20
|
export interface AskPlace {
|
|
21
|
-
/** False when too little of the box shows to hold the
|
|
21
|
+
/** False when too little of the box shows to hold the seat: it is put away until more does. */
|
|
22
22
|
readonly shown: boolean;
|
|
23
|
-
readonly
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
readonly drawer: {
|
|
28
|
-
readonly left: number;
|
|
29
|
-
readonly top: number;
|
|
30
|
-
readonly height: number;
|
|
31
|
-
readonly width: number;
|
|
32
|
-
};
|
|
23
|
+
readonly left: number;
|
|
24
|
+
readonly top: number;
|
|
25
|
+
readonly width: number;
|
|
26
|
+
readonly height: number;
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
35
|
-
* The
|
|
36
|
-
*
|
|
29
|
+
* The part of `box` that shows in a window `view` wide and high: the seat
|
|
30
|
+
* stands at its foot. `need` is the least the closed field needs.
|
|
37
31
|
*/
|
|
38
32
|
export declare function askPlace(box: ScreenBox, view: {
|
|
39
33
|
readonly width: number;
|
|
40
34
|
readonly height: number;
|
|
41
|
-
},
|
|
35
|
+
}, need: {
|
|
42
36
|
readonly width: number;
|
|
43
37
|
readonly height: number;
|
|
44
38
|
}): AskPlace;
|
|
@@ -46,7 +40,7 @@ export declare function askPlace(box: ScreenBox, view: {
|
|
|
46
40
|
* Puts a fixed `element` at `at` on the screen, or away. FIXED TO WHAT HOLDS
|
|
47
41
|
* IT, which is not always the window: a host that animates its stage with a
|
|
48
42
|
* transform (graview.dev's hero) makes that stage the box `fixed` is measured
|
|
49
|
-
* from, and the
|
|
43
|
+
* from, and the seat stood on the caption under it. Where it landed is read
|
|
50
44
|
* back and the difference taken off.
|
|
51
45
|
*/
|
|
52
46
|
export declare function pin(element: HTMLElement, at: {
|
package/dist/ask-place.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-place.d.ts","sourceRoot":"","sources":["../src/ask-place.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E,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAWnH"}
|
package/dist/ask-place.js
CHANGED
|
@@ -1,45 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* THE
|
|
2
|
+
* THE SEAT STAYS IN ITS OWN BOX.
|
|
3
3
|
*
|
|
4
4
|
* On graview.dev the routed face of a chapter stood its "Ask" at the foot
|
|
5
5
|
* of the WINDOW, fixed there like a page's own control: over the hero's
|
|
6
6
|
* caption, over the copy beside it and over every section scrolled past,
|
|
7
7
|
* while the embed it belonged to was somewhere else. On somebody else's page
|
|
8
|
-
* the face's box is the whole of its world, so the
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* the face's box is the whole of its world, so the seat stands in the part
|
|
9
|
+
* of that box that shows on the screen, and is put away when too little of
|
|
10
|
+
* the box shows to hold it.
|
|
11
11
|
*/
|
|
12
|
-
/** The gap between the
|
|
12
|
+
/** The gap between the seat and the edges of its box. */
|
|
13
13
|
const GAP = 16;
|
|
14
|
-
/** The drawer's width on a desk; on anything narrower it is the box's. */
|
|
15
|
-
const DRAWER = 320;
|
|
16
14
|
/**
|
|
17
|
-
* The
|
|
18
|
-
*
|
|
15
|
+
* The part of `box` that shows in a window `view` wide and high: the seat
|
|
16
|
+
* stands at its foot. `need` is the least the closed field needs.
|
|
19
17
|
*/
|
|
20
|
-
export function askPlace(box, view,
|
|
18
|
+
export function askPlace(box, view, need) {
|
|
21
19
|
const left = Math.max(0, box.left);
|
|
22
20
|
const right = Math.min(view.width, box.right);
|
|
23
21
|
const top = Math.max(0, box.top);
|
|
24
22
|
const foot = Math.min(view.height, box.bottom);
|
|
25
|
-
const shown = foot - top >=
|
|
26
|
-
return {
|
|
27
|
-
shown,
|
|
28
|
-
button: { left: Math.round(left + GAP), top: Math.round(foot - GAP - size.height) },
|
|
29
|
-
drawer: { left: Math.round(left), top: Math.round(top), height: Math.round(Math.max(0, foot - top)), width: Math.round(Math.max(0, Math.min(DRAWER, right - left))) },
|
|
30
|
-
};
|
|
23
|
+
const shown = foot - top >= need.height + 2 * GAP && right - left >= need.width + 2 * GAP;
|
|
24
|
+
return { shown, left: Math.round(left), top: Math.round(top), width: Math.round(Math.max(0, right - left)), height: Math.round(Math.max(0, foot - top)) };
|
|
31
25
|
}
|
|
32
26
|
/**
|
|
33
27
|
* Puts a fixed `element` at `at` on the screen, or away. FIXED TO WHAT HOLDS
|
|
34
28
|
* IT, which is not always the window: a host that animates its stage with a
|
|
35
29
|
* transform (graview.dev's hero) makes that stage the box `fixed` is measured
|
|
36
|
-
* from, and the
|
|
30
|
+
* from, and the seat stood on the caption under it. Where it landed is read
|
|
37
31
|
* back and the difference taken off.
|
|
38
32
|
*/
|
|
39
33
|
export function pin(element, at, shown) {
|
|
40
34
|
const style = element.style;
|
|
41
35
|
style.left = `${at.left}px`;
|
|
42
36
|
style.top = `${at.top}px`;
|
|
37
|
+
style.right = "auto";
|
|
43
38
|
style.bottom = "auto";
|
|
44
39
|
style.visibility = shown ? "" : "hidden";
|
|
45
40
|
const landed = element.getBoundingClientRect();
|
package/dist/ask-place.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-place.js","sourceRoot":"","sources":["../src/ask-place.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"ask-place.js","sourceRoot":"","sources":["../src/ask-place.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAoBH,yDAAyD;AACzD,MAAM,GAAG,GAAG,EAAE,CAAC;AAEf;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAc,EAAE,IAAyD,EAAE,IAAyD;IAC3J,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,K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AE,CAAC,CAAC,CAAC,QAAQ,CAAC;IACzC,MAAM,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAC/C,IAAI,MAAM,CAAC,KAAK,KAAK,CAAC;QAAE,OAAO;IAC/B,KAAK,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1D,KAAK,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;AACzD,CAAC"}
|
package/dist/ask.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { type AnySchema } from "@graview/core";
|
|
2
2
|
import type { PageContext } from "./pages.js";
|
|
3
3
|
/**
|
|
4
|
-
* THE
|
|
4
|
+
* THE SEAT ON EVERY PAGE — the same one as on the scene, not a second.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* A quiet ask field at the foot-left of the window ("Ask Things…") that
|
|
7
|
+
* grows into the conversation when asked, over the page and never pushing
|
|
8
|
+
* it; on a phone, a bottom sheet. It is the scene's own seat
|
|
9
|
+
* (`SeatField`), holding the app's one conversation, so a question asked
|
|
10
|
+
* on the scene is still there on Pages.
|
|
11
11
|
*
|
|
12
12
|
* WHAT "THIS" MEANS HERE IS THE ROUTE. On a record it is that record; on a
|
|
13
13
|
* kind's page, that kind; on a picture, the kind it is a picture of. The
|
|
14
14
|
* provider's selection is set from the address, so the same question means
|
|
15
|
-
* the same thing on both faces
|
|
16
|
-
* selection first) does the rest.
|
|
15
|
+
* the same thing on both faces.
|
|
17
16
|
*/
|
|
18
17
|
export declare function PageAsk<S extends AnySchema>({ context }: {
|
|
19
18
|
readonly context: PageContext<S>;
|
package/dist/ask.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../src/ask.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../src/ask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAQtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,SAAS,EAAE,EAAE,OAAO,EAAE,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CAAE,sCAmD7F"}
|
package/dist/ask.js
CHANGED
|
@@ -1,111 +1,119 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
import {
|
|
3
|
-
import { retryingImport } from "@graview/core/retry";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { layer } from "@graview/core";
|
|
4
3
|
import { aggregateId, kindCardId } from "@graview/layout/view";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { SeatField } from "@graview/primitives/pages";
|
|
5
|
+
import { useGraviewIfAny } from "@graview/react/provider";
|
|
6
|
+
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
7
7
|
import { askPlace, pin } from "./ask-place.js";
|
|
8
8
|
import { useLocation, useNavigate } from "react-router-dom";
|
|
9
9
|
import { kindOfSlug, recordPath } from "./registry.js";
|
|
10
|
-
const Companion = lazyModule(retryingImport(() => import("./ask-companion.js"))).part((companion, props) => {
|
|
11
|
-
const Panel = companion.Companion;
|
|
12
|
-
return _jsx(Panel, { ...props });
|
|
13
|
-
}, { what: "The assistant" });
|
|
14
10
|
/**
|
|
15
|
-
* THE
|
|
11
|
+
* THE SEAT ON EVERY PAGE — the same one as on the scene, not a second.
|
|
16
12
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
13
|
+
* A quiet ask field at the foot-left of the window ("Ask Things…") that
|
|
14
|
+
* grows into the conversation when asked, over the page and never pushing
|
|
15
|
+
* it; on a phone, a bottom sheet. It is the scene's own seat
|
|
16
|
+
* (`SeatField`), holding the app's one conversation, so a question asked
|
|
17
|
+
* on the scene is still there on Pages.
|
|
22
18
|
*
|
|
23
19
|
* WHAT "THIS" MEANS HERE IS THE ROUTE. On a record it is that record; on a
|
|
24
20
|
* kind's page, that kind; on a picture, the kind it is a picture of. The
|
|
25
21
|
* provider's selection is set from the address, so the same question means
|
|
26
|
-
* the same thing on both faces
|
|
27
|
-
* selection first) does the rest.
|
|
22
|
+
* the same thing on both faces.
|
|
28
23
|
*/
|
|
29
24
|
export function PageAsk({ context }) {
|
|
30
|
-
const [open, setOpen] = useState(false);
|
|
31
25
|
const navigate = useNavigate();
|
|
32
26
|
const here = useGraviewIfAny();
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
27
|
+
const { pathname } = useLocation();
|
|
28
|
+
const [, first, second] = pathname.split("/");
|
|
29
|
+
const placeHere = first === "places" && second ? decodeURIComponent(second) : undefined;
|
|
30
|
+
const box = useRef(null);
|
|
31
|
+
useInItsBox(box, here !== null);
|
|
36
32
|
if (!here)
|
|
37
33
|
return null;
|
|
38
|
-
return (_jsxs(_Fragment, { children: [_jsx(RouteSubject, { context: context }),
|
|
39
|
-
position: "fixed",
|
|
40
|
-
left: 16,
|
|
41
|
-
bottom: 16,
|
|
42
|
-
zIndex: layer("rail"),
|
|
43
|
-
display: "inline-flex",
|
|
44
|
-
alignItems: "center",
|
|
45
|
-
gap: 6,
|
|
46
|
-
minHeight: 40,
|
|
47
|
-
padding: "0 14px",
|
|
48
|
-
borderRadius: 999,
|
|
49
|
-
border: "1px solid var(--graview-edge)",
|
|
50
|
-
background: "var(--graview-float)",
|
|
51
|
-
color: "var(--graview-ink)",
|
|
52
|
-
font: "inherit",
|
|
53
|
-
fontSize: "0.9375rem",
|
|
54
|
-
boxShadow: "var(--graview-lift-low)",
|
|
55
|
-
cursor: "pointer",
|
|
56
|
-
}, children: [_jsx("span", { "aria-hidden": "true", children: "\u25C6" }), open ? "Close" : "Ask"] }), open ? (_jsx("div", { ref: drawer, "data-testid": "page-ask-drawer",
|
|
34
|
+
return (_jsxs(_Fragment, { children: [_jsx(RouteSubject, { context: context }), _jsx("div", { ref: box, "data-testid": "page-seat",
|
|
57
35
|
/*
|
|
58
|
-
* The
|
|
59
|
-
*
|
|
60
|
-
*
|
|
36
|
+
* The box the seat stands at the foot of: the page's reading
|
|
37
|
+
* column, or the part of an embed's box that shows. It takes no pointer and no room; the
|
|
38
|
+
* seat inside it is the only thing a press lands on.
|
|
61
39
|
*/
|
|
62
|
-
style: {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
40
|
+
style: { position: "fixed", left: 0, top: 0, width: "100vw", height: "100dvh", pointerEvents: "none", zIndex: layer("rail"), containerType: "size" }, children: _jsx(SeatField, { onPick: (id) => {
|
|
41
|
+
const node = context.store.graph.getNode(id);
|
|
42
|
+
if (node)
|
|
43
|
+
navigate(recordPath(context.store.schema, node.kind, id));
|
|
44
|
+
},
|
|
45
|
+
/*
|
|
46
|
+
* WHERE AN ANSWER TAKES THE APP, ON THIS FACE: its address, through
|
|
47
|
+
* the router, so Back walks out of it. The scene itself is the
|
|
48
|
+
* other face's: the embed's way there, else its own address.
|
|
49
|
+
*/
|
|
50
|
+
onMove: (move) => {
|
|
51
|
+
if (here.seatTalk.get().draft)
|
|
52
|
+
here.seatTalk.setDraft(null);
|
|
53
|
+
if (move.to === "place" && (move.face === "scene" || move.slug === "overview")) {
|
|
54
|
+
if (context.overview)
|
|
55
|
+
context.overview("#");
|
|
56
|
+
else if (!context.embedded)
|
|
57
|
+
window.location.assign(context.sceneHref ?? "/");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
navigate(move.address);
|
|
61
|
+
}, ...(placeHere ? { place: placeHere } : {}),
|
|
62
|
+
/* A view drawn stands in the main column, at its own address. */
|
|
63
|
+
onDraft: () => {
|
|
64
|
+
if (pathname !== "/~draft")
|
|
65
|
+
navigate("/~draft");
|
|
66
|
+
} }) })] }));
|
|
75
67
|
}
|
|
68
|
+
/** The least the closed field needs of the box it stands in. */
|
|
69
|
+
const NEED = { width: 160, height: 40 };
|
|
76
70
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
71
|
+
* THE SEAT STANDS IN THE PAGE'S OWN BOX (see `ask-place.ts`): in an embed,
|
|
72
|
+
* the embed's box as it shows on the screen; on a face that is the whole
|
|
73
|
+
* page, its reading column (`main`), so a field at the foot's left stands
|
|
74
|
+
* under the page and not across the list of places beside it. Placed again
|
|
75
|
+
* as the page scrolls, the box changes size or the route changes, and put
|
|
76
|
+
* away while too little of the box shows.
|
|
81
77
|
*/
|
|
82
|
-
function
|
|
78
|
+
function useInItsBox(anchor, drawn) {
|
|
79
|
+
const { pathname } = useLocation();
|
|
83
80
|
useLayoutEffect(() => {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
if (!ask || !box)
|
|
81
|
+
const element = anchor.current;
|
|
82
|
+
if (!element)
|
|
87
83
|
return;
|
|
84
|
+
const embed = element.parentElement?.closest("[data-embed-content]") ?? null;
|
|
85
|
+
const boxOf = () => embed ?? document.querySelector("main") ?? null;
|
|
88
86
|
const place = () => {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
pin(sheet, at.drawer, at.shown);
|
|
96
|
-
}
|
|
87
|
+
const box = boxOf();
|
|
88
|
+
const view = { width: document.documentElement.clientWidth || innerWidth, height: innerHeight };
|
|
89
|
+
const at = askPlace(box?.getBoundingClientRect() ?? { left: 0, top: 0, right: view.width, bottom: view.height }, view, NEED);
|
|
90
|
+
element.style.width = `${at.width}px`;
|
|
91
|
+
element.style.height = `${at.height}px`;
|
|
92
|
+
pin(element, at, at.shown);
|
|
97
93
|
};
|
|
98
94
|
place();
|
|
99
95
|
addEventListener("resize", place);
|
|
100
96
|
addEventListener("scroll", place, true);
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
/*
|
|
98
|
+
* Placed in the next frame, not inside the observer's own delivery: the
|
|
99
|
+
* box placed is one the seat's field measures too, and a size changed
|
|
100
|
+
* while notifications are being delivered is a loop WebKit reports.
|
|
101
|
+
*/
|
|
102
|
+
let frame = 0;
|
|
103
|
+
const grows = typeof ResizeObserver === "function" ? new ResizeObserver(() => {
|
|
104
|
+
cancelAnimationFrame(frame);
|
|
105
|
+
frame = requestAnimationFrame(place);
|
|
106
|
+
}) : null;
|
|
107
|
+
const box = boxOf();
|
|
108
|
+
if (box)
|
|
109
|
+
grows?.observe(box);
|
|
103
110
|
return () => {
|
|
111
|
+
cancelAnimationFrame(frame);
|
|
104
112
|
grows?.disconnect();
|
|
105
113
|
removeEventListener("resize", place);
|
|
106
114
|
removeEventListener("scroll", place, true);
|
|
107
115
|
};
|
|
108
|
-
}, [
|
|
116
|
+
}, [anchor, drawn, pathname]);
|
|
109
117
|
}
|
|
110
118
|
/** The page's own subject, put where every surface reads it: the selection. */
|
|
111
119
|
function RouteSubject({ context }) {
|
|
@@ -117,17 +125,10 @@ function RouteSubject({ context }) {
|
|
|
117
125
|
* current view, so a new one arrives on every render — and an effect
|
|
118
126
|
* that depended on it set the selection, re-rendered the provider, got a
|
|
119
127
|
* new setter and set the selection again, nine hundred times a second.
|
|
120
|
-
* The address is the only thing that decides the subject.
|
|
121
128
|
*/
|
|
122
129
|
const set = useRef(here?.setSelection);
|
|
123
130
|
set.current = here?.setSelection;
|
|
124
|
-
/*
|
|
125
|
-
* THE ADDRESS, ONCE PER ADDRESS. `useParams()` hands back a fresh object
|
|
126
|
-
* every render, so putting it in the dependencies made this run on every
|
|
127
|
-
* render, set the selection, and render again — a loop that took the
|
|
128
|
-
* whole page down with it the moment the drawer opened. The path is the
|
|
129
|
-
* only thing that decides the subject, so the path is the dependency.
|
|
130
|
-
*/
|
|
131
|
+
/* THE ADDRESS, ONCE PER ADDRESS: the path is the only thing that decides the subject. */
|
|
131
132
|
useEffect(() => {
|
|
132
133
|
const setSelection = set.current;
|
|
133
134
|
if (!setSelection)
|
|
@@ -145,7 +146,6 @@ function RouteSubject({ context }) {
|
|
|
145
146
|
})();
|
|
146
147
|
setSelection((current) => current.length === chosen.length && current.every((one, at) => one === chosen[at]) ? current : chosen);
|
|
147
148
|
}, [pathname]);
|
|
148
|
-
void labelOf;
|
|
149
149
|
return null;
|
|
150
150
|
}
|
|
151
151
|
//# sourceMappingURL=ask.js.map
|
package/dist/ask.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask.js","sourceRoot":"","sources":["../src/ask.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ask.js","sourceRoot":"","sources":["../src/ask.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kB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AAI,KAAK,QAAQ,EAAE,CAAC;gBACtB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,kBAAkB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBAC7F,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,CAAC;YACD,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAC/D,IAAI,IAAI,IAAI,EAAE;gBAAE,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAC;YAChD,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC,EAAE,CAAC;QACL,YAAY,CAAC,CAAC,OAAO,EAAE,EAAE,CACvB,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CACtG,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACf,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/face-placed.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Which of the face's own controls a shell placed itself — so the face's
|
|
3
|
-
* root (face-controls.tsx) draws only the ones it did not.
|
|
3
|
+
* root (face-controls.tsx) draws only the ones it did not. `"bar"` is only
|
|
4
|
+
* ever gone without: a design's shell that draws the whole window itself
|
|
5
|
+
* (`surface("shell", Shell, { without: ["bar"] })`) gets no app bar above it.
|
|
4
6
|
*/
|
|
5
|
-
export type FaceControl = "find" | "undo";
|
|
7
|
+
export type FaceControl = "find" | "undo" | "bar";
|
|
6
8
|
export interface Placed {
|
|
7
9
|
readonly count: (control: FaceControl) => number;
|
|
8
10
|
readonly place: (control: FaceControl) => () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"face-placed.d.ts","sourceRoot":"","sources":["../src/face-placed.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"face-placed.d.ts","sourceRoot":"","sources":["../src/face-placed.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAElD,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,MAAM,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,MAAM,IAAI,CAAC;IACrD,QAAQ,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,YAAY,wCAAqC,CAAC;AAE/D,wBAAgB,YAAY,IAAI,MAAM,CAqBrC;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAG7D;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAMvE"}
|
package/dist/face-placed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"face-placed.js","sourceRoot":"","sources":["../src/face-placed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,E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B;IACrD,MAAM,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACxC,eAAe,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAAc,EAAE,OAAoB;IAC5D,OAAO,oBAAoB,CACzB,MAAM,CAAC,SAAS,EAChB,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAC/B,GAAG,EAAE,CAAC,KAAK,CACZ,CAAC;AACJ,CAAC"}
|
package/dist/facts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facts.d.ts","sourceRoot":"","sources":["../src/facts.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"facts.d.ts","sourceRoot":"","sources":["../src/facts.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGvE;;;;;;;;GAQG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,IAAI,CAAC;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,K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;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAmBnG;AAID,8EAA8E;AAC9E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,uCAAuC;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtG,QAAQ,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CA2CrE"}
|
package/dist/facts.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { labelOf, readableFields, tellApart, violationsTouching, } from "@graview/core";
|
|
1
|
+
import { pluralLabel, labelOf, readableFields, tellApart, violationsTouching, } from "@graview/core";
|
|
2
2
|
import { deriveAffordances } from "@graview/tools";
|
|
3
3
|
import { withComputed } from "@graview/core/blocks";
|
|
4
4
|
export function recordFacts(store, id, options = {}) {
|
|
@@ -141,7 +141,7 @@ export function rankedRepairs(actions, repairs) {
|
|
|
141
141
|
export function kindMap(store) {
|
|
142
142
|
const kinds = store.schema.kinds.map((kind) => ({
|
|
143
143
|
kind,
|
|
144
|
-
plural: store.schema
|
|
144
|
+
plural: pluralLabel(store.schema, kind),
|
|
145
145
|
count: store.graph.nodesOfKind(kind).length,
|
|
146
146
|
}));
|
|
147
147
|
const counts = new Map();
|
package/dist/facts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facts.js","sourceRoot":"","sources":["../src/facts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,cAAc,EACd,SAAS,EACT,kBAAkB,GAOnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAsB,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAuCpD,MAAM,UAAU,WAAW,CACzB,KAAe,EACf,EAAU,EACV,UAAwB,EAAE;IAE1B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACrC,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,IAAI,GAAG,CAAC,SAAuC,EAAU,EAAE,CAC/D,OAAO,CACL,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,EAC1C,SAAmE,CACpE,CAAC;IAaJ,MAAM,MAAM,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC/C,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAA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AAC;oBAChE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;iBACpD,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AAC9B,CAAC"}
|
package/dist/page-context.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type AnySchema, type Brand, type Person, type Principal, type Store, type PresenceChannel, type SettingDeclaration } from "@graview/core";
|
|
2
2
|
import { type CSSProperties, type ReactNode } from "react";
|
|
3
|
-
import type { ReactViewRegistry } from "@graview/react/provider";
|
|
3
|
+
import type { KeepLensHost, ReactViewRegistry } from "@graview/react/provider";
|
|
4
|
+
import type { HostAi } from "@graview/tools/frame";
|
|
4
5
|
/**
|
|
5
6
|
* The default pages: the product's own site, derived.
|
|
6
7
|
*
|
|
@@ -90,6 +91,29 @@ export interface PageContext<S extends AnySchema> {
|
|
|
90
91
|
readonly settings?: readonly SettingDeclaration[];
|
|
91
92
|
/** Who else is here, for the same provider. */
|
|
92
93
|
readonly presence?: PresenceChannel;
|
|
94
|
+
/**
|
|
95
|
+
* Where a lens the seat drew is kept (`onKeepLens`): handed the
|
|
96
|
+
* check-clean `add-lens` edit, and `remove-lens` to take it back. A host
|
|
97
|
+
* that writes the declaration answers `{ kept: true }`; otherwise the
|
|
98
|
+
* lens is the reader's own.
|
|
99
|
+
*/
|
|
100
|
+
readonly onKeepLens?: KeepLensHost;
|
|
101
|
+
/**
|
|
102
|
+
* A GRAVIEW SIGNATURE: a quiet "Built with Graview" at the foot of the
|
|
103
|
+
* person's menu (drawn when `views` is given), linking to graview.dev.
|
|
104
|
+
* Off by default — an app leads with its own name and mark; Graview's own
|
|
105
|
+
* examples turn it on.
|
|
106
|
+
*/
|
|
107
|
+
readonly signature?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* THE AI THE SEAT MAY USE, decided by the host and never by a reader:
|
|
110
|
+
* `{ complete }` (the host's model: prompt in, text out) for open
|
|
111
|
+
* questions and views no template draws, `decide` for typed decisions,
|
|
112
|
+
* `onDevice` to let a model run in the reader's browser — for the
|
|
113
|
+
* provider under the pages when `views` is given. Unsaid, the graph
|
|
114
|
+
* answers alone, and an open question is told AI isn't on here.
|
|
115
|
+
*/
|
|
116
|
+
readonly ai?: HostAi;
|
|
93
117
|
}
|
|
94
118
|
/**
|
|
95
119
|
* WHERE A THING STANDS IN THE SCENE (FR-132, FR-137): a link from a page to
|
|
@@ -98,11 +122,13 @@ export interface PageContext<S extends AnySchema> {
|
|
|
98
122
|
* scene's address when the face owns its page; nowhere, and nothing drawn,
|
|
99
123
|
* when there is no scene to go to.
|
|
100
124
|
*/
|
|
101
|
-
export declare function SceneLink<S extends AnySchema>({ context, stop, title, style, children, ...rest }: {
|
|
125
|
+
export declare function SceneLink<S extends AnySchema>({ context, stop, title, style, className, children, ...rest }: {
|
|
102
126
|
readonly context: PageContext<S>;
|
|
103
127
|
readonly stop: string;
|
|
104
128
|
readonly title?: string;
|
|
105
129
|
readonly style?: CSSProperties;
|
|
130
|
+
/** A design's own class for the link. */
|
|
131
|
+
readonly className?: string;
|
|
106
132
|
readonly children?: ReactNode;
|
|
107
133
|
} & Record<`data-${string}`, string>): import("react").JSX.Element | null;
|
|
108
134
|
/** The way back to the example, for a face whose browser remembers. */
|