@protobase/cli 0.89.0 → 0.89.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.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.89.0";
2
+ var version = "0.89.1";
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.89.0",
3
+ "version": "0.89.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": {
@@ -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.89.0",
47
- "@protobase/layout": "0.89.0",
48
- "@protobase/query": "0.89.0",
49
- "@protobase/schema": "0.89.0",
50
- "@protobase/server": "0.89.0",
51
- "@protobase/ui": "0.89.0",
52
- "@protobase/workflows": "0.89.0",
46
+ "@protobase/config": "0.89.1",
47
+ "@protobase/layout": "0.89.1",
48
+ "@protobase/query": "0.89.1",
49
+ "@protobase/schema": "0.89.1",
50
+ "@protobase/server": "0.89.1",
51
+ "@protobase/ui": "0.89.1",
52
+ "@protobase/workflows": "0.89.1",
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",
@@ -13,6 +13,7 @@ Pages of your own, built from blocks in a JSX layout.
13
13
  - [Layout blocks](../reference/blocks.md#layout): Pages, responsive grids, cards and links.
14
14
  - [Full-width pages](../reference/blocks.md#page): A page fills the whole area beside the sidebar instead of a centred column, for a dashboard with many blocks.
15
15
  - [Data blocks](../reference/blocks.md#data): Counts, tables, single records, rows of cards, field values and progress bars.
16
+ - [Row buttons](../reference/blocks.md#row-buttons): A table's rows carry a button to an address their fields name, such as a task's tab, labelled by a field of the row, such as its next step.
16
17
  - [Record rows](../reference/blocks.md#recordrow): A sideways row of cards for a filter, favorites or saved searches, with a count and new-record marks.
17
18
  - [Record cards](../reference/blocks.md#recordcards): Full-width cards with fields and buttons, stacked or in a carousel.
18
19
  - [Chart block](../reference/blocks.md#chart): Counts, sums or averages by value or by date, as bars, lines or a donut, and over time split by a second field.
@@ -25,7 +25,7 @@ The page of one record, with its sections, related records, galleries, charts an
25
25
  - [Help while editing](../reference/ui-config.md#help-while-editing): Help lines meant for whoever changes a record show only on its form.
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
- - [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.
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
29
  - [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.
30
30
  - [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.
31
31
  - [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.
@@ -207,6 +207,7 @@ The first records of a list, drawn the way the resource's list page draws them:
207
207
  | --- | --- |
208
208
  | `resource`, `filter`, `sort` | Which records, in which order. `resource` is required; `sort` defaults to the list's. |
209
209
  | `columns` | Field names for the table; default the view's list columns. |
210
+ | `button` | A [button on each row](#row-buttons) to an address the row's fields name. |
210
211
  | `limit` | How many records it shows; default 10. It has no pages: the rest are in the list. Before 0.13 this was `pageSize`, rows per page; rename it. |
211
212
  | `display` | The display it opens in, such as `cards`; default the list's. |
212
213
  | `title`, `description`, `actions` | The heading. |
@@ -217,6 +218,22 @@ The first records of a list, drawn the way the resource's list page draws them:
217
218
  <Table title="Overdue invoices" resource="invoices" filter="status = 'overdue'" sort="issued_at" columns={['number', 'company_id', 'due_at', 'total']} limit={5} empty="Nothing is overdue." />
218
219
  ```
219
220
 
221
+ #### Row buttons
222
+
223
+ `button: { label, to }` adds a last column with a button on each row: a link, drawn as a button, to `to`, an [address](layouts.md#addresses) in the app, such as a record on one of its [tabs](ui-config.md#tabs). `{field}` in the address or the label is replaced by the row's value, the label's as the record page shows it (an enum value by its label), so each row can name its own next step. A row with no value for a field the button names shows no button. The button is checked when the config loads, and `/meta` gives it, on the block or the related section, to callers who can read the fields it names and follow its address, and leaves it out for the others. A [related section](ui-config.md#related-records) takes the same `button`, on its table's rows or its cards.
224
+
225
+ ```tsx
226
+ <Table
227
+ title="Waiting on you"
228
+ resource="holds"
229
+ filter="state = 'open'"
230
+ columns={['reason', 'task_id']}
231
+ button={{ label: '{verb}', to: { kind: 'record', resource: 'tasks', key: '{task_id}', tab: 'Review' } }}
232
+ />
233
+ ```
234
+
235
+ <gap>A row button cannot show when the table switches to a list display such as cards because drawing it on a display is not implemented.</gap>
236
+
220
237
  ### RecordCard
221
238
 
222
239
  One record and what is inside it: the one `recordKey` names (the key as the record's URL has it), else the first that matches `filter` in `sort` order. Its children and its heading `actions` work on that record.
@@ -953,6 +953,7 @@ Without any configuration, the record page's rail has a **Related records** card
953
953
  | `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. |
954
954
  | `presentation` | `'cards'` shows the records as [cards](#related-records-as-cards) instead of the table or display. |
955
955
  | `actions` | Named actions of `resource`'s view, by name, as buttons on each card; only with `presentation: 'cards'`. |
956
+ | `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`. |
956
957
  | `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. |
957
958
  | `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. |
958
959
  | `display` | The display of `resource`'s list it opens in, and View all opens, such as `cards`; default the list's. |
@@ -1012,7 +1013,7 @@ Every name is checked when the config loads. In `/meta` a caller who cannot read
1012
1013
 
1013
1014
  #### Related records as cards
1014
1015
 
1015
- 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), leaving out a field the record has no value for, 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.
1016
+ 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), leaving out a field the record has no value for, a button for each of `actions`, and `button` before them. 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.
1016
1017
 
1017
1018
  ```ts
1018
1019
  l.related('Waiting on you', {