@blueshed/joined 0.1.20 → 0.2.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 +1 -1
- package/.claude/skills/joined/reference.md +99 -18
- package/README.md +6 -4
- package/docs/design.md +31 -8
- package/docs/introduction.md +1 -1
- package/docs/learning.md +1 -1
- package/docs/light-and-shadow.svg +119 -0
- package/docs/links-and-trust.svg +93 -0
- package/docs/logo.svg +47 -0
- package/docs/stories-to-code.svg +86 -0
- package/docs/wire-op.svg +99 -0
- package/examples/cafe/kitchen.ts +2 -2
- package/examples/desk/card.ts +43 -0
- package/examples/desk/desk.css +17 -0
- package/examples/desk/desk.json +41 -0
- package/examples/desk/generated/elements.ts +69 -0
- package/examples/desk/generated/queries.ts +33 -0
- package/examples/desk/generated/rules.ts +94 -0
- package/examples/desk/index.html +34 -0
- package/examples/desk/lanes.css +126 -0
- package/examples/desk/lanes.ts +133 -0
- package/examples/desk/migrations/001-desk.ts +8 -0
- package/examples/desk/page.ts +29 -0
- package/examples/desk/pulse.ts +20 -0
- package/examples/desk/routes.ts +9 -0
- package/examples/desk/steps.ts +32 -0
- package/examples/desk/stories.jsonl +18 -0
- package/examples/desk/tally.css +62 -0
- package/examples/desk/tally.ts +76 -0
- package/examples/desk/thumbs.ts +45 -0
- package/examples/desk/trust.ts +24 -0
- package/examples/desk/words.ts +17 -0
- package/examples/trip/bar.ts +1 -1
- package/examples/trip/calendar-map.css +2 -0
- package/examples/trip/drags.ts +3 -3
- package/examples/trip/drawer.ts +5 -5
- package/examples/trip/event-form.ts +8 -7
- package/examples/trip/holding.ts +1 -1
- package/examples/trip/ics.ts +22 -112
- package/examples/trip/line-stops.ts +1 -1
- package/examples/trip/line-words.ts +1 -1
- package/examples/trip/line.ts +1 -1
- package/examples/trip/map.ts +1 -1
- package/examples/trip/month.ts +1 -1
- package/examples/trip/other-weeks.ts +1 -1
- package/examples/trip/page.ts +2 -2
- package/examples/trip/peek.ts +1 -1
- package/examples/trip/routes.ts +3 -3
- package/examples/trip/shell.ts +3 -3
- package/examples/trip/stays.ts +1 -1
- package/examples/trip/week.ts +1 -1
- package/examples/trip/writes.ts +1 -1
- package/examples/trips/card.ts +1 -1
- package/examples/trips/map.ts +1 -1
- package/examples/weeks/derive.ts +1 -1
- package/package.json +9 -2
- package/src/attachment.ts +18 -11
- package/src/client.ts +7 -0
- package/src/demo.css +29 -26
- package/src/demo.ts +2 -2
- package/src/draft.ts +23 -8
- package/src/files.ts +25 -9
- package/{examples/trip/mercator.ts → src/geo.ts} +13 -3
- package/src/icon-names.ts +4 -0
- package/src/ics.ts +130 -0
- package/src/members/group.ts +3 -1
- package/src/members/panel.css +208 -201
- package/src/members/panel.ts +17 -8
- package/src/ops.ts +5 -0
- package/src/outbox.ts +70 -0
- package/src/page.css +76 -70
- package/src/page.ts +86 -15
- package/src/parts.css +575 -428
- package/src/parts.ts +18 -5
- package/{examples/trip → src}/place-search.ts +5 -5
- package/{examples/trip → src}/places.ts +9 -7
- package/src/rank.ts +20 -0
- package/src/scrim.ts +81 -0
- package/src/server.ts +59 -13
- package/{examples/trip → src}/time.ts +37 -5
- package/src/together.ts +2 -6
- package/src/tokens.css +5 -0
- package/src/tokens.json +35 -0
- package/src/write.ts +29 -14
|
@@ -14,4 +14,4 @@ A new app goes stories → compile → folder → look → links → tests: §2,
|
|
|
14
14
|
`node_modules/joined/` (`src/`, `examples/`, `docs/`); joined's `tests/` isn't shipped, and an app's tests
|
|
15
15
|
are its own (`tests/`, its stories told). Copy from joined's examples, smallest first.
|
|
16
16
|
|
|
17
|
-
The rules, and the gate, are CLAUDE.md's. Traps already met are §13; the store, its migrations, and running elsewhere, §14 (and §3).
|
|
17
|
+
The rules, and the gate, are CLAUDE.md's. Traps already met are §13; the store, its migrations, and running elsewhere, §14 (and §3); views to copy, §16.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
| 2 | [Stories, the source](#2-stories-the-source) | `examples/people/stories.jsonl` (the smallest with members), `examples/trip/stories.jsonl`, `tests/compile.test.ts` |
|
|
7
7
|
| 3 | [What the compiler writes](#3-what-the-compiler-writes) | `examples/trip/generated/` |
|
|
8
8
|
| 4 | [A view: an item element given a look](#4-a-view-an-item-element-given-a-look) | `examples/trip/stays.ts` (the smallest), `examples/hello/page.ts` (a Draft), `examples/cafe/menu.ts` (a drawer) |
|
|
9
|
-
| 5 | [A display: a collection drawn in a shadow](#5-a-display-a-collection-drawn-in-a-shadow) | `examples/cafe/kitchen.ts` (the smallest), `examples/cafe/rail-drag.ts` (a drag), `examples/trip/calendar-map.ts` (grown, a part a file) |
|
|
9
|
+
| 5 | [A display: a collection drawn in a shadow](#5-a-display-a-collection-drawn-in-a-shadow) | `examples/cafe/kitchen.ts` (the smallest), `examples/desk/tally.ts` (one that holds nothing), `examples/cafe/rail-drag.ts` (a drag), `examples/trip/calendar-map.ts` (grown, a part a file) |
|
|
10
10
|
| 6 | [Links between documents](#6-links-between-documents) | an event's `people`; `examples/people/links.ts` |
|
|
11
11
|
| 7 | [Several documents on a page](#7-several-documents-on-a-page) | `examples/cafe/index.html`, `examples/trip/index.html` |
|
|
12
12
|
| 8 | [Routes: pages and edges](#8-routes-pages-and-edges) | `examples/hello/routes.ts`, `examples/cafe/routes.ts`, `examples/trip/routes.ts` |
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
| 13 | [Traps](#13-traps) | met while building |
|
|
18
18
|
| 14 | [Seeds, the store, and running it elsewhere](#14-seeds-the-store-and-running-it-elsewhere) | `examples/trip/trip.json`, `src/store.ts`, `src/migrate.ts` |
|
|
19
19
|
| 15 | [What stories can't show: definitions, an app's own rules, a kind](#15-what-stories-cant-show-definitions-an-apps-own-rules-a-kind) | `examples/cafe/stories.jsonl`, `src/definitions.ts` |
|
|
20
|
+
| 16 | [Recipes: views to copy](#16-recipes-views-to-copy) | `examples/desk/` (lanes, moves, thumbs, a tally, a glow, a rank), and the rest by where they're shown |
|
|
20
21
|
|
|
21
22
|
## 1. Start an app
|
|
22
23
|
|
|
@@ -55,8 +56,9 @@ element is the document); with the group and a collection, `examples/trips/`.
|
|
|
55
56
|
**An app imports joined by its name, never by a path into `src/`,** as a project that takes joined as
|
|
56
57
|
a dependency would; `tests/package.test.ts` refuses `../src/` under `examples/`. The names are
|
|
57
58
|
`package.json`'s `exports`: `joined/page` (`Answer`, `ask`), `joined/keep` (`keep`, `Row`), `joined/draft`,
|
|
58
|
-
`joined/parts` (`PARTS`, `face`, `said`, `askFirst`, `showsOpen`, `inHash`, `typeahead`), `joined/follow` (`follow`,
|
|
59
|
-
`held`), `joined/
|
|
59
|
+
`joined/parts` (`adopt`, `PARTS`, `face`, `said`, `askFirst`, `showsOpen`, `inHash`, `typeahead`), `joined/follow` (`follow`,
|
|
60
|
+
`held`), `joined/time`, `joined/ics`, `joined/geo`, `joined/places`, `joined/place-search`, `joined/rank` (time, places and order: §16's
|
|
61
|
+
"Shared, not copied"), `joined/icons`, `joined/hues` (`hueOf`), `joined/panel` (`members`, `signedIn`, `group`: §11), `joined/toast`, `joined/client` (`open`),
|
|
60
62
|
`joined/stories` (`tell`), `joined/migrate`, `joined/server` (the type `Read`), `joined/compile`; and in a page's HTML
|
|
61
63
|
`joined/tokens.css`, `joined/page.css`, `joined/icon.png` (`joined/parts.css` and `joined/tokens.json` are there for
|
|
62
64
|
a design system). The compiler writes `joined/page` and `joined/migrate` too.
|
|
@@ -229,9 +231,13 @@ is opened or closed, and `again()`, called as the items change, to open one name
|
|
|
229
231
|
The draft is `Draft` from `joined/draft`, given the form (Save named `go`, Never mind `never`) and
|
|
230
232
|
its note. `fill(saved, afresh)` sets the controls as the document has the item: afresh, all of
|
|
231
233
|
them; on a change from elsewhere (call it from the `MutationObserver`), only those not being
|
|
232
|
-
changed here. `edits()` is what's changed, by control name; `show("kept" | "changed" | "new")` says
|
|
233
|
-
so and turns Save and Never mind on or off
|
|
234
|
-
|
|
234
|
+
changed here. `edits()` is what's changed, by control name; `show("kept" | "changed" | "new", ready?)` says
|
|
235
|
+
so and turns Save and Never mind on or off, Save off too while it isn't `ready` (a new event's title not given);
|
|
236
|
+
`refuse(why)` says a refusal until `refuse("")`. `inside(drawer, close, never)` makes its drawer's × (named
|
|
237
|
+
`close`, at the end of its head) where the form has none, and has the ×, Escape and, on a phone, a tap on the dimmed
|
|
238
|
+
page close it. Every drawer that changes something is one, whether or not it holds its fields against the document
|
|
239
|
+
(a drawer that adds says its state by `show()` alone). What the changes are as ops (a time made a duration, an
|
|
240
|
+
emptied field cleared) stays the page's own.
|
|
235
241
|
|
|
236
242
|
Working, smallest first:
|
|
237
243
|
- `examples/trip/stays.ts`: a view of an item (its name changed in place, a way to cancel it), and a form that adds.
|
|
@@ -244,7 +250,7 @@ Working, smallest first:
|
|
|
244
250
|
- `examples/people/view.ts` (a person's row), `links.ts` (what links to them, kept as links come and go), `order.ts`
|
|
245
251
|
(dragged by a grip), `adding.ts` (the page's form).
|
|
246
252
|
- `examples/trip/event-form.ts` with `drawer.ts` and `writes.ts`: a `Draft` grown, in a drawer, its fields derived (a
|
|
247
|
-
time made a duration), its parts a file each (`zones.ts`, `
|
|
253
|
+
time made a duration), its parts a file each (`zones.ts`, `people-chips.ts`, `answer-rows.ts`; its place search is `joined/place-search`).
|
|
248
254
|
|
|
249
255
|
A file field (a post's photo, a PDF) is `attachment(doc, put, take?)` from `joined/attachment`: `el` to append, and
|
|
250
256
|
`draw(value, { put, take })` called from the view's `draw()` with the item's value and its `may`
|
|
@@ -283,6 +289,11 @@ It never shows it, and draws its items in its shadow DOM:
|
|
|
283
289
|
`iconify(this.#root)` (§10).
|
|
284
290
|
- **Another display's request** comes as an event on the item: `pick`, bubbling, is how the
|
|
285
291
|
people's links pick an event on the calendar.
|
|
292
|
+
- **Who changed it, and by what:** each change put on the page fires `changed` on every element it left changed (an
|
|
293
|
+
item, or a document's own), bubbling, once it's in: `detail.by` the member who made it (null: nobody's, a
|
|
294
|
+
stranger's page or the server's own) and `detail.via` the label of the agent's link it came through (`"claude"`;
|
|
295
|
+
null: a page's). An item removed has none left to say it. A display listening on itself hears its items', so a
|
|
296
|
+
row an agent changed can say so for a moment. Working: `tests/pages.test.ts` ("a change says who made it").
|
|
286
297
|
|
|
287
298
|
Working: `examples/cafe/kitchen.ts`, the smallest (about 130 lines: tickets kept by `keep` in columns, a ticket made
|
|
288
299
|
again only as its order changes, the waits each minute), and `examples/cafe/rail-drag.ts`, the smallest drag (30
|
|
@@ -326,9 +337,14 @@ and so is one put back while another of its document's collections kept it held
|
|
|
326
337
|
The server logs each write a page sends as one line: `write trip by member 1: done, version 12`, or
|
|
327
338
|
`refused, <why>` (quiet under `bun test`; `start({ log })` takes another).
|
|
328
339
|
|
|
329
|
-
When the socket drops (a phone asleep, a redeploy), the page is away (`body[data-away]`,
|
|
330
|
-
`away` event; `back` when it returns; the group's button says "· back soon")
|
|
331
|
-
|
|
340
|
+
When the socket drops (a phone asleep, a redeploy, a train with no signal), the page is away (`body[data-away]`,
|
|
341
|
+
and the `away` event; `back` when it returns; the group's button says "· back soon"). A write that only adds (every
|
|
342
|
+
op `add` at a collection's end: a cost, a person) is kept on the device (`src/outbox.ts`, under who wrote it), its
|
|
343
|
+
sender answered at once, and the page told what's waiting (`body[data-waiting]`, the `waiting` event, the group's
|
|
344
|
+
bar: "2 waiting for signal"); it's sent by itself once the page is back and holds its documents again, oldest first,
|
|
345
|
+
and one refused then is said in the toast and let go. Anything else it sends is refused at once (an edit made away
|
|
346
|
+
could overwrite what changed meanwhile: a Draft keeps it to save again), and it comes back by itself, each document
|
|
347
|
+
put in place by key. Only
|
|
332
348
|
the server closing it on purpose, or the door refusing it, signs it out. A write refused, draw again,
|
|
333
349
|
and a display shows nothing as saved that wasn't. A socket can die with no close (the browser still calls it
|
|
334
350
|
open): woken, or its network back, the page asks it (`{ subscribe, id: 0 }`, answered `{ done: 0 }`), and one
|
|
@@ -346,7 +362,9 @@ Working: `examples/cafe/index.html`, the till's page, holds the menu, the till's
|
|
|
346
362
|
A write of several documents is one message, `{ id, writes: [{ doc, ops, why? }, …] }`, sent by `together(writes)`
|
|
347
363
|
from `joined/page`: each part a document the page holds, or one the write makes (`board:$1`), each asked in the
|
|
348
364
|
write's transaction whether its writer may hold it, and the rules a write to it is held to. It's answered as one
|
|
349
|
-
write. A document each person sees only some of is told a write's parts on it as one change.
|
|
365
|
+
write. A document each person sees only some of is told a write's parts on it as one change. An undo (`undo(doc,
|
|
366
|
+
version)`) is one document's: a write of several lands `landed` with its first part's version, and undoing it puts
|
|
367
|
+
back that part alone.
|
|
350
368
|
|
|
351
369
|
## 8. Routes: pages and edges
|
|
352
370
|
|
|
@@ -399,10 +417,11 @@ Working: `examples/hello/routes.ts`, the smallest; `examples/cafe/routes.ts` (an
|
|
|
399
417
|
for them, as them (their grants, the app's trust), once; then the act is gone. The people's `person`: the person
|
|
400
418
|
they were invited as is them.
|
|
401
419
|
|
|
402
|
-
- **A file a document names** is joined's own route, never an app's: `POST /files?doc=<doc>` (the bytes the body)
|
|
420
|
+
- **A file a document names** is joined's own route, never an app's: `POST /files?doc=<doc>&name=<its file's name>` (the bytes the body)
|
|
403
421
|
by whoever may put a file in that document (an add to a collection with a file field, or its replace: a member by
|
|
404
422
|
their link, a guest by its code), from this site alone (another site's is refused); a photo made a WebP (1600px, no
|
|
405
|
-
EXIF), an SVG and a PDF as they are (an SVG served sandboxed: opened by its path, nothing in it runs),
|
|
423
|
+
EXIF), an SVG and a PDF as they are (an SVG served sandboxed: opened by its path, nothing in it runs), a Markdown
|
|
424
|
+
file as it is where its name says so (`.md`, `.markdown`) and it's text (served as text/markdown), under 20 MB
|
|
406
425
|
and 50 megapixels, else refused in words; answered `{ file }`. Kept by its
|
|
407
426
|
content's hash in `files/` beside the store, or where `JOINED_FILES` says: another folder, or a bucket,
|
|
408
427
|
`s3://<bucket>/<prefix>` (Bun's S3 client, its keys, endpoint and region from `S3_*` or `AWS_*` in the
|
|
@@ -417,10 +436,22 @@ Working: `examples/hello/routes.ts`, the smallest; `examples/cafe/routes.ts` (an
|
|
|
417
436
|
- **Every page's layout,** `src/page.css` (`joined/page.css`), linked after the tokens: the body, `h1`, `h2`,
|
|
418
437
|
`.note`, `.bar`, `#said`, and `main` hidden signed out and dimmed away. A page's own look comes after it.
|
|
419
438
|
- **The parts,** `src/parts.css`, once: buttons, fields, labels, the drawer (`.drawer`), the modal
|
|
420
|
-
(`dialog`)
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
field's look in a display's own sheet:
|
|
439
|
+
(`dialog`), the sheet (`.sheet`, a popover with a title and its ×) and a fixed foot (`.j-foot`). Adopted by the
|
|
440
|
+
page and every shadow (`src/parts.ts`; a display's: `adopt(this.#root, SHEET)`, which also has its modals, sheets
|
|
441
|
+
and drawers dim the page by its one scrim). A button with words is `.act` (`.ink`, `.danger`, `.quiet`), one with
|
|
442
|
+
its icon alone `.icon-only`; a field needs no class. Never a button's or a field's look in a display's own sheet:
|
|
443
|
+
only how it sits (`flex: 1`).
|
|
444
|
+
- **An app's rule wins over joined's:** the parts, the page's layout and the group's look are a layer, `joined`,
|
|
445
|
+
beneath anything of the app's own, whatever its specificity: never `.link.link`, nor adopting a sheet after
|
|
446
|
+
joined's to win. So an app's reset (`button { font: inherit; color: inherit }`) would win over a part too, and a
|
|
447
|
+
filled Save's words would take the page's ink: put it in `@layer reset { … }`, which joined's sheets name beneath
|
|
448
|
+
theirs (`@layer reset, joined;`), wherever it's written. The group is reached by its
|
|
449
|
+
parts: `members-panel::part(sheet)` (`bar`, `who`, `notice`, `sheet`, `menu`, `ask`, `waiting`).
|
|
450
|
+
- **How it moves,** `src/tokens.json`'s motion (`--rise`, `--fall`, `--ask`, `--ask-out`, `--drop`): a drawer or a
|
|
451
|
+
sheet rises (from the foot on a phone, a drawer from the right where it docks), a modal settles, a menu drops; on
|
|
452
|
+
a phone a drawer and a sheet are a phone's sheet (rounded at the top, a grabber), the page dimmed behind by one
|
|
453
|
+
scrim (`src/scrim.ts`) that fades in every browser, a tap on it closing the drawer on top. Never a surface's
|
|
454
|
+
motion or scrim of an app's own.
|
|
424
455
|
- **Type** is nine styles, each a font in `src/tokens.css`: `font: var(--font-row)` (`body`,
|
|
425
456
|
`heading`, `title`, `row`, `label`, `tool`, `small`, `tiny`, `field`). Never a size by hand.
|
|
426
457
|
- **The colours,** `src/tokens.css` (`--paper`, `--card`, `--ink`, `--muted`, `--line`, `--edge`, `--add`,
|
|
@@ -441,9 +472,10 @@ Working: `examples/hello/routes.ts`, the smallest; `examples/cafe/routes.ts` (an
|
|
|
441
472
|
- **A display's,** imported as text and adopted in its shadow:
|
|
442
473
|
|
|
443
474
|
```ts
|
|
475
|
+
import { adopt } from "joined/parts";
|
|
444
476
|
import STYLE from "./calendar-map.css" with { type: "text" };
|
|
445
477
|
const SHEET = new CSSStyleSheet(); SHEET.replaceSync(STYLE);
|
|
446
|
-
this.#root
|
|
478
|
+
adopt(this.#root, SHEET); // joined's parts, then its own
|
|
447
479
|
```
|
|
448
480
|
|
|
449
481
|
Sizes the code draws with are custom properties set on the host (`--hour`), so the numbers live
|
|
@@ -766,3 +798,52 @@ Working: `src/members/`; `tests/sign-in.test.ts`; `tests/mcp.test.ts` (the door)
|
|
|
766
798
|
(`tests/definitions.test.ts`), fills and timed on a tally (`tests/writes.test.ts`); a Padlet (`tests/padlet`, `tests/padlet.test.ts`): item roles in
|
|
767
799
|
a kind, `"me"`, moves from a premise and an add's first step, `gone: "with"`, and a board's secret link, and its settings, frozen and waits (`tests/settings`), and visitor levels (`tests/visitors`); a write across documents (`tests/together`); a post's file
|
|
768
800
|
(`tests/attachments`).
|
|
801
|
+
|
|
802
|
+
## 16. Recipes: views to copy
|
|
803
|
+
|
|
804
|
+
A view or a display an app keeps building, each a file to copy whole and rename. Each says, at its head, what it is,
|
|
805
|
+
what it reads (an item's `data` and its `may`), and the one write it sends. Find the one nearest what you need, copy
|
|
806
|
+
it beside your page, and change its names to your collection's; the rules of §4 and §5 hold in each.
|
|
807
|
+
|
|
808
|
+
The desk (`examples/desk/`, `/desk`) is tasks an agent works through and a person steers, and each part of its page is
|
|
809
|
+
one:
|
|
810
|
+
|
|
811
|
+
| Recipe | File | What it is | Its kind elsewhere |
|
|
812
|
+
|---|---|---|---|
|
|
813
|
+
| Lanes, dragged | `lanes.ts` | A display: a collection in lanes by a field, each in the collection's order, kept by `keep`; a card let go in another lane makes the step its `may` offers, and lands between the cards it's let go between, one write for both. | the kitchen's rail (fixed steps), cardlet's columns, idea-cards' stacks |
|
|
814
|
+
| The moves `may` offers | `steps.ts` | A button for each step of a `moves` field this person may make from where the item is (`replace:status>review`), its words the page's by from and to ("Send back"): the stories say which there are and whose. | a post held for approval, an order's next move |
|
|
815
|
+
| Thumbs | `thumbs.ts`, `trust.ts` | Up or down as two lists of ids (`ups`, `downs`, links to members): yours pressed, the other taken back in the same write (`write()` of the compiled elements); `trust.ts` holds a thumb to its giver, one an item. | idea-cards' thumbs, cardlet's votes |
|
|
816
|
+
| A summary strip (V6) | `tally.ts` | A display that holds nothing: it reads the page's live list and watches the collection for what it shows alone (`attributeFilter`: status, points), sums once a moment (`queueMicrotask`), and moves only a part's width and its words. Counts by a field, done of all, a sum; its parts tones of ink, never hues (a hue is a person's). | bluecount's totals and where it went, the cafe's books |
|
|
817
|
+
| What just changed | `pulse.ts` | A row `keep` makes again for a change glows a moment, not on the first drawing, nor when it's drawn for someone else; the display's own row glows (a class in its shadow), never the document's element. | an agent's work seen as it lands |
|
|
818
|
+
| A rank between | `joined/rank` | Where a thing let go lands among others: its place, and a rank halfway between its neighbours (one less than the first, one more than the last), so one write moves it. | the people's order, cardlet's columns |
|
|
819
|
+
|
|
820
|
+
Who added an item is a field the server fills (`{"fills":{"tasks":{"by":"me"}}}`), drawn as their face. Who made the
|
|
821
|
+
last change isn't told to a view yet (the ledger's #89, `docs/view-plan.md`'s step 3). The plan's V4 (a queue to
|
|
822
|
+
approve) and V5 (filter by a link, a link matrix) are recipes still to add here (its step 8).
|
|
823
|
+
|
|
824
|
+
Elsewhere, by what it does:
|
|
825
|
+
|
|
826
|
+
- A row changed in place and taken away: `examples/trip/stays.ts`. A drawer with a draft: `examples/cafe/menu.ts`.
|
|
827
|
+
- A form on the page that adds, its refusal said under it: `examples/people/adding.ts`, the desk's `page.ts`.
|
|
828
|
+
- What links to an item, kept as links come and go: `examples/people/links.ts`.
|
|
829
|
+
- Dragged in order by a grip, or the arrow keys: `examples/people/order.ts`.
|
|
830
|
+
- A list of people as chips, a typeahead past six: `examples/trip/people-chips.ts`.
|
|
831
|
+
- Each person's answer to an item, a list of ids each: `examples/trip/answer-rows.ts`, `answers.ts`.
|
|
832
|
+
- A file on an item: `attachment()` (§4), `tests/attachments/board/page.ts`.
|
|
833
|
+
- When and where by a hand (a calendar, a map): `examples/trip/calendar-map.ts` and its parts.
|
|
834
|
+
|
|
835
|
+
**Shared, not copied.** What three apps repeated is joined's, imported by name, never copied (each told in
|
|
836
|
+
`tests/`, the place search by the trip's page):
|
|
837
|
+
|
|
838
|
+
- `joined/time`: a start a wall clock kept as if UTC (`wall`, `local`, `hhmm`, `now`), a day a count (`dayOf`,
|
|
839
|
+
`mondayOf`, `weekOf`, `firstOf`, `gridOf`, `dated`), a length ISO 8601 (`seconds`, `iso`, `ends`), said and typed as
|
|
840
|
+
people do (`lasts`: PT2H30M is "2h 30m"; `lengthOf`: "1.5h" is PT1H30M), a drag's quarter hour (`snap`, `SNAP`),
|
|
841
|
+
`hours`, `stayed`, `on`. A time is never `new Date(start)`: that reads a wall clock in the browser's zone.
|
|
842
|
+
- `joined/geo`: a `geo:` value read (`geo`) and made (`geoOf`), Open in Maps (`mapsLink`), and Web Mercator over
|
|
843
|
+
OpenStreetMap's tiles (`world`, `placeAt`, `bounds`, `tileAt`, `TILE`).
|
|
844
|
+
- `joined/places`: Photon's `find(q, near?)` and `nameOf(point)`; `joined/place-search`'s `PlaceSearch` offers what's
|
|
845
|
+
found beneath a field.
|
|
846
|
+
- `joined/rank`: `between(before?, after?)` and `landing(rows, ranks, y)`.
|
|
847
|
+
- `joined/ics`: `toIcs(events, name)`, each event a `uid` (the same each time: a feed's calendar changes it, not adds
|
|
848
|
+
it again), its `zone`, `location`, `coordinates`, `description`, `url` and `attendees` where it has them; and
|
|
849
|
+
`fromIcs(text)`. Served as `text/calendar`, it's a download or a feed (`webcal://`); the trip's `routes.ts`.
|
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ elements.
|
|
|
31
31
|
hold their links and can give them again. Behind them all is a kind BDFL, who always says why.
|
|
32
32
|
- **Small.** Bun, web components and one dependency (lucide, for icons), and PGlite, optional, for a
|
|
33
33
|
Postgres store; the migrations are joined's own. The compiler, the server, the page's side and the store
|
|
34
|
-
together are about 4,
|
|
34
|
+
together are about 4,700 lines of code, and a change to one of 100,000 events costs at most twice one of 1,000
|
|
35
35
|
(`bun run claims` counts the one and times the other).
|
|
36
36
|
|
|
37
37
|
## Try it
|
|
@@ -64,7 +64,8 @@ so its connector address is `…/mcp`, with no link, and Claude changes it as an
|
|
|
64
64
|
## Your own apps
|
|
65
65
|
|
|
66
66
|
joined is a package: a project takes it as a dependency and keeps its apps in `apps/`, each a
|
|
67
|
-
folder like those in `examples/`.
|
|
67
|
+
folder like those in `examples/`. It's on npm as `@blueshed/joined`; once create-joined is published too, an app
|
|
68
|
+
begins with:
|
|
68
69
|
|
|
69
70
|
```
|
|
70
71
|
bun create joined my-app
|
|
@@ -76,8 +77,9 @@ test telling hello's stories, and the scripts: `dev`, `compile` (each app's `gen
|
|
|
76
77
|
its stories), `start` (serves `apps/`, keeping what the pages change in `.data/`), `link`, `upgrade` and `test`.
|
|
77
78
|
`bun run upgrade` moves it to the newest joined and refreshes the skill.
|
|
78
79
|
|
|
79
|
-
Until then,
|
|
80
|
-
|
|
80
|
+
Until then, `bun <joined>/create/index.ts my-app` makes it, on the newest joined from npm. To try a joined not
|
|
81
|
+
released yet, `bun run pack` in joined makes `.pack/blueshed-joined-<version>.tgz`, and `JOINED_FROM=<that tarball>`
|
|
82
|
+
makes the app on it. Never take joined's folder
|
|
81
83
|
itself (`file:../joined`): Bun copies a folder dependency whole, `.data/` (the store, and the members' keys)
|
|
82
84
|
included.
|
|
83
85
|
|
package/docs/design.md
CHANGED
|
@@ -18,14 +18,18 @@ and offers nothing they can't.
|
|
|
18
18
|
|
|
19
19
|
- **The page** shows what is here: a document's collection, in its readings.
|
|
20
20
|
- **A drawer** (Drawer) is editing: one thing's own fields, its deeds at its foot. Docked at the
|
|
21
|
-
right, `panel` wide; on a phone, a sheet
|
|
22
|
-
Its changes wait in it until Save.
|
|
21
|
+
right, `panel` wide, the page beside it as it was; on a phone, a sheet risen from the foot, the page dimmed
|
|
22
|
+
above it. Its changes wait in it until Save.
|
|
23
23
|
- **A modal** (Modal, New event) is new or delete: one question, one answer, gone. It never edits.
|
|
24
24
|
Removing, or anything that can't be taken back, is always asked first in the app's own modal,
|
|
25
25
|
never the browser's `confirm()`.
|
|
26
26
|
- **A sheet** (Sheet, The group) shows a list beside the page. It has a title and its ×, and closes
|
|
27
27
|
when you tap away. A form in it is laid out as a drawer's: its fields one under another, its deeds at
|
|
28
28
|
its foot, removing apart.
|
|
29
|
+
- **On a phone, a drawer and a sheet are a phone's sheet:** the width of the screen, risen from the foot,
|
|
30
|
+
rounded at the top (`radius-sheet`), a grabber on its head, the page dimmed behind by its one scrim; a tap on
|
|
31
|
+
the dimmed page closes a drawer, as its × does, and takes a sheet away. A modal dims the page by the same
|
|
32
|
+
scrim anywhere, over the drawer it asks over.
|
|
29
33
|
- **Each keeps its head and its foot in view.** A drawer, a modal and a sheet always show what it is
|
|
30
34
|
(its title, its ×) and what you may do (its deeds, a sheet's add field); only what's between them
|
|
31
35
|
scrolls, however tall it grows, under a band of its card (8px) below the head and above the foot, so
|
|
@@ -43,7 +47,8 @@ place with a picture is drawn as it (a trip is its week and its map), never as a
|
|
|
43
47
|
### What a tap does
|
|
44
48
|
|
|
45
49
|
- A tap on something named is that thing, in one tap.
|
|
46
|
-
- Nothing opens by itself, and closing changes nothing. One thing open at a time; Escape closes it
|
|
50
|
+
- Nothing opens by itself, and closing changes nothing. One thing open at a time; Escape closes it, wherever
|
|
51
|
+
you are.
|
|
47
52
|
Back closes it too, what's open being in the URL's hash (`#event=2`), so a link opens it again.
|
|
48
53
|
- Offer only what this person may do: each element's `may` says it, from the grants and their roles
|
|
49
54
|
(`add` on a collection; `remove`, `replace:price`, a move `replace:status>ready` on an item), and a
|
|
@@ -52,7 +57,10 @@ place with a picture is drawn as it (a trip is its week and its map), never as a
|
|
|
52
57
|
- Every write says what it did, where the person is: done, the change shows, on every page alike;
|
|
53
58
|
refused, and why, beside the control that sent it (Said), to that person alone. Nothing typed is
|
|
54
59
|
lost to a refusal.
|
|
55
|
-
- Away, what's shown dims, as it may be behind, and the group's button says it's coming back (Away).
|
|
60
|
+
- Away, what's shown dims, as it may be behind, and the group's button says it's coming back (Away). What's
|
|
61
|
+
added meanwhile (a cost, a person: a write that only adds) is kept on the device and the group's bar says how
|
|
62
|
+
many wait for signal; it's sent once the page is back, and one refused then is said. Anything else is refused
|
|
63
|
+
at once, so an edit made before it can't overwrite what changed meanwhile, and the drawer keeps it to save again.
|
|
56
64
|
|
|
57
65
|
### What a drag does
|
|
58
66
|
|
|
@@ -129,8 +137,19 @@ Icons assets).
|
|
|
129
137
|
that runs to the screen's edges bleeds by the gutter's name, `calc(-1 * var(--gutter))`, never its number.
|
|
130
138
|
- **Every space is a token** (`space-4` … `space-64`), on one scale, never a number of rem or px by hand.
|
|
131
139
|
- **Under a finger, 44px:** a button (`touch`), an icon button (`control`) and a field.
|
|
132
|
-
- **4px corners everywhere** (`radius`), a card's too; 3px inside a 4px box; a tag is a pill; a dot and a face are
|
|
133
|
-
|
|
140
|
+
- **4px corners everywhere** (`radius`), a card's too; 3px inside a 4px box; a tag is a pill; a dot and a face are
|
|
141
|
+
round; on a phone, a drawer's and a sheet's top corners are 14px (`radius-sheet`), as a phone's sheet.
|
|
142
|
+
- **No shadows.** A drawer, a modal and a sheet are set apart by a 1px `edge`; on a phone, a drawer and a sheet by
|
|
143
|
+
the scrim behind them alone.
|
|
144
|
+
- **A foot fixed at the screen's foot** (a quick add, a balance) is `.j-foot`: it runs on past the screen's foot
|
|
145
|
+
by 40vh, its words lifted by as much, so nothing of the page shows under it where an iPhone's address bar floats
|
|
146
|
+
and comes and goes.
|
|
147
|
+
- **An app's rule wins over a part:** the parts (and joined's page, the group's and the demo's sheets) are a
|
|
148
|
+
layer, `joined`, beneath anything of the app's own, whatever its specificity; an app's reset
|
|
149
|
+
(`button { font: inherit }`) goes in `@layer reset`, which joined names beneath its own. A display gives its shadow the
|
|
150
|
+
parts by `adopt(root, …its own sheets)`, so its modals, sheets and drawers dim the page as the page's do; the
|
|
151
|
+
group takes an app's touch by its parts, `members-panel::part(sheet)` (bar, who, notice, sheet, menu, ask,
|
|
152
|
+
waiting).
|
|
134
153
|
|
|
135
154
|
## Words
|
|
136
155
|
|
|
@@ -144,5 +163,9 @@ Icons assets).
|
|
|
144
163
|
|
|
145
164
|
## Motion
|
|
146
165
|
|
|
147
|
-
|
|
148
|
-
|
|
166
|
+
Things come and go as an iPhone's do (`src/tokens.json`, motion): a drawer or a sheet rises into place in
|
|
167
|
+
`rise` (420ms, quick then a long soft settle) and goes back the way it came in `fall` (280ms), from the foot on
|
|
168
|
+
a phone, a drawer from the right where it docks, a sheet a little from below; the scrim fades with them. A
|
|
169
|
+
modal settles in from a little larger in `ask` and fades as it shrinks a little in `ask-out`; a menu drops a
|
|
170
|
+
few pixels from its button in `drop`; the Toast fades. Nothing else moves, and under
|
|
171
|
+
`prefers-reduced-motion` nothing does (`src/parts.css`).
|
package/docs/introduction.md
CHANGED
|
@@ -187,7 +187,7 @@ Everything an app needs lives in one folder under `examples/`:
|
|
|
187
187
|
| `index.html` & `page.ts` | The page and its controls |
|
|
188
188
|
| `routes.ts` | Exports `document` and `routes` (the page and any edges like `/trip/1/trip.ics`) |
|
|
189
189
|
|
|
190
|
-
To read deeper,
|
|
190
|
+
To read deeper, `docs/plan.md` in joined's repository is `joined` as it's aimed: its architecture, what's decided
|
|
191
191
|
and why, every story and seed, what's built, and the phases still to build. See [docs/design.md](design.md) for how it
|
|
192
192
|
looks: the rules for its surfaces, taps and drags, colour, type, icons and words, whose values and parts
|
|
193
193
|
are `joined`'s design system.
|
package/docs/learning.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Learning joined
|
|
2
2
|
|
|
3
3
|
Why joined is hard to pick up, and what would make it easier. It isn't the size: the compiler, the
|
|
4
|
-
server, the page's side and the store are about 4,
|
|
4
|
+
server, the page's side and the store are about 4,700 lines of code, and every line is tested. It's that a
|
|
5
5
|
newcomer meets several unfamiliar things at once, with nothing familiar to hold on to.
|
|
6
6
|
|
|
7
7
|
## Why it's hard
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 880 360" font-family="system-ui, -apple-system, sans-serif">
|
|
2
|
+
<defs>
|
|
3
|
+
<marker id="arrow-obs" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
|
4
|
+
<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#4e79a7"/>
|
|
5
|
+
</marker>
|
|
6
|
+
<marker id="arrow-op" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
|
7
|
+
<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#f28e2b"/>
|
|
8
|
+
</marker>
|
|
9
|
+
</defs>
|
|
10
|
+
|
|
11
|
+
<!-- Outer Host Frame: <calendar-map> -->
|
|
12
|
+
<rect width="880" height="360" rx="10" fill="#fafafa" stroke="#ccc"/>
|
|
13
|
+
<text x="20" y="25" font-family="ui-monospace, SFMono-Regular, Menlo, monospace" font-size="13" font-weight="600" fill="#222"><calendar-map people="people"></text>
|
|
14
|
+
<text x="860" y="25" font-size="12" fill="#666" text-anchor="end">The light DOM is the document; the shadow DOM is the display.</text>
|
|
15
|
+
|
|
16
|
+
<!-- Left Panel: Light DOM (The Document) -->
|
|
17
|
+
<g transform="translate(18, 40)">
|
|
18
|
+
<rect width="324" height="300" rx="8" fill="#ffffff" stroke="#4e79a7" stroke-width="1.5"/>
|
|
19
|
+
<rect x="0.75" y="0.75" width="322.5" height="28" rx="7" fill="#eef3f8"/>
|
|
20
|
+
<text x="12" y="19" font-size="11.5" font-weight="600" fill="#2c5282">Light DOM — the document (hidden)</text>
|
|
21
|
+
<text x="312" y="19" font-size="10.5" fill="#4e79a7" text-anchor="end">no copy beside it</text>
|
|
22
|
+
|
|
23
|
+
<g font-family="ui-monospace, SFMono-Regular, Menlo, monospace" font-size="10.2" fill="#222">
|
|
24
|
+
<text x="14" y="49" fill="#2c5282" font-weight="600"><j-events></text>
|
|
25
|
+
|
|
26
|
+
<!-- Event 1 -->
|
|
27
|
+
<rect x="20" y="58" width="290" height="44" rx="5" fill="#f8f9fa" stroke="#e5e5e5"/>
|
|
28
|
+
<text x="28" y="75" fill="#666"><j-event <tspan fill="#222">key="1" title="Land at Haneda"</tspan></text>
|
|
29
|
+
<text x="28" y="92" fill="#666"> start="2026-11-03T14:30:00" …></text>
|
|
30
|
+
|
|
31
|
+
<!-- Event 2 (Highlighted / Picked) -->
|
|
32
|
+
<rect x="20" y="112" width="290" height="86" rx="5" fill="#fdf6ec" stroke="#f28e2b" stroke-width="1.5"/>
|
|
33
|
+
<text x="28" y="129" font-weight="600" fill="#222"><j-event <tspan fill="#d97706">key="2"</tspan></text>
|
|
34
|
+
<text x="38" y="146">title=<tspan fill="#59a14f">"Dinner in Shinjuku"</tspan></text>
|
|
35
|
+
<text x="38" y="163">start=<tspan fill="#2c5282" font-weight="600">"2026-11-04T19:00"</tspan> people=<tspan fill="#59a14f">"1 2"</tspan></text>
|
|
36
|
+
<text x="38" y="180">coordinates=<tspan fill="#2c5282" font-weight="600">"geo:35.6938,139.7034"</tspan>></text>
|
|
37
|
+
|
|
38
|
+
<!-- Event 3 -->
|
|
39
|
+
<rect x="20" y="208" width="290" height="44" rx="5" fill="#f8f9fa" stroke="#e5e5e5"/>
|
|
40
|
+
<text x="28" y="225" fill="#666"><j-event <tspan fill="#222">key="3" title="Shinkansen"</tspan></text>
|
|
41
|
+
<text x="28" y="242" fill="#666"> start="2026-11-06T09:00:00" …></text>
|
|
42
|
+
|
|
43
|
+
<text x="14" y="274" fill="#2c5282" font-weight="600"></j-events></text>
|
|
44
|
+
</g>
|
|
45
|
+
</g>
|
|
46
|
+
|
|
47
|
+
<!-- Middle Bridge: MutationObserver & el.change() -->
|
|
48
|
+
<g transform="translate(342, 130)">
|
|
49
|
+
<!-- Forward arrow: MutationObserver -->
|
|
50
|
+
<path d="M 10 22 L 126 22" fill="none" stroke="#4e79a7" stroke-width="1.8" marker-end="url(#arrow-obs)"/>
|
|
51
|
+
<text x="68" y="13" font-size="10.5" font-weight="600" fill="#2c5282" text-anchor="middle">MutationObserver</text>
|
|
52
|
+
<text x="68" y="37" font-size="10" fill="#666" text-anchor="middle">1 attribute → 1 move</text>
|
|
53
|
+
|
|
54
|
+
<!-- Return arrow: el.change(...) -->
|
|
55
|
+
<path d="M 126 78 L 10 78" fill="none" stroke="#f28e2b" stroke-width="1.8" stroke-dasharray="4 3" marker-end="url(#arrow-op)"/>
|
|
56
|
+
<text x="68" y="69" font-family="ui-monospace, monospace" font-size="9.8" font-weight="600" fill="#d97706" text-anchor="middle">el.change({ start })</text>
|
|
57
|
+
<text x="68" y="93" font-size="10" fill="#666" text-anchor="middle">Save sends 1 write</text>
|
|
58
|
+
</g>
|
|
59
|
+
|
|
60
|
+
<!-- Right Panel: Shadow DOM (The Display) -->
|
|
61
|
+
<g transform="translate(478, 40)">
|
|
62
|
+
<rect width="384" height="300" rx="8" fill="#ffffff" stroke="#222" stroke-width="1.5"/>
|
|
63
|
+
<rect x="0.75" y="0.75" width="382.5" height="28" rx="7" fill="#f3f4f6"/>
|
|
64
|
+
<text x="14" y="19" font-size="12" font-weight="600" fill="#222">#shadow-root — drawn twice from one element</text>
|
|
65
|
+
|
|
66
|
+
<!-- Sub-view 1: Calendar Days -->
|
|
67
|
+
<g transform="translate(14, 42)">
|
|
68
|
+
<rect width="174" height="190" rx="6" fill="#ffffff" stroke="#ddd"/>
|
|
69
|
+
<line x1="58" y1="0" x2="58" y2="190" stroke="#eee"/>
|
|
70
|
+
<line x1="116" y1="0" x2="116" y2="190" stroke="#eee"/>
|
|
71
|
+
<line x1="0" y1="24" x2="174" y2="24" stroke="#eee"/>
|
|
72
|
+
<text x="29" y="16" font-size="10.5" font-weight="600" fill="#444" text-anchor="middle">Tue 3</text>
|
|
73
|
+
<text x="87" y="16" font-size="10.5" font-weight="600" fill="#222" text-anchor="middle">Wed 4</text>
|
|
74
|
+
<text x="145" y="16" font-size="10.5" font-weight="600" fill="#444" text-anchor="middle">Thu 5</text>
|
|
75
|
+
|
|
76
|
+
<!-- Hour guide lines -->
|
|
77
|
+
<line x1="0" y1="68" x2="174" y2="68" stroke="#f3f3f3"/>
|
|
78
|
+
<line x1="0" y1="112" x2="174" y2="112" stroke="#f3f3f3"/>
|
|
79
|
+
<line x1="0" y1="156" x2="174" y2="156" stroke="#f3f3f3"/>
|
|
80
|
+
|
|
81
|
+
<!-- Event 1 block -->
|
|
82
|
+
<rect x="4" y="92" width="50" height="32" rx="3" fill="#e8eff7" stroke="#4e79a7" stroke-width="1"/>
|
|
83
|
+
<text x="9" y="105" font-size="8.5" fill="#4e79a7" font-weight="600">14:30</text>
|
|
84
|
+
<text x="9" y="117" font-size="8.5" fill="#222">Land</text>
|
|
85
|
+
|
|
86
|
+
<!-- Event 2 block (Dinner, picked!) -->
|
|
87
|
+
<rect x="62" y="128" width="50" height="44" rx="3" fill="#fdebd6" stroke="#222" stroke-width="1.5"/>
|
|
88
|
+
<line x1="63" y1="128" x2="63" y2="172" stroke="#e15759" stroke-width="3"/>
|
|
89
|
+
<text x="69" y="140" font-size="8.5" font-weight="600" fill="#d97706">19:00</text>
|
|
90
|
+
<text x="69" y="152" font-size="8.5" font-weight="600" fill="#222">Dinner</text>
|
|
91
|
+
<circle cx="73" cy="163" r="3" fill="#f28e2b"/>
|
|
92
|
+
<circle cx="82" cy="163" r="3" fill="#e15759"/>
|
|
93
|
+
</g>
|
|
94
|
+
|
|
95
|
+
<!-- Sub-view 2: Map Tiles + Pins -->
|
|
96
|
+
<g transform="translate(198, 42)">
|
|
97
|
+
<rect width="172" height="190" rx="6" fill="#e8eef2" stroke="#ddd"/>
|
|
98
|
+
<!-- Stylised coastline / map grid -->
|
|
99
|
+
<path d="M 0 140 Q 55 120 95 85 T 172 45 L 172 190 L 0 190 Z" fill="#dbe6ec"/>
|
|
100
|
+
<path d="M 20 0 L 20 190 M 85 0 L 85 190 M 150 0 L 150 190 M 0 60 L 172 60 M 0 125 L 172 125" stroke="#dde5ea" stroke-width="1"/>
|
|
101
|
+
|
|
102
|
+
<!-- Pin 1 -->
|
|
103
|
+
<circle cx="122" cy="138" r="6" fill="#4e79a7" stroke="#fff" stroke-width="2"/>
|
|
104
|
+
|
|
105
|
+
<!-- Pin 2 (Dinner, picked!) -->
|
|
106
|
+
<circle cx="96" cy="88" r="8" fill="#e15759" stroke="#222" stroke-width="2"/>
|
|
107
|
+
<circle cx="96" cy="88" r="6" fill="none" stroke="#fff" stroke-width="1.5"/>
|
|
108
|
+
<rect x="40" y="56" width="112" height="22" rx="4" fill="#222"/>
|
|
109
|
+
<text x="96" y="71" font-size="9.5" font-weight="600" fill="#fff" text-anchor="middle">Dinner in Shinjuku</text>
|
|
110
|
+
</g>
|
|
111
|
+
|
|
112
|
+
<!-- Connecting callout lines inside shadow root showing both come from key="2" -->
|
|
113
|
+
<g transform="translate(14, 244)">
|
|
114
|
+
<rect width="356" height="44" rx="6" fill="#f8f9fa" stroke="#ddd"/>
|
|
115
|
+
<text x="12" y="18" font-size="11" font-weight="600" fill="#222">Editing “Dinner in Shinjuku”</text>
|
|
116
|
+
<text x="12" y="34" font-size="10.2" fill="#555">One element (<tspan font-family="ui-monospace, monospace" fill="#222">key="2"</tspan>) → one calendar block, one map pin, one form.</text>
|
|
117
|
+
</g>
|
|
118
|
+
</g>
|
|
119
|
+
</svg>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 880 320" font-family="system-ui, -apple-system, sans-serif">
|
|
2
|
+
<defs>
|
|
3
|
+
<marker id="l-arrow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
|
4
|
+
<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#e15759"/>
|
|
5
|
+
</marker>
|
|
6
|
+
<marker id="l-arrow-blue" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
|
7
|
+
<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#4e79a7"/>
|
|
8
|
+
</marker>
|
|
9
|
+
</defs>
|
|
10
|
+
|
|
11
|
+
<rect width="880" height="320" rx="10" fill="#fafafa" stroke="#e5e5e5"/>
|
|
12
|
+
|
|
13
|
+
<!-- Left Half: Cross-Document Links via HTML IDREFS -->
|
|
14
|
+
<g transform="translate(20, 20)">
|
|
15
|
+
<rect width="410" height="280" rx="8" fill="#ffffff" stroke="#ccc"/>
|
|
16
|
+
<rect x="0.75" y="0.75" width="408.5" height="28" rx="7" fill="#f3f4f6"/>
|
|
17
|
+
<text x="14" y="19" font-size="12" font-weight="600" fill="#222">Links between documents: HTML IDREFS & CSS</text>
|
|
18
|
+
|
|
19
|
+
<!-- Document 1: trip:1 -->
|
|
20
|
+
<g transform="translate(14, 42)">
|
|
21
|
+
<rect width="382" height="84" rx="6" fill="#f8f9fa" stroke="#ddd"/>
|
|
22
|
+
<text x="12" y="18" font-size="11" font-weight="600" fill="#4e79a7">Document: trip:1 (<j-events>)</text>
|
|
23
|
+
<text x="12" y="39" font-family="ui-monospace, monospace" font-size="9.8" fill="#222"><j-event key="1" title="Land at Haneda" <tspan fill="#e15759" font-weight="600">people="1"</tspan>></text>
|
|
24
|
+
<text x="12" y="57" font-family="ui-monospace, monospace" font-size="9.8" fill="#222"><j-event key="2" title="Dinner in Shinjuku" <tspan fill="#e15759" font-weight="600">people="1 2"</tspan>></text>
|
|
25
|
+
<text x="12" y="74" font-size="10.2" fill="#666">Field name = target collection name ("people")</text>
|
|
26
|
+
</g>
|
|
27
|
+
|
|
28
|
+
<!-- CSS Selector Query Bridge -->
|
|
29
|
+
<path d="M 135 168 L 135 130" fill="none" stroke="#e15759" stroke-width="1.6" marker-end="url(#l-arrow)"/>
|
|
30
|
+
<text x="147" y="153" font-family="ui-monospace, monospace" font-size="10.5" font-weight="600" fill="#e15759">querySelectorAll('[people~="2"]')</text>
|
|
31
|
+
|
|
32
|
+
<!-- Document 2: people -->
|
|
33
|
+
<g transform="translate(14, 172)">
|
|
34
|
+
<rect width="382" height="94" rx="6" fill="#fdf6ec" stroke="#f28e2b"/>
|
|
35
|
+
<text x="12" y="18" font-size="11" font-weight="600" fill="#d97706">Document: people (<j-people> in its popover)</text>
|
|
36
|
+
<text x="12" y="38" font-family="ui-monospace, monospace" font-size="10.5" fill="#222"><j-person <tspan fill="#e15759" font-weight="600">key="2"</tspan> name="Kenji"></text>
|
|
37
|
+
<rect x="22" y="47" width="142" height="22" rx="4" fill="#ffffff" stroke="#222"/>
|
|
38
|
+
<text x="93" y="62" font-size="10.2" font-weight="600" fill="#222" text-anchor="middle">Dinner in Shinjuku ↗</text>
|
|
39
|
+
<text x="174" y="62" font-size="10.2" fill="#555">click dispatches <tspan font-family="ui-monospace, monospace" fill="#222">"pick"</tspan></text>
|
|
40
|
+
<text x="12" y="84" font-size="10.2" fill="#666">Server refuses removing Kenji while 1 event in trip links to him.</text>
|
|
41
|
+
</g>
|
|
42
|
+
</g>
|
|
43
|
+
|
|
44
|
+
<!-- Right Half: The Trust Network (src/members/) -->
|
|
45
|
+
<g transform="translate(450, 20)">
|
|
46
|
+
<rect width="410" height="280" rx="8" fill="#ffffff" stroke="#ccc"/>
|
|
47
|
+
<rect x="0.75" y="0.75" width="408.5" height="28" rx="7" fill="#f3f4f6"/>
|
|
48
|
+
<text x="14" y="19" font-size="12" font-weight="600" fill="#222">Sign-in by link: the trust tree (<j-members>)</text>
|
|
49
|
+
|
|
50
|
+
<!-- Tree Nodes -->
|
|
51
|
+
<!-- Root: Peter -->
|
|
52
|
+
<g transform="translate(20, 46)">
|
|
53
|
+
<rect width="246" height="34" rx="6" fill="#222"/>
|
|
54
|
+
<text x="12" y="21" font-size="12" font-weight="600" fill="#fff">Peter</text>
|
|
55
|
+
<rect x="52" y="8" width="38" height="18" rx="4" fill="#4e79a7"/>
|
|
56
|
+
<text x="71" y="20" font-size="9.5" font-weight="600" fill="#fff" text-anchor="middle">BDFL</text>
|
|
57
|
+
<text x="234" y="21" font-family="ui-monospace, monospace" font-size="10" fill="#ccc" text-anchor="end">key="1" (ROOT_TOKEN)</text>
|
|
58
|
+
</g>
|
|
59
|
+
|
|
60
|
+
<!-- Branch to Nick -->
|
|
61
|
+
<path d="M 34 80 L 34 108 L 50 108" fill="none" stroke="#888" stroke-width="1.5"/>
|
|
62
|
+
<g transform="translate(50, 91)">
|
|
63
|
+
<rect width="232" height="34" rx="6" fill="#f8f9fa" stroke="#ccc"/>
|
|
64
|
+
<text x="12" y="21" font-size="12" font-weight="600" fill="#222">Nick</text>
|
|
65
|
+
<text x="220" y="21" font-family="ui-monospace, monospace" font-size="10" fill="#666" text-anchor="end">key="2" inviter="1"</text>
|
|
66
|
+
</g>
|
|
67
|
+
|
|
68
|
+
<!-- Branch to Nora -->
|
|
69
|
+
<path d="M 64 125 L 64 153 L 80 153" fill="none" stroke="#888" stroke-width="1.5"/>
|
|
70
|
+
<g transform="translate(80, 136)">
|
|
71
|
+
<rect width="232" height="34" rx="6" fill="#f8f9fa" stroke="#ccc"/>
|
|
72
|
+
<text x="12" y="21" font-size="12" font-weight="600" fill="#222">Nora</text>
|
|
73
|
+
<text x="220" y="21" font-family="ui-monospace, monospace" font-size="10" fill="#666" text-anchor="end">key="3" inviter="2"</text>
|
|
74
|
+
</g>
|
|
75
|
+
|
|
76
|
+
<!-- Branch to Dev -->
|
|
77
|
+
<path d="M 94 170 L 94 198 L 110 198" fill="none" stroke="#888" stroke-width="1.5"/>
|
|
78
|
+
<g transform="translate(110, 181)">
|
|
79
|
+
<rect width="232" height="34" rx="6" fill="#f8f9fa" stroke="#ccc"/>
|
|
80
|
+
<text x="12" y="21" font-size="12" font-weight="600" fill="#222">Dev</text>
|
|
81
|
+
<text x="220" y="21" font-family="ui-monospace, monospace" font-size="10" fill="#666" text-anchor="end">key="4" inviter="3"</text>
|
|
82
|
+
</g>
|
|
83
|
+
|
|
84
|
+
<!-- Reparenting curved arrow (if Nora is removed, Dev moves up to Nick) -->
|
|
85
|
+
<path d="M 342 198 C 390 198, 390 108, 288 108" fill="none" stroke="#4e79a7" stroke-width="1.5" stroke-dasharray="3 2" marker-end="url(#l-arrow-blue)"/>
|
|
86
|
+
|
|
87
|
+
<!-- Rules summary at bottom -->
|
|
88
|
+
<g transform="translate(18, 228)" font-size="10.5" fill="#555">
|
|
89
|
+
<text x="0" y="14">• <tspan font-weight="600" fill="#222">Friends help friends:</tspan> your inviter holds your link to send again or replace.</text>
|
|
90
|
+
<text x="0" y="32">• <tspan font-weight="600" fill="#222">Remove with a reason:</tspan> if Nick removes Nora, Dev moves up to Nick.</text>
|
|
91
|
+
</g>
|
|
92
|
+
</g>
|
|
93
|
+
</svg>
|
package/docs/logo.svg
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 180 180">
|
|
2
|
+
<!-- Warm amber right half -->
|
|
3
|
+
<rect x="6" y="6" width="168" height="168" fill="#e07a24"/>
|
|
4
|
+
|
|
5
|
+
<!-- Slate-blue left half (head, ear, trunk, and left block) -->
|
|
6
|
+
<path d="
|
|
7
|
+
M 6 6
|
|
8
|
+
H 90
|
|
9
|
+
V 20
|
|
10
|
+
A 56 56 0 0 1 146 76
|
|
11
|
+
V 134
|
|
12
|
+
A 21 21 0 0 1 104 134
|
|
13
|
+
H 124
|
|
14
|
+
V 128
|
|
15
|
+
A 28 28 0 0 0 68 128
|
|
16
|
+
V 174
|
|
17
|
+
H 6
|
|
18
|
+
Z
|
|
19
|
+
" fill="#46719e"/>
|
|
20
|
+
|
|
21
|
+
<!-- Top vertical join tick -->
|
|
22
|
+
<line x1="90" y1="6" x2="90" y2="20" stroke="#080808" stroke-width="10"/>
|
|
23
|
+
|
|
24
|
+
<!-- Continuous ear -> forehead -> outer trunk -> trunk tip -->
|
|
25
|
+
<path d="
|
|
26
|
+
M 68 100
|
|
27
|
+
A 40 40 0 0 1 68 20
|
|
28
|
+
H 90
|
|
29
|
+
A 56 56 0 0 1 146 76
|
|
30
|
+
V 134
|
|
31
|
+
A 21 21 0 0 1 104 134
|
|
32
|
+
" fill="none" stroke="#080808" stroke-width="10" stroke-linecap="butt"/>
|
|
33
|
+
|
|
34
|
+
<!-- Inner throat arch -> down into trunk curl + bottom vertical join -->
|
|
35
|
+
<path d="
|
|
36
|
+
M 68 174
|
|
37
|
+
V 128
|
|
38
|
+
A 28 28 0 0 1 124 128
|
|
39
|
+
V 135
|
|
40
|
+
" fill="none" stroke="#080808" stroke-width="10" stroke-linecap="round"/>
|
|
41
|
+
|
|
42
|
+
<!-- Outer square frame -->
|
|
43
|
+
<rect x="6" y="6" width="168" height="168" fill="none" stroke="#080808" stroke-width="12"/>
|
|
44
|
+
|
|
45
|
+
<!-- White dot eye -->
|
|
46
|
+
<circle cx="110" cy="65" r="5" fill="#fff"/>
|
|
47
|
+
</svg>
|