@graview/primitives 0.1.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/LICENSE +96 -0
- package/README.md +25 -0
- package/dist/arrange-bar.d.ts +49 -0
- package/dist/arrange-bar.d.ts.map +1 -0
- package/dist/arrange-bar.js +264 -0
- package/dist/arrange-bar.js.map +1 -0
- package/dist/chat.d.ts +46 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +343 -0
- package/dist/chat.js.map +1 -0
- package/dist/companion.d.ts +58 -0
- package/dist/companion.d.ts.map +1 -0
- package/dist/companion.js +433 -0
- package/dist/companion.js.map +1 -0
- package/dist/connections.d.ts +23 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +100 -0
- package/dist/connections.js.map +1 -0
- package/dist/default-views.d.ts +35 -0
- package/dist/default-views.d.ts.map +1 -0
- package/dist/default-views.js +605 -0
- package/dist/default-views.js.map +1 -0
- package/dist/editable.d.ts +71 -0
- package/dist/editable.d.ts.map +1 -0
- package/dist/editable.js +225 -0
- package/dist/editable.js.map +1 -0
- package/dist/figure.d.ts +30 -0
- package/dist/figure.d.ts.map +1 -0
- package/dist/figure.js +66 -0
- package/dist/figure.js.map +1 -0
- package/dist/find.d.ts +5 -0
- package/dist/find.d.ts.map +1 -0
- package/dist/find.js +252 -0
- package/dist/find.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/installation.d.ts +17 -0
- package/dist/installation.d.ts.map +1 -0
- package/dist/installation.js +37 -0
- package/dist/installation.js.map +1 -0
- package/dist/ladder.d.ts +2 -0
- package/dist/ladder.d.ts.map +1 -0
- package/dist/ladder.js +53 -0
- package/dist/ladder.js.map +1 -0
- package/dist/lens/arranging.d.ts +41 -0
- package/dist/lens/arranging.d.ts.map +1 -0
- package/dist/lens/arranging.js +38 -0
- package/dist/lens/arranging.js.map +1 -0
- package/dist/lens/board.d.ts +146 -0
- package/dist/lens/board.d.ts.map +1 -0
- package/dist/lens/board.js +658 -0
- package/dist/lens/board.js.map +1 -0
- package/dist/lens/calendar-dates.d.ts +19 -0
- package/dist/lens/calendar-dates.d.ts.map +1 -0
- package/dist/lens/calendar-dates.js +55 -0
- package/dist/lens/calendar-dates.js.map +1 -0
- package/dist/lens/calendar-drawing.d.ts +59 -0
- package/dist/lens/calendar-drawing.d.ts.map +1 -0
- package/dist/lens/calendar-drawing.js +229 -0
- package/dist/lens/calendar-drawing.js.map +1 -0
- package/dist/lens/calendar-options.d.ts +107 -0
- package/dist/lens/calendar-options.d.ts.map +1 -0
- package/dist/lens/calendar-options.js +19 -0
- package/dist/lens/calendar-options.js.map +1 -0
- package/dist/lens/calendar-placing.d.ts +35 -0
- package/dist/lens/calendar-placing.d.ts.map +1 -0
- package/dist/lens/calendar-placing.js +113 -0
- package/dist/lens/calendar-placing.js.map +1 -0
- package/dist/lens/calendar-spans.d.ts +48 -0
- package/dist/lens/calendar-spans.d.ts.map +1 -0
- package/dist/lens/calendar-spans.js +146 -0
- package/dist/lens/calendar-spans.js.map +1 -0
- package/dist/lens/calendar-view.d.ts +34 -0
- package/dist/lens/calendar-view.d.ts.map +1 -0
- package/dist/lens/calendar-view.js +228 -0
- package/dist/lens/calendar-view.js.map +1 -0
- package/dist/lens/calendar.d.ts +43 -0
- package/dist/lens/calendar.d.ts.map +1 -0
- package/dist/lens/calendar.js +43 -0
- package/dist/lens/calendar.js.map +1 -0
- package/dist/lens/coverage.d.ts +183 -0
- package/dist/lens/coverage.d.ts.map +1 -0
- package/dist/lens/coverage.js +732 -0
- package/dist/lens/coverage.js.map +1 -0
- package/dist/lens/horizon.d.ts +14 -0
- package/dist/lens/horizon.d.ts.map +1 -0
- package/dist/lens/horizon.js +20 -0
- package/dist/lens/horizon.js.map +1 -0
- package/dist/lens/more.d.ts +16 -0
- package/dist/lens/more.d.ts.map +1 -0
- package/dist/lens/more.js +17 -0
- package/dist/lens/more.js.map +1 -0
- package/dist/lens/plan-lens.d.ts +17 -0
- package/dist/lens/plan-lens.d.ts.map +1 -0
- package/dist/lens/plan-lens.js +24 -0
- package/dist/lens/plan-lens.js.map +1 -0
- package/dist/lens/plan-state.d.ts +122 -0
- package/dist/lens/plan-state.d.ts.map +1 -0
- package/dist/lens/plan-state.js +152 -0
- package/dist/lens/plan-state.js.map +1 -0
- package/dist/lens/plan-view.d.ts +10 -0
- package/dist/lens/plan-view.d.ts.map +1 -0
- package/dist/lens/plan-view.js +576 -0
- package/dist/lens/plan-view.js.map +1 -0
- package/dist/lens/plan.d.ts +25 -0
- package/dist/lens/plan.d.ts.map +1 -0
- package/dist/lens/plan.js +25 -0
- package/dist/lens/plan.js.map +1 -0
- package/dist/lens/reach.d.ts +47 -0
- package/dist/lens/reach.d.ts.map +1 -0
- package/dist/lens/reach.js +67 -0
- package/dist/lens/reach.js.map +1 -0
- package/dist/lens/timeline.d.ts +137 -0
- package/dist/lens/timeline.d.ts.map +1 -0
- package/dist/lens/timeline.js +426 -0
- package/dist/lens/timeline.js.map +1 -0
- package/dist/markup.d.ts +23 -0
- package/dist/markup.d.ts.map +1 -0
- package/dist/markup.js +24 -0
- package/dist/markup.js.map +1 -0
- package/dist/places.d.ts +24 -0
- package/dist/places.d.ts.map +1 -0
- package/dist/places.js +227 -0
- package/dist/places.js.map +1 -0
- package/dist/popover.d.ts +28 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +59 -0
- package/dist/popover.js.map +1 -0
- package/dist/primitives/index.d.ts +214 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +381 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/profile.d.ts +65 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +233 -0
- package/dist/profile.js.map +1 -0
- package/dist/quick-relations.d.ts +16 -0
- package/dist/quick-relations.d.ts.map +1 -0
- package/dist/quick-relations.js +183 -0
- package/dist/quick-relations.js.map +1 -0
- package/dist/relation-key.d.ts +44 -0
- package/dist/relation-key.d.ts.map +1 -0
- package/dist/relation-key.js +196 -0
- package/dist/relation-key.js.map +1 -0
- package/dist/seat.d.ts +137 -0
- package/dist/seat.d.ts.map +1 -0
- package/dist/seat.js +162 -0
- package/dist/seat.js.map +1 -0
- package/dist/seats.d.ts +21 -0
- package/dist/seats.d.ts.map +1 -0
- package/dist/seats.js +62 -0
- package/dist/seats.js.map +1 -0
- package/dist/seeding.d.ts +150 -0
- package/dist/seeding.d.ts.map +1 -0
- package/dist/seeding.js +538 -0
- package/dist/seeding.js.map +1 -0
- package/dist/shell.d.ts +74 -0
- package/dist/shell.d.ts.map +1 -0
- package/dist/shell.js +86 -0
- package/dist/shell.js.map +1 -0
- package/dist/theme.d.ts +50 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +1692 -0
- package/dist/theme.js.map +1 -0
- package/dist/wordmark.d.ts +15 -0
- package/dist/wordmark.d.ts.map +1 -0
- package/dist/wordmark.js +55 -0
- package/dist/wordmark.js.map +1 -0
- package/dist/workbench/activity.d.ts +75 -0
- package/dist/workbench/activity.d.ts.map +1 -0
- package/dist/workbench/activity.js +259 -0
- package/dist/workbench/activity.js.map +1 -0
- package/dist/workbench/agent-seat.d.ts +51 -0
- package/dist/workbench/agent-seat.d.ts.map +1 -0
- package/dist/workbench/agent-seat.js +112 -0
- package/dist/workbench/agent-seat.js.map +1 -0
- package/dist/workbench/answer-args.d.ts +31 -0
- package/dist/workbench/answer-args.d.ts.map +1 -0
- package/dist/workbench/answer-args.js +257 -0
- package/dist/workbench/answer-args.js.map +1 -0
- package/dist/workbench/back-out.d.ts +71 -0
- package/dist/workbench/back-out.d.ts.map +1 -0
- package/dist/workbench/back-out.js +238 -0
- package/dist/workbench/back-out.js.map +1 -0
- package/dist/workbench/following.d.ts +7 -0
- package/dist/workbench/following.d.ts.map +1 -0
- package/dist/workbench/following.js +26 -0
- package/dist/workbench/following.js.map +1 -0
- package/dist/workbench/index.d.ts +23 -0
- package/dist/workbench/index.d.ts.map +1 -0
- package/dist/workbench/index.js +23 -0
- package/dist/workbench/index.js.map +1 -0
- package/dist/workbench/inspector.d.ts +27 -0
- package/dist/workbench/inspector.d.ts.map +1 -0
- package/dist/workbench/inspector.js +745 -0
- package/dist/workbench/inspector.js.map +1 -0
- package/dist/workbench/standing.d.ts +16 -0
- package/dist/workbench/standing.d.ts.map +1 -0
- package/dist/workbench/standing.js +102 -0
- package/dist/workbench/standing.js.map +1 -0
- package/dist/workbench/trail.d.ts +35 -0
- package/dist/workbench/trail.d.ts.map +1 -0
- package/dist/workbench/trail.js +150 -0
- package/dist/workbench/trail.js.map +1 -0
- package/package.json +62 -0
package/dist/find.js
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { actsOn } from "@graview/core";
|
|
3
|
+
import { aggregateId, kindCardId, withFocus, withJackIn, withOverview, withoutSearch, withQuery, withSelection, withWithin } from "@graview/layout";
|
|
4
|
+
import { useFound, useGraview, useKit, useViolations } from "@graview/react";
|
|
5
|
+
import { hueFor } from "@graview/render";
|
|
6
|
+
import { useEffect, useId, useMemo, useRef, useState } from "react";
|
|
7
|
+
import { VISUALLY_HIDDEN } from "./primitives/index.js";
|
|
8
|
+
/** The kind a hit belongs with in the strip; rules have a group of their own. */
|
|
9
|
+
const groupOf = (hit) => (hit.about === "rule" ? "rule:" : hit.about === "act" ? "act:" : hit.kind);
|
|
10
|
+
export function FindBox({ compact = false }) {
|
|
11
|
+
const { store, view, setView, principal, setMenuAt, brand } = useGraview();
|
|
12
|
+
const found = useFound();
|
|
13
|
+
const violations = useViolations();
|
|
14
|
+
const flag = useKit().marks.flag;
|
|
15
|
+
const input = useRef(null);
|
|
16
|
+
const strip = useId();
|
|
17
|
+
const [open, setOpen] = useState(false);
|
|
18
|
+
const [active, setActive] = useState(null);
|
|
19
|
+
// The record whose acts are shown: the one highlighted, kept while the keys move into its acts.
|
|
20
|
+
const [anchor, setAnchor] = useState(null);
|
|
21
|
+
const q = view.q ?? "";
|
|
22
|
+
/*
|
|
23
|
+
* `/` OR ⌘K, FROM ANYWHERE. ⌘K is a chord nobody types into a field, so
|
|
24
|
+
* it works from one; `/` is a character, so it only reaches the box when
|
|
25
|
+
* the keys are not already somewhere writing.
|
|
26
|
+
*/
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const onKey = (event) => {
|
|
29
|
+
const chord = event.key.toLowerCase() === "k" && (event.metaKey || event.ctrlKey) && !event.altKey && !event.shiftKey;
|
|
30
|
+
const slash = event.key === "/" && !event.metaKey && !event.ctrlKey && !event.altKey;
|
|
31
|
+
if (!chord && !slash)
|
|
32
|
+
return;
|
|
33
|
+
const at = document.activeElement;
|
|
34
|
+
const writing = at instanceof HTMLInputElement ||
|
|
35
|
+
at instanceof HTMLTextAreaElement ||
|
|
36
|
+
at instanceof HTMLSelectElement ||
|
|
37
|
+
(at instanceof HTMLElement && at.isContentEditable);
|
|
38
|
+
if (slash && writing)
|
|
39
|
+
return;
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
input.current?.focus();
|
|
42
|
+
input.current?.select();
|
|
43
|
+
setOpen(true);
|
|
44
|
+
};
|
|
45
|
+
window.addEventListener("keydown", onKey);
|
|
46
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
47
|
+
}, []);
|
|
48
|
+
/*
|
|
49
|
+
* WHAT CAN BE DONE ABOUT IT: the acts on the highlighted record, from the
|
|
50
|
+
* same matcher asked with that record as the subject — never subjectless.
|
|
51
|
+
*/
|
|
52
|
+
const acts = useMemo(() => (anchor && q.trim() ? actsOn(store, anchor, found?.words ?? q, { principal, limit: 4 }) : []), [store, q, found, anchor, principal]);
|
|
53
|
+
const groups = useMemo(() => {
|
|
54
|
+
const held = new Map();
|
|
55
|
+
for (const [index, hit] of (found?.hits ?? []).entries()) {
|
|
56
|
+
if (hit.about === "act")
|
|
57
|
+
continue;
|
|
58
|
+
const key = groupOf(hit);
|
|
59
|
+
const rows = held.get(key) ?? [];
|
|
60
|
+
rows.push({ id: `${strip}-${index}`, hit });
|
|
61
|
+
held.set(key, rows);
|
|
62
|
+
if (hit.about === "node" && hit.id === anchor) {
|
|
63
|
+
for (const [at, act] of acts.entries())
|
|
64
|
+
rows.push({ id: `${strip}-${index}-act-${at}`, hit: act });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return [...held.entries()];
|
|
68
|
+
}, [found, acts, anchor, strip]);
|
|
69
|
+
const rows = useMemo(() => groups.flatMap(([, entries]) => entries), [groups]);
|
|
70
|
+
const current = rows.find((row) => row.id === active) ?? rows[0];
|
|
71
|
+
// A new answer starts at its first row, as a list does.
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
setActive(null);
|
|
74
|
+
setAnchor(null);
|
|
75
|
+
}, [q]);
|
|
76
|
+
const highlight = (row) => {
|
|
77
|
+
if (!row)
|
|
78
|
+
return;
|
|
79
|
+
setActive(row.id);
|
|
80
|
+
if (row.hit.about === "node")
|
|
81
|
+
setAnchor(row.hit.id);
|
|
82
|
+
else if (row.hit.about !== "act")
|
|
83
|
+
setAnchor(null);
|
|
84
|
+
};
|
|
85
|
+
const travel = (row) => {
|
|
86
|
+
if (!row)
|
|
87
|
+
return;
|
|
88
|
+
const hit = row.hit;
|
|
89
|
+
switch (hit.about) {
|
|
90
|
+
case "node":
|
|
91
|
+
setView((stop) => withSelection(withFocus(withOverview(stop, false), hit.id), [hit.id]));
|
|
92
|
+
break;
|
|
93
|
+
case "kind":
|
|
94
|
+
// Into the district, narrowed by the same words — the same descent a double-click on the lit district makes.
|
|
95
|
+
setView((stop) => withJackIn(stop, kindCardId(hit.kind), { ownPicture: true, ...(stop.q ? { carry: stop.q } : {}) }));
|
|
96
|
+
break;
|
|
97
|
+
case "place":
|
|
98
|
+
setView((stop) => withWithin(withOverview(withFocus(stop, aggregateId(hit.kind)), false), "view", hit.as));
|
|
99
|
+
break;
|
|
100
|
+
case "rule": {
|
|
101
|
+
const named = violations.filter((violation) => violation.invariant === hit.name).flatMap((violation) => violation.nodeIds);
|
|
102
|
+
setView((stop) => withSelection(stop, [...new Set(named)]));
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
case "act": {
|
|
106
|
+
// The act lives in the menu on its subject, with its form and its preview.
|
|
107
|
+
setView((stop) => withSelection(stop, [hit.subject]));
|
|
108
|
+
const box = input.current?.getBoundingClientRect();
|
|
109
|
+
setMenuAt({ x: box?.left ?? 0, y: (box?.bottom ?? 0) + 6, on: hit.subject });
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
setOpen(false);
|
|
114
|
+
input.current?.blur();
|
|
115
|
+
};
|
|
116
|
+
const announce = found ? spoken(found.byKind, found.hits, store.schema) : "";
|
|
117
|
+
const expanded = open && q.trim().length > 0;
|
|
118
|
+
return (_jsxs("div", { style: { position: "relative", minWidth: 0, flex: "1 1 auto" }, "data-testid": "find", children: [_jsx("input", { ref: input, type: "search", role: "combobox", "aria-label": "Find anything", "aria-expanded": expanded, "aria-controls": strip, "aria-autocomplete": "list", ...(expanded && current ? { "aria-activedescendant": current.id } : {}), "data-testid": "find-box", placeholder: "Find\u2026 /", value: q, onChange: (event) => {
|
|
119
|
+
const words = event.target.value;
|
|
120
|
+
setOpen(true);
|
|
121
|
+
setView((stop) => withQuery(stop, words.length > 0 ? words : null));
|
|
122
|
+
}, onFocus: () => setOpen(true), onBlur: () => setOpen(false), onKeyDown: (event) => {
|
|
123
|
+
// Nothing highlighted yet: the first ↓ lands on the first row, not the second.
|
|
124
|
+
const at = active !== null && current ? rows.indexOf(current) : -1;
|
|
125
|
+
if (event.key === "ArrowDown") {
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
setOpen(true);
|
|
128
|
+
highlight(rows[Math.min(rows.length - 1, at + 1)]);
|
|
129
|
+
}
|
|
130
|
+
else if (event.key === "ArrowUp") {
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
highlight(rows[Math.max(0, at - 1)]);
|
|
133
|
+
}
|
|
134
|
+
else if (event.key === "Enter") {
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
travel(current);
|
|
137
|
+
}
|
|
138
|
+
else if (event.key === "Escape") {
|
|
139
|
+
event.preventDefault();
|
|
140
|
+
// The words first; an empty box lets go of the keys.
|
|
141
|
+
if (q)
|
|
142
|
+
setView((stop) => withoutSearch(stop));
|
|
143
|
+
else
|
|
144
|
+
input.current?.blur();
|
|
145
|
+
}
|
|
146
|
+
}, style: {
|
|
147
|
+
width: "100%",
|
|
148
|
+
boxSizing: "border-box",
|
|
149
|
+
minWidth: 0,
|
|
150
|
+
minHeight: 32,
|
|
151
|
+
padding: "4px 10px",
|
|
152
|
+
font: "inherit",
|
|
153
|
+
fontSize: "0.875rem",
|
|
154
|
+
color: "var(--graview-ink)",
|
|
155
|
+
background: "var(--graview-panel)",
|
|
156
|
+
border: `1px solid ${q ? "var(--graview-accent)" : "var(--graview-edge)"}`,
|
|
157
|
+
borderRadius: 8,
|
|
158
|
+
} }), _jsx("span", { role: "status", "aria-live": "polite", style: VISUALLY_HIDDEN, "data-testid": "find-count", children: q.trim() ? announce : "" }), _jsxs("div", { id: strip, role: "listbox", "aria-label": q ? `What “${q}” finds` : "What the words find", "data-testid": "find-strip", hidden: !expanded,
|
|
159
|
+
// Mousedown on a row must not blur the box before the click lands.
|
|
160
|
+
onMouseDown: (event) => event.preventDefault(), style: compact ? { ...STRIP, ...SHEET } : STRIP, children: [rows.length === 0 ? (_jsxs("p", { role: "presentation", style: { margin: 0, padding: "10px 12px", color: "var(--graview-ink-muted)", fontSize: "0.875rem" }, "data-testid": "find-nothing", children: ["Nothing here is called \u201C", found?.words || q, "\u201D."] })) : (groups.map(([key, entries]) => (_jsxs("div", { role: "group", "aria-label": headingOf(key, store.schema), children: [_jsxs("div", { role: "presentation", style: HEADING, children: [key !== "rule:" ? _jsx(Mark, { kind: key, accents: brand?.accents }) : null, headingOf(key, store.schema)] }), entries.map((row) => (_jsx("div", { id: row.id, role: "option", "aria-selected": row === current, "data-testid": "find-hit", "data-about": row.hit.about, onMouseEnter: () => highlight(row), onClick: () => travel(row), style: {
|
|
161
|
+
...OPTION,
|
|
162
|
+
...(row.hit.about === "act" ? { paddingLeft: 30 } : {}),
|
|
163
|
+
background: row === current ? "var(--graview-panel-muted)" : "transparent",
|
|
164
|
+
}, children: _jsx(HitLine, { hit: row.hit, flag: flag }) }, row.id)))] }, key)))), found && found.searched.past === false && found.searched.kinds.some((kind) => store.schema.tryDefinition(kind)?.lifecycle) ? (_jsx("p", { role: "presentation", style: { margin: 0, padding: "6px 12px 8px", color: "var(--graview-ink-faint)", fontSize: "0.75rem" }, children: "Current ones; add is:any for the past." })) : null] })] }));
|
|
165
|
+
}
|
|
166
|
+
function HitLine({ hit, flag }) {
|
|
167
|
+
switch (hit.about) {
|
|
168
|
+
case "node":
|
|
169
|
+
return (_jsxs(_Fragment, { children: [_jsxs("span", { style: { fontWeight: 600, overflowWrap: "anywhere" }, children: [hit.flagged ? _jsxs("span", { style: { color: "var(--graview-warn)" }, children: [flag, " "] }) : null, hit.label, hit.apart ? _jsxs("span", { style: MUTED, children: [" \u00B7 ", hit.apart] }) : null, hit.current ? null : _jsx("span", { style: MUTED, children: " \u00B7 past" })] }), hit.why.field !== "label" ? (_jsxs("span", { style: MUTED, children: [hit.why.reading.toLowerCase(), ": ", hit.why.fragment] })) : null] }));
|
|
170
|
+
case "kind":
|
|
171
|
+
return (_jsxs("span", { children: [hit.label, _jsxs("span", { style: MUTED, children: [" \u00B7 ", hit.count, " match"] })] }));
|
|
172
|
+
case "place":
|
|
173
|
+
return _jsxs("span", { children: ["Go to ", hit.title] });
|
|
174
|
+
case "rule":
|
|
175
|
+
return _jsxs("span", { children: ["The rule \u201C", hit.label, "\u201D"] });
|
|
176
|
+
case "act":
|
|
177
|
+
return (_jsxs("span", { style: hit.destructive ? { color: "var(--graview-warn)" } : undefined, children: [hit.title, _jsxs("span", { style: MUTED, children: [" \u00B7 ", hit.why.field === "title" ? "act" : `on ${hit.why.fragment}`] })] }));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function Mark({ kind, accents }) {
|
|
181
|
+
const hue = Math.round(hueFor(kind, accents));
|
|
182
|
+
return _jsx("span", { "aria-hidden": "true", style: { width: 8, height: 8, borderRadius: 2, flex: "0 0 auto", background: `hsl(${hue} 55% 52%)` } });
|
|
183
|
+
}
|
|
184
|
+
function headingOf(key, schema) {
|
|
185
|
+
if (key === "rule:")
|
|
186
|
+
return "Rules";
|
|
187
|
+
if (key === "act:")
|
|
188
|
+
return "Acts";
|
|
189
|
+
const definition = schema.tryDefinition(key);
|
|
190
|
+
return definition?.plural ?? `${key}s`;
|
|
191
|
+
}
|
|
192
|
+
/** "3 tasks, 1 list" — what a screen reader hears as the count changes. */
|
|
193
|
+
function spoken(byKind, hits, schema) {
|
|
194
|
+
const parts = Object.entries(byKind).map(([kind, count]) => {
|
|
195
|
+
const plural = (schema.tryDefinition(kind)?.plural ?? `${kind}s`).toLowerCase();
|
|
196
|
+
return `${count} ${count === 1 ? kind.replace(/-/g, " ") : plural}`;
|
|
197
|
+
});
|
|
198
|
+
const others = hits.filter((hit) => hit.about === "kind" || hit.about === "place" || hit.about === "rule").length;
|
|
199
|
+
if (others > 0)
|
|
200
|
+
parts.push(`${others} ${others === 1 ? "place or rule" : "places and rules"}`);
|
|
201
|
+
return parts.length === 0 ? "Nothing found" : `${parts.join(", ")} found`;
|
|
202
|
+
}
|
|
203
|
+
const STRIP = {
|
|
204
|
+
position: "absolute",
|
|
205
|
+
top: "calc(100% + 6px)",
|
|
206
|
+
right: 0,
|
|
207
|
+
width: "min(26rem, calc(100vw - 24px))",
|
|
208
|
+
maxHeight: "min(60vh, 28rem)",
|
|
209
|
+
overflowY: "auto",
|
|
210
|
+
boxSizing: "border-box",
|
|
211
|
+
background: "var(--graview-panel)",
|
|
212
|
+
border: "1px solid var(--graview-edge)",
|
|
213
|
+
borderRadius: 10,
|
|
214
|
+
boxShadow: "0 10px 28px rgb(0 0 0 / 0.18)",
|
|
215
|
+
zIndex: 40,
|
|
216
|
+
padding: "4px 0",
|
|
217
|
+
};
|
|
218
|
+
/** On a phone the strip is a sheet under the bar, the screen's full width. */
|
|
219
|
+
const SHEET = {
|
|
220
|
+
position: "fixed",
|
|
221
|
+
top: "auto",
|
|
222
|
+
left: 0,
|
|
223
|
+
right: 0,
|
|
224
|
+
width: "100vw",
|
|
225
|
+
maxHeight: "55vh",
|
|
226
|
+
borderRadius: 0,
|
|
227
|
+
borderLeft: "none",
|
|
228
|
+
borderRight: "none",
|
|
229
|
+
};
|
|
230
|
+
const HEADING = {
|
|
231
|
+
display: "flex",
|
|
232
|
+
alignItems: "center",
|
|
233
|
+
gap: 6,
|
|
234
|
+
padding: "8px 12px 2px",
|
|
235
|
+
fontSize: "0.6875rem",
|
|
236
|
+
letterSpacing: "0.06em",
|
|
237
|
+
textTransform: "uppercase",
|
|
238
|
+
color: "var(--graview-ink-muted)",
|
|
239
|
+
};
|
|
240
|
+
const OPTION = {
|
|
241
|
+
display: "grid",
|
|
242
|
+
gap: 1,
|
|
243
|
+
minHeight: 32,
|
|
244
|
+
padding: "5px 12px",
|
|
245
|
+
alignContent: "center",
|
|
246
|
+
cursor: "pointer",
|
|
247
|
+
fontSize: "0.875rem",
|
|
248
|
+
lineHeight: 1.35,
|
|
249
|
+
color: "var(--graview-ink)",
|
|
250
|
+
};
|
|
251
|
+
const MUTED = { color: "var(--graview-ink-muted)", fontSize: "0.8125rem", fontWeight: 400 };
|
|
252
|
+
//# sourceMappingURL=find.js.map
|
package/dist/find.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../src/find.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAA4B,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,S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E,UAAU;IACnB,YAAY,EAAE,QAAQ;IACtB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,oBAAoB;CAC5B,CAAC;AAEF,MAAM,KAAK,GAAkB,EAAE,KAAK,EAAE,0BAA0B,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export { BOARD_REQUIRED_ROLES, BoardBindingError, BoardView, buildBoard, createBoardLens, } from "./lens/board.js";
|
|
2
|
+
export type { BoardLens, BoardOptions, BoardSlot, BoardState, BoardViewProps } from "./lens/board.js";
|
|
3
|
+
export { ActivityRail, StartFresh, AgentSeat, AnswerArgs, BackOut, Backtrack, Inspector, nameOf, OverviewButton, descentTarget, Standing, Trail, UndoTurn, useRecentChanges, } from "./workbench/index.js";
|
|
4
|
+
export type { AgentSeatProps, Change } from "./workbench/index.js";
|
|
5
|
+
export { buildCoverage, capCoverage, CoverageBindingError, COVERAGE_MAX_COLUMNS, COVERAGE_MAX_ROWS, COVERAGE_REQUIRED_ROLES, CoverageView, createCoverageLens, } from "./lens/coverage.js";
|
|
6
|
+
export type { CappedCoverage, CoverageCell, CoverageGrid, CoverageLens, CoverageOptions, CoverageRoles, CoverageViewProps, } from "./lens/coverage.js";
|
|
7
|
+
export { ArrangeBar, arrangementCaption, arrangementOf, sayCondition, withArrangement } from "./arrange-bar.js";
|
|
8
|
+
export { useArranging } from "./lens/arranging.js";
|
|
9
|
+
export type { Arranging, ArrangingOptions } from "./lens/arranging.js";
|
|
10
|
+
export type { ArrangeBarProps } from "./arrange-bar.js";
|
|
11
|
+
export { Connections } from "./connections.js";
|
|
12
|
+
export type { ConnectionsProps } from "./connections.js";
|
|
13
|
+
export { EditableTitle, EditableValue, Fields, humanise } from "./editable.js";
|
|
14
|
+
export { Companion, useSubject } from "./companion.js";
|
|
15
|
+
export type { CompanionProps, Subject } from "./companion.js";
|
|
16
|
+
export { RelationKey, RelationMark, relationWords } from "./relation-key.js";
|
|
17
|
+
export { QuickRelations, handles } from "./quick-relations.js";
|
|
18
|
+
export { rosterOf } from "./default-views.js";
|
|
19
|
+
export { ChatPanel } from "./chat.js";
|
|
20
|
+
export { LadderSetting } from "./ladder.js";
|
|
21
|
+
export type { ChatPanelProps } from "./chat.js";
|
|
22
|
+
export { describeSource, proposalKey, SeatComposer, SeatHeader, SeatSettings, SeatThread, Settled, splitAside, useSeatConversation, } from "./seat.js";
|
|
23
|
+
export type { SeatAnswer, SeatOutcome, SeatTurn } from "./seat.js";
|
|
24
|
+
export { Wordmark } from "./wordmark.js";
|
|
25
|
+
export { Places } from "./places.js";
|
|
26
|
+
export { FindBox } from "./find.js";
|
|
27
|
+
export { ShowInstallation } from "./installation.js";
|
|
28
|
+
export { Seats } from "./seats.js";
|
|
29
|
+
export { Profile } from "./profile.js";
|
|
30
|
+
export { buildReach, ReachView, reachLens } from "./lens/reach.js";
|
|
31
|
+
export type { Reach, ReachCell } from "./lens/reach.js";
|
|
32
|
+
export { Shell } from "./shell.js";
|
|
33
|
+
export type { ShellProps } from "./shell.js";
|
|
34
|
+
export { Aggregate, Axis, Chip, Connector, FAINT_TEXT, Grid, MUTED_TEXT, Panel, Prose, VISUALLY_HIDDEN, Roster, useWidth, } from "./primitives/index.js";
|
|
35
|
+
export type { AggregateProps, AxisProps, ChipProps, ConnectorProps, GridProps, PanelProps, RosterProps, } from "./primitives/index.js";
|
|
36
|
+
export { DARK, GRAVIEW_BRAND, LIGHT, SCHEMES, themeCss, themeVariables } from "./theme.js";
|
|
37
|
+
export type { Brand, Scheme, ThemeCssOptions, ThemeTokens } from "./theme.js";
|
|
38
|
+
export { hueFor, registerDefaultViews } from "./default-views.js";
|
|
39
|
+
export { hasFigure, KindFigure } from "./figure.js";
|
|
40
|
+
export { useMarkup } from "./markup.js";
|
|
41
|
+
export { activeWindow, assignLanes, createTimelineLens, placeOnTimeline, TimelineBindingError, TimelineView, TIMELINE_REQUIRED_ROLES, } from "./lens/timeline.js";
|
|
42
|
+
export type { LanedSpan, PlacedSpan, TimelineBindings, TimelineColumn, TimelineLens, TimelineOptions, TimelineRoles, TimelineViewProps, } from "./lens/timeline.js";
|
|
43
|
+
export { actThatMoves, addDays, addMonths, CalendarBindingError, CALENDAR_RANGES, CALENDAR_REQUIRED_ROLES, createCalendarLens, dayOf, daysBetween, daysFrom, endOfMonth, entriesIn, entriesOn, finerThan, minutesOf, placeOnCalendar, rangesOf, spanOf, startOfMonth, startOfQuarter, startOfWeek, titleOf, weekdayOf, } from "./lens/calendar.js";
|
|
44
|
+
export type { CalendarBindings, CalendarCell, CalendarGrain, CalendarHorizon, CalendarLens, CalendarOptions, CalendarRange, CalendarRoles, CalendarSpan, PlacedEntry, } from "./lens/calendar.js";
|
|
45
|
+
export { Begin, Door, downscale, Intake, PlanReview, PHOTO_MAX_EDGE, PHOTO_QUALITY } from "./seeding.js";
|
|
46
|
+
export type { BeginProps, DoorProps, IntakeProps, PlanReviewProps } from "./seeding.js";
|
|
47
|
+
export { buildPlanLens, createPlanLens, PlanBindingError, PlanView, PLAN_REQUIRED_ROLES, } from "./lens/plan.js";
|
|
48
|
+
export type { PlanLens, PlanLensOptions, PlanLensState, PlanViewProps } from "./lens/plan.js";
|
|
49
|
+
export { THUMBNAIL_BUDGET } from "./default-views.js";
|
|
50
|
+
export { withMore } from "./lens/more.js";
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iB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AAC;AACzG,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export { BOARD_REQUIRED_ROLES, BoardBindingError, BoardView, buildBoard, createBoardLens, } from "./lens/board.js";
|
|
2
|
+
export { ActivityRail, StartFresh, AgentSeat, AnswerArgs, BackOut, Backtrack, Inspector, nameOf, OverviewButton, descentTarget, Standing, Trail, UndoTurn, useRecentChanges, } from "./workbench/index.js";
|
|
3
|
+
export { buildCoverage, capCoverage, CoverageBindingError, COVERAGE_MAX_COLUMNS, COVERAGE_MAX_ROWS, COVERAGE_REQUIRED_ROLES, CoverageView, createCoverageLens, } from "./lens/coverage.js";
|
|
4
|
+
export { ArrangeBar, arrangementCaption, arrangementOf, sayCondition, withArrangement } from "./arrange-bar.js";
|
|
5
|
+
export { useArranging } from "./lens/arranging.js";
|
|
6
|
+
export { Connections } from "./connections.js";
|
|
7
|
+
export { EditableTitle, EditableValue, Fields, humanise } from "./editable.js";
|
|
8
|
+
export { Companion, useSubject } from "./companion.js";
|
|
9
|
+
export { RelationKey, RelationMark, relationWords } from "./relation-key.js";
|
|
10
|
+
export { QuickRelations, handles } from "./quick-relations.js";
|
|
11
|
+
export { rosterOf } from "./default-views.js";
|
|
12
|
+
export { ChatPanel } from "./chat.js";
|
|
13
|
+
export { LadderSetting } from "./ladder.js";
|
|
14
|
+
export { describeSource, proposalKey, SeatComposer, SeatHeader, SeatSettings, SeatThread, Settled, splitAside, useSeatConversation, } from "./seat.js";
|
|
15
|
+
export { Wordmark } from "./wordmark.js";
|
|
16
|
+
export { Places } from "./places.js";
|
|
17
|
+
export { FindBox } from "./find.js";
|
|
18
|
+
export { ShowInstallation } from "./installation.js";
|
|
19
|
+
export { Seats } from "./seats.js";
|
|
20
|
+
export { Profile } from "./profile.js";
|
|
21
|
+
export { buildReach, ReachView, reachLens } from "./lens/reach.js";
|
|
22
|
+
export { Shell } from "./shell.js";
|
|
23
|
+
// The primitive set: enough for a new kind to render before anyone writes a view.
|
|
24
|
+
export { Aggregate, Axis, Chip, Connector, FAINT_TEXT, Grid, MUTED_TEXT, Panel, Prose, VISUALLY_HIDDEN, Roster, useWidth, } from "./primitives/index.js";
|
|
25
|
+
// The visual system: tokens, and the stylesheet an app drops in.
|
|
26
|
+
export { DARK, GRAVIEW_BRAND, LIGHT, SCHEMES, themeCss, themeVariables } from "./theme.js";
|
|
27
|
+
// Generic views for every cell, derived from the declaration.
|
|
28
|
+
export { hueFor, registerDefaultViews } from "./default-views.js";
|
|
29
|
+
export { hasFigure, KindFigure } from "./figure.js";
|
|
30
|
+
export { useMarkup } from "./markup.js";
|
|
31
|
+
// The worked example: one fully-built lens, from public primitives only.
|
|
32
|
+
export { activeWindow, assignLanes, createTimelineLens, placeOnTimeline, TimelineBindingError, TimelineView, TIMELINE_REQUIRED_ROLES, } from "./lens/timeline.js";
|
|
33
|
+
// The calendar: day, week, month, quarter, year and a horizon the app names,
|
|
34
|
+
// over real dates. Bound by roles like every other starter, and it has never
|
|
35
|
+
// heard of a task, a shift or a planting.
|
|
36
|
+
export { actThatMoves, addDays, addMonths, CalendarBindingError, CALENDAR_RANGES, CALENDAR_REQUIRED_ROLES, createCalendarLens, dayOf, daysBetween, daysFrom, endOfMonth, entriesIn, entriesOn, finerThan, minutesOf, placeOnCalendar, rangesOf, spanOf, startOfMonth, startOfQuarter, startOfWeek, titleOf, weekdayOf, } from "./lens/calendar.js";
|
|
37
|
+
// The surfaces a blank graph needs, derived from the chain the declaration
|
|
38
|
+
// already states: the way in, what a model proposes before it does it, and
|
|
39
|
+
// the doors it was declared to be reachable through.
|
|
40
|
+
export { Begin, Door, downscale, Intake, PlanReview, PHOTO_MAX_EDGE, PHOTO_QUALITY } from "./seeding.js";
|
|
41
|
+
export { buildPlanLens, createPlanLens, PlanBindingError, PlanView, PLAN_REQUIRED_ROLES, } from "./lens/plan.js";
|
|
42
|
+
export { THUMBNAIL_BUDGET } from "./default-views.js";
|
|
43
|
+
export { withMore } from "./lens/more.js";
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,EACT,SAAS,EACT,MAAM,EACN,cAAc,EACd,aAAa,EACb,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAU5B,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAChH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC/E,OAA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AC9D,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,yEAAyE;AACzE,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAY5B,6EAA6E;AAC7E,6EAA6E;AAC7E,0CAA0C;AAC1C,OAAO,EACL,YAAY,EACZ,OAAO,EACP,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,eAAe,EACf,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,cAAc,EACd,WAAW,EACX,OAAO,EACP,SAAS,GACV,MAAM,oBAAoB,CAAC;AAc5B,2EAA2E;AAC3E,2EAA2E;AAC3E,qDAAqD;AACrD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEzG,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AnySchema } from "@graview/core";
|
|
2
|
+
/**
|
|
3
|
+
* THE WAY INTO THE INSTALLATION, for those who keep it.
|
|
4
|
+
*
|
|
5
|
+
* A module drawn only for those who administer it is never a district for
|
|
6
|
+
* anyone else. For the seat that may run its acts there is one control, in
|
|
7
|
+
* the bar and on an embed's strip: press it and the installation's own
|
|
8
|
+
* kinds — the people, the invitations — rise into the scene beside the
|
|
9
|
+
* domain, as ordinary districts with ordinary cards and acts; press it
|
|
10
|
+
* again and they are gone. It is a stop (`show=installation` in the
|
|
11
|
+
* address), so Back knows the way out and an embed can open on it.
|
|
12
|
+
*
|
|
13
|
+
* Nothing renders for a seat that may not administer anything: the control
|
|
14
|
+
* is the policy's answer, not a hidden door.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ShowInstallation<S extends AnySchema>(): import("react").JSX.Element | null;
|
|
17
|
+
//# sourceMappingURL=installation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../src/installation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI/C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,SAAS,wCAmCnD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { withShown } from "@graview/layout";
|
|
3
|
+
import { useGraview, useNavigation } from "@graview/react";
|
|
4
|
+
/**
|
|
5
|
+
* THE WAY INTO THE INSTALLATION, for those who keep it.
|
|
6
|
+
*
|
|
7
|
+
* A module drawn only for those who administer it is never a district for
|
|
8
|
+
* anyone else. For the seat that may run its acts there is one control, in
|
|
9
|
+
* the bar and on an embed's strip: press it and the installation's own
|
|
10
|
+
* kinds — the people, the invitations — rise into the scene beside the
|
|
11
|
+
* domain, as ordinary districts with ordinary cards and acts; press it
|
|
12
|
+
* again and they are gone. It is a stop (`show=installation` in the
|
|
13
|
+
* address), so Back knows the way out and an embed can open on it.
|
|
14
|
+
*
|
|
15
|
+
* Nothing renders for a seat that may not administer anything: the control
|
|
16
|
+
* is the policy's answer, not a hidden door.
|
|
17
|
+
*/
|
|
18
|
+
export function ShowInstallation() {
|
|
19
|
+
const { administered } = useGraview();
|
|
20
|
+
const { view, go } = useNavigation();
|
|
21
|
+
const mine = administered.filter((module) => module.canShow);
|
|
22
|
+
if (mine.length === 0)
|
|
23
|
+
return null;
|
|
24
|
+
return (_jsx("div", { role: "group", "aria-label": "Administered", "data-testid": "administered", style: { display: "flex", gap: 6 }, children: mine.map((module) => (_jsx("button", { type: "button", "aria-pressed": module.shown, "data-testid": `show-${module.name}`, title: module.shown
|
|
25
|
+
? `Hide the ${module.name}'s own districts again`
|
|
26
|
+
: (module.description ?? `Show the ${module.name}'s own districts beside the domain`), onClick: () => go(withShown(view, module.name, !module.shown)), style: {
|
|
27
|
+
padding: "3px 11px",
|
|
28
|
+
borderRadius: 999,
|
|
29
|
+
fontSize: "0.875rem",
|
|
30
|
+
borderWidth: 1,
|
|
31
|
+
borderStyle: "solid",
|
|
32
|
+
borderColor: module.shown ? "var(--graview-accent)" : "var(--graview-edge)",
|
|
33
|
+
color: module.shown ? "var(--graview-accent)" : "var(--graview-ink-muted)",
|
|
34
|
+
background: module.shown ? "var(--graview-panel)" : "transparent",
|
|
35
|
+
}, children: module.shown ? `Hide the ${module.name}` : `Show the ${module.name}` }, module.name))) }));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=installation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installation.js","sourceRoot":"","sources":["../src/installation.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,EAAK,CAAC;IACzC,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,aAAa,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,YAAY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I,EAAE,CAAC,CAAC,CAAC,YAAY,MAAM,CAAC,IAAI,EAAE,IArBhE,MAAM,CAAC,IAAI,CAsBT,CACV,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
package/dist/ladder.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ladder.d.ts","sourceRoot":"","sources":["../src/ladder.tsx"],"names":[],"mappings":"AAsCA,wBAAgB,aAAa,gCAsG5B"}
|
package/dist/ladder.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useGraview } from "@graview/react";
|
|
3
|
+
/*
|
|
4
|
+
* THE LADDER, AS ONE ROW IN THE PROFILE. Which rung answers the chat —
|
|
5
|
+
* this graph, a model on this device, Jev (which decides and does not
|
|
6
|
+
* talk), or a frontier model with the person's own key — beside text size
|
|
7
|
+
* and scheme, in the same pills. It used to be a pane of prose the chat's
|
|
8
|
+
* gear opened over the map: four radios with a paragraph each, a key field
|
|
9
|
+
* with a placeholder about the dev server, three more sentences on where a
|
|
10
|
+
* key goes, clipped at the window's edge. That was configuration written
|
|
11
|
+
* as documentation. Here it is a setting: one short label per rung, a key
|
|
12
|
+
* field only when the rung needs one, one sentence on screen and the rest
|
|
13
|
+
* in a tooltip.
|
|
14
|
+
*/
|
|
15
|
+
const RUNGS = [
|
|
16
|
+
{ value: "graph", label: "this graph", why: "Keyless and instant: the graph answers from its own structure." },
|
|
17
|
+
{ value: "local", label: "on this device", why: "A small model runs in this browser. First use downloads about 1–2 GB; then it is free and private." },
|
|
18
|
+
{ value: "decision", label: "Jev, which decides", why: "A decision provider answers typed questions exactly — which surface, which zone, does this help — with a confidence. It writes no prose, so the graph still answers the chat." },
|
|
19
|
+
{ value: "remote", label: "a model, with my key", why: "A frontier model answers. Calls go straight from this browser to the provider." },
|
|
20
|
+
];
|
|
21
|
+
const field = {
|
|
22
|
+
font: "inherit",
|
|
23
|
+
fontSize: "0.875rem",
|
|
24
|
+
padding: "5px 9px",
|
|
25
|
+
minHeight: 24,
|
|
26
|
+
borderRadius: 8,
|
|
27
|
+
border: "1px solid var(--graview-edge)",
|
|
28
|
+
background: "var(--graview-panel)",
|
|
29
|
+
color: "var(--graview-ink)",
|
|
30
|
+
width: "100%",
|
|
31
|
+
boxSizing: "border-box",
|
|
32
|
+
};
|
|
33
|
+
const hint = { fontSize: "0.8125rem", color: "var(--graview-ink-muted)", lineHeight: 1.4 };
|
|
34
|
+
export function LadderSetting() {
|
|
35
|
+
const { intelligence, chooseIntelligence } = useGraview();
|
|
36
|
+
const current = RUNGS.find((rung) => rung.value === intelligence.source) ?? RUNGS[0];
|
|
37
|
+
const remote = intelligence.remote ?? { preset: "xai", apiKey: "" };
|
|
38
|
+
return (_jsxs("fieldset", { "data-testid": "setting-intelligence", style: { border: 0, margin: 0, padding: 0, display: "grid", gap: 5 }, children: [_jsx("legend", { style: { fontSize: "0.75rem", letterSpacing: "0.14em", textTransform: "uppercase", color: "var(--graview-ink-faint)", padding: 0 }, children: "Answers come from" }), _jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: RUNGS.map((rung) => {
|
|
39
|
+
const chosen = rung.value === intelligence.source;
|
|
40
|
+
return (_jsx("button", { type: "button", "aria-pressed": chosen, "data-testid": `setting-intelligence-${rung.value}`, title: rung.why, onClick: () => chooseIntelligence({ ...intelligence, source: rung.value }), style: {
|
|
41
|
+
minHeight: 24,
|
|
42
|
+
padding: "3px 10px",
|
|
43
|
+
borderRadius: 999,
|
|
44
|
+
fontSize: "0.875rem",
|
|
45
|
+
borderWidth: 1,
|
|
46
|
+
borderStyle: "solid",
|
|
47
|
+
borderColor: chosen ? "var(--graview-accent)" : "var(--graview-edge)",
|
|
48
|
+
color: chosen ? "var(--graview-accent)" : "var(--graview-ink-muted)",
|
|
49
|
+
background: chosen ? "var(--graview-panel)" : "transparent",
|
|
50
|
+
}, children: rung.label }, rung.value));
|
|
51
|
+
}) }), _jsx("span", { style: hint, "data-testid": "setting-intelligence-why", children: current.why.split(/(?<=\.)\s/)[0] }), intelligence.source === "decision" ? (_jsxs("label", { style: { display: "grid", gap: 3 }, children: [_jsx("span", { style: hint, children: "TypeSafe key \u2014 kept in this browser, sent only there. Empty uses this app's own door." }), _jsx("input", { type: "password", "data-testid": "intelligence-decision-key", value: intelligence.decision?.apiKey ?? "", onChange: (event) => chooseIntelligence({ ...intelligence, decision: { ...(intelligence.decision ?? {}), apiKey: event.target.value } }), autoComplete: "off", style: field })] })) : null, intelligence.source === "remote" ? (_jsxs("div", { style: { display: "grid", gap: 6 }, children: [_jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [_jsxs("select", { "data-testid": "intelligence-provider", value: remote.preset ?? "xai", onChange: (event) => chooseIntelligence({ ...intelligence, remote: { ...remote, preset: event.target.value } }), style: field, "aria-label": "Provider", children: [_jsx("option", { value: "xai", children: "xAI (Grok)" }), _jsx("option", { value: "custom", children: "OpenAI-compatible" })] }), _jsx("input", { "data-testid": "intelligence-model", value: remote.model ?? "", onChange: (event) => chooseIntelligence({ ...intelligence, remote: { ...remote, model: event.target.value } }), placeholder: remote.preset === "custom" ? "model id" : "grok-4-fast", "aria-label": "Model", style: field })] }), remote.preset === "custom" ? (_jsx("input", { "data-testid": "intelligence-base-url", value: remote.baseUrl ?? "", onChange: (event) => chooseIntelligence({ ...intelligence, remote: { ...remote, baseUrl: event.target.value } }), placeholder: "https://\u2026/v1", "aria-label": "Base URL", style: field })) : null, _jsxs("label", { style: { display: "grid", gap: 3 }, children: [_jsx("span", { style: hint, children: "API key \u2014 kept in this browser, sent only to the provider above." }), _jsx("input", { type: "password", "data-testid": "intelligence-key", value: remote.apiKey ?? "", onChange: (event) => chooseIntelligence({ ...intelligence, remote: { ...remote, apiKey: event.target.value } }), placeholder: remote.preset === "custom" ? "sk-…" : "xai-…", autoComplete: "off", style: field })] })] })) : null] }));
|
|
52
|
+
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AE,IAAI,sFAAyE,EAC1F,gBACE,IAAI,EAAC,UAAU,iBACH,kBAAkB,EAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE,EAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,GAAG,YAAY,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,EAC/G,WAAW,EAAE,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAC1D,YAAY,EAAC,KAAK,EAClB,KAAK,EAAE,KAAK,GACZ,IACI,IACJ,CACP,CAAC,CAAC,CAAC,IAAI,IACC,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type AnySchema, type Arranged, type ArrangeOption, type Arrangement, type NodeOfSchema } from "@graview/core";
|
|
2
|
+
import { type ViewProps } from "@graview/react";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
/**
|
|
5
|
+
* A LENS ARRANGES BEFORE IT DRAWS.
|
|
6
|
+
*
|
|
7
|
+
* The board, the timeline and the calendar each take their nodes and place
|
|
8
|
+
* them; none of them took a sort, a filter or a group, so the only way to
|
|
9
|
+
* see this week's shifts at the hall was to look for them. The arrangement
|
|
10
|
+
* lives in the stop (`in.sort`, `in.filter`, `in.group`, `in.q`) beside the
|
|
11
|
+
* calendar's own `in.at`, so an arranged picture is a link and Back
|
|
12
|
+
* restores it; this hook reads it, applies it to the nodes a lens is about
|
|
13
|
+
* to draw, and hands back the row to draw above them. Each lens says what
|
|
14
|
+
* it has no place for — a board has nowhere to group — and an app declines
|
|
15
|
+
* the rest with `arrange: false`.
|
|
16
|
+
*/
|
|
17
|
+
export interface ArrangingOptions<S extends AnySchema> {
|
|
18
|
+
/** What the app declared on the lens. Everything is on unless declined. */
|
|
19
|
+
readonly allow?: ArrangeOption;
|
|
20
|
+
/** What the lens itself has no place for. Composed with `allow`; a part either declines is off. */
|
|
21
|
+
readonly lensAllows?: ArrangeOption;
|
|
22
|
+
/** What the picture opens arranged by, when the stop says nothing. */
|
|
23
|
+
readonly arrangedBy?: Arrangement;
|
|
24
|
+
/** The nodes the arrangement is ABOUT; the rest pass through first, untouched. A board's slots, say. */
|
|
25
|
+
readonly only?: (node: NodeOfSchema<S>) => boolean;
|
|
26
|
+
/** The nodes to arrange instead of `props.nodes` — a board's occupants, found through the store. */
|
|
27
|
+
readonly subject?: readonly NodeOfSchema<S>[];
|
|
28
|
+
/** The kind whose declaration offers the arrangement. The subject nodes' kind when unsaid. */
|
|
29
|
+
readonly kind?: string;
|
|
30
|
+
readonly query?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface Arranging<S extends AnySchema> {
|
|
33
|
+
/** What to draw: the untouched nodes, then the subject nodes as arranged. */
|
|
34
|
+
readonly nodes: readonly NodeOfSchema<S>[];
|
|
35
|
+
readonly arranged: Arranged<NodeOfSchema<S>>;
|
|
36
|
+
readonly arrangement: Arrangement;
|
|
37
|
+
/** The row, at full fidelity and unless declined; null otherwise. */
|
|
38
|
+
readonly bar: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
export declare function useArranging<S extends AnySchema>(props: ViewProps<S>, options?: ArrangingOptions<S>): Arranging<S>;
|
|
41
|
+
//# sourceMappingURL=arranging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arranging.d.ts","sourceRoot":"","sources":["../../src/lens/arranging.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM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