@protobase/cli 0.65.1 → 0.66.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/dist/cli/package.js
CHANGED
package/dist/dev/app-server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.1",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@better-auth/core": "^1.7.12",
|
|
44
44
|
"@hono/node-server": "^2.1.3",
|
|
45
|
-
"@protobase/config": "0.
|
|
46
|
-
"@protobase/layout": "0.
|
|
47
|
-
"@protobase/query": "0.
|
|
48
|
-
"@protobase/schema": "0.
|
|
49
|
-
"@protobase/server": "0.
|
|
50
|
-
"@protobase/ui": "0.
|
|
45
|
+
"@protobase/config": "0.66.1",
|
|
46
|
+
"@protobase/layout": "0.66.1",
|
|
47
|
+
"@protobase/query": "0.66.1",
|
|
48
|
+
"@protobase/schema": "0.66.1",
|
|
49
|
+
"@protobase/server": "0.66.1",
|
|
50
|
+
"@protobase/ui": "0.66.1",
|
|
51
51
|
"@react-email/render": "^2.1.0",
|
|
52
52
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
53
53
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -20,7 +20,7 @@ The page of one record, with its sections, related records, galleries, charts an
|
|
|
20
20
|
- [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.
|
|
21
21
|
- [Galleries](../reference/ui-config.md#galleries): A record's photos show as tiles that open a full-screen lightbox, with keyboard and swipe navigation.
|
|
22
22
|
- [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.
|
|
23
|
-
- [Record lines](../reference/ui-config.md#record-lines):
|
|
23
|
+
- [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.
|
|
24
24
|
- [Charts of samples](../reference/ui-config.md#charts-of-related-records): A record page graphs numeric samples over the last hour, day or week, such as a server's CPU use.
|
|
25
25
|
- [Fresh data on return](../reference/ui-config.md#the-record-page): Records and lists reload when the browser tab is focused again, keeping unsaved edits.
|
|
26
26
|
- [Safe deletes](../reference/ui-config.md#deleting-a-record): Deleting asks first, or offers Undo for a soft delete, offers a review when the record changed since it was opened, and names the records that still point at it.
|
|
@@ -795,7 +795,16 @@ The record's form and the create form edit each field as its type asks, under it
|
|
|
795
795
|
|
|
796
796
|
### Record lines
|
|
797
797
|
|
|
798
|
-
A record with numbered lines, such as an invoice, shows all of them on its page as one table, without paging. The lines are the
|
|
798
|
+
A record with numbered lines, such as an invoice, shows all of them on its page as one table, without paging. The lines are the related table the record's view marks with `lines: true`, where the layout lists it: the records of `resource` whose `field` holds the record's key, ordered by hand within the record, so `resource` names `field` as the `within` of its [`.position()`](#reordering-by-hand).
|
|
799
|
+
|
|
800
|
+
```ts
|
|
801
|
+
view<typeof invoices>('invoices').layout((r) => [
|
|
802
|
+
l.section('Billing details', [r.company_id, r.issued_at]),
|
|
803
|
+
l.related('Lines', { resource: 'invoice_lines', field: 'invoice_id', lines: true, help: 'What the invoice bills for.' }),
|
|
804
|
+
])
|
|
805
|
+
```
|
|
806
|
+
|
|
807
|
+
The table's columns are the lines' list columns (`.list({ columns })` of their view, or their first fields), without the line's key, its tenant, the relation to the record and the position field, which is the order of the rows. Beside `resource`, `field` and `lines`, the section takes only `help` and `when`, since the table shows every line, and a view has one section of lines; both are checked when the config loads.
|
|
799
808
|
|
|
800
809
|
On the record's form the lines are edited in place, each field with the form's own editor and a relation with its picker. **Add line** adds an empty line at the end, which gets the record's key and the place after the last line when saved, and the database's defaults fill what is left empty. **Remove line**, in a line's menu, removes it, and the drag handle or **Move up** and **Move down** change the order, as in [Reordering by hand](#reordering-by-hand).
|
|
801
810
|
|
|
@@ -887,7 +896,7 @@ The browser fetches the tiles, so their host must answer the app's origins with
|
|
|
887
896
|
|
|
888
897
|
### Related records
|
|
889
898
|
|
|
890
|
-
Without any configuration, the record page's rail has a **Related records** card that counts the records pointing at this one: per resource, and per relation when one resource has two, such as Orders (Customer) and Orders (Supplier), how many there are, linking to its list filtered on this record (`/orders?filter=customer_id = "7"`). It counts each filterable relation to a resource with a one-field key, so an index serves the count, and leaves out a resource's tenant, a resource the user cannot list or whose relation they cannot read,
|
|
899
|
+
Without any configuration, the record page's rail has a **Related records** card that counts the records pointing at this one: per resource, and per relation when one resource has two, such as Orders (Customer) and Orders (Supplier), how many there are, linking to its list filtered on this record (`/orders?filter=customer_id = "7"`). It counts each filterable relation to a resource with a one-field key, so an index serves the count, and leaves out a resource's tenant, a resource the user cannot list or whose relation they cannot read, and a relation an `l.related` section of the page already lists, its [lines](#record-lines) included.
|
|
891
900
|
|
|
892
901
|
`l.related(title, options)` lists the first records of `resource` that point at the record on the page, in the table or display the resource's list page uses (with its switch, and on a phone its cards in one sideways row, as a [`Table` block](blocks.md#table) shows them), and links to all of them in that list. They point at it directly, through a relation field, or through a join resource (`through`), such as the leases a tenant signed through `lease_tenants`:
|
|
893
902
|
|
|
@@ -906,6 +915,7 @@ Without any configuration, the record page's rail has a **Related records** card
|
|
|
906
915
|
| `display` | The display of `resource`'s list it opens in, and View all opens, such as `cards`; default the list's. |
|
|
907
916
|
| `help`, `empty` | A line under the title, and the text when nothing matches (default "Nothing here yet."). |
|
|
908
917
|
| `hideEmpty` | `true` leaves the section off the page while it has no records. |
|
|
918
|
+
| `lines` | `true` makes the section the record's [lines](#record-lines), edited in place with the record. |
|
|
909
919
|
|
|
910
920
|
The real estate example lists who a unit is let to (the primary tenant and co-signers of the lease that runs today) and that lease:
|
|
911
921
|
|