@protobase/cli 0.94.9 → 0.94.11
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.94.
|
|
3
|
+
"version": "0.94.11",
|
|
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.
|
|
47
|
-
"@protobase/layout": "0.94.
|
|
48
|
-
"@protobase/query": "0.94.
|
|
49
|
-
"@protobase/schema": "0.94.
|
|
50
|
-
"@protobase/server": "0.94.
|
|
51
|
-
"@protobase/ui": "0.94.
|
|
52
|
-
"@protobase/workflows": "0.94.
|
|
46
|
+
"@protobase/config": "0.94.11",
|
|
47
|
+
"@protobase/layout": "0.94.11",
|
|
48
|
+
"@protobase/query": "0.94.11",
|
|
49
|
+
"@protobase/schema": "0.94.11",
|
|
50
|
+
"@protobase/server": "0.94.11",
|
|
51
|
+
"@protobase/ui": "0.94.11",
|
|
52
|
+
"@protobase/workflows": "0.94.11",
|
|
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",
|
|
@@ -19,6 +19,7 @@ The page of one record, with its sections, related records, galleries, charts an
|
|
|
19
19
|
- [Save feedback](../reference/ui-config.md#the-record-page): A view shows saving on the Save button instead of in a toast.
|
|
20
20
|
- [Save conflicts](../reference/ui-config.md#editing-a-record): When someone else changed a record while you edited it, Save shows their value beside yours for each field you both changed, and you keep yours or take theirs.
|
|
21
21
|
- [Groups and tabs](../reference/ui-config.md#groups): Parts of a record page sit under headings that open on click, or in tabs, and the open ones are kept in the address.
|
|
22
|
+
- [Read-only values and a title badge](../reference/ui-config.md#read-only-values-and-a-title-badge) (experimental): Read-only fields show as values, and one field can show as a badge beside the title.
|
|
22
23
|
- [Key facts](../reference/ui-config.md#key-facts): A section shows its values side by side with icons.
|
|
23
24
|
- [Confirming a change](../reference/ui-config.md#confirming-a-change): A field that is easy to set by mistake asks a question before a person changes it in a form or a list cell, and Cancel keeps its value.
|
|
24
25
|
- [Fields only once a record exists](../reference/ui-config.md#names-and-columns): A view leaves a field off the create form, such as a choice among records added after it, and the record page shows it as usual.
|
|
@@ -26,6 +27,7 @@ The page of one record, with its sections, related records, galleries, charts an
|
|
|
26
27
|
- [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
28
|
- [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
29
|
- [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.
|
|
30
|
+
- [Compact related cards](../reference/ui-config.md#compact-related-cards) (experimental): Related records can show as compact cards, coloured by a field.
|
|
29
31
|
- [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
32
|
- [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
33
|
- [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
|
|
|
@@ -670,7 +670,7 @@ export const repairsView = filtered
|
|
|
670
670
|
|
|
671
671
|
A custom component draws only its part: the page around it stays the record page, at `/<resource>/<key>`, with its breadcrumbs, Save, the action rail with Edit and Delete, and the related records, and a layout may hold only custom components. The repairs above list the customer's earlier repairs under the bike:
|
|
672
672
|
|
|
673
|
-
Without a layout the record page shows one section with every field the user may change; its [read view](#read-view-and-edit), which is what a user who may change none gets, shows every field. A section or sidebar card with no field the user may see is left out. On a wide screen the sidebar cards stay in view beside the main column as the page scrolls, below the top bar. The record's title is the page's heading, above the sections, with an enum `status` as a badge beside it unless the sidebar shows it already. `.saveFeedback('button')` shows saving on the Save button instead of a toast (`'toast'`, the default). A [sensitive field](data-config.md#sensitive-fields) in a section is masked, with an eye button that reveals it. A [write-only field](access.md#write-only-fields) is on the form only where a section names it, never in the section without a layout, and shows as an empty input to set a new value in.
|
|
673
|
+
Without a layout the record page shows one section with every field the user may change; its [read view](#read-view-and-edit), which is what a user who may change none gets, shows every field. A section or sidebar card with no field the user may see is left out. On a wide screen the sidebar cards stay in view beside the main column as the page scrolls, below the top bar. The record's title is the page's heading, above the sections, with an enum `status` as a badge beside it unless the sidebar shows it already, or the field [`.titleBadge(...)`](#read-only-values-and-a-title-badge) names. `.saveFeedback('button')` shows saving on the Save button instead of a toast (`'toast'`, the default). A [sensitive field](data-config.md#sensitive-fields) in a section is masked, with an eye button that reveals it. A [write-only field](access.md#write-only-fields) is on the form only where a section names it, never in the section without a layout, and shows as an empty input to set a new value in.
|
|
674
674
|
|
|
675
675
|
A record opened from a list, by its row or its card, shows the fields the list loaded at once, with placeholders for the others, and takes input once the whole record has loaded; actions, custom components, maps and galleries wait for it. What the page shows is read again whenever the browser tab or window regains focus, as are the lists, unless the record has unsaved changes, which keep the version they were made to.
|
|
676
676
|
|
|
@@ -682,6 +682,24 @@ The record page sits in a centred column about 1100px wide. `.recordWidth('full'
|
|
|
682
682
|
view<typeof objectives>('objectives').recordWidth('full')
|
|
683
683
|
```
|
|
684
684
|
|
|
685
|
+
### Read-only values and a title badge
|
|
686
|
+
|
|
687
|
+
:::caution[Experimental]
|
|
688
|
+
How read-only values and the title badge look may change in any release.
|
|
689
|
+
:::
|
|
690
|
+
|
|
691
|
+
On the form, a field nobody may change there, such as a `.readOnly()` field or one the user may only read, shows as its value rather than a greyed input, as the read view shows it: at full text contrast, an enum or a field with `.format('badge')` as a badge in the view's `valueLabels` and `valueColors`, a timestamp with `.format('relative')` as "3 hours ago" with the exact time on hover, and a missing value as a dash that screen readers read as "No value". Its label is text rather than a form label, since there is no control for it to name.
|
|
692
|
+
|
|
693
|
+
<gap>A relative time on an open record page cannot count up by itself because refreshing it on a timer is not implemented; it updates when the record loads again, such as when the tab regains focus.</gap>
|
|
694
|
+
|
|
695
|
+
`.titleBadge(...)` shows one field as a badge beside the record's title, in its `valueLabels` and `valueColors`, such as an objective's verdict, in place of the enum `status` the page shows there otherwise. It shows even when the sidebar lists the field, changes as the record does, and is left out while the field has no value or for a reader who cannot read it. `.titleBadge(...)` throws when the field does not exist, or is neither an enum nor shown with `.format('badge')`, so a long text never fills the header.
|
|
696
|
+
|
|
697
|
+
```ts
|
|
698
|
+
view<typeof objectives>('objectives')
|
|
699
|
+
.fields((r) => ({ verdict: r.verdict.label('Verdict').valueColors({ moving: 'green', stuck: 'red' }) }))
|
|
700
|
+
.titleBadge((r) => r.verdict)
|
|
701
|
+
```
|
|
702
|
+
|
|
685
703
|
### A record page that opens another
|
|
686
704
|
|
|
687
705
|
`.recordOpens(to)` sends a record's page to another address in its place, its `{field}`s, in the resource, the key and `run`, filled from the record, replacing the record's address in the history so Back skips it: a workflow run's page opens its workflow's page with the run on the graph. A caller who cannot follow it, such as one who may not read the resource it names or open the page it names, gets the record's own page. The record's own page stays at its address with `?standard=true`.
|
|
@@ -952,9 +970,11 @@ Without any configuration, the record page's rail has a **Related records** card
|
|
|
952
970
|
| `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
971
|
| `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
972
|
| `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'`. |
|
|
973
|
+
| `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. |
|
|
974
|
+
| `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). |
|
|
975
|
+
| `actions` | Named actions of `resource`'s view, by name, as buttons on each card; only with `presentation: 'cards'` or `'compact'`. |
|
|
976
|
+
| `time` | A date or timestamp field of `resource` each compact card shows beside its title, as its view formats it; only with `presentation: 'compact'`. |
|
|
977
|
+
| `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
978
|
| `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
979
|
| `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
980
|
| `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 +1051,30 @@ l.related('Waiting on you', {
|
|
|
1031
1051
|
|
|
1032
1052
|
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
1053
|
|
|
1054
|
+
#### Compact related cards
|
|
1055
|
+
|
|
1056
|
+
:::caution[Experimental]
|
|
1057
|
+
Compact cards may change in any release. Their `time` and `tone` are fields of the listed resource itself.
|
|
1058
|
+
:::
|
|
1059
|
+
|
|
1060
|
+
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.
|
|
1061
|
+
|
|
1062
|
+
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.
|
|
1063
|
+
|
|
1064
|
+
```ts
|
|
1065
|
+
l.related('Holding it up', {
|
|
1066
|
+
resource: 'objective_causes',
|
|
1067
|
+
field: 'objective_id',
|
|
1068
|
+
presentation: 'compact',
|
|
1069
|
+
time: 'since',
|
|
1070
|
+
tone: 'state',
|
|
1071
|
+
columns: ['owner', 'tasks'],
|
|
1072
|
+
actions: ['clear'],
|
|
1073
|
+
})
|
|
1074
|
+
```
|
|
1075
|
+
|
|
1076
|
+
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>
|
|
1077
|
+
|
|
1034
1078
|
#### A related record in full
|
|
1035
1079
|
|
|
1036
1080
|
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.
|