@blueshed/joined 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/joined/SKILL.md +9 -1
- package/.claude/skills/joined/reference.md +270 -55
- package/.claude/skills/joined-door/SKILL.md +57 -0
- package/README.md +19 -50
- package/docs/design.md +76 -10
- package/docs/introduction.md +18 -18
- package/docs/light-and-shadow.svg +1 -1
- 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 +2 -1
- package/examples/cafe/books.html +2 -2
- package/examples/cafe/cafe.css +9 -16
- 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.rows.ts +22 -0
- package/examples/cafe/generated/staff.rules.ts +6 -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 +12 -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.ts +1 -1
- package/examples/cafe/look.ts +30 -0
- package/examples/cafe/menu.html +10 -26
- package/examples/cafe/menu.ts +8 -80
- package/examples/cafe/order.html +6 -6
- package/examples/cafe/order.ts +5 -1
- package/examples/cafe/routes.ts +0 -1
- package/examples/cafe/stories.jsonl +3 -1
- package/examples/cafe/supplies.html +34 -34
- package/examples/cafe/supplies.ts +14 -11
- package/examples/cafe/till.ts +5 -1
- package/examples/chart/arches.ts +148 -0
- package/examples/chart/chart.css +6 -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/generated/rows.ts +22 -0
- package/examples/desk/generated/rules.ts +34 -1
- package/examples/desk/index.html +9 -2
- package/examples/desk/routes.ts +0 -2
- package/examples/desk/stories.jsonl +3 -2
- package/examples/desk/thumbs.ts +2 -2
- 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 +4 -5
- package/examples/notes/generated/elements.ts +112 -0
- package/examples/notes/generated/queries.ts +36 -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 +21 -0
- package/examples/people/generated/rows.ts +22 -0
- package/examples/people/generated/rules.ts +11 -1
- package/examples/people/links.ts +2 -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 +4 -2
- 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 +12 -12
- 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/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/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 +7 -5
- package/package.json +8 -2
- package/src/awesome.ts +103 -0
- package/src/board.css +75 -0
- package/src/board.ts +173 -0
- package/src/cli.ts +15 -2
- package/src/compile.ts +569 -35
- package/src/definitions.ts +53 -15
- package/src/draft.ts +38 -23
- package/src/drawer.ts +222 -0
- package/src/engine.ts +240 -166
- package/src/fields.ts +268 -0
- package/src/files.ts +6 -4
- package/src/ground.ts +110 -0
- package/src/icon-names.ts +15 -2
- package/src/kit.ts +51 -0
- package/src/link.ts +3 -3
- package/src/map.css +133 -0
- package/src/map.ts +200 -0
- package/src/mcp.ts +176 -38
- 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 +65 -39
- package/src/members/keys.ts +93 -77
- package/src/members/panel.css +23 -17
- package/src/members/panel.ts +49 -35
- package/src/migrate.ts +120 -104
- package/src/month.css +125 -0
- package/src/month.ts +179 -0
- package/src/page.css +8 -0
- package/src/page.ts +11 -7
- package/src/parts.css +462 -170
- package/src/parts.ts +209 -26
- package/src/plane.css +56 -0
- package/src/plane.ts +151 -0
- package/src/postgres-server.ts +60 -0
- package/src/reading.css +77 -0
- package/src/reading.ts +238 -0
- package/src/rows.css +308 -0
- package/src/rows.ts +780 -0
- package/src/search.css +80 -0
- package/src/search.ts +130 -0
- package/src/server.ts +211 -114
- package/src/settings.ts +9 -4
- package/src/sheet.ts +114 -0
- package/src/skill.ts +40 -0
- package/src/slots.css +94 -0
- package/src/slots.ts +213 -0
- package/src/specs.ts +38 -0
- package/src/starter.ts +5 -2
- package/src/store.ts +184 -143
- package/src/stories.ts +43 -11
- package/src/surface.ts +159 -0
- package/src/timeline.css +111 -0
- package/src/timeline.ts +226 -0
- package/src/toast.ts +21 -48
- package/src/together.ts +0 -7
- package/src/tokens.css +78 -1
- package/src/tokens.json +249 -0
- package/src/tool.ts +211 -0
- package/src/upkeep.ts +18 -20
- package/src/views.css +44 -0
- package/src/views.ts +94 -0
- package/src/week.css +151 -0
- package/src/week.ts +250 -0
- package/src/write.ts +219 -73
- package/starter/CLAUDE.md +3 -3
- package/starter/bunfig +4 -0
- package/starter/prettierignore +4 -0
- package/starter/tests/hello.test.ts +2 -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/fields.ts
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
// A field as a sheet asks for it (joined/kit, <j-field>): one control for each kind of value the stories hold, so a
|
|
2
|
+
// page names a field and is given the right one. What's in the document is shown in the control, and what's typed or
|
|
3
|
+
// picked is read back as the document holds it: a price in pence typed in pounds, a length typed "2h 30m" kept as
|
|
4
|
+
// PT2H30M, a time to the minute kept to the second. Each is a form control by the field's name (a hidden one where the
|
|
5
|
+
// control is more than a box: people's chips, a place), so a Draft (./draft.ts) holds it until Save like any other.
|
|
6
|
+
// Its label is the field's words; what it can't read is said as the box's own complaint, and Save waits for it.
|
|
7
|
+
|
|
8
|
+
import { choose, chosen } from "./draft.ts";
|
|
9
|
+
import { iconButton } from "./icons.ts";
|
|
10
|
+
import { hueOf } from "./hues.ts";
|
|
11
|
+
import { face, typeahead } from "./parts.ts";
|
|
12
|
+
import { PlaceSearch } from "./place-search.ts";
|
|
13
|
+
import type { Field } from "./rows.ts";
|
|
14
|
+
import { lasts, lengthOf } from "./time.ts";
|
|
15
|
+
|
|
16
|
+
/** What a page may say of a field, beyond what the stories do: its words, and how it's read (money in its minor
|
|
17
|
+
* units, words long enough for a box of lines), and whether, once an item has it, it's only said there (readonly):
|
|
18
|
+
* asked as it's added, never changed after. */
|
|
19
|
+
export type Kind = { label?: string; as?: "money" | "long"; currency?: string; readonly?: boolean };
|
|
20
|
+
export type Asked = Field & Kind;
|
|
21
|
+
|
|
22
|
+
/** What a control needs of the page: what a link may be to, and that what it holds has changed. */
|
|
23
|
+
export type Context = { choices(f: Field): [key: number, words: string][]; changed(): void };
|
|
24
|
+
|
|
25
|
+
/** A field's control: its element (a label holding it), the document's value as the form shows it, the form's as the
|
|
26
|
+
* document keeps it, and what it offers drawn again as what may be chosen changes. */
|
|
27
|
+
export type Control = {
|
|
28
|
+
el: HTMLElement;
|
|
29
|
+
shown(v: unknown): string | boolean;
|
|
30
|
+
kept(s: string | boolean): unknown;
|
|
31
|
+
refresh(): void;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const el = <K extends keyof HTMLElementTagNameMap>(tag: K, props: object = {}, ...inside: (Node | string)[]) => {
|
|
35
|
+
const e = Object.assign(document.createElement(tag), props);
|
|
36
|
+
e.append(...inside);
|
|
37
|
+
return e;
|
|
38
|
+
};
|
|
39
|
+
/** Told each time a control is filled from the document (a Draft's fill, which says what it holds in data-saved):
|
|
40
|
+
* after it, its value is what was filled. */
|
|
41
|
+
const filled = (control: HTMLElement, then: () => void) =>
|
|
42
|
+
new MutationObserver(then).observe(control, { attributes: true, attributeFilter: ["data-saved"] });
|
|
43
|
+
/** How many may be chosen from as themselves (design.md, Choosing). */
|
|
44
|
+
const FEW = 6;
|
|
45
|
+
const ZONES = Intl.supportedValuesOf("timeZone");
|
|
46
|
+
|
|
47
|
+
/** A currency's minor units and its symbol, as the reader's locale writes it. */
|
|
48
|
+
export function currencyOf(code = "GBP") {
|
|
49
|
+
const f = new Intl.NumberFormat(undefined, { style: "currency", currency: code });
|
|
50
|
+
return {
|
|
51
|
+
digits: f.resolvedOptions().maximumFractionDigits ?? 2,
|
|
52
|
+
symbol: f.formatToParts(0).find((p) => p.type === "currency")!.value,
|
|
53
|
+
format: (n: number) => f.format(n),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** How a value of a field reads where it's said, not asked (a row's facts): money as money, a length as a length. */
|
|
58
|
+
export function reads(f: Asked, v: unknown): string | null {
|
|
59
|
+
if (f.as === "money" && typeof v === "number") {
|
|
60
|
+
const c = currencyOf(f.currency);
|
|
61
|
+
return c.format(v / 10 ** c.digits);
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** A field's control, as its kind and type say: Web Awesome's for what it has (a box, a number, a tick, words of
|
|
67
|
+
* several lines, a choice of a few), each its label its own; joined's for what's its own (a length, a zone, a place,
|
|
68
|
+
* people, a typeahead). */
|
|
69
|
+
export function control(f: Asked, words: string, page: Context): Control {
|
|
70
|
+
const name = f.name,
|
|
71
|
+
plain = (v: unknown) => (v === undefined || v === null ? "" : String(v)),
|
|
72
|
+
// its name an attribute at once (Web Awesome reflects a property only as it next draws): a form finds it by it
|
|
73
|
+
wa = (tag: string, props: object = {}) => {
|
|
74
|
+
const it = Object.assign(document.createElement(tag), { label: words, autocomplete: "off", ...props });
|
|
75
|
+
return (it.setAttribute("name", name), it) as HTMLElement;
|
|
76
|
+
},
|
|
77
|
+
same = { kept: (s: string | boolean) => s, refresh() {} };
|
|
78
|
+
if (f.type === "boolean") {
|
|
79
|
+
const box = wa("wa-checkbox");
|
|
80
|
+
box.append(words);
|
|
81
|
+
return { ...same, el: box, shown: (v) => v === true };
|
|
82
|
+
}
|
|
83
|
+
if (f.to && f.how === "one") return one(f, words, page);
|
|
84
|
+
if (f.to && f.how === "ids") return people(f, words, page);
|
|
85
|
+
if (f.as === "money") {
|
|
86
|
+
const c = currencyOf(f.currency);
|
|
87
|
+
return {
|
|
88
|
+
el: wa("wa-number-input", {
|
|
89
|
+
label: `${words}, ${c.symbol}`,
|
|
90
|
+
step: 1 / 10 ** c.digits,
|
|
91
|
+
min: 0,
|
|
92
|
+
inputmode: "decimal",
|
|
93
|
+
withoutSteppers: true,
|
|
94
|
+
}),
|
|
95
|
+
shown: (v) => (typeof v === "number" ? (v / 10 ** c.digits).toFixed(c.digits) : ""),
|
|
96
|
+
kept: (s) => Math.round(Number(s) * 10 ** c.digits),
|
|
97
|
+
refresh() {},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (f.type === "integer" || f.type === "decimal")
|
|
101
|
+
return {
|
|
102
|
+
el: wa(
|
|
103
|
+
"wa-number-input",
|
|
104
|
+
f.type === "integer" ? { inputmode: "numeric" } : { step: "any", inputmode: "decimal", withoutSteppers: true },
|
|
105
|
+
),
|
|
106
|
+
shown: plain,
|
|
107
|
+
kept: (s) => Number(s),
|
|
108
|
+
refresh() {},
|
|
109
|
+
};
|
|
110
|
+
if (f.type === "date-time")
|
|
111
|
+
return {
|
|
112
|
+
el: wa("wa-input", { type: "datetime-local" }),
|
|
113
|
+
shown: (v) => plain(v).slice(0, 16),
|
|
114
|
+
kept: (s) => (String(s).length === 16 ? `${s}:00` : s),
|
|
115
|
+
refresh() {},
|
|
116
|
+
};
|
|
117
|
+
if (f.type === "duration") {
|
|
118
|
+
const input = wa("wa-input", { placeholder: "2h 30m" }) as HTMLInputElement,
|
|
119
|
+
check = () =>
|
|
120
|
+
input.setCustomValidity(!input.value.trim() || lengthOf(input.value) ? "" : "A length, such as 45m or 2h 30m");
|
|
121
|
+
input.addEventListener("input", check);
|
|
122
|
+
// filled from the document (or put back by Never mind), it's read again
|
|
123
|
+
filled(input, check);
|
|
124
|
+
return {
|
|
125
|
+
el: input,
|
|
126
|
+
shown: (v) => lasts(plain(v) || undefined),
|
|
127
|
+
kept: (s) => lengthOf(String(s)),
|
|
128
|
+
refresh() {},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (f.type === "zone") return zone(f, words, page);
|
|
132
|
+
if (f.type === "place") return place(f, words, page);
|
|
133
|
+
if (f.as === "long") return { ...same, el: wa("wa-textarea", { rows: 4, resize: "auto" }), shown: plain };
|
|
134
|
+
return { ...same, el: wa("wa-input"), shown: plain };
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** A link to one item: chosen from a few as a select; from more, found by typing, the one chosen said in its box. */
|
|
138
|
+
function one(f: Field, words: string, page: Context): Control {
|
|
139
|
+
const select = Object.assign(document.createElement("wa-select"), { label: words }) as HTMLElement & {
|
|
140
|
+
value: string | null;
|
|
141
|
+
required: boolean;
|
|
142
|
+
},
|
|
143
|
+
find = el("input", { className: "find", autocomplete: "off", ariaLabel: words }),
|
|
144
|
+
list = el("div", { className: "j-choices", role: "listbox", hidden: true }),
|
|
145
|
+
many = el("label", {}, words, find, list);
|
|
146
|
+
select.setAttribute("name", f.name);
|
|
147
|
+
const offer = typeahead(
|
|
148
|
+
find,
|
|
149
|
+
list,
|
|
150
|
+
() => page.choices(f),
|
|
151
|
+
(key) => (choose(select, String(key)), refresh(), page.changed()),
|
|
152
|
+
);
|
|
153
|
+
function refresh() {
|
|
154
|
+
const all = page.choices(f),
|
|
155
|
+
few = all.length <= FEW,
|
|
156
|
+
was = chosen(select) || null;
|
|
157
|
+
select.setAttribute("placeholder", f.needed ? "Choose one" : "None");
|
|
158
|
+
select.toggleAttribute("with-clear", !f.needed);
|
|
159
|
+
// drawn again only where they've changed: Web Awesome's select keeps a value only as one of its options chosen
|
|
160
|
+
const now = JSON.stringify(all);
|
|
161
|
+
if (select.dataset.offered !== now) {
|
|
162
|
+
select.dataset.offered = now;
|
|
163
|
+
select.replaceChildren(
|
|
164
|
+
...all.map(([key, words]) => {
|
|
165
|
+
const o = el("wa-option" as "option", {}, words);
|
|
166
|
+
o.setAttribute("value", String(key));
|
|
167
|
+
return o;
|
|
168
|
+
}),
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
choose(select, was);
|
|
172
|
+
select.hidden = !few;
|
|
173
|
+
many.hidden = few;
|
|
174
|
+
find.placeholder = all.find(([key]) => String(key) === was)?.[1] ?? "Type to find one";
|
|
175
|
+
offer();
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
el: el("div", { className: "j-one" }, select, many),
|
|
179
|
+
shown: (v) => (v === undefined || v === null ? "" : String(v)),
|
|
180
|
+
kept: (s) => (s === "" ? undefined : Number(s)),
|
|
181
|
+
refresh,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** A list of people: each a chip to press, those in it pressed. Picks within a Save surface: kept with the rest. */
|
|
186
|
+
function people(f: Field, words: string, page: Context): Control {
|
|
187
|
+
const held = el("input", { type: "hidden", name: f.name }),
|
|
188
|
+
chips = el("div", { className: "j-chips", role: "group", ariaLabel: words });
|
|
189
|
+
const ids = (): number[] => JSON.parse(held.value || "[]");
|
|
190
|
+
function refresh() {
|
|
191
|
+
chips.replaceChildren(
|
|
192
|
+
...page.choices(f).map(([key, who]) => {
|
|
193
|
+
const b = el("button", { type: "button", ariaPressed: String(ids().includes(key)) }, face(key, who), who);
|
|
194
|
+
b.style.setProperty("--hue", hueOf(key));
|
|
195
|
+
b.addEventListener("click", () => {
|
|
196
|
+
const now = ids().includes(key) ? ids().filter((k) => k !== key) : [...ids(), key].sort((a, b) => a - b);
|
|
197
|
+
held.value = JSON.stringify(now);
|
|
198
|
+
refresh();
|
|
199
|
+
page.changed();
|
|
200
|
+
});
|
|
201
|
+
return b;
|
|
202
|
+
}),
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
// filled by the draft without an input event: the chips follow it as it's filled
|
|
206
|
+
filled(held, refresh);
|
|
207
|
+
return {
|
|
208
|
+
el: el("div", { className: "label" }, el("span", {}, words), held, chips),
|
|
209
|
+
shown: (v) => JSON.stringify([...((v as number[]) ?? [])].sort((a, b) => a - b)),
|
|
210
|
+
kept: (s) => JSON.parse(String(s) || "[]"),
|
|
211
|
+
refresh,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** A time zone, found by typing a city ("tokyo", "new york"); what's typed is kept only where it's one. */
|
|
216
|
+
function zone(f: Field, words: string, page: Context): Control {
|
|
217
|
+
const input = el("input", { name: f.name, autocomplete: "off", placeholder: "A city: Tokyo, London" }),
|
|
218
|
+
list = el("div", { className: "j-choices", role: "listbox", hidden: true });
|
|
219
|
+
typeahead(
|
|
220
|
+
input,
|
|
221
|
+
list,
|
|
222
|
+
() => ZONES.map((z, i) => [i, z]),
|
|
223
|
+
(i) => ((input.value = ZONES[i]!), input.setCustomValidity(""), page.changed()),
|
|
224
|
+
);
|
|
225
|
+
// typeahead empties the box as it chooses: the zone is written back after it
|
|
226
|
+
const check = () =>
|
|
227
|
+
input.setCustomValidity(!input.value || ZONES.includes(input.value) ? "" : "Choose a zone from those offered");
|
|
228
|
+
input.addEventListener("input", check);
|
|
229
|
+
filled(input, check);
|
|
230
|
+
return {
|
|
231
|
+
el: el("label", {}, words, input, list),
|
|
232
|
+
shown: (v) => (v ? String(v) : ""),
|
|
233
|
+
kept: (s) => s,
|
|
234
|
+
refresh() {},
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** A place: found by its name (Photon, ./places.ts), and kept as where it is (geo:lat,lng); said by the name it was
|
|
239
|
+
* found by, or where it is. Taken away by its ×. */
|
|
240
|
+
function place(f: Field, words: string, page: Context): Control {
|
|
241
|
+
const held = el("input", { type: "hidden", name: f.name }),
|
|
242
|
+
find = el("input", { type: "search", autocomplete: "off", placeholder: "Find a place", ariaLabel: words }),
|
|
243
|
+
at = el("span", { className: "at" }),
|
|
244
|
+
clear = iconButton("close", "No place"),
|
|
245
|
+
list = el("div", { className: "j-choices", role: "listbox", hidden: true }),
|
|
246
|
+
search = new PlaceSearch(list, (p) => {
|
|
247
|
+
held.value = p.coordinates;
|
|
248
|
+
at.textContent = p.name;
|
|
249
|
+
find.value = "";
|
|
250
|
+
page.changed();
|
|
251
|
+
said();
|
|
252
|
+
});
|
|
253
|
+
const said = () => {
|
|
254
|
+
if (!held.value) at.textContent = "";
|
|
255
|
+
else if (!at.textContent) at.textContent = held.value.replace(/^geo:/, "");
|
|
256
|
+
clear.hidden = !held.value;
|
|
257
|
+
};
|
|
258
|
+
clear.addEventListener("click", () => ((held.value = ""), said(), page.changed()));
|
|
259
|
+
find.addEventListener("input", () => search.search(find.value.trim(), () => undefined));
|
|
260
|
+
find.addEventListener("keydown", (e) => e.key === "Enter" && e.preventDefault());
|
|
261
|
+
filled(held, () => ((at.textContent = ""), said()));
|
|
262
|
+
return {
|
|
263
|
+
el: el("label", { className: "place" }, words, held, el("span", { className: "where" }, at, clear), find, list),
|
|
264
|
+
shown: (v) => (v ? String(v) : ""),
|
|
265
|
+
kept: (s) => s || undefined,
|
|
266
|
+
refresh: said,
|
|
267
|
+
};
|
|
268
|
+
}
|
package/src/files.ts
CHANGED
|
@@ -178,18 +178,20 @@ export function routes(files: Files, may: (req: Request, doc: string) => Promise
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
/** Each file the store names: in an item's file field now, or in a change it keeps, which an undo may put back. */
|
|
181
|
-
export function named(db: Engine, rules: { collections: Record<string, { fields: Record<string, Type> }> }[]) {
|
|
181
|
+
export async function named(db: Engine, rules: { collections: Record<string, { fields: Record<string, Type> }> }[]) {
|
|
182
182
|
const names = new Set<string>();
|
|
183
183
|
for (const { collections } of rules)
|
|
184
184
|
for (const [coll, c] of Object.entries(collections))
|
|
185
185
|
for (const f of Object.keys(c.fields).filter((f) => c.fields[f] === "file"))
|
|
186
|
-
for (const { v } of db.query(`SELECT "${f}" AS v FROM "${coll}" WHERE "${f}" IS NOT NULL`).all())
|
|
186
|
+
for (const { v } of (await db.query(`SELECT "${f}" AS v FROM "${coll}" WHERE "${f}" IS NOT NULL`).all()) as {
|
|
187
|
+
v: unknown;
|
|
188
|
+
}[])
|
|
187
189
|
names.add(fileName(String(v)));
|
|
188
|
-
for (const { ops } of db
|
|
190
|
+
for (const { ops } of (await db
|
|
189
191
|
.query(
|
|
190
192
|
"SELECT CAST(ops AS TEXT) || ' ' || COALESCE(CAST(inverse AS TEXT), '') AS ops FROM changes WHERE CAST(ops AS TEXT) LIKE '%file:%' OR CAST(inverse AS TEXT) LIKE '%file:%'",
|
|
191
193
|
)
|
|
192
|
-
.all())
|
|
194
|
+
.all()) as { ops: unknown }[])
|
|
193
195
|
for (const [, name] of String(ops).matchAll(NAMED)) names.add(name!);
|
|
194
196
|
return names;
|
|
195
197
|
}
|
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,12 @@ import {
|
|
|
6
6
|
Bot,
|
|
7
7
|
CalendarDays,
|
|
8
8
|
CalendarPlus,
|
|
9
|
-
|
|
9
|
+
ChartGantt,
|
|
10
10
|
Check,
|
|
11
11
|
CloudOff,
|
|
12
12
|
ChevronLeft,
|
|
13
13
|
ChevronRight,
|
|
14
|
+
Columns3,
|
|
14
15
|
Contact,
|
|
15
16
|
Copy,
|
|
16
17
|
Download,
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
GripVertical,
|
|
19
20
|
GitCommitVertical,
|
|
20
21
|
KeyRound,
|
|
22
|
+
List,
|
|
21
23
|
Lock,
|
|
22
24
|
LockOpen,
|
|
23
25
|
Pencil,
|
|
@@ -26,8 +28,12 @@ import {
|
|
|
26
28
|
ThumbsUp,
|
|
27
29
|
LogIn,
|
|
28
30
|
LogOut,
|
|
31
|
+
Map as Mapped,
|
|
32
|
+
MapPin,
|
|
29
33
|
Maximize2,
|
|
30
34
|
Plus,
|
|
35
|
+
Search,
|
|
36
|
+
SquareKanban,
|
|
31
37
|
Trash2,
|
|
32
38
|
Upload,
|
|
33
39
|
User,
|
|
@@ -45,6 +51,7 @@ export const ICONS = {
|
|
|
45
51
|
agent: Bot,
|
|
46
52
|
away: CloudOff,
|
|
47
53
|
back: ChevronLeft,
|
|
54
|
+
board: SquareKanban,
|
|
48
55
|
calendar: CalendarDays,
|
|
49
56
|
"calendar-add": CalendarPlus,
|
|
50
57
|
check: Check,
|
|
@@ -56,22 +63,28 @@ export const ICONS = {
|
|
|
56
63
|
grip: GripVertical,
|
|
57
64
|
group: Users,
|
|
58
65
|
grow: Maximize2,
|
|
59
|
-
month:
|
|
66
|
+
month: CalendarDays,
|
|
60
67
|
more: Ellipsis,
|
|
61
68
|
line: GitCommitVertical,
|
|
69
|
+
list: List,
|
|
70
|
+
map: Mapped,
|
|
62
71
|
"new-link": KeyRound,
|
|
63
72
|
on: ChevronRight,
|
|
64
73
|
out: LogOut,
|
|
65
74
|
people: Contact,
|
|
75
|
+
place: MapPin,
|
|
66
76
|
play: Play,
|
|
67
77
|
"person-add": UserPlus,
|
|
68
78
|
"person-remove": UserMinus,
|
|
69
79
|
"read-only": Lock,
|
|
80
|
+
search: Search,
|
|
70
81
|
"give-back": LockOpen,
|
|
71
82
|
remove: Trash2,
|
|
72
83
|
stay: BedDouble,
|
|
84
|
+
timeline: ChartGantt,
|
|
73
85
|
"sign-in": LogIn,
|
|
74
86
|
upload: Upload,
|
|
87
|
+
week: Columns3,
|
|
75
88
|
up: ThumbsUp,
|
|
76
89
|
you: User,
|
|
77
90
|
"zoom-in": ZoomIn,
|
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,133 @@
|
|
|
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
|
+
.pin {
|
|
22
|
+
position: absolute;
|
|
23
|
+
z-index: 1;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
width: var(--size-pin);
|
|
26
|
+
height: var(--size-pin);
|
|
27
|
+
margin: calc(var(--size-pin) / -2) 0 0 calc(var(--size-pin) / -2);
|
|
28
|
+
padding: 0;
|
|
29
|
+
border: calc(var(--space-4) / 2) solid var(--card);
|
|
30
|
+
border-radius: var(--radius-dot);
|
|
31
|
+
background: var(--hue, var(--accent));
|
|
32
|
+
box-shadow: var(--drop);
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
touch-action: none;
|
|
35
|
+
}
|
|
36
|
+
/* under a finger, the pin is what's drawn, its button a finger wide round it */
|
|
37
|
+
@media (pointer: coarse) {
|
|
38
|
+
.pin::after {
|
|
39
|
+
content: "";
|
|
40
|
+
position: absolute;
|
|
41
|
+
inset: calc((var(--size-finger) - var(--size-pin)) / -2);
|
|
42
|
+
}
|
|
43
|
+
.zoom .icon-only {
|
|
44
|
+
width: var(--size-finger);
|
|
45
|
+
height: var(--size-finger);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
.pin:is([open], [peeked]) {
|
|
49
|
+
z-index: 2;
|
|
50
|
+
scale: 1.3;
|
|
51
|
+
outline: calc(var(--space-4) / 2) solid var(--ink);
|
|
52
|
+
}
|
|
53
|
+
.pin[dragged] {
|
|
54
|
+
z-index: 3;
|
|
55
|
+
cursor: grabbing;
|
|
56
|
+
}
|
|
57
|
+
.zoom {
|
|
58
|
+
position: absolute;
|
|
59
|
+
z-index: 3;
|
|
60
|
+
top: var(--space-8);
|
|
61
|
+
left: var(--space-8);
|
|
62
|
+
display: grid;
|
|
63
|
+
border: 1px solid var(--edge);
|
|
64
|
+
border-radius: var(--radius);
|
|
65
|
+
background: var(--card);
|
|
66
|
+
}
|
|
67
|
+
.zoom .icon-only + .icon-only {
|
|
68
|
+
border-top: 1px solid var(--line);
|
|
69
|
+
}
|
|
70
|
+
small {
|
|
71
|
+
position: absolute;
|
|
72
|
+
z-index: 3;
|
|
73
|
+
right: 0;
|
|
74
|
+
bottom: 0;
|
|
75
|
+
padding: 0 var(--space-4);
|
|
76
|
+
background: color-mix(in srgb, var(--card) 80%, transparent);
|
|
77
|
+
color: var(--muted);
|
|
78
|
+
font: var(--font-tiny);
|
|
79
|
+
}
|
|
80
|
+
small a {
|
|
81
|
+
color: inherit;
|
|
82
|
+
}
|
|
83
|
+
/* the peek: what was tapped, at the map's foot, to open in full; above the tiles' credit, which it never covers */
|
|
84
|
+
.peek {
|
|
85
|
+
position: absolute;
|
|
86
|
+
z-index: 4;
|
|
87
|
+
inset: auto var(--space-8) var(--space-24);
|
|
88
|
+
display: grid;
|
|
89
|
+
gap: var(--space-4);
|
|
90
|
+
max-width: var(--size-sheet);
|
|
91
|
+
margin-inline: auto;
|
|
92
|
+
padding: var(--space-8) var(--space-8) var(--space-8) var(--space-16);
|
|
93
|
+
border: 1px solid var(--edge);
|
|
94
|
+
border-inline-start: var(--size-stripe) solid var(--hue, var(--accent));
|
|
95
|
+
border-radius: var(--radius);
|
|
96
|
+
background: var(--card);
|
|
97
|
+
box-shadow: var(--drop);
|
|
98
|
+
color: var(--ink);
|
|
99
|
+
}
|
|
100
|
+
.peek[hidden] {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
103
|
+
.peek header {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
gap: var(--space-8);
|
|
107
|
+
font: var(--font-row);
|
|
108
|
+
}
|
|
109
|
+
.peek b {
|
|
110
|
+
flex: 1;
|
|
111
|
+
font-weight: 600;
|
|
112
|
+
}
|
|
113
|
+
.peek p {
|
|
114
|
+
margin: 0;
|
|
115
|
+
color: var(--muted);
|
|
116
|
+
font: var(--font-small);
|
|
117
|
+
}
|
|
118
|
+
.peek p:empty {
|
|
119
|
+
display: none;
|
|
120
|
+
}
|
|
121
|
+
.peek footer a {
|
|
122
|
+
text-decoration: none;
|
|
123
|
+
}
|
|
124
|
+
.peek footer {
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: flex-end;
|
|
127
|
+
gap: var(--space-8);
|
|
128
|
+
}
|
|
129
|
+
@media (max-width: 40rem) {
|
|
130
|
+
.peek footer > * {
|
|
131
|
+
min-height: var(--size-finger);
|
|
132
|
+
}
|
|
133
|
+
}
|