@protobase/cli 0.94.9 → 0.94.10

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.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.94.9";
2
+ var version = "0.94.10";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.94.9",
3
+ "version": "0.94.10",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,13 +43,13 @@
43
43
  "dependencies": {
44
44
  "@better-auth/core": "^1.7.12",
45
45
  "@hono/node-server": "^2.1.3",
46
- "@protobase/config": "0.94.9",
47
- "@protobase/layout": "0.94.9",
48
- "@protobase/query": "0.94.9",
49
- "@protobase/schema": "0.94.9",
50
- "@protobase/server": "0.94.9",
51
- "@protobase/ui": "0.94.9",
52
- "@protobase/workflows": "0.94.9",
46
+ "@protobase/config": "0.94.10",
47
+ "@protobase/layout": "0.94.10",
48
+ "@protobase/query": "0.94.10",
49
+ "@protobase/schema": "0.94.10",
50
+ "@protobase/server": "0.94.10",
51
+ "@protobase/ui": "0.94.10",
52
+ "@protobase/workflows": "0.94.10",
53
53
  "@react-email/render": "^2.1.0",
54
54
  "@scalar/hono-api-reference": "^0.12.10",
55
55
  "@sentry/vite-plugin": "^11.10.0",
@@ -26,6 +26,7 @@ The page of one record, with its sections, related records, galleries, charts an
26
26
  - [Conditional sections](../reference/ui-config.md#form-and-read-view): Sections and fields show only while editing, only while reading, or only when a condition on the record holds.
27
27
  - [Galleries](../reference/ui-config.md#galleries): A record's photos show as tiles that open a full-screen lightbox, with keyboard and swipe navigation.
28
28
  - [Related records](../reference/ui-config.md#related-records): Every record page shows how many records point at it, and can list related records, also through a join resource, as a table, another display or cards with buttons, each row or card with a button to an address its fields name.
29
+ - [Compact related cards](../reference/ui-config.md#compact-related-cards) (experimental): Related records can show as compact cards, coloured by a field.
29
30
  - [A related record in full](../reference/ui-config.md#a-related-record-in-full): A related record can show its fields in full, without a card, for reading tabs such as notes.
30
31
  - [Record lines](../reference/ui-config.md#record-lines): The related table a record's view marks as its lines, such as an invoice's, shows all of them on its page, where you edit, add, remove and reorder them, and Save writes the record and its lines together.
31
32
  - [Custom section fallbacks](../reference/custom-components.md#record-section-fallbacks) (experimental): Where your own component on a record page cannot be drawn, such as on a watch, what you declare shows in its place: any main-column item in the main column, conversations included, and sidebar maps and sidebar custom components in the sidebar.
@@ -119,7 +119,7 @@ An enum's value labels show everywhere the admin shows its values: badges, selec
119
119
 
120
120
  An enum value's badge takes the tone or colour its view gives it, and a money field shows in the ISO 4217 currency its view names. Nothing is read from the names of values or fields: a value the view gives no tone is `neutral`, and a decimal without a currency is a number.
121
121
 
122
- `.valueColors(...)` gives each value one of the badge tones, `neutral`, `blue`, `green`, `amber`, `red` or `violet`, or a hex colour that fills the badge. The tone shows on the value's badges in lists, boards and the record page, in the record page's heading and in a list's [related dots](#related-records-in-a-list); a hex colour colours a chart's group too. Anything else throws when the view is built.
122
+ `.valueColors(...)` gives each value one of the badge tones, `neutral`, `blue`, `green`, `amber`, `red` or `violet`, or a hex colour that fills the badge. The tone shows on the value's badges in lists, boards and the record page, in the record page's heading and in a list's [related dots](#related-records-in-a-list) and on the edge of [related cards](#compact-related-cards); a hex colour colours a chart's group too. Anything else throws when the view is built.
123
123
 
124
124
  `.currency('EUR')` on a decimal field makes the list show it as money in that currency, with the currency's sign and grouping for the language, in the table and in its range filter. A currency on another field type stops the server at startup, as does `.format('signed')` on a field that is not an integer.
125
125
 
@@ -952,9 +952,11 @@ Without any configuration, the record page's rail has a **Related records** card
952
952
  | `from` | A field of this record whose value `field` must hold, instead of this record's key, such as the task of a question, to list the task's links: `{ resource: 'task_links', field: 'task_id', from: 'task_id' }`. Same type as `field` (a relation to the same resource), not sensitive, and not with `through`. A record with no value lists nothing. |
953
953
  | `through` | `{ resource, field, key?, filter? }`: the join records whose `field` (a filterable relation) holds this record's key; their `key` values (default their primary key, filterable, and pointing at one resource with `field`) pick the listed records, in one read with [`related()`](api.md#filtering-through-related-records), so an index must serve `key` too. |
954
954
  | `filter`, `sort` | AIP-160 and AIP-132 on `resource`, as in the list API. `filter` narrows the listed records, `through.filter` the join records. |
955
- | `columns` | Fields of `resource`, through relations too (`unit_id.property_id`); default the view's list columns without `field`. The first links to the record a row opens. With `presentation: 'cards'`, the fields each card shows; with `presentation: 'record'`, the fields of the record it shows. |
956
- | `presentation` | `'cards'` shows the records as [cards](#related-records-as-cards) instead of the table or display; `'record'` shows [one record in full](#a-related-record-in-full). |
957
- | `actions` | Named actions of `resource`'s view, by name, as buttons on each card; only with `presentation: 'cards'`. |
955
+ | `columns` | Fields of `resource`, through relations too (`unit_id.property_id`); default the view's list columns without `field`. The first links to the record a row opens. With `presentation: 'cards'` or `'compact'`, the fields each card shows; with `presentation: 'record'`, the fields of the record it shows. |
956
+ | `presentation` | `'cards'` shows the records as [cards](#related-records-as-cards) instead of the table or display; `'compact'` as [compact cards](#compact-related-cards) of a line or two; `'record'` shows [one record in full](#a-related-record-in-full). |
957
+ | `actions` | Named actions of `resource`'s view, by name, as buttons on each card; only with `presentation: 'cards'` or `'compact'`. |
958
+ | `time` | A date or timestamp field of `resource` each compact card shows beside its title, as its view formats it; only with `presentation: 'compact'`. |
959
+ | `tone` | An enum field of `resource` whose value colours each card's left edge, by its view's [`valueColors`](#value-tones-and-currencies); only with `presentation: 'cards'` or `'compact'`. |
958
960
  | `button` | `{ label, to }`: a [button on each row](blocks.md#row-buttons), or each card, to an address the row's fields name, such as `{ label: '{verb}', to: { kind: 'record', resource: 'tasks', key: '{task_id}', tab: 'Review' } }`; a row without a value for a field it names shows none. Not with `lines`. |
959
961
  | `open` | The relation of `resource` whose record a row opens, for rows that link this record to another. By default the one relation in `resource`'s primary key besides `field`, when there is exactly one (a join resource such as `task_dependencies` keyed on `[task_id, type, depends_on_id]`); otherwise rows open their own records. The row's menu then has **Open** for the other record and **Edit** for the link itself. |
960
962
  | `limit` | How many records it shows, 1 to 100; default 10. Not with `presentation: 'record'`. When there are more, the section says so beside View all, such as "The first 10 of 37.". Before 0.13 this was `pageSize`, rows per page; rename it. |
@@ -1031,6 +1033,30 @@ l.related('Waiting on you', {
1031
1033
 
1032
1034
  An action that `actions` names must be a named action of `resource`'s view. The cards have no display switch or **Reorder**; View all opens the list as a table section would.
1033
1035
 
1036
+ #### Compact related cards
1037
+
1038
+ :::caution[Experimental]
1039
+ Compact cards may change in any release. Their `time` and `tone` are fields of the listed resource itself.
1040
+ :::
1041
+
1042
+ With `presentation: 'compact'` each card takes a line or two, for a short list where every record needs a glance and an act, such as the causes holding an objective up. The first line holds the record's title, a link to its page, and its `time` at the end of the line; the second holds `columns` side by side without their labels, a dot between them, leaving out a field the record has no value for. The buttons of `actions` and `button` sit beside both lines, or beside the second where the card is narrow, such as on a phone, with the title on a line of its own. The buttons work as on [cards](#related-records-as-cards), and so does View all.
1043
+
1044
+ With `tone`, each card's left edge takes the colour its value has in the view's `valueColors`, a tone or a hex colour as its badge does, and the value's badge shows first among the card's values, unless `columns` places it elsewhere, so the colour is never all that says it. An action that changes the value changes the edge as the section loads again. `tone` works on `presentation: 'cards'` too.
1045
+
1046
+ ```ts
1047
+ l.related('Holding it up', {
1048
+ resource: 'objective_causes',
1049
+ field: 'objective_id',
1050
+ presentation: 'compact',
1051
+ time: 'since',
1052
+ tone: 'state',
1053
+ columns: ['owner', 'tasks'],
1054
+ actions: ['clear'],
1055
+ })
1056
+ ```
1057
+
1058
+ A `time` or `tone` field the caller cannot read is left out of their cards. <gap>A compact card cannot take its `time` or `tone` through a relation, such as `task_id.updated_at`, because reading them through one is not implemented.</gap>
1059
+
1034
1060
  #### A related record in full
1035
1061
 
1036
1062
  With `presentation: 'record'` the section shows one related record as part of the page, for a tab meant for reading, such as an objective's notes kept in a record of their own: no card, no title of the record, nothing cut short with **Show more**, and no View all while there is only the one record. It shows the first record in `sort` order, each of `columns` in full as the record page shows it (a markdown field rendered), leaving out a field the record has no value for. On the heading's line, a link **Open** and the singular name of `resource`'s view, such as **Open note**, goes to the record's own page, with `button` before it. When more records match, View all under the record opens them all in the list, so a section such as the latest review does not hide the older ones. With one column the value stands alone, without its label; with several each is under its label. Without a record it shows `empty`, or with `hideEmpty` nothing. A change to the record shows as soon as the page hears of it, as in every related section of a [live](live.md) resource.