@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
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
| 1 | [Start an app](#1-start-an-app) | `examples/hello/` |
|
|
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
|
-
| 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.
|
|
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/
|
|
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.html` (the kit, §17) |
|
|
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/line.ts` (a reading of the kit's, grown) |
|
|
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` |
|
|
13
|
-
| 9 | [Stylesheets](#9-stylesheets) | `examples/hello/hello.css`, `examples/cafe/kitchen.css` (a display's), `examples/trip/
|
|
13
|
+
| 9 | [Stylesheets](#9-stylesheets) | `examples/hello/hello.css`, `examples/cafe/kitchen.css` (a display's), `examples/trip/line.css` |
|
|
14
14
|
| 10 | [Icons](#10-icons) | `src/icons.ts` |
|
|
15
15
|
| 11 | [The group: sign-in by link](#11-the-group-sign-in-by-link) | `src/members/`, `tests/sign-in.test.ts` |
|
|
16
16
|
| 12 | [Tests](#12-tests) | `tests/pages.test.ts` (hello's), `tests/cafe.test.ts`, `tests/examples.test.ts` |
|
|
@@ -18,6 +18,7 @@
|
|
|
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
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 |
|
|
21
|
+
| 17 | [The kit: a page composed, not written](#17-the-kit-a-page-composed-not-written) | `examples/cafe/menu.html` (the smallest), `tests/kit/` (every kind of field, every reading) |
|
|
21
22
|
|
|
22
23
|
## 1. Start an app
|
|
23
24
|
|
|
@@ -46,6 +47,12 @@ examples/notes/
|
|
|
46
47
|
notes.css how the document's elements look
|
|
47
48
|
```
|
|
48
49
|
|
|
50
|
+
**A page before it has a display of its own:** the compiler writes each collection one, rows
|
|
51
|
+
(`generated/rows.ts`, §3). `index.html` holds `<j-notes-rows><j-notes></j-notes></j-notes-rows>`, and `page.ts`
|
|
52
|
+
defines it: `define(JNotesRows)`, from `joined/rows` and `./generated/rows.ts`. Every op the stories allow is there
|
|
53
|
+
to do. It's the app's to extend (a word, how a field reads, a deed more) or to leave for a display of its own (§4,
|
|
54
|
+
§5) when rows aren't what the thing is. Working: `tests/rows/choices/`.
|
|
55
|
+
|
|
49
56
|
Then `bun run compile`, add a link to the root page (`examples/index.html`), and `bun run dev`. The
|
|
50
57
|
server finds the app by its `routes.ts` and nothing else. A document that other pages hold, and
|
|
51
58
|
has no page of its own, needs only its stories, its seed and `routes.ts`, as `examples/people/` does.
|
|
@@ -56,7 +63,7 @@ element is the document); with the group and a collection, `examples/trips/`.
|
|
|
56
63
|
**An app imports joined by its name, never by a path into `src/`,** as a project that takes joined as
|
|
57
64
|
a dependency would; `tests/package.test.ts` refuses `../src/` under `examples/`. The names are
|
|
58
65
|
`package.json`'s `exports`: `joined/page` (`Answer`, `ask`), `joined/keep` (`keep`, `Row`), `joined/draft`,
|
|
59
|
-
`joined/parts` (`adopt`, `PARTS`, `face`, `said`, `askFirst`, `showsOpen`, `inHash`, `typeahead`), `joined/follow` (`follow`,
|
|
66
|
+
`joined/parts` (`adopt`, `PARTS`, `face`, `said`, `askFirst`, `showsOpen`, `inHash`, `typeahead`, `row`, `tick`, `mention`, `peek`), `joined/follow` (`follow`,
|
|
60
67
|
`held`), `joined/time`, `joined/ics`, `joined/geo`, `joined/places`, `joined/place-search`, `joined/rank` (time, places and order: §16's
|
|
61
68
|
"Shared, not copied"), `joined/icons`, `joined/hues` (`hueOf`), `joined/panel` (`members`, `signedIn`, `group`: §11), `joined/toast`, `joined/client` (`open`),
|
|
62
69
|
`joined/stories` (`tell`), `joined/migrate`, `joined/server` (the type `Read`), `joined/compile`; and in a page's HTML
|
|
@@ -102,23 +109,29 @@ A story is one JSON line in dzql's words:
|
|
|
102
109
|
of writes), told with nobody signed in. A project whose stories are all anonymous has no members. The
|
|
103
110
|
grammar, and what the compiler refuses: `docs/stories.md`.
|
|
104
111
|
- The model is only what the `does` stories do:
|
|
105
|
-
- **A collection** is a path's first step (`/events`), named in the plural
|
|
112
|
+
- **A collection** is a path's first step (`/events`), named in the plural: a regular one, or one of English's
|
|
113
|
+
irregular plurals a domain keeps (people, teeth, feet, children, men, women, mice, geese).
|
|
106
114
|
- **A field** is a key an add gives or a replace names. Its type is its values': a string, or one
|
|
107
115
|
read off its form (a date-time `2026-11-07T19:00:00`, a time zone `Asia/Tokyo`, an instant `2026-11-07T10:00:00Z`, a duration `PT2H`, a place `geo:35.69,139.70`, a file `file:<its SHA-256>.webp`, one kept by `/files`, §8),
|
|
108
116
|
a boolean, an integer or a decimal (a value with a fraction), or a list of ids (§6). A value not its
|
|
109
117
|
form is refused in words.
|
|
110
118
|
- **A field is needed** if every add gives it. A story more that leaves it out lets it go:
|
|
111
|
-
`bun run compile` says so, naming the story.
|
|
119
|
+
`bun run compile` says so, naming the story. Where no story adds an item (a race's fleets, only replaced), the
|
|
120
|
+
seed's items are all there are: a field every one of them has is typed as there (`JFleetData.start: string`),
|
|
121
|
+
though its column is as a field no add needs.
|
|
112
122
|
- **An op is allowed** only if a story does it.
|
|
113
123
|
- **A field may be removed** if a story removes it (`remove /events/2/location`) and it isn't
|
|
114
124
|
needed.
|
|
115
125
|
- The compiler refuses, naming the story:
|
|
116
126
|
- a field typed two ways;
|
|
117
|
-
- a name that can't be an attribute
|
|
127
|
+
- a name that can't be an attribute, or is every HTML element's own (`class`, `style`, `hidden`, `id`, `slot`,
|
|
128
|
+
`part`, `lang`, `dir`…): an item's fields are its element's attributes, so a boat's class is its `design`;
|
|
129
|
+
- a link's name given otherwise in another document of the app (a race's crossings' `boat` a link to boats, an
|
|
130
|
+
entry's `boat` a string), naming both: a link's name is its own wherever the app says it;
|
|
118
131
|
- a path no op can have;
|
|
119
132
|
- a list of ids named for no collection;
|
|
120
133
|
- an empty list nothing else types;
|
|
121
|
-
- a collection that isn't a regular
|
|
134
|
+
- a collection that isn't a plural (one the compiler knows: regular, or those above);
|
|
122
135
|
- two documents with a collection of one name.
|
|
123
136
|
|
|
124
137
|
Working: `examples/trip/stories.jsonl`; the model's rules in `tests/compile.test.ts`.
|
|
@@ -138,7 +151,7 @@ Working: `examples/trip/stories.jsonl`; the model's rules in `tests/compile.test
|
|
|
138
151
|
- **The collection's element** (`JEvents`, defined there): `items`, and `add(...values)`, one write
|
|
139
152
|
for them all, each a `JEventValue`: the fields as the stories write them, a dotted one nested (`terms: { days
|
|
140
153
|
}`), and a link to one item its id or an add's before it in the same write (`"$1"`, the till's lines naming
|
|
141
|
-
their order). On a page it holds its document (§7). An app's own `write(el, ops)` is typed the same.
|
|
154
|
+
their order); a list of ids may hold one too (`papers: [4, "$1"]`: an add and the line naming it, one write). On a page it holds its document (§7). An app's own `write(el, ops)` is typed the same.
|
|
142
155
|
- **The item's element** (`JEvent`, defined by the page, as it is or extended by a view, §4):
|
|
143
156
|
- `key`, `path` and `data` (its fields, read from its attributes; a missing number reads as
|
|
144
157
|
`undefined`, a boolean as `false`, a list as `[]`);
|
|
@@ -155,6 +168,45 @@ Working: `examples/trip/stories.jsonl`; the model's rules in `tests/compile.test
|
|
|
155
168
|
sent from any element of it; its ops typed as the stories allow them (`<Doc>Op`), so one they don't
|
|
156
169
|
is a type error; it returns the write's answer too. Working: `tests/fixtures/ledger/page.ts`.
|
|
157
170
|
|
|
171
|
+
- **`rows.ts`:** a display for each collection, rows, drawn by `joined/rows` as this file says it: nothing is
|
|
172
|
+
guessed as it runs. It exports a class each (`JEventsRows`, its tag `j-events-rows`) and defines none: the page
|
|
173
|
+
does, `define(JEventsRows)` from `joined/rows`, as it is or extended, as an item's element is the page's to define.
|
|
174
|
+
- **A row** is its item's title (the first words an add needs, else its first words), where it's got to beside
|
|
175
|
+
it as a tag (a `moves` field), and under it what else it holds, as each reads: a number, a time, what a link is to,
|
|
176
|
+
people as their faces; a yes or no is a tick at its start, kept at once. At its end, what its person may do there, by its `may`: a
|
|
177
|
+
`mine` list pressed to be in it, the faces of those who are and how many (the lists it's said with taken back
|
|
178
|
+
in the same write); each step a `moves` field may take ("Mark settled").
|
|
179
|
+
- **Under it,** the collection whose items are each of one of its own (an add needs a link to one: an option's
|
|
180
|
+
`question`), where the page puts that collection's element in the rows too
|
|
181
|
+
(`<j-questions-rows><j-questions></j-questions><j-options></j-options></j-questions-rows>`): each item's own
|
|
182
|
+
beneath it, a way to add one there (the link given, never asked), and a note where there are none. One deep.
|
|
183
|
+
- **Tapped, its drawer:** the fields its person may change, its title first, each asked by its type (a tick, a
|
|
184
|
+
number, a time; a link to one chosen from six or fewer as a select, from more by typing: design.md's
|
|
185
|
+
Choosing), a `Draft` until Save, one write; Remove at its foot, asked first. What's open is in the hash
|
|
186
|
+
(`#option=2`). Add opens it empty, Save off until it has what an add needs. What the server fills is said,
|
|
187
|
+
never asked.
|
|
188
|
+
- **To extend it,** a class of the page's own: `class Options extends JOptionsRows { label(f) { … } }`, then
|
|
189
|
+
`define(Options)`. Each part is a method: `label(field)` (what it's called: its name, until the page says its
|
|
190
|
+
words), `named(item)`, `says(item, field)` (how one field reads), `facts(item)`, `deeds(item)` (call `super`
|
|
191
|
+
and add one), `step(field, to)` (a step's words), `row(item)` (the row whole), `asks(spec)` (the drawer's
|
|
192
|
+
fields, in order); `static sheets` adds stylesheets. **To restyle it,** its parts from the page's own
|
|
193
|
+
stylesheet: `j-options-rows::part(title)` (`list`, `row`, `open`, `title`, `state`, `facts`, `deeds`, `mine`,
|
|
194
|
+
`step`, `add`, `under`, `none`, `drawer`). **To replace it,** don't define it: a display of the app's own
|
|
195
|
+
holds the same elements (§5).
|
|
196
|
+
- **From the model alone,** with nothing said by the app (`examples/notes/page.ts` is twenty lines): a time (a
|
|
197
|
+
date and time, an instant) is a mention under the row's words, and tapped pops its month, small (`<j-month
|
|
198
|
+
small>`), whose button opens the page's month where `<j-views>` holds one. The rows are a list: read as a board
|
|
199
|
+
or a month, they're held in `<j-views>` beside `<j-board>` and `<j-month>` (§17, `examples/notes/index.html`).
|
|
200
|
+
Where a collection put in the rows is each member's own number for an
|
|
201
|
+
item (`mine: {"ranks": {"of": "note", "by": "by"}}`), the list is in my order (a grip, the arrow keys), another's
|
|
202
|
+
or everyone's (`?order=3`, `?order=all`); a collection an add needs only its name for is added by a box on the
|
|
203
|
+
page; the row whose drawer is open is marked. Each is a method to override (`pops`, `timed`, `below`,
|
|
204
|
+
`grip`, `adder`), and `adds(collection, under)`, whether Add is offered there: an app says no where its own
|
|
205
|
+
rules (its `trust.ts`) would refuse the add, so it's never offered and then refused. An item opens in its collection's `<j-sheet>`, the page's, or one put on the page. Working: `tests/compiled.test.ts`.
|
|
206
|
+
- Not drawn yet in a row: one of an object's fields, a list of ids that isn't `mine` (people's are faces, others
|
|
207
|
+
counted, neither chosen), a file, a place; a field emptied is left as it was. (In its sheet a file is joined's
|
|
208
|
+
attachment, in the drawer and in the add modal alike.)
|
|
209
|
+
Working: `tests/rows/choices/` (its page extends one, for two words), `tests/rows.test.ts`.
|
|
158
210
|
- **`migrations/NNN-<what>.ts`,** in `src/migrate.ts`'s words (`createTable`, `addColumn`…), when the stories
|
|
159
211
|
say more than the migrations so far: a collection is a table, a field a column (null where a story
|
|
160
212
|
or the seed may leave it out), a list of ids a table of pairs, `<collection>_<field>`. The same
|
|
@@ -218,15 +270,16 @@ is for what no role can say. No story's field may be named `key` or `may`. Worki
|
|
|
218
270
|
|
|
219
271
|
Words are changed in a drawer (`.drawer`, a part: `src/parts.css`), or a form on the page: it holds them as a
|
|
220
272
|
draft, as the document has them until they're changed there, and Save sends the changes in one
|
|
221
|
-
`replace()`; Never mind puts them back. Taking one away asks first, in a `<dialog>`: `askFirst(dialog)`
|
|
222
|
-
from `joined/parts` wires its Never mind (`keep`) and its deed (`sure`),
|
|
223
|
-
`
|
|
273
|
+
`replace()`; Never mind puts them back. Taking one away asks first, in a `<wa-dialog>`: `askFirst(dialog, words, follows)`
|
|
274
|
+
from `joined/parts` wires its Never mind (`keep`) and its deed (`sure`), puts a line under the question saying what
|
|
275
|
+
follows (`GONE` unless said), and returns the way to ask it, `ask(question, deed, follows?)`; `askOnPage(question,
|
|
276
|
+
deed, words?, follows?)` asks in the page's own, for a row in the page. The page's line, `#said`, says a request's refusal, emptied as the next is sent:
|
|
224
277
|
`said(line)`, from `joined/parts`. A page's reading (a filter, a calendar or a line) is in its address's query, `?view=line`, read as it loads and
|
|
225
278
|
said with `history.replaceState` as it changes, so a link opens it so (`examples/trip/page.ts`, `address`). What's
|
|
226
279
|
open in a drawer is in the URL's hash (`#event=2`), so Back closes it
|
|
227
280
|
and a link opens it: `inHash(name, items, picked, show, signal?)` from `joined/parts` returns `mark(key)`, called as one
|
|
228
|
-
is opened or closed, and `again()`, called as the items change, to open one named before it was there (the
|
|
229
|
-
`<
|
|
281
|
+
is opened or closed, and `again()`, called as the items change, to open one named before it was there (the kit's
|
|
282
|
+
`<j-sheet>`). Its `signal` lets it go with the display.
|
|
230
283
|
|
|
231
284
|
The draft is `Draft` from `joined/draft`, given the form (Save named `go`, Never mind `never`) and
|
|
232
285
|
its note. `fill(saved, afresh)` sets the controls as the document has the item: afresh, all of
|
|
@@ -249,8 +302,8 @@ Working, smallest first:
|
|
|
249
302
|
how many are left.
|
|
250
303
|
- `examples/people/view.ts` (a person's row), `links.ts` (what links to them, kept as links come and go), `order.ts`
|
|
251
304
|
(dragged by a grip), `adding.ts` (the page's form).
|
|
252
|
-
-
|
|
253
|
-
|
|
305
|
+
- The kit's `<j-sheet>` (§17): a `Draft` grown, in a drawer, a field for each kind (a time and how long, a zone, a
|
|
306
|
+
place searched, people as chips); the trip's events are edited in it.
|
|
254
307
|
|
|
255
308
|
A file field (a post's photo, a PDF) is `attachment(doc, put, take?)` from `joined/attachment`: `el` to append, and
|
|
256
309
|
`draw(value, { put, take })` called from the view's `draw()` with the item's value and its `may`
|
|
@@ -261,7 +314,7 @@ or an add form's field); `take` is `this.removeField("attachment")`. A photo or
|
|
|
261
314
|
|
|
262
315
|
## 5. A display: a collection drawn in a shadow
|
|
263
316
|
|
|
264
|
-
A display holds the collection's element as its child (`<
|
|
317
|
+
A display holds the collection's element as its child (`<kitchen-rail><j-orders></j-orders></kitchen-rail>`).
|
|
265
318
|
It never shows it, and draws its items in its shadow DOM:
|
|
266
319
|
|
|
267
320
|
- **Watch it** with a `MutationObserver` on itself (`childList`, `subtree`, `attributes`). Its
|
|
@@ -287,6 +340,9 @@ It never shows it, and draws its items in its shadow DOM:
|
|
|
287
340
|
name, asked of Photon); the form asks only the rest.
|
|
288
341
|
- **Its look** is its own stylesheet, adopted in the shadow (§9). Its icons go in with
|
|
289
342
|
`iconify(this.#root)` (§10).
|
|
343
|
+
- **Words in a drawing scaled by its `viewBox`** are sized in the drawing's units, so `font: var(--font-small)` there
|
|
344
|
+
shrinks or grows with the scale. Put the words over the drawing in HTML, where joined's type is as it says; or set
|
|
345
|
+
the text's `font-size` in the drawing's own units, from the scale it's drawn at (a custom property on the host).
|
|
290
346
|
- **Another display's request** comes as an event on the item: `pick`, bubbling, is how the
|
|
291
347
|
people's links pick an event on the calendar.
|
|
292
348
|
- **Who changed it, and by what:** each change put on the page fires `changed` on every element it left changed (an
|
|
@@ -297,11 +353,8 @@ It never shows it, and draws its items in its shadow DOM:
|
|
|
297
353
|
|
|
298
354
|
Working: `examples/cafe/kitchen.ts`, the smallest (about 130 lines: tickets kept by `keep` in columns, a ticket made
|
|
299
355
|
again only as its order changes, the waits each minute), and `examples/cafe/rail-drag.ts`, the smallest drag (30
|
|
300
|
-
lines, `follow` and `held`); `examples/trip/
|
|
301
|
-
|
|
302
|
-
`peek.ts`, `drawer.ts` and `writes.ts` (the form's drawer and its writes), `drags.ts` (what a hand gives), `holding.ts`
|
|
303
|
-
(its events, read once a change), `told.ts` (the lists it's told of), `bar.ts`, `other-weeks.ts`, `shell.ts`; and
|
|
304
|
-
`src/members/panel.ts`. **One concept a file, under 250 lines** (`tests/examples.test.ts` holds every example to it).
|
|
356
|
+
lines, `follow` and `held`); `examples/trip/line.ts`, a reading of the kit's (`Reading`, `joined/kit`) grown: its
|
|
357
|
+
week's stops (`line-stops.ts`, `line-words.ts`), the lists it's told of (`told.ts`); and `src/members/panel.ts`. **One concept a file, under 250 lines** (`tests/examples.test.ts` holds every example to it).
|
|
305
358
|
|
|
306
359
|
## 6. Links between documents
|
|
307
360
|
|
|
@@ -318,8 +371,8 @@ event's `people: [1, 3]`. The name is the rule, not a guess.
|
|
|
318
371
|
only the ids added and taken.
|
|
319
372
|
- **On the page it's an IDREFS attribute,** `people="1 3"`, so CSS finds the links:
|
|
320
373
|
`[people~="2"]` is everything that links to person 2, in any document.
|
|
321
|
-
- **A display watches the linked document** too: `<
|
|
322
|
-
people are, and observes it.
|
|
374
|
+
- **A display watches the linked document** too: `<trip-line people="the-people">` names where the
|
|
375
|
+
people are (by an id of its own: on a phone a sheet's content moves into its drawer), and observes it.
|
|
323
376
|
|
|
324
377
|
Working: the trip's events and `examples/people/links.ts` (what links to a person, kept as links come and go, and
|
|
325
378
|
`pick`); within one document, a line's `order` (`examples/cafe/views.ts`).
|
|
@@ -342,7 +395,8 @@ and the `away` event; `back` when it returns; the group's button says "· back s
|
|
|
342
395
|
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
396
|
sender answered at once, and the page told what's waiting (`body[data-waiting]`, the `waiting` event, the group's
|
|
344
397
|
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.
|
|
398
|
+
and one refused then is said in the toast and let go. Each is sent with its own id (`kept`), so one the server made
|
|
399
|
+
already (its answer lost as the signal went, or sent by two tabs from the one device) is answered done, not made twice. Anything else it sends is refused at once (an edit made away
|
|
346
400
|
could overwrite what changed meanwhile: a Draft keeps it to save again), and it comes back by itself, each document
|
|
347
401
|
put in place by key. Only
|
|
348
402
|
the server closing it on purpose, or the door refusing it, signs it out. A write refused, draw again,
|
|
@@ -401,7 +455,10 @@ export const routes = (read: Read) => ({ "/trip/:n": page, "/trip/:n/trip.ics":
|
|
|
401
455
|
stories (`doc`, `from`, `derive(read, member)`; its `routes.ts` re-exports `derive`) and an example,
|
|
402
456
|
`<doc>.json`, its shape: elements with no ops, every write refused. The server derives it for each
|
|
403
457
|
page's member as it's joined, and again after a write to what it's read from, sending it whole where it's
|
|
404
|
-
changed.
|
|
458
|
+
changed. Its fields are its items' attributes, so never a capital (`likeName` is refused: it would arrive
|
|
459
|
+
`likename`). Two derived documents may each derive one kind of item (`spans`) only where it's the same, field for
|
|
460
|
+
field: one element for both. `tests/fixtures/statement`. Where a query can say it, it's a read-only document by member (`documents`,
|
|
461
|
+
§15) and not a `derive.ts`: `examples/weeks` is.
|
|
405
462
|
- **The root's page** is `examples/routes.ts`.
|
|
406
463
|
|
|
407
464
|
Working: `examples/hello/routes.ts`, the smallest; `examples/cafe/routes.ts` (an app of several documents:
|
|
@@ -431,14 +488,26 @@ Working: `examples/hello/routes.ts`, the smallest; `examples/cafe/routes.ts` (an
|
|
|
431
488
|
|
|
432
489
|
## 9. Stylesheets
|
|
433
490
|
|
|
491
|
+
- **How the look is built,** `docs/design.md`'s last section, six rules each held by a test on every page: hidden
|
|
492
|
+
always hides (never `hidden` to keep a thing's room); joined's class names (`bar`, `brand`, `lead`, `note`, `act`,
|
|
493
|
+
`danger`, `icon-only`, `said`, `drawer`, `sheet`) mean joined's parts, so an app names its own thing otherwise;
|
|
494
|
+
layers decide, never specificity; into a shadow by its parts alone (`j-sheet::part(field-accountants)`,
|
|
495
|
+
`j-week::part(item)`, `j-views::part(tab-papers)`), never script; tokens only, a control's words a field's size;
|
|
496
|
+
and every page looked at whole, wide and on a phone.
|
|
434
497
|
- **What the look is,** `docs/design.md`: the surfaces, colour, a chip, a pin, type, icons, layout and
|
|
435
498
|
the parts. Read its section for what you draw; this section is how to draw it here.
|
|
436
499
|
- **Every page's layout,** `src/page.css` (`joined/page.css`), linked after the tokens: the body, `h1`, `h2`,
|
|
437
500
|
`.note`, `.bar`, `#said`, and `main` hidden signed out and dimmed away. A page's own look comes after it.
|
|
438
|
-
- **The parts,** `src/parts.css`, once: buttons, fields, labels, the drawer (`.drawer`), the
|
|
439
|
-
(
|
|
440
|
-
page and every shadow (`src/parts.ts`; a display's: `adopt(this.#root, SHEET)
|
|
441
|
-
|
|
501
|
+
- **The parts,** `src/parts.css`, once: buttons, fields, labels, the drawer (`.drawer`), the sheet
|
|
502
|
+
(`.sheet`, a popover with a title and its ×), a fixed foot (`.j-foot`), and how Web Awesome's parts sit in
|
|
503
|
+
joined's look. Adopted by the page and every shadow (`src/parts.ts`; a display's: `adopt(this.#root, SHEET)`).
|
|
504
|
+
- **Web Awesome** (`src/awesome.ts`, imported by the kit and the parts) is the modal (`wa-dialog`), a phone's
|
|
505
|
+
drawer and sheet (`wa-drawer`, by `Surface`, `joined/surface`), the toast, the peek (`wa-popover`), a tick
|
|
506
|
+
(`wa-checkbox`), words and numbers (`wa-input`, `wa-textarea`, `wa-number-input`), a choice of a few
|
|
507
|
+
(`wa-select`), tabs, a card (`wa-card`) and a refusal in place (`wa-callout`). A field of Web Awesome's draws a
|
|
508
|
+
moment after it's given a value: name it by attribute (`setAttribute("name", …)`), set a choice by `choose()`
|
|
509
|
+
and read it by `chosen()` (`joined/draft`), and wait for its `updateComplete` before asking a form if it's
|
|
510
|
+
valid. A button with words is `.act` (`.ink`, `.danger`, `.quiet`), one with
|
|
442
511
|
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
512
|
only how it sits (`flex: 1`).
|
|
444
513
|
- **An app's rule wins over joined's:** the parts, the page's layout and the group's look are a layer, `joined`,
|
|
@@ -449,11 +518,12 @@ Working: `examples/hello/routes.ts`, the smallest; `examples/cafe/routes.ts` (an
|
|
|
449
518
|
parts: `members-panel::part(sheet)` (`bar`, `who`, `notice`, `sheet`, `menu`, `ask`, `waiting`).
|
|
450
519
|
- **How it moves,** `src/tokens.json`'s motion (`--rise`, `--fall`, `--ask`, `--ask-out`, `--drop`): a drawer or a
|
|
451
520
|
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
|
|
453
|
-
|
|
454
|
-
motion or scrim of an app's own.
|
|
455
|
-
- **Type** is
|
|
456
|
-
`heading`, `title`, `row`, `label`, `tool`, `small`, `tiny`, `field`)
|
|
521
|
+
a phone a drawer and a sheet are Web Awesome's `wa-drawer` (rounded at the top, a grabber), the page dimmed
|
|
522
|
+
behind by its scrim, a tap on it closing the drawer on top; Web Awesome's surfaces move as it moves them. Never a
|
|
523
|
+
surface's motion or scrim of an app's own.
|
|
524
|
+
- **Type** is thirteen styles, each a font in `src/tokens.css`: `font: var(--font-row)` (`display`, `lead`,
|
|
525
|
+
`section`, `name`, `body`, `heading`, `title`, `row`, `label`, `tool`, `small`, `tiny`, `field`), and a family,
|
|
526
|
+
`--sans` or `--mono`. Never a size by hand. A control's words (`tool`, `row`) are a field's size, 16px.
|
|
457
527
|
- **The colours,** `src/tokens.css` (`--paper`, `--card`, `--ink`, `--muted`, `--line`, `--edge`, `--add`,
|
|
458
528
|
`--danger`, `--scrim`, `--tint`…), light and dark, linked by every page before `app.css`. Every colour
|
|
459
529
|
is one of them, in a shadow too: custom properties pass into it. An app's own palette is named once, as properties
|
|
@@ -473,7 +543,7 @@ Working: `examples/hello/routes.ts`, the smallest; `examples/cafe/routes.ts` (an
|
|
|
473
543
|
|
|
474
544
|
```ts
|
|
475
545
|
import { adopt } from "joined/parts";
|
|
476
|
-
import STYLE from "./
|
|
546
|
+
import STYLE from "./line.css" with { type: "text" };
|
|
477
547
|
const SHEET = new CSSStyleSheet(); SHEET.replaceSync(STYLE);
|
|
478
548
|
adopt(this.#root, SHEET); // joined's parts, then its own
|
|
479
549
|
```
|
|
@@ -483,7 +553,7 @@ Working: `examples/hello/routes.ts`, the smallest; `examples/cafe/routes.ts` (an
|
|
|
483
553
|
|
|
484
554
|
Working: `examples/app.css`, `examples/cafe/cafe.css` (a page's look over joined's parts),
|
|
485
555
|
`examples/cafe/kitchen.css` (a display's own palette, named once on `:host`), `examples/people/people.css`,
|
|
486
|
-
`examples/trip/
|
|
556
|
+
`examples/trip/line.css`.
|
|
487
557
|
|
|
488
558
|
## 10. Icons
|
|
489
559
|
|
|
@@ -536,12 +606,20 @@ Working: `src/icons.ts`; the members panel and every example.
|
|
|
536
606
|
- **To act for Peter,** use an agent's link he made, labelled (as `claude`). Its writes are his,
|
|
537
607
|
`via` the label, and it holds none of his keys.
|
|
538
608
|
- **The MCP door** (`src/mcp.ts`): an agent's link is a custom connector for Claude in a chat (claude.ai, a
|
|
539
|
-
phone), and the Agents tab copies it so: `POST /mcp/<its token>`, MCP's Streamable HTTP in plain JSON. Only an agent's token opens it.
|
|
609
|
+
phone), and the Agents tab copies it so: `POST /mcp/<its token>`, MCP's Streamable HTTP in plain JSON. Only an agent's token opens it. It speaks both
|
|
610
|
+
eras of MCP: the modern (2026-07-28: no handshake, each request's version and capabilities in its `_meta`, its
|
|
611
|
+
headers checked against its body, `server/discover`) and the legacy, opened by `initialize` (2025-06-18 and
|
|
612
|
+
before), which Claude's apps and Gemini CLI use today. Its tools are
|
|
540
613
|
written from the compiled rules: `read_<doc>` (as its member sees it; whole, or a `collection`'s items, some by
|
|
541
614
|
`ids`) and `write_<doc>` (one write, ops typed as the grants allow, in anyOf and enum as a strict client reads
|
|
542
615
|
them, a link's id a number or `"$1"`, answered `{ done, version, ids }` or a tool error in the refusal's words); a
|
|
543
|
-
kind's take `key`; a window isn't one (read the document).
|
|
544
|
-
|
|
616
|
+
kind's take `key`; a window isn't one (read the document). The door carries its own skill, how any document is
|
|
617
|
+
read and written there (`.claude/skills/joined-door/SKILL.md`, the one text, `src/skill.ts`): by MCP's skills
|
|
618
|
+
extension (`io.modelcontextprotocol/skills`, declared in `server/discover`; `skills/list`, `skills/get`, the
|
|
619
|
+
resource `skill://joined-door/SKILL.md`), and in its instructions, where a client doesn't say it loads skills
|
|
620
|
+
itself (one that does is told where the skill is). After it in the instructions come each app's words: its `routes.ts` may export `instructions`
|
|
621
|
+
(`examples/trip/routes.ts`), what's its own alone (what its documents mean, its people, its clock), never how a read
|
|
622
|
+
or a write goes. A change to how any document is read or written there changes that skill with it (`tests/mcp.test.ts`). Never print the token: the URL holds it. A project with no
|
|
545
623
|
members (every story anonymous, hello) has no group and no agent's link: its door is anyone's, `POST /mcp` with no
|
|
546
624
|
token, as a stranger's page is, each write logged "by anyone" (`tests/server.test.ts`).
|
|
547
625
|
- **Never put `ROOT_TOKEN`, `.env`, the store (`joined.sqlite`, which holds the keys) or anyone's link in a commit,** nor in chat
|
|
@@ -559,8 +637,10 @@ Working: `src/members/`; `tests/sign-in.test.ts`; `tests/mcp.test.ts` (the door)
|
|
|
559
637
|
- `page(url, doc, token)` is a page's socket subscribed to `doc`, signed in or refused, with
|
|
560
638
|
`next(match)`, `subscribe(doc)` and `closed`. A page's first told may come before you listen: wait with
|
|
561
639
|
`toldOnSignIn` (`tests/sign-in.test.ts`).
|
|
562
|
-
- **The stories are told by who they say,** every app's and the group's: `expect(await tell(
|
|
563
|
-
(`tests/server.test.ts`).
|
|
640
|
+
- **The stories are told by who they say,** every app's and the group's: `expect(await tell(app)).toEqual([])`
|
|
641
|
+
(`tests/server.test.ts`). `tell` is by app folder, not by document: an app whose stories write several documents
|
|
642
|
+
(a race and its entries, in `apps/race/`) is told whole by `tell("race")`, and `tell("entries")` is refused,
|
|
643
|
+
saying whose stories write it. A story's `does` must pass, be heard by those it names, and leave what its
|
|
564
644
|
`then` says, and its `cannot` must be refused; `tell` says, a line each, any that didn't
|
|
565
645
|
(`tests/then.test.ts`).
|
|
566
646
|
- **What isn't an op** (the sign-in routes, links, notices, agents) is tested in
|
|
@@ -631,7 +711,7 @@ Working: `src/members/`; `tests/sign-in.test.ts`; `tests/mcp.test.ts` (the door)
|
|
|
631
711
|
whole width. Met on the Stays sheet, 2 Nov 2026.
|
|
632
712
|
- **A search on a change's path costs what the page holds:** `querySelector` on a display's shadow seeks past every
|
|
633
713
|
block before the part it wants, and on the document past every item. Keep a display's own parts once found, and
|
|
634
|
-
read a kind of element from a live list (`getElementsByTagName`). `bun run
|
|
714
|
+
read a kind of element from a live list (`getElementsByTagName`). `bun run scale` times it; Chrome's profiler
|
|
635
715
|
(`view.cdp("Profiler.start")`) says where. Met on the trip, 2 Nov 2026: 1.8 ms a change at 100,000 events, now 0.4.
|
|
636
716
|
- **Bun writes nothing copying a file into one it's asked `exists()` of** (`Bun.write(file, Bun.file(from))`, Bun
|
|
637
717
|
1.4.4): write to the path instead. `joined init` made every file empty, met on its first try from the packed
|
|
@@ -644,6 +724,20 @@ Working: `src/members/`; `tests/sign-in.test.ts`; `tests/mcp.test.ts` (the door)
|
|
|
644
724
|
declared after it is made. The people's view threw on every load, unseen, and after its fix a helper declared below
|
|
645
725
|
the define waited for a page served with links in it. `tests/examples.test.ts` refuses a declaration after a
|
|
646
726
|
define; the pages test's "every page loads without an error thrown" (Chrome) catches what throws.
|
|
727
|
+
- **A font in a scaled SVG is in the drawing's units,** not the page's: `font: var(--font-small)` on a `<text>` in a
|
|
728
|
+
`viewBox` of 1000 drawn 300 wide is a third of its size. Words go over it in HTML, or are sized in its units (§5).
|
|
729
|
+
Met on raceday, 30 Nov 2026.
|
|
730
|
+
- **Never restyle a pressed button:** a display's `[aria-pressed="true"] { background: var(--tint-strong) }` set
|
|
731
|
+
an invalid background (`--tint-strong` is a percentage, for `color-mix`), while the parts kept a pressed `.act`'s
|
|
732
|
+
words in `--card`: the words vanished. A choice that stays pressed is the parts' own `.act[aria-pressed]`, a few
|
|
733
|
+
side by side `.j-tabs`, chips `.j-chips`; a display says only how they sit (§9). Met on raceday, 30 Nov 2026.
|
|
734
|
+
- **What a tap overwrites is decided by the unique keys:** with one condition per tooth (`unique: conditions
|
|
735
|
+
[["tooth"]]`), a root filling written onto a crowned tooth replaced the crown, and the record was lost. Keyed by the
|
|
736
|
+
place and its own value (`[["tooth", "state"]]`), the two sit side by side. A tool writes the item its place and its
|
|
737
|
+
own value name, nothing else. Met on the dental chart, by Peter, 30 Nov 2026.
|
|
738
|
+
- **A picture in a shadow styled inline can't show state:** an inline `style` beats the rules that read an item's
|
|
739
|
+
state (`[data-crown="to do"]`), so the picture never changes. It draws itself by its own SVG `<style>`, its rules
|
|
740
|
+
reading the attributes. Met on the dental chart, 30 Nov 2026.
|
|
647
741
|
- **What an AI copies is the example the skill points it at,** traps and all: idea-cards copied the calendar's frame
|
|
648
742
|
and not its moving only what changed. Point at the smallest instance (the contents table), and fix a trap in the
|
|
649
743
|
example, not only here. Met 3 Nov 2026.
|
|
@@ -655,13 +749,19 @@ Working: `src/members/`; `tests/sign-in.test.ts`; `tests/mcp.test.ts` (the door)
|
|
|
655
749
|
file, `joined.sqlite` in the data folder (`DB`, from `JOINED_DB`; the folder from `JOINED_DATA`, or
|
|
656
750
|
`.data/`, which git ignores). Every app's tables are in it, the group's keys too, made by
|
|
657
751
|
migrations at start, joined's own first (`src/migrations/`), then the group's, then each app's.
|
|
658
|
-
- **Or Postgres
|
|
659
|
-
the
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
(`
|
|
663
|
-
|
|
664
|
-
|
|
752
|
+
- **Or Postgres:** a server, by its URL with its password (`JOINED_POSTGRES=postgres://user:password@host:5432/db`,
|
|
753
|
+
SCRAM and TLS as the URL says: that alone chooses it), or else (`JOINED_ENGINE=postgres`, or `start({ engine })`) PGlite in a
|
|
754
|
+
folder (`postgres/` in the data folder), or in memory. The engine (`src/engine.ts`) is awaited, on either:
|
|
755
|
+
the values go beside the SQL as parameters, one write at a time (on Postgres, by a lock every server takes), and
|
|
756
|
+
each commit is notified (`NOTIFY joined`), so several servers on one database tell their pages each other's
|
|
757
|
+
writes. The compiler writes each document's query, items and triggers in both dialects
|
|
758
|
+
(`generated/queries.ts`'s `postgres`). The stories are told on both (`tests/helpers.ts`'s `ENGINES`);
|
|
759
|
+
`fresh({ engine })` and `tell(doc, dir, engine)` take one. Old changes and unused files are let go on both;
|
|
760
|
+
joined vacuums and backs up a SQLite file alone (Postgres has its own).
|
|
761
|
+
- An app's rules, its `trust.ts`, `derive.ts`, reactions and routes read the documents at once, as they always
|
|
762
|
+
have (`read(doc)`, no await): joined reads each one they ask for first, and asks them again. A route's `write` is
|
|
763
|
+
awaited (`await write(doc, ops)`), and a route reads what it needs before it writes.
|
|
764
|
+
- A write is one transaction: its rows, the document's version, a row of its change
|
|
665
765
|
(`changes`: the ledger, and what a page catching up is sent), and the group's keys when a member
|
|
666
766
|
goes. Ids come from joined's sequences (`joined_sequences`): one is never handed out twice.
|
|
667
767
|
- A document new to the store begins from a `<doc>.json` in the data folder (from before the
|
|
@@ -674,7 +774,8 @@ Working: `src/members/`; `tests/sign-in.test.ts`; `tests/mcp.test.ts` (the door)
|
|
|
674
774
|
A change is kept 90 days (`JOINED_HISTORY`), and any of a document's last 500 for good (what a page
|
|
675
775
|
catching up is sent); an older one is let go before the vacuum.
|
|
676
776
|
The files the documents name are in `files/` beside it, as its backups are, or a bucket (`JOINED_FILES`:
|
|
677
|
-
`s3://<bucket>/<prefix>`, a prefix each site's own);
|
|
777
|
+
`s3://<bucket>/<prefix>`, a prefix each site's own); a kind that keeps its files apart (§15) keeps each instance's
|
|
778
|
+
in a folder of its own, `book-1/`; one no item and no kept change names is let go once it's
|
|
678
779
|
older than the history and the backups' week. A test's server has a files
|
|
679
780
|
folder of its own (`fresh()`).
|
|
680
781
|
To go back to one, stop joined and put it in the store's place, with no `-wal` or `-shm` beside it.
|
|
@@ -701,12 +802,22 @@ Working: `src/members/`; `tests/sign-in.test.ts`; `tests/mcp.test.ts` (the door)
|
|
|
701
802
|
- **`stories.jsonl`'s header lines**, after the cast, one a key (`{"owns":"owner | author"}`), say what the
|
|
702
803
|
stories can't show; the compiler alone reads them, refuses one no story checks, and writes them into
|
|
703
804
|
`generated/rules.ts` as code (`src/definitions.ts` says each key and the who-path):
|
|
805
|
+
- `title`: the field that names a collection's items (in a row, a chooser, a peek), where it isn't the first field
|
|
806
|
+
of words the stories give: `{"title": {"accounts": "name"}}`, never its code; refused if it isn't a field of words.
|
|
704
807
|
- `links`: a field linking though not named for its collection, a list (`{ owners: "members" }`) or one
|
|
705
808
|
id (`{ account: { to: "accounts", one: true } }`), in its own document or another's. A link may name an
|
|
706
809
|
item an add before it in the same write makes: the id the store will give it.
|
|
707
810
|
A list a link declares is typed by it, though every story gives it empty. `gone: "with"` on one id
|
|
708
811
|
(`{ post: { to: "posts", one: true, gone: "with" } }`): removing the post removes what links to it first, in
|
|
709
812
|
the same write, told to the pages as removals and undone with it; without it, the removal is refused.
|
|
813
|
+
`part: true` on one id (`{ order: { to: "orders", one: true, part: true } }`) says the link is structure (is a,
|
|
814
|
+
has a, composition), not a reference: a page places the item by it and never pops it; one `gone: "with"` is part
|
|
815
|
+
too. `holds` on a link to members names who it may name, a who-path of collections asked of the one named (not
|
|
816
|
+
the writer): `{ supplier: { to: "members", one: true, holds: "staff/posts[role=supplier]@members" } }`, any other
|
|
817
|
+
refused "supplier names someone who isn't among staff's posts with role supplier", checked by a cannot (the
|
|
818
|
+
cafe's "Peter can't order from Nora: she isn't a supplier"). What each field pops is written beside its collection, `collections.<name>.pops` (a value with a form:
|
|
819
|
+
`{ form: "date-time" }`; a reference: `{ to: "items" }`; a plain value or structure isn't in it): `docs/design.md`,
|
|
820
|
+
"A peek".
|
|
710
821
|
- `roles`: who someone is, a who-path each: `posts[role=keeper]@members`, `holdings@members`,
|
|
711
822
|
`members/members[!inviter]`, and in a kind `@owners`, the root item's; but an `@field` the item a write is to
|
|
712
823
|
has is the item's (a post's `@author` on a board, the board's `@owners`). Someone two roles to an item is told
|
|
@@ -723,20 +834,48 @@ Working: `src/members/`; `tests/sign-in.test.ts`; `tests/mcp.test.ts` (the door)
|
|
|
723
834
|
named for the kind. A collection element takes its document from its `doc` attribute: a page for each
|
|
724
835
|
(`/trip/:n`) sets it from its path (`examples/trip/page.ts`). A window is on an instance
|
|
725
836
|
(`trip:1?week=2026-11-02`); another window is held by putting a new collection element in place of the old
|
|
726
|
-
(the old one lets its window go), as the trip's page does a
|
|
727
|
-
`examples/trip`.
|
|
837
|
+
(the old one lets its window go), as the trip's page does a month (`examples/trip/page.ts`, `hold`). Working: `examples/trips` and
|
|
838
|
+
`examples/trip`. `kind: { root: "books", files: "apart" }` keeps each instance's files in a folder of its own
|
|
839
|
+
(`book-1/<name>`, never served by its name alone), and `/export/book-1` hands it back to whoever is on it: a tar of
|
|
840
|
+
its document, its root item and its files. Any instance's file is served at `/files/book-1/<name>`
|
|
841
|
+
(`fileUrl(value, doc)`) only to who holds it and sees an item naming it. Working: `tests/apart`.
|
|
728
842
|
- `fills: { cards: { added: "now" }, boards: { count: 0 } }`: a field the server fills on every add,
|
|
729
|
-
which no story gives (`"now"`, the instant; `"me"`, the member who adds it: a post's author); the server's alone, so a page giving or replacing it is
|
|
843
|
+
which no story gives (`"now"`, the instant, or a wall clock, below; `"me"`, the member who adds it: a post's author); the server's alone, so a page giving or replacing it is
|
|
730
844
|
refused, and a route's write or a reaction keeps it (a count, a total). But `"random"`, a code: a story may
|
|
731
845
|
replace it (`{"op":"replace","path":"/boards/1/code","value":"new"}`, granted its teller's role), and the server
|
|
732
846
|
makes the new code, whatever the write gives, before it's checked and kept: told and kept, twelve of a URL's own
|
|
733
847
|
characters. A board's secret link made new: the old one opens nothing (`tests/visitors`).
|
|
848
|
+
**`"now"` is as its field is:** where the seed gives the field wall clocks (`"at": "2026-07-01T12:41:07"`, no `Z`),
|
|
849
|
+
it's one too, on the clock of its zone, so it stands beside the times kept so (a crossing beside its start). The
|
|
850
|
+
zone is a field named `zone` (a time zone, `Europe/London`): the item's own where it gives one, else its kind's
|
|
851
|
+
root's (a board's), else the document's own (`/zone`). No such field, and it's refused as it compiles; none said
|
|
852
|
+
when it's added, and the add is refused. No seed of it, and it's an instant. Working: `tests/fixtures/regatta`,
|
|
853
|
+
`tests/fixtures/tide` (`tests/clock.test.ts`). A store that kept it as an instant before has rows a wall clock's
|
|
854
|
+
CHECK refuses: put them on the clock in a migration of their own, before the compiler's.
|
|
855
|
+
- `notEmpty: { notes: ["text"] }`: fields of words that are never none, nor only spaces, whoever writes them,
|
|
856
|
+
refused "text cannot be empty" (a trigger, in both databases; no migration, and a row that's empty already is left
|
|
857
|
+
until it's changed). Checked by a cannot refused in those words. Working: `examples/notes/stories.jsonl`.
|
|
734
858
|
- `timed: { cards: "due" }`: an instant the stories give; when it comes the server clears it, as its own
|
|
735
859
|
write, and the app's reactions do what follows (a clock's next tick sets it again).
|
|
736
860
|
- `unique: { people: ["name"] }` (or fields together, `[["hotel", "name"]]`) and
|
|
737
861
|
`noOverlap: { stays: { range: ["from", "until"], same: ["room"] } }` (half open; the end a time, a
|
|
738
862
|
number, or a duration on from the start): asked once a write is done, in its transaction, of each item it
|
|
739
863
|
touched, and refused in words (`people 3 has that name already`), none of it landed.
|
|
864
|
+
- `mine: {"tasks": [["ups", "downs"]]}`: lists of members that are each member's own: a member gives and takes
|
|
865
|
+
only their own id (`ups is each member's own to give`), however it's written (an id, the list whole, an item
|
|
866
|
+
added with it); lists said together (`[["ups", "downs"]]`, or one alone, `["going"]`) hold nobody twice on an item,
|
|
867
|
+
asked once the write is done, so a thumb turns over in one write (`tasks 3 has someone in two of ups and downs:
|
|
868
|
+
take one back first`). A thumb, a vote, who's coming: never a `trust.ts`. Checked by a `cannot` writing each
|
|
869
|
+
list. Working: `examples/desk/stories.jsonl`, `tests/mine.test.ts`.
|
|
870
|
+
A link to one member is one too: `mine: {"people": ["member"]}`, which person you are, set only to its writer and
|
|
871
|
+
taken back only by them. A field may say its own words: `{"people": [{"member": "you say which person you are, as
|
|
872
|
+
yourself"}]}`. Working: `examples/people/stories.jsonl`.
|
|
873
|
+
Or a collection of values, each one member's for one item of another: `mine: {"ranks": {"of": "note", "by":
|
|
874
|
+
"by"}}`, my place for a note, my rating, my word on it. `of` and `by` are links to one (`by` a member's); the
|
|
875
|
+
server fills `by` with its writer, a member has one for an item at most, and only they change or remove theirs
|
|
876
|
+
("ranks are each member's own to change"). Everyone sees them: a page reads the list in my order, another's or
|
|
877
|
+
everyone's. Held to a cannot story that changes another's. The compiled rows never draw one as rows. Working:
|
|
878
|
+
`examples/notes/stories.jsonl`, drawn by the compiled rows (`tests/compiled.test.ts`).
|
|
740
879
|
- `window` and `order`: a part of a collection a page may hold alone, and a collection held in a number's order
|
|
741
880
|
(§8).
|
|
742
881
|
- `copies: {"lines": {"from": "item", "fields": ["name", "price"]}}`: fields an item takes from what one of its
|
|
@@ -779,17 +918,41 @@ Working: `src/members/`; `tests/sign-in.test.ts`; `tests/mcp.test.ts` (the door)
|
|
|
779
918
|
refused in its words; and a waits step no story adds. A story's premise may write the root (freeze it, then the
|
|
780
919
|
cannot). Asked after trust.ts and the grants; a route's write or a reaction isn't asked them. Working:
|
|
781
920
|
`tests/settings`.
|
|
921
|
+
- `frozen` of an item, by collection: kept as it is once it's settled, by its own yes-or-no field:
|
|
922
|
+
`{"frozen": {"supplies": {"by": "delivered", "fields": ["price", "terms"], "refused": "a delivered supply keeps its
|
|
923
|
+
price and terms"}}}`, those fields (an object's, each of its own; none named, all of them) changed by no write while
|
|
924
|
+
it's true. A trigger in the database, SQLite's and Postgres's, refused in its words.
|
|
925
|
+
- `addedWith`: an item added only in the write adding what a link of it points at, never after: `{"addedWith":
|
|
926
|
+
{"lines": {"order": "an order's lines are set when it's placed"}}}`. A trigger, in both: the item linked to is one
|
|
927
|
+
the write added (the rows a write changed, `joined_touched`).
|
|
928
|
+
- `within` and `apart`: an item's lists as the write leaves them. `{"within": {"events": [{"lists": ["keen", "asked",
|
|
929
|
+
"declined"], "of": "people", "refused": "an answer is from someone on the event"}]}}`: each id of those lists is in
|
|
930
|
+
its `of` list too; `{"apart": {"events": [{"lists": ["keen", "asked", "declined"], "refused": "one answer each"}]}}`:
|
|
931
|
+
no id is in two of them. SQLite holds them by code once the write is done (`listsHold`, generated); Postgres by a
|
|
932
|
+
constraint trigger that waits for the write's end (the store settles it then), so a list replaced whole, or an id
|
|
933
|
+
moved from one list to another, is held as it lands. Working: `examples/trip/stories.jsonl`.
|
|
934
|
+
Each of these is checked by a `cannot` refused in its words.
|
|
782
935
|
- `where`: which rows each of an app's several documents holds, and who may hold it at all: `{"kitchen":
|
|
783
936
|
{"holds": "kitchen | manager", "orders": {"status": ["placed", "being made", "ready"]}}}`; `last` and `by` keep only
|
|
784
937
|
the newest so many; a collection's name in place of the fields, the rows linking to those (an order's lines).
|
|
785
938
|
- `documents`: a read-only document worked out by member: `{"books": {"entries": {"from": "supplies", "when":
|
|
786
939
|
"delivered", "sides": {"buyer": "bought", "supplier": "sold"}, "fields": ["title", "buyer", "supplier"], "total": {"sum": "qty",
|
|
787
940
|
"times": "price"}}}}`, each side's books. A sum by member is this; a split (a cost divided among a group) isn't
|
|
788
|
-
a definition: work it out on the page, from the items, as a pure function
|
|
941
|
+
a definition: work it out on the page, from the items, as a pure function in a file of its own, tested alone.
|
|
942
|
+
Or rows counted by what they link to and their week: `{"weeks": {"weeks": {"from": "events", "by": {"trip":
|
|
943
|
+
"trips"}, "seen": ["organisers", "travellers"], "week": "start", "count": "events"}}}`, each trip the member is
|
|
944
|
+
on (a list of that trip's naming them), its events by the Monday of their week, numbered in order: items `id`,
|
|
945
|
+
`trip`, `week`, `events`. A document in a folder of its own is said in that folder's `stories.jsonl` alone, its
|
|
946
|
+
files unprefixed (`examples/weeks`).
|
|
789
947
|
- **`<app>/trust.ts`**, exported from `routes.ts` (`export { trust } from "./trust.ts"`), is the app's own
|
|
790
948
|
rule over a whole write, reading any document: `(write, { member, roles }, read) => why | null`. It's
|
|
791
949
|
asked first, so a refusal is in its words; it reads the ops as sent, before they're checked. It's asked
|
|
792
|
-
when the group is open too, of nobody (`member` 0).
|
|
950
|
+
when the group is open too, of nobody (`member` 0). The compiler can't read it, so write a `cannot` story,
|
|
951
|
+
`refused` in its words, for each rule in it: the stories told say so of one that refuses nothing they tell
|
|
952
|
+
(`<app>'s trust.ts refuses nothing its stories tell`), and no more than that. Look first for a definition that
|
|
953
|
+
says it (`mine`, `unique`, `noOverlap`, `notEmpty`, `moves`, `takes`, `frozen`, `addedWith`, `within`, `apart`): the examples
|
|
954
|
+
have no `trust.ts` (Peter, 30 Nov: their rules said once, the database's on Postgres). One that truly can't be
|
|
955
|
+
declared is a trigger in each dialect's SQL, not TypeScript.
|
|
793
956
|
- **A story's words for them:** `premise` (each name's writes before it, in order; an anonymous story's, a list), `unseen` (who must not
|
|
794
957
|
see it), `refused` (the words a cannot is refused in). `tell(doc, dir)` from `joined/stories` says each.
|
|
795
958
|
- Working: the cafe's stories (`examples/cafe/stories.jsonl`) say `copies`, `totals`, `moves`, `guests`, `where`,
|
|
@@ -813,25 +976,24 @@ one:
|
|
|
813
976
|
|---|---|---|---|
|
|
814
977
|
| 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 |
|
|
815
978
|
| 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 |
|
|
816
|
-
| Thumbs | `thumbs.ts`, `
|
|
979
|
+
| Thumbs | `thumbs.ts`, `stories.jsonl` | 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); the desk's `mine` line holds a thumb to its giver, one an item (§15). | idea-cards' thumbs, cardlet's votes |
|
|
817
980
|
| 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 |
|
|
818
981
|
| 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 |
|
|
819
982
|
| 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 |
|
|
820
983
|
|
|
821
984
|
Who added an item is a field the server fills (`{"fills":{"tasks":{"by":"me"}}}`), drawn as their face. Who made the
|
|
822
|
-
last change isn't told to a view yet (the ledger's #89
|
|
823
|
-
approve) and V5 (filter by a link, a link matrix) are recipes still to add here (its step 8).
|
|
985
|
+
last change isn't told to a view yet (the ledger's #89).
|
|
824
986
|
|
|
825
987
|
Elsewhere, by what it does:
|
|
826
988
|
|
|
827
|
-
- A row changed in place and taken away: `examples/trip/stays.ts`.
|
|
989
|
+
- A row changed in place and taken away: `examples/trip/stays.ts`. An item's sheet, with a draft: the kit (§17).
|
|
828
990
|
- A form on the page that adds, its refusal said under it: `examples/people/adding.ts`, the desk's `page.ts`.
|
|
829
991
|
- What links to an item, kept as links come and go: `examples/people/links.ts`.
|
|
830
992
|
- Dragged in order by a grip, or the arrow keys: `examples/people/order.ts`.
|
|
831
|
-
-
|
|
832
|
-
|
|
993
|
+
- People as chips, and each person's answer to an item (a list of ids each): the kit's `<j-field>` (§17); the trip's
|
|
994
|
+
`answers.ts` reads them.
|
|
833
995
|
- A file on an item: `attachment()` (§4), `tests/attachments/board/page.ts`.
|
|
834
|
-
- When and where by a hand (a calendar, a map):
|
|
996
|
+
- When and where by a hand (a calendar, a map): the kit's readings (§17), as the trip's page has them.
|
|
835
997
|
|
|
836
998
|
**Shared, not copied.** What three apps repeated is joined's, imported by name, never copied (each told in
|
|
837
999
|
`tests/`, the place search by the trip's page):
|
|
@@ -848,3 +1010,94 @@ Elsewhere, by what it does:
|
|
|
848
1010
|
- `joined/ics`: `toIcs(events, name)`, each event a `uid` (the same each time: a feed's calendar changes it, not adds
|
|
849
1011
|
it again), its `zone`, `location`, `coordinates`, `description`, `url` and `attendees` where it has them; and
|
|
850
1012
|
`fromIcs(text)`. Served as `text/calendar`, it's a download or a feed (`webcal://`); the trip's `routes.ts`.
|
|
1013
|
+
|
|
1014
|
+
## 17. The kit: a page composed, not written
|
|
1015
|
+
|
|
1016
|
+
Before writing a list, a form or a search, compose them from the kit (`joined/kit`). Each part is bound to the
|
|
1017
|
+
document by a collection's name and a field's: nothing is wired by hand, and every decision a person would otherwise
|
|
1018
|
+
re-make (which control a kind of field takes, how a draft is held, where Save goes, how a sheet comes up on a phone,
|
|
1019
|
+
what search hides and how it says what it found, which icon) is already made, and tested wide and on a phone. Write a
|
|
1020
|
+
display of your own only for what the kit doesn't have (§5, §16), and let it open the kit's sheet for an item
|
|
1021
|
+
(`document.querySelector('j-sheet[for="items"]').show(item)`). A calendar, a map, a timeline or a board is the kit's:
|
|
1022
|
+
its readings, below.
|
|
1023
|
+
|
|
1024
|
+
The cafe's menu is the whole of it (`examples/cafe/menu.html`, and its `menu.ts` is four lines):
|
|
1025
|
+
|
|
1026
|
+
```html
|
|
1027
|
+
<header class="find"><j-search for="items" placeholder="Find on the menu"></j-search></header>
|
|
1028
|
+
<j-items-rows><j-items doc="menu"></j-items></j-items-rows>
|
|
1029
|
+
|
|
1030
|
+
<j-sheet for="items">
|
|
1031
|
+
<j-field name="name"></j-field>
|
|
1032
|
+
<j-field name="price" as="money" currency="GBP"></j-field>
|
|
1033
|
+
<j-field name="stock" label="Left" readonly></j-field>
|
|
1034
|
+
</j-sheet>
|
|
1035
|
+
```
|
|
1036
|
+
|
|
1037
|
+
```ts
|
|
1038
|
+
import "joined/panel";
|
|
1039
|
+
import "joined/kit";
|
|
1040
|
+
import { define } from "joined/rows";
|
|
1041
|
+
import { JItemsRows } from "./generated/menu.rows.ts";
|
|
1042
|
+
define(JItemsRows);
|
|
1043
|
+
```
|
|
1044
|
+
|
|
1045
|
+
`define()` gives the kit the compiler's collections (`specs`, in every `generated/rows.ts`); a page with no rows
|
|
1046
|
+
display gives them once: `use(specs)` from `joined/kit`.
|
|
1047
|
+
|
|
1048
|
+
| Part | What it is | Its attributes | Events |
|
|
1049
|
+
|---|---|---|---|
|
|
1050
|
+
| `<j-<collection>-rows>` (`joined/rows`) | The collection as rows: each its name and facts, money as money; pressed, its sheet opens, the row marked (`aria-current`, a stripe and a chevron); an add at the foot where the stories let this person add, asked in a modal (what it can't be without, then Add; new is never the sheet's). Only what the person `may` is offered: a cook sees rows that don't open. | (the compiler's) | hears `j-search`, tells `j-found` |
|
|
1051
|
+
| `<j-sheet for="items">` | One item's fields, as a drawer wide and a sheet on a phone (rising from the foot, a grabber, the page dimmed). A draft until Save (one write); Never mind puts it back; × closes; what's open is in the address (`#item=3`); a removal asked first; a refusal said in the story's words. Only the fields this person may replace are shown; the rest stay as they are. A page reaches what's in it by its parts, never by script into its shadow: `j-sheet::part(field-accountants)` (each field `field` and `field-<name>`), `part(label)`, `part(control)`, `part(hint)`, `part(chips)`, `part(chip chosen)` and `part(chip offered)` (each chip's person its `data-key`), `part(foot)`, `part(drawer)`. | `for` (a collection) | tells `j-open` |
|
|
1052
|
+
| `<j-field name="…">` | How one field is asked and read, in its sheet and its row, in the order written. Without any, the sheet asks every plain field, each link to one, and each list of people. | `label`, `as` (`money`, `long`), `currency` (ISO 4217: `GBP`, `JPY`), `readonly` (shown, not changed once the item exists; asked when adding), `hint` (a line under its label: "Tap to choose"), `not` (of a link: none another field holds now offered, `not="owners"`, unless already chosen; it follows the form as it's changed) | |
|
|
1053
|
+
| `<j-search for="items">` | A field at the head of what it finds in, a magnifier at its start, × to clear (or Escape). Each letter hides the rows without every word, and it says "3 of 12". The page's alone: kept in the address (`?q=latte`), so a reload or a link keeps it. `folded`: the magnifier alone, for a bar, opening as it's tapped. | `for`, `placeholder`, `folded`, `param` (`q`) | tells `j-search`, hears `j-found` |
|
|
1054
|
+
|
|
1055
|
+
The control a field gets is its kind's (`src/fields.ts`), never chosen again:
|
|
1056
|
+
|
|
1057
|
+
| Kind (§2) | Control | Kept as |
|
|
1058
|
+
|---|---|---|
|
|
1059
|
+
| text | a box; `as="long"`, a textarea | as typed |
|
|
1060
|
+
| integer, decimal | a number box | a number |
|
|
1061
|
+
| integer, `as="money"` | a number box in the currency's units, its label "Price, £", the row "Price £3.60" | minor units (360) |
|
|
1062
|
+
| boolean | a tick, its label beside it | true / false |
|
|
1063
|
+
| date-time | the browser's date and time | a wall clock, `2026-11-15T10:30:00` |
|
|
1064
|
+
| duration | a box read as people say it, "2h 30m", "1.5h", its fault said ("A length, such as 45m or 2h 30m") and Save stopped | ISO 8601, `PT2H30M` |
|
|
1065
|
+
| zone | a box offering the zones as a city is typed | `Europe/London` |
|
|
1066
|
+
| place | a box finding the place by its name (Photon), the point shown, × for none | `geo:lat,lon` |
|
|
1067
|
+
| a link to one | a choice of six or fewer; a typeahead past six | its id |
|
|
1068
|
+
| a list of people (`ids`, to members) | a chip for each, pressed or not, a finger tall | the ids |
|
|
1069
|
+
|
|
1070
|
+
**The readings: the ways in.** A page opens on what its data is: things in time on a week, things in places on a map,
|
|
1071
|
+
things that move through steps on a board; a list is one reading of several, not the page. Each is bound like the
|
|
1072
|
+
rest, holds nothing (it finds the collection's items wherever they are on the page), shows only what the page's search
|
|
1073
|
+
finds, and opens the same `<j-sheet>`; each gesture is a write the item's `may` offers, refused in the story's words
|
|
1074
|
+
and put back. `<j-views>` holds several, a tab each, one shown, kept in `?view=`:
|
|
1075
|
+
|
|
1076
|
+
```html
|
|
1077
|
+
<j-search for="plans"></j-search>
|
|
1078
|
+
<j-views>
|
|
1079
|
+
<j-plans-rows label="List"><j-plans></j-plans></j-plans-rows>
|
|
1080
|
+
<j-week for="plans"></j-week>
|
|
1081
|
+
<j-month for="plans"></j-month>
|
|
1082
|
+
<j-timeline for="plans" lane="who"></j-timeline>
|
|
1083
|
+
<j-map for="plans"></j-map>
|
|
1084
|
+
<j-board for="plans" by="done"></j-board>
|
|
1085
|
+
</j-views>
|
|
1086
|
+
```
|
|
1087
|
+
|
|
1088
|
+
| Reading | Reads | What a person does there | Its attributes |
|
|
1089
|
+
|---|---|---|---|
|
|
1090
|
+
| `<j-week>` | a date-time, and a duration (an hour where none) | each item a block at its time, those at once side by side, now a line; a block tapped opens it, dragged it moves by quarter hours and to another day, its foot makes it longer; an empty hour tapped adds one there (asked in a modal, offered that day and hour: new is never the sheet's). On a phone, a day at a time, the week a strip of days above. | `when`, `length`, `from` and `until` (the hours, 8 and 20, grown to hold what's there) |
|
|
1091
|
+
| `<j-month>` | a date-time | each day its items, each its time and words; a day tapped is marked and its items listed under the month, with Add on that day; an item dragged to another day keeps its hour. On a phone, a mark on each day. | `when` |
|
|
1092
|
+
| `<j-timeline>` | a date-time and a duration | a Gantt: a lane for each value of `lane` (each person of a list of people, each item a link is to, yes or no, each word, and none), or each item its own row; bars at once stacked; dragged, moved, by its end longer; hours where everything lasts under a day, else days; scrolls sideways, its lanes' names staying. | `when`, `length`, `lane`, `scale` (`hour`, `day`) |
|
|
1093
|
+
| `<j-map>` | a place (`geo:`) | a pin each, fitted to them all until it's moved; dragged it pans, nearer and farther by its buttons, a pinch or a trackpad's; a pin tapped is peeked at the map's foot, then Open (its sheet) or Open in Maps; a pin held and dragged moves its place. | `at`, `when` (said in the peek) |
|
|
1094
|
+
| `<j-board>` | a field: yes or no, a link to one, a field that moves, or words | a lane for each value (`lanes="idea,booked,done"` names them and their order), a card each, its count; a card dragged to another lane is moved there where it may go (a field that moves, only to the steps its `may` offers); Add at each lane's foot. On a phone, lanes to swipe between. | `by`, `lanes` |
|
|
1095
|
+
| `<j-views>` | the readings in it | a tab each, its icon and its word (`label`, or the reading's own), the one chosen shown | `param` (`view`) |
|
|
1096
|
+
|
|
1097
|
+
Each reading opens on the day the address says (`?day=2026-11-15`), else today where something's on or after it, else
|
|
1098
|
+
the last day something was. A reading's attribute names a field (`when="start"`); left out, it's the first of its type.
|
|
1099
|
+
|
|
1100
|
+
Its look is joined's (`parts.css`, the tokens), light and dark, every control a finger tall on a phone; an app's
|
|
1101
|
+
stylesheet places the parts (`main.menu .card > .find`), never restyles them. `tests/kit.test.ts` and `tests/readings.test.ts` are each part, as
|
|
1102
|
+
a person uses it, wide and on a phone; `bun run look cafe`, and `JOINED_APPS=$PWD/tests/kit bun run look plans`, draw
|
|
1103
|
+
each state.
|