@graview/pages 0.1.29 → 0.1.32
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/context-menu.d.ts +10 -0
- package/dist/context-menu.d.ts.map +1 -0
- package/dist/context-menu.js +295 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +56 -13
- package/dist/form.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/page-context.d.ts +34 -3
- package/dist/page-context.d.ts.map +1 -1
- package/dist/page-context.js +8 -6
- package/dist/page-context.js.map +1 -1
- package/dist/page-home.js +1 -1
- package/dist/page-home.js.map +1 -1
- package/dist/page-list.d.ts.map +1 -1
- package/dist/page-list.js +151 -48
- package/dist/page-list.js.map +1 -1
- package/dist/page-places.d.ts.map +1 -1
- package/dist/page-places.js +80 -13
- package/dist/page-places.js.map +1 -1
- package/dist/page-problems.d.ts.map +1 -1
- package/dist/page-problems.js +12 -1
- package/dist/page-problems.js.map +1 -1
- package/dist/page-record.d.ts.map +1 -1
- package/dist/page-record.js +52 -14
- package/dist/page-record.js.map +1 -1
- package/dist/page-search.d.ts.map +1 -1
- package/dist/page-search.js +9 -8
- package/dist/page-search.js.map +1 -1
- package/dist/page-shell.d.ts.map +1 -1
- package/dist/page-shell.js +18 -5
- package/dist/page-shell.js.map +1 -1
- package/dist/page-typography.d.ts.map +1 -1
- package/dist/page-typography.js +4 -1
- package/dist/page-typography.js.map +1 -1
- package/dist/pages-activity.d.ts.map +1 -1
- package/dist/pages-activity.js +11 -5
- package/dist/pages-activity.js.map +1 -1
- package/dist/quick-ask.d.ts +16 -0
- package/dist/quick-ask.d.ts.map +1 -0
- package/dist/quick-ask.js +57 -0
- package/dist/quick-ask.js.map +1 -0
- package/dist/router.d.ts +11 -2
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +98 -23
- package/dist/router.js.map +1 -1
- package/dist/section.d.ts +18 -0
- package/dist/section.d.ts.map +1 -0
- package/dist/section.js +63 -0
- package/dist/section.js.map +1 -0
- package/dist/static.d.ts +54 -0
- package/dist/static.d.ts.map +1 -1
- package/dist/static.js +56 -6
- package/dist/static.js.map +1 -1
- package/package.json +6 -6
- package/dist/ask-place.d.ts +0 -50
- package/dist/ask-place.d.ts.map +0 -1
- package/dist/ask-place.js +0 -46
- package/dist/ask-place.js.map +0 -1
- package/dist/ask.d.ts +0 -20
- package/dist/ask.d.ts.map +0 -1
- package/dist/ask.js +0 -161
- package/dist/ask.js.map +0 -1
package/dist/page-context.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { HistoryHost } from "@graview/core/history";
|
|
2
|
+
import { type AnySchema, type Brand, type GraviewApp, type HostFiles, type ResolveApp, type LinkedRecords, type Person, type Principal, type Store, type PresenceChannel, type SettingDeclaration, type SubscriptionStore } from "@graview/core";
|
|
2
3
|
import { type CSSProperties, type ReactNode } from "react";
|
|
3
|
-
import type { KeepLensHost, ReactViewRegistry } from "@graview/react/provider";
|
|
4
|
+
import type { KeepLensHost, MenuSectionSource, ReactViewRegistry } from "@graview/react/provider";
|
|
4
5
|
import type { HostAi } from "@graview/tools/frame";
|
|
5
6
|
/**
|
|
6
7
|
* The default pages: the product's own site, derived.
|
|
@@ -120,6 +121,19 @@ export interface PageContext<S extends AnySchema> {
|
|
|
120
121
|
* answers alone, and an open question is told AI isn't on here.
|
|
121
122
|
*/
|
|
122
123
|
readonly ai?: HostAi;
|
|
124
|
+
/**
|
|
125
|
+
* WHERE "NOTIFY ME" IS KEPT (Roadmap f-notify-subscriptions), for the
|
|
126
|
+
* provider under the pages when `views` is given: the host's store, else
|
|
127
|
+
* the provider's around the face, else the page's own memory.
|
|
128
|
+
*/
|
|
129
|
+
readonly subscriptions?: SubscriptionStore;
|
|
130
|
+
/**
|
|
131
|
+
* THE QUICK ASK on every page (Roadmap f-quick-ask-framework): ⌘K's bar
|
|
132
|
+
* beside what the page is about, and its answer cards. On by default
|
|
133
|
+
* where `ai` gives a model; `false` draws none — the same setting the
|
|
134
|
+
* Shell's `quickAsk` reads, so one app has it on both faces or neither.
|
|
135
|
+
*/
|
|
136
|
+
readonly quickAsk?: boolean;
|
|
123
137
|
/**
|
|
124
138
|
* THE HOST'S FILES (FR-163): where a picture or a document put on a
|
|
125
139
|
* record from these pages is sent. Unsaid, the provider around them
|
|
@@ -133,6 +147,21 @@ export interface PageContext<S extends AnySchema> {
|
|
|
133
147
|
* it, and its address plainly where there is none.
|
|
134
148
|
*/
|
|
135
149
|
readonly resolveApp?: ResolveApp;
|
|
150
|
+
/** What the host keeps outside the log, for playback (Roadmap f-playback): its declaration changes, and a script view's code at a moment. */
|
|
151
|
+
readonly history?: HistoryHost;
|
|
152
|
+
/**
|
|
153
|
+
* THE HOST'S WAY TO READ ANOTHER APP'S RECORDS (FR-171): a linked record
|
|
154
|
+
* draws with its own card from its home app, as this viewer is told it,
|
|
155
|
+
* "linked record (no access)" where they may not open that app; linking
|
|
156
|
+
* picks from what it lists. Unsaid, the provider around them says.
|
|
157
|
+
*/
|
|
158
|
+
readonly linkedRecords?: LinkedRecords;
|
|
159
|
+
/**
|
|
160
|
+
* SECTIONS OF THE CONTEXT MENU the host adds beside its acts, on these
|
|
161
|
+
* pages and, through the provider around them, the scene: each told what
|
|
162
|
+
* the menu was opened on, answering rows or what it draws (`MenuSection`).
|
|
163
|
+
*/
|
|
164
|
+
readonly menuSections?: readonly MenuSectionSource[];
|
|
136
165
|
/**
|
|
137
166
|
* The app these pages are of, for the provider under them when `views`
|
|
138
167
|
* is given: the seat's tools and a host's turn describe its places with
|
|
@@ -147,10 +176,12 @@ export interface PageContext<S extends AnySchema> {
|
|
|
147
176
|
* scene's address when the face owns its page; nowhere, and nothing drawn,
|
|
148
177
|
* when there is no scene to go to.
|
|
149
178
|
*/
|
|
150
|
-
export declare function SceneLink<S extends AnySchema>({ context, stop, title, style, className, children, ...rest }: {
|
|
179
|
+
export declare function SceneLink<S extends AnySchema>({ context, stop, title, label, style, className, children, ...rest }: {
|
|
151
180
|
readonly context: PageContext<S>;
|
|
152
181
|
readonly stop: string;
|
|
153
182
|
readonly title?: string;
|
|
183
|
+
/** What a screen reader calls it, where its words are a mark ("↗"): the mark is said as nothing at all. */
|
|
184
|
+
readonly label?: string;
|
|
154
185
|
readonly style?: CSSProperties;
|
|
155
186
|
/** A design's own class for the link. */
|
|
156
187
|
readonly className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-context.d.ts","sourceRoot":"","sources":["../src/page-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"page-context.d.ts","sourceRoot":"","sources":["../src/page-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC7P,OAAO,EAA6C,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,KAAK,EAAE,MA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C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,2GAA2G;IAC3G,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;IAC/B,yCAAyC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B,GAAG,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,CAAC,sCAkCnC;AAED,uEAAuE;AACvE,wBAAgB,cAAc,gCA8B7B;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAczE"}
|
package/dist/page-context.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { sceneTitle } from "@graview/core";
|
|
3
3
|
import { useCallback, useRef, useSyncExternalStore } from "react";
|
|
4
4
|
/**
|
|
@@ -8,19 +8,21 @@ import { useCallback, useRef, useSyncExternalStore } from "react";
|
|
|
8
8
|
* scene's address when the face owns its page; nowhere, and nothing drawn,
|
|
9
9
|
* when there is no scene to go to.
|
|
10
10
|
*/
|
|
11
|
-
export function SceneLink({ context, stop, title, style, className, children, ...rest }) {
|
|
12
|
-
const
|
|
13
|
-
|
|
11
|
+
export function SceneLink({ context, stop, title, label, style, className, children, ...rest }) {
|
|
12
|
+
const scene = sceneTitle(context.views?.arrangement?.());
|
|
13
|
+
// The arrow is drawn, not said: "In the scene, link", never "In the scene north east arrow".
|
|
14
|
+
const words = children ?? (_jsxs(_Fragment, { children: ["In ", scene === "Scene" ? "the scene" : scene.replace(/^The /, "the "), " ", _jsx("span", { "aria-hidden": "true", children: "\u2197" })] }));
|
|
15
|
+
const named = label ? { "aria-label": label } : {};
|
|
14
16
|
if (context.overview) {
|
|
15
17
|
const go = context.overview;
|
|
16
|
-
return (_jsx("a", { href: stop, ...rest, ...(title ? { title } : {}), style: style, ...(className ? { className } : {}), onClick: (event) => {
|
|
18
|
+
return (_jsx("a", { href: stop, ...rest, ...named, ...(title ? { title } : {}), style: style, ...(className ? { className } : {}), onClick: (event) => {
|
|
17
19
|
event.preventDefault();
|
|
18
20
|
go(stop);
|
|
19
21
|
}, children: words }));
|
|
20
22
|
}
|
|
21
23
|
if (context.embedded)
|
|
22
24
|
return null;
|
|
23
|
-
return (_jsx("a", { href: `${context.sceneHref ?? "/"}${stop}`, ...rest, ...(title ? { title } : {}), style: style, ...(className ? { className } : {}), children: words }));
|
|
25
|
+
return (_jsx("a", { href: `${context.sceneHref ?? "/"}${stop}`, ...rest, ...named, ...(title ? { title } : {}), style: style, ...(className ? { className } : {}), children: words }));
|
|
24
26
|
}
|
|
25
27
|
/** The way back to the example, for a face whose browser remembers. */
|
|
26
28
|
export function StartFreshLink() {
|
package/dist/page-context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-context.js","sourceRoot":"","sources":["../src/page-context.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"page-context.js","sourceRoot":"","sources":["../src/page-context.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAoN,MAAM,eAAe,CAAC;AAC7P,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB,EAAsC,MAAM,OAAO,CAAC;AA0KtG;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAsB,EAC7C,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EAW2B;IAClC,MAAM,KAAK,GAAG,UAAU,CAAC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@@ -77,7 +77,7 @@ export function DefaultHomePage({ context }) {
|
|
|
77
77
|
}
|
|
78
78
|
const live = new Set(liveKinds(store, context.principal));
|
|
79
79
|
const relations = kindMap(store).relations.filter((relation) => live.has(relation.from) && (relation.to === "*" || live.has(relation.to)));
|
|
80
|
-
return (_jsxs(PageMain, { context: context, style: wide, children: [_jsxs("header", { style: { display: "grid", gap: 12 }, children: [brand?.subtitle ? _jsx("p", { style: { ...quiet, margin: 0 }, "data-testid": "app-subtitle", children: brand.subtitle }) : null, _jsx(PageTitle, { context: context, "data-testid": "standing", children: summary }), _jsxs("p", { style: { ...lede, display: "grid", gap: 4 }, "data-testid": "standing-card", children: [present.length === 0 && beginning ? (_jsxs("span", { children: ["Begin with \u201C", beginning.creator?.title ?? beginning.creator?.name, "\u201D, under", " ", _jsx(Link, { to: `/${pluralSlug(store.schema, beginning.entry.kind)}`, style: link, children: pluralOf(store, beginning.entry.kind) }), "."] })) : null, violations.length === 0 ? (_jsx("span", { children: "All rules hold." })) : (_jsx(Link, { to: "/problems", style: { ...link, color: "var(--graview-warn)" }, children: seeWhatIsBroken }))] })] }), _jsx(Gallery, { context: context }), _jsxs("section", { style: { ...rule, display: "grid", gap: 14 }, "data-testid": "kinds", children: [_jsxs("div", { style: { display: "flex", alignItems: "baseline", gap: 10, flexWrap: "wrap" }, children: [_jsx("h2", { style: h2, children: "What is here" }), relations.length > 0 ? (_jsxs(Link, { to: "/map", style: { ...link, ...quiet, marginLeft: "auto" }, "data-testid": "map-link", children: ["Connections \u00B7 ", relations.length === 1 ? "1 relation" : `${relations.length} relations`, " \u2192"] })) : null] }), _jsx("ul", { style: { margin: 0, padding: 0, listStyle: "none", display: "flex", flexWrap: "wrap", gap: "8px 10px" }, children: counted.map(({ kind, members }) => (_jsx("li", { style: { maxWidth: "100%" }, children: _jsxs(Link, { to: `/${pluralSlug(store.schema, kind)}`, style: {
|
|
80
|
+
return (_jsxs(PageMain, { context: context, style: wide, children: [_jsxs("header", { style: { display: "grid", gap: 12 }, children: [brand?.subtitle ? _jsx("p", { style: { ...quiet, margin: 0 }, "data-testid": "app-subtitle", children: brand.subtitle }) : null, _jsx(PageTitle, { context: context, "data-testid": "standing", children: summary }), _jsxs("p", { style: { ...lede, display: "grid", gap: 4 }, "data-testid": "standing-card", children: [present.length === 0 && beginning ? (_jsxs("span", { children: ["Begin with \u201C", beginning.creator?.title ?? beginning.creator?.name, "\u201D, under", " ", _jsx(Link, { to: `/${pluralSlug(store.schema, beginning.entry.kind)}`, style: link, children: pluralOf(store, beginning.entry.kind) }), "."] })) : null, violations.length === 0 ? (_jsx("span", { children: "All rules hold." })) : (_jsx(Link, { to: "/problems", style: { ...link, color: "var(--graview-warn)" }, children: seeWhatIsBroken }))] })] }), _jsx(Gallery, { context: context }), _jsxs("section", { style: { ...rule, display: "grid", gap: 14 }, "data-testid": "kinds", children: [_jsxs("div", { style: { display: "flex", alignItems: "baseline", gap: 10, flexWrap: "wrap" }, children: [_jsx("h2", { style: h2, children: "What is here" }), relations.length > 0 ? (_jsxs(Link, { to: "/map", style: { ...link, ...quiet, marginLeft: "auto" }, "data-testid": "map-link", children: ["Connections \u00B7 ", relations.length === 1 ? "1 relation" : `${relations.length} relations`, " ", _jsx("span", { "aria-hidden": "true", children: "\u2192" })] })) : null] }), _jsx("ul", { style: { margin: 0, padding: 0, listStyle: "none", display: "flex", flexWrap: "wrap", gap: "8px 10px" }, children: counted.map(({ kind, members }) => (_jsx("li", { style: { maxWidth: "100%" }, children: _jsxs(Link, { to: `/${pluralSlug(store.schema, kind)}`, style: {
|
|
81
81
|
...plain,
|
|
82
82
|
// A long plural and its count wrap inside the card rather than push the page sideways (320 wide, 32px text).
|
|
83
83
|
flexWrap: "wrap",
|
package/dist/page-home.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-home.js","sourceRoot":"","sources":["../src/page-home.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,SAAS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C,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5C,0FAA0F;IAC1F,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IACjC,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAGD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,SAAS,EAAE,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CAAE,+BAW5F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAe,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,+BAopB5I;AAqCD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,SAAS,MAAM,EAAE,GAC3B;IAAE,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CA4B5E"}
|
package/dist/page-list.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { AppLink, ArrangeBar, CHOOSING_CSS, Files, pageSays, prefetchSeveral, SeveralBarDoor, useChoosing } from "@graview/primitives/pages";
|
|
3
|
-
import { admitArrangement, arrange, arrangeable, formatArrangement, asksForThePast, parseArrangement, throughEdges } from "@graview/core/arrange";
|
|
2
|
+
import { AppLink, ArrangeBar, CHOOSING_CSS, Files, pageSays, prefetchSeveral, SeveralBarDoor, useChoosing, useEndsAboveItsList } from "@graview/primitives/pages";
|
|
3
|
+
import { admitArrangement, arrange, arrangeable, formatArrangement, asksForThePast, listGroup, listOpening, orderListGroups, parseArrangement, throughEdges, withWorkedOut } from "@graview/core/arrange";
|
|
4
4
|
import { archivedFrom, humanizeField, nounOf, isAppAddress, isAppLinkField, isCurrent, labelOf, LOCAL_LAYERS, } from "@graview/core";
|
|
5
5
|
import { describeSearched, matchNode, parseQuery } from "@graview/core/search";
|
|
6
6
|
import { firstPicture, withComputed } from "@graview/core/blocks";
|
|
@@ -65,6 +65,7 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
65
65
|
const { store, brand, invariantContext } = context;
|
|
66
66
|
useStoreTick(store);
|
|
67
67
|
const [search, setSearch] = useSearchParams();
|
|
68
|
+
const listId = `list-${useId().replace(/:/g, "")}`;
|
|
68
69
|
const definition = store.schema.tryDefinition(kind);
|
|
69
70
|
// The live records, unless the address asks for the archived (`?archived=true` or `all`, FR-173).
|
|
70
71
|
const askedArchived = archivedFrom(search.get("archived"));
|
|
@@ -80,8 +81,8 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
80
81
|
* `?past=1` widens the horizon — because a record's "all the tasks on this
|
|
81
82
|
* list" is a link somebody may have sent.
|
|
82
83
|
*/
|
|
83
|
-
// Its kind's own,
|
|
84
|
-
const offers = throughEdges(store.schema, arrangeable(store.schema, kind));
|
|
84
|
+
// Its kind's own, through each relation the far end's choices (`became.stage`), and what it works out to sort by (a rank).
|
|
85
|
+
const offers = withWorkedOut(store.schema, throughEdges(store.schema, arrangeable(store.schema, kind)));
|
|
85
86
|
const edgeKinds = relations.map((relation) => relation.edgeKind);
|
|
86
87
|
const asked = arrangementFromSearch(search, offers, edgeKinds);
|
|
87
88
|
// What the address says, or — saying nothing — how the design opens the list, or a large list's meaningful order.
|
|
@@ -89,7 +90,21 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
89
90
|
const large = all.length >= LARGE_LIST;
|
|
90
91
|
// The kind's natural time, which its list opens newest first by and indexes by year.
|
|
91
92
|
const when = definition?.fieldRoles?.["when"];
|
|
92
|
-
|
|
93
|
+
/*
|
|
94
|
+
* HOW THE DECLARATION OPENS THIS LIST (`pages.lists.<kind>`): what it
|
|
95
|
+
* filters by, the order it opens in, and its grouping — the closed groups
|
|
96
|
+
* (done, declined) last and shut. A person sorts or groups it another way,
|
|
97
|
+
* and the address says so; a design's own opening wins over it.
|
|
98
|
+
*/
|
|
99
|
+
const declared = context.views?.arrangement?.()?.lists?.[kind];
|
|
100
|
+
const declaredOpening = listOpening(declared);
|
|
101
|
+
const declaredGroup = listGroup(declared?.group);
|
|
102
|
+
const natural = naturalOpening(large, when);
|
|
103
|
+
const opened = opening ?? (declaredOpening ? { ...natural, ...declaredOpening } : natural);
|
|
104
|
+
const chosen = addressed ? asked.arrangement : admitArrangement(opened, offers).arrangement;
|
|
105
|
+
// A declared order keeps its tiebreak while the list is in that order, however it was reached.
|
|
106
|
+
const declaredSort = declaredOpening?.sort;
|
|
107
|
+
const arrangement = chosen.sort && declaredSort?.then && chosen.sort.by === declaredSort.by && chosen.sort.direction === declaredSort.direction ? { ...chosen, sort: declaredSort } : chosen;
|
|
93
108
|
// The words may say `is:any` too, as they do in the Find box.
|
|
94
109
|
const typed = parseQuery(arrangement.query ?? "");
|
|
95
110
|
const showingPast = [...(arrangement.filter ?? []), ...typed.conditions].some((condition) => condition.key === "is" && (condition.value === "past" || condition.value === "any")) ||
|
|
@@ -98,12 +113,49 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
98
113
|
const effective = showingPast || !definition?.lifecycle
|
|
99
114
|
? arrangement
|
|
100
115
|
: { ...arrangement, filter: [...(arrangement.filter ?? []), { key: "is", value: "current" }] };
|
|
116
|
+
// A rank the kind works out is worked out once a record, over what this seat sees (FR-83).
|
|
117
|
+
const worked = new Map();
|
|
101
118
|
const arranged = arrange(all, effective, {
|
|
102
119
|
schema: store.schema,
|
|
103
120
|
graph: store.graph,
|
|
104
121
|
flagged,
|
|
105
122
|
...(typeof invariantContext?.["today"] === "string" ? { today: invariantContext["today"] } : {}),
|
|
123
|
+
read: (node, key) => {
|
|
124
|
+
let values = worked.get(node.id);
|
|
125
|
+
if (!values)
|
|
126
|
+
worked.set(node.id, (values = withComputed(store.schema, store.graph, node)));
|
|
127
|
+
return values[key];
|
|
128
|
+
},
|
|
106
129
|
});
|
|
130
|
+
/*
|
|
131
|
+
* THE DECLARED GROUPS, IN THEIR ORDER, THE CLOSED ONES LAST AND SHUT —
|
|
132
|
+
* while the list is grouped the way the declaration groups it. A closed
|
|
133
|
+
* group opens for a person who presses it (the address keeps it open,
|
|
134
|
+
* `?open=done`), and stands open when the list is narrowed to find
|
|
135
|
+
* something: by words, or by the very field it groups.
|
|
136
|
+
*/
|
|
137
|
+
const groupField = declaredGroup && arrangement.group?.by === declaredGroup.by && !arrangement.group.bucket ? offers.groups.find((offer) => offer.key === declaredGroup.by) : undefined;
|
|
138
|
+
const groupsDrawn = declaredGroup && groupField && (groupField.type === "choice" || groupField.type === "boolean")
|
|
139
|
+
? orderListGroups(arranged.groups, declaredGroup, { type: groupField.type, ...(groupField.options ? { options: groupField.options } : {}) })
|
|
140
|
+
: arranged.groups.map((group) => ({ ...group, closed: false }));
|
|
141
|
+
const openedGroups = new Set((search.get("open") ?? "").split(",").filter(Boolean));
|
|
142
|
+
const narrowedToFind = Boolean(arrangement.query) || (arrangement.filter ?? []).some((condition) => condition.key === declaredGroup?.by);
|
|
143
|
+
const groupKeyOf = (key) => (groupField?.type === "boolean" ? (key === "1" ? "true" : "false") : key);
|
|
144
|
+
const isShut = (group) => group.closed && !narrowedToFind && !openedGroups.has(groupKeyOf(group.key));
|
|
145
|
+
const toggleGroup = (key) => {
|
|
146
|
+
const params = new URLSearchParams(search);
|
|
147
|
+
const next = new Set(openedGroups);
|
|
148
|
+
if (next.has(key))
|
|
149
|
+
next.delete(key);
|
|
150
|
+
else
|
|
151
|
+
next.add(key);
|
|
152
|
+
if (next.size > 0)
|
|
153
|
+
params.set("open", [...next].join(","));
|
|
154
|
+
else
|
|
155
|
+
params.delete("open");
|
|
156
|
+
// Opening a group is not a new place to go back to.
|
|
157
|
+
setSearch(params, { replace: true });
|
|
158
|
+
};
|
|
107
159
|
const members = arranged.nodes;
|
|
108
160
|
const current = definition?.lifecycle && !showingPast ? all.filter((node) => isCurrent(definition, node)) : all;
|
|
109
161
|
const retired = all.length - current.length;
|
|
@@ -117,7 +169,7 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
117
169
|
if (words[key])
|
|
118
170
|
params.set(key, words[key]);
|
|
119
171
|
// Everything taken off is still a choice, and not the opening one.
|
|
120
|
-
if (![...params.keys()].some((key) => ["sort", "filter", "group", "q"].includes(key)) && (opening || large || when))
|
|
172
|
+
if (![...params.keys()].some((key) => ["sort", "filter", "group", "q"].includes(key)) && (opening || declaredOpening || large || when))
|
|
121
173
|
params.set("sort", "");
|
|
122
174
|
setSearch(params);
|
|
123
175
|
};
|
|
@@ -150,6 +202,24 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
150
202
|
}))
|
|
151
203
|
.filter((entry) => entry.mutation !== undefined);
|
|
152
204
|
const withheld = facts.actions.withheld;
|
|
205
|
+
/*
|
|
206
|
+
* WHICH BEGINNINGS STAND OPEN, per kind: every one where there is nothing
|
|
207
|
+
* yet, none otherwise, and a kind followed from another starts over.
|
|
208
|
+
*/
|
|
209
|
+
const startingOpen = () => new Set(members.length === 0 ? creators.map(({ mutation }) => mutation.name) : []);
|
|
210
|
+
const [begun, setBegun] = useState(() => ({ kind: kind, open: startingOpen() }));
|
|
211
|
+
if (begun.kind !== kind)
|
|
212
|
+
setBegun({ kind: kind, open: startingOpen() });
|
|
213
|
+
const beginsOpen = (name) => (begun.kind === kind ? begun.open : startingOpen()).has(name);
|
|
214
|
+
const setBegins = (name, open) => setBegun((was) => {
|
|
215
|
+
const next = new Set(was.open);
|
|
216
|
+
if (open)
|
|
217
|
+
next.add(name);
|
|
218
|
+
else
|
|
219
|
+
next.delete(name);
|
|
220
|
+
return { kind: was.kind, open: next };
|
|
221
|
+
});
|
|
222
|
+
const beginId = `begin-${useId().replace(/:/g, "")}`;
|
|
153
223
|
// Search-to-create: when the words found nothing, the beginnings start with them as the name.
|
|
154
224
|
const startsWith = typed.words && members.length === 0
|
|
155
225
|
? Object.fromEntries(beginningsFrom(store, kind, facts.actions.affordances).map((beginning) => [beginning.mutation.name, beginning.arg]))
|
|
@@ -184,7 +254,7 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
184
254
|
const row = (node) => {
|
|
185
255
|
const label = labelOf(definition, node);
|
|
186
256
|
if (ownRowOf) {
|
|
187
|
-
return (_jsxs("li", { "data-testid": "record-row", style: { minWidth: 0 }, ...chooseAt(node.id), children: [box(node, label), ownRowOf(node, { label, href: recordPath(store.schema, kind, node.id), flagged: flagged.has(node.id), glance: glance(unsaid(node), definition, label) })] }, node.id));
|
|
257
|
+
return (_jsxs("li", { "data-testid": "record-row", "data-graview-record": node.id, style: { minWidth: 0 }, ...chooseAt(node.id), children: [box(node, label), ownRowOf(node, { label, href: recordPath(store.schema, kind, node.id), flagged: flagged.has(node.id), glance: glance(unsaid(node), definition, label) })] }, node.id));
|
|
188
258
|
}
|
|
189
259
|
if (RowView) {
|
|
190
260
|
/*
|
|
@@ -195,7 +265,7 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
195
265
|
const rowSays = pageSays(ownRow, node, store.graph);
|
|
196
266
|
const rest = Object.fromEntries(Object.entries(unsaid(node)).filter(([key]) => !rowSays?.fields.has(key)));
|
|
197
267
|
const facts = rowSays ? glance(rest, definition, rowSays.title ?? label) : "";
|
|
198
|
-
return (_jsxs("li", { "data-testid": "record-row", style: { position: "relative", display: "flex", flexWrap: "wrap", alignItems: "baseline", columnGap: 16, rowGap: 2, paddingBlock: 10, borderTop: "1px solid var(--graview-edge)" }, ...chooseAt(node.id), children: [box(node, label), _jsx("div", { style: { flex: "1 1 14rem", minWidth: 0 }, children: _jsx(RowView, { node: node, cardinality: "one", fidelity: "glyph", mode: "fullscreen", selected: false, ...(flagged.has(node.id) ? { flagged: [node.id] } : {}) }) }), facts ? (_jsx("span", { style: { ...quiet, flex: "0 1 auto", minWidth: 0, overflowWrap: "anywhere" }, "data-testid": "record-glance", children: facts })) : null, _jsx(
|
|
268
|
+
return (_jsxs("li", { "data-testid": "record-row", "data-graview-record": node.id, style: { position: "relative", display: "flex", flexWrap: "wrap", alignItems: "baseline", columnGap: 16, rowGap: 2, paddingBlock: 10, borderTop: "1px solid var(--graview-edge)" }, ...chooseAt(node.id), children: [box(node, label), _jsx("div", { style: { flex: "1 1 14rem", minWidth: 0 }, children: _jsx(RowView, { node: node, cardinality: "one", fidelity: "glyph", mode: "fullscreen", selected: false, ...(flagged.has(node.id) ? { flagged: [node.id] } : {}) }) }), facts ? (_jsx("span", { style: { ...quiet, flex: "0 1 auto", minWidth: 0, overflowWrap: "anywhere" }, "data-testid": "record-glance", children: facts })) : null, _jsx(StretchedRowLink, { to: recordPath(store.schema, kind, node.id), label: flagged.has(node.id) ? `${label} — implicated in a problem` : label })] }, node.id));
|
|
199
269
|
}
|
|
200
270
|
// A glance may say a computed field (FR-83), worked out over what this seat sees.
|
|
201
271
|
const said = glance(unsaid(node), definition, label);
|
|
@@ -205,9 +275,9 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
205
275
|
const picture = large ? undefined : firstPicture(node, definition);
|
|
206
276
|
// Another app it links, by the name the host gives it (FR-171).
|
|
207
277
|
const app = firstAppLink(node, definition);
|
|
208
|
-
const title = (_jsxs(Link, { to: recordPath(store.schema, kind, node.id), className: "graview-row-title", ...(label.length > 60 ? { title: label } : {}), children: [flagged.has(node.id) ? _jsx("span", { style: { color: "var(--graview-warn)" }, children: "\u26A0 " }) : null, label] }));
|
|
278
|
+
const title = (_jsxs(Link, { to: recordPath(store.schema, kind, node.id), className: "graview-row-title", ...(label.length > 60 ? { title: label } : {}), children: [flagged.has(node.id) ? _jsxs(_Fragment, { children: [_jsx("span", { role: "img", "aria-label": "Breaks a rule:", style: { color: "var(--graview-warn)" }, children: "\u26A0" }), " "] }) : null, label] }));
|
|
209
279
|
// The name, then its glance in a column of its own (`ROWS_CSS`).
|
|
210
|
-
return (_jsxs("li", { className: "graview-row", ...chooseAt(node.id), children: [box(node, label), picture ? (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 14, minWidth: 0 }, children: [_jsx(Files, { as: "thumb", file: picture }), title] })) : (title), said || app ? (_jsxs("span", { className: "graview-row-glance", children: [said, said && app ? " · " : null, app ? _jsx(AppLink, { address: app }) : null] })) : null, why ? _jsx(WhyLine, { why: why }) : null] }, node.id));
|
|
280
|
+
return (_jsxs("li", { className: "graview-row", "data-graview-record": node.id, ...chooseAt(node.id), children: [box(node, label), picture ? (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 14, minWidth: 0 }, children: [_jsx(Files, { as: "thumb", file: picture }), title] })) : (title), said || app ? (_jsxs("span", { className: "graview-row-glance", children: [said, said && app ? " · " : null, app ? _jsx(AppLink, { address: app }) : null] })) : null, why ? _jsx(WhyLine, { why: why }) : null] }, node.id));
|
|
211
281
|
};
|
|
212
282
|
/*
|
|
213
283
|
* THE HEAD SAYS EACH THING ONCE, AND THE RECORDS COME FIRST.
|
|
@@ -225,7 +295,7 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
225
295
|
*/
|
|
226
296
|
const pictures = placesOf(context).filter((place) => place.kind === kind);
|
|
227
297
|
// What the declaration says this list filters by (`pages.lists.<kind>.filters`), when it says.
|
|
228
|
-
const named =
|
|
298
|
+
const named = declared?.filters;
|
|
229
299
|
// `is:any` is the horizon widened by "+N past", not an arrangement to undo.
|
|
230
300
|
const narrowed = (arrangement.filter ?? []).some((condition) => condition.key !== "is" || condition.value !== "any");
|
|
231
301
|
const arrangedAlready = Boolean(arrangement.sort || arrangement.group || arrangement.query || narrowed);
|
|
@@ -267,7 +337,7 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
267
337
|
* some act on one of these at all.
|
|
268
338
|
*/
|
|
269
339
|
// The records in the order they are drawn — by group, by section, else as arranged — which a range and Cmd/Ctrl-A read.
|
|
270
|
-
const drawn = arranged.grouped && grouping ?
|
|
340
|
+
const drawn = arranged.grouped && grouping ? groupsDrawn.flatMap((group) => (isShut(group) ? [] : group.nodes)) : sections && sections.length > 1 ? sections.flatMap((section) => section.nodes) : members;
|
|
271
341
|
const order = useMemo(() => drawn.map((node) => node.id), [drawn.map((node) => node.id).join("\n")]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
272
342
|
const choosing = useChoosing(order);
|
|
273
343
|
const choosable = (principal ? store.permittedMutations(principal) : store.permittedMutations()).some((mutation) => {
|
|
@@ -307,14 +377,34 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
307
377
|
*/
|
|
308
378
|
const saidTwice = new Set(roads.map((road) => (road.words ?? "").toLowerCase()).filter((words, at, all) => words && all.indexOf(words) !== at));
|
|
309
379
|
const Frame = bare ? BareFrame : PageMain;
|
|
310
|
-
return (_jsxs(Frame, { context: context, children: [_jsxs("div", { style: { display: "grid", gap: 12 }, children: [_jsxs("header", { style: { display: "grid", gap: 4 }, children: [_jsxs("div", { style: { display: "flex", alignItems: "center",
|
|
380
|
+
return (_jsxs(Frame, { context: context, children: [_jsxs("div", { style: { display: "grid", gap: 12 }, children: [_jsxs("header", { style: { display: "grid", gap: 4 }, children: [_jsxs("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap", columnGap: 10, rowGap: 4, minWidth: 0 }, children: [_jsx(KindMark, { kind: kind, brand: brand, schema: store.schema, size: 8 }), _jsx(PageTitle, { context: context, children: plural }), creators.length > 0 ? (
|
|
381
|
+
/*
|
|
382
|
+
* ADDING ONE IS THE PRESS AFTER THE HEADING. Following a place
|
|
383
|
+
* puts the keyboard on the page's heading; the way to add one
|
|
384
|
+
* stood at the list's end, past the bar or past every row, and
|
|
385
|
+
* making a task from the keyboard cost six presses more than it
|
|
386
|
+
* had. Beside the heading it is the next press, and its form
|
|
387
|
+
* opens under the head, above the list.
|
|
388
|
+
*/
|
|
389
|
+
_jsx("span", { style: { marginLeft: "auto", display: "flex", flexWrap: "wrap", columnGap: 14 }, "data-testid": "beginnings-open", children: creators.map(({ affordance, mutation }) => (_jsx(BeginButton, { name: mutation.name, title: mutation.title ?? mutation.name, panel: `${beginId}-${mutation.name}`, open: beginsOpen(mutation.name), onOpen: (open) => setBegins(mutation.name, open) }, affordance.id))) })) : null] }), description ?? definition?.description ? _jsx("p", { style: lede, children: description ?? definition?.description }) : null, roads.length > 0 || pictures.length > 0 ? (
|
|
311
390
|
/*
|
|
312
391
|
* WHERE ELSE TO GO, IN ONE QUIET LINE: the kinds this one is tied
|
|
313
392
|
* to, each in the relation's own words from this end ("The
|
|
314
393
|
* decision it follows from"), and the kind's own pictures, which
|
|
315
394
|
* the bar's place list holds too.
|
|
316
395
|
*/
|
|
317
|
-
_jsxs("p", { style: { ...quiet, margin: 0, display: "flex", flexWrap: "wrap", columnGap: 18, rowGap: 2 }, "data-testid": "kind-related", children: [roads.length > 0 ? (_jsxs("span", { "data-testid": "kind-relations", children: ["Related:", " ", roads.map(({ relation, far, words }, index) => (_jsxs("span", { "data-relation": relation.edgeKind, children: [index > 0 ? "
|
|
396
|
+
_jsxs("p", { style: { ...quiet, margin: 0, display: "flex", flexWrap: "wrap", columnGap: 18, rowGap: 2 }, "data-testid": "kind-related", children: [roads.length > 0 ? (_jsxs("span", { "data-testid": "kind-relations", children: ["Related:", " ", roads.map(({ relation, far, words }, index) => (_jsxs("span", { "data-relation": relation.edgeKind, children: [index > 0 ? _jsx("span", { "aria-hidden": "true", children: " \u00B7 " }) : null, far === "*" ? (capitalize(words ?? humanizeField(relation.edgeKind))) : (_jsx(Link, { to: `/${pluralSlug(store.schema, far)}`, style: link, title: pluralOf(store, far), children: words && saidTwice.has(words.toLowerCase()) ? `${capitalize(words)}: ${pluralOf(store, far).toLowerCase()}` : capitalize(words ?? pluralOf(store, far)) }))] }, `${relation.edgeKind}|${relation.from}|${relation.to}`)))] })) : null, pictures.length > 0 ? (_jsxs("span", { "data-testid": "kind-pictures", children: ["Also as:", " ", pictures.map((place, index) => (_jsxs("span", { children: [index > 0 ? _jsx("span", { "aria-hidden": "true", children: " \u00B7 " }) : null, _jsx(Link, { to: pathOfPlace(context, place), style: link, children: place.title })] }, placeKey(place))))] })) : null] })) : null] }), creators.length > 0 ? (
|
|
397
|
+
/*
|
|
398
|
+
* ADDING ONE IS ONE QUIET ACT, in the act's own words beside the
|
|
399
|
+
* heading; the form opens here, under the head, when it is asked
|
|
400
|
+
* for. A full form at the foot of every list took nearly the room
|
|
401
|
+
* of the list. It stands open where there is nothing yet, and when
|
|
402
|
+
* the words found nothing and the name is already in it.
|
|
403
|
+
*/
|
|
404
|
+
_jsx("div", { style: { display: "contents" }, "data-testid": "beginnings", children: creators.map(({ affordance, mutation }) => {
|
|
405
|
+
const prefilled = Boolean(startsWith[mutation.name] && members.length === 0);
|
|
406
|
+
return (_jsx(BeginningForm, { name: mutation.name, id: `${beginId}-${mutation.name}`, description: mutation.description, open: beginsOpen(mutation.name), onClose: () => setBegins(mutation.name, false), children: _jsx(DerivedForm, { store: store, mutation: mutation, prefilled: affordance.args, open: affordance.open, ...(prefilled ? { initial: { [startsWith[mutation.name]]: typed.words } } : {}), ...(context.principal ? { principal: context.principal } : {}) }, prefilled ? `${mutation.name}|${typed.words}` : mutation.name) }, affordance.id));
|
|
407
|
+
}) })) : null, asked.dropped.length > 0 ? (_jsxs("p", { style: { ...quiet, margin: 0 }, "data-testid": "list-dropped", children: ["This link asked for ", asked.dropped.join(", "), ", which ", plural.toLowerCase(), " cannot be arranged by; the rest is shown."] })) : null, current.length > 0 ? (_jsx(ArrangeBar, { schema: store.schema, graph: store.graph, kind: kind, arrangement: arrangement, onChange: rearrange, kept: { shown: members.length, of: current.length }, noun: { one: nounOf(definition, kind), many: plural.toLowerCase() }, ...(controls ? {} : { allow: false }), ...(named ? { filters: named } : {}),
|
|
318
408
|
// Its choice fields as chips over the list, counted over what is in it, where the line arranges.
|
|
319
409
|
offers: offers, chips: { nodes: current, flagged, ...(typeof invariantContext?.["today"] === "string" ? { today: invariantContext["today"] } : {}) },
|
|
320
410
|
// The bar's Find narrows this list; a second box for the same
|
|
@@ -332,28 +422,31 @@ export function ListPage({ context, kind, opening, row: ownRowOf, layout = "list
|
|
|
332
422
|
: {}), children: members.length === 0 && typed.words ? (
|
|
333
423
|
/* Honest about nothing: what was searched, and the way forward below — the name already in it. */
|
|
334
424
|
_jsxs("p", { style: lede, "data-testid": "none-yet", children: ["Nothing here is called \u201C", typed.words, "\u201D.", " ", _jsx("span", { style: quiet, "data-testid": "list-searched", children: describeSearched(store.schema, { kinds: [kind], past: showingPast }) }), " ", _jsx(Link, { to: "?", style: link, children: "Show every one" })] })) : members.length === 0 ? (_jsxs("p", { style: lede, "data-testid": "none-yet", children: [arrangement.filter?.length || arrangement.query ? "None of them." : "None yet", !arrangement.filter?.length && !arrangement.query && creators.length > 0
|
|
335
|
-
? ` — the first one starts
|
|
425
|
+
? ` — the first one starts above, with “${creators[0]?.mutation.title ?? creators[0]?.mutation.name}”.`
|
|
336
426
|
: !arrangement.filter?.length && !arrangement.query
|
|
337
427
|
? "."
|
|
338
|
-
: "", arrangement.filter?.length || arrangement.query ? (_jsxs(_Fragment, { children: [" ", _jsx(Link, { to: "?", style: link, children: "Show every one" })] })) : null] })) : arranged.grouped && grouping ? (_jsx("div", { style: { display: "grid", gap: "1rem" }, "data-testid": "records", "data-grouped": grouping, children:
|
|
428
|
+
: "", arrangement.filter?.length || arrangement.query ? (_jsxs(_Fragment, { children: [" ", _jsx(Link, { to: "?", style: link, children: "Show every one" })] })) : null] })) : arranged.grouped && grouping ? (_jsx("div", { style: { display: "grid", gap: "1rem" }, "data-testid": "records", "data-grouped": grouping, children: groupsDrawn.map((group) => {
|
|
429
|
+
if (!group.closed) {
|
|
430
|
+
return (_jsxs("section", { style: { display: "grid", gap: 0 }, "data-testid": "list-group", children: [_jsxs("h2", { className: "graview-group-head", children: [group.label, " ", _jsx("span", { children: group.nodes.length })] }), _jsx("ul", { style: rowsStyle, className: rowsClass, "data-graview-rows": "", children: group.nodes.map(row) })] }, group.key || "-"));
|
|
431
|
+
}
|
|
432
|
+
/*
|
|
433
|
+
* A CLOSED GROUP IS A DISCLOSURE: its heading a button that says
|
|
434
|
+
* what it holds and how many ("done · 12 requests"), expanded or
|
|
435
|
+
* not, the rows it controls drawn once it opens.
|
|
436
|
+
*/
|
|
437
|
+
const shut = isShut(group);
|
|
438
|
+
const rowsId = `${listId}-${anchor(group.key || "none")}`;
|
|
439
|
+
return (_jsxs("section", { style: { display: "grid", gap: 0 }, "data-testid": "list-group", "data-closed": shut ? "shut" : "open", children: [_jsx("h2", { className: "graview-group-head", children: _jsxs("button", { type: "button", className: "graview-group-toggle", "aria-expanded": !shut, "aria-controls": rowsId, "data-testid": "list-group-toggle", onClick: () => toggleGroup(groupKeyOf(group.key)), children: [_jsx("span", { "aria-hidden": "true", children: shut ? "▸" : "▾" }), group.label, " ", _jsxs("span", { children: ["\u00B7 ", group.nodes.length] }), _jsxs("span", { style: visuallyHidden, children: [" ", group.nodes.length === 1 ? nounOf(definition, kind) : plural.toLowerCase()] })] }) }), _jsx("ul", { id: rowsId, style: shut ? { ...rowsStyle, display: "none" } : rowsStyle, className: rowsClass, "data-graview-rows": "", hidden: shut, children: shut ? null : group.nodes.map(row) })] }, group.key || "-"));
|
|
440
|
+
}) })) : sections && sections.length > 1 ? (_jsxs("div", { style: { display: "grid", gap: 14 }, "data-testid": "records", "data-sectioned": sortOffer?.type === "date" ? "year" : "letter", children: [_jsx("nav", { "aria-label": "Jump to", "data-testid": "list-index",
|
|
339
441
|
// Wrapped to as many quiet lines as it needs: an entry is never cut at the edge.
|
|
340
442
|
style: { ...quiet, display: "flex", flexWrap: "wrap", gap: sortOffer?.type === "date" ? "0 10px" : "0 4px", lineHeight: 1.3 }, children: sections.map((section) => (_jsx("a", { href: `#${anchor(section.key)}`, onClick: (event) => {
|
|
341
443
|
// A jump within the page, not a new address: the router keeps the list's own.
|
|
342
444
|
event.preventDefault();
|
|
343
445
|
document.getElementById(anchor(section.key))?.scrollIntoView({ block: "start" });
|
|
344
|
-
}, style: { ...plain, minWidth: 24, justifyContent: "center" }, children: section.key }, section.key))) }), sections.map((section) => (_jsxs("section", { "data-testid": "list-section", "aria-labelledby": anchor(section.key), style: { display: "grid", gap: 0 }, children: [_jsx("h2", { id: anchor(section.key), className: "graview-group-head", children: section.key }), _jsx("ul", { style: rowsStyle, className: rowsClass, "data-graview-rows": "", children: section.nodes.map(row) })] }, section.key)))] })) : (_jsx("ul", { style: rowsStyle, className: rowsClass, "data-testid": "records", "data-graview-rows": "", children: members.map(row) })) }), choosable ? (_jsx(SeveralBarDoor, { store: store, chosen: choosing.chosen, ...(principal ? { principal } : {}), ...(invariantContext ? { context: invariantContext } : {}), anchor: anchorOf, of: order.length, onChooseAll: () => choosing.choose(order), onClear: choosing.clear, onActed: acted })) : null, retired > 0 ? (_jsxs(Link, { to: withWord(search, "filter", "is:any"), style: { ...link, ...quiet, justifySelf: "start" }, "data-testid": "past-link", children: ["+", retired, " past"] })) : null, askedArchived === false && store.graph.count(kind, { archived: true }) > 0 ? (_jsxs(Link, { to: withWord(search, "archived", "true"), style: { ...link, ...quiet, justifySelf: "start" }, "data-testid": "archived-link", children: ["+", store.graph.count(kind, { archived: true }), " archived"] })) : null,
|
|
345
|
-
/*
|
|
346
|
-
* ADDING ONE IS ONE QUIET ACT at the list's end, in the act's own
|
|
347
|
-
* words; the form opens in place when it is asked for. A full form
|
|
348
|
-
* at the foot of every list took nearly the room of the list. It
|
|
349
|
-
* stands open where there is nothing yet, and when the words found
|
|
350
|
-
* nothing and the name is already in it.
|
|
351
|
-
*/
|
|
352
|
-
_jsx("div", { style: { display: "grid", gap: 6 }, "data-testid": "beginnings", children: creators.map(({ affordance, mutation }) => {
|
|
353
|
-
const prefilled = Boolean(startsWith[mutation.name] && members.length === 0);
|
|
354
|
-
return (_jsx(Beginning, { name: mutation.name, title: mutation.title ?? mutation.name, description: mutation.description, open: members.length === 0, children: _jsx(DerivedForm, { store: store, mutation: mutation, prefilled: affordance.args, open: affordance.open, ...(prefilled ? { initial: { [startsWith[mutation.name]]: typed.words } } : {}), ...(context.principal ? { principal: context.principal } : {}) }, prefilled ? `${mutation.name}|${typed.words}` : mutation.name) }, affordance.id));
|
|
355
|
-
}) })) : null] }), withheld.length > 0 ? (_jsx("ul", { style: { ...rule, margin: 0, padding: 0, listStyle: "none", display: "grid", gap: 4 }, "data-testid": "withheld", children: withheld.map((entry) => (_jsxs("li", { style: quiet, children: [_jsx("s", { children: entry.label }), " \u2014 ", entry.refusal.message] }, entry.id))) })) : null] }));
|
|
446
|
+
}, style: { ...plain, minWidth: 24, justifyContent: "center" }, children: section.key }, section.key))) }), sections.map((section) => (_jsxs("section", { "data-testid": "list-section", "aria-labelledby": anchor(section.key), style: { display: "grid", gap: 0 }, children: [_jsx("h2", { id: anchor(section.key), className: "graview-group-head", children: section.key }), _jsx("ul", { style: rowsStyle, className: rowsClass, "data-graview-rows": "", children: section.nodes.map(row) })] }, section.key)))] })) : (_jsx("ul", { style: rowsStyle, className: rowsClass, "data-testid": "records", "data-graview-rows": "", children: members.map(row) })) }), choosable ? (_jsx(SeveralBarDoor, { store: store, chosen: choosing.chosen, ...(principal ? { principal } : {}), ...(invariantContext ? { context: invariantContext } : {}), anchor: anchorOf, of: order.length, onChooseAll: () => choosing.choose(order), onClear: choosing.clear, onActed: acted })) : null, retired > 0 ? (_jsxs(Link, { to: withWord(search, "filter", "is:any"), style: { ...link, ...quiet, justifySelf: "start" }, "data-testid": "past-link", children: ["+", retired, " past"] })) : null, askedArchived === false && store.graph.count(kind, { archived: true }) > 0 ? (_jsxs(Link, { to: withWord(search, "archived", "true"), style: { ...link, ...quiet, justifySelf: "start" }, "data-testid": "archived-link", children: ["+", store.graph.count(kind, { archived: true }), " archived"] })) : null] }), withheld.length > 0 ? (_jsx("ul", { style: { ...rule, margin: 0, padding: 0, listStyle: "none", display: "grid", gap: 4 }, "data-testid": "withheld", children: withheld.map((entry) => (_jsxs("li", { style: quiet, children: [_jsx("s", { children: entry.label }), " \u2014 ", entry.refusal.message] }, entry.id))) })) : null] }));
|
|
356
447
|
}
|
|
448
|
+
/** Words a screen reader says and a sighted reader does not need: the noun after a closed group's count. */
|
|
449
|
+
const visuallyHidden = { position: "absolute", width: 1, height: 1, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0 0 0 0)", whiteSpace: "nowrap", border: 0 };
|
|
357
450
|
/** The bar stands at the foot of the embed the list is drawn in, or of the window. */
|
|
358
451
|
const anchorOf = () => document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]") ?? null;
|
|
359
452
|
/*
|
|
@@ -426,26 +519,36 @@ function withWord(search, key, value) {
|
|
|
426
519
|
}
|
|
427
520
|
/**
|
|
428
521
|
* One way to begin a record: the act's title as a quiet press ("+ Add a
|
|
429
|
-
* deliverable") that opens its form
|
|
430
|
-
* form's first field; Escape puts it away
|
|
431
|
-
* The form is in the page either way — closed,
|
|
432
|
-
* asks is what it would ask open.
|
|
522
|
+
* deliverable") beside the list's heading, that opens its form under the
|
|
523
|
+
* head, the keyboard going to the form's first field; Escape puts it away
|
|
524
|
+
* and gives the keyboard back. The form is in the page either way — closed,
|
|
525
|
+
* it is hidden — so what it asks is what it would ask open.
|
|
433
526
|
*/
|
|
434
|
-
function
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
527
|
+
function BeginButton({ name, title, panel, open, onOpen }) {
|
|
528
|
+
return (_jsxs("button", { type: "button", "data-testid": `act-open-${name}`, "data-graview-act": name, "aria-expanded": open, "aria-controls": panel, onClick: () => {
|
|
529
|
+
onOpen(!open);
|
|
530
|
+
if (!open)
|
|
531
|
+
requestAnimationFrame(() => document.getElementById(panel)?.querySelector("input, select, textarea, button")?.focus());
|
|
532
|
+
},
|
|
533
|
+
// A target of 28 pixels that takes no more of the line than the title does, so the first record stands where it stood.
|
|
534
|
+
style: { ...plain, minHeight: 28, margin: "-4px 0", padding: "0 2px", border: 0, background: "none", font: "inherit", fontWeight: 600, color: "var(--graview-ink)", cursor: "pointer" }, children: [_jsx("span", { "aria-hidden": "true", style: { marginRight: 6 }, children: open ? "−" : "+" }), title] }));
|
|
535
|
+
}
|
|
536
|
+
/** The form a beginning opens, under the list's head; Escape gives the keyboard back to its press. */
|
|
537
|
+
function BeginningForm({ name, id, description, open, onClose, children }) {
|
|
538
|
+
return (
|
|
539
|
+
// Closed, it is no part of the page's grid, so the list stands where it stood without it.
|
|
540
|
+
_jsxs("div", { "data-testid": `act-${name}`, id: id, hidden: !open, onKeyDown: (event) => {
|
|
541
|
+
if (event.key !== "Escape")
|
|
542
|
+
return;
|
|
543
|
+
event.preventDefault();
|
|
544
|
+
onClose();
|
|
545
|
+
document.querySelector(`[aria-controls="${id}"]`)?.focus();
|
|
546
|
+
}, style: open ? { display: "grid", gap: 12, padding: "4px 0 12px" } : undefined, children: [description ? _jsx("p", { style: { ...quiet, margin: 0, maxWidth: "58ch" }, children: description }) : null, children] }));
|
|
547
|
+
}
|
|
548
|
+
/** A declared row's way to its record: stretched over the row, down to where a list the row draws begins (`useEndsAboveItsList`). */
|
|
549
|
+
function StretchedRowLink({ to, label }) {
|
|
550
|
+
const link = useRef(null);
|
|
551
|
+
useEndsAboveItsList(link);
|
|
552
|
+
return _jsx(Link, { ref: link, to: to, "aria-label": label, style: { position: "absolute", inset: 0, borderRadius: 6 } });
|
|
450
553
|
}
|
|
451
554
|
//# sourceMappingURL=page-list.js.map
|