@graview/primitives 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/dist/app-bar.d.ts +47 -1
- package/dist/app-bar.d.ts.map +1 -1
- package/dist/app-bar.js +270 -60
- package/dist/app-bar.js.map +1 -1
- package/dist/bar-panes-door.d.ts +8 -0
- package/dist/bar-panes-door.d.ts.map +1 -0
- package/dist/bar-panes-door.js +10 -0
- package/dist/bar-panes-door.js.map +1 -0
- package/dist/chat.js +1 -1
- package/dist/chat.js.map +1 -1
- package/dist/companion.d.ts +0 -15
- package/dist/companion.d.ts.map +1 -1
- package/dist/companion.js +19 -150
- package/dist/companion.js.map +1 -1
- package/dist/connections.d.ts +7 -1
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +13 -13
- package/dist/connections.js.map +1 -1
- package/dist/declared-lens-doors.d.ts +3 -3
- package/dist/declared-lens-doors.d.ts.map +1 -1
- package/dist/declared-lens-doors.js +37 -24
- package/dist/declared-lens-doors.js.map +1 -1
- package/dist/default-view.d.ts +2 -0
- package/dist/default-view.d.ts.map +1 -1
- package/dist/default-view.js +10 -4
- package/dist/default-view.js.map +1 -1
- package/dist/default-views.d.ts.map +1 -1
- package/dist/default-views.js +195 -42
- package/dist/default-views.js.map +1 -1
- package/dist/editable.d.ts +31 -0
- package/dist/editable.d.ts.map +1 -1
- package/dist/editable.js +86 -17
- package/dist/editable.js.map +1 -1
- package/dist/figure.js +1 -1
- package/dist/figure.js.map +1 -1
- package/dist/find.d.ts.map +1 -1
- package/dist/find.js +23 -6
- package/dist/find.js.map +1 -1
- package/dist/frame.d.ts +3 -2
- package/dist/frame.d.ts.map +1 -1
- package/dist/frame.js +2 -1
- package/dist/frame.js.map +1 -1
- package/dist/index.d.ts +13 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/lens/calendar-dates.d.ts +2 -0
- package/dist/lens/calendar-dates.d.ts.map +1 -1
- package/dist/lens/calendar-dates.js +2 -0
- package/dist/lens/calendar-dates.js.map +1 -1
- package/dist/lens/calendar-drawing.d.ts +2 -2
- package/dist/lens/calendar-drawing.d.ts.map +1 -1
- package/dist/lens/calendar-drawing.js +1 -2
- package/dist/lens/calendar-drawing.js.map +1 -1
- package/dist/lens/calendar-spans.d.ts.map +1 -1
- package/dist/lens/calendar-spans.js +1 -2
- package/dist/lens/calendar-spans.js.map +1 -1
- package/dist/lens/calendar-view.d.ts +2 -1
- package/dist/lens/calendar-view.d.ts.map +1 -1
- package/dist/lens/calendar-view.js +2 -1
- package/dist/lens/calendar-view.js.map +1 -1
- package/dist/notice-place.d.ts.map +1 -1
- package/dist/notice-place.js +2 -0
- package/dist/notice-place.js.map +1 -1
- package/dist/pages.d.ts +5 -3
- package/dist/pages.d.ts.map +1 -1
- package/dist/pages.js +5 -2
- package/dist/pages.js.map +1 -1
- package/dist/places.js +2 -2
- package/dist/places.js.map +1 -1
- package/dist/profile.d.ts.map +1 -1
- package/dist/profile.js +34 -9
- package/dist/profile.js.map +1 -1
- package/dist/prose-editor.d.ts +9 -0
- package/dist/prose-editor.d.ts.map +1 -0
- package/dist/prose-editor.js +64 -0
- package/dist/prose-editor.js.map +1 -0
- package/dist/record-head.d.ts +28 -0
- package/dist/record-head.d.ts.map +1 -0
- package/dist/record-head.js +3 -0
- package/dist/record-head.js.map +1 -0
- package/dist/relation-key.d.ts.map +1 -1
- package/dist/relation-key.js +2 -2
- package/dist/relation-key.js.map +1 -1
- package/dist/scene-css.d.ts.map +1 -1
- package/dist/scene-css.js +13 -0
- package/dist/scene-css.js.map +1 -1
- package/dist/scene-places.d.ts +37 -0
- package/dist/scene-places.d.ts.map +1 -0
- package/dist/scene-places.js +77 -0
- package/dist/scene-places.js.map +1 -0
- package/dist/spec-views.d.ts +9 -2
- package/dist/spec-views.d.ts.map +1 -1
- package/dist/spec-views.js +52 -4
- package/dist/spec-views.js.map +1 -1
- package/dist/subject.d.ts +17 -0
- package/dist/subject.d.ts.map +1 -0
- package/dist/subject.js +155 -0
- package/dist/subject.js.map +1 -0
- package/dist/text-body.d.ts +28 -0
- package/dist/text-body.d.ts.map +1 -0
- package/dist/text-body.js +64 -0
- package/dist/text-body.js.map +1 -0
- package/dist/view-doors.d.ts +5 -1
- package/dist/view-doors.d.ts.map +1 -1
- package/dist/view-doors.js +28 -14
- package/dist/view-doors.js.map +1 -1
- package/dist/workbench/answer-args.d.ts.map +1 -1
- package/dist/workbench/answer-args.js +26 -2
- package/dist/workbench/answer-args.js.map +1 -1
- package/dist/workbench/inspector.js +1 -1
- package/dist/workbench/inspector.js.map +1 -1
- package/dist/workbench/standing.d.ts.map +1 -1
- package/dist/workbench/standing.js +4 -3
- package/dist/workbench/standing.js.map +1 -1
- package/package.json +6 -6
package/dist/connections.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../src/connections.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAuD,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../src/connections.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAuD,MAAM,eAAe,CAAC;AAChH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAoCzC,MAAM,UAAU,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAoB;IACxE,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,EAAa,CAAC;IAC1C,qEAAqE;IACrE,QAAQ,EAAE,CAAC;IACX,sEAAsE;IACtE,0EAA0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C"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type AnySchema, type GraviewApp } from "@graview/core";
|
|
2
|
-
import type
|
|
3
|
-
/** Fetch the shipped lenses' factories; resolved, every door draws in the commit it is first drawn in. */
|
|
2
|
+
import { type ReactViewRegistry } from "@graview/react/provider";
|
|
3
|
+
/** Fetch the shipped lenses' factories; resolved, every door draws in the commit it is first drawn in. Rejected when they did not arrive, and asked for again on the next call (FR-139). */
|
|
4
4
|
export declare function fetchDeclaredLenses(): Promise<void>;
|
|
5
|
-
/** Fetch the home view's drawing: the blocks, and nothing of the lenses. */
|
|
5
|
+
/** Fetch the home view's drawing: the blocks, and nothing of the lenses. Asked for again after it failed (FR-139). */
|
|
6
6
|
export declare function fetchHomeView(): Promise<void>;
|
|
7
7
|
/**
|
|
8
8
|
* Registers every lens the declaration draws as a named place, lays the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declared-lens-doors.d.ts","sourceRoot":"","sources":["../src/declared-lens-doors.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"declared-lens-doors.d.ts","sourceRoot":"","sources":["../src/declared-lens-doors.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,SAAS,EAAkB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAAc,KAAK,iBAAiB,EAAsC,MAAM,yBAAyB,CAAC;AAyBjH,4LAA4L;AAC5L,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEnD;AA8BD,sHAAsH;AACtH,wBAAgB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7C;AAgCD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,SAAS,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAalL"}
|
|
@@ -1,48 +1,61 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { retryingImport } from "@graview/core/retry";
|
|
2
3
|
import { declaredLenses } from "@graview/core";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { lazyModule } from "@graview/react/provider";
|
|
5
|
+
import { Suspense } from "react";
|
|
6
|
+
/**
|
|
7
|
+
* A DECLARED LENS DRAWS (FR-79), REGISTERED BEFORE IT IS FETCHED.
|
|
8
|
+
*
|
|
9
|
+
* Every lens an app declares with a title is a place: a pill on the bar, a
|
|
10
|
+
* drive-in from altitude, a page at `/places/<as>` — drawn from the
|
|
11
|
+
* declaration alone, so a document a chat wrote and a TypeScript app that
|
|
12
|
+
* never registered a view both get their pictures. `declaredLenses` (in
|
|
13
|
+
* `@graview/core`) decides which lenses draw and with what options, the
|
|
14
|
+
* same list `graview check` and `graview describe` read; this registers a
|
|
15
|
+
* door for each over every kind it stands on, at both cells a place fills
|
|
16
|
+
* (many × full, many × summary).
|
|
17
|
+
*
|
|
18
|
+
* The factories themselves — the timeline, the calendar, the coverage
|
|
19
|
+
* grid, the board, the plan, the reach — are fetched when a door is first
|
|
20
|
+
* drawn (`./declared-lenses.tsx`), as the framework's own views are
|
|
21
|
+
* (FR-57): a page that never draws a lens never carries one.
|
|
22
|
+
*
|
|
23
|
+
* And the declaration's arrangement (FR-80) goes on the registry beside the
|
|
24
|
+
* places, so every face that reads the places reads where they go.
|
|
25
|
+
*/
|
|
26
|
+
const heavy = lazyModule(retryingImport(() => import("./declared-lenses.js")));
|
|
27
|
+
/** Fetch the shipped lenses' factories; resolved, every door draws in the commit it is first drawn in. Rejected when they did not arrive, and asked for again on the next call (FR-139). */
|
|
7
28
|
export function fetchDeclaredLenses() {
|
|
8
|
-
return (
|
|
9
|
-
heavy = lenses;
|
|
10
|
-
}));
|
|
29
|
+
return heavy.load().then(() => undefined);
|
|
11
30
|
}
|
|
12
31
|
function Drawn({ lens, view }) {
|
|
13
|
-
const View = heavy.declaredLensView(lens);
|
|
32
|
+
const View = heavy.current.declaredLensView(lens);
|
|
14
33
|
return _jsx(View, { ...view });
|
|
15
34
|
}
|
|
16
|
-
|
|
35
|
+
/* Drawn once the factories are here; until then the line, and they are asked for again (FR-139). */
|
|
36
|
+
const Arriving = heavy.part((_, props) => _jsx(Drawn, { ...props }), { what: "This picture" });
|
|
17
37
|
/** The view a declared lens draws as, behind a door: the lens itself once its factory is here. */
|
|
18
38
|
function doorFor(lens) {
|
|
19
39
|
const Door = (view) => {
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
const props = { lens, view: view };
|
|
23
|
-
return here ? (_jsx(Drawn, { ...props })) : (_jsx(Suspense, { fallback: null, children: _jsx(Arriving, { ...props }) }));
|
|
40
|
+
// Drawn at once when the factories are here, and the same element either way (`lazyModule`).
|
|
41
|
+
return (_jsx(Suspense, { fallback: null, children: _jsx(Arriving, { lens: lens, view: view }) }));
|
|
24
42
|
};
|
|
25
43
|
return Door;
|
|
26
44
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/** Fetch the home view's drawing: the blocks, and nothing of the lenses. */
|
|
45
|
+
const home = lazyModule(retryingImport(() => import("./home-view.js")));
|
|
46
|
+
/** Fetch the home view's drawing: the blocks, and nothing of the lenses. Asked for again after it failed (FR-139). */
|
|
30
47
|
export function fetchHomeView() {
|
|
31
|
-
return
|
|
32
|
-
home = module;
|
|
33
|
-
}));
|
|
48
|
+
return home.load().then(() => undefined);
|
|
34
49
|
}
|
|
35
50
|
function HomeDrawn({ blocks, view }) {
|
|
36
|
-
const View = home.homeView(blocks);
|
|
51
|
+
const View = home.current.homeView(blocks);
|
|
37
52
|
return _jsx(View, { ...view });
|
|
38
53
|
}
|
|
39
|
-
const HomeArriving =
|
|
54
|
+
const HomeArriving = home.part((_, props) => _jsx(HomeDrawn, { ...props }), { what: "The home" });
|
|
40
55
|
/** The home view (FR-81) behind a door, fetched when the home first draws it. */
|
|
41
56
|
function homeDoor(blocks) {
|
|
42
57
|
const door = (view) => {
|
|
43
|
-
|
|
44
|
-
const props = { blocks, view: view };
|
|
45
|
-
return here ? (_jsx(HomeDrawn, { ...props })) : (_jsx(Suspense, { fallback: null, children: _jsx(HomeArriving, { ...props }) }));
|
|
58
|
+
return (_jsx(Suspense, { fallback: null, children: _jsx(HomeArriving, { blocks: blocks, view: view }) }));
|
|
46
59
|
};
|
|
47
60
|
/*
|
|
48
61
|
* A home written as blocks says the app's line itself, under its own
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declared-lens-doors.js","sourceRoot":"","sources":["../src/declared-lens-doors.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"declared-lens-doors.js","sourceRoot":"","sources":["../src/declared-lens-doors.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAmD,MAAM,eAAe,CAAC;AAChG,OAAO,EAAE,UAAU,EAA8D,MAAM,yBAAyB,CAAC;AACjH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,KAAK,GAAG,UAAU,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAE/E,4LAA4L;AAC5L,MAAM,UAAU,mBAAmB;IACjC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AAC5C,CAAC;AAOD,SAAS,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAa;IACtC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CA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EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/default-view.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { type ReactViewRegistry, type ViewProps } from "@graview/react/provider"
|
|
|
3
3
|
import { type ReactNode } from "react";
|
|
4
4
|
/** The framework's own views for a schema, made once. */
|
|
5
5
|
export declare function defaultViewsOf<S extends AnySchema>(schema: S): ReactViewRegistry<S>;
|
|
6
|
+
/** Whether the surface around is itself the default for the cell: the pages face's record page. */
|
|
7
|
+
export declare function useDefaultElsewhere(): boolean;
|
|
6
8
|
/** Marks the views inside as drawn where the surface itself is the default. */
|
|
7
9
|
export declare function DefaultViewElsewhere({ children }: {
|
|
8
10
|
readonly children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-view.d.ts","sourceRoot":"","sources":["../src/default-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"default-view.d.ts","sourceRoot":"","sources":["../src/default-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAkD,KAAK,iBAAiB,EAAsB,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACrJ,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAiBnD,yDAAyD;AACzD,wBAAgB,cAAc,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAInF;AAWD,mGAAmG;AACnG,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAElF;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,sCAShG"}
|
package/dist/default-view.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createViews, useGraview } from "@graview/react/provider";
|
|
3
|
-
import {
|
|
2
|
+
import { createViews, DefaultDrawnElsewhere, useGraview } from "@graview/react/provider";
|
|
3
|
+
import { useContext } from "react";
|
|
4
4
|
import { registerDefaultViews } from "./default-views.js";
|
|
5
5
|
/*
|
|
6
6
|
* THE DEFAULT, INSIDE A VIEW OF YOUR OWN (FR-36).
|
|
@@ -24,9 +24,15 @@ export function defaultViewsOf(schema) {
|
|
|
24
24
|
/**
|
|
25
25
|
* Where the default for a cell is already drawn by the surface around a
|
|
26
26
|
* view: the pages face's record page is the framework's own record, so a
|
|
27
|
-
* page view that wraps the default draws only what it adds there.
|
|
27
|
+
* page view that wraps the default draws only what it adds there. The
|
|
28
|
+
* context is `@graview/react`'s, so a view drawn by a package that does not
|
|
29
|
+
* import this one — a worker view of one record (FR-149) — reads it too.
|
|
28
30
|
*/
|
|
29
|
-
const ELSEWHERE =
|
|
31
|
+
const ELSEWHERE = DefaultDrawnElsewhere;
|
|
32
|
+
/** Whether the surface around is itself the default for the cell: the pages face's record page. */
|
|
33
|
+
export function useDefaultElsewhere() {
|
|
34
|
+
return useContext(ELSEWHERE);
|
|
35
|
+
}
|
|
30
36
|
/** Marks the views inside as drawn where the surface itself is the default. */
|
|
31
37
|
export function DefaultViewElsewhere({ children }) {
|
|
32
38
|
return _jsx(ELSEWHERE.Provider, { value: true, children: children });
|
package/dist/default-view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-view.js","sourceRoot":"","sources":["../src/default-view.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAA8D,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"default-view.js","sourceRoot":"","sources":["../src/default-view.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,UAAU,EAA8D,MAAM,yBAAyB,CAAC;AACrJ,OAAO,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;;;GAUG;AAEH,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAwC,CAAC;AAErE,yDAAyD;AACzD,MAAM,UAAU,cAAc,CAAsB,MAAS;IAC3D,IAAI,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,CAAC,IAAI;QAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,GAAG,oBAAoB,CAAC,MAAmB,EAAE,WAAW,CAAC,MAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IACtH,OAAO,IAAuC,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,qBAAqB,CAAC;AAExC,mGAAmG;AACnG,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,oBAAoB,CAAC,EAAE,QAAQ,EAAoC;IACjF,OAAO,KAAC,SAAS,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YAAG,QAAQ,GAAsB,CAAC;AAC1E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAsB,KAAgD;IAC/F,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,EAAK,CAAC;IAClC,IAAI,SAAS;QAAE,OAAO,IAAI,CAAC;IAC3B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IACtE,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAiC,CAAC;IACrJ,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,OAAO,KAAC,IAAI,OAAM,KAAsB,GAAI,CAAC;AAC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-views.d.ts","sourceRoot":"","sources":["../src/default-views.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-views.d.ts","sourceRoot":"","sources":["../src/default-views.tsx"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,SAAS,EAIf,MAAM,eAAe,CAAC;AAIvB,OAAO,EAQL,KAAK,iBAAiB,EAIN,MAAM,yBAAyB,CAAC;AAiBlD;;;;;;;;GAQG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,0EAA0E;AAC1E,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG3C;AAyBD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAMrH;AA+LD,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,SAAS,EACtD,MAAM,EAAE,CAAC,EACT,QAAQ,GAAE,iBAAiB,CAAC,CAAC,CAAuB,GACnD,iBAAiB,CAAC,CAAC,CAAC,CA21BtB"}
|
package/dist/default-views.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { arrange } from "@graview/core/arrange";
|
|
3
|
+
import { retryingImport } from "@graview/core/retry";
|
|
3
4
|
import { describeNode, humanizeField, labelOf, nounOf, readableFields, violationsTouching, } from "@graview/core";
|
|
4
5
|
import { withComputed } from "@graview/core/blocks";
|
|
5
|
-
import { aggregateId, kindCardId, rosterRows, withFocus, withJackIn, withOverview, withPast, withWithin } from "@graview/layout/view";
|
|
6
|
+
import { aggregateId, kindCardId, rosterRows, withFocus, withJackIn, withOverview, withPast, withPicture, withWithin } from "@graview/layout/view";
|
|
6
7
|
import { useKit, useMarqueeRoom, useReached } from "@graview/react/drawing";
|
|
7
|
-
import { createViews, useFound, useGraview, useNavigation, useSelection, useViolations, isDefaultView, markDefaultView } from "@graview/react/provider";
|
|
8
|
-
import {
|
|
8
|
+
import { createViews, useFound, useGraview, useNavigation, useSelection, useViolations, isDefaultView, lazyModule, markDefaultView } from "@graview/react/provider";
|
|
9
|
+
import { Suspense, useContext, useLayoutEffect, useRef, useState } from "react";
|
|
9
10
|
import { arrangementOf, withArrangement } from "./arrangement.js";
|
|
10
11
|
/*
|
|
11
12
|
* THE ROW THAT ARRANGES A DISTRICT, fetched when a district is opened full
|
|
12
13
|
* with more than one member in it: every other card draws without it, and a
|
|
13
14
|
* page's first chunk does not carry it (FR-57).
|
|
14
15
|
*/
|
|
15
|
-
const ArrangeBar =
|
|
16
|
+
const ArrangeBar = lazyModule(retryingImport(() => import("./arrange-bar.js"))).part((bar, props) => _jsx(bar.ArrangeBar, { ...props }), { what: "Arranging this list" });
|
|
16
17
|
import { Connections } from "./connections.js";
|
|
17
18
|
import { EditableTitle, Fields } from "./editable.js";
|
|
18
19
|
import { Aggregate, Chip, Panel, Roster } from "./primitives/index.js";
|
|
20
|
+
import { RecordHeadContext } from "./record-head.js";
|
|
19
21
|
/**
|
|
20
22
|
* A generic view for every cell of the matrix, derived from the declaration.
|
|
21
23
|
*
|
|
@@ -73,6 +75,70 @@ export function rosterOf(names, rows) {
|
|
|
73
75
|
}
|
|
74
76
|
/** How many members a pile draws as rows before it says how many more. */
|
|
75
77
|
const ROWS_SHOWN = 8;
|
|
78
|
+
/** How long after a lens is pressed a second press still makes it a double-click: the platforms' own default. */
|
|
79
|
+
const SECOND_PRESS_MS = 500;
|
|
80
|
+
/** How far from the first press the second may land and still be its double-click: the platforms' own slop, in CSS pixels. */
|
|
81
|
+
const SECOND_PRESS_SLOP = 12;
|
|
82
|
+
/** The press an event is, read the same way for the first press and the second. */
|
|
83
|
+
function pressOf(event) {
|
|
84
|
+
return { x: event.clientX, y: event.clientY, pointerType: event.pointerType ?? "" };
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* THE SECOND PRESS OF A DOUBLE-CLICK, WHERE THE POINTER STILL IS.
|
|
88
|
+
*
|
|
89
|
+
* Pressing a lens on its district flies the camera to it, so by the second
|
|
90
|
+
* click of a double-click the lens has moved out from under the pointer and
|
|
91
|
+
* the district's own card is there instead: the double-click jacked into
|
|
92
|
+
* the district — zoomed, still aloft — rather than opening the lens. The
|
|
93
|
+
* pointer did not move; the city did. So the first press listens, for as
|
|
94
|
+
* long as a double-click lasts, for a second press where the first was made
|
|
95
|
+
* — within the platforms' slop, by the same kind of pointer — keeps it from
|
|
96
|
+
* whatever is under it now, and takes it as the second half of its own
|
|
97
|
+
* gesture. A second tap is the same press, so a double-tap opens the lens
|
|
98
|
+
* too. A press anywhere else — another district, the bar, another lens — is
|
|
99
|
+
* not this gesture: it goes through untouched, and the listening ends.
|
|
100
|
+
*/
|
|
101
|
+
function awaitSecondPress(document, first, second) {
|
|
102
|
+
const until = performance.now() + SECOND_PRESS_MS;
|
|
103
|
+
const kept = ["pointerdown", "pointerup", "mousedown", "mouseup", "dblclick"];
|
|
104
|
+
const ours = (event) => {
|
|
105
|
+
if (performance.now() > until || !(event instanceof MouseEvent))
|
|
106
|
+
return false;
|
|
107
|
+
const press = pressOf(event);
|
|
108
|
+
if (first.pointerType && press.pointerType && first.pointerType !== press.pointerType)
|
|
109
|
+
return false;
|
|
110
|
+
return Math.hypot(press.x - first.x, press.y - first.y) <= SECOND_PRESS_SLOP;
|
|
111
|
+
};
|
|
112
|
+
const keep = (event) => {
|
|
113
|
+
if (!ours(event))
|
|
114
|
+
return done();
|
|
115
|
+
event.stopPropagation();
|
|
116
|
+
};
|
|
117
|
+
const take = (event) => {
|
|
118
|
+
if (!ours(event))
|
|
119
|
+
return done();
|
|
120
|
+
event.stopPropagation();
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
// The dblclick that follows this click belongs to the same gesture; keep it a moment longer.
|
|
123
|
+
document.removeEventListener("click", take, true);
|
|
124
|
+
setTimeout(done, 50);
|
|
125
|
+
second();
|
|
126
|
+
};
|
|
127
|
+
let finished = false;
|
|
128
|
+
const done = () => {
|
|
129
|
+
if (finished)
|
|
130
|
+
return;
|
|
131
|
+
finished = true;
|
|
132
|
+
clearTimeout(timer);
|
|
133
|
+
document.removeEventListener("click", take, true);
|
|
134
|
+
for (const type of kept)
|
|
135
|
+
document.removeEventListener(type, keep, true);
|
|
136
|
+
};
|
|
137
|
+
for (const type of kept)
|
|
138
|
+
document.addEventListener(type, keep, true);
|
|
139
|
+
document.addEventListener("click", take, true);
|
|
140
|
+
const timer = setTimeout(done, SECOND_PRESS_MS);
|
|
141
|
+
}
|
|
76
142
|
/**
|
|
77
143
|
* Members drawn as their kind's own row (FR-37): one line each, a target
|
|
78
144
|
* for its record, at most `ROWS_SHOWN` and then "+n more".
|
|
@@ -82,6 +148,75 @@ function MemberRows({ View, members, mode, flagged, }) {
|
|
|
82
148
|
const shown = members.slice(0, ROWS_SHOWN);
|
|
83
149
|
return (_jsxs("div", { "data-graview-rows": "", style: { display: "grid", gap: 4, minWidth: 0 }, children: [shown.map((member) => (_jsx("div", { "data-graview-pick": member.id, style: { minWidth: 0, cursor: "pointer" }, children: _jsx(View, { node: member, cardinality: "one", fidelity: "glyph", mode: mode, selected: isSelected(member.id), ...(flagged?.includes(member.id) ? { flagged: [member.id] } : {}) }) }, member.id))), members.length > shown.length ? _jsx(Chip, { label: `+${members.length - shown.length} more` }) : null] }));
|
|
84
150
|
}
|
|
151
|
+
/** The smallest a district's name is drawn at, as a share of its own size: eleven pixels of fifteen. */
|
|
152
|
+
const NAME_FLOOR = 11 / 15;
|
|
153
|
+
/**
|
|
154
|
+
* A DISTRICT'S BOX HOLDS ITS NAME (FR-143).
|
|
155
|
+
*
|
|
156
|
+
* A district's name is read, not glanced at, so it is drawn at fifteen
|
|
157
|
+
* pixels — and a name longer than its box wrapped to a second line the
|
|
158
|
+
* box had no room for: "WORKSHOP PARTS" stood half out of the top of its
|
|
159
|
+
* box, its count pushed out of the bottom. The name keeps one line. Where
|
|
160
|
+
* it is wider than the box it is drawn smaller, as much as it needs and no
|
|
161
|
+
* smaller than eleven pixels; past that it is cut, and said whole on
|
|
162
|
+
* hover. Measured from the name's own width, which a transform does not
|
|
163
|
+
* change, and again whenever the box is resized.
|
|
164
|
+
*/
|
|
165
|
+
function DistrictName({ text, accent }) {
|
|
166
|
+
const box = useRef(null);
|
|
167
|
+
const words = useRef(null);
|
|
168
|
+
const [scale, setScale] = useState(1);
|
|
169
|
+
const [cut, setCut] = useState(false);
|
|
170
|
+
/* A share of the name's own size, so a reader's larger text is still larger. */
|
|
171
|
+
const smaller = scale < 1 ? `${scale}em` : undefined;
|
|
172
|
+
useLayoutEffect(() => {
|
|
173
|
+
const outer = box.current;
|
|
174
|
+
const inner = words.current;
|
|
175
|
+
if (!outer || !inner)
|
|
176
|
+
return;
|
|
177
|
+
const fit = () => {
|
|
178
|
+
const room = outer.clientWidth;
|
|
179
|
+
const drawn = inner.offsetWidth;
|
|
180
|
+
if (room <= 0 || drawn <= 0)
|
|
181
|
+
return;
|
|
182
|
+
const current = parseFloat(getComputedStyle(inner).fontSize) / parseFloat(getComputedStyle(outer).fontSize) || 1;
|
|
183
|
+
// The name's width at its own size, from its width at the size it is drawn at.
|
|
184
|
+
const whole = drawn / current;
|
|
185
|
+
const next = Math.max(NAME_FLOOR, Math.min(1, Math.floor((room / whole) * 100) / 100));
|
|
186
|
+
setScale((was) => (Math.abs(was - next) < 0.01 ? was : next));
|
|
187
|
+
setCut(whole * next > room + 0.5);
|
|
188
|
+
};
|
|
189
|
+
fit();
|
|
190
|
+
if (typeof ResizeObserver === "undefined")
|
|
191
|
+
return;
|
|
192
|
+
const watch = new ResizeObserver(fit);
|
|
193
|
+
watch.observe(outer);
|
|
194
|
+
return () => watch.disconnect();
|
|
195
|
+
}, [text]);
|
|
196
|
+
return (_jsx("span", { ref: box, "data-graview-district-name": "", ...(scale < 1 ? { "data-graview-fitted": "" } : {}), ...(cut ? { title: text } : {}), style: {
|
|
197
|
+
display: "block",
|
|
198
|
+
minWidth: 0,
|
|
199
|
+
/*
|
|
200
|
+
* A DISTRICT'S NAME IS READ, not glanced at. Thirteen pixels
|
|
201
|
+
* before the kinds plane's own recession put it on the screen at
|
|
202
|
+
* ten, and the kind above it at under eight — small enough that
|
|
203
|
+
* the bottom of the picture was a row of gray marks rather than
|
|
204
|
+
* a map of the domain.
|
|
205
|
+
*/
|
|
206
|
+
fontSize: "0.9375rem",
|
|
207
|
+
lineHeight: 1.25,
|
|
208
|
+
letterSpacing: "0.05em",
|
|
209
|
+
textTransform: "uppercase",
|
|
210
|
+
color: accent ? "var(--graview-accent)" : "var(--graview-ink-muted)",
|
|
211
|
+
whiteSpace: "nowrap",
|
|
212
|
+
overflow: "hidden",
|
|
213
|
+
textOverflow: "ellipsis",
|
|
214
|
+
}, children: _jsx("span", { ref: words, style: { fontSize: smaller }, children: text }) }));
|
|
215
|
+
}
|
|
216
|
+
/** Whether a record is read down the page: a value in it is prose, or its page groups its facts (FR-147, FR-148). */
|
|
217
|
+
function readsDown(definition, node) {
|
|
218
|
+
return Boolean(definition?.display?.page?.groups?.length) || readableFields(node, definition).some((field) => field.long);
|
|
219
|
+
}
|
|
85
220
|
export function registerDefaultViews(schema, registry = createViews(schema)) {
|
|
86
221
|
for (const kind of schema.kinds) {
|
|
87
222
|
const definition = schema.tryDefinition(kind);
|
|
@@ -100,8 +235,11 @@ export function registerDefaultViews(schema, registry = createViews(schema)) {
|
|
|
100
235
|
* along: emphasis painted and not said.
|
|
101
236
|
*/
|
|
102
237
|
const violations = useViolations();
|
|
238
|
+
// The kind's declared page, when it heads this record (FR-141): drawn inside this frame, not beside it.
|
|
239
|
+
const headed = useContext(RecordHeadContext);
|
|
103
240
|
if (!node)
|
|
104
241
|
return null;
|
|
242
|
+
const head = headed?.nodeId === node.id ? headed : null;
|
|
105
243
|
/*
|
|
106
244
|
* On a page, the heading is the WHOLE thing.
|
|
107
245
|
*
|
|
@@ -121,38 +259,39 @@ export function registerDefaultViews(schema, registry = createViews(schema)) {
|
|
|
121
259
|
return (_jsxs(Panel
|
|
122
260
|
// The name is the rename control. Nothing else on the page repeats
|
|
123
261
|
// it, so the thing you click to change it is the thing itself.
|
|
262
|
+
// A declared page's own title heads the frame: the heading its author wrote, still the rename control where it is the name.
|
|
124
263
|
, {
|
|
125
264
|
// The name is the rename control. Nothing else on the page repeats
|
|
126
265
|
// it, so the thing you click to change it is the thing itself.
|
|
127
|
-
title
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
// the heading back under the heading — so only take it when the
|
|
140
|
-
// declaration actually supplied one.
|
|
141
|
-
definition?.describe
|
|
142
|
-
? describeNode(definition, node)
|
|
143
|
-
: (definition?.description ?? String(kind)), selected: props.selected, ...(props.flagged?.includes(node.id) ? { tone: "warning" } : {}),
|
|
266
|
+
// A declared page's own title heads the frame: the heading its author wrote, still the rename control where it is the name.
|
|
267
|
+
title: _jsx(EditableTitle, { nodeId: node.id, children: head?.title ?? heading }), ...(head
|
|
268
|
+
? {}
|
|
269
|
+
: {
|
|
270
|
+
subtitle:
|
|
271
|
+
// `describeNode` falls back to "<kind> <label>", which would put
|
|
272
|
+
// the heading back under the heading — so only take it when the
|
|
273
|
+
// declaration actually supplied one.
|
|
274
|
+
definition?.describe
|
|
275
|
+
? describeNode(definition, node)
|
|
276
|
+
: (definition?.description ?? String(kind)),
|
|
277
|
+
}), selected: props.selected, ...(props.flagged?.includes(node.id) ? { tone: "warning" } : {}),
|
|
144
278
|
// A card in the scene; a document on a page. Same component, and the
|
|
145
279
|
// only difference is which of those two things it is sitting on.
|
|
146
|
-
fit: true, children: [_jsxs("div", { style: {
|
|
280
|
+
fit: true, children: [head ? _jsx(RecordHeadContext.Provider, { value: null, children: head.body }) : null, _jsxs("div", { style: {
|
|
147
281
|
display: "grid",
|
|
148
|
-
|
|
282
|
+
/*
|
|
283
|
+
* A record with prose in it is read down the page (FR-147): its
|
|
284
|
+
* facts the panel's width, its relationships under them. A
|
|
285
|
+
* draft in the left column was a third of the panel wide.
|
|
286
|
+
*/
|
|
287
|
+
gridTemplateColumns: readsDown(definition, node) ? "minmax(0, 1fr)" : "minmax(200px, 1fr) minmax(220px, 1.4fr)",
|
|
149
288
|
gap: "22px 34px",
|
|
150
289
|
alignItems: "start",
|
|
151
290
|
}, children: [_jsx(Fields, { id: node.id,
|
|
152
291
|
// What the panel already said: its title and its subtitle. A
|
|
153
292
|
// record repeating its own heading is what made this read as a
|
|
154
293
|
// debug dump rather than as a page about something.
|
|
155
|
-
shown: [heading, short, definition?.description] }), _jsx(Connections, { id: node.id, empty: `Nothing is connected to this ${nounOf(definition, String(kind))} yet
|
|
294
|
+
shown: [heading, short, definition?.description, head?.title], ...(head ? { hide: [...head.fields] } : {}) }), _jsx(Connections, { id: node.id, empty: `Nothing is connected to this ${nounOf(definition, String(kind))} yet.`, ...(head ? { hide: head.records } : {}) })] }), touching.length > 0 ? (_jsx("p", { "data-graview-broken": "", style: {
|
|
156
295
|
margin: "14px 0 0",
|
|
157
296
|
paddingTop: 12,
|
|
158
297
|
borderTop: "1px solid var(--graview-edge)",
|
|
@@ -312,6 +451,13 @@ export function registerDefaultViews(schema, registry = createViews(schema)) {
|
|
|
312
451
|
const tied = accent
|
|
313
452
|
? 0
|
|
314
453
|
: members.filter((member) => reached.includes(member.id) && !chosen.has(member.id)).length;
|
|
454
|
+
/*
|
|
455
|
+
* THE COUNT SAID ONCE (FR-143). A district every member of which the
|
|
456
|
+
* selection reaches read "4 4 tied": the count, then the count again.
|
|
457
|
+
* With nothing broken in it, the tie IS the count — "4 tied", or
|
|
458
|
+
* "2 of 4 tied" — in one place.
|
|
459
|
+
*/
|
|
460
|
+
const saysTied = tied > 0 && !trouble;
|
|
315
461
|
/*
|
|
316
462
|
* WHAT THE WORDS FOUND HERE. With a search open, a district with hits
|
|
317
463
|
* is lit and says how many; one with none recedes. Pressing the count
|
|
@@ -331,15 +477,8 @@ export function registerDefaultViews(schema, registry = createViews(schema)) {
|
|
|
331
477
|
* The district's NAME, lifted out of the markup because a figure stands
|
|
332
478
|
* beside it and a name written twice is a name that drifts.
|
|
333
479
|
*/
|
|
334
|
-
const name = (_jsx("span", { style: {
|
|
335
|
-
|
|
336
|
-
* A DISTRICT'S NAME IS READ, not glanced at. Thirteen pixels
|
|
337
|
-
* before the kinds plane's own recession put it on the screen at
|
|
338
|
-
* ten, and the kind above it at under eight — small enough that
|
|
339
|
-
* the bottom of the picture was a row of gray marks rather than
|
|
340
|
-
* a map of the domain.
|
|
341
|
-
*/
|
|
342
|
-
fontSize: nested ? "0.75rem" : "0.9375rem",
|
|
480
|
+
const name = nested ? (_jsx("span", { style: {
|
|
481
|
+
fontSize: "0.75rem",
|
|
343
482
|
lineHeight: 1.25,
|
|
344
483
|
letterSpacing: "0.05em",
|
|
345
484
|
textTransform: "uppercase",
|
|
@@ -351,10 +490,10 @@ export function registerDefaultViews(schema, registry = createViews(schema)) {
|
|
|
351
490
|
* the alternative, growing the tuck until it fits, makes it the
|
|
352
491
|
* same size as the thing it is meant to be behind.
|
|
353
492
|
*/
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}, children: props.label ?? plural }));
|
|
493
|
+
whiteSpace: "nowrap",
|
|
494
|
+
overflow: "hidden",
|
|
495
|
+
textOverflow: "ellipsis",
|
|
496
|
+
}, children: props.label ?? plural })) : (_jsx(DistrictName, { text: props.label ?? plural, accent: Boolean(accent) }));
|
|
358
497
|
return (_jsxs("div", { className: "graview-kind-card", "data-graview-rank": props.rank, "data-graview-landmark": figure || undefined, "data-graview-nested": nested || undefined, "data-graview-tied": tied || undefined, "data-graview-hits": found && !nested ? hits : undefined, "data-graview-emphasis": found && !nested ? (hits > 0 ? "lit" : "dimmed") : undefined, ...(definition?.description || nested
|
|
359
498
|
? {
|
|
360
499
|
title: nested
|
|
@@ -438,15 +577,15 @@ export function registerDefaultViews(schema, registry = createViews(schema)) {
|
|
|
438
577
|
*/
|
|
439
578
|
size: nested ? 14 : 18 }), name] })) : (name), _jsxs("div", { style: { display: "flex", alignItems: "center", gap: 5, fontSize: "0.875rem" }, children: [_jsx("span", { style: {
|
|
440
579
|
fontVariantNumeric: "tabular-nums",
|
|
441
|
-
color: trouble ? "var(--graview-warn)" : "var(--graview-ink-faint)",
|
|
442
|
-
}, children: members.length === 0 ? "none yet" : `${trouble ? `${flag} ` : ""}${members.length}` }), (props.retired ?? 0) > 0 ? (_jsxs("button", { type: "button", className: "graview-kind-past", "data-graview-retired": props.retired, title: `${props.retired} retired ${plural.toLowerCase()} — press to widen the view to the past`, onClick: (event) => {
|
|
580
|
+
color: trouble ? "var(--graview-warn)" : saysTied ? "var(--graview-accent)" : "var(--graview-ink-faint)",
|
|
581
|
+
}, children: members.length === 0 ? "none yet" : saysTied ? (tied === members.length ? `${tied} tied` : `${tied} of ${members.length} tied`) : `${trouble ? `${flag} ` : ""}${members.length}` }), (props.retired ?? 0) > 0 ? (_jsxs("button", { type: "button", className: "graview-kind-past", "data-graview-retired": props.retired, title: `${props.retired} retired ${plural.toLowerCase()} — press to widen the view to the past`, onClick: (event) => {
|
|
443
582
|
event.stopPropagation();
|
|
444
583
|
go(withPast(view, true));
|
|
445
584
|
}, onDoubleClick: (event) => event.stopPropagation(), onPointerDown: (event) => event.stopPropagation(), children: ["+", props.retired, " past"] })) : null, hits > 0 ? (_jsxs("button", { type: "button", className: "graview-kind-hits", "data-testid": `hits-${String(kind)}`, title: `${hits} ${hits === 1 ? "match" : "matches"} for “${view.q ?? ""}” — press to go in, narrowed`, onClick: (event) => {
|
|
446
585
|
event.stopPropagation();
|
|
447
586
|
// The same descent a double-click on the lit district makes: one transition, not three.
|
|
448
587
|
go(withJackIn(view, kindCardId(String(kind)), { ownPicture: true, ...(view.q ? { carry: view.q } : {}) }));
|
|
449
|
-
}, onDoubleClick: (event) => event.stopPropagation(), onPointerDown: (event) => event.stopPropagation(), children: [hits, " match"] })) : null, tied > 0 ? (_jsxs("span", { style: { fontSize: "0.8125rem", color: "var(--graview-accent)" }, children: [tied, " tied"] })) : null, props.hasOwnView ? (_jsx("span", { title: `${plural} has a view of its own`, "aria-label": "has its own view", style: { fontSize: "0.6875rem", color: "var(--graview-accent)" }, children: "\u25C6" })) : null, !nested && members.length > 0 && !props.focused ? (_jsxs("button", { type: "button", className: "graview-kind-open", "data-testid": `open-${String(kind)}`, "aria-expanded": props.opened ?? false, title: props.opened ? "Close it up" : `See the ${plural} in here`, onClick: (event) => {
|
|
588
|
+
}, onDoubleClick: (event) => event.stopPropagation(), onPointerDown: (event) => event.stopPropagation(), children: [hits, " match"] })) : null, tied > 0 && !saysTied ? (_jsxs("span", { style: { fontSize: "0.8125rem", color: "var(--graview-accent)" }, children: [tied, " tied"] })) : null, props.hasOwnView ? (_jsx("span", { title: `${plural} has a view of its own`, "aria-label": "has its own view", style: { fontSize: "0.6875rem", color: "var(--graview-accent)" }, children: "\u25C6" })) : null, !nested && members.length > 0 && !props.focused ? (_jsxs("button", { type: "button", className: "graview-kind-open", "data-testid": `open-${String(kind)}`, "aria-expanded": props.opened ?? false, title: props.opened ? "Close it up" : `See the ${plural} in here`, onClick: (event) => {
|
|
450
589
|
event.stopPropagation();
|
|
451
590
|
toggle(kindCardId(String(kind)));
|
|
452
591
|
}, onDoubleClick: (event) => event.stopPropagation(), onPointerDown: (event) => event.stopPropagation(), children: [_jsx("span", { className: "graview-kind-open-word", children: props.opened ? "close" : "open" }), " ", props.opened ? "▴" : "▾"] })) : null] }), props.opened ? (
|
|
@@ -485,11 +624,25 @@ export function registerDefaultViews(schema, registry = createViews(schema)) {
|
|
|
485
624
|
return (_jsx(Chip, { pickId: member.id, label: broken ? `${name} ${flag}` : name, title: broken ? `${name} — implicated in a problem` : undefined, hue: hue, selected: chosen.has(member.id) }, member.id));
|
|
486
625
|
}), members.length > roster.shown ? (_jsxs("span", { style: { fontSize: "0.75rem", color: "var(--graview-ink-faint)", padding: "2px 4px", gridColumn: "1 / -1" }, children: ["+", members.length - roster.shown, " more \u2014 double-click to go in"] })) : null] })) : null] }), !nested && showings.length > 0 ? (_jsx("div", { className: "graview-drive-in", "data-testid": `drive-in-${String(kind)}`, "data-graview-showing": showingNow, onPointerDown: (event) => event.stopPropagation(), onDoubleClick: (event) => event.stopPropagation(), children: _jsx("div", { className: "graview-drive-in-marquee", role: "group", "aria-label": `${plural}: pictures`, "data-graview-thumbs": showings.length === 1 ? "one" : "two", children: showings.map((place) => {
|
|
487
626
|
const showing = showingNow === place.as;
|
|
488
|
-
return (_jsxs("div", { className: "graview-drive-in-thumb", "data-graview-pressed": showing || undefined, children: [_jsx("span", { className: "graview-drive-in-thumb-title", "aria-hidden": "true", children: place.title }), _jsx("button", { type: "button", className: "graview-drive-in-thumb-press", "data-testid": `showing-${place.as}`, "aria-label": `${plural}: ${place.title}`, "aria-pressed": showing, title: showing ? `${place.title} is showing` : `Show ${place.title} on the billboard`, onClick: (event) => {
|
|
627
|
+
return (_jsxs("div", { className: "graview-drive-in-thumb", "data-graview-pressed": showing || undefined, children: [_jsx("span", { className: "graview-drive-in-thumb-title", "aria-hidden": "true", children: place.title }), _jsx("button", { type: "button", className: "graview-drive-in-thumb-press", "data-testid": `showing-${place.as}`, "aria-label": `${plural}: ${place.title}`, "aria-pressed": showing, title: showing ? `${place.title} is showing — press again to open it` : `Show ${place.title} on the billboard — double-click to open it`, onClick: (event) => {
|
|
489
628
|
event.stopPropagation();
|
|
490
|
-
|
|
629
|
+
/*
|
|
630
|
+
* A LENS DOUBLE-CLICKED FROM UP OPENS IT. The first
|
|
631
|
+
* press shows it on the billboard and stays aloft;
|
|
632
|
+
* the second — of a double-click or a double-tap,
|
|
633
|
+
* wherever the flight has put it, or Enter again on
|
|
634
|
+
* the showing already pressed — goes down into it,
|
|
635
|
+
* by the same stop the bar's place list makes.
|
|
636
|
+
*/
|
|
637
|
+
const down = () => go(withPicture(view, String(kind), place.as));
|
|
638
|
+
if (event.detail >= 2 || (showing && props.focused)) {
|
|
639
|
+
down();
|
|
491
640
|
return;
|
|
641
|
+
}
|
|
492
642
|
go(withWithin(withFocus(withOverview(view, true), aggregateId(String(kind))), "view", place.as));
|
|
643
|
+
// A pointer's press (`detail` 1); a key's is 0 and has its own second press.
|
|
644
|
+
if (event.detail === 1)
|
|
645
|
+
awaitSecondPress(event.currentTarget.ownerDocument, pressOf(event.nativeEvent), down);
|
|
493
646
|
} })] }, place.as));
|
|
494
647
|
}) }) })) : null] }));
|
|
495
648
|
};
|