@blueshed/joined 0.2.2 → 0.3.1
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/.claude/skills/joined/SKILL.md +9 -1
- package/.claude/skills/joined/reference.md +316 -63
- package/.claude/skills/joined-door/SKILL.md +57 -0
- package/README.md +19 -50
- package/docs/design.md +158 -37
- package/docs/introduction.md +27 -27
- package/docs/light-and-shadow.svg +2 -1
- package/docs/links-and-trust.svg +1 -0
- package/docs/stories-to-code.svg +2 -1
- package/docs/wire-op.svg +1 -0
- package/examples/README.md +20 -0
- package/examples/account/account.json +1 -0
- package/examples/account/derive.ts +41 -0
- package/examples/account/generated/elements.ts +52 -0
- package/examples/account/generated/rows.ts +22 -0
- package/examples/account/generated/rules.ts +32 -0
- package/examples/account/routes.ts +5 -0
- package/examples/app.css +11 -1
- package/examples/cafe/books.html +2 -2
- package/examples/cafe/cafe.css +96 -85
- package/examples/cafe/generated/books.rows.ts +22 -0
- package/examples/cafe/generated/books.rules.ts +3 -2
- package/examples/cafe/generated/kitchen.rows.ts +27 -0
- package/examples/cafe/generated/kitchen.rules.ts +11 -1
- package/examples/cafe/generated/menu.rows.ts +22 -0
- package/examples/cafe/generated/menu.rules.ts +3 -2
- package/examples/cafe/generated/order.rows.ts +27 -0
- package/examples/cafe/generated/order.rules.ts +11 -1
- package/examples/cafe/generated/staff.elements.ts +7 -2
- package/examples/cafe/generated/staff.rows.ts +22 -0
- package/examples/cafe/generated/staff.rules.ts +9 -1
- package/examples/cafe/generated/supplies.queries.ts +4 -2
- package/examples/cafe/generated/supplies.rows.ts +22 -0
- package/examples/cafe/generated/supplies.rules.ts +17 -1
- package/examples/cafe/generated/till.queries.ts +2 -0
- package/examples/cafe/generated/till.rows.ts +27 -0
- package/examples/cafe/generated/till.rules.ts +11 -1
- package/examples/cafe/index.html +14 -15
- package/examples/cafe/kitchen.css +11 -19
- package/examples/cafe/kitchen.ts +7 -3
- package/examples/cafe/look.ts +30 -0
- package/examples/cafe/menu.html +10 -26
- package/examples/cafe/menu.ts +8 -80
- package/examples/cafe/migrations/002-guard-supplies.ts +15 -0
- package/examples/cafe/order.html +8 -7
- package/examples/cafe/order.ts +6 -2
- package/examples/cafe/routes.ts +0 -1
- package/examples/cafe/staff.json +5 -0
- package/examples/cafe/stories.jsonl +6 -2
- package/examples/cafe/supplies.html +35 -34
- package/examples/cafe/supplies.ts +59 -39
- package/examples/cafe/till.ts +19 -11
- package/examples/cafe/views.ts +7 -5
- package/examples/chart/arches.ts +150 -0
- package/examples/chart/chart.css +11 -0
- package/examples/chart/chart.json +87 -0
- package/examples/chart/generated/elements.ts +105 -0
- package/examples/chart/generated/queries.ts +36 -0
- package/examples/chart/generated/rows.ts +27 -0
- package/examples/chart/generated/rules.ts +111 -0
- package/examples/chart/grid.ts +118 -0
- package/examples/chart/index.html +78 -0
- package/examples/chart/migrations/001-chart.ts +6 -0
- package/examples/chart/migrations/002-create-conditions.ts +6 -0
- package/examples/chart/page.ts +20 -0
- package/examples/chart/routes.ts +7 -0
- package/examples/chart/stories.jsonl +14 -0
- package/examples/chart/teeth.ts +57 -0
- package/examples/desk/desk.css +6 -10
- package/examples/desk/generated/elements.ts +1 -1
- package/examples/desk/generated/rows.ts +22 -0
- package/examples/desk/generated/rules.ts +34 -1
- package/examples/desk/index.html +10 -3
- package/examples/desk/lanes.css +21 -19
- package/examples/desk/routes.ts +0 -2
- package/examples/desk/stories.jsonl +4 -3
- package/examples/desk/tally.css +1 -1
- package/examples/desk/thumbs.ts +2 -2
- package/examples/docs.ts +7 -4
- package/examples/hello/generated/elements.ts +2 -2
- package/examples/hello/generated/rules.ts +3 -2
- package/examples/hello/hello.css +2 -4
- package/examples/hello/index.html +10 -3
- package/examples/hello/page.ts +4 -4
- package/examples/index.html +20 -12
- package/examples/notes/generated/elements.ts +112 -0
- package/examples/notes/generated/queries.ts +42 -0
- package/examples/notes/generated/rows.ts +27 -0
- package/examples/notes/generated/rules.ts +133 -0
- package/examples/notes/index.html +32 -0
- package/examples/notes/look.ts +41 -0
- package/examples/notes/migrations/001-notes.ts +7 -0
- package/examples/notes/notes.json +78 -0
- package/examples/notes/page.ts +21 -0
- package/examples/notes/routes.ts +6 -0
- package/examples/notes/stories.jsonl +24 -0
- package/examples/page.ts +9 -2
- package/examples/people/generated/rows.ts +22 -0
- package/examples/people/generated/rules.ts +11 -1
- package/examples/people/links.ts +8 -9
- package/examples/people/people.css +1 -1
- package/examples/people/routes.ts +1 -3
- package/examples/people/stories.jsonl +1 -0
- package/examples/people/view.ts +5 -2
- package/examples/trip/generated/elements.ts +5 -3
- package/examples/trip/generated/queries.ts +12 -1
- package/examples/trip/generated/rows.ts +27 -0
- package/examples/trip/generated/rules.ts +56 -2
- package/examples/trip/index.html +58 -12
- package/examples/trip/line.css +186 -0
- package/examples/trip/line.ts +51 -40
- package/examples/trip/page.ts +65 -71
- package/examples/trip/routes.ts +9 -5
- package/examples/trip/stays.css +13 -13
- package/examples/trip/stays.ts +15 -10
- package/examples/trip/stories.jsonl +2 -0
- package/examples/trip/told.ts +3 -26
- package/examples/trip/trip.css +16 -0
- package/examples/trips/generated/elements.ts +1 -1
- package/examples/trips/generated/rows.ts +22 -0
- package/examples/trips/generated/rules.ts +9 -1
- package/examples/trips/index.html +10 -10
- package/examples/trips/map.ts +3 -14
- package/examples/trips/new-trip.ts +14 -16
- package/examples/trips/trips.css +24 -23
- package/examples/weeks/generated/elements.ts +1 -1
- package/examples/weeks/generated/queries.ts +11 -0
- package/examples/weeks/generated/rows.ts +22 -0
- package/examples/weeks/generated/rules.ts +11 -5
- package/examples/weeks/routes.ts +3 -2
- package/examples/weeks/stories.jsonl +1 -0
- package/examples/welcome.css +43 -33
- package/package.json +8 -2
- package/src/attachment.ts +17 -2
- package/src/awesome.ts +103 -0
- package/src/board.css +76 -0
- package/src/board.ts +173 -0
- package/src/cli.ts +28 -3
- package/src/compile.ts +821 -109
- package/src/definitions.ts +113 -27
- package/src/demo.css +2 -5
- package/src/draft.ts +48 -27
- package/src/drawer.ts +248 -0
- package/src/engine.ts +253 -170
- package/src/fields.ts +341 -0
- package/src/file-value.ts +12 -2
- package/src/files.ts +113 -33
- package/src/ground.ts +110 -0
- package/src/icon-names.ts +19 -2
- package/src/keep.ts +16 -3
- package/src/kit.ts +51 -0
- package/src/link.ts +3 -3
- package/src/map.css +140 -0
- package/src/map.ts +200 -0
- package/src/mcp.ts +129 -24
- package/src/members/demo.ts +13 -12
- package/src/members/generated/rows.ts +22 -0
- package/src/members/generated/rules.ts +3 -2
- package/src/members/group.ts +105 -55
- package/src/members/keys.ts +95 -79
- package/src/members/panel.css +40 -35
- package/src/members/panel.ts +58 -37
- package/src/migrate.ts +178 -125
- package/src/migrations/005-change-kept.ts +7 -0
- package/src/month.css +129 -0
- package/src/month.ts +179 -0
- package/src/ops.ts +40 -1
- package/src/page.css +11 -2
- package/src/page.ts +68 -17
- package/src/parts.css +614 -230
- package/src/parts.ts +259 -36
- package/src/plane.css +61 -0
- package/src/plane.ts +153 -0
- package/src/postgres-server.ts +60 -0
- package/src/reading.css +73 -0
- package/src/reading.ts +238 -0
- package/src/rows.css +289 -0
- package/src/rows.ts +864 -0
- package/src/search.css +80 -0
- package/src/search.ts +130 -0
- package/src/server.ts +355 -137
- package/src/settings.ts +9 -4
- package/src/sheet.ts +116 -0
- package/src/skill.ts +40 -0
- package/src/slots.css +90 -0
- package/src/slots.ts +213 -0
- package/src/specs.ts +38 -0
- package/src/starter.ts +19 -2
- package/src/store.ts +224 -161
- package/src/stories.ts +43 -11
- package/src/surface.ts +164 -0
- package/src/time.ts +2 -0
- package/src/timeline.css +111 -0
- package/src/timeline.ts +235 -0
- package/src/toast.ts +21 -48
- package/src/together.ts +15 -24
- package/src/tokens.css +89 -3
- package/src/tokens.json +287 -7
- package/src/tool.ts +210 -0
- package/src/upkeep.ts +47 -22
- package/src/views.css +43 -0
- package/src/views.ts +111 -0
- package/src/week.css +150 -0
- package/src/week.ts +254 -0
- package/src/write.ts +326 -78
- package/starter/CHANGELOG.md +8 -0
- package/starter/CLAUDE.md +9 -3
- package/starter/bunfig +5 -0
- package/starter/githooks/pre-commit +13 -0
- package/starter/prettierignore +5 -0
- package/starter/tests/hello.test.ts +2 -0
- package/starter/tests/records.test.ts +40 -0
- package/starter/todo.jsonl +0 -0
- package/docs/learning.md +0 -76
- package/examples/cafe/trust.ts +0 -20
- package/examples/desk/trust.ts +0 -24
- package/examples/people/trust.ts +0 -14
- package/examples/trip/answer-rows.ts +0 -70
- package/examples/trip/bar.ts +0 -89
- package/examples/trip/calendar-map.css +0 -711
- package/examples/trip/calendar-map.ts +0 -249
- package/examples/trip/drags.ts +0 -143
- package/examples/trip/drawer.ts +0 -250
- package/examples/trip/event-form.ts +0 -200
- package/examples/trip/holding.ts +0 -61
- package/examples/trip/map.ts +0 -234
- package/examples/trip/month.ts +0 -87
- package/examples/trip/other-weeks.ts +0 -67
- package/examples/trip/peek.ts +0 -71
- package/examples/trip/people-chips.ts +0 -74
- package/examples/trip/shell.ts +0 -39
- package/examples/trip/trust.ts +0 -51
- package/examples/trip/week.ts +0 -237
- package/examples/trip/writes.ts +0 -91
- package/examples/trip/zones.ts +0 -16
- package/examples/weeks/derive.ts +0 -23
- package/src/scrim.ts +0 -81
package/src/ground.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// A map's ground (joined/ground), the one every map draws on: OpenStreetMap's tiles for where it looks, and a person
|
|
2
|
+
// moving it. Dragged, it pans; two fingers pinch it nearer or farther; so do a trackpad's (the wheel with ctrl: the
|
|
3
|
+
// wheel alone scrolls the page) and its buttons. A press that didn't move is a tap there. The kit's <j-map>, a small
|
|
4
|
+
// map of a place (joined/parts' place()) and an app's own map (the trip's) each draw by it.
|
|
5
|
+
|
|
6
|
+
import { follow } from "./follow.ts";
|
|
7
|
+
import { TILE, tileAt } from "./geo.ts";
|
|
8
|
+
|
|
9
|
+
/** Where a map looks: its zoom, and the world's pixel at its top left. */
|
|
10
|
+
export type View = { z: number; x: number; y: number };
|
|
11
|
+
|
|
12
|
+
/** OpenStreetMap's tiles covering a view: zoom z, its top left the world's pixel x, y, w by h. Each an <img> placed in
|
|
13
|
+
* it; one that can't be had is hidden, so the map's ground shows, never a broken picture. */
|
|
14
|
+
export function tiles(z: number, x: number, y: number, w: number, h: number) {
|
|
15
|
+
const out: HTMLImageElement[] = [];
|
|
16
|
+
for (let tx = Math.floor(x / TILE); tx * TILE < x + w; tx++)
|
|
17
|
+
for (let ty = Math.max(0, Math.floor(y / TILE)); ty * TILE < y + h && ty < 2 ** z; ty++) {
|
|
18
|
+
const img = Object.assign(document.createElement("img"), { alt: "", draggable: false, src: tileAt(z, tx, ty) });
|
|
19
|
+
img.width = img.height = TILE;
|
|
20
|
+
img.onerror = () => (img.hidden = true);
|
|
21
|
+
img.style.left = `${Math.round(tx * TILE - x)}px`;
|
|
22
|
+
img.style.top = `${Math.round(ty * TILE - y)}px`;
|
|
23
|
+
out.push(img);
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** A view a step nearer (1) or farther (-1), about a point on the map, from 2 (the world) to 18 (a street). */
|
|
29
|
+
export function zoomed(v: View, by: 1 | -1, at: { x: number; y: number }): View {
|
|
30
|
+
const z = Math.max(2, Math.min(18, v.z + by)),
|
|
31
|
+
k = 2 ** (z - v.z);
|
|
32
|
+
return { z, x: (v.x + at.x) * k - at.x, y: (v.y + at.y) * k - at.y };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** A map moved by a person: `view` where it looks, `look` it looking somewhere else; a press on what `not` names (a
|
|
36
|
+
* pin, a button) is that thing's own; one on the ground that didn't move is `tap`ped. Returns its zoom by a step (about
|
|
37
|
+
* the map's middle, for its buttons), and its press, for a finger that swipes from a pin to pan. */
|
|
38
|
+
export function moves(
|
|
39
|
+
map: HTMLElement,
|
|
40
|
+
view: () => View,
|
|
41
|
+
look: (v: View) => void,
|
|
42
|
+
{ not = ".pin, .peek, a, button", tap }: { not?: string; tap?: (down: PointerEvent) => void } = {},
|
|
43
|
+
) {
|
|
44
|
+
const offset = (e: { clientX: number; clientY: number }) => {
|
|
45
|
+
const r = map.getBoundingClientRect();
|
|
46
|
+
return { x: e.clientX - r.left, y: e.clientY - r.top };
|
|
47
|
+
};
|
|
48
|
+
const zoom = (by: 1 | -1, at = { x: map.clientWidth / 2, y: map.clientHeight / 2 }) => {
|
|
49
|
+
const v = view(),
|
|
50
|
+
to = zoomed(v, by, at);
|
|
51
|
+
if (to.z !== v.z) look(to);
|
|
52
|
+
};
|
|
53
|
+
const fingers = new Map<number, { clientX: number; clientY: number }>();
|
|
54
|
+
let apart = 0;
|
|
55
|
+
const press = (down: PointerEvent, tapped = true) => {
|
|
56
|
+
fingers.set(down.pointerId, down);
|
|
57
|
+
const [first, second] = [...fingers.values()];
|
|
58
|
+
// a second finger: how far apart they came down, for the pinch the first finger's press follows
|
|
59
|
+
if (second) return void (apart = Math.hypot(first!.clientX - second.clientX, first!.clientY - second.clientY));
|
|
60
|
+
const was = { ...view() };
|
|
61
|
+
let moved = false;
|
|
62
|
+
follow(
|
|
63
|
+
down,
|
|
64
|
+
(e) => {
|
|
65
|
+
if (!fingers.has(e.pointerId)) return;
|
|
66
|
+
fingers.set(e.pointerId, e);
|
|
67
|
+
const [a, b] = [...fingers.values()];
|
|
68
|
+
if (b) {
|
|
69
|
+
// a pinch: a step nearer or farther each time the fingers part or close by half again
|
|
70
|
+
moved = true;
|
|
71
|
+
const d = Math.hypot(a!.clientX - b.clientX, a!.clientY - b.clientY);
|
|
72
|
+
if (d > apart * 1.5 || d < apart / 1.5) {
|
|
73
|
+
zoom(
|
|
74
|
+
d > apart ? 1 : -1,
|
|
75
|
+
offset({ clientX: (a!.clientX + b.clientX) / 2, clientY: (a!.clientY + b.clientY) / 2 }),
|
|
76
|
+
);
|
|
77
|
+
apart = d;
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const dx = e.clientX - down.clientX,
|
|
82
|
+
dy = e.clientY - down.clientY;
|
|
83
|
+
if (!moved && Math.hypot(dx, dy) < 4) return;
|
|
84
|
+
moved = true;
|
|
85
|
+
look({ ...was, x: was.x - dx, y: was.y - dy });
|
|
86
|
+
},
|
|
87
|
+
(e) => {
|
|
88
|
+
fingers.clear();
|
|
89
|
+
if (e && !moved && tapped) tap?.(down);
|
|
90
|
+
},
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
map.addEventListener("pointerdown", (down) => {
|
|
94
|
+
if (down.button === 0 && !(down.target as Element).closest(not)) press(down);
|
|
95
|
+
});
|
|
96
|
+
let wheel = 0;
|
|
97
|
+
map.addEventListener(
|
|
98
|
+
"wheel",
|
|
99
|
+
(e) => {
|
|
100
|
+
if (!e.ctrlKey) return;
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
wheel += e.deltaY;
|
|
103
|
+
if (Math.abs(wheel) < 40) return;
|
|
104
|
+
zoom(wheel < 0 ? 1 : -1, offset(e));
|
|
105
|
+
wheel = 0;
|
|
106
|
+
},
|
|
107
|
+
{ passive: false },
|
|
108
|
+
);
|
|
109
|
+
return { zoom, press };
|
|
110
|
+
}
|
package/src/icon-names.ts
CHANGED
|
@@ -6,11 +6,13 @@ import {
|
|
|
6
6
|
Bot,
|
|
7
7
|
CalendarDays,
|
|
8
8
|
CalendarPlus,
|
|
9
|
-
|
|
9
|
+
ChartGantt,
|
|
10
10
|
Check,
|
|
11
11
|
CloudOff,
|
|
12
|
+
ChevronDown,
|
|
12
13
|
ChevronLeft,
|
|
13
14
|
ChevronRight,
|
|
15
|
+
Columns3,
|
|
14
16
|
Contact,
|
|
15
17
|
Copy,
|
|
16
18
|
Download,
|
|
@@ -18,6 +20,7 @@ import {
|
|
|
18
20
|
GripVertical,
|
|
19
21
|
GitCommitVertical,
|
|
20
22
|
KeyRound,
|
|
23
|
+
List,
|
|
21
24
|
Lock,
|
|
22
25
|
LockOpen,
|
|
23
26
|
Pencil,
|
|
@@ -26,8 +29,13 @@ import {
|
|
|
26
29
|
ThumbsUp,
|
|
27
30
|
LogIn,
|
|
28
31
|
LogOut,
|
|
32
|
+
Map as Mapped,
|
|
33
|
+
MapPin,
|
|
29
34
|
Maximize2,
|
|
35
|
+
Minus,
|
|
30
36
|
Plus,
|
|
37
|
+
Search,
|
|
38
|
+
SquareKanban,
|
|
31
39
|
Trash2,
|
|
32
40
|
Upload,
|
|
33
41
|
User,
|
|
@@ -45,9 +53,11 @@ export const ICONS = {
|
|
|
45
53
|
agent: Bot,
|
|
46
54
|
away: CloudOff,
|
|
47
55
|
back: ChevronLeft,
|
|
56
|
+
board: SquareKanban,
|
|
48
57
|
calendar: CalendarDays,
|
|
49
58
|
"calendar-add": CalendarPlus,
|
|
50
59
|
check: Check,
|
|
60
|
+
choose: ChevronDown,
|
|
51
61
|
close: X,
|
|
52
62
|
copy: Copy,
|
|
53
63
|
down: ThumbsDown,
|
|
@@ -56,22 +66,29 @@ export const ICONS = {
|
|
|
56
66
|
grip: GripVertical,
|
|
57
67
|
group: Users,
|
|
58
68
|
grow: Maximize2,
|
|
59
|
-
month:
|
|
69
|
+
month: CalendarDays,
|
|
60
70
|
more: Ellipsis,
|
|
61
71
|
line: GitCommitVertical,
|
|
72
|
+
list: List,
|
|
73
|
+
map: Mapped,
|
|
62
74
|
"new-link": KeyRound,
|
|
63
75
|
on: ChevronRight,
|
|
64
76
|
out: LogOut,
|
|
65
77
|
people: Contact,
|
|
78
|
+
place: MapPin,
|
|
66
79
|
play: Play,
|
|
67
80
|
"person-add": UserPlus,
|
|
68
81
|
"person-remove": UserMinus,
|
|
69
82
|
"read-only": Lock,
|
|
83
|
+
search: Search,
|
|
70
84
|
"give-back": LockOpen,
|
|
85
|
+
less: Minus,
|
|
71
86
|
remove: Trash2,
|
|
72
87
|
stay: BedDouble,
|
|
88
|
+
timeline: ChartGantt,
|
|
73
89
|
"sign-in": LogIn,
|
|
74
90
|
upload: Upload,
|
|
91
|
+
week: Columns3,
|
|
75
92
|
up: ThumbsUp,
|
|
76
93
|
you: User,
|
|
77
94
|
"zoom-in": ZoomIn,
|
package/src/keep.ts
CHANGED
|
@@ -13,9 +13,20 @@ const typing = (el: Element | null) =>
|
|
|
13
13
|
(el instanceof HTMLInputElement &&
|
|
14
14
|
!["button", "submit", "reset", "checkbox", "radio", "range", "color", "file", "image"].includes(el.type));
|
|
15
15
|
|
|
16
|
+
/** What in a row may hold the focus a hand gives it, in its order. */
|
|
17
|
+
const FOCUSABLE = "button, input, select, textarea, a[href], [tabindex], [contenteditable], wa-checkbox, wa-switch";
|
|
18
|
+
/** The focus a row made again keeps: on the row, or on the control at the same place in it (a tick just pressed),
|
|
19
|
+
* once it's drawn (a Web Awesome control takes the focus only then). */
|
|
20
|
+
function refocus(was: HTMLElement, now: HTMLElement, active: Element | null) {
|
|
21
|
+
const at = (
|
|
22
|
+
was === active ? now : now.querySelectorAll(FOCUSABLE)[[...was.querySelectorAll(FOCUSABLE)].indexOf(active!)]
|
|
23
|
+
) as (HTMLElement & { updateComplete?: Promise<unknown> }) | undefined;
|
|
24
|
+
void (at?.updateComplete ?? Promise.resolve()).then(() => at?.focus({ preventScroll: true }));
|
|
25
|
+
}
|
|
26
|
+
|
|
16
27
|
/** A display's list kept by key: a row is made again only when what it shows has changed (and never while
|
|
17
|
-
* something in it is being typed in: a button just pressed doesn't hold it
|
|
18
|
-
* are moved into their order, never made again. */
|
|
28
|
+
* something in it is being typed in: a button just pressed doesn't hold it, and keeps the focus in the row made
|
|
29
|
+
* again), one gone is taken away, and the rest are moved into their order, never made again. */
|
|
19
30
|
export function keep(list: HTMLElement, kept: Map<string, { shows: string; el: HTMLElement }>, rows: Row[]) {
|
|
20
31
|
const wanted = new Set(rows.map((r) => r.key));
|
|
21
32
|
const active = (list.getRootNode() as ShadowRoot | Document).activeElement;
|
|
@@ -24,8 +35,10 @@ export function keep(list: HTMLElement, kept: Map<string, { shows: string; el: H
|
|
|
24
35
|
let k = kept.get(row.key);
|
|
25
36
|
const busy = typing(active) && k?.el.contains(active);
|
|
26
37
|
if (!k || (k.shows !== row.shows && !busy)) {
|
|
27
|
-
const el = row.make()
|
|
38
|
+
const el = row.make(),
|
|
39
|
+
held = !!k && !!active && k.el.contains(active);
|
|
28
40
|
k?.el.replaceWith(el);
|
|
41
|
+
if (held) refocus(k!.el, el, active);
|
|
29
42
|
kept.set(row.key, (k = { shows: row.shows, el }));
|
|
30
43
|
}
|
|
31
44
|
if (list.children[i] !== k.el) list.insertBefore(k.el, list.children[i] ?? null);
|
package/src/kit.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// joined's kit (joined/kit): the parts a page is composed of, each bound to the document by a collection's name and a
|
|
2
|
+
// field's, so nothing is wired by hand. A page imports this, gives it the compiler's collections once, and puts the
|
|
3
|
+
// parts in its markup:
|
|
4
|
+
//
|
|
5
|
+
// import { use } from "joined/kit";
|
|
6
|
+
// import { specs } from "./generated/rows.ts";
|
|
7
|
+
// use(specs);
|
|
8
|
+
//
|
|
9
|
+
// <j-search for="items"></j-search>
|
|
10
|
+
// <j-items-rows><j-items></j-items></j-items-rows> (joined/rows, define())
|
|
11
|
+
// <j-sheet for="items"><j-field name="price" as="money" currency="GBP"></j-field></j-sheet>
|
|
12
|
+
//
|
|
13
|
+
// <j-sheet> is one item's fields, Save one write, a refusal said in the story's words; <j-field> says how one field is
|
|
14
|
+
// asked and read, in its sheet and in its row; <j-search> finds among the items. The readings are the ways in, each
|
|
15
|
+
// opening the same sheet: <j-month> and <j-week> by a time, <j-timeline> along it in lanes, <j-map> by a place,
|
|
16
|
+
// <j-board> in lanes by a field; <j-views> holds several, one shown at a time. The maps are the readings on a picture
|
|
17
|
+
// of the domain's own: <j-plane>, marks where two fields put them, and <j-slots>, each item in its place; each takes
|
|
18
|
+
// <j-tool>s, chosen first and then tapped. The skill's §17 is their catalogue.
|
|
19
|
+
|
|
20
|
+
import { JField, JSheet } from "./sheet.ts";
|
|
21
|
+
import { JSearch } from "./search.ts";
|
|
22
|
+
import { JViews } from "./views.ts";
|
|
23
|
+
import { JMonth } from "./month.ts";
|
|
24
|
+
import { JWeek } from "./week.ts";
|
|
25
|
+
import { JTimeline } from "./timeline.ts";
|
|
26
|
+
import { JMap } from "./map.ts";
|
|
27
|
+
import { JBoard } from "./board.ts";
|
|
28
|
+
import { JPlane } from "./plane.ts";
|
|
29
|
+
import { JSlots } from "./slots.ts";
|
|
30
|
+
import { JTool } from "./tool.ts";
|
|
31
|
+
|
|
32
|
+
export { use } from "./specs.ts";
|
|
33
|
+
/** What every reading shares, for an app's own reading of a collection (the trip's line). */
|
|
34
|
+
export { Reading } from "./reading.ts";
|
|
35
|
+
export { JField, JSheet, JSearch, JViews, JMonth, JWeek, JTimeline, JMap, JBoard, JPlane, JSlots, JTool };
|
|
36
|
+
|
|
37
|
+
for (const [tag, part] of [
|
|
38
|
+
["j-field", JField],
|
|
39
|
+
["j-sheet", JSheet],
|
|
40
|
+
["j-search", JSearch],
|
|
41
|
+
["j-views", JViews],
|
|
42
|
+
["j-month", JMonth],
|
|
43
|
+
["j-week", JWeek],
|
|
44
|
+
["j-timeline", JTimeline],
|
|
45
|
+
["j-map", JMap],
|
|
46
|
+
["j-board", JBoard],
|
|
47
|
+
["j-tool", JTool],
|
|
48
|
+
["j-plane", JPlane],
|
|
49
|
+
["j-slots", JSlots],
|
|
50
|
+
] as const)
|
|
51
|
+
if (!customElements.get(tag)) customElements.define(tag, part);
|
package/src/link.ts
CHANGED
|
@@ -19,12 +19,12 @@ export async function linkFor(
|
|
|
19
19
|
if (!name || !root) throw new Error("bun run link <name>, with ROOT_TOKEN set (in .env)");
|
|
20
20
|
const store = sqlite(db, { readonly: true });
|
|
21
21
|
// a column left empty is a field not given, as the store reads it: the BDFL has no inviter
|
|
22
|
-
const all = (store.query("SELECT id, name, inviter FROM members").all() as Record<string, unknown>[]).map(
|
|
22
|
+
const all = ((await store.query("SELECT id, name, inviter FROM members").all()) as Record<string, unknown>[]).map(
|
|
23
23
|
(r) => Object.fromEntries(Object.entries(r).filter(([, v]) => v !== null)) as Member,
|
|
24
24
|
);
|
|
25
25
|
const m = all.find((x) => x.name.toLowerCase() === name.toLowerCase());
|
|
26
|
-
const token = !m ? undefined : m.id === bdflOf(all)?.id ? root : (await openKeys(store, root)).peek(m.id);
|
|
27
|
-
store.close();
|
|
26
|
+
const token = !m ? undefined : m.id === bdflOf(all)?.id ? root : await (await openKeys(store, root)).peek(m.id);
|
|
27
|
+
await store.close();
|
|
28
28
|
if (!m) throw new Error(`nobody in the group is called ${name}`);
|
|
29
29
|
if (!token) throw new Error(`${m.name} has no link yet: start joined once, and it makes one`);
|
|
30
30
|
return `${m.name}'s link: ${base}/auth/${token}`;
|
package/src/map.css
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/* <j-map> (./map.ts), in its shadow: the map, its tiles, a pin for each item (a dot of its colour in a ring of card,
|
|
2
|
+
larger where it's open or peeked), nearer and farther at its corner, the tiles' credit, and the peek at its foot. */
|
|
3
|
+
:host {
|
|
4
|
+
--map-h: calc(var(--space-64) * 6);
|
|
5
|
+
}
|
|
6
|
+
.map {
|
|
7
|
+
position: relative;
|
|
8
|
+
height: var(--map-h);
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
border-top: 1px solid var(--line);
|
|
11
|
+
background: var(--well);
|
|
12
|
+
touch-action: none;
|
|
13
|
+
user-select: none;
|
|
14
|
+
}
|
|
15
|
+
.tiles img {
|
|
16
|
+
position: absolute;
|
|
17
|
+
width: calc(var(--space-64) * 4);
|
|
18
|
+
height: calc(var(--space-64) * 4);
|
|
19
|
+
-webkit-user-drag: none;
|
|
20
|
+
}
|
|
21
|
+
/* a pin: what's tapped is its box, a finger wide on a phone or under a finger; what's drawn is its dot (::before) */
|
|
22
|
+
.pin {
|
|
23
|
+
--hit: var(--size-pin);
|
|
24
|
+
position: absolute;
|
|
25
|
+
z-index: 1;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
width: var(--hit);
|
|
28
|
+
height: var(--hit);
|
|
29
|
+
margin: calc(var(--hit) / -2) 0 0 calc(var(--hit) / -2);
|
|
30
|
+
padding: 0;
|
|
31
|
+
border: 0;
|
|
32
|
+
border-radius: var(--radius-dot);
|
|
33
|
+
background: none;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
touch-action: none;
|
|
36
|
+
}
|
|
37
|
+
.pin::before {
|
|
38
|
+
content: "";
|
|
39
|
+
position: absolute;
|
|
40
|
+
inset: calc(50% - var(--size-pin) / 2);
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
border: calc(var(--space-4) / 2) solid var(--card);
|
|
43
|
+
border-radius: var(--radius-dot);
|
|
44
|
+
background: var(--hue, var(--accent));
|
|
45
|
+
}
|
|
46
|
+
@media (max-width: 40rem), (pointer: coarse) {
|
|
47
|
+
.pin {
|
|
48
|
+
--hit: var(--size-finger);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
@media (pointer: coarse) {
|
|
52
|
+
.zoom .icon-only {
|
|
53
|
+
width: var(--size-finger);
|
|
54
|
+
height: var(--size-finger);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
.pin:is([open], [peeked]) {
|
|
58
|
+
z-index: 2;
|
|
59
|
+
}
|
|
60
|
+
.pin:is([open], [peeked])::before {
|
|
61
|
+
scale: 1.3;
|
|
62
|
+
outline: calc(var(--space-4) / 2) solid var(--ink);
|
|
63
|
+
}
|
|
64
|
+
.pin[dragged] {
|
|
65
|
+
z-index: 3;
|
|
66
|
+
cursor: grabbing;
|
|
67
|
+
}
|
|
68
|
+
.zoom {
|
|
69
|
+
position: absolute;
|
|
70
|
+
z-index: 3;
|
|
71
|
+
top: var(--space-8);
|
|
72
|
+
left: var(--space-8);
|
|
73
|
+
display: grid;
|
|
74
|
+
border: 1px solid var(--edge);
|
|
75
|
+
border-radius: var(--radius);
|
|
76
|
+
background: var(--card);
|
|
77
|
+
}
|
|
78
|
+
.zoom .icon-only + .icon-only {
|
|
79
|
+
border-top: 1px solid var(--line);
|
|
80
|
+
}
|
|
81
|
+
small {
|
|
82
|
+
position: absolute;
|
|
83
|
+
z-index: 3;
|
|
84
|
+
right: 0;
|
|
85
|
+
bottom: 0;
|
|
86
|
+
padding: 0 var(--space-4);
|
|
87
|
+
background: color-mix(in srgb, var(--card) 80%, transparent);
|
|
88
|
+
color: var(--muted);
|
|
89
|
+
font: var(--font-tiny);
|
|
90
|
+
}
|
|
91
|
+
small a {
|
|
92
|
+
color: inherit;
|
|
93
|
+
}
|
|
94
|
+
/* the peek: what was tapped, at the map's foot, to open in full; above the tiles' credit, which it never covers */
|
|
95
|
+
.peek {
|
|
96
|
+
position: absolute;
|
|
97
|
+
z-index: 4;
|
|
98
|
+
inset: auto var(--space-8) var(--space-24);
|
|
99
|
+
display: grid;
|
|
100
|
+
gap: var(--space-4);
|
|
101
|
+
max-width: var(--size-sheet);
|
|
102
|
+
margin-inline: auto;
|
|
103
|
+
padding: var(--space-8) var(--space-8) var(--space-8) var(--space-16);
|
|
104
|
+
border: 1px solid var(--edge);
|
|
105
|
+
border-inline-start: var(--size-stripe) solid var(--hue, var(--accent));
|
|
106
|
+
border-radius: var(--radius);
|
|
107
|
+
background: var(--card);
|
|
108
|
+
color: var(--ink);
|
|
109
|
+
}
|
|
110
|
+
.peek header {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
gap: var(--space-8);
|
|
114
|
+
font: var(--font-row);
|
|
115
|
+
}
|
|
116
|
+
.peek b {
|
|
117
|
+
flex: 1;
|
|
118
|
+
font-weight: 600;
|
|
119
|
+
}
|
|
120
|
+
.peek p {
|
|
121
|
+
margin: 0;
|
|
122
|
+
color: var(--muted);
|
|
123
|
+
font: var(--font-small);
|
|
124
|
+
}
|
|
125
|
+
.peek p:empty {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
.peek footer a {
|
|
129
|
+
text-decoration: none;
|
|
130
|
+
}
|
|
131
|
+
.peek footer {
|
|
132
|
+
display: flex;
|
|
133
|
+
justify-content: flex-end;
|
|
134
|
+
gap: var(--space-8);
|
|
135
|
+
}
|
|
136
|
+
@media (max-width: 40rem) {
|
|
137
|
+
.peek footer > * {
|
|
138
|
+
min-height: var(--size-finger);
|
|
139
|
+
}
|
|
140
|
+
}
|
package/src/map.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
// <j-map for="plans" at="at"> (joined/kit): a collection on a map, OpenStreetMap's, each item with a place a pin there.
|
|
2
|
+
// It opens holding every pin, as near as they let it, and stays where a person moves it: dragged it pans, its buttons
|
|
3
|
+
// (or a pinch, or a trackpad's) bring it nearer and farther. A pin tapped is peeked: a card at the map's foot says
|
|
4
|
+
// what it is, when, and where, with Open (its sheet, in full) and Open in Maps; peek, then open in full. Held and
|
|
5
|
+
// dragged, a pin moves its item's place where its `may` lets it, and is put back if it's refused.
|
|
6
|
+
|
|
7
|
+
import { follow, held } from "./follow.ts";
|
|
8
|
+
import { hueOf } from "./hues.ts";
|
|
9
|
+
import { moves, tiles, type View } from "./ground.ts";
|
|
10
|
+
import { bounds, geo, mapsLink, placeAt, world } from "./geo.ts";
|
|
11
|
+
import { icon, iconButton } from "./icons.ts";
|
|
12
|
+
import { el, Reading } from "./reading.ts";
|
|
13
|
+
import type { Item } from "./rows.ts";
|
|
14
|
+
import { dated, dayOf } from "./time.ts";
|
|
15
|
+
import STYLE from "./map.css" with { type: "text" };
|
|
16
|
+
|
|
17
|
+
const SHEET = new CSSStyleSheet();
|
|
18
|
+
SHEET.replaceSync(STYLE);
|
|
19
|
+
|
|
20
|
+
export class JMap extends Reading {
|
|
21
|
+
static override sheets = [SHEET];
|
|
22
|
+
#map = el("div", { className: "map", role: "application", ariaLabel: "Map" });
|
|
23
|
+
#tiles = el("div", { className: "tiles", ariaHidden: "true" });
|
|
24
|
+
#peek = el("section", { className: "peek", part: "peek", hidden: true, ariaLive: "polite" });
|
|
25
|
+
#pins = new Map<Item, HTMLButtonElement>();
|
|
26
|
+
#view: View = { z: 0, x: 0, y: 0 };
|
|
27
|
+
/** Where a person moved it: kept, so the pins coming and going don't move it again. */
|
|
28
|
+
#moved = false;
|
|
29
|
+
#fitted = "";
|
|
30
|
+
#peeked: Item | null = null;
|
|
31
|
+
/** A press that pans it, from a finger that swipes from a pin. */
|
|
32
|
+
#press: (down: PointerEvent) => void = () => {};
|
|
33
|
+
|
|
34
|
+
get #at() {
|
|
35
|
+
return this.field("at") ?? this.spec?.fields.find((f) => f.type === "place");
|
|
36
|
+
}
|
|
37
|
+
protected made() {
|
|
38
|
+
const { zoom: step, press } = moves(
|
|
39
|
+
this.#map,
|
|
40
|
+
() => this.#view,
|
|
41
|
+
(v) => this.#look(v),
|
|
42
|
+
{ not: ".pin, .peek, .zoom, a, button" },
|
|
43
|
+
);
|
|
44
|
+
this.#press = press;
|
|
45
|
+
const zoom = el(
|
|
46
|
+
"div",
|
|
47
|
+
{ className: "zoom", part: "zoom" },
|
|
48
|
+
iconButton("zoom-in", "Nearer", () => step(1)),
|
|
49
|
+
iconButton("zoom-out", "Farther", () => step(-1)),
|
|
50
|
+
);
|
|
51
|
+
const credit = el(
|
|
52
|
+
"small",
|
|
53
|
+
{},
|
|
54
|
+
"© ",
|
|
55
|
+
el("a", { href: "https://www.openstreetmap.org/copyright", target: "_blank", rel: "noopener" }, "OpenStreetMap"),
|
|
56
|
+
);
|
|
57
|
+
this.#map.append(this.#tiles, zoom, credit, this.#peek);
|
|
58
|
+
// a press on the ground lets a peek go
|
|
59
|
+
this.#map.addEventListener("pointerdown", (e) => {
|
|
60
|
+
if (!(e.target as Element).closest(".pin, .peek, .zoom, a, button")) this.#show(null);
|
|
61
|
+
});
|
|
62
|
+
new ResizeObserver(() => this.again()).observe(this.#map);
|
|
63
|
+
this.root.append(this.#map);
|
|
64
|
+
}
|
|
65
|
+
protected draw() {
|
|
66
|
+
const at = this.#at;
|
|
67
|
+
if (!at) return;
|
|
68
|
+
const placed = this.items().flatMap((it) => {
|
|
69
|
+
const p = geo(it.data[at.name]);
|
|
70
|
+
return p ? [{ it, p }] : [];
|
|
71
|
+
});
|
|
72
|
+
const W = this.#map.clientWidth,
|
|
73
|
+
H = this.#map.clientHeight;
|
|
74
|
+
if (!W || !H) return;
|
|
75
|
+
// fitted to every pin as near as they let it, until a person moves it
|
|
76
|
+
const fit = JSON.stringify([W, H, placed.map(({ p }) => [p.lat, p.lng])]);
|
|
77
|
+
if (!this.#moved && fit !== this.#fitted) {
|
|
78
|
+
this.#fitted = fit;
|
|
79
|
+
this.#view = { z: 2, x: 0, y: 0 };
|
|
80
|
+
if (placed.length)
|
|
81
|
+
for (let z = 16; z >= 1; z--) {
|
|
82
|
+
const [x0, x1, y0, y1] = bounds(placed.map(({ p }) => world(p.lat, p.lng, z)));
|
|
83
|
+
this.#view = { z, x: (x0 + x1) / 2 - W / 2, y: (y0 + y1) / 2 - H / 2 };
|
|
84
|
+
if (x1 - x0 <= W - 80 && y1 - y0 <= H - 80) break;
|
|
85
|
+
}
|
|
86
|
+
this.#look(this.#view, false);
|
|
87
|
+
}
|
|
88
|
+
for (const [it, pin] of this.#pins) if (!placed.some((p) => p.it === it)) (pin.remove(), this.#pins.delete(it));
|
|
89
|
+
for (const { it, p } of placed) {
|
|
90
|
+
let pin = this.#pins.get(it);
|
|
91
|
+
if (!pin) {
|
|
92
|
+
pin = el("button", { type: "button", className: "pin", part: "item pin" });
|
|
93
|
+
this.#hold(pin, it);
|
|
94
|
+
this.#pins.set(it, pin);
|
|
95
|
+
this.#map.insertBefore(pin, this.#peek);
|
|
96
|
+
}
|
|
97
|
+
pin.style.setProperty("--hue", hueOf(it.key));
|
|
98
|
+
pin.ariaLabel = this.named(it);
|
|
99
|
+
pin.title = this.named(it);
|
|
100
|
+
pin.toggleAttribute("open", this.opened(it));
|
|
101
|
+
pin.toggleAttribute("peeked", this.#peeked === it);
|
|
102
|
+
this.#place(pin, p);
|
|
103
|
+
}
|
|
104
|
+
if (this.#peeked && !this.#pins.has(this.#peeked)) this.#show(null);
|
|
105
|
+
else if (this.#peeked) this.#show(this.#peeked);
|
|
106
|
+
}
|
|
107
|
+
/** A pin pressed: a tap peeks it; held (a mouse's at once), dragged, it moves its place where it may. */
|
|
108
|
+
#hold(pin: HTMLButtonElement, it: Item) {
|
|
109
|
+
pin.addEventListener("click", (e) => e.detail === 0 && this.#show(it));
|
|
110
|
+
pin.addEventListener("pointerdown", (down) => {
|
|
111
|
+
const at = this.#at!.name,
|
|
112
|
+
peek = () => this.#show(it);
|
|
113
|
+
if (!this.may(it, at)) return void pin.addEventListener("pointerup", peek, { once: true });
|
|
114
|
+
held(
|
|
115
|
+
down,
|
|
116
|
+
() => {
|
|
117
|
+
const r = this.#map.getBoundingClientRect();
|
|
118
|
+
let far = false;
|
|
119
|
+
pin.toggleAttribute("dragged", true);
|
|
120
|
+
follow(
|
|
121
|
+
down,
|
|
122
|
+
(e) => {
|
|
123
|
+
if (!far && Math.hypot(e.clientX - down.clientX, e.clientY - down.clientY) < 4) return;
|
|
124
|
+
far = true;
|
|
125
|
+
pin.style.left = `${e.clientX - r.left}px`;
|
|
126
|
+
pin.style.top = `${e.clientY - r.top}px`;
|
|
127
|
+
},
|
|
128
|
+
(e) => {
|
|
129
|
+
pin.toggleAttribute("dragged", false);
|
|
130
|
+
if (!far || !e) return (this.again(), e && peek());
|
|
131
|
+
const place = placeAt(this.#view.x + e.clientX - r.left, this.#view.y + e.clientY - r.top, this.#view.z);
|
|
132
|
+
void this.change(it, { [at]: place });
|
|
133
|
+
},
|
|
134
|
+
);
|
|
135
|
+
},
|
|
136
|
+
() => this.#press(down),
|
|
137
|
+
peek,
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/** An item peeked, at the map's foot: what, when, where, and the ways on; or none. */
|
|
142
|
+
#show(it: Item | null) {
|
|
143
|
+
this.#peeked = it;
|
|
144
|
+
for (const [i, pin] of this.#pins) pin.toggleAttribute("peeked", i === it);
|
|
145
|
+
this.#peek.hidden = !it;
|
|
146
|
+
if (!it) return this.#peek.replaceChildren();
|
|
147
|
+
this.#peek.style.setProperty("--hue", hueOf(it.key));
|
|
148
|
+
const when = this.when,
|
|
149
|
+
place = it.data[this.#at!.name],
|
|
150
|
+
maps = mapsLink(place),
|
|
151
|
+
open = el("button", { type: "button", className: "act small ink" }, icon("grow"), "Open");
|
|
152
|
+
open.addEventListener("click", () => (this.open(it), this.#show(null)));
|
|
153
|
+
const w = when ? it.data[when.name] : undefined,
|
|
154
|
+
facts =
|
|
155
|
+
typeof w === "string"
|
|
156
|
+
? [`${dated(dayOf(w), { weekday: "short", day: "numeric", month: "short" })}, ${w.slice(11, 16)}`]
|
|
157
|
+
: [];
|
|
158
|
+
this.#peek.replaceChildren(
|
|
159
|
+
el(
|
|
160
|
+
"header",
|
|
161
|
+
{},
|
|
162
|
+
el("b", {}, this.named(it)),
|
|
163
|
+
iconButton("close", "Close", () => this.#show(null)),
|
|
164
|
+
),
|
|
165
|
+
el("p", {}, facts.join(" · ")),
|
|
166
|
+
el(
|
|
167
|
+
"footer",
|
|
168
|
+
{},
|
|
169
|
+
...(maps
|
|
170
|
+
? [
|
|
171
|
+
el(
|
|
172
|
+
"a",
|
|
173
|
+
{ className: "act small", href: maps, target: "_blank", rel: "noopener" },
|
|
174
|
+
icon("place"),
|
|
175
|
+
"Open in Maps",
|
|
176
|
+
),
|
|
177
|
+
]
|
|
178
|
+
: []),
|
|
179
|
+
open,
|
|
180
|
+
),
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
#place(pin: HTMLElement, p: { lat: number; lng: number }) {
|
|
184
|
+
const w = world(p.lat, p.lng, this.#view.z);
|
|
185
|
+
pin.style.left = `${w.x - this.#view.x}px`;
|
|
186
|
+
pin.style.top = `${w.y - this.#view.y}px`;
|
|
187
|
+
}
|
|
188
|
+
/** The map looking somewhere: its tiles there, and its pins. */
|
|
189
|
+
#look(view: View, moved = true) {
|
|
190
|
+
this.#view = view;
|
|
191
|
+
this.#moved ||= moved;
|
|
192
|
+
this.#tiles.replaceChildren(...tiles(view.z, view.x, view.y, this.#map.clientWidth, this.#map.clientHeight));
|
|
193
|
+
const at = this.#at?.name;
|
|
194
|
+
if (at)
|
|
195
|
+
for (const [it, pin] of this.#pins) {
|
|
196
|
+
const p = geo(it.data[at]);
|
|
197
|
+
if (p) this.#place(pin, p);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|