@graview/pages 0.2.0 → 0.2.2
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/held-element.d.ts +12 -0
- package/dist/held-element.d.ts.map +1 -0
- package/dist/held-element.js +90 -0
- package/dist/held-element.js.map +1 -0
- 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/one-place-city.d.ts.map +1 -1
- package/dist/one-place-city.js +1232 -193
- package/dist/one-place-city.js.map +1 -1
- package/dist/one-place-control.d.ts +9 -0
- package/dist/one-place-control.d.ts.map +1 -1
- package/dist/one-place-control.js +9 -0
- package/dist/one-place-control.js.map +1 -1
- package/dist/one-place-geometry.d.ts +72 -1
- package/dist/one-place-geometry.d.ts.map +1 -1
- package/dist/one-place-geometry.js +104 -6
- package/dist/one-place-geometry.js.map +1 -1
- package/dist/one-place-signs.d.ts +65 -0
- package/dist/one-place-signs.d.ts.map +1 -0
- package/dist/one-place-signs.js +405 -0
- package/dist/one-place-signs.js.map +1 -0
- package/dist/one-place.d.ts +12 -4
- package/dist/one-place.d.ts.map +1 -1
- package/dist/one-place.js +264 -54
- package/dist/one-place.js.map +1 -1
- package/dist/page-context.d.ts +19 -0
- package/dist/page-context.d.ts.map +1 -1
- package/dist/page-context.js.map +1 -1
- package/dist/page-problems.d.ts.map +1 -1
- package/dist/page-problems.js +18 -6
- package/dist/page-problems.js.map +1 -1
- package/dist/page-record.d.ts.map +1 -1
- package/dist/page-record.js +3 -1
- package/dist/page-record.js.map +1 -1
- package/dist/page-shell.d.ts.map +1 -1
- package/dist/page-shell.js +20 -4
- package/dist/page-shell.js.map +1 -1
- package/dist/page-typography.d.ts.map +1 -1
- package/dist/page-typography.js +3 -2
- package/dist/page-typography.js.map +1 -1
- package/dist/router.d.ts +2 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +57 -5
- package/dist/router.js.map +1 -1
- package/package.json +6 -6
package/dist/one-place.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { OVERVIEW_PATH, ONE_FACE_LAYERS, hueFor, labelOf } from "@graview/core";
|
|
2
|
+
import { LOCAL_LAYERS, OVERVIEW_PATH, ONE_FACE_LAYERS, counted, hueFor, labelOf } from "@graview/core";
|
|
3
|
+
import { RECORD_BOXES_ATTRIBUTE, RECORD_BOXES_MOVED, recordBoxesOf } from "@graview/core/record-boxes";
|
|
3
4
|
import { retryingImport } from "@graview/core/retry";
|
|
4
5
|
import { barPlaces, HOME_KEY, PastBar } from "@graview/primitives/pages";
|
|
5
6
|
import { lazyPart, useGraview, usePlayback } from "@graview/react/provider";
|
|
@@ -10,7 +11,8 @@ import { useStoreTick } from "./page-context.js";
|
|
|
10
11
|
import { pluralOf } from "./page-typography.js";
|
|
11
12
|
import { kindOfSlug, recordPath, pluralSlug } from "./registry.js";
|
|
12
13
|
import { OneFaceContext } from "./one-place-control.js";
|
|
13
|
-
import {
|
|
14
|
+
import { HeldHere } from "./held-element.js";
|
|
15
|
+
import { BOARD_ASPECT, boardFaceWidth, frameSpacing, smallWindow, CITY, LEVEL_NAMES, nearestThatWay, PAGE, PANEL, panelBox, panelRange, panelStoreKey, PHONE } from "./one-place-geometry.js";
|
|
14
16
|
/**
|
|
15
17
|
* PAGES AND THE SCENE ARE ONE PLACE (Graview HQ feature:f-page-zooms-out-to-the-city).
|
|
16
18
|
*
|
|
@@ -33,9 +35,11 @@ import { boardCut, CITY, LEVEL_NAMES, nearestThatWay, PAGE, PANEL, panelBox, pan
|
|
|
33
35
|
*
|
|
34
36
|
* One button at the window's bottom left rises and comes down a level and
|
|
35
37
|
* says which level this is; Alt and the arrows, and Escape for down, do the
|
|
36
|
-
* same from the keyboard; a pinch or ctrl and the wheel
|
|
37
|
-
* and the page with it, as far as the hand goes,
|
|
38
|
-
* level when let go.
|
|
38
|
+
* same from the keyboard; a pinch or ctrl and the wheel over the page beside
|
|
39
|
+
* the city scrub the camera, and the page with it, as far as the hand goes,
|
|
40
|
+
* settling to the nearest level when let go. Over the city, at Nearby and
|
|
41
|
+
* the City, a pinch zooms the camera and a drag pans it, and the level
|
|
42
|
+
* stays. The address is the page's
|
|
39
43
|
* route at every level, so Back and Forward work.
|
|
40
44
|
*
|
|
41
45
|
* The city's part (`one-place-city.tsx`) — the Scene, the camera, the
|
|
@@ -106,6 +110,8 @@ const TIP_WARM_MS = 300;
|
|
|
106
110
|
const TIP_PRESS_MS = 500;
|
|
107
111
|
/** When a tooltip of the control was last put away, for the warm window. */
|
|
108
112
|
let tipHiddenAt = -Infinity;
|
|
113
|
+
/** Until when a focus this face put on the control itself (a page with nothing else to take it) shows no tooltip. */
|
|
114
|
+
let quietFocusUntil = -Infinity;
|
|
109
115
|
/** When a pointer last went down: a focus that follows a press is the pointer's, and shows no tooltip. */
|
|
110
116
|
let pressedAt = -Infinity;
|
|
111
117
|
if (typeof document !== "undefined")
|
|
@@ -166,6 +172,8 @@ function useIntentTip() {
|
|
|
166
172
|
onPointerCancel: () => hide(0),
|
|
167
173
|
onFocus: (event) => {
|
|
168
174
|
// The keyboard's focus (or one moved there for it), not a press's.
|
|
175
|
+
if (performance.now() < quietFocusUntil)
|
|
176
|
+
return;
|
|
169
177
|
if (event.currentTarget.matches(":focus-visible") || performance.now() - pressedAt > 400)
|
|
170
178
|
show(event.currentTarget, text);
|
|
171
179
|
},
|
|
@@ -197,7 +205,7 @@ const keysOn = () => {
|
|
|
197
205
|
};
|
|
198
206
|
/** Typing somewhere: the keys are the field's, not the altitude's. */
|
|
199
207
|
const typingIn = (target) => target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement || (target instanceof HTMLElement && target.isContentEditable);
|
|
200
|
-
export function OnePlace({ context, children }) {
|
|
208
|
+
export function OnePlace({ context, page, onFace, children, }) {
|
|
201
209
|
const { views } = useGraview();
|
|
202
210
|
const store = context.store;
|
|
203
211
|
const schema = store.schema;
|
|
@@ -223,17 +231,28 @@ export function OnePlace({ context, children }) {
|
|
|
223
231
|
watch.observe(bar);
|
|
224
232
|
return () => watch.disconnect();
|
|
225
233
|
}, [bar]);
|
|
234
|
+
/* A host that draws the bar itself (an embed's) is handed the slot, and draws its bar there. */
|
|
235
|
+
const toldSlot = context.onBarSlot;
|
|
236
|
+
useLayoutEffect(() => {
|
|
237
|
+
if (!toldSlot)
|
|
238
|
+
return;
|
|
239
|
+
toldSlot(bar);
|
|
240
|
+
return () => toldSlot(null);
|
|
241
|
+
}, [bar, toldSlot]);
|
|
226
242
|
/*
|
|
227
243
|
* THE PANEL AS THE PERSON SIZED IT: dragged by its inner edge, or stepped
|
|
228
244
|
* by the arrow keys there — a desk's panel's width, a phone's sheet's
|
|
229
|
-
* height (the share of the window above it). Kept in this browser
|
|
230
|
-
*
|
|
245
|
+
* height (the share of the window above it). Kept in this browser for
|
|
246
|
+
* this app (its address and its name: two apps on one host keep their
|
|
247
|
+
* own), for the moves between levels to start and end from, and over the
|
|
248
|
+
* width the panel opens at (`context.panel`, 55% of a desk's window).
|
|
231
249
|
*/
|
|
232
250
|
const phoneNow = size.width <= PHONE;
|
|
233
|
-
const
|
|
251
|
+
const appKey = `${base || "/"}|${context.app?.name ?? context.brand?.name ?? schema.kinds.join(",")}`;
|
|
252
|
+
const panelKey = panelStoreKey(appKey, phoneNow);
|
|
234
253
|
const [panelSize, setPanelSize] = useState(() => {
|
|
235
254
|
try {
|
|
236
|
-
const kept = typeof window === "undefined" ? null : window.localStorage.getItem(
|
|
255
|
+
const kept = typeof window === "undefined" ? null : window.localStorage.getItem(panelStoreKey(appKey, windowSize().width <= PHONE));
|
|
237
256
|
return kept === null ? undefined : Number(kept) || undefined;
|
|
238
257
|
}
|
|
239
258
|
catch {
|
|
@@ -266,7 +285,8 @@ export function OnePlace({ context, children }) {
|
|
|
266
285
|
// A browser that keeps nothing keeps the size for this visit.
|
|
267
286
|
}
|
|
268
287
|
}, [panelKey]);
|
|
269
|
-
const
|
|
288
|
+
const share = context.panel;
|
|
289
|
+
const view = useMemo(() => ({ ...size, top: barHeight, ...(panelSize !== undefined ? { panel: panelSize } : {}), ...(share !== undefined ? { share } : {}) }), [size, barHeight, panelSize, share]);
|
|
270
290
|
const motion = useRef({ level: where.type === "overview" ? CITY : null, scrub: 0, scrubbing: false, held: false, resizing: false });
|
|
271
291
|
// What the camera says: the level rested at or headed for, and whether the page is out of the window.
|
|
272
292
|
const [now, setNow] = useState({ level: PAGE, away: where.type === "overview", moving: false });
|
|
@@ -292,18 +312,43 @@ export function OnePlace({ context, children }) {
|
|
|
292
312
|
*/
|
|
293
313
|
const boards = useMemo(() => {
|
|
294
314
|
const places = barPlaces({ store: store, principal: context.principal, views: context.views }).filter((place) => !place.hidden);
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
315
|
+
/*
|
|
316
|
+
* WHAT EACH BOARD SAYS IT IS. A view's board listed the first records of
|
|
317
|
+
* its kind, as its kind's list did: ten views on a rich app drew alike,
|
|
318
|
+
* and none looked like itself. A list's board says how many it holds
|
|
319
|
+
* and its first; a view's says whose view it is, over its own
|
|
320
|
+
* title; the home's and the connections' say what they are.
|
|
321
|
+
*/
|
|
322
|
+
const out = places.map((place) => {
|
|
323
|
+
const where = whereOf(schema, has, place.path.split("?")[0], placeKinds);
|
|
324
|
+
const list = where.type === "list";
|
|
325
|
+
const kind = place.kind;
|
|
326
|
+
const count = kind ? store.graph.count(kind) : 0;
|
|
327
|
+
const says = place.group === "home"
|
|
328
|
+
? "Front page"
|
|
329
|
+
: place.key === "connections"
|
|
330
|
+
? "The kinds, linked"
|
|
331
|
+
: list && kind
|
|
332
|
+
? count === 0
|
|
333
|
+
? `No ${pluralOf(store, kind).toLowerCase()} yet`
|
|
334
|
+
: counted(store.schema, kind, count)
|
|
335
|
+
: kind
|
|
336
|
+
? `View · ${pluralOf(store, kind).toLowerCase()}`
|
|
337
|
+
: "A view";
|
|
338
|
+
return {
|
|
339
|
+
key: place.key,
|
|
340
|
+
label: place.label,
|
|
341
|
+
path: place.path,
|
|
342
|
+
eyebrow: place.group === "home" ? "home" : place.group === "lists" ? "list" : "view",
|
|
343
|
+
says,
|
|
344
|
+
lines: list && kind ? firstOf(store, [kind]).slice(0, 1) : [],
|
|
345
|
+
kind: place.kind,
|
|
346
|
+
where,
|
|
347
|
+
};
|
|
348
|
+
});
|
|
304
349
|
if (where.type === "record") {
|
|
305
350
|
const node = store.graph.getNode(where.id);
|
|
306
|
-
out.push({ key: `record:${where.id}`, label: node ? labelOf(store.schema.tryDefinition(node.kind), node) : where.id, path: recordPath(schema, where.kind, where.id), eyebrow: "page", lines: [], kind: where.kind, where });
|
|
351
|
+
out.push({ key: `record:${where.id}`, label: node ? labelOf(store.schema.tryDefinition(node.kind), node) : where.id, path: recordPath(schema, where.kind, where.id), eyebrow: "page", says: "", lines: [], kind: where.kind, where });
|
|
307
352
|
}
|
|
308
353
|
return out;
|
|
309
354
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -355,13 +400,32 @@ export function OnePlace({ context, children }) {
|
|
|
355
400
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
356
401
|
}, [where.type]);
|
|
357
402
|
/** Another place, at a level: its address, and the camera asked to that level there. */
|
|
403
|
+
/*
|
|
404
|
+
* THE PAGE CHOSEN IS DRAWN FIRST, THEN IT MOVES. Asked for at the same
|
|
405
|
+
* moment as the address, the level began to move the page that was being
|
|
406
|
+
* left while the chosen one's route was still drawing — on a slow machine
|
|
407
|
+
* one long task, which landed inside the move as a leap. The level is
|
|
408
|
+
* asked once the new address has drawn and been painted.
|
|
409
|
+
*/
|
|
410
|
+
const pendingLevel = useRef(null);
|
|
411
|
+
useEffect(() => {
|
|
412
|
+
const pending = pendingLevel.current;
|
|
413
|
+
if (!pending || pending.path !== location.pathname)
|
|
414
|
+
return;
|
|
415
|
+
pendingLevel.current = null;
|
|
416
|
+
const frame = requestAnimationFrame(() => {
|
|
417
|
+
motion.current.level = pending.level;
|
|
418
|
+
});
|
|
419
|
+
return () => cancelAnimationFrame(frame);
|
|
420
|
+
}, [location.pathname]);
|
|
358
421
|
const openAt = useCallback((path, level) => {
|
|
359
|
-
|
|
422
|
+
// The page this is (asked by its path alone, or narrowed as it is): only the level moves. Narrowed otherwise (`/problems?kind=…` from `/problems`), it is gone to.
|
|
423
|
+
if (path.includes("?") ? path === `${location.pathname}${location.search}` : path === location.pathname)
|
|
360
424
|
return goLevel(level);
|
|
361
425
|
if (level > PAGE)
|
|
362
426
|
keep();
|
|
363
427
|
kept.current = level > PAGE ? { scrollY: 0, address: path } : null;
|
|
364
|
-
|
|
428
|
+
pendingLevel.current = { path: path.split("?")[0], level };
|
|
365
429
|
if (level > PAGE)
|
|
366
430
|
setNow((was) => (was.away ? was : { ...was, away: true }));
|
|
367
431
|
navigate(path);
|
|
@@ -406,8 +470,8 @@ export function OnePlace({ context, children }) {
|
|
|
406
470
|
/*
|
|
407
471
|
* A PINCH, OR CTRL AND THE WHEEL, SCRUBS THE ALTITUDE: on the page and on
|
|
408
472
|
* the panel this face moves the camera itself, as far as the hand goes;
|
|
409
|
-
* over the city the Scene's own hand zooms it, and the
|
|
410
|
-
*
|
|
473
|
+
* over the city the Scene's own hand zooms it, and the level stays.
|
|
474
|
+
* Nothing snaps: let go, it settles to the nearest level.
|
|
411
475
|
* Alt and the up arrow rise a level, Alt and the down arrow (or Escape)
|
|
412
476
|
* come down one — never while the keys are writing in a field.
|
|
413
477
|
*/
|
|
@@ -473,6 +537,69 @@ export function OnePlace({ context, children }) {
|
|
|
473
537
|
if (event.touches.length < 2)
|
|
474
538
|
pinch = null;
|
|
475
539
|
};
|
|
540
|
+
/*
|
|
541
|
+
* A TRACKPAD'S PINCH OVER THE PANEL (ctrl and the wheel, as the browser
|
|
542
|
+
* says one) steps the level, as two fingers on a phone's sheet do: it
|
|
543
|
+
* scrubs the altitude, Page↔Nearby↔City, settling to the nearest when let
|
|
544
|
+
* go. Over the city beside it the same pinch is the city's own and only
|
|
545
|
+
* zooms the camera (`one-place-city.tsx`); a plain scroll over the panel
|
|
546
|
+
* scrolls the page. At Page the pinch is the browser's own.
|
|
547
|
+
*/
|
|
548
|
+
/*
|
|
549
|
+
* SAFARI'S TRACKPAD PINCH is a GestureEvent, its `scale` how far the
|
|
550
|
+
* fingers have gone since they began: over the panel it scrubs the
|
|
551
|
+
* altitude as a pinch on a phone's sheet does (and the page is not
|
|
552
|
+
* zoomed by the browser while it is out of the window). Two fingers on
|
|
553
|
+
* glass are the touches' (above), never read twice.
|
|
554
|
+
*/
|
|
555
|
+
let gestureFrom = null;
|
|
556
|
+
const gestureStart = (event) => {
|
|
557
|
+
const now = latest.current.now;
|
|
558
|
+
if (!onPage(event.target) || !now.away || pinch !== null)
|
|
559
|
+
return;
|
|
560
|
+
event.preventDefault();
|
|
561
|
+
gestureFrom = now.level === PANEL && !now.moving ? 1 : null;
|
|
562
|
+
};
|
|
563
|
+
const gestureChange = (event) => {
|
|
564
|
+
if (!onPage(event.target) || !latest.current.now.away || pinch !== null)
|
|
565
|
+
return;
|
|
566
|
+
event.preventDefault();
|
|
567
|
+
if (gestureFrom === null)
|
|
568
|
+
return;
|
|
569
|
+
const scale = event.scale ?? 1;
|
|
570
|
+
if (!(scale > 0))
|
|
571
|
+
return;
|
|
572
|
+
begin();
|
|
573
|
+
motion.current.held = true;
|
|
574
|
+
// Fingers together is out: the altitude rises as far as they have closed.
|
|
575
|
+
motion.current.scrub += Math.log(gestureFrom / scale) * 1.6;
|
|
576
|
+
gestureFrom = scale;
|
|
577
|
+
};
|
|
578
|
+
const gestureEnd = () => {
|
|
579
|
+
if (gestureFrom !== null)
|
|
580
|
+
motion.current.held = false;
|
|
581
|
+
gestureFrom = null;
|
|
582
|
+
};
|
|
583
|
+
const wheel = (event) => {
|
|
584
|
+
if (!(event.ctrlKey || event.metaKey) || !onPage(event.target))
|
|
585
|
+
return;
|
|
586
|
+
// Safari says a pinch as a gesture as well: read once, from the gesture.
|
|
587
|
+
if (gestureFrom !== null) {
|
|
588
|
+
event.preventDefault();
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
const now = latest.current.now;
|
|
592
|
+
if (!now.away)
|
|
593
|
+
return;
|
|
594
|
+
// Out of the window, the browser never zooms the page under the hand: the pinch is the face's.
|
|
595
|
+
event.preventDefault();
|
|
596
|
+
if (!motion.current.scrubbing && (now.level !== PANEL || now.moving))
|
|
597
|
+
return;
|
|
598
|
+
const unit = event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? 400 : 1;
|
|
599
|
+
begin();
|
|
600
|
+
// Fingers together (the wheel's down) is out: the altitude rises as far as the camera's zoom would fall.
|
|
601
|
+
motion.current.scrub += event.deltaY * unit * 0.016;
|
|
602
|
+
};
|
|
476
603
|
const key = (event) => {
|
|
477
604
|
// Never with the browser's own chords (its zoom is Cmd or Ctrl and plus, minus, 0), never while the keys are writing, never into a view's frame.
|
|
478
605
|
const target = (event.composedPath()[0] ?? event.target);
|
|
@@ -492,7 +619,8 @@ export function OnePlace({ context, children }) {
|
|
|
492
619
|
const stop = !event.altKey ? LEVEL_KEYS.indexOf(event.key) : -1;
|
|
493
620
|
if (stop >= 0) {
|
|
494
621
|
event.preventDefault();
|
|
495
|
-
|
|
622
|
+
// The level's own key, at Nearby or the City, brings the camera back to that level's framing after a hand moved it.
|
|
623
|
+
if (stop !== level || level > PAGE)
|
|
496
624
|
latest.current.goTo(stop);
|
|
497
625
|
return;
|
|
498
626
|
}
|
|
@@ -519,12 +647,20 @@ export function OnePlace({ context, children }) {
|
|
|
519
647
|
window.addEventListener("touchmove", touchMove, { passive: false, capture: true });
|
|
520
648
|
window.addEventListener("touchend", touchEnd, { capture: true });
|
|
521
649
|
window.addEventListener("touchcancel", touchEnd, { capture: true });
|
|
650
|
+
window.addEventListener("wheel", wheel, { passive: false, capture: true });
|
|
651
|
+
window.addEventListener("gesturestart", gestureStart, { passive: false, capture: true });
|
|
652
|
+
window.addEventListener("gesturechange", gestureChange, { passive: false, capture: true });
|
|
653
|
+
window.addEventListener("gestureend", gestureEnd, { capture: true });
|
|
522
654
|
document.addEventListener("keydown", key);
|
|
523
655
|
return () => {
|
|
524
656
|
window.removeEventListener("touchstart", touchStart, { capture: true });
|
|
525
657
|
window.removeEventListener("touchmove", touchMove, { capture: true });
|
|
526
658
|
window.removeEventListener("touchend", touchEnd, { capture: true });
|
|
527
659
|
window.removeEventListener("touchcancel", touchEnd, { capture: true });
|
|
660
|
+
window.removeEventListener("wheel", wheel, { capture: true });
|
|
661
|
+
window.removeEventListener("gesturestart", gestureStart, { capture: true });
|
|
662
|
+
window.removeEventListener("gesturechange", gestureChange, { capture: true });
|
|
663
|
+
window.removeEventListener("gestureend", gestureEnd, { capture: true });
|
|
528
664
|
document.removeEventListener("keydown", key);
|
|
529
665
|
};
|
|
530
666
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -556,17 +692,42 @@ export function OnePlace({ context, children }) {
|
|
|
556
692
|
if (!onBoards && (active !== document.body || !moved))
|
|
557
693
|
return;
|
|
558
694
|
const title = sheet.current?.querySelector("main h1, h1:not([data-graview-app-bar] h1)");
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
695
|
+
/*
|
|
696
|
+
* A page with no title of its own (a view drawn in place of a record's
|
|
697
|
+
* page) takes the keyboard on its main part; only a page with none of
|
|
698
|
+
* that either puts it on the control — on the level it is at, its
|
|
699
|
+
* tooltip quiet: the first stop lit by a focus ring, "Page (1)" up, read
|
|
700
|
+
* as a second level chosen.
|
|
701
|
+
*/
|
|
702
|
+
const landing = title ?? sheet.current?.querySelector("main, [role=main]") ?? null;
|
|
703
|
+
if (landing) {
|
|
704
|
+
if (!landing.hasAttribute("tabindex")) {
|
|
705
|
+
landing.setAttribute("tabindex", "-1");
|
|
706
|
+
if (landing !== title)
|
|
707
|
+
landing.setAttribute("data-graview-focus-landing", "");
|
|
708
|
+
}
|
|
709
|
+
landing.focus({ preventScroll: true });
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
quietFocusUntil = performance.now() + 400;
|
|
713
|
+
(fab.current?.querySelector('button[aria-pressed="true"]') ?? fab.current?.querySelector("button"))?.focus({ preventScroll: true });
|
|
563
714
|
}
|
|
564
|
-
else
|
|
565
|
-
fab.current?.querySelector("button")?.focus({ preventScroll: true });
|
|
566
715
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
567
716
|
}, [now.level, now.moving, current, bar]);
|
|
568
717
|
const face = useMemo(() => ({ level: now.level, goLevel, openRecord, openPath: openAt, bar }), [now.level, goLevel, openRecord, openAt, bar]);
|
|
718
|
+
// The page drawn where it was first drawn reads the face from there: told it as it changes, before the frame is painted.
|
|
719
|
+
useLayoutEffect(() => {
|
|
720
|
+
onFace?.(face);
|
|
721
|
+
}, [face, onFace]);
|
|
722
|
+
useLayoutEffect(() => () => onFace?.(null), [onFace]);
|
|
569
723
|
const away = now.away;
|
|
724
|
+
/*
|
|
725
|
+
* IN THE PANEL: out of the window and at Nearby or above (headed there,
|
|
726
|
+
* or resting) — the page as a column beside the city, not a full page. The
|
|
727
|
+
* page says so (`data-graview-in-panel`, which each worker view's root
|
|
728
|
+
* takes too), and its gutter and its room above and below are a panel's.
|
|
729
|
+
*/
|
|
730
|
+
const inPanel = away && now.level >= PANEL;
|
|
570
731
|
// The page as one element: in the page's own flow while it is read, the window's box and then the panel's once it moves (`one-place-city.tsx` sets its box each frame).
|
|
571
732
|
const sheetStyle = away
|
|
572
733
|
? {
|
|
@@ -588,10 +749,11 @@ export function OnePlace({ context, children }) {
|
|
|
588
749
|
containerType: "inline-size",
|
|
589
750
|
// Out of the window's flow the page is under the bar already: the room it kept for it is none.
|
|
590
751
|
["--graview-one-face-bar"]: "0px",
|
|
752
|
+
// Its gutter and its room above and below: set each frame by the city part, from the altitude (`frameSpacingAt`), so they move with the page's box.
|
|
591
753
|
}
|
|
592
|
-
: { display: "contents", ["--graview-one-face-bar"]: `${barHeight}px
|
|
754
|
+
: { display: "contents", ["--graview-one-face-bar"]: `${barHeight}px`, ...frameSpacing(false) };
|
|
593
755
|
const subject = where.type === "record" ? where.id : null;
|
|
594
|
-
const
|
|
756
|
+
const whole = useWholeView(sheet, `${where.type}:${subject ?? ""}`);
|
|
595
757
|
/* The arrow keys among the boards: the nearest that way. */
|
|
596
758
|
const boardKeys = (event) => {
|
|
597
759
|
const ways = { ArrowLeft: "left", ArrowRight: "right", ArrowUp: "up", ArrowDown: "down" };
|
|
@@ -611,23 +773,30 @@ export function OnePlace({ context, children }) {
|
|
|
611
773
|
if (next)
|
|
612
774
|
boardEls.current.get(next)?.focus({ preventScroll: true });
|
|
613
775
|
};
|
|
614
|
-
return (_jsxs(OneFaceContext.Provider, { value: face, children: [_jsx("div", { ref: setBar, "data-testid": "one-place-bar", style: { position: "fixed", left: 0, right: 0, top: 0, zIndex: ONE_FACE_LAYERS.bar, background: "var(--graview-ground, Canvas)" } }), _jsx(Suspense, { fallback: null, children: _jsx(OnePlaceCity, { where: where, out: now.away, sheet: sheet, connected: connected, boards: standing, current: current, boardEls: boardEls, boardLayer: boardLayer, fab: fab, view: view, lessMotion: lessMotion(), resolve: resolve, openRecord: openRecord, openKind: openKind, onGround: onGround, motion: motion, onAltitude: onAltitude }) }), _jsx("div", { ref: sheet, "data-graview-one-place": now.level, "data-graview-standing-on": where.type === "record" ? where.id : where.type === "list" ? `kind:${where.kind}` : where.type, style: sheetStyle, children: _jsxs("div", { ...(now.level >= CITY ? { inert: true } : {}), style: away ? { minHeight: "100%", display: "flex", flexDirection: "column" } : { display: "contents" }, children: [children, away && subject ? _jsx(Connected, { store: store, id: subject, box: connected, sheet: sheet, openRecord: openRecord }) : null, away ? null : _jsx(FootRoom, { fab: fab, sheet: sheet })] }) }), _jsx("div", { ref: boardLayer, role: "group", "aria-label": "The app's views", "data-testid": "one-place-boards", tabIndex: -1, onKeyDown: boardKeys, hidden: now.level < PANEL && !now.moving, style: { position: "fixed", left: 0, top: 0, width: 0, height: 0, zIndex: ONE_FACE_LAYERS.
|
|
776
|
+
return (_jsxs(OneFaceContext.Provider, { value: face, children: [_jsx("div", { ref: setBar, "data-testid": "one-place-bar", "data-graview-one-face-bar": "", style: { position: "fixed", left: 0, right: 0, top: 0, zIndex: ONE_FACE_LAYERS.bar, background: "var(--graview-ground, Canvas)" } }), _jsx(Suspense, { fallback: null, children: _jsx(OnePlaceCity, { where: where, out: now.away, sheet: sheet, connected: connected, boards: standing, current: current, boardEls: boardEls, boardLayer: boardLayer, fab: fab, view: view, lessMotion: lessMotion(), resolve: resolve, openRecord: openRecord, openKind: openKind, onGround: onGround, motion: motion, onAltitude: onAltitude }) }), _jsx("div", { ref: sheet, "data-graview-one-place": now.level, ...(inPanel ? { "data-graview-in-panel": "" } : {}), "data-graview-standing-on": where.type === "record" ? where.id : where.type === "list" ? `kind:${where.kind}` : where.type, style: sheetStyle, children: _jsxs("div", { ...(now.level >= CITY ? { inert: true } : {}), style: away ? { minHeight: "100%", display: "flex", flexDirection: "column" } : { display: "contents" }, children: [context.embedded ? _jsx("div", { "aria-hidden": "true", "data-graview-bar-room": "", style: { height: "var(--graview-one-face-bar, 0px)", flex: "0 0 auto" } }) : null, away && subject && whole ? _jsx(Connected, { store: store, id: subject, box: connected, sheet: sheet, openRecord: openRecord, whole: true }) : null, page ? _jsx(HeldHere, { host: page }) : children, away && subject && !whole ? _jsx(Connected, { store: store, id: subject, box: connected, sheet: sheet, openRecord: openRecord, whole: false }) : null, away ? null : _jsx(FootRoom, { fab: fab, sheet: sheet })] }) }), _jsx("div", { ref: boardLayer, role: "group", "aria-label": "The app's views", "data-testid": "one-place-boards", tabIndex: -1, onKeyDown: boardKeys, hidden: now.level < PANEL && !now.moving, style: { position: "fixed", left: 0, top: 0, width: 0, height: 0, zIndex: ONE_FACE_LAYERS.page }, children: standing.map((board) => (_jsx("button", { ref: (el) => {
|
|
615
777
|
if (el)
|
|
616
778
|
boardEls.current.set(board.key, el);
|
|
617
779
|
else
|
|
618
780
|
boardEls.current.delete(board.key);
|
|
619
781
|
}, type: "button", "data-graview-board": board.key, ...(rising ? { "data-graview-rising": "" } : {}), ...(leaving.includes(board) ? { "data-graview-leaving": "", tabIndex: -1, "aria-hidden": true } : {}), "data-graview-board-path": board.path, ...(board.key === current ? { "aria-current": "page" } : {}), "aria-label": `${board.label}, ${board.eyebrow}${board.key === current ? ", the one you were on" : ""}`, title: board.label, onClick: () => intoBoard(board.key), onFocus: () => {
|
|
620
782
|
chosen.current = board.key;
|
|
621
|
-
}, className: "graview-one-place-board",
|
|
783
|
+
}, className: "graview-one-place-board",
|
|
784
|
+
// In the layer's own box, not each a layer of its own: every board's post is drawn under every board (`LOCAL_LAYERS.beneath`), so a post that has to cross another board runs behind its words, never over them.
|
|
785
|
+
style: { position: "absolute", left: 0, top: 0, width: 0, height: 0, padding: 0, margin: 0, border: "none", background: "none", cursor: "pointer", overflow: "visible", display: "block", opacity: 0, color: "inherit", font: "inherit", textAlign: "start" }, children: board.key === current ? null : _jsx(BoardFace, { board: board, width: boardFaceWidth(view), height: boardFaceWidth(view) / BOARD_ASPECT, small: smallWindow(view) }) }, board.key))) }), now.level === PANEL && !now.moving ? _jsx(PanelEdge, { view: view, size: sizePanel, keep: keepPanel, motion: motion }) : null, _jsx(Altitude, { box: fab, level: now.level, moving: now.moving, goTo: goTo, where: where, chosen: chosen, boards: boards, current: current, store: store, motion: motion, begin: beginAway }), _jsx("style", { children: ONE_PLACE_CSS })] }));
|
|
622
786
|
}
|
|
623
787
|
/**
|
|
624
788
|
* A BOARD'S FACE: the top of its page as the page draws it — what it is,
|
|
625
789
|
* its title — at the page's own size, scaled by the city part
|
|
626
790
|
* with the camera, so a board and the page that becomes one read alike.
|
|
791
|
+
* A title too long for it is cut whole, with an ellipsis; the board's own
|
|
792
|
+
* name (`title`, and what a screen reader is told) is the whole of it.
|
|
627
793
|
*/
|
|
628
|
-
function BoardFace({ board, width, height }) {
|
|
794
|
+
function BoardFace({ board, width, height, small }) {
|
|
795
|
+
// A small window's face is narrower and its words fewer to a line: its title on two lines, broken where a word must be, fits the card whole.
|
|
796
|
+
const sizes = small ? { pad: "16px 16px 0", says: "2.125rem", title: "2.25rem" } : { pad: "22px 34px 0", says: "2.25rem", title: "3.5rem" };
|
|
629
797
|
const hue = board.kind ? `hsl(${Math.round(hueFor(board.kind))} 55% 52%)` : "var(--graview-accent)";
|
|
630
|
-
|
|
798
|
+
const view = board.eyebrow === "view";
|
|
799
|
+
return (_jsx("div", { "data-graview-board-face": "", "aria-hidden": "true", style: { position: "absolute", left: 0, top: 0, width, height, transformOrigin: "0 0", background: "var(--graview-ground, Canvas)", border: "3px solid var(--graview-edge)", borderTop: `10px solid ${hue}`, borderRadius: 18, overflow: "hidden", boxShadow: "0 18px 40px rgba(0,0,0,0.28)", pointerEvents: "none" }, children: _jsxs("div", { lang: "en", style: { padding: sizes.pad, ...(view ? { background: `linear-gradient(color-mix(in srgb, ${hue} 16%, transparent), transparent 85%)`, height: "100%", boxSizing: "border-box" } : {}) }, children: [_jsx("div", { "data-graview-board-says": "", style: { fontSize: sizes.says, lineHeight: 1.2, fontWeight: 600, letterSpacing: "0.06em", textTransform: "uppercase", color: view ? hue : "var(--graview-ink-muted)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: board.says }), _jsx("div", { "data-graview-board-title": "", style: { marginTop: 6, fontSize: sizes.title, lineHeight: 1.15, fontWeight: 650, color: "var(--graview-ink)", display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden", overflowWrap: "break-word", hyphens: "auto" }, children: board.label }), _jsx("div", { style: { marginTop: 16, display: "grid", gap: 12 }, children: (small ? [] : board.lines).map((line, index) => (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 16, padding: "10px 16px", borderRadius: 12, border: "2px solid var(--graview-edge)", fontSize: "2.125rem", color: "var(--graview-ink-muted)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: [_jsx("span", { style: { flex: "0 0 auto", width: 18, height: 18, borderRadius: 9, border: `3px solid ${hue}` } }), _jsx("span", { style: { minWidth: 0, overflow: "hidden", textOverflow: "ellipsis" }, children: line })] }, index))) })] }) }));
|
|
631
800
|
}
|
|
632
801
|
/** How long a board takes to rise out of the city or sink into it, as a building does while the history plays. */
|
|
633
802
|
const RISE_MS = 420;
|
|
@@ -669,13 +838,15 @@ const ONE_PLACE_CSS = `
|
|
|
669
838
|
.graview-one-place-edge[aria-orientation="horizontal"]::after { top: 11px; left: 50%; height: 5px; width: 40px; margin-left: -20px; }
|
|
670
839
|
.graview-one-place-edge:hover::after, .graview-one-place-edge:focus-visible::after { background: var(--graview-accent); }
|
|
671
840
|
.graview-one-place-edge:focus-visible { outline: none; }
|
|
672
|
-
.graview-one-place-board
|
|
673
|
-
.graview-one-place-board::
|
|
841
|
+
.graview-one-place-board { touch-action: none; }
|
|
842
|
+
.graview-one-place-board::after { content: ""; position: absolute; z-index: ${LOCAL_LAYERS.beneath}; left: 50%; top: 100%; width: 2px; height: var(--graview-sign-post, 10px); margin-left: -1px; background: color-mix(in srgb, var(--graview-ink) 35%, transparent); }
|
|
843
|
+
.graview-one-place-board::before { content: ""; position: absolute; z-index: ${LOCAL_LAYERS.beneath}; left: 50%; top: calc(100% + var(--graview-sign-post, 10px)); width: 18px; height: 6px; margin: -3px 0 0 -9px; border-radius: 50%; background: rgba(0,0,0,0.28); }
|
|
674
844
|
.graview-one-place-board[data-graview-rising] { transform-origin: 50% 100%; transform: scaleY(1); transition: transform ${RISE_MS}ms cubic-bezier(.33,0,.2,1); }
|
|
675
845
|
@starting-style { .graview-one-place-board[data-graview-rising] { transform: scaleY(0); } }
|
|
676
846
|
.graview-one-place-board[data-graview-rising][data-graview-leaving] { transform: scaleY(0); pointer-events: none; }
|
|
677
847
|
.graview-one-place-board[aria-current] { outline: 2px solid color-mix(in srgb, var(--graview-accent) 60%, transparent); outline-offset: 3px; border-radius: 4px; }
|
|
678
848
|
[data-graview-past-slot] > * { pointer-events: auto; margin: 0 !important; }
|
|
849
|
+
[data-graview-focus-landing]:focus { outline: none; }
|
|
679
850
|
.graview-one-place-board:focus-visible { outline: 3px solid var(--graview-accent); outline-offset: 4px; border-radius: 6px; }
|
|
680
851
|
.graview-one-place-board:hover [data-graview-board-face] { border-color: var(--graview-accent); }
|
|
681
852
|
[data-graview-one-face-stops] { display: inline-flex; align-items: stretch; height: 32px; padding: 2px; gap: 2px; border-radius: 8px; border: 1px solid var(--graview-edge); background: var(--graview-panel, Canvas); box-shadow: 0 1px 2px rgba(0,0,0,0.12); box-sizing: border-box; }
|
|
@@ -757,20 +928,20 @@ function Altitude({ box, level, moving, goTo, where, chosen, boards, current, st
|
|
|
757
928
|
return "City: every page and view of the app";
|
|
758
929
|
};
|
|
759
930
|
/*
|
|
760
|
-
* THE LEGEND
|
|
761
|
-
*
|
|
762
|
-
*
|
|
763
|
-
*
|
|
931
|
+
* THE LEGEND IS A BUTTON. It starts put away — the Key, the control's
|
|
932
|
+
* last stop, opens it — beside the city and on the page alike: open by
|
|
933
|
+
* default it stood over a quarter of a desk's window at the City on the
|
|
934
|
+
* first visit, over the districts it was there to explain. Opened beside
|
|
935
|
+
* the city, it is kept open in this browser until it is put away, and
|
|
936
|
+
* kept put away after; read from this browser as the control mounts, so
|
|
937
|
+
* the swap of the pages' plain routes for this face keeps it.
|
|
764
938
|
*/
|
|
765
|
-
// A phone has no room beside the city for it: there it starts put away, until it is asked for — and then it is kept.
|
|
766
939
|
const [legendCity, setLegendCity] = useState(() => {
|
|
767
|
-
const roomy = typeof window === "undefined" || window.innerWidth > PHONE;
|
|
768
940
|
try {
|
|
769
|
-
|
|
770
|
-
return kept === null ? roomy : kept !== "hidden";
|
|
941
|
+
return window.localStorage.getItem(LEGEND_KEY) === "shown";
|
|
771
942
|
}
|
|
772
943
|
catch {
|
|
773
|
-
return
|
|
944
|
+
return false;
|
|
774
945
|
}
|
|
775
946
|
});
|
|
776
947
|
const [legendPage, setLegendPage] = useState(false);
|
|
@@ -803,7 +974,9 @@ function Altitude({ box, level, moving, goTo, where, chosen, boards, current, st
|
|
|
803
974
|
onPointerDown: (event) => {
|
|
804
975
|
event.preventDefault();
|
|
805
976
|
stopTips[stop].onPointerDown(event);
|
|
806
|
-
},
|
|
977
|
+
},
|
|
978
|
+
// The level it is at, pressed at Nearby or the City, brings the camera back to that level's framing.
|
|
979
|
+
onClick: () => (stop === level && level === PAGE ? undefined : goTo(stop)), children: [LEVEL_NAMES[stop], keyOpen ? (_jsx("kbd", { "data-testid": `altitude-keycap-${stop}`, "aria-hidden": "true", style: { position: "absolute", top: -22, left: "50%", transform: "translateX(-50%)", minWidth: 18, padding: "1px 5px", borderRadius: 4, border: "1px solid var(--graview-edge)", background: "var(--graview-panel, Canvas)", color: "var(--graview-ink)", font: "inherit", fontSize: "0.75rem", lineHeight: 1.4, textAlign: "center" }, children: LEVEL_KEYS[stop] })) : null] }, stop))), _jsx("button", { type: "button", "data-testid": "altitude-key", "data-graview-key-stop": "", "aria-expanded": keyOpen, "aria-label": "Key: what the city's marks mean", ...intent.on("Key: what the city's marks mean"), onClick: () => setKeyOpen((open) => !open), onKeyDown: (event) => {
|
|
807
980
|
// The Key's Escape is the Key's: it puts the Key away, and nothing moves a level.
|
|
808
981
|
if (event.key !== "Escape" || !keyOpen)
|
|
809
982
|
return;
|
|
@@ -1019,8 +1192,31 @@ function CityKey({ close }) {
|
|
|
1019
1192
|
* it for that record's building. Nothing at all when the page shows every
|
|
1020
1193
|
* one. What the Scene's own record view said under the record ("why this is
|
|
1021
1194
|
* here", "the list it is on") is here when the page does not say it.
|
|
1195
|
+
*
|
|
1196
|
+
* A PAGE THAT IS A VIEW'S WHOLE (Graview HQ brief
|
|
1197
|
+
* b-cloud-2026-11-13-connected-under-a-view): a tall view can put what the
|
|
1198
|
+
* record is connected to far below the first window, or under nothing that
|
|
1199
|
+
* says it is there. Then Connected stands at the page's top, every record
|
|
1200
|
+
* it is linked to said there at once, small, under how many there are; a
|
|
1201
|
+
* line leaves from the view's own part for a record where that part is in
|
|
1202
|
+
* sight, and from here where it is not.
|
|
1022
1203
|
*/
|
|
1023
|
-
|
|
1204
|
+
/** Whether the page the sheet holds is a view's whole (`data-graview-whole-view`), as it is drawn now. */
|
|
1205
|
+
function useWholeView(sheet, at) {
|
|
1206
|
+
const [whole, setWhole] = useState(false);
|
|
1207
|
+
useLayoutEffect(() => {
|
|
1208
|
+
const plane = sheet.current;
|
|
1209
|
+
if (!plane)
|
|
1210
|
+
return;
|
|
1211
|
+
const read = () => setWhole(plane.querySelector("[data-graview-whole-view]") !== null);
|
|
1212
|
+
read();
|
|
1213
|
+
const watch = typeof MutationObserver === "undefined" ? null : new MutationObserver(read);
|
|
1214
|
+
watch?.observe(plane, { childList: true, subtree: true });
|
|
1215
|
+
return () => watch?.disconnect();
|
|
1216
|
+
}, [sheet, at]);
|
|
1217
|
+
return whole;
|
|
1218
|
+
}
|
|
1219
|
+
function Connected({ store, id, box, sheet, openRecord, whole }) {
|
|
1024
1220
|
const tick = useStoreTick(store);
|
|
1025
1221
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1026
1222
|
const facts = useMemo(() => recordFacts(store, id), [store, id, tick]);
|
|
@@ -1032,9 +1228,16 @@ function Connected({ store, id, box, sheet, openRecord }) {
|
|
|
1032
1228
|
return;
|
|
1033
1229
|
const read = () => {
|
|
1034
1230
|
const shown = new Set();
|
|
1035
|
-
for (const part of plane.querySelectorAll(
|
|
1231
|
+
for (const part of plane.querySelectorAll(`[data-graview-pick], [data-graview-record], [data-record], a[href], [${RECORD_BOXES_ATTRIBUTE}]`)) {
|
|
1036
1232
|
if (box.current?.contains(part))
|
|
1037
1233
|
continue;
|
|
1234
|
+
/* A view drawn where the page cannot read (a worker view, a frame): the records its host says it shows, in sight or not. */
|
|
1235
|
+
const drawn = recordBoxesOf(part);
|
|
1236
|
+
if (drawn) {
|
|
1237
|
+
for (const one of drawn.shows())
|
|
1238
|
+
shown.add(one);
|
|
1239
|
+
continue;
|
|
1240
|
+
}
|
|
1038
1241
|
const marked = part.getAttribute("data-graview-pick") ?? part.getAttribute("data-graview-record") ?? part.getAttribute("data-record");
|
|
1039
1242
|
if (marked)
|
|
1040
1243
|
shown.add(marked);
|
|
@@ -1056,12 +1259,19 @@ function Connected({ store, id, box, sheet, openRecord }) {
|
|
|
1056
1259
|
read();
|
|
1057
1260
|
const watch = typeof MutationObserver === "undefined" ? null : new MutationObserver(read);
|
|
1058
1261
|
watch?.observe(plane, { childList: true, subtree: true });
|
|
1059
|
-
|
|
1262
|
+
plane.addEventListener(RECORD_BOXES_MOVED, read);
|
|
1263
|
+
return () => {
|
|
1264
|
+
watch?.disconnect();
|
|
1265
|
+
plane.removeEventListener(RECORD_BOXES_MOVED, read);
|
|
1266
|
+
};
|
|
1060
1267
|
}, [sheet, box, id, tick]);
|
|
1061
|
-
const groups = (facts?.links ?? []).map((group) => ({ ...group, targets: group.targets.filter((target) => !onPage?.has(target.id)) })).filter((group) => group.targets.length > 0);
|
|
1268
|
+
const groups = (facts?.links ?? []).map((group) => ({ ...group, targets: whole ? group.targets : group.targets.filter((target) => !onPage?.has(target.id)) })).filter((group) => group.targets.length > 0);
|
|
1062
1269
|
const total = groups.reduce((sum, group) => sum + group.targets.length, 0);
|
|
1063
1270
|
if (onPage === null || total === 0)
|
|
1064
1271
|
return _jsx("div", { ref: box, "data-graview-connected-box": "", hidden: true });
|
|
1272
|
+
if (whole) {
|
|
1273
|
+
return (_jsx("div", { ref: box, "data-graview-connected-box": "", "data-graview-connected-at": "top", style: { height: 0, opacity: 0, overflow: "hidden", background: "var(--graview-panel, Canvas)", borderBottom: "1px solid var(--graview-edge)", flex: "0 0 auto" }, children: _jsxs("section", { "data-graview-connected": total, "aria-label": "Connected", style: { padding: "8px 18px 10px" }, children: [_jsxs("h2", { style: { margin: "0 0 6px", fontSize: "0.95rem" }, children: ["Connected ", _jsxs("span", { style: { fontWeight: 400, color: "var(--graview-ink-faint)" }, children: ["\u00B7 ", total] })] }), groups.map((group) => (_jsxs("div", { style: { marginTop: 4 }, children: [_jsx("div", { style: { fontSize: "0.75rem", color: "var(--graview-ink-muted)" }, children: group.description ?? group.edgeKind }), _jsx("ul", { style: { listStyle: "none", margin: "2px 0 0", padding: 0, display: "flex", flexWrap: "wrap", gap: 4 }, children: group.targets.map((target) => (_jsx("li", { children: _jsx("button", { type: "button", "data-graview-record": target.id, onClick: () => openRecord(target.id, PANEL), style: { display: "inline-flex", alignItems: "center", minHeight: 26, padding: "2px 8px", border: "1px solid var(--graview-edge)", borderRadius: 999, background: "none", color: "var(--graview-ink)", font: "inherit", fontSize: "0.8125rem", cursor: "pointer" }, children: target.label }) }, target.id))) })] }, `${group.edgeKind}|${group.direction}`)))] }) }));
|
|
1274
|
+
}
|
|
1065
1275
|
return (_jsx("div", { ref: box, "data-graview-connected-box": "", style: { height: 0, opacity: 0, overflow: "hidden", background: "var(--graview-panel, Canvas)", borderTop: "1px solid var(--graview-edge)", flex: "0 0 auto" }, children: _jsxs("section", { "data-graview-connected": total, "aria-label": "Also connected", style: { padding: "10px 18px 12px" }, children: [_jsxs("h2", { style: { margin: "0 0 6px", fontSize: "0.95rem" }, children: ["Also connected ", _jsxs("span", { style: { fontWeight: 400, color: "var(--graview-ink-faint)" }, children: ["\u00B7 ", total] })] }), groups.map((group) => (_jsxs("div", { style: { marginTop: 6 }, children: [_jsx("div", { style: { fontSize: "0.75rem", color: "var(--graview-ink-muted)" }, children: group.description ?? group.edgeKind }), _jsx("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, children: group.targets.map((target) => (_jsx("li", { children: _jsx("button", { type: "button", "data-graview-record": target.id, onClick: () => openRecord(target.id, PANEL), style: { display: "block", width: "100%", textAlign: "start", padding: "4px 0", border: "none", background: "none", color: "var(--graview-ink)", font: "inherit", fontSize: "0.9rem", cursor: "pointer", minHeight: 32 }, children: target.label }) }, target.id))) })] }, `${group.edgeKind}|${group.direction}`)))] }) }));
|
|
1066
1276
|
}
|
|
1067
1277
|
export { PHONE };
|