@graview/react 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 +20 -0
- package/dist/activity.d.ts +113 -0
- package/dist/activity.d.ts.map +1 -0
- package/dist/activity.js +207 -0
- package/dist/activity.js.map +1 -0
- package/dist/animation.d.ts +64 -0
- package/dist/animation.d.ts.map +1 -0
- package/dist/animation.js +245 -0
- package/dist/animation.js.map +1 -0
- package/dist/captions.d.ts +43 -0
- package/dist/captions.d.ts.map +1 -0
- package/dist/captions.js +61 -0
- package/dist/captions.js.map +1 -0
- package/dist/channels.d.ts +15 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/channels.js +114 -0
- package/dist/channels.js.map +1 -0
- package/dist/connectors.d.ts +176 -0
- package/dist/connectors.d.ts.map +1 -0
- package/dist/connectors.js +837 -0
- package/dist/connectors.js.map +1 -0
- package/dist/context.d.ts +348 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +568 -0
- package/dist/context.js.map +1 -0
- package/dist/drawn.d.ts +60 -0
- package/dist/drawn.d.ts.map +1 -0
- package/dist/drawn.js +58 -0
- package/dist/drawn.js.map +1 -0
- package/dist/edge-signs.d.ts +13 -0
- package/dist/edge-signs.d.ts.map +1 -0
- package/dist/edge-signs.js +76 -0
- package/dist/edge-signs.js.map +1 -0
- package/dist/hooks.d.ts +160 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +457 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/keyboard.d.ts +5 -0
- package/dist/keyboard.d.ts.map +1 -0
- package/dist/keyboard.js +178 -0
- package/dist/keyboard.js.map +1 -0
- package/dist/kit.d.ts +10 -0
- package/dist/kit.d.ts.map +1 -0
- package/dist/kit.js +32 -0
- package/dist/kit.js.map +1 -0
- package/dist/local-intelligence.d.ts +31 -0
- package/dist/local-intelligence.d.ts.map +1 -0
- package/dist/local-intelligence.js +66 -0
- package/dist/local-intelligence.js.map +1 -0
- package/dist/motion.d.ts +17 -0
- package/dist/motion.d.ts.map +1 -0
- package/dist/motion.js +26 -0
- package/dist/motion.js.map +1 -0
- package/dist/occupants.d.ts +45 -0
- package/dist/occupants.d.ts.map +1 -0
- package/dist/occupants.js +57 -0
- package/dist/occupants.js.map +1 -0
- package/dist/parallel.d.ts +19 -0
- package/dist/parallel.d.ts.map +1 -0
- package/dist/parallel.js +30 -0
- package/dist/parallel.js.map +1 -0
- package/dist/picking.d.ts +30 -0
- package/dist/picking.d.ts.map +1 -0
- package/dist/picking.js +140 -0
- package/dist/picking.js.map +1 -0
- package/dist/plots.d.ts +106 -0
- package/dist/plots.d.ts.map +1 -0
- package/dist/plots.js +306 -0
- package/dist/plots.js.map +1 -0
- package/dist/pointer.d.ts +27 -0
- package/dist/pointer.d.ts.map +1 -0
- package/dist/pointer.js +39 -0
- package/dist/pointer.js.map +1 -0
- package/dist/presence.d.ts +110 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +280 -0
- package/dist/presence.js.map +1 -0
- package/dist/rails.d.ts +11 -0
- package/dist/rails.d.ts.map +1 -0
- package/dist/rails.js +15 -0
- package/dist/rails.js.map +1 -0
- package/dist/resolved-view.d.ts +78 -0
- package/dist/resolved-view.d.ts.map +1 -0
- package/dist/resolved-view.js +365 -0
- package/dist/resolved-view.js.map +1 -0
- package/dist/robot.d.ts +114 -0
- package/dist/robot.d.ts.map +1 -0
- package/dist/robot.js +93 -0
- package/dist/robot.js.map +1 -0
- package/dist/routes.d.ts +50 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +150 -0
- package/dist/routes.js.map +1 -0
- package/dist/scene-camera.d.ts +25 -0
- package/dist/scene-camera.d.ts.map +1 -0
- package/dist/scene-camera.js +130 -0
- package/dist/scene-camera.js.map +1 -0
- package/dist/scene-hand.d.ts +110 -0
- package/dist/scene-hand.d.ts.map +1 -0
- package/dist/scene-hand.js +317 -0
- package/dist/scene-hand.js.map +1 -0
- package/dist/scene-helpers.d.ts +46 -0
- package/dist/scene-helpers.d.ts.map +1 -0
- package/dist/scene-helpers.js +108 -0
- package/dist/scene-helpers.js.map +1 -0
- package/dist/scene-lines.d.ts +76 -0
- package/dist/scene-lines.d.ts.map +1 -0
- package/dist/scene-lines.js +578 -0
- package/dist/scene-lines.js.map +1 -0
- package/dist/scene-root.d.ts +71 -0
- package/dist/scene-root.d.ts.map +1 -0
- package/dist/scene-root.js +790 -0
- package/dist/scene-root.js.map +1 -0
- package/dist/scene.d.ts +17 -0
- package/dist/scene.d.ts.map +1 -0
- package/dist/scene.js +17 -0
- package/dist/scene.js.map +1 -0
- package/dist/seat-marks.d.ts +35 -0
- package/dist/seat-marks.d.ts.map +1 -0
- package/dist/seat-marks.js +43 -0
- package/dist/seat-marks.js.map +1 -0
- package/dist/settings.d.ts +30 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +73 -0
- package/dist/settings.js.map +1 -0
- package/dist/view-boundary.d.ts +33 -0
- package/dist/view-boundary.d.ts.map +1 -0
- package/dist/view-boundary.js +53 -0
- package/dist/view-boundary.js.map +1 -0
- package/dist/view-host.d.ts +57 -0
- package/dist/view-host.d.ts.map +1 -0
- package/dist/view-host.js +474 -0
- package/dist/view-host.js.map +1 -0
- package/dist/view-registry.d.ts +122 -0
- package/dist/view-registry.d.ts.map +1 -0
- package/dist/view-registry.js +20 -0
- package/dist/view-registry.js.map +1 -0
- package/dist/where-drawn.d.ts +151 -0
- package/dist/where-drawn.d.ts.map +1 -0
- package/dist/where-drawn.js +231 -0
- package/dist/where-drawn.js.map +1 -0
- package/package.json +60 -0
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import { aggregateId, edgeOfSelection, fromUrl, kindsOf, toggleExpanded, toUrl, withFocus, withRelation, withZoom, sameView, EMPTY_VIEW, withJackIn, } from "@graview/layout";
|
|
2
|
+
import { applyAffordance, deriveAffordances, editableFields, previewAffordance, } from "@graview/tools";
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
4
|
+
import { useFound, useGraph, useGraview } from "./context.js";
|
|
5
|
+
/** The current selection, and the ways an interface changes it. */
|
|
6
|
+
export function useSelection() {
|
|
7
|
+
const { selection, setSelection } = useGraview();
|
|
8
|
+
return useMemo(() => ({
|
|
9
|
+
selection,
|
|
10
|
+
set: (ids) => setSelection(ids),
|
|
11
|
+
clear: () => setSelection([]),
|
|
12
|
+
toggle: (id) => setSelection((current) => current.includes(id) ? current.filter((other) => other !== id) : [...current, id]),
|
|
13
|
+
isSelected: (id) => selection.includes(id),
|
|
14
|
+
}), [selection, setSelection]);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Everything currently broken, recomputed whenever the graph changes.
|
|
18
|
+
*
|
|
19
|
+
* The invariant engine has always known this and the interface only ever
|
|
20
|
+
* showed it to someone who happened to select an implicated node. An
|
|
21
|
+
* agreement nobody can see the state of is not an agreement anyone is
|
|
22
|
+
* keeping — "is anything wrong?" is the first question a person asks of a
|
|
23
|
+
* week, and it should never require hunting for it.
|
|
24
|
+
*/
|
|
25
|
+
export function useViolations() {
|
|
26
|
+
const { store } = useGraview();
|
|
27
|
+
const nodes = useGraph();
|
|
28
|
+
// `nodes` changes with the graph, so a re-render after an edit asks again.
|
|
29
|
+
return useMemo(() => violationsOf(store), [store, nodes]);
|
|
30
|
+
}
|
|
31
|
+
const evaluated = new WeakMap();
|
|
32
|
+
function violationsOf(store) {
|
|
33
|
+
let entry = evaluated.get(store);
|
|
34
|
+
if (!entry) {
|
|
35
|
+
const fresh = { violations: null };
|
|
36
|
+
// Cleared inside the store's notify, before React renders anything that asks again.
|
|
37
|
+
store.subscribe(() => {
|
|
38
|
+
fresh.violations = null;
|
|
39
|
+
});
|
|
40
|
+
evaluated.set(store, fresh);
|
|
41
|
+
entry = fresh;
|
|
42
|
+
}
|
|
43
|
+
entry.violations ??= store.violations();
|
|
44
|
+
return entry.violations;
|
|
45
|
+
}
|
|
46
|
+
/** Ids implicated in some current violation, for marking them in place. */
|
|
47
|
+
export function useFlagged() {
|
|
48
|
+
const violations = useViolations();
|
|
49
|
+
return useMemo(() => [...new Set(violations.flatMap((violation) => violation.nodeIds))], [violations]);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Everything the selection reaches: the selected nodes, plus everything one
|
|
53
|
+
* edge away from them.
|
|
54
|
+
*
|
|
55
|
+
* Selecting a person and having the week sit there unchanged is the same
|
|
56
|
+
* failure as clicking an event and getting an empty plane — the graph knows
|
|
57
|
+
* which five events that person is in, and the calendar is right there
|
|
58
|
+
* drawing all eighteen of them. A view that receives this can say so in its
|
|
59
|
+
* own idiom: a calendar lights up the spans, a roster rings the chips.
|
|
60
|
+
*
|
|
61
|
+
* Empty when nothing is selected, which every view must read as "no
|
|
62
|
+
* emphasis" rather than "nothing is related".
|
|
63
|
+
*/
|
|
64
|
+
export function useImplicated() {
|
|
65
|
+
const reachedBySelection = useReached();
|
|
66
|
+
const found = useFound();
|
|
67
|
+
/*
|
|
68
|
+
* AND WHAT THE WORDS FIND. A search lights its hits in whatever picture
|
|
69
|
+
* is open, through the same set every view already dims by — so a lens
|
|
70
|
+
* learns nothing new to take part. Words that find nothing dim it all:
|
|
71
|
+
* the one id nothing is called keeps the set non-empty.
|
|
72
|
+
*/
|
|
73
|
+
return useMemo(() => {
|
|
74
|
+
if (!found)
|
|
75
|
+
return reachedBySelection;
|
|
76
|
+
// Every match, not the strip's capped index: a real hit is never drawn dimmed.
|
|
77
|
+
const hits = found.matched;
|
|
78
|
+
if (hits.length === 0 && reachedBySelection.length === 0)
|
|
79
|
+
return [NOTHING_FOUND];
|
|
80
|
+
return [...new Set([...reachedBySelection, ...hits])];
|
|
81
|
+
}, [found, reachedBySelection]);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* What the SELECTION alone reaches — `useImplicated` without the search.
|
|
85
|
+
* For the one reading that must not confuse the two: a district's "tied"
|
|
86
|
+
* count is about what you picked, not what you typed.
|
|
87
|
+
*/
|
|
88
|
+
export function useReached() {
|
|
89
|
+
const { store, selection } = useGraview();
|
|
90
|
+
const nodes = useGraph();
|
|
91
|
+
return useMemo(() => {
|
|
92
|
+
if (selection.length === 0)
|
|
93
|
+
return [];
|
|
94
|
+
const chosen = new Set(selection);
|
|
95
|
+
const reached = new Set(chosen);
|
|
96
|
+
for (const edge of store.graph.allEdges()) {
|
|
97
|
+
if (chosen.has(edge.from))
|
|
98
|
+
reached.add(edge.to);
|
|
99
|
+
if (chosen.has(edge.to))
|
|
100
|
+
reached.add(edge.from);
|
|
101
|
+
}
|
|
102
|
+
/*
|
|
103
|
+
* What a selected thing JUDGES, as well as what it touches.
|
|
104
|
+
*
|
|
105
|
+
* A rule has no edges, so selecting one reached nothing and the screen
|
|
106
|
+
* did not change — it read as broken. What a rule is about is derivable
|
|
107
|
+
* from its violations, which name the nodes they implicate, so selecting
|
|
108
|
+
* one now lights those wherever they are drawn.
|
|
109
|
+
*/
|
|
110
|
+
for (const violation of store.violations()) {
|
|
111
|
+
if (violation.subjectId !== undefined && chosen.has(violation.subjectId)) {
|
|
112
|
+
for (const id of violation.nodeIds)
|
|
113
|
+
reached.add(id);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return [...reached];
|
|
117
|
+
}, [store, selection, nodes]);
|
|
118
|
+
}
|
|
119
|
+
/** Stands in the implicated set when a search found nothing, so every view dims. */
|
|
120
|
+
export const NOTHING_FOUND = "search:nothing";
|
|
121
|
+
/**
|
|
122
|
+
* What can be done with the current selection, recomputed whenever the
|
|
123
|
+
* selection or the graph changes.
|
|
124
|
+
*
|
|
125
|
+
* Derivation is cheap enough to run on every selection change — measured
|
|
126
|
+
* under a millisecond on the household example's whole graph — so there is no cache to go
|
|
127
|
+
* stale and no "refresh actions" button.
|
|
128
|
+
*/
|
|
129
|
+
export function useAffordances(options = {}) {
|
|
130
|
+
const { store, selection: chosen, principal, providers } = useGraview();
|
|
131
|
+
const { about, ...rest } = options;
|
|
132
|
+
const selection = about ?? chosen;
|
|
133
|
+
const nodes = useGraph();
|
|
134
|
+
return useMemo(() => {
|
|
135
|
+
// A selected kind card or district denotes KINDS; the binding owns those
|
|
136
|
+
// ids, so it translates here and providers only ever see the kinds.
|
|
137
|
+
const kindSelection = [...new Set(selection.flatMap((id) => kindsOf(id)))];
|
|
138
|
+
const edgeSelection = selection
|
|
139
|
+
.map((id) => edgeOfSelection(id))
|
|
140
|
+
.filter((edge) => edge !== null);
|
|
141
|
+
// Asked as WHOEVER IS HERE, so what the strip offers is what the store
|
|
142
|
+
// would accept — and what it withholds is stated with a reason rather
|
|
143
|
+
// than quietly missing. The installation's declared providers apply to
|
|
144
|
+
// every surface that asks, unless a caller deliberately overrides.
|
|
145
|
+
return deriveAffordances(store, selection, {
|
|
146
|
+
principal,
|
|
147
|
+
kindSelection,
|
|
148
|
+
edgeSelection,
|
|
149
|
+
...(providers ? { providers } : {}),
|
|
150
|
+
...rest,
|
|
151
|
+
});
|
|
152
|
+
}, [store, selection, options, nodes, principal, providers]);
|
|
153
|
+
}
|
|
154
|
+
/** Runs an affordance, or shows what it would do first. */
|
|
155
|
+
export function useApplyAffordance() {
|
|
156
|
+
const { store, principal } = useGraview();
|
|
157
|
+
return useMemo(() => ({
|
|
158
|
+
preview: (affordance, args) => previewAffordance(store, affordance, args ?? {}),
|
|
159
|
+
apply: (affordance, args) => applyAffordance(store, affordance, args ?? {}, {
|
|
160
|
+
// The principal, not a bare "human": the store enforces against
|
|
161
|
+
// this and the log attributes to it, and they must be one object.
|
|
162
|
+
author: principal,
|
|
163
|
+
}),
|
|
164
|
+
}), [store, principal]);
|
|
165
|
+
}
|
|
166
|
+
/** Navigation: every stop is a view, and every view is a URL. */
|
|
167
|
+
export function useNavigation() {
|
|
168
|
+
const { view, setView } = useGraview();
|
|
169
|
+
return useMemo(() => ({
|
|
170
|
+
view,
|
|
171
|
+
url: toUrl(view),
|
|
172
|
+
focus: (id) => setView((current) => withFocus(current, id)),
|
|
173
|
+
show: (relation) => setView((current) => withRelation(current, relation)),
|
|
174
|
+
toggle: (aggregateId) => setView((current) => toggleExpanded(current, aggregateId)),
|
|
175
|
+
go: (next) => setView(next),
|
|
176
|
+
}), [view, setView]);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Keeps the view in the URL fragment and honours the back button.
|
|
180
|
+
*
|
|
181
|
+
* The back button returning to the exact prior view is not a nicety here: it
|
|
182
|
+
* is the thing that makes a spatial interface navigable at all, because it
|
|
183
|
+
* means no arrangement is ever unreachable once you have left it.
|
|
184
|
+
*/
|
|
185
|
+
/**
|
|
186
|
+
* `useUrlSync` as a component, for shells that make syncing conditional —
|
|
187
|
+
* a hook inside `if (syncUrl)` is a Rules-of-Hooks trap the moment the
|
|
188
|
+
* flag ever changes; a conditionally RENDERED component is not.
|
|
189
|
+
*/
|
|
190
|
+
export function UrlSync() {
|
|
191
|
+
useUrlSync();
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
export function useUrlSync() {
|
|
195
|
+
const { view, setView, views } = useGraview();
|
|
196
|
+
/*
|
|
197
|
+
* A STOP THAT NAMES A PLACE AND NOT ITS GROUP STILL GOES THERE.
|
|
198
|
+
*
|
|
199
|
+
* `#view=grounds-map` is the link a page can actually write: the page knows
|
|
200
|
+
* the picture it is talking about, not how the layout spells the aggregate
|
|
201
|
+
* id of the kind behind it. The registry does know — a named place carries
|
|
202
|
+
* its kind — so the place is looked up here and the group it is a picture
|
|
203
|
+
* of becomes the focus. Without this the short form lands on the default
|
|
204
|
+
* view, which is the pasted-link problem one level up.
|
|
205
|
+
*/
|
|
206
|
+
const settled = useCallback((state) => {
|
|
207
|
+
const asked = state.within?.["view"];
|
|
208
|
+
if (asked === undefined || state.focusId)
|
|
209
|
+
return state;
|
|
210
|
+
const place = views.places().find((candidate) => candidate.as === asked);
|
|
211
|
+
return place ? { ...state, focusId: aggregateId(place.kind) } : state;
|
|
212
|
+
}, [views]);
|
|
213
|
+
/*
|
|
214
|
+
* Adopt the fragment on FIRST load, not only on navigation.
|
|
215
|
+
*
|
|
216
|
+
* "Every stop is a URL" was only half true: the view was written to the
|
|
217
|
+
* fragment and the back button honoured it, but opening a shared link
|
|
218
|
+
* landed on the default view and silently overwrote the address bar. A
|
|
219
|
+
* pasted link that does not go where it says is worse than no link.
|
|
220
|
+
*/
|
|
221
|
+
useEffect(() => {
|
|
222
|
+
if (typeof window === "undefined")
|
|
223
|
+
return;
|
|
224
|
+
const initial = settled(fromUrl(window.location.hash));
|
|
225
|
+
// Adopt ANY address that says something — overview, zoom, a selection —
|
|
226
|
+
// not only the focus-shaped ones. A pasted link that does not go where
|
|
227
|
+
// it says is worse than no link.
|
|
228
|
+
if (!sameView(initial, EMPTY_VIEW)) {
|
|
229
|
+
setView(initial);
|
|
230
|
+
}
|
|
231
|
+
// Once, on mount: later changes are this hook's own writes.
|
|
232
|
+
}, []);
|
|
233
|
+
useEffect(() => {
|
|
234
|
+
if (typeof window === "undefined")
|
|
235
|
+
return;
|
|
236
|
+
const onPop = () => setView(settled(fromUrl(window.location.hash)));
|
|
237
|
+
window.addEventListener("popstate", onPop);
|
|
238
|
+
window.addEventListener("hashchange", onPop);
|
|
239
|
+
return () => {
|
|
240
|
+
window.removeEventListener("popstate", onPop);
|
|
241
|
+
window.removeEventListener("hashchange", onPop);
|
|
242
|
+
};
|
|
243
|
+
}, [setView, settled]);
|
|
244
|
+
const landed = useRef(false);
|
|
245
|
+
const written = useRef(null);
|
|
246
|
+
useEffect(() => {
|
|
247
|
+
if (typeof window === "undefined")
|
|
248
|
+
return;
|
|
249
|
+
const next = toUrl(view);
|
|
250
|
+
// Only write when the view actually changed, or the back stack fills with
|
|
251
|
+
// duplicates and the back button stops meaning anything. The baseline
|
|
252
|
+
// still moves: after a popstate re-syncs the view, a stale baseline made
|
|
253
|
+
// the next drag read as travel and push a phantom stop.
|
|
254
|
+
if (window.location.hash === next) {
|
|
255
|
+
written.current = view;
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
/*
|
|
259
|
+
* ARRIVING is not a navigation.
|
|
260
|
+
*
|
|
261
|
+
* The first write is the app adopting its own default view, and pushing it
|
|
262
|
+
* put a stop in the history that nobody went to — so the back control was
|
|
263
|
+
* offered the moment the page loaded, and pressing it went to the blank
|
|
264
|
+
* URL the app had just left. Replacing is what a page does when it tidies
|
|
265
|
+
* its own address.
|
|
266
|
+
*/
|
|
267
|
+
if (!landed.current) {
|
|
268
|
+
landed.current = true;
|
|
269
|
+
written.current = view;
|
|
270
|
+
window.history.replaceState({ graview: trail.at }, "", next);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
/*
|
|
274
|
+
* MOVING THE FURNITURE IS NOT TRAVELLING.
|
|
275
|
+
*
|
|
276
|
+
* A drag writes the view state on every pointer move, because that is what
|
|
277
|
+
* makes the connectors follow the card. Pushed, one drag would be sixty
|
|
278
|
+
* history entries and Back would mean "one pixel ago". A change that
|
|
279
|
+
* touches only the camera or where things were dragged is an adjustment of
|
|
280
|
+
* the stop you are on, so it replaces: the address stays shareable and
|
|
281
|
+
* Back still means the place you were before you started fiddling.
|
|
282
|
+
*/
|
|
283
|
+
if (adjustment(written.current, view)) {
|
|
284
|
+
window.history.replaceState({ graview: trail.at }, "", next);
|
|
285
|
+
written.current = view;
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
written.current = view;
|
|
289
|
+
window.history.pushState({ graview: ++trail.at }, "", next);
|
|
290
|
+
// A new stop discards anything that was ahead of it, exactly as the
|
|
291
|
+
// browser does.
|
|
292
|
+
trail.depth = trail.at;
|
|
293
|
+
trail.tell();
|
|
294
|
+
}, [view]);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Where you are in your own history.
|
|
298
|
+
*
|
|
299
|
+
* The History API says nothing about whether there is anywhere to go forward
|
|
300
|
+
* to, and an interface cannot offer a control it does not know the state of —
|
|
301
|
+
* a forward arrow that is always enabled and usually does nothing is worse
|
|
302
|
+
* than none. So the position is tracked here, from the pushes this hook makes
|
|
303
|
+
* and the pops the browser reports.
|
|
304
|
+
*
|
|
305
|
+
* Module-level because there is one history per document, and because a hook
|
|
306
|
+
* that re-created it per component would count each navigation once per
|
|
307
|
+
* mounted consumer.
|
|
308
|
+
*/
|
|
309
|
+
/**
|
|
310
|
+
* Whether one view differs from another only in what the user MOVED.
|
|
311
|
+
*
|
|
312
|
+
* Where you are is the focus, the relation, what is expanded and whether you
|
|
313
|
+
* have risen above the stack. Where you dragged things to is not a different
|
|
314
|
+
* place; it is the same place, rearranged.
|
|
315
|
+
*/
|
|
316
|
+
/**
|
|
317
|
+
* WHETHER A CHANGE IS A STOP OR JUST A NUDGE OF THE ONE YOU ARE ON.
|
|
318
|
+
*
|
|
319
|
+
* Exported so it can be read and held to: what belongs in here is the
|
|
320
|
+
* difference between the back button meaning something and meaning "one
|
|
321
|
+
* pixel ago", and the two things that went wrong went wrong silently — the
|
|
322
|
+
* address changed, no entry was pushed, and the arrows stayed grey.
|
|
323
|
+
*/
|
|
324
|
+
export function adjustment(before, after) {
|
|
325
|
+
if (!before)
|
|
326
|
+
return false;
|
|
327
|
+
return (before.focusId === after.focusId &&
|
|
328
|
+
before.relation === after.relation &&
|
|
329
|
+
(before.overview ?? false) === (after.overview ?? false) &&
|
|
330
|
+
(before.zoom ?? false) === (after.zoom ?? false) &&
|
|
331
|
+
(before.past ?? false) === (after.past ?? false) &&
|
|
332
|
+
before.expanded.join(",") === after.expanded.join(",") &&
|
|
333
|
+
/*
|
|
334
|
+
* SHOWING A MODULE IS TRAVELLING. "Show the installation" raises whole
|
|
335
|
+
* districts into the scene — who is here, who has been invited — and
|
|
336
|
+
* its own comment always said it was a stop Back knew the way out of.
|
|
337
|
+
* It was not: `shown` was missing from this comparison, so the address
|
|
338
|
+
* gained `show=installation` and the entry was REPLACED, the arrows
|
|
339
|
+
* stayed grey, and one Back from the installation left the app.
|
|
340
|
+
*/
|
|
341
|
+
(before.shown ?? []).join(",") === (after.shown ?? []).join(",") &&
|
|
342
|
+
/*
|
|
343
|
+
* A VIEW MOVING ALONG ITS OWN DIMENSION IS TRAVELLING.
|
|
344
|
+
*
|
|
345
|
+
* Turning the calendar to October is going somewhere: a URL to send
|
|
346
|
+
* somebody, a place to come back to, a Back that means "the month I was
|
|
347
|
+
* looking at". Left out of this comparison it read as an adjustment of
|
|
348
|
+
* the stop — the address updated, no entry was pushed, and one Back
|
|
349
|
+
* from October landed past the calendar entirely, at the place before
|
|
350
|
+
* anyone opened it. That is the exact failure `within` exists to fix.
|
|
351
|
+
*/
|
|
352
|
+
sameWithin(before.within, after.within));
|
|
353
|
+
}
|
|
354
|
+
function sameWithin(before, after) {
|
|
355
|
+
const say = (held) => Object.entries(held ?? {})
|
|
356
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
357
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
358
|
+
.join("&");
|
|
359
|
+
return say(withoutWords(before)) === say(withoutWords(after));
|
|
360
|
+
}
|
|
361
|
+
/*
|
|
362
|
+
* TYPING IS NOT TRAVELLING. The words a row narrows by (`in.q`) change on
|
|
363
|
+
* every keystroke, and each one pushed a history entry — five letters, five
|
|
364
|
+
* Backs to leave a list. The scene's own `q` was never compared; the row's
|
|
365
|
+
* words are the same act and read the same way.
|
|
366
|
+
*/
|
|
367
|
+
function withoutWords(held) {
|
|
368
|
+
if (!held || !("q" in held))
|
|
369
|
+
return held;
|
|
370
|
+
const { q: _words, ...rest } = held;
|
|
371
|
+
return rest;
|
|
372
|
+
}
|
|
373
|
+
const trail = {
|
|
374
|
+
at: 0,
|
|
375
|
+
depth: 0,
|
|
376
|
+
listeners: new Set(),
|
|
377
|
+
tell() {
|
|
378
|
+
for (const listener of this.listeners)
|
|
379
|
+
listener();
|
|
380
|
+
},
|
|
381
|
+
};
|
|
382
|
+
if (typeof window !== "undefined") {
|
|
383
|
+
window.addEventListener("popstate", (event) => {
|
|
384
|
+
const state = event.state;
|
|
385
|
+
// A stop this app pushed knows its own position. Anything else — a link
|
|
386
|
+
// out and back, another app's entry — resets to the start rather than
|
|
387
|
+
// guessing, since a wrong answer here offers a control that does nothing.
|
|
388
|
+
trail.at = typeof state?.graview === "number" ? state.graview : 0;
|
|
389
|
+
if (trail.at > trail.depth)
|
|
390
|
+
trail.depth = trail.at;
|
|
391
|
+
trail.tell();
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Whether there is anywhere to go, and the way to go there.
|
|
396
|
+
*
|
|
397
|
+
* Every stop in a Graview app is a URL — that was the point of view state
|
|
398
|
+
* being serialisable — so back and forward are the BROWSER's, and this only
|
|
399
|
+
* makes them visible. An interface whose navigation is the browser's should
|
|
400
|
+
* not require the person using it to know that.
|
|
401
|
+
*/
|
|
402
|
+
export function useBacktrack() {
|
|
403
|
+
const subscribe = useCallback((listener) => {
|
|
404
|
+
trail.listeners.add(listener);
|
|
405
|
+
return () => trail.listeners.delete(listener);
|
|
406
|
+
}, []);
|
|
407
|
+
const at = useSyncExternalStore(subscribe, () => trail.at, () => 0);
|
|
408
|
+
const depth = useSyncExternalStore(subscribe, () => trail.depth, () => 0);
|
|
409
|
+
return useMemo(() => ({
|
|
410
|
+
canGoBack: at > 0,
|
|
411
|
+
canGoForward: at < depth,
|
|
412
|
+
back: () => window.history.back(),
|
|
413
|
+
forward: () => window.history.forward(),
|
|
414
|
+
}), [at, depth]);
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* "Jack in": lift one view out of the scene into a conventional full page.
|
|
418
|
+
*
|
|
419
|
+
* A FAMILIARITY affordance, not an interactivity escape hatch. Because
|
|
420
|
+
* pointer routing keeps the in-scene view fully interactive, jacking in is a
|
|
421
|
+
* comfort for a novel interface rather than a requirement to get work done —
|
|
422
|
+
* and every view has to render correctly both ways.
|
|
423
|
+
*/
|
|
424
|
+
export function useJackIn() {
|
|
425
|
+
const { view, setView } = useGraview();
|
|
426
|
+
/*
|
|
427
|
+
* Jacking in ZOOMS now — it does not jump. The gesture keeps its name and
|
|
428
|
+
* this hook keeps its contract, but underneath it is ordinary view state:
|
|
429
|
+
* focus the thing and zoom the scene in close, so entering tweens from
|
|
430
|
+
* wherever you were and the back button backs out of it. The modal page
|
|
431
|
+
* this used to open isolated the view from every relation it had.
|
|
432
|
+
*/
|
|
433
|
+
const enter = useCallback((id) => setView((current) => withJackIn(current, id)), [setView]);
|
|
434
|
+
const exit = useCallback(() => setView((current) => withZoom(current, false)), [setView]);
|
|
435
|
+
const jackedIn = view.zoom ? view.focusId : null;
|
|
436
|
+
return useMemo(() => ({ jackedIn, enter, exit, isJackedIn: view.zoom === true }), [jackedIn, enter, exit, view.zoom]);
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* The fields of a node that can be changed where they are shown, and the way
|
|
440
|
+
* to change one.
|
|
441
|
+
*
|
|
442
|
+
* `commit` runs the mutation the framework found, with the author set to a
|
|
443
|
+
* person — so an in-place edit lands in the op log, can be undone, and is
|
|
444
|
+
* judged by the invariants exactly like an edit made from the actions strip.
|
|
445
|
+
* There is no second write path.
|
|
446
|
+
*/
|
|
447
|
+
export function useEditableFields(id) {
|
|
448
|
+
const { store, principal } = useGraview();
|
|
449
|
+
const nodes = useGraph();
|
|
450
|
+
const fields = useMemo(() => (id === null ? [] : editableFields(store, id)), [store, id, nodes]);
|
|
451
|
+
const commit = useCallback((field, value, rest = {}) => {
|
|
452
|
+
const call = field.call(value);
|
|
453
|
+
store.apply({ name: call.name, args: { ...call.args, ...rest } }, { author: principal });
|
|
454
|
+
}, [store, principal]);
|
|
455
|
+
return { fields, commit };
|
|
456
|
+
}
|
|
457
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":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ST_MS, useFound, useGraph, useGraview, useGraviewIfAny, useNode, useRobots, useScenePointer, useViewMode, useWhereIs, ViewModeProvider } from "./context.js";
|
|
2
|
+
export { Figure, Occupants, PersonFigure } from "./occupants.js";
|
|
3
|
+
export { anchorOf, AUDIENCE_ROW, HEARTBEAT_MS, placeOthers, PRESENCE_SETTINGS, SHARE_OVER, SHARE_WHERE, tabSession, usePresenceState } from "./presence.js";
|
|
4
|
+
export type { Placed, PresenceInputs, PresenceState } from "./presence.js";
|
|
5
|
+
export type { OccupantsProps } from "./occupants.js";
|
|
6
|
+
export { foldRobots, participantOf, standingFor, VISIT_EACH_UP_TO } from "./robot.js";
|
|
7
|
+
export type { RobotEvent, RobotMode, RobotState, SeatNote } from "./robot.js";
|
|
8
|
+
export type { ActsDoor, AdministeredModule, DrawnBox, GraviewContextValue, GraviewProviderProps, PointerMenu, SceneHandle, Scheme, Seat, ViewMode } from "./context.js";
|
|
9
|
+
export { createPointerStore } from "./pointer.js";
|
|
10
|
+
export type { PointerStore, ScenePoint } from "./pointer.js";
|
|
11
|
+
export { applySettings, honourSetting, loadSetting, rememberSetting } from "./settings.js";
|
|
12
|
+
export { createViews, DEFAULT_VIEW, isDefaultView, markDefaultView } from "./view-registry.js";
|
|
13
|
+
export { ViewBoundary } from "./view-boundary.js";
|
|
14
|
+
export type { ViewBoundaryProps } from "./view-boundary.js";
|
|
15
|
+
export type { Cardinality, Fidelity, ReactViewRegistry, ViewCell, ViewComponent, ViewProps, } from "./view-registry.js";
|
|
16
|
+
export { clipQuadratic, connectorStrands, altitudeOpacity, stackOpacity, onScreen, ResolvedView, Scene, selectionFor, tieRoute, whereIsIn, } from "./scene.js";
|
|
17
|
+
export type { SceneNode, Strand } from "./scene.js";
|
|
18
|
+
export { useAnimatedLayout, useSeatWork, useTouched } from "./animation.js";
|
|
19
|
+
export { SeatMarks } from "./seat-marks.js";
|
|
20
|
+
export type { SeatAct, SeatWork } from "./animation.js";
|
|
21
|
+
export type { TransitionOptions } from "./animation.js";
|
|
22
|
+
export { ACTIVITY_HOLD_MS, markActivity, useActivity, useAttention, } from "./activity.js";
|
|
23
|
+
export type { ActivityMark, Attention, Manner, ToolCallLike } from "./activity.js";
|
|
24
|
+
export type { ResolvedViewProps, SceneProps } from "./scene.js";
|
|
25
|
+
export { NOTHING_FOUND, useFlagged, useImplicated, useReached, useViolations } from "./hooks.js";
|
|
26
|
+
export { useLocalIntelligence } from "./local-intelligence.js";
|
|
27
|
+
export type { Ask, LocalIntelligence } from "./local-intelligence.js";
|
|
28
|
+
export { kitConnector, useKit } from "./kit.js";
|
|
29
|
+
export { clipPolyline, latticePoints, orthogonalPoints, polylineD, roundedPolylineD, routePoint, routedQuadratic } from "./routes.js";
|
|
30
|
+
export { bandRows, channelRoute } from "./channels.js";
|
|
31
|
+
export { useAffordances, useApplyAffordance, adjustment, useBacktrack, useEditableFields, useJackIn, useNavigation, useSelection, UrlSync, useUrlSync, } from "./hooks.js";
|
|
32
|
+
export { useDrawnSize, useTextMeasure } from "./drawn.js";
|
|
33
|
+
export type { DrawnOptions, DrawnSize } from "./drawn.js";
|
|
34
|
+
export { createMotionStore, useSceneStill } from "./motion.js";
|
|
35
|
+
export type { MotionStore } from "./motion.js";
|
|
36
|
+
export { landingIn, useTheKeyboardLandsSomewhere } from "./keyboard.js";
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC/L,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,QAAQ,EA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Y,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { GraviewProvider, ROBOT_REST_MS, useFound, useGraph, useGraview, useGraviewIfAny, useNode, useRobots, useScenePointer, useViewMode, useWhereIs, ViewModeProvider } from "./context.js";
|
|
2
|
+
export { Figure, Occupants, PersonFigure } from "./occupants.js";
|
|
3
|
+
export { anchorOf, AUDIENCE_ROW, HEARTBEAT_MS, placeOthers, PRESENCE_SETTINGS, SHARE_OVER, SHARE_WHERE, tabSession, usePresenceState } from "./presence.js";
|
|
4
|
+
export { foldRobots, participantOf, standingFor, VISIT_EACH_UP_TO } from "./robot.js";
|
|
5
|
+
export { createPointerStore } from "./pointer.js";
|
|
6
|
+
export { applySettings, honourSetting, loadSetting, rememberSetting } from "./settings.js";
|
|
7
|
+
export { createViews, DEFAULT_VIEW, isDefaultView, markDefaultView } from "./view-registry.js";
|
|
8
|
+
export { ViewBoundary } from "./view-boundary.js";
|
|
9
|
+
export { clipQuadratic, connectorStrands, altitudeOpacity, stackOpacity, onScreen, ResolvedView, Scene, selectionFor, tieRoute, whereIsIn, } from "./scene.js";
|
|
10
|
+
export { useAnimatedLayout, useSeatWork, useTouched } from "./animation.js";
|
|
11
|
+
export { SeatMarks } from "./seat-marks.js";
|
|
12
|
+
export { ACTIVITY_HOLD_MS, markActivity, useActivity, useAttention, } from "./activity.js";
|
|
13
|
+
export { NOTHING_FOUND, useFlagged, useImplicated, useReached, useViolations } from "./hooks.js";
|
|
14
|
+
export { useLocalIntelligence } from "./local-intelligence.js";
|
|
15
|
+
export { kitConnector, useKit } from "./kit.js";
|
|
16
|
+
export { clipPolyline, latticePoints, orthogonalPoints, polylineD, roundedPolylineD, routePoint, routedQuadratic } from "./routes.js";
|
|
17
|
+
export { bandRows, channelRoute } from "./channels.js";
|
|
18
|
+
export { useAffordances, useApplyAffordance, adjustment, useBacktrack, useEditableFields, useJackIn, useNavigation, useSelection, UrlSync, useUrlSync, } from "./hooks.js";
|
|
19
|
+
export { useDrawnSize, useTextMeasure } from "./drawn.js";
|
|
20
|
+
export { createMotionStore, useSceneStill } from "./motion.js";
|
|
21
|
+
export { landingIn, useTheKeyboardLandsSomewhere } from "./keyboard.js";
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC/L,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG5J,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE3F,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAE,YAAY,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*/
|
|
3
|
+
export declare function landingIn(standing: Element, gone?: Element): HTMLElement | null;
|
|
4
|
+
export declare function useTheKeyboardLandsSomewhere(root: RefObject<HTMLElement | null>): void;
|
|
5
|
+
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../src/keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AA6DlD,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAU/E;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAiGtF"}
|