@protobase/cli 0.25.5 → 0.25.6
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/dist/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.6",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@hono/node-server": "^2.1.3",
|
|
37
37
|
"@hono/vite-dev-server": "^0.26.1",
|
|
38
|
-
"@protobase/layout": "0.25.
|
|
39
|
-
"@protobase/query": "0.25.
|
|
40
|
-
"@protobase/schema": "0.25.
|
|
41
|
-
"@protobase/server": "0.25.
|
|
42
|
-
"@protobase/ui": "0.25.
|
|
38
|
+
"@protobase/layout": "0.25.6",
|
|
39
|
+
"@protobase/query": "0.25.6",
|
|
40
|
+
"@protobase/schema": "0.25.6",
|
|
41
|
+
"@protobase/server": "0.25.6",
|
|
42
|
+
"@protobase/ui": "0.25.6",
|
|
43
43
|
"@react-email/render": "^2.1.0",
|
|
44
44
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
45
45
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -600,7 +600,7 @@ export const repairsView = filtered
|
|
|
600
600
|
| `l.group(title, items, { collapsed?, when? })` | A heading over sections and related tables, closed until opened with `collapsed: true`. `when` also takes a [condition](#form-and-read-view). See [Groups](#groups). |
|
|
601
601
|
| `l.tab(title, items)` | A tab holding main-column items; a view's tabs show as one strip on the read view and the form. See [Tabs](#tabs). |
|
|
602
602
|
| `l.sidebar(fields, { when? })` | A summary card beside it, read-only. `when` also takes a [condition](#form-and-read-view). |
|
|
603
|
-
| `l.related(title, { ... })` | A table of the records of another resource that point at this one, in the main column. See [Related records](#related-records). |
|
|
603
|
+
| `l.related(title, { ... })` | A table or cards of the records of another resource that point at this one, in the main column. See [Related records](#related-records). |
|
|
604
604
|
| `l.custom(Component, { title?, props?, sidebar?, when? })` | A [custom component](custom-components.md#record-sections)) where it is listed: in the main column under `title`, or with `sidebar: true` as a sidebar card. |
|
|
605
605
|
| `l.map(title, { latitude, longitude, zoom?, sidebar?, when? })` | A map with a pin at the record's position, in the main column or with `sidebar: true` as a sidebar card. See [Maps](#maps). |
|
|
606
606
|
| `l.gallery(title, { image?, photos?, when? })` | The record's photos as tiles, opening a lightbox. See [Galleries](#galleries). |
|
|
@@ -800,10 +800,12 @@ Without any configuration, the record page's rail has a **Related records** card
|
|
|
800
800
|
| `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. |
|
|
801
801
|
| `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) pick the listed records. All of them are read. |
|
|
802
802
|
| `filter`, `sort` | AIP-160 and AIP-132 on `resource`, as in the list API. `filter` narrows the listed records, `through.filter` the join records. |
|
|
803
|
-
| `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. |
|
|
803
|
+
| `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. |
|
|
804
|
+
| `presentation` | `'cards'` shows the records as [cards](#related-records-as-cards) instead of the table or display. |
|
|
805
|
+
| `actions` | Named actions of `resource`'s view, by name, as buttons on each card; only with `presentation: 'cards'`. |
|
|
804
806
|
| `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. |
|
|
805
807
|
| `limit` | How many records it shows, 1 to 100; default 10. 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. |
|
|
806
|
-
| `display` | The display of `resource`'s list it opens in, such as `cards`; default the list's. |
|
|
808
|
+
| `display` | The display of `resource`'s list it opens in, and View all opens, such as `cards`; default the list's. |
|
|
807
809
|
| `help`, `empty` | A line under the title, and the text when nothing matches (default "Nothing here yet."). |
|
|
808
810
|
| `hideEmpty` | `true` leaves the section off the page while it has no records. |
|
|
809
811
|
|
|
@@ -857,6 +859,24 @@ When `resource` is ordered by hand within the record on the page (`.position(...
|
|
|
857
859
|
|
|
858
860
|
Every name is checked when the config loads. In `/meta` a caller who cannot read a resource the section names, or a field its filter or sort uses, does not get the section, and columns they cannot read are left out; the rows come from the list API with the caller's token, so row filters apply as everywhere else.
|
|
859
861
|
|
|
862
|
+
#### Related records as cards
|
|
863
|
+
|
|
864
|
+
With `presentation: 'cards'` the section shows each record as a card, the cards stacked full width so a long value has room: the record's title, a link to its page, then each of `columns` under its label as the record page shows it (a markdown field rendered, a relation by its name), and a button for each of `actions`. A value taller than a few lines is cut short with **Show more**, which shows it all. The buttons run the actions as the record page does: one with `confirm` asks first, one with [inputs](#actions-that-ask-for-input) opens its dialog (a sheet on a phone), and an `a.action` runs the app's handler; a card leaves out an action the user does not get and disables one they cannot run on that record. After an action the section loads again, so a record it no longer matches leaves it, and with `hideEmpty` the section goes once nothing matches.
|
|
865
|
+
|
|
866
|
+
```ts
|
|
867
|
+
l.related('Waiting on you', {
|
|
868
|
+
resource: 'task_preconditions',
|
|
869
|
+
field: 'task_id',
|
|
870
|
+
filter: 'state = "waiting"',
|
|
871
|
+
presentation: 'cards',
|
|
872
|
+
columns: ['plan'],
|
|
873
|
+
actions: ['approve', 'request_changes'],
|
|
874
|
+
hideEmpty: true,
|
|
875
|
+
})
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
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.
|
|
879
|
+
|
|
860
880
|
## Actions and views per role
|
|
861
881
|
|
|
862
882
|
```ts title="docs-examples/bike-shop/step-5.ts"
|